From: support
Date: Mon, 2 Jan 2023 16:38:03 +0000 (+0000)
Subject: Built motion from commit dc14b02d.|2.6.27
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=37c1398e2b7eeaef97b6b9f3b9ef21ea5773de9d;p=motion2.git
Built motion from commit dc14b02d.|2.6.27
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 6ed3f45..79f3195 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-02T11:17:56.314Z",
+ "time": "2023-01-02T16:29:17.656Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 925c56b..91ab20a 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-02T11:17:56.314Z",
+ "time": "2023-01-02T16:29:17.656Z",
"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 16eba18..8b7cf4f 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 _0xda04=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xda04,0x185));var _0x4da0=function(_0x5b9a30,_0x2b3667){_0x5b9a30=_0x5b9a30-0x0;var _0x35f722=_0xda04[_0x5b9a30];return _0x35f722;};'use strict';var Sequelize=require(_0x4da0('0x0'));module[_0x4da0('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x180163){return this[_0x4da0('0x2')](_0x4da0('0x3'));}},'action':{'type':Sequelize[_0x4da0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4da0('0x5'),_0x4da0('0x6'),_0x4da0('0x7'),_0x4da0('0x8'),_0x4da0('0x9'),_0x4da0('0xa'),_0x4da0('0xb'),_0x4da0('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x4da0('0xd')},'data1':{'type':Sequelize[_0x4da0('0x4')](0x1000),'comment':_0x4da0('0xe')},'data2':{'type':Sequelize[_0x4da0('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[_0x4da0('0x4')](0x1000),'comment':_0x4da0('0xf')},'data4':{'type':Sequelize[_0x4da0('0x4')](0x1000),'comments':_0x4da0('0x10')},'data5':{'type':Sequelize[_0x4da0('0x4')](0x1000),'comments':_0x4da0('0x11')},'data6':{'type':Sequelize[_0x4da0('0x4')],'comments':_0x4da0('0x12')},'data7':{'type':Sequelize[_0x4da0('0x13')],'comments':_0x4da0('0x14')}};
\ No newline at end of file
+var _0xb9b3=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','sequelize','exports','getDataValue','contactManager','integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]'];(function(_0xe3260d,_0x26a406){var _0x226368=function(_0x318b66){while(--_0x318b66){_0xe3260d['push'](_0xe3260d['shift']());}};_0x226368(++_0x26a406);}(_0xb9b3,0x1a6));var _0x3b9b=function(_0x1efc87,_0x2774b4){_0x1efc87=_0x1efc87-0x0;var _0x29f3cd=_0xb9b3[_0x1efc87];return _0x29f3cd;};'use strict';var Sequelize=require(_0x3b9b('0x0'));module[_0x3b9b('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1cc4ec){return this[_0x3b9b('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3b9b('0x3'),_0x3b9b('0x4'),_0x3b9b('0x5'),_0x3b9b('0x6'),_0x3b9b('0x7'),'browser',_0x3b9b('0x8'),'script']],'msg':_0x3b9b('0x9')}},'comment':_0x3b9b('0x9')},'data1':{'type':Sequelize[_0x3b9b('0xa')](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[_0x3b9b('0xa')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3b9b('0xb')},'data4':{'type':Sequelize[_0x3b9b('0xa')](0x1000),'comments':_0x3b9b('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x3b9b('0xd')},'data6':{'type':Sequelize[_0x3b9b('0xa')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x3b9b('0xe')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index ce32b9c..3406dff 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 _0x6606=['destroy','stack','send','body','params','catch','Action','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x432a5e,_0xbf10bb){var _0x55f1b1=function(_0x38f346){while(--_0x38f346){_0x432a5e['push'](_0x432a5e['shift']());}};_0x55f1b1(++_0xbf10bb);}(_0x6606,0x1a5));var _0x6660=function(_0x52382a,_0x10b3e7){_0x52382a=_0x52382a-0x0;var _0x542a0d=_0x6606[_0x52382a];return _0x542a0d;};'use strict';var emlformat=require(_0x6660('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6660('0x1'));var jsonpatch=require(_0x6660('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6660('0x3'));var Mustache=require(_0x6660('0x4'));var util=require(_0x6660('0x5'));var path=require(_0x6660('0x6'));var sox=require(_0x6660('0x7'));var csv=require(_0x6660('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6660('0x9'));var _=require(_0x6660('0xa'));var squel=require(_0x6660('0xb'));var crypto=require(_0x6660('0xc'));var jsforce=require(_0x6660('0xd'));var deskjs=require(_0x6660('0xe'));var toCsv=require(_0x6660('0x8'));var querystring=require(_0x6660('0xf'));var Papa=require(_0x6660('0x10'));var Redis=require('ioredis');var authService=require(_0x6660('0x11'));var qs=require(_0x6660('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6660('0x13'));var logger=require('../../config/logger')(_0x6660('0x14'));var utils=require(_0x6660('0x15'));var config=require(_0x6660('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6660('0x17'))['db'];function respondWithStatusCode(_0x69e480,_0x1ce4dd){_0x1ce4dd=_0x1ce4dd||0xcc;return function(_0x4e5c12){if(_0x4e5c12){return _0x69e480[_0x6660('0x18')](_0x1ce4dd);}return _0x69e480[_0x6660('0x19')](_0x1ce4dd)[_0x6660('0x1a')]();};}function respondWithResult(_0x1203ba,_0x458f93){_0x458f93=_0x458f93||0xc8;return function(_0xa39399){if(_0xa39399){return _0x1203ba[_0x6660('0x19')](_0x458f93)[_0x6660('0x1b')](_0xa39399);}};}function respondWithFilteredResult(_0xb74b22,_0x1943fd){return function(_0x815f77){if(_0x815f77){var _0x522644=typeof _0x1943fd[_0x6660('0x1c')]===_0x6660('0x1d')&&typeof _0x1943fd[_0x6660('0x1e')]===_0x6660('0x1d');var _0x3332ea=_0x815f77[_0x6660('0x1f')];var _0x560055=_0x522644?0x0:_0x1943fd[_0x6660('0x1c')];var _0x2fb3eb=_0x522644?_0x815f77[_0x6660('0x1f')]:_0x1943fd[_0x6660('0x1c')]+_0x1943fd[_0x6660('0x1e')];var _0x4d0e0e;if(_0x2fb3eb>=_0x3332ea){_0x2fb3eb=_0x3332ea;_0x4d0e0e=0xc8;}else{_0x4d0e0e=0xce;}_0xb74b22[_0x6660('0x19')](_0x4d0e0e);return _0xb74b22[_0x6660('0x20')](_0x6660('0x21'),_0x560055+'-'+_0x2fb3eb+'/'+_0x3332ea)[_0x6660('0x1b')](_0x815f77);}return null;};}function patchUpdates(_0x385acb){return function(_0x1a03aa){try{jsonpatch[_0x6660('0x22')](_0x1a03aa,_0x385acb,!![]);}catch(_0x534fd4){return BPromise[_0x6660('0x23')](_0x534fd4);}return _0x1a03aa[_0x6660('0x24')]();};}function saveUpdates(_0x28010b,_0x1ccd83){return function(_0x5c43e0){if(_0x5c43e0){return _0x5c43e0[_0x6660('0x25')](_0x28010b)[_0x6660('0x26')](function(_0x2c78fb){return _0x2c78fb;});}return null;};}function removeEntity(_0x81267a,_0x411270){return function(_0x5d4e52){if(_0x5d4e52){return _0x5d4e52[_0x6660('0x27')]()[_0x6660('0x26')](function(){_0x81267a[_0x6660('0x19')](0xcc)[_0x6660('0x1a')]();});}};}function handleEntityNotFound(_0xd5bc56,_0x7bd22b){return function(_0xef9fe5){if(!_0xef9fe5){_0xd5bc56[_0x6660('0x18')](0x194);}return _0xef9fe5;};}function handleError(_0x2b1817,_0x230ad0){_0x230ad0=_0x230ad0||0x1f4;return function(_0x558b67){logger['error'](_0x558b67[_0x6660('0x28')]);if(_0x558b67['name']){delete _0x558b67['name'];}_0x2b1817['status'](_0x230ad0)[_0x6660('0x29')](_0x558b67);};}exports[_0x6660('0x25')]=function(_0xac618e,_0x5aca42){if(_0xac618e[_0x6660('0x2a')]['id']){delete _0xac618e[_0x6660('0x2a')]['id'];}return db['Action']['find']({'where':{'id':_0xac618e[_0x6660('0x2b')]['id']}})[_0x6660('0x26')](handleEntityNotFound(_0x5aca42,null))[_0x6660('0x26')](saveUpdates(_0xac618e['body'],null))['then'](respondWithResult(_0x5aca42,null))[_0x6660('0x2c')](handleError(_0x5aca42,null));};exports[_0x6660('0x27')]=function(_0x1ade56,_0x1e1f87){return db[_0x6660('0x2d')]['find']({'where':{'id':_0x1ade56[_0x6660('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1e1f87,null))[_0x6660('0x26')](removeEntity(_0x1e1f87,null))[_0x6660('0x2c')](handleError(_0x1e1f87,null));};
\ No newline at end of file
+var _0xf326=['reject','then','stack','name','send','update','body','Action','find','params','catch','destroy','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','Content-Range'];(function(_0x433ae0,_0x209a59){var _0x7b57dc=function(_0x10ad47){while(--_0x10ad47){_0x433ae0['push'](_0x433ae0['shift']());}};_0x7b57dc(++_0x209a59);}(_0xf326,0x164));var _0x6f32=function(_0x10a2ea,_0x487cf2){_0x10a2ea=_0x10a2ea-0x0;var _0x347b66=_0xf326[_0x10a2ea];return _0x347b66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f32('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f32('0x1'));var rp=require('request-promise');var moment=require(_0x6f32('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6f32('0x3'));var util=require(_0x6f32('0x4'));var path=require(_0x6f32('0x5'));var sox=require(_0x6f32('0x6'));var csv=require(_0x6f32('0x7'));var ejs=require(_0x6f32('0x8'));var fs=require('fs');var fs_extra=require(_0x6f32('0x9'));var _=require(_0x6f32('0xa'));var squel=require(_0x6f32('0xb'));var crypto=require(_0x6f32('0xc'));var jsforce=require(_0x6f32('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6f32('0x7'));var querystring=require(_0x6f32('0xe'));var Papa=require(_0x6f32('0xf'));var Redis=require(_0x6f32('0x10'));var authService=require(_0x6f32('0x11'));var qs=require(_0x6f32('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f32('0x13'));var logger=require(_0x6f32('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6f32('0x15'));var db=require(_0x6f32('0x16'))['db'];function respondWithStatusCode(_0x282c17,_0x542818){_0x542818=_0x542818||0xcc;return function(_0xcd1eb2){if(_0xcd1eb2){return _0x282c17[_0x6f32('0x17')](_0x542818);}return _0x282c17['status'](_0x542818)[_0x6f32('0x18')]();};}function respondWithResult(_0x37b304,_0x21ccd3){_0x21ccd3=_0x21ccd3||0xc8;return function(_0x438714){if(_0x438714){return _0x37b304[_0x6f32('0x19')](_0x21ccd3)[_0x6f32('0x1a')](_0x438714);}};}function respondWithFilteredResult(_0x23d2f5,_0x243c65){return function(_0x56ee1d){if(_0x56ee1d){var _0x327fdd=typeof _0x243c65['offset']==='undefined'&&typeof _0x243c65[_0x6f32('0x1b')]==='undefined';var _0x21ac15=_0x56ee1d[_0x6f32('0x1c')];var _0x50b3d2=_0x327fdd?0x0:_0x243c65[_0x6f32('0x1d')];var _0x36a614=_0x327fdd?_0x56ee1d[_0x6f32('0x1c')]:_0x243c65['offset']+_0x243c65[_0x6f32('0x1b')];var _0x253c8d;if(_0x36a614>=_0x21ac15){_0x36a614=_0x21ac15;_0x253c8d=0xc8;}else{_0x253c8d=0xce;}_0x23d2f5[_0x6f32('0x19')](_0x253c8d);return _0x23d2f5['set'](_0x6f32('0x1e'),_0x50b3d2+'-'+_0x36a614+'/'+_0x21ac15)[_0x6f32('0x1a')](_0x56ee1d);}return null;};}function patchUpdates(_0x282b60){return function(_0x4b8015){try{jsonpatch['apply'](_0x4b8015,_0x282b60,!![]);}catch(_0x5ba0af){return BPromise[_0x6f32('0x1f')](_0x5ba0af);}return _0x4b8015['save']();};}function saveUpdates(_0x571ebc,_0x54586e){return function(_0x58db42){if(_0x58db42){return _0x58db42['update'](_0x571ebc)['then'](function(_0x36ebb0){return _0x36ebb0;});}return null;};}function removeEntity(_0x312b44,_0x2cd230){return function(_0x5d6180){if(_0x5d6180){return _0x5d6180['destroy']()[_0x6f32('0x20')](function(){_0x312b44['status'](0xcc)[_0x6f32('0x18')]();});}};}function handleEntityNotFound(_0x337a9b,_0xcce170){return function(_0x4aaee1){if(!_0x4aaee1){_0x337a9b[_0x6f32('0x17')](0x194);}return _0x4aaee1;};}function handleError(_0xc823ae,_0x3fc666){_0x3fc666=_0x3fc666||0x1f4;return function(_0x581803){logger['error'](_0x581803[_0x6f32('0x21')]);if(_0x581803[_0x6f32('0x22')]){delete _0x581803[_0x6f32('0x22')];}_0xc823ae[_0x6f32('0x19')](_0x3fc666)[_0x6f32('0x23')](_0x581803);};}exports[_0x6f32('0x24')]=function(_0x5d2bc7,_0x3ee85c){if(_0x5d2bc7[_0x6f32('0x25')]['id']){delete _0x5d2bc7['body']['id'];}return db[_0x6f32('0x26')][_0x6f32('0x27')]({'where':{'id':_0x5d2bc7[_0x6f32('0x28')]['id']}})['then'](handleEntityNotFound(_0x3ee85c,null))['then'](saveUpdates(_0x5d2bc7[_0x6f32('0x25')],null))[_0x6f32('0x20')](respondWithResult(_0x3ee85c,null))[_0x6f32('0x29')](handleError(_0x3ee85c,null));};exports[_0x6f32('0x2a')]=function(_0x1bdbc2,_0x40161f){return db[_0x6f32('0x26')][_0x6f32('0x27')]({'where':{'id':_0x1bdbc2[_0x6f32('0x28')]['id']}})[_0x6f32('0x20')](handleEntityNotFound(_0x40161f,null))[_0x6f32('0x20')](removeEntity(_0x40161f,null))[_0x6f32('0x29')](handleError(_0x40161f,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index bc9ed36..650cbdd 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 _0x9c2e=['tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','Action'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9c2e,0x161));var _0xe9c2=function(_0x3f4e6a,_0x467be1){_0x3f4e6a=_0x3f4e6a-0x0;var _0x4beff8=_0x9c2e[_0x3f4e6a];return _0x4beff8;};'use strict';var _=require('lodash');var util=require(_0xe9c2('0x0'));var logger=require(_0xe9c2('0x1'))(_0xe9c2('0x2'));var moment=require(_0xe9c2('0x3'));var BPromise=require(_0xe9c2('0x4'));var rp=require(_0xe9c2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9c2('0x6'));var config=require(_0xe9c2('0x7'));var attributes=require(_0xe9c2('0x8'));module['exports']=function(_0x160096,_0x405cac){return _0x160096['define'](_0xe9c2('0x9'),attributes,{'tableName':_0xe9c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x36f9=['path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','../../config/logger','bluebird','request-promise'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x36f9,0x151));var _0x936f=function(_0x1773ad,_0x10e77f){_0x1773ad=_0x1773ad-0x0;var _0x332287=_0x36f9[_0x1773ad];return _0x332287;};'use strict';var _=require(_0x936f('0x0'));var util=require('util');var logger=require(_0x936f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x936f('0x2'));var rp=require(_0x936f('0x3'));var fs=require('fs');var path=require(_0x936f('0x4'));var rimraf=require(_0x936f('0x5'));var config=require(_0x936f('0x6'));var attributes=require(_0x936f('0x7'));module[_0x936f('0x8')]=function(_0xb18ba3,_0x1c9c87){return _0xb18ba3[_0x936f('0x9')](_0x936f('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index bfc0387..ea53862 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5b45e1,_0x3186ee){var _0x1c6f23=function(_0x20517b){while(--_0x20517b){_0x5b45e1['push'](_0x5b45e1['shift']());}};_0x1c6f23(++_0x3186ee);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x814b,0x1a2));var _0xb814=function(_0x104993,_0x3f9a6b){_0x104993=_0x104993-0x0;var _0x105a96=_0x814b[_0x104993];return _0x105a96;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 498789a..6bd961b 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 _0xdc0c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xdc0c,0x11c));var _0xcdc0=function(_0xe62ed,_0x44b6cd){_0xe62ed=_0xe62ed-0x0;var _0x3dd5cc=_0xdc0c[_0xe62ed];return _0x3dd5cc;};'use strict';var multer=require(_0xcdc0('0x0'));var util=require('util');var path=require(_0xcdc0('0x1'));var timeout=require(_0xcdc0('0x2'));var express=require(_0xcdc0('0x3'));var router=express[_0xcdc0('0x4')]();var fs_extra=require(_0xcdc0('0x5'));var auth=require(_0xcdc0('0x6'));var interaction=require(_0xcdc0('0x7'));var config=require('../../config/environment');var controller=require(_0xcdc0('0x8'));router[_0xcdc0('0x9')](_0xcdc0('0xa'),auth[_0xcdc0('0xb')](),controller[_0xcdc0('0xc')]);router[_0xcdc0('0xd')](_0xcdc0('0xa'),auth[_0xcdc0('0xb')](),controller[_0xcdc0('0xe')]);module[_0xcdc0('0xf')]=router;
\ No newline at end of file
+var _0x92df=['exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x92df,0x169));var _0xf92d=function(_0x13658f,_0x1f0961){_0x13658f=_0x13658f-0x0;var _0x1fae13=_0x92df[_0x13658f];return _0x1fae13;};'use strict';var multer=require(_0xf92d('0x0'));var util=require(_0xf92d('0x1'));var path=require(_0xf92d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf92d('0x3')]();var fs_extra=require(_0xf92d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf92d('0x5'));var config=require(_0xf92d('0x6'));var controller=require(_0xf92d('0x7'));router[_0xf92d('0x8')](_0xf92d('0x9'),auth['isAuthenticated'](),controller[_0xf92d('0xa')]);router[_0xf92d('0xb')]('/:id',auth[_0xf92d('0xc')](),controller[_0xf92d('0xd')]);module[_0xf92d('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index dbe9548..2daf6a5 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 _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x37bc16,_0x3b3585){var _0xbde296=function(_0x5d4cbf){while(--_0x5d4cbf){_0x37bc16['push'](_0x37bc16['shift']());}};_0xbde296(++_0x3b3585);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x6148ee,_0x4d2fca){_0x6148ee=_0x6148ee-0x0;var _0x5afc74=_0xf2ca[_0x6148ee];return _0x5afc74;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}};
\ No newline at end of file
+var _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x5ac75a,_0x110969){var _0x479de6=function(_0xa30b51){while(--_0xa30b51){_0x5ac75a['push'](_0x5ac75a['shift']());}};_0x479de6(++_0x110969);}(_0xb138,0x1dd));var _0x8b13=function(_0x3be8b2,_0x26c3b4){_0x3be8b2=_0x3be8b2-0x0;var _0x47672e=_0xb138[_0x3be8b2];return _0x47672e;};'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 ce1c875..bbd45d8 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 _0x3f5c=['options','AnalyticCustomReport','findAll','rows','catch','show','params','keys','length','includeAll','include','find','create','user','Reports','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','MetricId','metric','replace','function','format','orderBy','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','right_join','COUNT(%s)','MIN(%s)','UNIX_TIMESTAMP(%s)','includes','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','DESC','clone','output','web','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','fork','../../files/reports','savename','countTable','COUNT(*)','run','alias','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../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','reject','then','get','CustomReports','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','key','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge'];(function(_0xf99c03,_0x41b579){var _0x39b6ad=function(_0xc77b6b){while(--_0xc77b6b){_0xf99c03['push'](_0xf99c03['shift']());}};_0x39b6ad(++_0x41b579);}(_0x3f5c,0x64));var _0xc3f5=function(_0x45c84d,_0xb0e269){_0x45c84d=_0x45c84d-0x0;var _0x26c4c0=_0x3f5c[_0x45c84d];return _0x26c4c0;};'use strict';var emlformat=require(_0xc3f5('0x0'));var rimraf=require(_0xc3f5('0x1'));var zipdir=require(_0xc3f5('0x2'));var jsonpatch=require(_0xc3f5('0x3'));var rp=require(_0xc3f5('0x4'));var moment=require(_0xc3f5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f5('0x6'));var ejs=require(_0xc3f5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3f5('0x8'));var squel=require(_0xc3f5('0x9'));var crypto=require('crypto');var jsforce=require(_0xc3f5('0xa'));var deskjs=require(_0xc3f5('0xb'));var toCsv=require(_0xc3f5('0x6'));var querystring=require(_0xc3f5('0xc'));var Papa=require('papaparse');var Redis=require(_0xc3f5('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc3f5('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f5('0xf'));var logger=require(_0xc3f5('0x10'))(_0xc3f5('0x11'));var utils=require(_0xc3f5('0x12'));var config=require(_0xc3f5('0x13'));var licenseUtil=require(_0xc3f5('0x14'));var db=require(_0xc3f5('0x15'))['db'];var dbH=require('../../mysqldb')[_0xc3f5('0x16')];function respondWithStatusCode(_0x16858d,_0x8bad73){_0x8bad73=_0x8bad73||0xcc;return function(_0x1e9e86){if(_0x1e9e86){return _0x16858d[_0xc3f5('0x17')](_0x8bad73);}return _0x16858d['status'](_0x8bad73)[_0xc3f5('0x18')]();};}function respondWithResult(_0x37edb6,_0xa2594e){_0xa2594e=_0xa2594e||0xc8;return function(_0x5d62f9){if(_0x5d62f9){return _0x37edb6[_0xc3f5('0x19')](_0xa2594e)[_0xc3f5('0x1a')](_0x5d62f9);}};}function respondWithFilteredResult(_0x5e4d7a,_0x1635f8){return function(_0x2ac934){if(_0x2ac934){var _0x228ce7=typeof _0x1635f8[_0xc3f5('0x1b')]===_0xc3f5('0x1c')&&typeof _0x1635f8[_0xc3f5('0x1d')]===_0xc3f5('0x1c');var _0x127535=_0x2ac934[_0xc3f5('0x1e')];var _0x16e626=_0x228ce7?0x0:_0x1635f8['offset'];var _0x520aad=_0x228ce7?_0x2ac934['count']:_0x1635f8[_0xc3f5('0x1b')]+_0x1635f8['limit'];var _0x46aa82;if(_0x520aad>=_0x127535){_0x520aad=_0x127535;_0x46aa82=0xc8;}else{_0x46aa82=0xce;}_0x5e4d7a[_0xc3f5('0x19')](_0x46aa82);return _0x5e4d7a[_0xc3f5('0x1f')](_0xc3f5('0x20'),_0x16e626+'-'+_0x520aad+'/'+_0x127535)[_0xc3f5('0x1a')](_0x2ac934);}return null;};}function patchUpdates(_0x3c70fe){return function(_0x5f6a2f){try{jsonpatch[_0xc3f5('0x21')](_0x5f6a2f,_0x3c70fe,!![]);}catch(_0x15b606){return BPromise[_0xc3f5('0x22')](_0x15b606);}return _0x5f6a2f['save']();};}function saveUpdates(_0x2b2505,_0x1ebcd9){return function(_0x56e8e6){if(_0x56e8e6){return _0x56e8e6['update'](_0x2b2505)[_0xc3f5('0x23')](function(_0x47a36e){return _0x47a36e;});}return null;};}function removeEntity(_0x37d7ff,_0xb199a5){return function(_0x1b7f7c){if(_0x1b7f7c){return _0x1b7f7c['destroy']()[_0xc3f5('0x23')](function(){var _0x1e18cd=_0x1b7f7c[_0xc3f5('0x24')]({'plain':!![]});var _0x2d124a=_0xc3f5('0x25');return db[_0xc3f5('0x26')][_0xc3f5('0x27')]({'where':{'type':_0x2d124a,'resourceId':_0x1e18cd['id']}})['then'](function(){return _0x1b7f7c;});})['then'](function(){_0x37d7ff[_0xc3f5('0x19')](0xcc)[_0xc3f5('0x18')]();});}};}function handleEntityNotFound(_0x98cae2,_0x24d5c2){return function(_0x16b541){if(!_0x16b541){_0x98cae2[_0xc3f5('0x17')](0x194);}return _0x16b541;};}function handleError(_0x465447,_0x18afed){_0x18afed=_0x18afed||0x1f4;return function(_0x2e8043){logger['error'](_0x2e8043[_0xc3f5('0x28')]);if(_0x2e8043[_0xc3f5('0x29')]){delete _0x2e8043[_0xc3f5('0x29')];}_0x465447[_0xc3f5('0x19')](_0x18afed)['send'](_0x2e8043);};}exports[_0xc3f5('0x2a')]=function(_0x1b333a,_0xbbd2f2){var _0x405347={},_0x292feb={},_0x4911b1={'count':0x0,'rows':[]};var _0x5aaa6f=_[_0xc3f5('0x2b')](db['AnalyticCustomReport'][_0xc3f5('0x2c')],function(_0xefb90a){return{'name':_0xefb90a[_0xc3f5('0x2d')],'type':_0xefb90a['type'][_0xc3f5('0x2e')]};});_0x292feb['model']=_[_0xc3f5('0x2b')](_0x5aaa6f,_0xc3f5('0x29'));_0x292feb[_0xc3f5('0x2f')]=_['keys'](_0x1b333a[_0xc3f5('0x2f')]);_0x292feb['filters']=_[_0xc3f5('0x30')](_0x292feb['model'],_0x292feb[_0xc3f5('0x2f')]);_0x405347[_0xc3f5('0x31')]=_[_0xc3f5('0x30')](_0x292feb[_0xc3f5('0x32')],qs[_0xc3f5('0x33')](_0x1b333a[_0xc3f5('0x2f')][_0xc3f5('0x33')]));_0x405347[_0xc3f5('0x31')]=_0x405347[_0xc3f5('0x31')]['length']?_0x405347[_0xc3f5('0x31')]:_0x292feb[_0xc3f5('0x32')];if(!_0x1b333a[_0xc3f5('0x2f')][_0xc3f5('0x34')](_0xc3f5('0x35'))){_0x405347[_0xc3f5('0x1d')]=qs[_0xc3f5('0x1d')](_0x1b333a[_0xc3f5('0x2f')][_0xc3f5('0x1d')]);_0x405347[_0xc3f5('0x1b')]=qs[_0xc3f5('0x1b')](_0x1b333a[_0xc3f5('0x2f')]['offset']);}_0x405347[_0xc3f5('0x36')]=qs['sort'](_0x1b333a['query'][_0xc3f5('0x37')]);_0x405347[_0xc3f5('0x38')]=qs[_0xc3f5('0x39')](_[_0xc3f5('0x3a')](_0x1b333a['query'],_0x292feb[_0xc3f5('0x39')]),_0x5aaa6f);if(_0x1b333a[_0xc3f5('0x2f')][_0xc3f5('0x3b')]){_0x405347['where']=_['merge'](_0x405347[_0xc3f5('0x38')],{'$or':_[_0xc3f5('0x2b')](_0x5aaa6f,function(_0xc5f686){if(_0xc5f686[_0xc3f5('0x3c')]!==_0xc3f5('0x3d')){var _0x1e3af6={};_0x1e3af6[_0xc5f686[_0xc3f5('0x29')]]={'$like':'%'+_0x1b333a[_0xc3f5('0x2f')]['filter']+'%'};return _0x1e3af6;}})});}_0x405347=_[_0xc3f5('0x3e')]({},_0x405347,_0x1b333a[_0xc3f5('0x3f')]);var _0x2027b2={'where':_0x405347[_0xc3f5('0x38')]};return db[_0xc3f5('0x40')]['count'](_0x2027b2)['then'](function(_0x2cc154){_0x4911b1[_0xc3f5('0x1e')]=_0x2cc154;if(_0x1b333a['query']['includeAll']){_0x405347['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xc3f5('0x41')](_0x405347);})[_0xc3f5('0x23')](function(_0x419f8c){_0x4911b1[_0xc3f5('0x42')]=_0x419f8c;return _0x4911b1;})[_0xc3f5('0x23')](respondWithFilteredResult(_0xbbd2f2,_0x405347))[_0xc3f5('0x43')](handleError(_0xbbd2f2,null));};exports[_0xc3f5('0x44')]=function(_0x2699f9,_0x1c64ba){var _0x1ff32f={'raw':![],'where':{'id':_0x2699f9[_0xc3f5('0x45')]['id']}},_0x567e36={};_0x567e36[_0xc3f5('0x32')]=_[_0xc3f5('0x46')](db['AnalyticCustomReport'][_0xc3f5('0x2c')]);_0x567e36[_0xc3f5('0x2f')]=_[_0xc3f5('0x46')](_0x2699f9[_0xc3f5('0x2f')]);_0x567e36['filters']=_[_0xc3f5('0x30')](_0x567e36['model'],_0x567e36[_0xc3f5('0x2f')]);_0x1ff32f[_0xc3f5('0x31')]=_[_0xc3f5('0x30')](_0x567e36[_0xc3f5('0x32')],qs[_0xc3f5('0x33')](_0x2699f9[_0xc3f5('0x2f')][_0xc3f5('0x33')]));_0x1ff32f['attributes']=_0x1ff32f[_0xc3f5('0x31')][_0xc3f5('0x47')]?_0x1ff32f[_0xc3f5('0x31')]:_0x567e36[_0xc3f5('0x32')];if(_0x2699f9[_0xc3f5('0x2f')][_0xc3f5('0x48')]){_0x1ff32f[_0xc3f5('0x49')]=[{'all':!![]}];}_0x1ff32f=_[_0xc3f5('0x3e')]({},_0x1ff32f,_0x2699f9[_0xc3f5('0x3f')]);return db[_0xc3f5('0x40')][_0xc3f5('0x4a')](_0x1ff32f)[_0xc3f5('0x23')](handleEntityNotFound(_0x1c64ba,null))[_0xc3f5('0x23')](respondWithResult(_0x1c64ba,null))[_0xc3f5('0x43')](handleError(_0x1c64ba,null));};exports[_0xc3f5('0x4b')]=function(_0x17b215,_0x6aa0b8){return db[_0xc3f5('0x40')][_0xc3f5('0x4b')](_0x17b215['body'],{})[_0xc3f5('0x23')](function(_0x50207f){var _0x530ce0=_0x17b215['user'][_0xc3f5('0x24')]({'plain':!![]});if(!_0x530ce0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x530ce0['role']===_0xc3f5('0x4c')){var _0x2909cc=_0x50207f['get']({'plain':!![]});var _0x5e05b7=_0xc3f5('0x4d');return db[_0xc3f5('0x4e')]['find']({'where':{'name':_0x5e05b7,'userProfileId':_0x530ce0[_0xc3f5('0x4f')]},'raw':!![]})[_0xc3f5('0x23')](function(_0x1682c7){if(_0x1682c7&&_0x1682c7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2909cc['name'],'resourceId':_0x2909cc['id'],'type':'CustomReports','sectionId':_0x1682c7['id']},{})[_0xc3f5('0x23')](function(){return _0x50207f;});}else{return _0x50207f;}})['catch'](function(_0x482db7){logger[_0xc3f5('0x50')](_0xc3f5('0x51'),_0x482db7);throw _0x482db7;});}return _0x50207f;})[_0xc3f5('0x23')](respondWithResult(_0x6aa0b8,0xc9))['catch'](handleError(_0x6aa0b8,null));};exports[_0xc3f5('0x52')]=function(_0x5266f3,_0x464a67){if(_0x5266f3['body']['id']){delete _0x5266f3[_0xc3f5('0x53')]['id'];}return db['AnalyticCustomReport'][_0xc3f5('0x4a')]({'where':{'id':_0x5266f3[_0xc3f5('0x45')]['id']}})[_0xc3f5('0x23')](handleEntityNotFound(_0x464a67,null))['then'](saveUpdates(_0x5266f3[_0xc3f5('0x53')],null))[_0xc3f5('0x23')](respondWithResult(_0x464a67,null))[_0xc3f5('0x43')](handleError(_0x464a67,null));};exports[_0xc3f5('0x27')]=function(_0x4a0ea8,_0x58691e){return db[_0xc3f5('0x40')][_0xc3f5('0x4a')]({'where':{'id':_0x4a0ea8[_0xc3f5('0x45')]['id']}})[_0xc3f5('0x23')](handleEntityNotFound(_0x58691e,null))[_0xc3f5('0x23')](removeEntity(_0x58691e,null))[_0xc3f5('0x43')](handleError(_0x58691e,null));};exports[_0xc3f5('0x54')]=function(_0x15e4a8,_0x725711){var _0x56a7ea=0xa;var _0x1f7f57=[_0xc3f5('0x55'),_0xc3f5('0x56'),'right_join',_0xc3f5('0x57')];var _0x5d156b={'SUM':_0xc3f5('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc3f5('0x59'),'MAX':_0xc3f5('0x5a'),'MIN':'MIN(%s)','AVG':_0xc3f5('0x5b'),'GROUP_CONCAT':_0xc3f5('0x5c'),'GROUP_CONCAT ASC':_0xc3f5('0x5d'),'GROUP_CONCAT DESC':_0xc3f5('0x5e')};var _0x16c3b0={'SEC_TO_TIME':_0xc3f5('0x5f'),'DATE':_0xc3f5('0x60'),'HOUR':_0xc3f5('0x61'),'ROUND':_0xc3f5('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x11187b=function(_0x4059c6){return!_['includes']([_0xc3f5('0x63'),_0xc3f5('0x64'),_0xc3f5('0x65'),_0xc3f5('0x66')],_0x4059c6);};var _0x1c51b3=function(_0x597f99){if(!_0x597f99||!_0x597f99[_0xc3f5('0x67')]['length']){return'';}for(var _0x23a311='(',_0x125864=0x0;_0x125864<_0x597f99[_0xc3f5('0x67')]['length'];_0x125864+=0x1){_0x125864>0x0&&(_0x23a311+='\x20'+_0x597f99[_0xc3f5('0x68')]+'\x20');_0x23a311+=_0x597f99['rules'][_0x125864][_0xc3f5('0x69')]?_0x1c51b3(_0x597f99[_0xc3f5('0x67')][_0x125864][_0xc3f5('0x69')]):_0x597f99[_0xc3f5('0x67')][_0x125864][_0xc3f5('0x6a')]+'\x20'+_0x597f99[_0xc3f5('0x67')][_0x125864][_0xc3f5('0x6b')]+(_0x11187b(_0x597f99[_0xc3f5('0x67')][_0x125864][_0xc3f5('0x6b')])?'\x20'+_0x597f99['rules'][_0x125864][_0xc3f5('0x6c')]:'');}return _0x23a311+')';};var _0x59cdf4={'where':{'id':_0x15e4a8['params']['id']}},_0x33623c,_0x3fb732,_0x425f48,_0x2fa2b7,_0x37c73;_0x59cdf4=_[_0xc3f5('0x3e')]({},_0x59cdf4,_0x15e4a8[_0xc3f5('0x3f')]);return db[_0xc3f5('0x40')][_0xc3f5('0x4a')](_0x59cdf4)[_0xc3f5('0x23')](function(_0x192f45){if(_0x192f45){_0x33623c=_0x192f45;return _0x192f45[_0xc3f5('0x6d')]();}return null;})[_0xc3f5('0x23')](function(_0x53eae9){if(_0x53eae9){if(!_0x53eae9['length']){throw new db[(_0xc3f5('0x6e'))][(_0xc3f5('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3fb732=_0x53eae9;return db[_0xc3f5('0x70')][_0xc3f5('0x41')]({'raw':!![]});}return null;})['then'](function(_0x758ea){if(_0x758ea){_0x425f48=_[_0xc3f5('0x71')](_0x758ea,'id');var _0x3c0631;var _0x16668c=squel[_0xc3f5('0x72')]();_0x16668c[_0xc3f5('0x73')](_0x33623c['table']);for(var _0x40a6bf=0x0;_0x40a6bf<_0x3fb732[_0xc3f5('0x47')];_0x40a6bf+=0x1){_0x3c0631=_0x3fb732[_0x40a6bf][_0xc3f5('0x74')]?_0x425f48[_0x3fb732[_0x40a6bf][_0xc3f5('0x74')]][_0xc3f5('0x75')]:_0x3fb732[_0x40a6bf][_0xc3f5('0x6a')];_0x3c0631=_0x3fb732[_0x40a6bf]['function']?_[_0xc3f5('0x76')](_0x5d156b[_0x3fb732[_0x40a6bf][_0xc3f5('0x77')]],'%s',_0x3c0631):_0x3c0631;_0x3c0631=_0x3fb732[_0x40a6bf][_0xc3f5('0x78')]?_['replace'](_0x16c3b0[_0x3fb732[_0x40a6bf]['format']],'%s',_0x3c0631):_0x3c0631;if(_0x3fb732[_0x40a6bf]['groupBy']){_0x16668c[_0xc3f5('0x69')](_0x3c0631);}_0x3fb732[_0x40a6bf][_0xc3f5('0x79')]&&_0x16668c[_0xc3f5('0x36')](_0x3c0631,_0x3fb732[_0x40a6bf][_0xc3f5('0x79')]==='DESC'?![]:!![]);_0x16668c['field'](_0x3c0631,_0x3fb732[_0x40a6bf]['alias']||_0x3c0631);}if(_0x33623c['joins']){_0x33623c[_0xc3f5('0x7a')]=JSON[_0xc3f5('0x7b')](_0x33623c['joins']);for(var _0x10b3c5=0x0;_0x10b3c5<_0x33623c[_0xc3f5('0x7a')][_0xc3f5('0x47')];_0x10b3c5+=0x1){if(_0x33623c[_0xc3f5('0x7a')][_0x10b3c5][_0xc3f5('0x3c')]&&_['includes'](_0x1f7f57,_0x33623c[_0xc3f5('0x7a')][_0x10b3c5][_0xc3f5('0x3c')])&&_0x33623c[_0xc3f5('0x7a')][_0x10b3c5][_0xc3f5('0x7c')]&&_0x33623c[_0xc3f5('0x7a')][_0x10b3c5][_0xc3f5('0x7d')]&&_0x33623c['joins'][_0x10b3c5][_0xc3f5('0x7e')]){_0x16668c[_0x33623c[_0xc3f5('0x7a')][_0x10b3c5][_0xc3f5('0x3c')]](_0x33623c['joins'][_0x10b3c5][_0xc3f5('0x7d')],null,util[_0xc3f5('0x78')](_0xc3f5('0x7f'),_0x33623c[_0xc3f5('0x80')],_0x33623c[_0xc3f5('0x7a')][_0x10b3c5][_0xc3f5('0x7c')],_0x33623c['joins'][_0x10b3c5][_0xc3f5('0x7d')],_0x33623c[_0xc3f5('0x7a')][_0x10b3c5][_0xc3f5('0x7e')]));}}}if(_0x33623c[_0xc3f5('0x81')]){_0x33623c[_0xc3f5('0x81')]=JSON[_0xc3f5('0x7b')](_0x33623c[_0xc3f5('0x81')]);_0x16668c[_0xc3f5('0x38')](_0x1c51b3(_0x33623c[_0xc3f5('0x81')][_0xc3f5('0x69')]));}_0x37c73=_0x16668c['clone']();_0x16668c[_0xc3f5('0x1d')](_0x56a7ea);_0x16668c[_0xc3f5('0x1b')](0x0);logger[_0xc3f5('0x82')](_0xc3f5('0x83'),_0x16668c['toString']());return dbH[_0xc3f5('0x84')][_0xc3f5('0x2f')](_0x16668c[_0xc3f5('0x85')](),{'type':dbH[_0xc3f5('0x84')][_0xc3f5('0x86')][_0xc3f5('0x87')]});}})[_0xc3f5('0x23')](respondWithResult(_0x725711,null))['catch'](handleError(_0x725711,null));};function runReport(_0x46c0c3,_0x523d92,_0x330ec2){var _0x4b5120=_0x523d92[_0xc3f5('0x29')];var _0x28407b=0xa;var _0x1edd24=[_0xc3f5('0x55'),_0xc3f5('0x56'),_0xc3f5('0x88'),_0xc3f5('0x57')];var _0x323960={'SUM':_0xc3f5('0x58'),'COUNT':_0xc3f5('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xc3f5('0x8a'),'AVG':_0xc3f5('0x5b'),'GROUP_CONCAT':_0xc3f5('0x5c'),'GROUP_CONCAT ASC':_0xc3f5('0x5d'),'GROUP_CONCAT DESC':_0xc3f5('0x5e')};var _0x2264ea={'SEC_TO_TIME':_0xc3f5('0x5f'),'DATE':_0xc3f5('0x60'),'HOUR':_0xc3f5('0x61'),'ROUND':_0xc3f5('0x62'),'UNIX_TIMESTAMP':_0xc3f5('0x8b')};var _0x5019f6=function(_0x4a13e4){return!_[_0xc3f5('0x8c')](['IS\x20NULL',_0xc3f5('0x64'),_0xc3f5('0x65'),'IS\x20NOT\x20EMPTY'],_0x4a13e4);};var _0x3e3d49=function(_0x5bb2e1){if(!_0x5bb2e1||!_0x5bb2e1[_0xc3f5('0x67')]['length']){return'';}for(var _0x4d8c8e='(',_0xc5824=0x0;_0xc5824<_0x5bb2e1[_0xc3f5('0x67')][_0xc3f5('0x47')];_0xc5824+=0x1){_0xc5824>0x0&&(_0x4d8c8e+='\x20'+_0x5bb2e1[_0xc3f5('0x68')]+'\x20');_0x4d8c8e+=_0x5bb2e1['rules'][_0xc5824]['group']?_0x3e3d49(_0x5bb2e1[_0xc3f5('0x67')][_0xc5824][_0xc3f5('0x69')]):_0x5bb2e1[_0xc3f5('0x67')][_0xc5824][_0xc3f5('0x6a')]+'\x20'+_0x5bb2e1[_0xc3f5('0x67')][_0xc5824][_0xc3f5('0x6b')]+(_0x5019f6(_0x5bb2e1[_0xc3f5('0x67')][_0xc5824][_0xc3f5('0x6b')])?'\x20'+_0x5bb2e1[_0xc3f5('0x67')][_0xc5824][_0xc3f5('0x6c')]:'');}return _0x4d8c8e+')';};var _0x23ce50={'where':{'id':_0x46c0c3['id']}},_0x2286d2,_0x33c4ab,_0x10b78f,_0x2c3fe2,_0x7cc8d;_0x23ce50=_[_0xc3f5('0x3e')]({},_0x23ce50,_0x330ec2);return db[_0xc3f5('0x40')][_0xc3f5('0x4a')](_0x23ce50)['then'](function(_0x107f6e){if(_0x107f6e){_0x2286d2=_0x107f6e;return _0x107f6e[_0xc3f5('0x6d')]();}return null;})['then'](function(_0x1fa2f0){if(_0x1fa2f0){if(!_0x1fa2f0[_0xc3f5('0x47')]){throw new db[(_0xc3f5('0x6e'))][(_0xc3f5('0x6f'))](_0xc3f5('0x8d'),0x193);}_0x33c4ab=_0x1fa2f0;return db['AnalyticMetric'][_0xc3f5('0x41')]({'raw':!![]});}return null;})[_0xc3f5('0x23')](function(_0x3a6624){if(_0x3a6624){_0x10b78f=_['keyBy'](_0x3a6624,'id');var _0x3b1248;var _0x31a4a6=squel[_0xc3f5('0x72')]();_0x31a4a6[_0xc3f5('0x73')](_0x2286d2['table']);for(var _0x4512e7=0x0;_0x4512e7<_0x33c4ab[_0xc3f5('0x47')];_0x4512e7+=0x1){_0x3b1248=_0x33c4ab[_0x4512e7][_0xc3f5('0x74')]?_0x10b78f[_0x33c4ab[_0x4512e7][_0xc3f5('0x74')]]['metric']:_0x33c4ab[_0x4512e7][_0xc3f5('0x6a')];_0x3b1248=_0x33c4ab[_0x4512e7][_0xc3f5('0x77')]?_[_0xc3f5('0x76')](_0x323960[_0x33c4ab[_0x4512e7][_0xc3f5('0x77')]],'%s',_0x3b1248):_0x3b1248;_0x3b1248=_0x33c4ab[_0x4512e7][_0xc3f5('0x78')]?_[_0xc3f5('0x76')](_0x2264ea[_0x33c4ab[_0x4512e7][_0xc3f5('0x78')]],'%s',_0x3b1248):_0x3b1248;if(_0x33c4ab[_0x4512e7][_0xc3f5('0x8e')]){_0x31a4a6[_0xc3f5('0x69')](_0x3b1248);}_0x33c4ab[_0x4512e7][_0xc3f5('0x79')]&&_0x31a4a6[_0xc3f5('0x36')](_0x3b1248,_0x33c4ab[_0x4512e7][_0xc3f5('0x79')]===_0xc3f5('0x8f')?![]:!![]);_0x31a4a6[_0xc3f5('0x6a')](_0x3b1248,_0x33c4ab[_0x4512e7]['alias']||_0x3b1248);}if(_0x2286d2[_0xc3f5('0x7a')]){_0x2286d2[_0xc3f5('0x7a')]=JSON[_0xc3f5('0x7b')](_0x2286d2['joins']);for(var _0x4656db=0x0;_0x4656db<_0x2286d2[_0xc3f5('0x7a')][_0xc3f5('0x47')];_0x4656db+=0x1){if(_0x2286d2[_0xc3f5('0x7a')][_0x4656db]['type']&&_[_0xc3f5('0x8c')](_0x1edd24,_0x2286d2[_0xc3f5('0x7a')][_0x4656db][_0xc3f5('0x3c')])&&_0x2286d2[_0xc3f5('0x7a')][_0x4656db][_0xc3f5('0x7c')]&&_0x2286d2[_0xc3f5('0x7a')][_0x4656db]['foreignTable']&&_0x2286d2['joins'][_0x4656db][_0xc3f5('0x7e')]){_0x31a4a6[_0x2286d2[_0xc3f5('0x7a')][_0x4656db]['type']](_0x2286d2[_0xc3f5('0x7a')][_0x4656db][_0xc3f5('0x7d')],null,util[_0xc3f5('0x78')](_0xc3f5('0x7f'),_0x2286d2[_0xc3f5('0x80')],_0x2286d2[_0xc3f5('0x7a')][_0x4656db]['parentKey'],_0x2286d2[_0xc3f5('0x7a')][_0x4656db][_0xc3f5('0x7d')],_0x2286d2[_0xc3f5('0x7a')][_0x4656db][_0xc3f5('0x7e')]));}}}if(_0x2286d2[_0xc3f5('0x81')]){_0x2286d2[_0xc3f5('0x81')]=JSON[_0xc3f5('0x7b')](_0x2286d2['conditions']);_0x31a4a6[_0xc3f5('0x38')](_0x3e3d49(_0x2286d2['conditions'][_0xc3f5('0x69')]));}_0x7cc8d=_0x31a4a6[_0xc3f5('0x90')]();_0x31a4a6[_0xc3f5('0x1d')](_0x28407b);_0x31a4a6[_0xc3f5('0x1b')](0x0);return;}})[_0xc3f5('0x23')](function(){if(_0x523d92[_0xc3f5('0x91')]===_0xc3f5('0x92')){return null;}var _0x29dc5b=_[_0xc3f5('0x3e')](_0x523d92,{'name':_0x523d92['fullPath']||_0x523d92[_0xc3f5('0x29')]||_0x2286d2['name'],'basename':_0x4b5120,'savename':util['format']('%s-%s.%s',_0x523d92[_0xc3f5('0x29')]||_0x2286d2[_0xc3f5('0x29')],require('randomstring')[_0xc3f5('0x93')](0x4),_0x523d92[_0xc3f5('0x91')]||_0xc3f5('0x94')),'reportId':_0x2286d2['id'],'reportType':_0xc3f5('0x95')});return db[_0xc3f5('0x96')][_0xc3f5('0x4b')](_0x29dc5b,{'raw':!![]});})[_0xc3f5('0x23')](function(_0xa537ae){if(_0x2286d2['table']==='cdr'){_0x7cc8d['where'](_0x2286d2[_0xc3f5('0x80')]+_0xc3f5('0x97'),_0x523d92[_0xc3f5('0x98')],_0x523d92[_0xc3f5('0x99')]);}else{_0x7cc8d[_0xc3f5('0x38')](_0x2286d2[_0xc3f5('0x80')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x523d92[_0xc3f5('0x98')],_0x523d92['endDate']);}if(_0xa537ae){logger[_0xc3f5('0x9a')](_0xc3f5('0x9b'),_0x7cc8d[_0xc3f5('0x85')]());require('child_process')[_0xc3f5('0x9c')](path[_0xc3f5('0x55')](__dirname,'../../components/export/',_0xa537ae[_0xc3f5('0x91')]),[_0xa537ae['id'],_0x7cc8d['toString'](),path[_0xc3f5('0x55')](__dirname,_0xc3f5('0x9d'),_0xa537ae[_0xc3f5('0x9e')]),_0x4b5120]);return _0xa537ae;}else{var _0x1c23b2=squel[_0xc3f5('0x72')]();_0x1c23b2[_0xc3f5('0x73')]('('+_0x7cc8d[_0xc3f5('0x85')]()+')',_0xc3f5('0x9f'));_0x1c23b2[_0xc3f5('0x6a')](_0xc3f5('0xa0'),_0xc3f5('0x1e'));_0x7cc8d[_0xc3f5('0x1d')](_0x523d92['limit']||_0x28407b);_0x7cc8d[_0xc3f5('0x1b')](_0x523d92[_0xc3f5('0x1b')]||0x0);return dbH[_0xc3f5('0x84')]['query'](_0x1c23b2[_0xc3f5('0x85')](),{'type':dbH[_0xc3f5('0x84')][_0xc3f5('0x86')]['SELECT']})['then'](function(_0x239ab4){if(!_0x239ab4['length']){_0x2c3fe2=0x0;}else{_0x2c3fe2=_0x239ab4[0x0]['count']||0x0;}return dbH[_0xc3f5('0x84')][_0xc3f5('0x2f')](_0x7cc8d[_0xc3f5('0x85')](),{'type':dbH[_0xc3f5('0x84')][_0xc3f5('0x86')][_0xc3f5('0x87')]});})['then'](function(_0x37e518){return{'rows':_0x37e518||[],'count':_0x2c3fe2};});}});}exports[_0xc3f5('0xa1')]=function(_0x3f2b9a,_0x19fe62){return runReport(_0x3f2b9a[_0xc3f5('0x45')],_0x3f2b9a['query'],_0x3f2b9a[_0xc3f5('0x3f')])[_0xc3f5('0x23')](respondWithResult(_0x19fe62,null))[_0xc3f5('0x43')](handleError(_0x19fe62,null));};exports['runReport']=runReport;exports[_0xc3f5('0x2f')]=function(_0x4a20fa,_0xbee7b0){var _0x4c0ddf=0xa;var _0x16bbc8=['join',_0xc3f5('0x56'),'right_join',_0xc3f5('0x57')];var _0x1d015b={'SUM':_0xc3f5('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc3f5('0x59'),'MAX':_0xc3f5('0x5a'),'MIN':_0xc3f5('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x549e6f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc3f5('0x60'),'HOUR':'HOUR(%s)','ROUND':_0xc3f5('0x62'),'UNIX_TIMESTAMP':_0xc3f5('0x8b')};var _0x2b7f20=function(_0x3fd90c){return!_[_0xc3f5('0x8c')]([_0xc3f5('0x63'),_0xc3f5('0x64'),_0xc3f5('0x65'),_0xc3f5('0x66')],_0x3fd90c);};var _0x4b816f=function(_0xc7436b){if(!_0xc7436b||!_0xc7436b['rules'][_0xc3f5('0x47')]){return'';}for(var _0x4d67fe='(',_0x5454e9=0x0;_0x5454e9<_0xc7436b[_0xc3f5('0x67')]['length'];_0x5454e9+=0x1){_0x5454e9>0x0&&(_0x4d67fe+='\x20'+_0xc7436b[_0xc3f5('0x68')]+'\x20');_0x4d67fe+=_0xc7436b[_0xc3f5('0x67')][_0x5454e9][_0xc3f5('0x69')]?_0x4b816f(_0xc7436b[_0xc3f5('0x67')][_0x5454e9][_0xc3f5('0x69')]):_0xc7436b[_0xc3f5('0x67')][_0x5454e9][_0xc3f5('0x6a')]+'\x20'+_0xc7436b[_0xc3f5('0x67')][_0x5454e9][_0xc3f5('0x6b')]+(_0x2b7f20(_0xc7436b[_0xc3f5('0x67')][_0x5454e9][_0xc3f5('0x6b')])?'\x20'+_0xc7436b[_0xc3f5('0x67')][_0x5454e9][_0xc3f5('0x6c')]:'');}return _0x4d67fe+')';};var _0x2790df={'where':{'id':_0x4a20fa['params']['id']}},_0x2b6a94,_0x1975a4,_0x505175,_0x54ef51,_0x3509ee;_0x2790df=_[_0xc3f5('0x3e')]({},_0x2790df,_0x4a20fa[_0xc3f5('0x3f')]);return db['AnalyticCustomReport']['find'](_0x2790df)[_0xc3f5('0x23')](function(_0x4d8bea){if(_0x4d8bea){_0x2b6a94=_0x4d8bea;return _0x4d8bea[_0xc3f5('0x6d')]();}return null;})['then'](function(_0x41558e){if(_0x41558e){if(!_0x41558e['length']){throw new db[(_0xc3f5('0x6e'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1975a4=_0x41558e;return db[_0xc3f5('0x70')][_0xc3f5('0x41')]({'raw':!![]});}return null;})[_0xc3f5('0x23')](function(_0x5b9bc0){if(_0x5b9bc0){_0x505175=_['keyBy'](_0x5b9bc0,'id');var _0x55386a;var _0x2d8f7f=squel['select']();_0x2d8f7f[_0xc3f5('0x73')](_0x2b6a94[_0xc3f5('0x80')]);for(var _0x368886=0x0;_0x368886<_0x1975a4[_0xc3f5('0x47')];_0x368886+=0x1){_0x55386a=_0x1975a4[_0x368886][_0xc3f5('0x74')]?_0x505175[_0x1975a4[_0x368886][_0xc3f5('0x74')]][_0xc3f5('0x75')]:_0x1975a4[_0x368886][_0xc3f5('0x6a')];_0x55386a=_0x1975a4[_0x368886]['function']?_[_0xc3f5('0x76')](_0x1d015b[_0x1975a4[_0x368886][_0xc3f5('0x77')]],'%s',_0x55386a):_0x55386a;_0x55386a=_0x1975a4[_0x368886]['format']?_['replace'](_0x549e6f[_0x1975a4[_0x368886]['format']],'%s',_0x55386a):_0x55386a;if(_0x1975a4[_0x368886][_0xc3f5('0x8e')]){_0x2d8f7f[_0xc3f5('0x69')](_0x55386a);}_0x1975a4[_0x368886][_0xc3f5('0x79')]&&_0x2d8f7f[_0xc3f5('0x36')](_0x55386a,_0x1975a4[_0x368886][_0xc3f5('0x79')]===_0xc3f5('0x8f')?![]:!![]);_0x2d8f7f[_0xc3f5('0x6a')](_0x55386a,_0x1975a4[_0x368886][_0xc3f5('0xa2')]||_0x55386a);}if(_0x2b6a94[_0xc3f5('0x7a')]){_0x2b6a94['joins']=JSON['parse'](_0x2b6a94[_0xc3f5('0x7a')]);for(var _0x4941df=0x0;_0x4941df<_0x2b6a94['joins']['length'];_0x4941df+=0x1){if(_0x2b6a94[_0xc3f5('0x7a')][_0x4941df]['type']&&_['includes'](_0x16bbc8,_0x2b6a94[_0xc3f5('0x7a')][_0x4941df]['type'])&&_0x2b6a94[_0xc3f5('0x7a')][_0x4941df][_0xc3f5('0x7c')]&&_0x2b6a94[_0xc3f5('0x7a')][_0x4941df]['foreignTable']&&_0x2b6a94[_0xc3f5('0x7a')][_0x4941df][_0xc3f5('0x7e')]){_0x2d8f7f[_0x2b6a94[_0xc3f5('0x7a')][_0x4941df]['type']](_0x2b6a94['joins'][_0x4941df][_0xc3f5('0x7d')],null,util[_0xc3f5('0x78')](_0xc3f5('0x7f'),_0x2b6a94[_0xc3f5('0x80')],_0x2b6a94[_0xc3f5('0x7a')][_0x4941df][_0xc3f5('0x7c')],_0x2b6a94[_0xc3f5('0x7a')][_0x4941df][_0xc3f5('0x7d')],_0x2b6a94[_0xc3f5('0x7a')][_0x4941df][_0xc3f5('0x7e')]));}}}if(_0x2b6a94[_0xc3f5('0x81')]){_0x2b6a94[_0xc3f5('0x81')]=JSON[_0xc3f5('0x7b')](_0x2b6a94[_0xc3f5('0x81')]);_0x2d8f7f[_0xc3f5('0x38')](_0x4b816f(_0x2b6a94['conditions'][_0xc3f5('0x69')]));}_0x3509ee=_0x2d8f7f[_0xc3f5('0x90')]();_0x2d8f7f[_0xc3f5('0x1d')](_0x4c0ddf);_0x2d8f7f[_0xc3f5('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x2d8f7f[_0xc3f5('0x85')]());return dbH[_0xc3f5('0x84')][_0xc3f5('0x2f')](_0x2d8f7f[_0xc3f5('0x85')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x3509ee[_0xc3f5('0x85')]()};})[_0xc3f5('0x23')](respondWithResult(_0xbee7b0,null))['catch'](handleError(_0xbee7b0,null));};
\ No newline at end of file
+var _0x96db=['util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','UserProfileResource','stack','name','send','map','AnalyticCustomReport','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','cross_join','UNIX_TIMESTAMP(%s)','ValidationErrorItem','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','countTable','run','runReport','SUM(%s)','ROUND(%s)','IS\x20EMPTY','alias','debug','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x26f4f5,_0x4ad85d){var _0x217fc0=function(_0x187120){while(--_0x187120){_0x26f4f5['push'](_0x26f4f5['shift']());}};_0x217fc0(++_0x4ad85d);}(_0x96db,0x13f));var _0xb96d=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x96db[_0x1bc0ae];return _0x501104;};'use strict';var emlformat=require(_0xb96d('0x0'));var rimraf=require(_0xb96d('0x1'));var zipdir=require(_0xb96d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb96d('0x3'));var moment=require(_0xb96d('0x4'));var BPromise=require(_0xb96d('0x5'));var Mustache=require(_0xb96d('0x6'));var util=require(_0xb96d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb96d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb96d('0x9'));var _=require('lodash');var squel=require(_0xb96d('0xa'));var crypto=require(_0xb96d('0xb'));var jsforce=require(_0xb96d('0xc'));var deskjs=require(_0xb96d('0xd'));var toCsv=require(_0xb96d('0x8'));var querystring=require(_0xb96d('0xe'));var Papa=require(_0xb96d('0xf'));var Redis=require(_0xb96d('0x10'));var authService=require(_0xb96d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb96d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb96d('0x13'))(_0xb96d('0x14'));var utils=require('../../config/utils');var config=require(_0xb96d('0x15'));var licenseUtil=require(_0xb96d('0x16'));var db=require(_0xb96d('0x17'))['db'];var dbH=require(_0xb96d('0x17'))[_0xb96d('0x18')];function respondWithStatusCode(_0x5e004a,_0x16f18c){_0x16f18c=_0x16f18c||0xcc;return function(_0x37230c){if(_0x37230c){return _0x5e004a[_0xb96d('0x19')](_0x16f18c);}return _0x5e004a['status'](_0x16f18c)[_0xb96d('0x1a')]();};}function respondWithResult(_0x1f1e02,_0x2b5bf1){_0x2b5bf1=_0x2b5bf1||0xc8;return function(_0x5d1962){if(_0x5d1962){return _0x1f1e02[_0xb96d('0x1b')](_0x2b5bf1)[_0xb96d('0x1c')](_0x5d1962);}};}function respondWithFilteredResult(_0x5af532,_0x58e8d7){return function(_0x25ff3c){if(_0x25ff3c){var _0x4069db=typeof _0x58e8d7[_0xb96d('0x1d')]===_0xb96d('0x1e')&&typeof _0x58e8d7['limit']===_0xb96d('0x1e');var _0x2db8c7=_0x25ff3c[_0xb96d('0x1f')];var _0xb62640=_0x4069db?0x0:_0x58e8d7[_0xb96d('0x1d')];var _0x468243=_0x4069db?_0x25ff3c[_0xb96d('0x1f')]:_0x58e8d7[_0xb96d('0x1d')]+_0x58e8d7[_0xb96d('0x20')];var _0x51a564;if(_0x468243>=_0x2db8c7){_0x468243=_0x2db8c7;_0x51a564=0xc8;}else{_0x51a564=0xce;}_0x5af532[_0xb96d('0x1b')](_0x51a564);return _0x5af532[_0xb96d('0x21')](_0xb96d('0x22'),_0xb62640+'-'+_0x468243+'/'+_0x2db8c7)['json'](_0x25ff3c);}return null;};}function patchUpdates(_0x57706a){return function(_0x251cfe){try{jsonpatch['apply'](_0x251cfe,_0x57706a,!![]);}catch(_0x712fb5){return BPromise['reject'](_0x712fb5);}return _0x251cfe[_0xb96d('0x23')]();};}function saveUpdates(_0x53f947,_0x146d7c){return function(_0x4513fe){if(_0x4513fe){return _0x4513fe[_0xb96d('0x24')](_0x53f947)[_0xb96d('0x25')](function(_0xab92b6){return _0xab92b6;});}return null;};}function removeEntity(_0x66cdbb,_0x368a39){return function(_0x3722ad){if(_0x3722ad){return _0x3722ad[_0xb96d('0x26')]()[_0xb96d('0x25')](function(){var _0x3d4db6=_0x3722ad['get']({'plain':!![]});var _0xd32008='CustomReports';return db[_0xb96d('0x27')][_0xb96d('0x26')]({'where':{'type':_0xd32008,'resourceId':_0x3d4db6['id']}})[_0xb96d('0x25')](function(){return _0x3722ad;});})[_0xb96d('0x25')](function(){_0x66cdbb[_0xb96d('0x1b')](0xcc)[_0xb96d('0x1a')]();});}};}function handleEntityNotFound(_0x49d03b,_0x56748b){return function(_0x1a6b43){if(!_0x1a6b43){_0x49d03b[_0xb96d('0x19')](0x194);}return _0x1a6b43;};}function handleError(_0x5ef98e,_0x581142){_0x581142=_0x581142||0x1f4;return function(_0x13af36){logger['error'](_0x13af36[_0xb96d('0x28')]);if(_0x13af36['name']){delete _0x13af36[_0xb96d('0x29')];}_0x5ef98e[_0xb96d('0x1b')](_0x581142)[_0xb96d('0x2a')](_0x13af36);};}exports['index']=function(_0x4cd429,_0x3966cb){var _0x29554e={},_0x103eae={},_0x2133ca={'count':0x0,'rows':[]};var _0x215adf=_[_0xb96d('0x2b')](db[_0xb96d('0x2c')]['rawAttributes'],function(_0x239949){return{'name':_0x239949[_0xb96d('0x2d')],'type':_0x239949[_0xb96d('0x2e')]['key']};});_0x103eae['model']=_[_0xb96d('0x2b')](_0x215adf,_0xb96d('0x29'));_0x103eae[_0xb96d('0x2f')]=_['keys'](_0x4cd429[_0xb96d('0x2f')]);_0x103eae[_0xb96d('0x30')]=_['intersection'](_0x103eae[_0xb96d('0x31')],_0x103eae[_0xb96d('0x2f')]);_0x29554e[_0xb96d('0x32')]=_[_0xb96d('0x33')](_0x103eae[_0xb96d('0x31')],qs['fields'](_0x4cd429['query'][_0xb96d('0x34')]));_0x29554e[_0xb96d('0x32')]=_0x29554e[_0xb96d('0x32')][_0xb96d('0x35')]?_0x29554e[_0xb96d('0x32')]:_0x103eae[_0xb96d('0x31')];if(!_0x4cd429[_0xb96d('0x2f')][_0xb96d('0x36')]('nolimit')){_0x29554e['limit']=qs[_0xb96d('0x20')](_0x4cd429[_0xb96d('0x2f')][_0xb96d('0x20')]);_0x29554e[_0xb96d('0x1d')]=qs['offset'](_0x4cd429[_0xb96d('0x2f')][_0xb96d('0x1d')]);}_0x29554e[_0xb96d('0x37')]=qs[_0xb96d('0x38')](_0x4cd429[_0xb96d('0x2f')]['sort']);_0x29554e['where']=qs[_0xb96d('0x30')](_['pick'](_0x4cd429[_0xb96d('0x2f')],_0x103eae[_0xb96d('0x30')]),_0x215adf);if(_0x4cd429['query'][_0xb96d('0x39')]){_0x29554e[_0xb96d('0x3a')]=_[_0xb96d('0x3b')](_0x29554e[_0xb96d('0x3a')],{'$or':_['map'](_0x215adf,function(_0x17134a){if(_0x17134a['type']!==_0xb96d('0x3c')){var _0x5e17c7={};_0x5e17c7[_0x17134a['name']]={'$like':'%'+_0x4cd429[_0xb96d('0x2f')][_0xb96d('0x39')]+'%'};return _0x5e17c7;}})});}_0x29554e=_[_0xb96d('0x3b')]({},_0x29554e,_0x4cd429[_0xb96d('0x3d')]);var _0x53eb18={'where':_0x29554e['where']};return db[_0xb96d('0x2c')][_0xb96d('0x1f')](_0x53eb18)[_0xb96d('0x25')](function(_0x5c8917){_0x2133ca[_0xb96d('0x1f')]=_0x5c8917;if(_0x4cd429[_0xb96d('0x2f')][_0xb96d('0x3e')]){_0x29554e['include']=[{'all':!![]}];}return db[_0xb96d('0x2c')][_0xb96d('0x3f')](_0x29554e);})[_0xb96d('0x25')](function(_0xed0354){_0x2133ca[_0xb96d('0x40')]=_0xed0354;return _0x2133ca;})['then'](respondWithFilteredResult(_0x3966cb,_0x29554e))['catch'](handleError(_0x3966cb,null));};exports['show']=function(_0x12b75a,_0x38a95f){var _0x2c7517={'raw':![],'where':{'id':_0x12b75a[_0xb96d('0x41')]['id']}},_0x309d02={};_0x309d02['model']=_[_0xb96d('0x42')](db[_0xb96d('0x2c')][_0xb96d('0x43')]);_0x309d02['query']=_['keys'](_0x12b75a['query']);_0x309d02[_0xb96d('0x30')]=_[_0xb96d('0x33')](_0x309d02[_0xb96d('0x31')],_0x309d02[_0xb96d('0x2f')]);_0x2c7517[_0xb96d('0x32')]=_[_0xb96d('0x33')](_0x309d02[_0xb96d('0x31')],qs[_0xb96d('0x34')](_0x12b75a[_0xb96d('0x2f')][_0xb96d('0x34')]));_0x2c7517[_0xb96d('0x32')]=_0x2c7517[_0xb96d('0x32')][_0xb96d('0x35')]?_0x2c7517['attributes']:_0x309d02['model'];if(_0x12b75a[_0xb96d('0x2f')][_0xb96d('0x3e')]){_0x2c7517[_0xb96d('0x44')]=[{'all':!![]}];}_0x2c7517=_[_0xb96d('0x3b')]({},_0x2c7517,_0x12b75a['options']);return db['AnalyticCustomReport'][_0xb96d('0x45')](_0x2c7517)[_0xb96d('0x25')](handleEntityNotFound(_0x38a95f,null))[_0xb96d('0x25')](respondWithResult(_0x38a95f,null))['catch'](handleError(_0x38a95f,null));};exports[_0xb96d('0x46')]=function(_0x17a6a2,_0x4b0a62){return db[_0xb96d('0x2c')][_0xb96d('0x46')](_0x17a6a2[_0xb96d('0x47')],{})[_0xb96d('0x25')](function(_0x2519c9){var _0x5414fe=_0x17a6a2['user']['get']({'plain':!![]});if(!_0x5414fe)throw new Error(_0xb96d('0x48'));if(_0x5414fe[_0xb96d('0x49')]===_0xb96d('0x4a')){var _0x23ab58=_0x2519c9['get']({'plain':!![]});var _0x372c39=_0xb96d('0x4b');return db[_0xb96d('0x4c')]['find']({'where':{'name':_0x372c39,'userProfileId':_0x5414fe[_0xb96d('0x4d')]},'raw':!![]})[_0xb96d('0x25')](function(_0x27eb3e){if(_0x27eb3e&&_0x27eb3e[_0xb96d('0x4e')]===0x0){return db[_0xb96d('0x27')][_0xb96d('0x46')]({'name':_0x23ab58[_0xb96d('0x29')],'resourceId':_0x23ab58['id'],'type':_0xb96d('0x4f'),'sectionId':_0x27eb3e['id']},{})[_0xb96d('0x25')](function(){return _0x2519c9;});}else{return _0x2519c9;}})[_0xb96d('0x50')](function(_0x2a7a50){logger[_0xb96d('0x51')](_0xb96d('0x52'),_0x2a7a50);throw _0x2a7a50;});}return _0x2519c9;})[_0xb96d('0x25')](respondWithResult(_0x4b0a62,0xc9))['catch'](handleError(_0x4b0a62,null));};exports[_0xb96d('0x24')]=function(_0x3acca3,_0x3882e3){if(_0x3acca3[_0xb96d('0x47')]['id']){delete _0x3acca3['body']['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x3acca3[_0xb96d('0x41')]['id']}})[_0xb96d('0x25')](handleEntityNotFound(_0x3882e3,null))[_0xb96d('0x25')](saveUpdates(_0x3acca3[_0xb96d('0x47')],null))[_0xb96d('0x25')](respondWithResult(_0x3882e3,null))[_0xb96d('0x50')](handleError(_0x3882e3,null));};exports[_0xb96d('0x26')]=function(_0x105a48,_0x20b7eb){return db[_0xb96d('0x2c')][_0xb96d('0x45')]({'where':{'id':_0x105a48[_0xb96d('0x41')]['id']}})[_0xb96d('0x25')](handleEntityNotFound(_0x20b7eb,null))['then'](removeEntity(_0x20b7eb,null))['catch'](handleError(_0x20b7eb,null));};exports[_0xb96d('0x53')]=function(_0x42cca0,_0x48a953){var _0x28ee1e=0xa;var _0x4d0451=['join',_0xb96d('0x54'),_0xb96d('0x55'),'cross_join'];var _0x5df38c={'SUM':'SUM(%s)','COUNT':_0xb96d('0x56'),'COUNT DISTINCT':_0xb96d('0x57'),'MAX':_0xb96d('0x58'),'MIN':'MIN(%s)','AVG':_0xb96d('0x59'),'GROUP_CONCAT':_0xb96d('0x5a'),'GROUP_CONCAT ASC':_0xb96d('0x5b'),'GROUP_CONCAT DESC':_0xb96d('0x5c')};var _0x2c2006={'SEC_TO_TIME':_0xb96d('0x5d'),'DATE':_0xb96d('0x5e'),'HOUR':_0xb96d('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3d1d2e=function(_0x27206f){return!_[_0xb96d('0x60')]([_0xb96d('0x61'),_0xb96d('0x62'),'IS\x20EMPTY',_0xb96d('0x63')],_0x27206f);};var _0x594774=function(_0x549364){if(!_0x549364||!_0x549364[_0xb96d('0x64')]['length']){return'';}for(var _0x33d065='(',_0x564a7c=0x0;_0x564a7c<_0x549364[_0xb96d('0x64')][_0xb96d('0x35')];_0x564a7c+=0x1){_0x564a7c>0x0&&(_0x33d065+='\x20'+_0x549364[_0xb96d('0x65')]+'\x20');_0x33d065+=_0x549364[_0xb96d('0x64')][_0x564a7c][_0xb96d('0x66')]?_0x594774(_0x549364[_0xb96d('0x64')][_0x564a7c][_0xb96d('0x66')]):_0x549364['rules'][_0x564a7c][_0xb96d('0x67')]+'\x20'+_0x549364[_0xb96d('0x64')][_0x564a7c][_0xb96d('0x68')]+(_0x3d1d2e(_0x549364[_0xb96d('0x64')][_0x564a7c]['condition'])?'\x20'+_0x549364[_0xb96d('0x64')][_0x564a7c][_0xb96d('0x69')]:'');}return _0x33d065+')';};var _0x152281={'where':{'id':_0x42cca0[_0xb96d('0x41')]['id']}},_0x48631f,_0x1f7e8e,_0x4fee39,_0x10874c,_0x193c90;_0x152281=_['merge']({},_0x152281,_0x42cca0[_0xb96d('0x3d')]);return db[_0xb96d('0x2c')]['find'](_0x152281)[_0xb96d('0x25')](function(_0x501db0){if(_0x501db0){_0x48631f=_0x501db0;return _0x501db0[_0xb96d('0x6a')]();}return null;})[_0xb96d('0x25')](function(_0x495fac){if(_0x495fac){if(!_0x495fac[_0xb96d('0x35')]){throw new db[(_0xb96d('0x6b'))]['ValidationErrorItem'](_0xb96d('0x6c'),0x193);}_0x1f7e8e=_0x495fac;return db[_0xb96d('0x6d')][_0xb96d('0x3f')]({'raw':!![]});}return null;})[_0xb96d('0x25')](function(_0x1a5277){if(_0x1a5277){_0x4fee39=_[_0xb96d('0x6e')](_0x1a5277,'id');var _0x55593f;var _0x331fc3=squel[_0xb96d('0x6f')]();_0x331fc3[_0xb96d('0x70')](_0x48631f[_0xb96d('0x71')]);for(var _0x17e0d8=0x0;_0x17e0d8<_0x1f7e8e[_0xb96d('0x35')];_0x17e0d8+=0x1){_0x55593f=_0x1f7e8e[_0x17e0d8][_0xb96d('0x72')]?_0x4fee39[_0x1f7e8e[_0x17e0d8][_0xb96d('0x72')]][_0xb96d('0x73')]:_0x1f7e8e[_0x17e0d8][_0xb96d('0x67')];_0x55593f=_0x1f7e8e[_0x17e0d8][_0xb96d('0x74')]?_[_0xb96d('0x75')](_0x5df38c[_0x1f7e8e[_0x17e0d8][_0xb96d('0x74')]],'%s',_0x55593f):_0x55593f;_0x55593f=_0x1f7e8e[_0x17e0d8][_0xb96d('0x76')]?_[_0xb96d('0x75')](_0x2c2006[_0x1f7e8e[_0x17e0d8][_0xb96d('0x76')]],'%s',_0x55593f):_0x55593f;if(_0x1f7e8e[_0x17e0d8][_0xb96d('0x77')]){_0x331fc3[_0xb96d('0x66')](_0x55593f);}_0x1f7e8e[_0x17e0d8][_0xb96d('0x78')]&&_0x331fc3[_0xb96d('0x37')](_0x55593f,_0x1f7e8e[_0x17e0d8]['orderBy']===_0xb96d('0x79')?![]:!![]);_0x331fc3[_0xb96d('0x67')](_0x55593f,_0x1f7e8e[_0x17e0d8]['alias']||_0x55593f);}if(_0x48631f[_0xb96d('0x7a')]){_0x48631f['joins']=JSON[_0xb96d('0x7b')](_0x48631f[_0xb96d('0x7a')]);for(var _0x234538=0x0;_0x234538<_0x48631f[_0xb96d('0x7a')][_0xb96d('0x35')];_0x234538+=0x1){if(_0x48631f[_0xb96d('0x7a')][_0x234538][_0xb96d('0x2e')]&&_[_0xb96d('0x60')](_0x4d0451,_0x48631f[_0xb96d('0x7a')][_0x234538][_0xb96d('0x2e')])&&_0x48631f[_0xb96d('0x7a')][_0x234538][_0xb96d('0x7c')]&&_0x48631f[_0xb96d('0x7a')][_0x234538][_0xb96d('0x7d')]&&_0x48631f[_0xb96d('0x7a')][_0x234538]['foreignKey']){_0x331fc3[_0x48631f[_0xb96d('0x7a')][_0x234538][_0xb96d('0x2e')]](_0x48631f[_0xb96d('0x7a')][_0x234538][_0xb96d('0x7d')],null,util[_0xb96d('0x76')](_0xb96d('0x7e'),_0x48631f[_0xb96d('0x71')],_0x48631f['joins'][_0x234538][_0xb96d('0x7c')],_0x48631f[_0xb96d('0x7a')][_0x234538][_0xb96d('0x7d')],_0x48631f['joins'][_0x234538][_0xb96d('0x7f')]));}}}if(_0x48631f[_0xb96d('0x80')]){_0x48631f[_0xb96d('0x80')]=JSON['parse'](_0x48631f[_0xb96d('0x80')]);_0x331fc3[_0xb96d('0x3a')](_0x594774(_0x48631f[_0xb96d('0x80')][_0xb96d('0x66')]));}_0x193c90=_0x331fc3['clone']();_0x331fc3[_0xb96d('0x20')](_0x28ee1e);_0x331fc3[_0xb96d('0x1d')](0x0);logger['debug'](_0xb96d('0x81'),_0x331fc3[_0xb96d('0x82')]());return dbH[_0xb96d('0x83')][_0xb96d('0x2f')](_0x331fc3[_0xb96d('0x82')](),{'type':dbH['sequelize'][_0xb96d('0x84')][_0xb96d('0x85')]});}})['then'](respondWithResult(_0x48a953,null))[_0xb96d('0x50')](handleError(_0x48a953,null));};function runReport(_0x41385e,_0x2622fc,_0x2b55a2){var _0x12a123=_0x2622fc[_0xb96d('0x29')];var _0x5ea1df=0xa;var _0x27bdec=[_0xb96d('0x86'),_0xb96d('0x54'),_0xb96d('0x55'),_0xb96d('0x87')];var _0x3246fb={'SUM':'SUM(%s)','COUNT':_0xb96d('0x56'),'COUNT DISTINCT':_0xb96d('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xb96d('0x59'),'GROUP_CONCAT':_0xb96d('0x5a'),'GROUP_CONCAT ASC':_0xb96d('0x5b'),'GROUP_CONCAT DESC':_0xb96d('0x5c')};var _0xa0457d={'SEC_TO_TIME':_0xb96d('0x5d'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb96d('0x88')};var _0x474693=function(_0x192bf0){return!_['includes']([_0xb96d('0x61'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x192bf0);};var _0x24ff3c=function(_0x54a9ed){if(!_0x54a9ed||!_0x54a9ed[_0xb96d('0x64')][_0xb96d('0x35')]){return'';}for(var _0xc47bab='(',_0x325077=0x0;_0x325077<_0x54a9ed['rules']['length'];_0x325077+=0x1){_0x325077>0x0&&(_0xc47bab+='\x20'+_0x54a9ed[_0xb96d('0x65')]+'\x20');_0xc47bab+=_0x54a9ed['rules'][_0x325077][_0xb96d('0x66')]?_0x24ff3c(_0x54a9ed[_0xb96d('0x64')][_0x325077][_0xb96d('0x66')]):_0x54a9ed[_0xb96d('0x64')][_0x325077][_0xb96d('0x67')]+'\x20'+_0x54a9ed[_0xb96d('0x64')][_0x325077][_0xb96d('0x68')]+(_0x474693(_0x54a9ed['rules'][_0x325077][_0xb96d('0x68')])?'\x20'+_0x54a9ed[_0xb96d('0x64')][_0x325077][_0xb96d('0x69')]:'');}return _0xc47bab+')';};var _0x5b170f={'where':{'id':_0x41385e['id']}},_0x40ce0e,_0xe849b1,_0x50a20d,_0x2cea3b,_0x37171c;_0x5b170f=_[_0xb96d('0x3b')]({},_0x5b170f,_0x2b55a2);return db[_0xb96d('0x2c')][_0xb96d('0x45')](_0x5b170f)[_0xb96d('0x25')](function(_0x2424a9){if(_0x2424a9){_0x40ce0e=_0x2424a9;return _0x2424a9[_0xb96d('0x6a')]();}return null;})[_0xb96d('0x25')](function(_0x5a3b39){if(_0x5a3b39){if(!_0x5a3b39[_0xb96d('0x35')]){throw new db[(_0xb96d('0x6b'))][(_0xb96d('0x89'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe849b1=_0x5a3b39;return db[_0xb96d('0x6d')][_0xb96d('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x1fa723){if(_0x1fa723){_0x50a20d=_['keyBy'](_0x1fa723,'id');var _0x48c4ae;var _0x4515ad=squel[_0xb96d('0x6f')]();_0x4515ad['from'](_0x40ce0e[_0xb96d('0x71')]);for(var _0x4150a6=0x0;_0x4150a6<_0xe849b1['length'];_0x4150a6+=0x1){_0x48c4ae=_0xe849b1[_0x4150a6][_0xb96d('0x72')]?_0x50a20d[_0xe849b1[_0x4150a6][_0xb96d('0x72')]][_0xb96d('0x73')]:_0xe849b1[_0x4150a6][_0xb96d('0x67')];_0x48c4ae=_0xe849b1[_0x4150a6][_0xb96d('0x74')]?_[_0xb96d('0x75')](_0x3246fb[_0xe849b1[_0x4150a6][_0xb96d('0x74')]],'%s',_0x48c4ae):_0x48c4ae;_0x48c4ae=_0xe849b1[_0x4150a6][_0xb96d('0x76')]?_[_0xb96d('0x75')](_0xa0457d[_0xe849b1[_0x4150a6][_0xb96d('0x76')]],'%s',_0x48c4ae):_0x48c4ae;if(_0xe849b1[_0x4150a6][_0xb96d('0x77')]){_0x4515ad[_0xb96d('0x66')](_0x48c4ae);}_0xe849b1[_0x4150a6]['orderBy']&&_0x4515ad[_0xb96d('0x37')](_0x48c4ae,_0xe849b1[_0x4150a6][_0xb96d('0x78')]==='DESC'?![]:!![]);_0x4515ad['field'](_0x48c4ae,_0xe849b1[_0x4150a6]['alias']||_0x48c4ae);}if(_0x40ce0e[_0xb96d('0x7a')]){_0x40ce0e[_0xb96d('0x7a')]=JSON[_0xb96d('0x7b')](_0x40ce0e['joins']);for(var _0x1e8af8=0x0;_0x1e8af8<_0x40ce0e[_0xb96d('0x7a')]['length'];_0x1e8af8+=0x1){if(_0x40ce0e[_0xb96d('0x7a')][_0x1e8af8]['type']&&_[_0xb96d('0x60')](_0x27bdec,_0x40ce0e['joins'][_0x1e8af8]['type'])&&_0x40ce0e[_0xb96d('0x7a')][_0x1e8af8][_0xb96d('0x7c')]&&_0x40ce0e[_0xb96d('0x7a')][_0x1e8af8]['foreignTable']&&_0x40ce0e['joins'][_0x1e8af8][_0xb96d('0x7f')]){_0x4515ad[_0x40ce0e[_0xb96d('0x7a')][_0x1e8af8][_0xb96d('0x2e')]](_0x40ce0e[_0xb96d('0x7a')][_0x1e8af8][_0xb96d('0x7d')],null,util['format'](_0xb96d('0x7e'),_0x40ce0e[_0xb96d('0x71')],_0x40ce0e[_0xb96d('0x7a')][_0x1e8af8]['parentKey'],_0x40ce0e[_0xb96d('0x7a')][_0x1e8af8][_0xb96d('0x7d')],_0x40ce0e[_0xb96d('0x7a')][_0x1e8af8][_0xb96d('0x7f')]));}}}if(_0x40ce0e[_0xb96d('0x80')]){_0x40ce0e['conditions']=JSON[_0xb96d('0x7b')](_0x40ce0e['conditions']);_0x4515ad['where'](_0x24ff3c(_0x40ce0e[_0xb96d('0x80')][_0xb96d('0x66')]));}_0x37171c=_0x4515ad[_0xb96d('0x8a')]();_0x4515ad[_0xb96d('0x20')](_0x5ea1df);_0x4515ad[_0xb96d('0x1d')](0x0);return;}})[_0xb96d('0x25')](function(){if(_0x2622fc[_0xb96d('0x8b')]===_0xb96d('0x8c')){return null;}var _0x26fe17=_['merge'](_0x2622fc,{'name':_0x2622fc[_0xb96d('0x8d')]||_0x2622fc[_0xb96d('0x29')]||_0x40ce0e[_0xb96d('0x29')],'basename':_0x12a123,'savename':util[_0xb96d('0x76')](_0xb96d('0x8e'),_0x2622fc[_0xb96d('0x29')]||_0x40ce0e[_0xb96d('0x29')],require(_0xb96d('0x8f'))[_0xb96d('0x90')](0x4),_0x2622fc[_0xb96d('0x8b')]||_0xb96d('0x91')),'reportId':_0x40ce0e['id'],'reportType':_0xb96d('0x92')});return db[_0xb96d('0x93')]['create'](_0x26fe17,{'raw':!![]});})['then'](function(_0x32fad0){if(_0x40ce0e[_0xb96d('0x71')]==='cdr'){_0x37171c[_0xb96d('0x3a')](_0x40ce0e[_0xb96d('0x71')]+_0xb96d('0x94'),_0x2622fc[_0xb96d('0x95')],_0x2622fc['endDate']);}else{_0x37171c[_0xb96d('0x3a')](_0x40ce0e['table']+_0xb96d('0x96'),_0x2622fc['startDate'],_0x2622fc[_0xb96d('0x97')]);}if(_0x32fad0){logger[_0xb96d('0x98')](_0xb96d('0x99'),_0x37171c[_0xb96d('0x82')]());require('child_process')[_0xb96d('0x9a')](path[_0xb96d('0x86')](__dirname,'../../components/export/',_0x32fad0[_0xb96d('0x8b')]),[_0x32fad0['id'],_0x37171c[_0xb96d('0x82')](),path['join'](__dirname,'../../files/reports',_0x32fad0['savename']),_0x12a123]);return _0x32fad0;}else{var _0xb3e0b3=squel['select']();_0xb3e0b3[_0xb96d('0x70')]('('+_0x37171c['toString']()+')',_0xb96d('0x9b'));_0xb3e0b3[_0xb96d('0x67')]('COUNT(*)',_0xb96d('0x1f'));_0x37171c['limit'](_0x2622fc[_0xb96d('0x20')]||_0x5ea1df);_0x37171c[_0xb96d('0x1d')](_0x2622fc[_0xb96d('0x1d')]||0x0);return dbH[_0xb96d('0x83')][_0xb96d('0x2f')](_0xb3e0b3[_0xb96d('0x82')](),{'type':dbH[_0xb96d('0x83')][_0xb96d('0x84')][_0xb96d('0x85')]})[_0xb96d('0x25')](function(_0x4baab1){if(!_0x4baab1[_0xb96d('0x35')]){_0x2cea3b=0x0;}else{_0x2cea3b=_0x4baab1[0x0][_0xb96d('0x1f')]||0x0;}return dbH[_0xb96d('0x83')][_0xb96d('0x2f')](_0x37171c[_0xb96d('0x82')](),{'type':dbH[_0xb96d('0x83')][_0xb96d('0x84')][_0xb96d('0x85')]});})[_0xb96d('0x25')](function(_0x10f801){return{'rows':_0x10f801||[],'count':_0x2cea3b};});}});}exports[_0xb96d('0x9c')]=function(_0x55c70b,_0x1b91eb){return runReport(_0x55c70b[_0xb96d('0x41')],_0x55c70b['query'],_0x55c70b[_0xb96d('0x3d')])[_0xb96d('0x25')](respondWithResult(_0x1b91eb,null))[_0xb96d('0x50')](handleError(_0x1b91eb,null));};exports[_0xb96d('0x9d')]=runReport;exports[_0xb96d('0x2f')]=function(_0x140adc,_0x60bfa6){var _0x6c57c8=0xa;var _0x2407e1=['join',_0xb96d('0x54'),_0xb96d('0x55'),_0xb96d('0x87')];var _0xb6a093={'SUM':_0xb96d('0x9e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb96d('0x58'),'MIN':'MIN(%s)','AVG':_0xb96d('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb96d('0x5b'),'GROUP_CONCAT DESC':_0xb96d('0x5c')};var _0x4f3db0={'SEC_TO_TIME':_0xb96d('0x5d'),'DATE':_0xb96d('0x5e'),'HOUR':_0xb96d('0x5f'),'ROUND':_0xb96d('0x9f'),'UNIX_TIMESTAMP':_0xb96d('0x88')};var _0x1244e9=function(_0x232e19){return!_[_0xb96d('0x60')]([_0xb96d('0x61'),_0xb96d('0x62'),_0xb96d('0xa0'),_0xb96d('0x63')],_0x232e19);};var _0x36f2e0=function(_0xc08d5f){if(!_0xc08d5f||!_0xc08d5f[_0xb96d('0x64')][_0xb96d('0x35')]){return'';}for(var _0x293531='(',_0x58acb1=0x0;_0x58acb1<_0xc08d5f[_0xb96d('0x64')][_0xb96d('0x35')];_0x58acb1+=0x1){_0x58acb1>0x0&&(_0x293531+='\x20'+_0xc08d5f[_0xb96d('0x65')]+'\x20');_0x293531+=_0xc08d5f[_0xb96d('0x64')][_0x58acb1][_0xb96d('0x66')]?_0x36f2e0(_0xc08d5f[_0xb96d('0x64')][_0x58acb1][_0xb96d('0x66')]):_0xc08d5f[_0xb96d('0x64')][_0x58acb1][_0xb96d('0x67')]+'\x20'+_0xc08d5f[_0xb96d('0x64')][_0x58acb1][_0xb96d('0x68')]+(_0x1244e9(_0xc08d5f[_0xb96d('0x64')][_0x58acb1][_0xb96d('0x68')])?'\x20'+_0xc08d5f[_0xb96d('0x64')][_0x58acb1][_0xb96d('0x69')]:'');}return _0x293531+')';};var _0x1376d7={'where':{'id':_0x140adc[_0xb96d('0x41')]['id']}},_0x1449ae,_0x367cf7,_0x2055bf,_0x5c2036,_0x17b113;_0x1376d7=_['merge']({},_0x1376d7,_0x140adc[_0xb96d('0x3d')]);return db[_0xb96d('0x2c')][_0xb96d('0x45')](_0x1376d7)[_0xb96d('0x25')](function(_0x40f6d3){if(_0x40f6d3){_0x1449ae=_0x40f6d3;return _0x40f6d3['getFields']();}return null;})[_0xb96d('0x25')](function(_0x4eb378){if(_0x4eb378){if(!_0x4eb378[_0xb96d('0x35')]){throw new db[(_0xb96d('0x6b'))][(_0xb96d('0x89'))](_0xb96d('0x6c'),0x193);}_0x367cf7=_0x4eb378;return db['AnalyticMetric'][_0xb96d('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x5dc742){if(_0x5dc742){_0x2055bf=_['keyBy'](_0x5dc742,'id');var _0x4fca85;var _0x2fa93f=squel[_0xb96d('0x6f')]();_0x2fa93f[_0xb96d('0x70')](_0x1449ae['table']);for(var _0x4a8bf5=0x0;_0x4a8bf5<_0x367cf7[_0xb96d('0x35')];_0x4a8bf5+=0x1){_0x4fca85=_0x367cf7[_0x4a8bf5]['MetricId']?_0x2055bf[_0x367cf7[_0x4a8bf5][_0xb96d('0x72')]]['metric']:_0x367cf7[_0x4a8bf5][_0xb96d('0x67')];_0x4fca85=_0x367cf7[_0x4a8bf5]['function']?_[_0xb96d('0x75')](_0xb6a093[_0x367cf7[_0x4a8bf5]['function']],'%s',_0x4fca85):_0x4fca85;_0x4fca85=_0x367cf7[_0x4a8bf5][_0xb96d('0x76')]?_[_0xb96d('0x75')](_0x4f3db0[_0x367cf7[_0x4a8bf5]['format']],'%s',_0x4fca85):_0x4fca85;if(_0x367cf7[_0x4a8bf5][_0xb96d('0x77')]){_0x2fa93f[_0xb96d('0x66')](_0x4fca85);}_0x367cf7[_0x4a8bf5][_0xb96d('0x78')]&&_0x2fa93f[_0xb96d('0x37')](_0x4fca85,_0x367cf7[_0x4a8bf5][_0xb96d('0x78')]==='DESC'?![]:!![]);_0x2fa93f[_0xb96d('0x67')](_0x4fca85,_0x367cf7[_0x4a8bf5][_0xb96d('0xa1')]||_0x4fca85);}if(_0x1449ae['joins']){_0x1449ae[_0xb96d('0x7a')]=JSON[_0xb96d('0x7b')](_0x1449ae[_0xb96d('0x7a')]);for(var _0x1e0241=0x0;_0x1e0241<_0x1449ae[_0xb96d('0x7a')][_0xb96d('0x35')];_0x1e0241+=0x1){if(_0x1449ae[_0xb96d('0x7a')][_0x1e0241]['type']&&_[_0xb96d('0x60')](_0x2407e1,_0x1449ae[_0xb96d('0x7a')][_0x1e0241][_0xb96d('0x2e')])&&_0x1449ae[_0xb96d('0x7a')][_0x1e0241][_0xb96d('0x7c')]&&_0x1449ae[_0xb96d('0x7a')][_0x1e0241][_0xb96d('0x7d')]&&_0x1449ae[_0xb96d('0x7a')][_0x1e0241][_0xb96d('0x7f')]){_0x2fa93f[_0x1449ae[_0xb96d('0x7a')][_0x1e0241][_0xb96d('0x2e')]](_0x1449ae[_0xb96d('0x7a')][_0x1e0241][_0xb96d('0x7d')],null,util[_0xb96d('0x76')]('%s.%s\x20=\x20%s.%s',_0x1449ae[_0xb96d('0x71')],_0x1449ae[_0xb96d('0x7a')][_0x1e0241][_0xb96d('0x7c')],_0x1449ae[_0xb96d('0x7a')][_0x1e0241]['foreignTable'],_0x1449ae['joins'][_0x1e0241][_0xb96d('0x7f')]));}}}if(_0x1449ae[_0xb96d('0x80')]){_0x1449ae[_0xb96d('0x80')]=JSON[_0xb96d('0x7b')](_0x1449ae[_0xb96d('0x80')]);_0x2fa93f['where'](_0x36f2e0(_0x1449ae[_0xb96d('0x80')][_0xb96d('0x66')]));}_0x17b113=_0x2fa93f[_0xb96d('0x8a')]();_0x2fa93f[_0xb96d('0x20')](_0x6c57c8);_0x2fa93f['offset'](0x0);logger[_0xb96d('0xa2')](_0xb96d('0x81'),_0x2fa93f['toString']());return dbH[_0xb96d('0x83')][_0xb96d('0x2f')](_0x2fa93f[_0xb96d('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0xb96d('0x85')]});}})['then'](function(){return{'sql':_0x17b113[_0xb96d('0x82')]()};})['then'](respondWithResult(_0x60bfa6,null))[_0xb96d('0x50')](handleError(_0x60bfa6,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index ab3a215..2db1cf7 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 _0xe3fb=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe3fb,0x9c));var _0xbe3f=function(_0x21d1eb,_0x56f664){_0x21d1eb=_0x21d1eb-0x0;var _0x4cb8cd=_0xe3fb[_0x21d1eb];return _0x4cb8cd;};'use strict';var _=require(_0xbe3f('0x0'));var util=require('util');var logger=require(_0xbe3f('0x1'))(_0xbe3f('0x2'));var moment=require('moment');var BPromise=require(_0xbe3f('0x3'));var rp=require(_0xbe3f('0x4'));var fs=require('fs');var path=require(_0xbe3f('0x5'));var rimraf=require(_0xbe3f('0x6'));var config=require(_0xbe3f('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0xbe3f('0x8')]=function(_0x331574,_0x14da19){return _0x331574[_0xbe3f('0x9')](_0xbe3f('0xa'),attributes,{'tableName':_0xbe3f('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x96ee=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','AnalyticCustomReport','lodash'];(function(_0x26cc43,_0x135965){var _0x25de4f=function(_0x36837d){while(--_0x36837d){_0x26cc43['push'](_0x26cc43['shift']());}};_0x25de4f(++_0x135965);}(_0x96ee,0x131));var _0xe96e=function(_0x395667,_0x45593a){_0x395667=_0x395667-0x0;var _0x5cdb8f=_0x96ee[_0x395667];return _0x5cdb8f;};'use strict';var _=require(_0xe96e('0x0'));var util=require(_0xe96e('0x1'));var logger=require(_0xe96e('0x2'))(_0xe96e('0x3'));var moment=require(_0xe96e('0x4'));var BPromise=require(_0xe96e('0x5'));var rp=require(_0xe96e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe96e('0x7'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x1dc1c0,_0x1af3ae){return _0x1dc1c0['define'](_0xe96e('0x8'),attributes,{'tableName':'analytics_custom_reports','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 6fec822..85ae479 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 _0x9937=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','ioredis'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x9937,0x1b4));var _0x7993=function(_0x268787,_0x328324){_0x268787=_0x268787-0x0;var _0x3f530f=_0x9937[_0x268787];return _0x3f530f;};'use strict';var _=require(_0x7993('0x0'));var util=require('util');var moment=require(_0x7993('0x1'));var BPromise=require(_0x7993('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7993('0x3'));var db=require(_0x7993('0x4'))['db'];var utils=require(_0x7993('0x5'));var logger=require(_0x7993('0x6'))(_0x7993('0x7'));var config=require(_0x7993('0x8'));var jayson=require(_0x7993('0x9'));var client=jayson[_0x7993('0xa')][_0x7993('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30fb1e,_0x484077,_0x43444e){return new BPromise(function(_0x2a19d2,_0x4029c9){return client['request'](_0x30fb1e,_0x43444e)[_0x7993('0xc')](function(_0x5a5e47){logger[_0x7993('0xd')](_0x7993('0xe'),_0x484077,_0x7993('0xf'));logger['debug'](_0x7993('0x10'),_0x484077,_0x7993('0xf'),JSON['stringify'](_0x5a5e47));if(_0x5a5e47[_0x7993('0x11')]){if(_0x5a5e47[_0x7993('0x11')]['code']===0x1f4){logger[_0x7993('0x11')](_0x7993('0xe'),_0x484077,_0x5a5e47['error']['message']);return _0x4029c9(_0x5a5e47[_0x7993('0x11')][_0x7993('0x12')]);}logger[_0x7993('0x11')](_0x7993('0xe'),_0x484077,_0x5a5e47['error']['message']);return _0x2a19d2(_0x5a5e47['error'][_0x7993('0x12')]);}else{logger[_0x7993('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x484077,_0x7993('0xf'));_0x2a19d2(_0x5a5e47['result']['message']);}})[_0x7993('0x13')](function(_0x37d1f4){logger[_0x7993('0x11')](_0x7993('0xe'),_0x484077,_0x37d1f4);_0x4029c9(_0x37d1f4);});});}
\ No newline at end of file
+var _0x525f=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x32b70b,_0x5749c4){var _0x459147=function(_0x1ba5a7){while(--_0x1ba5a7){_0x32b70b['push'](_0x32b70b['shift']());}};_0x459147(++_0x5749c4);}(_0x525f,0x64));var _0xf525=function(_0x2d010a,_0x515cfa){_0x2d010a=_0x2d010a-0x0;var _0x16e6d2=_0x525f[_0x2d010a];return _0x16e6d2;};'use strict';var _=require(_0xf525('0x0'));var util=require(_0xf525('0x1'));var moment=require(_0xf525('0x2'));var BPromise=require(_0xf525('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf525('0x4'));var db=require(_0xf525('0x5'))['db'];var utils=require(_0xf525('0x6'));var logger=require(_0xf525('0x7'))(_0xf525('0x8'));var config=require('../../config/environment');var jayson=require(_0xf525('0x9'));var client=jayson[_0xf525('0xa')][_0xf525('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x412592,_0x4f269c,_0x1e8a9b){return new BPromise(function(_0xd876f5,_0x55ccc4){return client[_0xf525('0xc')](_0x412592,_0x1e8a9b)['then'](function(_0x559e39){logger[_0xf525('0xd')](_0xf525('0xe'),_0x4f269c,_0xf525('0xf'));logger[_0xf525('0x10')](_0xf525('0x11'),_0x4f269c,_0xf525('0xf'),JSON[_0xf525('0x12')](_0x559e39));if(_0x559e39[_0xf525('0x13')]){if(_0x559e39['error'][_0xf525('0x14')]===0x1f4){logger[_0xf525('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4f269c,_0x559e39[_0xf525('0x13')][_0xf525('0x15')]);return _0x55ccc4(_0x559e39['error']['message']);}logger[_0xf525('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4f269c,_0x559e39[_0xf525('0x13')][_0xf525('0x15')]);return _0xd876f5(_0x559e39[_0xf525('0x13')][_0xf525('0x15')]);}else{logger[_0xf525('0xd')](_0xf525('0xe'),_0x4f269c,_0xf525('0xf'));_0xd876f5(_0x559e39[_0xf525('0x16')][_0xf525('0x15')]);}})[_0xf525('0x17')](function(_0x7212fc){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4f269c,_0x7212fc);_0x55ccc4(_0x7212fc);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a55053e..55cae8c 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 _0x9036=['/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9036,0x155));var _0x6903=function(_0x2709bd,_0x274e31){_0x2709bd=_0x2709bd-0x0;var _0x4b5d5c=_0x9036[_0x2709bd];return _0x4b5d5c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6903('0x0'));var express=require(_0x6903('0x1'));var router=express[_0x6903('0x2')]();var fs_extra=require(_0x6903('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6903('0x4'));var config=require(_0x6903('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x6903('0x6')]('/',auth[_0x6903('0x7')](),controller['index']);router[_0x6903('0x6')](_0x6903('0x8'),auth[_0x6903('0x7')](),controller[_0x6903('0x9')]);router[_0x6903('0x6')](_0x6903('0xa'),auth[_0x6903('0x7')](),controller['preview']);router[_0x6903('0x6')](_0x6903('0xb'),auth[_0x6903('0x7')](),controller[_0x6903('0xc')]);router[_0x6903('0x6')](_0x6903('0xd'),auth[_0x6903('0x7')](),controller[_0x6903('0xe')]);router[_0x6903('0xf')]('/',auth[_0x6903('0x7')](),controller[_0x6903('0x10')]);router[_0x6903('0x11')](_0x6903('0x8'),auth[_0x6903('0x7')](),controller[_0x6903('0x12')]);router[_0x6903('0x13')](_0x6903('0x8'),auth['isAuthenticated'](),controller[_0x6903('0x14')]);module[_0x6903('0x15')]=router;
\ No newline at end of file
+var _0xbd51=['create','/:id','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','post'];(function(_0x1b2058,_0x29a3e9){var _0x52e1bf=function(_0xfccdb5){while(--_0xfccdb5){_0x1b2058['push'](_0x1b2058['shift']());}};_0x52e1bf(++_0x29a3e9);}(_0xbd51,0x89));var _0x1bd5=function(_0x2869ed,_0x547407){_0x2869ed=_0x2869ed-0x0;var _0xc061d5=_0xbd51[_0x2869ed];return _0xc061d5;};'use strict';var multer=require('multer');var util=require(_0x1bd5('0x0'));var path=require(_0x1bd5('0x1'));var timeout=require(_0x1bd5('0x2'));var express=require('express');var router=express[_0x1bd5('0x3')]();var fs_extra=require(_0x1bd5('0x4'));var auth=require(_0x1bd5('0x5'));var interaction=require(_0x1bd5('0x6'));var config=require(_0x1bd5('0x7'));var controller=require(_0x1bd5('0x8'));router[_0x1bd5('0x9')]('/',auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xb')]);router[_0x1bd5('0x9')]('/:id',auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xc')]);router[_0x1bd5('0x9')](_0x1bd5('0xd'),auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xe')]);router[_0x1bd5('0x9')](_0x1bd5('0xf'),auth[_0x1bd5('0xa')](),controller['run']);router[_0x1bd5('0x9')]('/:id/query',auth[_0x1bd5('0xa')](),controller['query']);router[_0x1bd5('0x10')]('/',auth[_0x1bd5('0xa')](),controller[_0x1bd5('0x11')]);router['put'](_0x1bd5('0x12'),auth[_0x1bd5('0xa')](),controller[_0x1bd5('0x13')]);router[_0x1bd5('0x14')](_0x1bd5('0x12'),auth[_0x1bd5('0xa')](),controller['destroy']);module[_0x1bd5('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index aed0213..d3d9a0c 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 _0x5d58=['TEXT','STRING'];(function(_0xdb8a50,_0x5c5a10){var _0x145296=function(_0x507357){while(--_0x507357){_0xdb8a50['push'](_0xdb8a50['shift']());}};_0x145296(++_0x5c5a10);}(_0x5d58,0x187));var _0x85d5=function(_0x2c5f95,_0x1bd928){_0x2c5f95=_0x2c5f95-0x0;var _0x2931da=_0x5d58[_0x2c5f95];return _0x2931da;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf494,0x1c6));var _0x4f49=function(_0x2386f2,_0x44a57b){_0x2386f2=_0x2386f2-0x0;var _0x587a2a=_0xf494[_0x2386f2];return _0x587a2a;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index bdfb3da..6d46c08 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x441fae,_0x3ab2ee){var _0x189025=function(_0x4914e1){while(--_0x4914e1){_0x441fae['push'](_0x441fae['shift']());}};_0x189025(++_0x3ab2ee);}(_0xba34,0x119));var _0x4ba3=function(_0x35987d,_0x3634ee){_0x35987d=_0x35987d-0x0;var _0x274b86=_0xba34[_0x35987d];return _0x274b86;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
+var _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x41320f,_0x28a6fa){var _0x555dc7=function(_0x22de94){while(--_0x22de94){_0x41320f['push'](_0x41320f['shift']());}};_0x555dc7(++_0x28a6fa);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x5e0251,_0x3da697){_0x5e0251=_0x5e0251-0x0;var _0x30f995=_0x3f8a[_0x5e0251];return _0x30f995;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 2dbabfb..f4e4d90 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 _0x0803=['bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x0803,0xd4));var _0x3080=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0803[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3080('0x0'));var util=require(_0x3080('0x1'));var logger=require(_0x3080('0x2'))(_0x3080('0x3'));var moment=require('moment');var BPromise=require(_0x3080('0x4'));var rp=require(_0x3080('0x5'));var fs=require('fs');var path=require(_0x3080('0x6'));var rimraf=require('rimraf');var config=require(_0x3080('0x7'));var attributes=require(_0x3080('0x8'));module[_0x3080('0x9')]=function(_0xf39c0a,_0x348a9e){return _0xf39c0a['define'](_0x3080('0xa'),attributes,{'tableName':_0x3080('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7615=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x33dc24,_0x4de4c2){var _0x5b67d4=function(_0x24aac8){while(--_0x24aac8){_0x33dc24['push'](_0x33dc24['shift']());}};_0x5b67d4(++_0x4de4c2);}(_0x7615,0x16c));var _0x5761=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x7615[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x5761('0x0'));var util=require(_0x5761('0x1'));var logger=require(_0x5761('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5761('0x3'));var rp=require(_0x5761('0x4'));var fs=require('fs');var path=require(_0x5761('0x5'));var rimraf=require(_0x5761('0x6'));var config=require(_0x5761('0x7'));var attributes=require(_0x5761('0x8'));module[_0x5761('0x9')]=function(_0x479a32,_0x37b01f){return _0x479a32[_0x5761('0xa')](_0x5761('0xb'),attributes,{'tableName':_0x5761('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index bd24086..09482c7 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 _0x963c=['request\x20sent','stringify','error','message','AnalyticDefaultReport,\x20%s,\x20%s','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2e1229,_0x41e7ef){var _0x47342a=function(_0x3dd0f8){while(--_0x3dd0f8){_0x2e1229['push'](_0x2e1229['shift']());}};_0x47342a(++_0x41e7ef);}(_0x963c,0x65));var _0xc963=function(_0x3b5a19,_0x3892be){_0x3b5a19=_0x3b5a19-0x0;var _0x29fee4=_0x963c[_0x3b5a19];return _0x29fee4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc963('0x0'));var BPromise=require(_0xc963('0x1'));var rs=require(_0xc963('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc963('0x3'))['db'];var utils=require(_0xc963('0x4'));var logger=require(_0xc963('0x5'))(_0xc963('0x6'));var config=require(_0xc963('0x7'));var jayson=require(_0xc963('0x8'));var client=jayson[_0xc963('0x9')][_0xc963('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4eadd0,_0x3d8fda,_0x4e60ba){return new BPromise(function(_0x4de941,_0x2be018){return client['request'](_0x4eadd0,_0x4e60ba)[_0xc963('0xb')](function(_0x5f0c8a){logger[_0xc963('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d8fda,_0xc963('0xd'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3d8fda,'request\x20sent',JSON[_0xc963('0xe')](_0x5f0c8a));if(_0x5f0c8a[_0xc963('0xf')]){if(_0x5f0c8a[_0xc963('0xf')]['code']===0x1f4){logger[_0xc963('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d8fda,_0x5f0c8a['error'][_0xc963('0x10')]);return _0x2be018(_0x5f0c8a[_0xc963('0xf')][_0xc963('0x10')]);}logger['error'](_0xc963('0x11'),_0x3d8fda,_0x5f0c8a['error'][_0xc963('0x10')]);return _0x4de941(_0x5f0c8a[_0xc963('0xf')]['message']);}else{logger['info'](_0xc963('0x11'),_0x3d8fda,_0xc963('0xd'));_0x4de941(_0x5f0c8a[_0xc963('0x12')][_0xc963('0x10')]);}})['catch'](function(_0xb601c){logger[_0xc963('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d8fda,_0xb601c);_0x2be018(_0xb601c);});});}
\ No newline at end of file
+var _0xe556=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xe556,0xd8));var _0x6e55=function(_0x24d402,_0x2576d8){_0x24d402=_0x24d402-0x0;var _0x25e745=_0xe556[_0x24d402];return _0x25e745;};'use strict';var _=require(_0x6e55('0x0'));var util=require(_0x6e55('0x1'));var moment=require(_0x6e55('0x2'));var BPromise=require(_0x6e55('0x3'));var rs=require(_0x6e55('0x4'));var fs=require('fs');var Redis=require(_0x6e55('0x5'));var db=require(_0x6e55('0x6'))['db'];var utils=require(_0x6e55('0x7'));var logger=require(_0x6e55('0x8'))(_0x6e55('0x9'));var config=require(_0x6e55('0xa'));var jayson=require(_0x6e55('0xb'));var client=jayson['client'][_0x6e55('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4dadcc,_0x1b58b4,_0x5e598c){return new BPromise(function(_0xcdbc5a,_0x43a3d4){return client['request'](_0x4dadcc,_0x5e598c)['then'](function(_0x41013e){logger[_0x6e55('0xd')](_0x6e55('0xe'),_0x1b58b4,_0x6e55('0xf'));logger[_0x6e55('0x10')](_0x6e55('0x11'),_0x1b58b4,_0x6e55('0xf'),JSON[_0x6e55('0x12')](_0x41013e));if(_0x41013e[_0x6e55('0x13')]){if(_0x41013e[_0x6e55('0x13')][_0x6e55('0x14')]===0x1f4){logger[_0x6e55('0x13')](_0x6e55('0xe'),_0x1b58b4,_0x41013e['error']['message']);return _0x43a3d4(_0x41013e[_0x6e55('0x13')][_0x6e55('0x15')]);}logger['error'](_0x6e55('0xe'),_0x1b58b4,_0x41013e[_0x6e55('0x13')][_0x6e55('0x15')]);return _0xcdbc5a(_0x41013e['error'][_0x6e55('0x15')]);}else{logger[_0x6e55('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1b58b4,_0x6e55('0xf'));_0xcdbc5a(_0x41013e['result']['message']);}})[_0x6e55('0x16')](function(_0x21994c){logger[_0x6e55('0x13')](_0x6e55('0xe'),_0x1b58b4,_0x21994c);_0x43a3d4(_0x21994c);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 0fb7632..5796d41 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 _0xa23d=['get','isAuthenticated','/:id','preview','/:id/run','run','query','create','update','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x26aa47,_0x3edb9b){var _0x471721=function(_0x4e1ebd){while(--_0x4e1ebd){_0x26aa47['push'](_0x26aa47['shift']());}};_0x471721(++_0x3edb9b);}(_0xa23d,0x119));var _0xda23=function(_0x3cb03c,_0x396ff0){_0x3cb03c=_0x3cb03c-0x0;var _0x1c533d=_0xa23d[_0x3cb03c];return _0x1c533d;};'use strict';var multer=require('multer');var util=require(_0xda23('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xda23('0x1'));var router=express[_0xda23('0x2')]();var fs_extra=require(_0xda23('0x3'));var auth=require(_0xda23('0x4'));var interaction=require(_0xda23('0x5'));var config=require(_0xda23('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0xda23('0x7')]('/',auth[_0xda23('0x8')](),controller['index']);router[_0xda23('0x7')](_0xda23('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xda23('0x7')]('/:id/preview',auth[_0xda23('0x8')](),controller[_0xda23('0xa')]);router[_0xda23('0x7')](_0xda23('0xb'),auth['isAuthenticated'](),controller[_0xda23('0xc')]);router['get']('/:id/query',auth[_0xda23('0x8')](),controller[_0xda23('0xd')]);router['post']('/',auth[_0xda23('0x8')](),controller[_0xda23('0xe')]);router['put'](_0xda23('0x9'),auth['isAuthenticated'](),controller[_0xda23('0xf')]);router['delete'](_0xda23('0x9'),auth[_0xda23('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc727=['put','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','/:id','preview','/:id/run','run','/:id/query','query','post','create'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0xc727,0x1e5));var _0x7c72=function(_0x5c9f98,_0x581815){_0x5c9f98=_0x5c9f98-0x0;var _0x1e56a1=_0xc727[_0x5c9f98];return _0x1e56a1;};'use strict';var multer=require(_0x7c72('0x0'));var util=require(_0x7c72('0x1'));var path=require(_0x7c72('0x2'));var timeout=require('connect-timeout');var express=require(_0x7c72('0x3'));var router=express[_0x7c72('0x4')]();var fs_extra=require(_0x7c72('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7c72('0x6'));var config=require(_0x7c72('0x7'));var controller=require(_0x7c72('0x8'));router['get']('/',auth[_0x7c72('0x9')](),controller['index']);router[_0x7c72('0xa')](_0x7c72('0xb'),auth[_0x7c72('0x9')](),controller['show']);router[_0x7c72('0xa')]('/:id/preview',auth[_0x7c72('0x9')](),controller[_0x7c72('0xc')]);router[_0x7c72('0xa')](_0x7c72('0xd'),auth[_0x7c72('0x9')](),controller[_0x7c72('0xe')]);router[_0x7c72('0xa')](_0x7c72('0xf'),auth[_0x7c72('0x9')](),controller[_0x7c72('0x10')]);router[_0x7c72('0x11')]('/',auth['isAuthenticated'](),controller[_0x7c72('0x12')]);router[_0x7c72('0x13')](_0x7c72('0xb'),auth[_0x7c72('0x9')](),controller['update']);router[_0x7c72('0x14')](_0x7c72('0xb'),auth[_0x7c72('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 6fcccb2..e8bb80e 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 _0xc75e=['DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','pdf'];(function(_0x4b14e4,_0x23593b){var _0xcb77b0=function(_0x256808){while(--_0x256808){_0x4b14e4['push'](_0x4b14e4['shift']());}};_0xcb77b0(++_0x23593b);}(_0xc75e,0x167));var _0xec75=function(_0x787d70,_0x2d6602){_0x787d70=_0x787d70-0x0;var _0x326b32=_0xc75e[_0x787d70];return _0x326b32;};'use strict';var Sequelize=require(_0xec75('0x0'));var moment=require('moment');module[_0xec75('0x1')]={'name':{'type':Sequelize[_0xec75('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xec75('0x3'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xec75('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xec75('0x4')]},'endDate':{'type':Sequelize[_0xec75('0x4')]},'status':{'type':Sequelize[_0xec75('0x2')],'defaultValue':_0xec75('0x5')},'type':{'type':Sequelize[_0xec75('0x6')](_0xec75('0x7'),_0xec75('0x8')),'allowNull':![],'defaultValue':_0xec75('0x7')},'reportId':{'type':Sequelize[_0xec75('0x9')](0xb)[_0xec75('0xa')]},'reportType':{'type':Sequelize[_0xec75('0x2')]}};
\ No newline at end of file
+var _0xdb84=['exports','STRING','csv','xlsx','DATE','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x15f22f,_0x4f44a5){var _0x35bc1b=function(_0x26a312){while(--_0x26a312){_0x15f22f['push'](_0x15f22f['shift']());}};_0x35bc1b(++_0x4f44a5);}(_0xdb84,0x76));var _0x4db8=function(_0x5adf77,_0x805933){_0x5adf77=_0x5adf77-0x0;var _0x48b099=_0xdb84[_0x5adf77];return _0x48b099;};'use strict';var Sequelize=require(_0x4db8('0x0'));var moment=require(_0x4db8('0x1'));module[_0x4db8('0x2')]={'name':{'type':Sequelize[_0x4db8('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x4db8('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x4db8('0x4'),'pdf',_0x4db8('0x5')),'allowNull':![],'defaultValue':_0x4db8('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x4db8('0x6')]},'endDate':{'type':Sequelize[_0x4db8('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x4db8('0x7')](_0x4db8('0x8'),_0x4db8('0x9')),'allowNull':![],'defaultValue':_0x4db8('0x8')},'reportId':{'type':Sequelize[_0x4db8('0xa')](0xb)[_0x4db8('0xb')]},'reportType':{'type':Sequelize[_0x4db8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index f1a2dd4..8ac92d2 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 _0xe286=['request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','ExtractedReports','UserProfileResource','then','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','catch','params','rawAttributes','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','download','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x3aa859,_0x439f05){var _0x51ac7c=function(_0x1be030){while(--_0x1be030){_0x3aa859['push'](_0x3aa859['shift']());}};_0x51ac7c(++_0x439f05);}(_0xe286,0x1bf));var _0x6e28=function(_0x446591,_0x2fe3b6){_0x446591=_0x446591-0x0;var _0x39342a=_0xe286[_0x446591];return _0x39342a;};'use strict';var emlformat=require(_0x6e28('0x0'));var rimraf=require(_0x6e28('0x1'));var zipdir=require(_0x6e28('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e28('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6e28('0x4'));var path=require('path');var sox=require(_0x6e28('0x5'));var csv=require(_0x6e28('0x6'));var ejs=require(_0x6e28('0x7'));var fs=require('fs');var fs_extra=require(_0x6e28('0x8'));var _=require('lodash');var squel=require(_0x6e28('0x9'));var crypto=require(_0x6e28('0xa'));var jsforce=require(_0x6e28('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6e28('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6e28('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6e28('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6e28('0xe'));var utils=require('../../config/utils');var config=require(_0x6e28('0xf'));var licenseUtil=require(_0x6e28('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x314f7,_0x50cd11){_0x50cd11=_0x50cd11||0xcc;return function(_0x1572de){if(_0x1572de){return _0x314f7[_0x6e28('0x11')](_0x50cd11);}return _0x314f7['status'](_0x50cd11)[_0x6e28('0x12')]();};}function respondWithResult(_0x150444,_0x3c4f14){_0x3c4f14=_0x3c4f14||0xc8;return function(_0xc028bf){if(_0xc028bf){return _0x150444[_0x6e28('0x13')](_0x3c4f14)[_0x6e28('0x14')](_0xc028bf);}};}function respondWithFilteredResult(_0x376313,_0x1a36b9){return function(_0x582577){if(_0x582577){var _0x9fc2c7=typeof _0x1a36b9[_0x6e28('0x15')]===_0x6e28('0x16')&&typeof _0x1a36b9[_0x6e28('0x17')]==='undefined';var _0x67b771=_0x582577['count'];var _0x3a7fa5=_0x9fc2c7?0x0:_0x1a36b9[_0x6e28('0x15')];var _0x193dcd=_0x9fc2c7?_0x582577[_0x6e28('0x18')]:_0x1a36b9[_0x6e28('0x15')]+_0x1a36b9['limit'];var _0x1a59fa;if(_0x193dcd>=_0x67b771){_0x193dcd=_0x67b771;_0x1a59fa=0xc8;}else{_0x1a59fa=0xce;}_0x376313[_0x6e28('0x13')](_0x1a59fa);return _0x376313[_0x6e28('0x19')](_0x6e28('0x1a'),_0x3a7fa5+'-'+_0x193dcd+'/'+_0x67b771)[_0x6e28('0x14')](_0x582577);}return null;};}function patchUpdates(_0x279a03){return function(_0x3e3da9){try{jsonpatch['apply'](_0x3e3da9,_0x279a03,!![]);}catch(_0x1d6a12){return BPromise[_0x6e28('0x1b')](_0x1d6a12);}return _0x3e3da9[_0x6e28('0x1c')]();};}function saveUpdates(_0x2c9738,_0x42233b){return function(_0x31684d){if(_0x31684d){return _0x31684d[_0x6e28('0x1d')](_0x2c9738)['then'](function(_0x2d6129){return _0x2d6129;});}return null;};}function removeEntity(_0x3f3e05,_0x2e820d){return function(_0x107d28){if(_0x107d28){return _0x107d28[_0x6e28('0x1e')]()['then'](function(){var _0x402c00=_0x107d28['get']({'plain':!![]});var _0x4e05a5=_0x6e28('0x1f');return db[_0x6e28('0x20')][_0x6e28('0x1e')]({'where':{'type':_0x4e05a5,'resourceId':_0x402c00['id']}})[_0x6e28('0x21')](function(){return _0x107d28;});})['then'](function(){_0x3f3e05[_0x6e28('0x13')](0xcc)[_0x6e28('0x12')]();});}};}function handleEntityNotFound(_0x2ccefd,_0x98ea2e){return function(_0xa3e683){if(!_0xa3e683){_0x2ccefd[_0x6e28('0x11')](0x194);}return _0xa3e683;};}function handleError(_0x3be9bf,_0x468965){_0x468965=_0x468965||0x1f4;return function(_0x2b1c4e){logger[_0x6e28('0x22')](_0x2b1c4e[_0x6e28('0x23')]);if(_0x2b1c4e[_0x6e28('0x24')]){delete _0x2b1c4e['name'];}_0x3be9bf[_0x6e28('0x13')](_0x468965)[_0x6e28('0x25')](_0x2b1c4e);};}exports[_0x6e28('0x26')]=function(_0x5e1920,_0x189ade){var _0x45f771={},_0x3208ca={},_0x43a9a9={'count':0x0,'rows':[]};var _0x55455d=_[_0x6e28('0x27')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x51fad7){return{'name':_0x51fad7[_0x6e28('0x28')],'type':_0x51fad7[_0x6e28('0x29')]['key']};});_0x3208ca[_0x6e28('0x2a')]=_['map'](_0x55455d,_0x6e28('0x24'));_0x3208ca[_0x6e28('0x2b')]=_[_0x6e28('0x2c')](_0x5e1920[_0x6e28('0x2b')]);_0x3208ca[_0x6e28('0x2d')]=_['intersection'](_0x3208ca['model'],_0x3208ca[_0x6e28('0x2b')]);_0x45f771[_0x6e28('0x2e')]=_[_0x6e28('0x2f')](_0x3208ca[_0x6e28('0x2a')],qs[_0x6e28('0x30')](_0x5e1920[_0x6e28('0x2b')][_0x6e28('0x30')]));_0x45f771[_0x6e28('0x2e')]=_0x45f771['attributes'][_0x6e28('0x31')]?_0x45f771[_0x6e28('0x2e')]:_0x3208ca[_0x6e28('0x2a')];if(!_0x5e1920[_0x6e28('0x2b')][_0x6e28('0x32')](_0x6e28('0x33'))){_0x45f771[_0x6e28('0x17')]=qs[_0x6e28('0x17')](_0x5e1920[_0x6e28('0x2b')][_0x6e28('0x17')]);_0x45f771[_0x6e28('0x15')]=qs['offset'](_0x5e1920[_0x6e28('0x2b')][_0x6e28('0x15')]);}_0x45f771[_0x6e28('0x34')]=qs[_0x6e28('0x35')](_0x5e1920[_0x6e28('0x2b')]['sort']);_0x45f771[_0x6e28('0x36')]=qs[_0x6e28('0x2d')](_['pick'](_0x5e1920[_0x6e28('0x2b')],_0x3208ca[_0x6e28('0x2d')]),_0x55455d);if(_0x5e1920[_0x6e28('0x2b')][_0x6e28('0x37')]){_0x45f771['where']=_[_0x6e28('0x38')](_0x45f771[_0x6e28('0x36')],{'$or':_[_0x6e28('0x27')](_0x55455d,function(_0x33e651){if(_0x33e651['type']!==_0x6e28('0x39')){var _0x476567={};_0x476567[_0x33e651[_0x6e28('0x24')]]={'$like':'%'+_0x5e1920['query'][_0x6e28('0x37')]+'%'};return _0x476567;}})});}_0x45f771=_[_0x6e28('0x38')]({},_0x45f771,_0x5e1920[_0x6e28('0x3a')]);var _0x237520={'where':_0x45f771[_0x6e28('0x36')]};return db[_0x6e28('0x3b')][_0x6e28('0x18')](_0x237520)[_0x6e28('0x21')](function(_0x1d835c){_0x43a9a9['count']=_0x1d835c;if(_0x5e1920[_0x6e28('0x2b')][_0x6e28('0x3c')]){_0x45f771[_0x6e28('0x3d')]=[{'all':!![]}];}return db[_0x6e28('0x3b')][_0x6e28('0x3e')](_0x45f771);})['then'](function(_0xf192a0){_0x43a9a9['rows']=_0xf192a0;return _0x43a9a9;})['then'](respondWithFilteredResult(_0x189ade,_0x45f771))[_0x6e28('0x3f')](handleError(_0x189ade,null));};exports['show']=function(_0x185e4b,_0x57c3a8){var _0x42c62f={'raw':!![],'where':{'id':_0x185e4b[_0x6e28('0x40')]['id']}},_0x13402f={};_0x13402f['model']=_[_0x6e28('0x2c')](db[_0x6e28('0x3b')][_0x6e28('0x41')]);_0x13402f[_0x6e28('0x2b')]=_['keys'](_0x185e4b[_0x6e28('0x2b')]);_0x13402f['filters']=_['intersection'](_0x13402f[_0x6e28('0x2a')],_0x13402f[_0x6e28('0x2b')]);_0x42c62f['attributes']=_['intersection'](_0x13402f['model'],qs['fields'](_0x185e4b[_0x6e28('0x2b')][_0x6e28('0x30')]));_0x42c62f[_0x6e28('0x2e')]=_0x42c62f[_0x6e28('0x2e')]['length']?_0x42c62f[_0x6e28('0x2e')]:_0x13402f[_0x6e28('0x2a')];if(_0x185e4b[_0x6e28('0x2b')][_0x6e28('0x3c')]){_0x42c62f[_0x6e28('0x3d')]=[{'all':!![]}];}_0x42c62f=_['merge']({},_0x42c62f,_0x185e4b[_0x6e28('0x3a')]);return db[_0x6e28('0x3b')]['find'](_0x42c62f)['then'](handleEntityNotFound(_0x57c3a8,null))[_0x6e28('0x21')](respondWithResult(_0x57c3a8,null))['catch'](handleError(_0x57c3a8,null));};exports[_0x6e28('0x42')]=function(_0x326fd9,_0x73b5b){return db['AnalyticExtractedReport']['create'](_0x326fd9['body'],{})[_0x6e28('0x21')](function(_0x4e22e1){var _0x571a10=_0x326fd9[_0x6e28('0x43')][_0x6e28('0x44')]({'plain':!![]});if(!_0x571a10)throw new Error(_0x6e28('0x45'));if(_0x571a10[_0x6e28('0x46')]===_0x6e28('0x43')){var _0x23ada3=_0x4e22e1['get']({'plain':!![]});var _0x458de8=_0x6e28('0x1f');return db[_0x6e28('0x47')]['find']({'where':{'name':_0x458de8,'userProfileId':_0x571a10['userProfileId']},'raw':!![]})['then'](function(_0x47eb70){if(_0x47eb70&&_0x47eb70[_0x6e28('0x48')]===0x0){return db[_0x6e28('0x20')][_0x6e28('0x42')]({'name':_0x23ada3['name'],'resourceId':_0x23ada3['id'],'type':_0x47eb70['name'],'sectionId':_0x47eb70['id']},{})[_0x6e28('0x21')](function(){return _0x4e22e1;});}else{return _0x4e22e1;}})[_0x6e28('0x3f')](function(_0x6d83d0){logger[_0x6e28('0x22')](_0x6e28('0x49'),_0x6d83d0);throw _0x6d83d0;});}return _0x4e22e1;})[_0x6e28('0x21')](respondWithResult(_0x73b5b,0xc9))[_0x6e28('0x3f')](handleError(_0x73b5b,null));};exports['update']=function(_0x4cc98a,_0x427c7c){if(_0x4cc98a[_0x6e28('0x4a')]['id']){delete _0x4cc98a[_0x6e28('0x4a')]['id'];}return db[_0x6e28('0x3b')][_0x6e28('0x4b')]({'where':{'id':_0x4cc98a[_0x6e28('0x40')]['id']}})[_0x6e28('0x21')](handleEntityNotFound(_0x427c7c,null))[_0x6e28('0x21')](saveUpdates(_0x4cc98a[_0x6e28('0x4a')],null))[_0x6e28('0x21')](respondWithResult(_0x427c7c,null))[_0x6e28('0x3f')](handleError(_0x427c7c,null));};exports['destroy']=function(_0x419ec9,_0x17a8c6){return db[_0x6e28('0x3b')][_0x6e28('0x4b')]({'where':{'id':_0x419ec9[_0x6e28('0x40')]['id']}})[_0x6e28('0x21')](handleEntityNotFound(_0x17a8c6,null))[_0x6e28('0x21')](removeEntity(_0x17a8c6,null))[_0x6e28('0x3f')](handleError(_0x17a8c6,null));};exports[_0x6e28('0x4c')]=function(_0x1d8930,_0x19e012,_0x38abdc){return db[_0x6e28('0x3b')]['find']({'where':{'id':_0x1d8930[_0x6e28('0x40')]['id']},'attributes':[_0x6e28('0x24'),'basename','savename',_0x6e28('0x4d')],'raw':!![]})[_0x6e28('0x21')](handleEntityNotFound(_0x19e012,null))['then'](function(_0x312a66){if(_0x312a66){if(!fs[_0x6e28('0x4e')](path[_0x6e28('0x4f')](config[_0x6e28('0x50')],_0x6e28('0x51'),_0x312a66['savename']))){throw new db['Sequelize'][(_0x6e28('0x52'))](_0x6e28('0x53'));}if(_0x1d8930[_0x6e28('0x2b')][_0x6e28('0x54')]){return _0x19e012[_0x6e28('0x11')](0xc8);}return _0x19e012['download'](path[_0x6e28('0x4f')](config[_0x6e28('0x50')],_0x6e28('0x51'),_0x312a66[_0x6e28('0x55')]),util[_0x6e28('0x56')](_0x6e28('0x57'),_0x312a66[_0x6e28('0x58')]||_0x312a66['name'],_0x312a66[_0x6e28('0x4d')][_0x6e28('0x59')]()));}})[_0x6e28('0x3f')](handleError(_0x19e012,null));};
\ No newline at end of file
+var _0x09cf=['offset','Content-Range','apply','reject','save','update','then','UserProfileResource','error','stack','name','send','AnalyticExtractedReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count'];(function(_0x6c16b6,_0x1cb121){var _0x563a6f=function(_0x1caadb){while(--_0x1caadb){_0x6c16b6['push'](_0x6c16b6['shift']());}};_0x563a6f(++_0x1cb121);}(_0x09cf,0x1c7));var _0xf09c=function(_0x5d79cb,_0x2b29b8){_0x5d79cb=_0x5d79cb-0x0;var _0x490415=_0x09cf[_0x5d79cb];return _0x490415;};'use strict';var emlformat=require(_0xf09c('0x0'));var rimraf=require(_0xf09c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf09c('0x2'));var BPromise=require(_0xf09c('0x3'));var Mustache=require(_0xf09c('0x4'));var util=require(_0xf09c('0x5'));var path=require(_0xf09c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf09c('0x7'));var fs=require('fs');var fs_extra=require(_0xf09c('0x8'));var _=require(_0xf09c('0x9'));var squel=require(_0xf09c('0xa'));var crypto=require(_0xf09c('0xb'));var jsforce=require(_0xf09c('0xc'));var deskjs=require(_0xf09c('0xd'));var toCsv=require(_0xf09c('0xe'));var querystring=require(_0xf09c('0xf'));var Papa=require('papaparse');var Redis=require(_0xf09c('0x10'));var authService=require(_0xf09c('0x11'));var qs=require(_0xf09c('0x12'));var as=require(_0xf09c('0x13'));var hardwareService=require(_0xf09c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf09c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf09c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a146b,_0x32317c){_0x32317c=_0x32317c||0xcc;return function(_0x4b7525){if(_0x4b7525){return _0x5a146b[_0xf09c('0x17')](_0x32317c);}return _0x5a146b[_0xf09c('0x18')](_0x32317c)[_0xf09c('0x19')]();};}function respondWithResult(_0x8ee833,_0x28e519){_0x28e519=_0x28e519||0xc8;return function(_0x2c7421){if(_0x2c7421){return _0x8ee833[_0xf09c('0x18')](_0x28e519)[_0xf09c('0x1a')](_0x2c7421);}};}function respondWithFilteredResult(_0x5a4bf3,_0x30b97f){return function(_0x1ba995){if(_0x1ba995){var _0x1016ed=typeof _0x30b97f['offset']===_0xf09c('0x1b')&&typeof _0x30b97f[_0xf09c('0x1c')]===_0xf09c('0x1b');var _0x5687ff=_0x1ba995[_0xf09c('0x1d')];var _0x8838aa=_0x1016ed?0x0:_0x30b97f['offset'];var _0x4bc268=_0x1016ed?_0x1ba995[_0xf09c('0x1d')]:_0x30b97f[_0xf09c('0x1e')]+_0x30b97f[_0xf09c('0x1c')];var _0x36fa1e;if(_0x4bc268>=_0x5687ff){_0x4bc268=_0x5687ff;_0x36fa1e=0xc8;}else{_0x36fa1e=0xce;}_0x5a4bf3[_0xf09c('0x18')](_0x36fa1e);return _0x5a4bf3['set'](_0xf09c('0x1f'),_0x8838aa+'-'+_0x4bc268+'/'+_0x5687ff)[_0xf09c('0x1a')](_0x1ba995);}return null;};}function patchUpdates(_0x164731){return function(_0x448f8d){try{jsonpatch[_0xf09c('0x20')](_0x448f8d,_0x164731,!![]);}catch(_0x2c6427){return BPromise[_0xf09c('0x21')](_0x2c6427);}return _0x448f8d[_0xf09c('0x22')]();};}function saveUpdates(_0x176ee5,_0x2ca422){return function(_0x1bfc11){if(_0x1bfc11){return _0x1bfc11[_0xf09c('0x23')](_0x176ee5)[_0xf09c('0x24')](function(_0x8923c1){return _0x8923c1;});}return null;};}function removeEntity(_0x3cec4a,_0x29f3a9){return function(_0xbb3ce7){if(_0xbb3ce7){return _0xbb3ce7['destroy']()[_0xf09c('0x24')](function(){var _0x2946ef=_0xbb3ce7['get']({'plain':!![]});var _0x3ba789='ExtractedReports';return db[_0xf09c('0x25')]['destroy']({'where':{'type':_0x3ba789,'resourceId':_0x2946ef['id']}})[_0xf09c('0x24')](function(){return _0xbb3ce7;});})[_0xf09c('0x24')](function(){_0x3cec4a[_0xf09c('0x18')](0xcc)[_0xf09c('0x19')]();});}};}function handleEntityNotFound(_0x4ae424,_0x2860f2){return function(_0x528ce3){if(!_0x528ce3){_0x4ae424[_0xf09c('0x17')](0x194);}return _0x528ce3;};}function handleError(_0x2befd4,_0x10d763){_0x10d763=_0x10d763||0x1f4;return function(_0x20718f){logger[_0xf09c('0x26')](_0x20718f[_0xf09c('0x27')]);if(_0x20718f['name']){delete _0x20718f[_0xf09c('0x28')];}_0x2befd4[_0xf09c('0x18')](_0x10d763)[_0xf09c('0x29')](_0x20718f);};}exports['index']=function(_0x4e78c5,_0x47db07){var _0xceb20b={},_0x2d37b2={},_0x2093aa={'count':0x0,'rows':[]};var _0x1a6b8f=_['map'](db[_0xf09c('0x2a')]['rawAttributes'],function(_0x4c1a90){return{'name':_0x4c1a90[_0xf09c('0x2b')],'type':_0x4c1a90[_0xf09c('0x2c')][_0xf09c('0x2d')]};});_0x2d37b2[_0xf09c('0x2e')]=_[_0xf09c('0x2f')](_0x1a6b8f,_0xf09c('0x28'));_0x2d37b2[_0xf09c('0x30')]=_[_0xf09c('0x31')](_0x4e78c5[_0xf09c('0x30')]);_0x2d37b2[_0xf09c('0x32')]=_[_0xf09c('0x33')](_0x2d37b2['model'],_0x2d37b2[_0xf09c('0x30')]);_0xceb20b[_0xf09c('0x34')]=_['intersection'](_0x2d37b2['model'],qs[_0xf09c('0x35')](_0x4e78c5[_0xf09c('0x30')][_0xf09c('0x35')]));_0xceb20b['attributes']=_0xceb20b[_0xf09c('0x34')][_0xf09c('0x36')]?_0xceb20b[_0xf09c('0x34')]:_0x2d37b2[_0xf09c('0x2e')];if(!_0x4e78c5[_0xf09c('0x30')][_0xf09c('0x37')](_0xf09c('0x38'))){_0xceb20b[_0xf09c('0x1c')]=qs[_0xf09c('0x1c')](_0x4e78c5['query'][_0xf09c('0x1c')]);_0xceb20b[_0xf09c('0x1e')]=qs[_0xf09c('0x1e')](_0x4e78c5[_0xf09c('0x30')][_0xf09c('0x1e')]);}_0xceb20b[_0xf09c('0x39')]=qs[_0xf09c('0x3a')](_0x4e78c5['query'][_0xf09c('0x3a')]);_0xceb20b[_0xf09c('0x3b')]=qs[_0xf09c('0x32')](_[_0xf09c('0x3c')](_0x4e78c5[_0xf09c('0x30')],_0x2d37b2[_0xf09c('0x32')]),_0x1a6b8f);if(_0x4e78c5[_0xf09c('0x30')][_0xf09c('0x3d')]){_0xceb20b[_0xf09c('0x3b')]=_[_0xf09c('0x3e')](_0xceb20b[_0xf09c('0x3b')],{'$or':_[_0xf09c('0x2f')](_0x1a6b8f,function(_0x1680d7){if(_0x1680d7[_0xf09c('0x2c')]!==_0xf09c('0x3f')){var _0x5f53ab={};_0x5f53ab[_0x1680d7[_0xf09c('0x28')]]={'$like':'%'+_0x4e78c5[_0xf09c('0x30')][_0xf09c('0x3d')]+'%'};return _0x5f53ab;}})});}_0xceb20b=_[_0xf09c('0x3e')]({},_0xceb20b,_0x4e78c5['options']);var _0x73df03={'where':_0xceb20b[_0xf09c('0x3b')]};return db[_0xf09c('0x2a')][_0xf09c('0x1d')](_0x73df03)[_0xf09c('0x24')](function(_0x541247){_0x2093aa[_0xf09c('0x1d')]=_0x541247;if(_0x4e78c5[_0xf09c('0x30')][_0xf09c('0x40')]){_0xceb20b[_0xf09c('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0xceb20b);})[_0xf09c('0x24')](function(_0x4f4d11){_0x2093aa[_0xf09c('0x42')]=_0x4f4d11;return _0x2093aa;})['then'](respondWithFilteredResult(_0x47db07,_0xceb20b))[_0xf09c('0x43')](handleError(_0x47db07,null));};exports[_0xf09c('0x44')]=function(_0xf5cffc,_0x180cad){var _0xcb73a0={'raw':!![],'where':{'id':_0xf5cffc[_0xf09c('0x45')]['id']}},_0x59e770={};_0x59e770['model']=_[_0xf09c('0x31')](db['AnalyticExtractedReport'][_0xf09c('0x46')]);_0x59e770[_0xf09c('0x30')]=_[_0xf09c('0x31')](_0xf5cffc[_0xf09c('0x30')]);_0x59e770[_0xf09c('0x32')]=_[_0xf09c('0x33')](_0x59e770[_0xf09c('0x2e')],_0x59e770['query']);_0xcb73a0[_0xf09c('0x34')]=_['intersection'](_0x59e770['model'],qs[_0xf09c('0x35')](_0xf5cffc['query']['fields']));_0xcb73a0[_0xf09c('0x34')]=_0xcb73a0[_0xf09c('0x34')]['length']?_0xcb73a0[_0xf09c('0x34')]:_0x59e770[_0xf09c('0x2e')];if(_0xf5cffc[_0xf09c('0x30')][_0xf09c('0x40')]){_0xcb73a0[_0xf09c('0x41')]=[{'all':!![]}];}_0xcb73a0=_[_0xf09c('0x3e')]({},_0xcb73a0,_0xf5cffc[_0xf09c('0x47')]);return db[_0xf09c('0x2a')][_0xf09c('0x48')](_0xcb73a0)[_0xf09c('0x24')](handleEntityNotFound(_0x180cad,null))[_0xf09c('0x24')](respondWithResult(_0x180cad,null))['catch'](handleError(_0x180cad,null));};exports[_0xf09c('0x49')]=function(_0x3b3f1c,_0x1d70be){return db['AnalyticExtractedReport'][_0xf09c('0x49')](_0x3b3f1c[_0xf09c('0x4a')],{})[_0xf09c('0x24')](function(_0x15f43f){var _0x4fdacb=_0x3b3f1c[_0xf09c('0x4b')]['get']({'plain':!![]});if(!_0x4fdacb)throw new Error(_0xf09c('0x4c'));if(_0x4fdacb[_0xf09c('0x4d')]==='user'){var _0xbe5ffb=_0x15f43f[_0xf09c('0x4e')]({'plain':!![]});var _0x58c599=_0xf09c('0x4f');return db[_0xf09c('0x50')]['find']({'where':{'name':_0x58c599,'userProfileId':_0x4fdacb[_0xf09c('0x51')]},'raw':!![]})[_0xf09c('0x24')](function(_0xedafb9){if(_0xedafb9&&_0xedafb9[_0xf09c('0x52')]===0x0){return db[_0xf09c('0x25')]['create']({'name':_0xbe5ffb[_0xf09c('0x28')],'resourceId':_0xbe5ffb['id'],'type':_0xedafb9[_0xf09c('0x28')],'sectionId':_0xedafb9['id']},{})['then'](function(){return _0x15f43f;});}else{return _0x15f43f;}})[_0xf09c('0x43')](function(_0x4d97e6){logger[_0xf09c('0x26')](_0xf09c('0x53'),_0x4d97e6);throw _0x4d97e6;});}return _0x15f43f;})[_0xf09c('0x24')](respondWithResult(_0x1d70be,0xc9))['catch'](handleError(_0x1d70be,null));};exports[_0xf09c('0x23')]=function(_0x30d6ec,_0x36c1a7){if(_0x30d6ec[_0xf09c('0x4a')]['id']){delete _0x30d6ec['body']['id'];}return db[_0xf09c('0x2a')]['find']({'where':{'id':_0x30d6ec[_0xf09c('0x45')]['id']}})[_0xf09c('0x24')](handleEntityNotFound(_0x36c1a7,null))[_0xf09c('0x24')](saveUpdates(_0x30d6ec['body'],null))[_0xf09c('0x24')](respondWithResult(_0x36c1a7,null))[_0xf09c('0x43')](handleError(_0x36c1a7,null));};exports['destroy']=function(_0x285aa0,_0x4b49fe){return db[_0xf09c('0x2a')][_0xf09c('0x48')]({'where':{'id':_0x285aa0[_0xf09c('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b49fe,null))[_0xf09c('0x24')](removeEntity(_0x4b49fe,null))[_0xf09c('0x43')](handleError(_0x4b49fe,null));};exports[_0xf09c('0x54')]=function(_0x33f091,_0x86ae7f,_0x595a6a){return db['AnalyticExtractedReport'][_0xf09c('0x48')]({'where':{'id':_0x33f091[_0xf09c('0x45')]['id']},'attributes':[_0xf09c('0x28'),_0xf09c('0x55'),_0xf09c('0x56'),_0xf09c('0x57')],'raw':!![]})[_0xf09c('0x24')](handleEntityNotFound(_0x86ae7f,null))['then'](function(_0x1dbb3d){if(_0x1dbb3d){if(!fs['existsSync'](path[_0xf09c('0x58')](config[_0xf09c('0x59')],_0xf09c('0x5a'),_0x1dbb3d[_0xf09c('0x56')]))){throw new db[(_0xf09c('0x5b'))][(_0xf09c('0x5c'))](_0xf09c('0x5d'));}if(_0x33f091['query'][_0xf09c('0x5e')]){return _0x86ae7f['sendStatus'](0xc8);}return _0x86ae7f[_0xf09c('0x54')](path[_0xf09c('0x58')](config['root'],_0xf09c('0x5a'),_0x1dbb3d['savename']),util['format'](_0xf09c('0x5f'),_0x1dbb3d[_0xf09c('0x55')]||_0x1dbb3d['name'],_0x1dbb3d[_0xf09c('0x57')][_0xf09c('0x60')]()));}})[_0xf09c('0x43')](handleError(_0x86ae7f,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 2d290a5..effed22 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 _0x83d9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0x398fdf,_0x5bba8c){var _0x48c965=function(_0x45f19f){while(--_0x45f19f){_0x398fdf['push'](_0x398fdf['shift']());}};_0x48c965(++_0x5bba8c);}(_0x83d9,0x8a));var _0x983d=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x83d9[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x983d('0x0'));var util=require(_0x983d('0x1'));var logger=require(_0x983d('0x2'))(_0x983d('0x3'));var moment=require(_0x983d('0x4'));var BPromise=require(_0x983d('0x5'));var rp=require(_0x983d('0x6'));var fs=require('fs');var path=require(_0x983d('0x7'));var rimraf=require(_0x983d('0x8'));var config=require(_0x983d('0x9'));var attributes=require(_0x983d('0xa'));module[_0x983d('0xb')]=function(_0x36223a,_0x2cf8b7){return _0x36223a[_0x983d('0xc')](_0x983d('0xd'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x30cc=['path','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','moment','bluebird','request-promise'];(function(_0x58dc50,_0x2af0b7){var _0x1fda34=function(_0x5cf61b){while(--_0x5cf61b){_0x58dc50['push'](_0x58dc50['shift']());}};_0x1fda34(++_0x2af0b7);}(_0x30cc,0xec));var _0xc30c=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0x30cc[_0x310d10];return _0x1fb8af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc30c('0x0'))('api');var moment=require(_0xc30c('0x1'));var BPromise=require(_0xc30c('0x2'));var rp=require(_0xc30c('0x3'));var fs=require('fs');var path=require(_0xc30c('0x4'));var rimraf=require('rimraf');var config=require(_0xc30c('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0xc30c('0x6')]=function(_0xc8f081,_0x285fac){return _0xc8f081[_0xc30c('0x7')](_0xc30c('0x8'),attributes,{'tableName':_0xc30c('0x9'),'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 9c3503f..f567cba 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 _0x761b=['rpc','../../config/environment','client','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x761b,0xa8));var _0xb761=function(_0x21bcc5,_0x3c0552){_0x21bcc5=_0x21bcc5-0x0;var _0xc62ace=_0x761b[_0x21bcc5];return _0xc62ace;};'use strict';var _=require(_0xb761('0x0'));var util=require(_0xb761('0x1'));var moment=require(_0xb761('0x2'));var BPromise=require(_0xb761('0x3'));var rs=require(_0xb761('0x4'));var fs=require('fs');var Redis=require(_0xb761('0x5'));var db=require(_0xb761('0x6'))['db'];var utils=require(_0xb761('0x7'));var logger=require('../../config/logger')(_0xb761('0x8'));var config=require(_0xb761('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb761('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1aaeaf,_0x103125,_0x51f718){return new BPromise(function(_0x260aaf,_0x6e12f8){return client[_0xb761('0xb')](_0x1aaeaf,_0x51f718)[_0xb761('0xc')](function(_0x39a155){logger['info'](_0xb761('0xd'),_0x103125,_0xb761('0xe'));logger['debug'](_0xb761('0xf'),_0x103125,_0xb761('0xe'),JSON['stringify'](_0x39a155));if(_0x39a155[_0xb761('0x10')]){if(_0x39a155[_0xb761('0x10')][_0xb761('0x11')]===0x1f4){logger[_0xb761('0x10')](_0xb761('0xd'),_0x103125,_0x39a155[_0xb761('0x10')][_0xb761('0x12')]);return _0x6e12f8(_0x39a155[_0xb761('0x10')][_0xb761('0x12')]);}logger[_0xb761('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x103125,_0x39a155[_0xb761('0x10')][_0xb761('0x12')]);return _0x260aaf(_0x39a155['error'][_0xb761('0x12')]);}else{logger[_0xb761('0x13')](_0xb761('0xd'),_0x103125,_0xb761('0xe'));_0x260aaf(_0x39a155[_0xb761('0x14')]['message']);}})[_0xb761('0x15')](function(_0x3b4d78){logger[_0xb761('0x10')](_0xb761('0xd'),_0x103125,_0x3b4d78);_0x6e12f8(_0x3b4d78);});});}
\ No newline at end of file
+var _0xc0c5=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x5bf6c9,_0x215c82){var _0x2dd545=function(_0x4bd6b2){while(--_0x4bd6b2){_0x5bf6c9['push'](_0x5bf6c9['shift']());}};_0x2dd545(++_0x215c82);}(_0xc0c5,0x7a));var _0x5c0c=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0xc0c5[_0x375492];return _0x18ba5b;};'use strict';var _=require(_0x5c0c('0x0'));var util=require(_0x5c0c('0x1'));var moment=require(_0x5c0c('0x2'));var BPromise=require(_0x5c0c('0x3'));var rs=require(_0x5c0c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c0c('0x5'));var logger=require(_0x5c0c('0x6'))(_0x5c0c('0x7'));var config=require(_0x5c0c('0x8'));var jayson=require(_0x5c0c('0x9'));var client=jayson[_0x5c0c('0xa')][_0x5c0c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23892b,_0x3789db,_0x207089){return new BPromise(function(_0x49e8cf,_0x13d385){return client[_0x5c0c('0xc')](_0x23892b,_0x207089)[_0x5c0c('0xd')](function(_0x182544){logger[_0x5c0c('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3789db,_0x5c0c('0xf'));logger['debug'](_0x5c0c('0x10'),_0x3789db,_0x5c0c('0xf'),JSON['stringify'](_0x182544));if(_0x182544[_0x5c0c('0x11')]){if(_0x182544[_0x5c0c('0x11')]['code']===0x1f4){logger[_0x5c0c('0x11')](_0x5c0c('0x12'),_0x3789db,_0x182544[_0x5c0c('0x11')]['message']);return _0x13d385(_0x182544['error'][_0x5c0c('0x13')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3789db,_0x182544[_0x5c0c('0x11')][_0x5c0c('0x13')]);return _0x49e8cf(_0x182544[_0x5c0c('0x11')][_0x5c0c('0x13')]);}else{logger[_0x5c0c('0xe')](_0x5c0c('0x12'),_0x3789db,'request\x20sent');_0x49e8cf(_0x182544['result'][_0x5c0c('0x13')]);}})[_0x5c0c('0x14')](function(_0x2580e3){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3789db,_0x2580e3);_0x13d385(_0x2580e3);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e1523ff..0047a2c 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 _0x1f38=['delete','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','create','update'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x1f38,0x1b1));var _0x81f3=function(_0x5d5ab2,_0x1d3681){_0x5d5ab2=_0x5d5ab2-0x0;var _0xb8fe37=_0x1f38[_0x5d5ab2];return _0xb8fe37;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x81f3('0x0'));var timeout=require(_0x81f3('0x1'));var express=require('express');var router=express[_0x81f3('0x2')]();var fs_extra=require(_0x81f3('0x3'));var auth=require(_0x81f3('0x4'));var interaction=require(_0x81f3('0x5'));var config=require(_0x81f3('0x6'));var controller=require(_0x81f3('0x7'));router['get']('/',auth[_0x81f3('0x8')](),controller[_0x81f3('0x9')]);router[_0x81f3('0xa')](_0x81f3('0xb'),auth[_0x81f3('0x8')](),controller['show']);router[_0x81f3('0xa')](_0x81f3('0xc'),auth[_0x81f3('0x8')](),controller[_0x81f3('0xd')]);router[_0x81f3('0xe')]('/',auth[_0x81f3('0x8')](),controller[_0x81f3('0xf')]);router['put'](_0x81f3('0xb'),auth[_0x81f3('0x8')](),controller[_0x81f3('0x10')]);router[_0x81f3('0x11')](_0x81f3('0xb'),auth[_0x81f3('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x2b8e=['download','post','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download'];(function(_0x1dae9c,_0x234f3c){var _0x4065b8=function(_0x4b827e){while(--_0x4b827e){_0x1dae9c['push'](_0x1dae9c['shift']());}};_0x4065b8(++_0x234f3c);}(_0x2b8e,0x159));var _0xe2b8=function(_0x6304fd,_0x361f88){_0x6304fd=_0x6304fd-0x0;var _0x1e6a29=_0x2b8e[_0x6304fd];return _0x1e6a29;};'use strict';var multer=require(_0xe2b8('0x0'));var util=require(_0xe2b8('0x1'));var path=require(_0xe2b8('0x2'));var timeout=require(_0xe2b8('0x3'));var express=require(_0xe2b8('0x4'));var router=express[_0xe2b8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe2b8('0x6'));var interaction=require(_0xe2b8('0x7'));var config=require(_0xe2b8('0x8'));var controller=require(_0xe2b8('0x9'));router[_0xe2b8('0xa')]('/',auth[_0xe2b8('0xb')](),controller['index']);router[_0xe2b8('0xa')](_0xe2b8('0xc'),auth[_0xe2b8('0xb')](),controller[_0xe2b8('0xd')]);router['get'](_0xe2b8('0xe'),auth[_0xe2b8('0xb')](),controller[_0xe2b8('0xf')]);router[_0xe2b8('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe2b8('0x11')](_0xe2b8('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe2b8('0x12')](_0xe2b8('0xc'),auth[_0xe2b8('0xb')](),controller[_0xe2b8('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index a53e66c..e70aeae 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 _0x0c76=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x2f2c2a,_0x308545){var _0x297c21=function(_0x1303a8){while(--_0x1303a8){_0x2f2c2a['push'](_0x2f2c2a['shift']());}};_0x297c21(++_0x308545);}(_0x0c76,0x190));var _0x60c7=function(_0x1a2ccf,_0x172b3f){_0x1a2ccf=_0x1a2ccf-0x0;var _0x48f6f2=_0x0c76[_0x1a2ccf];return _0x48f6f2;};'use strict';var Sequelize=require(_0x60c7('0x0'));module[_0x60c7('0x1')]={'field':{'type':Sequelize[_0x60c7('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x60c7('0x3')]},'format':{'type':Sequelize[_0x60c7('0x3')]},'groupBy':{'type':Sequelize[_0x60c7('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x60c7('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xdede=['exports','TEXT','STRING','BOOLEAN'];(function(_0x217551,_0x58f340){var _0x5edb32=function(_0x55bf70){while(--_0x55bf70){_0x217551['push'](_0x217551['shift']());}};_0x5edb32(++_0x58f340);}(_0xdede,0x148));var _0xeded=function(_0x5559a8,_0xd3f84){_0x5559a8=_0x5559a8-0x0;var _0x4899d8=_0xdede[_0x5559a8];return _0x4899d8;};'use strict';var Sequelize=require('sequelize');module[_0xeded('0x0')]={'field':{'type':Sequelize[_0xeded('0x1')]},'alias':{'type':Sequelize[_0xeded('0x2')]},'function':{'type':Sequelize[_0xeded('0x2')]},'format':{'type':Sequelize[_0xeded('0x2')]},'groupBy':{'type':Sequelize[_0xeded('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xeded('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 6b438b8..cadf28d 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 _0x4516=['send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','keys','includeAll','find','create','body','bulkCreate','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','name'];(function(_0x1fd27a,_0x4232f2){var _0x3681d8=function(_0x517801){while(--_0x517801){_0x1fd27a['push'](_0x1fd27a['shift']());}};_0x3681d8(++_0x4232f2);}(_0x4516,0xc5));var _0x6451=function(_0x1c9925,_0xd1718){_0x1c9925=_0x1c9925-0x0;var _0x430db0=_0x4516[_0x1c9925];return _0x430db0;};'use strict';var emlformat=require(_0x6451('0x0'));var rimraf=require(_0x6451('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6451('0x2'));var BPromise=require(_0x6451('0x3'));var Mustache=require(_0x6451('0x4'));var util=require(_0x6451('0x5'));var path=require(_0x6451('0x6'));var sox=require('sox');var csv=require(_0x6451('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6451('0x8'));var squel=require(_0x6451('0x9'));var crypto=require('crypto');var jsforce=require(_0x6451('0xa'));var deskjs=require(_0x6451('0xb'));var toCsv=require(_0x6451('0x7'));var querystring=require(_0x6451('0xc'));var Papa=require('papaparse');var Redis=require(_0x6451('0xd'));var authService=require(_0x6451('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6451('0xf'));var hardwareService=require(_0x6451('0x10'));var logger=require(_0x6451('0x11'))('api');var utils=require(_0x6451('0x12'));var config=require(_0x6451('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6451('0x14'))['db'];function respondWithStatusCode(_0x2f58b9,_0x252358){_0x252358=_0x252358||0xcc;return function(_0x45473f){if(_0x45473f){return _0x2f58b9[_0x6451('0x15')](_0x252358);}return _0x2f58b9[_0x6451('0x16')](_0x252358)['end']();};}function respondWithResult(_0x3182c4,_0x550317){_0x550317=_0x550317||0xc8;return function(_0x5c22af){if(_0x5c22af){return _0x3182c4[_0x6451('0x16')](_0x550317)[_0x6451('0x17')](_0x5c22af);}};}function respondWithFilteredResult(_0x50316a,_0x1ec796){return function(_0x39f9e5){if(_0x39f9e5){var _0x5454c9=typeof _0x1ec796[_0x6451('0x18')]===_0x6451('0x19')&&typeof _0x1ec796[_0x6451('0x1a')]==='undefined';var _0x453d22=_0x39f9e5[_0x6451('0x1b')];var _0x8e67ee=_0x5454c9?0x0:_0x1ec796[_0x6451('0x18')];var _0x36d414=_0x5454c9?_0x39f9e5[_0x6451('0x1b')]:_0x1ec796[_0x6451('0x18')]+_0x1ec796['limit'];var _0x524f6a;if(_0x36d414>=_0x453d22){_0x36d414=_0x453d22;_0x524f6a=0xc8;}else{_0x524f6a=0xce;}_0x50316a[_0x6451('0x16')](_0x524f6a);return _0x50316a[_0x6451('0x1c')](_0x6451('0x1d'),_0x8e67ee+'-'+_0x36d414+'/'+_0x453d22)['json'](_0x39f9e5);}return null;};}function patchUpdates(_0x153322){return function(_0x4d06b3){try{jsonpatch['apply'](_0x4d06b3,_0x153322,!![]);}catch(_0x58b598){return BPromise['reject'](_0x58b598);}return _0x4d06b3[_0x6451('0x1e')]();};}function saveUpdates(_0x30fd16,_0x58ad16){return function(_0x518818){if(_0x518818){return _0x518818[_0x6451('0x1f')](_0x30fd16)[_0x6451('0x20')](function(_0x2db7c1){return _0x2db7c1;});}return null;};}function removeEntity(_0xd6a2c3,_0x10f01c){return function(_0x437736){if(_0x437736){return _0x437736[_0x6451('0x21')]()[_0x6451('0x20')](function(){_0xd6a2c3[_0x6451('0x16')](0xcc)[_0x6451('0x22')]();});}};}function handleEntityNotFound(_0x31c010,_0x302022){return function(_0x101d4f){if(!_0x101d4f){_0x31c010[_0x6451('0x15')](0x194);}return _0x101d4f;};}function handleError(_0x13e1d4,_0x533e94){_0x533e94=_0x533e94||0x1f4;return function(_0x184222){logger[_0x6451('0x23')](_0x184222['stack']);if(_0x184222[_0x6451('0x24')]){delete _0x184222[_0x6451('0x24')];}_0x13e1d4['status'](_0x533e94)[_0x6451('0x25')](_0x184222);};}exports[_0x6451('0x26')]=function(_0x4be340,_0x19b9cf){var _0x38948c={},_0x200c03={},_0x2c4472={'count':0x0,'rows':[]};var _0x2d1747=_[_0x6451('0x27')](db[_0x6451('0x28')][_0x6451('0x29')],function(_0x1b7891){return{'name':_0x1b7891[_0x6451('0x2a')],'type':_0x1b7891[_0x6451('0x2b')][_0x6451('0x2c')]};});_0x200c03['model']=_[_0x6451('0x27')](_0x2d1747,_0x6451('0x24'));_0x200c03[_0x6451('0x2d')]=_['keys'](_0x4be340[_0x6451('0x2d')]);_0x200c03[_0x6451('0x2e')]=_[_0x6451('0x2f')](_0x200c03[_0x6451('0x30')],_0x200c03[_0x6451('0x2d')]);_0x38948c[_0x6451('0x31')]=_[_0x6451('0x2f')](_0x200c03[_0x6451('0x30')],qs[_0x6451('0x32')](_0x4be340[_0x6451('0x2d')][_0x6451('0x32')]));_0x38948c[_0x6451('0x31')]=_0x38948c[_0x6451('0x31')][_0x6451('0x33')]?_0x38948c['attributes']:_0x200c03['model'];if(!_0x4be340[_0x6451('0x2d')][_0x6451('0x34')](_0x6451('0x35'))){_0x38948c[_0x6451('0x1a')]=qs[_0x6451('0x1a')](_0x4be340[_0x6451('0x2d')][_0x6451('0x1a')]);_0x38948c[_0x6451('0x18')]=qs[_0x6451('0x18')](_0x4be340[_0x6451('0x2d')][_0x6451('0x18')]);}_0x38948c[_0x6451('0x36')]=qs[_0x6451('0x37')](_0x4be340[_0x6451('0x2d')][_0x6451('0x37')]);_0x38948c[_0x6451('0x38')]=qs[_0x6451('0x2e')](_['pick'](_0x4be340[_0x6451('0x2d')],_0x200c03[_0x6451('0x2e')]),_0x2d1747);if(_0x4be340[_0x6451('0x2d')]['filter']){_0x38948c['where']=_[_0x6451('0x39')](_0x38948c[_0x6451('0x38')],{'$or':_['map'](_0x2d1747,function(_0x59c6f8){if(_0x59c6f8[_0x6451('0x2b')]!==_0x6451('0x3a')){var _0x1a847c={};_0x1a847c[_0x59c6f8[_0x6451('0x24')]]={'$like':'%'+_0x4be340[_0x6451('0x2d')][_0x6451('0x3b')]+'%'};return _0x1a847c;}})});}_0x38948c=_[_0x6451('0x39')]({},_0x38948c,_0x4be340[_0x6451('0x3c')]);var _0x4f8808={'where':_0x38948c[_0x6451('0x38')]};return db[_0x6451('0x28')]['count'](_0x4f8808)[_0x6451('0x20')](function(_0x33e878){_0x2c4472[_0x6451('0x1b')]=_0x33e878;if(_0x4be340[_0x6451('0x2d')]['includeAll']){_0x38948c['include']=[{'all':!![]}];}return db[_0x6451('0x28')][_0x6451('0x3d')](_0x38948c);})['then'](function(_0x112199){_0x2c4472[_0x6451('0x3e')]=_0x112199;return _0x2c4472;})[_0x6451('0x20')](respondWithFilteredResult(_0x19b9cf,_0x38948c))[_0x6451('0x3f')](handleError(_0x19b9cf,null));};exports[_0x6451('0x40')]=function(_0x1c1da0,_0x3c7a82){var _0x5927f3={'raw':![],'where':{'id':_0x1c1da0[_0x6451('0x41')]['id']}},_0x43f8ab={};_0x43f8ab[_0x6451('0x30')]=_[_0x6451('0x42')](db[_0x6451('0x28')][_0x6451('0x29')]);_0x43f8ab['query']=_[_0x6451('0x42')](_0x1c1da0[_0x6451('0x2d')]);_0x43f8ab[_0x6451('0x2e')]=_[_0x6451('0x2f')](_0x43f8ab[_0x6451('0x30')],_0x43f8ab[_0x6451('0x2d')]);_0x5927f3[_0x6451('0x31')]=_[_0x6451('0x2f')](_0x43f8ab[_0x6451('0x30')],qs['fields'](_0x1c1da0[_0x6451('0x2d')][_0x6451('0x32')]));_0x5927f3['attributes']=_0x5927f3[_0x6451('0x31')]['length']?_0x5927f3[_0x6451('0x31')]:_0x43f8ab['model'];if(_0x1c1da0['query'][_0x6451('0x43')]){_0x5927f3['include']=[{'all':!![]}];}_0x5927f3=_[_0x6451('0x39')]({},_0x5927f3,_0x1c1da0[_0x6451('0x3c')]);return db[_0x6451('0x28')][_0x6451('0x44')](_0x5927f3)[_0x6451('0x20')](handleEntityNotFound(_0x3c7a82,null))[_0x6451('0x20')](respondWithResult(_0x3c7a82,null))[_0x6451('0x3f')](handleError(_0x3c7a82,null));};exports[_0x6451('0x45')]=function(_0x38e0c6,_0x23b50e){return db['AnalyticFieldReport'][_0x6451('0x45')](_0x38e0c6[_0x6451('0x46')],{})[_0x6451('0x20')](respondWithResult(_0x23b50e,0xc9))['catch'](handleError(_0x23b50e,null));};exports[_0x6451('0x47')]=function(_0xa3771d,_0x1dc17b){return db[_0x6451('0x28')][_0x6451('0x47')](_0xa3771d['body'],{'raw':![],'individualHooks':!![]})[_0x6451('0x20')](respondWithResult(_0x1dc17b,0xc9))[_0x6451('0x3f')](handleError(_0x1dc17b,null));};exports[_0x6451('0x1f')]=function(_0x1302c8,_0x39a766){if(_0x1302c8[_0x6451('0x46')]['id']){delete _0x1302c8[_0x6451('0x46')]['id'];}return db[_0x6451('0x28')]['find']({'where':{'id':_0x1302c8['params']['id']}})[_0x6451('0x20')](handleEntityNotFound(_0x39a766,null))[_0x6451('0x20')](saveUpdates(_0x1302c8[_0x6451('0x46')],null))['then'](respondWithResult(_0x39a766,null))[_0x6451('0x3f')](handleError(_0x39a766,null));};exports[_0x6451('0x21')]=function(_0x47dec0,_0x385c60){return db[_0x6451('0x28')][_0x6451('0x44')]({'where':{'id':_0x47dec0[_0x6451('0x41')]['id']}})[_0x6451('0x20')](handleEntityNotFound(_0x385c60,null))[_0x6451('0x20')](removeEntity(_0x385c60,null))[_0x6451('0x3f')](handleError(_0x385c60,null));};exports['bulkDestroy']=function(_0x1420c4,_0xb4a682){return db[_0x6451('0x28')][_0x6451('0x21')]({'where':{'id':_0x1420c4['query'][_0x6451('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x6451('0x20')](respondWithResult(_0xb4a682,0xcc))[_0x6451('0x3f')](handleError(_0xb4a682,null));};exports['addFields']=function(_0x4329ab,_0x29f1c6,_0x1e35a4){return db[_0x6451('0x49')][_0x6451('0x4a')]({'where':{'id':_0x4329ab['params']['id']}})[_0x6451('0x20')](handleEntityNotFound(_0x29f1c6,null))['then'](function(_0x5de2c2){if(_0x5de2c2){return db[_0x6451('0x4b')][_0x6451('0x4c')](function(_0x2a94cd){return db['AnalyticFieldReport'][_0x6451('0x21')]({'where':{'CustomReportId':_0x4329ab[_0x6451('0x41')]['id']},'transaction':_0x2a94cd})['then'](function(_0x4cd22d){var _0x44ed34=_['map'](_0x4329ab[_0x6451('0x46')],function(_0x15b752){delete _0x15b752['id'];_0x15b752[_0x6451('0x4d')]=_0x4329ab[_0x6451('0x41')]['id'];return _0x15b752;});return db[_0x6451('0x28')][_0x6451('0x47')](_0x44ed34,{'transaction':_0x2a94cd});});})[_0x6451('0x20')](function(){return db['AnalyticFieldReport'][_0x6451('0x3d')]({'where':{'CustomReportId':_0x4329ab['params']['id']}});});}})[_0x6451('0x20')](respondWithResult(_0x29f1c6,null))[_0x6451('0x3f')](handleError(_0x29f1c6,null));};
\ No newline at end of file
+var _0x1507=['end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','create','bulkCreate','body','find','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2dbe2e,_0x127139){var _0x2d6400=function(_0x344148){while(--_0x344148){_0x2dbe2e['push'](_0x2dbe2e['shift']());}};_0x2d6400(++_0x127139);}(_0x1507,0xdf));var _0x7150=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x1507[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7150('0x0'));var jsonpatch=require(_0x7150('0x1'));var rp=require(_0x7150('0x2'));var moment=require(_0x7150('0x3'));var BPromise=require(_0x7150('0x4'));var Mustache=require(_0x7150('0x5'));var util=require(_0x7150('0x6'));var path=require(_0x7150('0x7'));var sox=require(_0x7150('0x8'));var csv=require(_0x7150('0x9'));var ejs=require(_0x7150('0xa'));var fs=require('fs');var fs_extra=require(_0x7150('0xb'));var _=require(_0x7150('0xc'));var squel=require(_0x7150('0xd'));var crypto=require('crypto');var jsforce=require(_0x7150('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7150('0xf'));var Papa=require(_0x7150('0x10'));var Redis=require(_0x7150('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7150('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7150('0x13'));var logger=require('../../config/logger')(_0x7150('0x14'));var utils=require(_0x7150('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7150('0x16'));var db=require(_0x7150('0x17'))['db'];function respondWithStatusCode(_0x57b897,_0xf913d7){_0xf913d7=_0xf913d7||0xcc;return function(_0x1dd640){if(_0x1dd640){return _0x57b897[_0x7150('0x18')](_0xf913d7);}return _0x57b897[_0x7150('0x19')](_0xf913d7)[_0x7150('0x1a')]();};}function respondWithResult(_0xb17301,_0x2eaed9){_0x2eaed9=_0x2eaed9||0xc8;return function(_0x1065bd){if(_0x1065bd){return _0xb17301[_0x7150('0x19')](_0x2eaed9)[_0x7150('0x1b')](_0x1065bd);}};}function respondWithFilteredResult(_0x2e483f,_0x5ef2c7){return function(_0x5def86){if(_0x5def86){var _0x4e3c6a=typeof _0x5ef2c7[_0x7150('0x1c')]===_0x7150('0x1d')&&typeof _0x5ef2c7[_0x7150('0x1e')]===_0x7150('0x1d');var _0x1ed6b5=_0x5def86[_0x7150('0x1f')];var _0x4b93d3=_0x4e3c6a?0x0:_0x5ef2c7['offset'];var _0x29e14d=_0x4e3c6a?_0x5def86[_0x7150('0x1f')]:_0x5ef2c7[_0x7150('0x1c')]+_0x5ef2c7['limit'];var _0xf188df;if(_0x29e14d>=_0x1ed6b5){_0x29e14d=_0x1ed6b5;_0xf188df=0xc8;}else{_0xf188df=0xce;}_0x2e483f['status'](_0xf188df);return _0x2e483f[_0x7150('0x20')](_0x7150('0x21'),_0x4b93d3+'-'+_0x29e14d+'/'+_0x1ed6b5)[_0x7150('0x1b')](_0x5def86);}return null;};}function patchUpdates(_0x7d2809){return function(_0x199c94){try{jsonpatch['apply'](_0x199c94,_0x7d2809,!![]);}catch(_0x33d036){return BPromise['reject'](_0x33d036);}return _0x199c94[_0x7150('0x22')]();};}function saveUpdates(_0x160d49,_0x2e3eea){return function(_0x594849){if(_0x594849){return _0x594849[_0x7150('0x23')](_0x160d49)[_0x7150('0x24')](function(_0x3c88a9){return _0x3c88a9;});}return null;};}function removeEntity(_0x190321,_0x24ecc1){return function(_0x30e9a9){if(_0x30e9a9){return _0x30e9a9['destroy']()[_0x7150('0x24')](function(){_0x190321[_0x7150('0x19')](0xcc)[_0x7150('0x1a')]();});}};}function handleEntityNotFound(_0x35d2c9,_0x3fd423){return function(_0x4726e8){if(!_0x4726e8){_0x35d2c9[_0x7150('0x18')](0x194);}return _0x4726e8;};}function handleError(_0x5dd93f,_0xbaebe3){_0xbaebe3=_0xbaebe3||0x1f4;return function(_0x31b1c3){logger[_0x7150('0x25')](_0x31b1c3[_0x7150('0x26')]);if(_0x31b1c3['name']){delete _0x31b1c3[_0x7150('0x27')];}_0x5dd93f['status'](_0xbaebe3)[_0x7150('0x28')](_0x31b1c3);};}exports['index']=function(_0xe15340,_0xe17b06){var _0x203bc0={},_0x5d521c={},_0x397ea9={'count':0x0,'rows':[]};var _0x38d82b=_[_0x7150('0x29')](db[_0x7150('0x2a')][_0x7150('0x2b')],function(_0x16a6da){return{'name':_0x16a6da[_0x7150('0x2c')],'type':_0x16a6da[_0x7150('0x2d')][_0x7150('0x2e')]};});_0x5d521c[_0x7150('0x2f')]=_[_0x7150('0x29')](_0x38d82b,'name');_0x5d521c['query']=_[_0x7150('0x30')](_0xe15340[_0x7150('0x31')]);_0x5d521c[_0x7150('0x32')]=_['intersection'](_0x5d521c[_0x7150('0x2f')],_0x5d521c[_0x7150('0x31')]);_0x203bc0[_0x7150('0x33')]=_['intersection'](_0x5d521c['model'],qs[_0x7150('0x34')](_0xe15340['query'][_0x7150('0x34')]));_0x203bc0['attributes']=_0x203bc0[_0x7150('0x33')]['length']?_0x203bc0['attributes']:_0x5d521c[_0x7150('0x2f')];if(!_0xe15340[_0x7150('0x31')][_0x7150('0x35')](_0x7150('0x36'))){_0x203bc0[_0x7150('0x1e')]=qs[_0x7150('0x1e')](_0xe15340['query'][_0x7150('0x1e')]);_0x203bc0['offset']=qs[_0x7150('0x1c')](_0xe15340[_0x7150('0x31')][_0x7150('0x1c')]);}_0x203bc0['order']=qs['sort'](_0xe15340[_0x7150('0x31')][_0x7150('0x37')]);_0x203bc0[_0x7150('0x38')]=qs[_0x7150('0x32')](_[_0x7150('0x39')](_0xe15340[_0x7150('0x31')],_0x5d521c['filters']),_0x38d82b);if(_0xe15340[_0x7150('0x31')][_0x7150('0x3a')]){_0x203bc0['where']=_['merge'](_0x203bc0[_0x7150('0x38')],{'$or':_[_0x7150('0x29')](_0x38d82b,function(_0x18cecc){if(_0x18cecc[_0x7150('0x2d')]!==_0x7150('0x3b')){var _0x20a33c={};_0x20a33c[_0x18cecc[_0x7150('0x27')]]={'$like':'%'+_0xe15340[_0x7150('0x31')][_0x7150('0x3a')]+'%'};return _0x20a33c;}})});}_0x203bc0=_[_0x7150('0x3c')]({},_0x203bc0,_0xe15340['options']);var _0x37ce94={'where':_0x203bc0[_0x7150('0x38')]};return db['AnalyticFieldReport'][_0x7150('0x1f')](_0x37ce94)[_0x7150('0x24')](function(_0x108d50){_0x397ea9['count']=_0x108d50;if(_0xe15340['query'][_0x7150('0x3d')]){_0x203bc0[_0x7150('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x7150('0x3f')](_0x203bc0);})['then'](function(_0x505fd5){_0x397ea9[_0x7150('0x40')]=_0x505fd5;return _0x397ea9;})['then'](respondWithFilteredResult(_0xe17b06,_0x203bc0))[_0x7150('0x41')](handleError(_0xe17b06,null));};exports[_0x7150('0x42')]=function(_0x5a76a4,_0x36f158){var _0x152721={'raw':![],'where':{'id':_0x5a76a4[_0x7150('0x43')]['id']}},_0x45d945={};_0x45d945['model']=_['keys'](db[_0x7150('0x2a')]['rawAttributes']);_0x45d945['query']=_[_0x7150('0x30')](_0x5a76a4['query']);_0x45d945[_0x7150('0x32')]=_['intersection'](_0x45d945[_0x7150('0x2f')],_0x45d945[_0x7150('0x31')]);_0x152721[_0x7150('0x33')]=_[_0x7150('0x44')](_0x45d945[_0x7150('0x2f')],qs[_0x7150('0x34')](_0x5a76a4[_0x7150('0x31')][_0x7150('0x34')]));_0x152721[_0x7150('0x33')]=_0x152721[_0x7150('0x33')][_0x7150('0x45')]?_0x152721[_0x7150('0x33')]:_0x45d945[_0x7150('0x2f')];if(_0x5a76a4[_0x7150('0x31')][_0x7150('0x3d')]){_0x152721['include']=[{'all':!![]}];}_0x152721=_[_0x7150('0x3c')]({},_0x152721,_0x5a76a4[_0x7150('0x46')]);return db[_0x7150('0x2a')]['find'](_0x152721)[_0x7150('0x24')](handleEntityNotFound(_0x36f158,null))['then'](respondWithResult(_0x36f158,null))[_0x7150('0x41')](handleError(_0x36f158,null));};exports[_0x7150('0x47')]=function(_0x497caf,_0x50a689){return db['AnalyticFieldReport']['create'](_0x497caf['body'],{})[_0x7150('0x24')](respondWithResult(_0x50a689,0xc9))[_0x7150('0x41')](handleError(_0x50a689,null));};exports[_0x7150('0x48')]=function(_0x43dd8d,_0xf7dccd){return db['AnalyticFieldReport'][_0x7150('0x48')](_0x43dd8d[_0x7150('0x49')],{'raw':![],'individualHooks':!![]})[_0x7150('0x24')](respondWithResult(_0xf7dccd,0xc9))[_0x7150('0x41')](handleError(_0xf7dccd,null));};exports[_0x7150('0x23')]=function(_0x4591fa,_0x221be7){if(_0x4591fa[_0x7150('0x49')]['id']){delete _0x4591fa[_0x7150('0x49')]['id'];}return db['AnalyticFieldReport'][_0x7150('0x4a')]({'where':{'id':_0x4591fa[_0x7150('0x43')]['id']}})['then'](handleEntityNotFound(_0x221be7,null))[_0x7150('0x24')](saveUpdates(_0x4591fa[_0x7150('0x49')],null))[_0x7150('0x24')](respondWithResult(_0x221be7,null))[_0x7150('0x41')](handleError(_0x221be7,null));};exports['destroy']=function(_0x51630c,_0xc2e711){return db[_0x7150('0x2a')][_0x7150('0x4a')]({'where':{'id':_0x51630c['params']['id']}})[_0x7150('0x24')](handleEntityNotFound(_0xc2e711,null))['then'](removeEntity(_0xc2e711,null))['catch'](handleError(_0xc2e711,null));};exports[_0x7150('0x4b')]=function(_0x5ed409,_0x4a30aa){return db[_0x7150('0x2a')][_0x7150('0x4c')]({'where':{'id':_0x5ed409[_0x7150('0x31')][_0x7150('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x7150('0x24')](respondWithResult(_0x4a30aa,0xcc))[_0x7150('0x41')](handleError(_0x4a30aa,null));};exports[_0x7150('0x4e')]=function(_0x5ef15f,_0x5aff68,_0x3a9b3f){return db[_0x7150('0x4f')][_0x7150('0x50')]({'where':{'id':_0x5ef15f[_0x7150('0x43')]['id']}})[_0x7150('0x24')](handleEntityNotFound(_0x5aff68,null))['then'](function(_0x176a70){if(_0x176a70){return db[_0x7150('0x51')]['transaction'](function(_0x20b1c5){return db[_0x7150('0x2a')][_0x7150('0x4c')]({'where':{'CustomReportId':_0x5ef15f['params']['id']},'transaction':_0x20b1c5})[_0x7150('0x24')](function(_0x3bd311){var _0x37eb9a=_['map'](_0x5ef15f[_0x7150('0x49')],function(_0x1c4fcc){delete _0x1c4fcc['id'];_0x1c4fcc[_0x7150('0x52')]=_0x5ef15f['params']['id'];return _0x1c4fcc;});return db[_0x7150('0x2a')][_0x7150('0x48')](_0x37eb9a,{'transaction':_0x20b1c5});});})[_0x7150('0x24')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x5ef15f[_0x7150('0x43')]['id']}});});}})[_0x7150('0x24')](respondWithResult(_0x5aff68,null))[_0x7150('0x41')](handleError(_0x5aff68,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 1fb00b5..476c2d5 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 _0xf042=['./analyticFieldReport.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1604b0,_0x48d196){var _0xf7ee7e=function(_0x368052){while(--_0x368052){_0x1604b0['push'](_0x1604b0['shift']());}};_0xf7ee7e(++_0x48d196);}(_0xf042,0x8f));var _0x2f04=function(_0x589fbe,_0x1aff49){_0x589fbe=_0x589fbe-0x0;var _0xfda1fb=_0xf042[_0x589fbe];return _0xfda1fb;};'use strict';var _=require(_0x2f04('0x0'));var util=require(_0x2f04('0x1'));var logger=require('../../config/logger')(_0x2f04('0x2'));var moment=require(_0x2f04('0x3'));var BPromise=require(_0x2f04('0x4'));var rp=require(_0x2f04('0x5'));var fs=require('fs');var path=require(_0x2f04('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2f04('0x7'));module[_0x2f04('0x8')]=function(_0x51f534,_0x90db24){return _0x51f534[_0x2f04('0x9')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7f0=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0xd7f0,0x1bb));var _0x0d7f=function(_0x4d991a,_0x299835){_0x4d991a=_0x4d991a-0x0;var _0x9a2a94=_0xd7f0[_0x4d991a];return _0x9a2a94;};'use strict';var _=require(_0x0d7f('0x0'));var util=require(_0x0d7f('0x1'));var logger=require(_0x0d7f('0x2'))(_0x0d7f('0x3'));var moment=require(_0x0d7f('0x4'));var BPromise=require(_0x0d7f('0x5'));var rp=require(_0x0d7f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0d7f('0x7'));var attributes=require(_0x0d7f('0x8'));module[_0x0d7f('0x9')]=function(_0x529184,_0x2623a2){return _0x529184[_0x0d7f('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x0d7f('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 ca070f0..010fbbe 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 _0x3ef9=['code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','client','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4d8906,_0x5e033e){var _0x588c3d=function(_0x15f630){while(--_0x15f630){_0x4d8906['push'](_0x4d8906['shift']());}};_0x588c3d(++_0x5e033e);}(_0x3ef9,0x1f2));var _0x93ef=function(_0x510db3,_0x119a16){_0x510db3=_0x510db3-0x0;var _0x3a7e4d=_0x3ef9[_0x510db3];return _0x3a7e4d;};'use strict';var _=require(_0x93ef('0x0'));var util=require(_0x93ef('0x1'));var moment=require(_0x93ef('0x2'));var BPromise=require('bluebird');var rs=require(_0x93ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x93ef('0x5'));var config=require(_0x93ef('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x93ef('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a146c,_0xd50aa3,_0x5f1967){return new BPromise(function(_0xa5aa62,_0x3d95e2){return client[_0x93ef('0x8')](_0x5a146c,_0x5f1967)['then'](function(_0x350514){logger['info'](_0x93ef('0x9'),_0xd50aa3,_0x93ef('0xa'));logger[_0x93ef('0xb')](_0x93ef('0xc'),_0xd50aa3,_0x93ef('0xa'),JSON[_0x93ef('0xd')](_0x350514));if(_0x350514[_0x93ef('0xe')]){if(_0x350514[_0x93ef('0xe')][_0x93ef('0xf')]===0x1f4){logger[_0x93ef('0xe')](_0x93ef('0x9'),_0xd50aa3,_0x350514['error']['message']);return _0x3d95e2(_0x350514['error'][_0x93ef('0x10')]);}logger['error'](_0x93ef('0x9'),_0xd50aa3,_0x350514['error'][_0x93ef('0x10')]);return _0xa5aa62(_0x350514['error'][_0x93ef('0x10')]);}else{logger['info'](_0x93ef('0x9'),_0xd50aa3,_0x93ef('0xa'));_0xa5aa62(_0x350514[_0x93ef('0x11')][_0x93ef('0x10')]);}})[_0x93ef('0x12')](function(_0x479c62){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0xd50aa3,_0x479c62);_0x3d95e2(_0x479c62);});});}
\ No newline at end of file
+var _0xc958=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x2129a3,_0x48f17a){var _0x18842b=function(_0x254d06){while(--_0x254d06){_0x2129a3['push'](_0x2129a3['shift']());}};_0x18842b(++_0x48f17a);}(_0xc958,0xd7));var _0x8c95=function(_0x362d44,_0x43c9c7){_0x362d44=_0x362d44-0x0;var _0x2731d1=_0xc958[_0x362d44];return _0x2731d1;};'use strict';var _=require(_0x8c95('0x0'));var util=require(_0x8c95('0x1'));var moment=require(_0x8c95('0x2'));var BPromise=require(_0x8c95('0x3'));var rs=require(_0x8c95('0x4'));var fs=require('fs');var Redis=require(_0x8c95('0x5'));var db=require(_0x8c95('0x6'))['db'];var utils=require(_0x8c95('0x7'));var logger=require(_0x8c95('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8c95('0x9'));var client=jayson[_0x8c95('0xa')][_0x8c95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ecef0,_0x4b8bc9,_0x403b91){return new BPromise(function(_0x1eaa31,_0x4022b8){return client[_0x8c95('0xc')](_0x1ecef0,_0x403b91)[_0x8c95('0xd')](function(_0x5857bc){logger[_0x8c95('0xe')](_0x8c95('0xf'),_0x4b8bc9,_0x8c95('0x10'));logger[_0x8c95('0x11')](_0x8c95('0x12'),_0x4b8bc9,'request\x20sent',JSON['stringify'](_0x5857bc));if(_0x5857bc[_0x8c95('0x13')]){if(_0x5857bc[_0x8c95('0x13')][_0x8c95('0x14')]===0x1f4){logger[_0x8c95('0x13')](_0x8c95('0xf'),_0x4b8bc9,_0x5857bc[_0x8c95('0x13')][_0x8c95('0x15')]);return _0x4022b8(_0x5857bc['error'][_0x8c95('0x15')]);}logger['error'](_0x8c95('0xf'),_0x4b8bc9,_0x5857bc[_0x8c95('0x13')]['message']);return _0x1eaa31(_0x5857bc['error']['message']);}else{logger[_0x8c95('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4b8bc9,_0x8c95('0x10'));_0x1eaa31(_0x5857bc[_0x8c95('0x16')][_0x8c95('0x15')]);}})[_0x8c95('0x17')](function(_0x5e975b){logger[_0x8c95('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4b8bc9,_0x5e975b);_0x4022b8(_0x5e975b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 9d0010b..b22c2e3 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(_0x380414,_0x4149b1){var _0x5eea14=function(_0x21cab1){while(--_0x21cab1){_0x380414['push'](_0x380414['shift']());}};_0x5eea14(++_0x4149b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x371bf5,_0x4bdad0){var _0x39c21d=function(_0x2702d0){while(--_0x2702d0){_0x371bf5['push'](_0x371bf5['shift']());}};_0x39c21d(++_0x4bdad0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 e5d4ad5..5cb83d8 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 _0xb12d=['STRING','sequelize','exports'];(function(_0x146207,_0x494980){var _0x3f15b8=function(_0x316ac4){while(--_0x316ac4){_0x146207['push'](_0x146207['shift']());}};_0x3f15b8(++_0x494980);}(_0xb12d,0x124));var _0xdb12=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0xb12d[_0x6e1239];return _0x418150;};'use strict';var Sequelize=require(_0xdb12('0x0'));module[_0xdb12('0x1')]={'name':{'type':Sequelize[_0xdb12('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xdb12('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xdb12('0x2')]}};
\ No newline at end of file
+var _0xffaa=['sequelize','exports','STRING','TEXT'];(function(_0x261e73,_0x7768f3){var _0x5a1e03=function(_0x560981){while(--_0x560981){_0x261e73['push'](_0x261e73['shift']());}};_0x5a1e03(++_0x7768f3);}(_0xffaa,0x130));var _0xaffa=function(_0x430c5f,_0x1fb159){_0x430c5f=_0x430c5f-0x0;var _0x749624=_0xffaa[_0x430c5f];return _0x749624;};'use strict';var Sequelize=require(_0xaffa('0x0'));module[_0xaffa('0x1')]={'name':{'type':Sequelize[_0xaffa('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xaffa('0x3')]},'description':{'type':Sequelize[_0xaffa('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index fff66b7..4e5e54e 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 _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5cb5cd,_0x6d4a7b){var _0x59caa6=function(_0x39bb7f){while(--_0x39bb7f){_0x5cb5cd['push'](_0x5cb5cd['shift']());}};_0x59caa6(++_0x6d4a7b);}(_0x55ca,0x126));var _0xa55c=function(_0x3e8f4d,_0x2973ed){_0x3e8f4d=_0x3e8f4d-0x0;var _0x590a2e=_0x55ca[_0x3e8f4d];return _0x590a2e;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
+var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x3491ab,_0x13b16d){var _0x5ab8d2=function(_0xdf063b){while(--_0xdf063b){_0x3491ab['push'](_0x3491ab['shift']());}};_0x5ab8d2(++_0x13b16d);}(_0xe5b3,0x133));var _0x3e5b=function(_0x296295,_0x218428){_0x296295=_0x296295-0x0;var _0x546d2c=_0xe5b3[_0x296295];return _0x546d2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index b2e69fd..c37b116 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 _0xc627=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x170cbb,_0x9093e){var _0x39fae4=function(_0x120b6b){while(--_0x120b6b){_0x170cbb['push'](_0x170cbb['shift']());}};_0x39fae4(++_0x9093e);}(_0xc627,0x14a));var _0x7c62=function(_0x44729e,_0x13b036){_0x44729e=_0x44729e-0x0;var _0x1876be=_0xc627[_0x44729e];return _0x1876be;};'use strict';var _=require('lodash');var util=require(_0x7c62('0x0'));var logger=require(_0x7c62('0x1'))(_0x7c62('0x2'));var moment=require('moment');var BPromise=require(_0x7c62('0x3'));var rp=require(_0x7c62('0x4'));var fs=require('fs');var path=require(_0x7c62('0x5'));var rimraf=require(_0x7c62('0x6'));var config=require(_0x7c62('0x7'));var attributes=require(_0x7c62('0x8'));module[_0x7c62('0x9')]=function(_0x448f4b,_0x25a5c8){return _0x448f4b[_0x7c62('0xa')](_0x7c62('0xb'),attributes,{'tableName':_0x7c62('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x29eb=['define','AnalyticMetric','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./analyticMetric.attributes','exports'];(function(_0x5150a2,_0x100437){var _0x40263f=function(_0xbdd2aa){while(--_0xbdd2aa){_0x5150a2['push'](_0x5150a2['shift']());}};_0x40263f(++_0x100437);}(_0x29eb,0x1c5));var _0xb29e=function(_0x4e968a,_0x466f96){_0x4e968a=_0x4e968a-0x0;var _0x1ce5e1=_0x29eb[_0x4e968a];return _0x1ce5e1;};'use strict';var _=require(_0xb29e('0x0'));var util=require(_0xb29e('0x1'));var logger=require(_0xb29e('0x2'))('api');var moment=require(_0xb29e('0x3'));var BPromise=require(_0xb29e('0x4'));var rp=require(_0xb29e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb29e('0x6'));var config=require('../../config/environment');var attributes=require(_0xb29e('0x7'));module[_0xb29e('0x8')]=function(_0x3426f3,_0x2e216f){return _0x3426f3[_0xb29e('0x9')](_0xb29e('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 cdbd34c..a7c8007 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 _0xc21c=['../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x189381,_0x2825dd){var _0xcb8c3=function(_0x37574a){while(--_0x37574a){_0x189381['push'](_0x189381['shift']());}};_0xcb8c3(++_0x2825dd);}(_0xc21c,0xcb));var _0xcc21=function(_0x305d9d,_0x4bd49f){_0x305d9d=_0x305d9d-0x0;var _0x37ea21=_0xc21c[_0x305d9d];return _0x37ea21;};'use strict';var _=require(_0xcc21('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcc21('0x1'));var rs=require(_0xcc21('0x2'));var fs=require('fs');var Redis=require(_0xcc21('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc21('0x4'));var logger=require(_0xcc21('0x5'))(_0xcc21('0x6'));var config=require(_0xcc21('0x7'));var jayson=require(_0xcc21('0x8'));var client=jayson[_0xcc21('0x9')][_0xcc21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x302378,_0xaef0a5,_0x59a683){return new BPromise(function(_0x17fca9,_0x4dead6){return client[_0xcc21('0xb')](_0x302378,_0x59a683)[_0xcc21('0xc')](function(_0x3aa370){logger['info'](_0xcc21('0xd'),_0xaef0a5,_0xcc21('0xe'));logger['debug'](_0xcc21('0xf'),_0xaef0a5,_0xcc21('0xe'),JSON[_0xcc21('0x10')](_0x3aa370));if(_0x3aa370[_0xcc21('0x11')]){if(_0x3aa370[_0xcc21('0x11')]['code']===0x1f4){logger[_0xcc21('0x11')](_0xcc21('0xd'),_0xaef0a5,_0x3aa370[_0xcc21('0x11')][_0xcc21('0x12')]);return _0x4dead6(_0x3aa370[_0xcc21('0x11')][_0xcc21('0x12')]);}logger[_0xcc21('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0xaef0a5,_0x3aa370[_0xcc21('0x11')]['message']);return _0x17fca9(_0x3aa370[_0xcc21('0x11')][_0xcc21('0x12')]);}else{logger['info'](_0xcc21('0xd'),_0xaef0a5,_0xcc21('0xe'));_0x17fca9(_0x3aa370[_0xcc21('0x13')][_0xcc21('0x12')]);}})[_0xcc21('0x14')](function(_0x215cd3){logger[_0xcc21('0x11')](_0xcc21('0xd'),_0xaef0a5,_0x215cd3);_0x4dead6(_0x215cd3);});});}
\ No newline at end of file
+var _0xeb9a=['then','info','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x54de3d,_0x3a0f83){var _0x175fcd=function(_0x5d231d){while(--_0x5d231d){_0x54de3d['push'](_0x54de3d['shift']());}};_0x175fcd(++_0x3a0f83);}(_0xeb9a,0x87));var _0xaeb9=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xeb9a[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0xaeb9('0x0'));var util=require(_0xaeb9('0x1'));var moment=require(_0xaeb9('0x2'));var BPromise=require('bluebird');var rs=require(_0xaeb9('0x3'));var fs=require('fs');var Redis=require(_0xaeb9('0x4'));var db=require(_0xaeb9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeb9('0x6'))(_0xaeb9('0x7'));var config=require(_0xaeb9('0x8'));var jayson=require(_0xaeb9('0x9'));var client=jayson[_0xaeb9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x147adb,_0x82024a,_0x244e16){return new BPromise(function(_0x388f24,_0x2be7ae){return client[_0xaeb9('0xb')](_0x147adb,_0x244e16)[_0xaeb9('0xc')](function(_0x260cb4){logger[_0xaeb9('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x82024a,'request\x20sent');logger['debug'](_0xaeb9('0xe'),_0x82024a,_0xaeb9('0xf'),JSON[_0xaeb9('0x10')](_0x260cb4));if(_0x260cb4[_0xaeb9('0x11')]){if(_0x260cb4[_0xaeb9('0x11')]['code']===0x1f4){logger[_0xaeb9('0x11')](_0xaeb9('0x12'),_0x82024a,_0x260cb4[_0xaeb9('0x11')][_0xaeb9('0x13')]);return _0x2be7ae(_0x260cb4[_0xaeb9('0x11')][_0xaeb9('0x13')]);}logger['error'](_0xaeb9('0x12'),_0x82024a,_0x260cb4[_0xaeb9('0x11')][_0xaeb9('0x13')]);return _0x388f24(_0x260cb4['error'][_0xaeb9('0x13')]);}else{logger[_0xaeb9('0xd')](_0xaeb9('0x12'),_0x82024a,_0xaeb9('0xf'));_0x388f24(_0x260cb4[_0xaeb9('0x14')][_0xaeb9('0x13')]);}})['catch'](function(_0x1cd0d7){logger[_0xaeb9('0x11')](_0xaeb9('0x12'),_0x82024a,_0x1cd0d7);_0x2be7ae(_0x1cd0d7);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index f538bc0..b71a2a6 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 _0x14f5=['express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','util','connect-timeout'];(function(_0x146d85,_0x5ef426){var _0x3da482=function(_0xd844cd){while(--_0xd844cd){_0x146d85['push'](_0x146d85['shift']());}};_0x3da482(++_0x5ef426);}(_0x14f5,0xae));var _0x514f=function(_0x519554,_0x17e6b1){_0x519554=_0x519554-0x0;var _0xf68f51=_0x14f5[_0x519554];return _0xf68f51;};'use strict';var multer=require('multer');var util=require(_0x514f('0x0'));var path=require('path');var timeout=require(_0x514f('0x1'));var express=require(_0x514f('0x2'));var router=express[_0x514f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x514f('0x4'));var interaction=require(_0x514f('0x5'));var config=require('../../config/environment');var controller=require(_0x514f('0x6'));router[_0x514f('0x7')]('/',auth[_0x514f('0x8')](),controller[_0x514f('0x9')]);router[_0x514f('0x7')](_0x514f('0xa'),auth[_0x514f('0x8')](),controller['show']);router[_0x514f('0xb')]('/',auth['isAuthenticated'](),controller[_0x514f('0xc')]);router[_0x514f('0xd')](_0x514f('0xa'),auth[_0x514f('0x8')](),controller[_0x514f('0xe')]);router[_0x514f('0xf')](_0x514f('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4f5a=['destroy','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','put','update'];(function(_0x2499dc,_0x237995){var _0x47f07=function(_0x9a1853){while(--_0x9a1853){_0x2499dc['push'](_0x2499dc['shift']());}};_0x47f07(++_0x237995);}(_0x4f5a,0xaa));var _0xa4f5=function(_0x4aadc8,_0x311481){_0x4aadc8=_0x4aadc8-0x0;var _0x96db0e=_0x4f5a[_0x4aadc8];return _0x96db0e;};'use strict';var multer=require(_0xa4f5('0x0'));var util=require(_0xa4f5('0x1'));var path=require('path');var timeout=require(_0xa4f5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa4f5('0x3'));var config=require(_0xa4f5('0x4'));var controller=require('./analyticMetric.controller');router[_0xa4f5('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa4f5('0x6'),auth[_0xa4f5('0x7')](),controller[_0xa4f5('0x8')]);router[_0xa4f5('0x9')]('/',auth[_0xa4f5('0x7')](),controller['create']);router[_0xa4f5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa4f5('0xb')]);router['delete'](_0xa4f5('0x6'),auth[_0xa4f5('0x7')](),controller[_0xa4f5('0xc')]);module[_0xa4f5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 67de44b..97dd9f3 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 _0x3cd1=['exports','TEXT'];(function(_0x3eddfa,_0x45950e){var _0x21a5fe=function(_0x1adaa9){while(--_0x1adaa9){_0x3eddfa['push'](_0x3eddfa['shift']());}};_0x21a5fe(++_0x45950e);}(_0x3cd1,0x112));var _0x13cd=function(_0x751d96,_0x4fde3f){_0x751d96=_0x751d96-0x0;var _0x20b0d4=_0x3cd1[_0x751d96];return _0x20b0d4;};'use strict';var Sequelize=require('sequelize');module[_0x13cd('0x0')]={'tree':{'type':Sequelize[_0x13cd('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x3a2b=['TEXT','sequelize','exports'];(function(_0x17823f,_0xffd807){var _0x51fc21=function(_0x5e4921){while(--_0x5e4921){_0x17823f['push'](_0x17823f['shift']());}};_0x51fc21(++_0xffd807);}(_0x3a2b,0x13c));var _0xb3a2=function(_0x2388bf,_0x1a5d51){_0x2388bf=_0x2388bf-0x0;var _0xaf8da9=_0x3a2b[_0x2388bf];return _0xaf8da9;};'use strict';var Sequelize=require(_0xb3a2('0x0'));module[_0xb3a2('0x1')]={'tree':{'type':Sequelize[_0xb3a2('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 1a01778..f1fb4b8 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 _0x1803=['crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','name','send','map','AnalyticTreeReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x4a896d,_0x186812){var _0x55b94b=function(_0x57e052){while(--_0x57e052){_0x4a896d['push'](_0x4a896d['shift']());}};_0x55b94b(++_0x186812);}(_0x1803,0x1f2));var _0x3180=function(_0x37a66c,_0x29d8f4){_0x37a66c=_0x37a66c-0x0;var _0x190911=_0x1803[_0x37a66c];return _0x190911;};'use strict';var emlformat=require(_0x3180('0x0'));var rimraf=require(_0x3180('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3180('0x2'));var rp=require('request-promise');var moment=require(_0x3180('0x3'));var BPromise=require(_0x3180('0x4'));var Mustache=require(_0x3180('0x5'));var util=require(_0x3180('0x6'));var path=require(_0x3180('0x7'));var sox=require(_0x3180('0x8'));var csv=require('to-csv');var ejs=require(_0x3180('0x9'));var fs=require('fs');var fs_extra=require(_0x3180('0xa'));var _=require(_0x3180('0xb'));var squel=require(_0x3180('0xc'));var crypto=require(_0x3180('0xd'));var jsforce=require(_0x3180('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3180('0xf'));var querystring=require(_0x3180('0x10'));var Papa=require(_0x3180('0x11'));var Redis=require(_0x3180('0x12'));var authService=require(_0x3180('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3180('0x14'));var logger=require(_0x3180('0x15'))(_0x3180('0x16'));var utils=require('../../config/utils');var config=require(_0x3180('0x17'));var licenseUtil=require(_0x3180('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x352a24,_0x382373){_0x382373=_0x382373||0xcc;return function(_0x138130){if(_0x138130){return _0x352a24[_0x3180('0x19')](_0x382373);}return _0x352a24['status'](_0x382373)[_0x3180('0x1a')]();};}function respondWithResult(_0x3dc208,_0x11641d){_0x11641d=_0x11641d||0xc8;return function(_0x2f275a){if(_0x2f275a){return _0x3dc208[_0x3180('0x1b')](_0x11641d)['json'](_0x2f275a);}};}function respondWithFilteredResult(_0x52b920,_0x394bfe){return function(_0x12c1fe){if(_0x12c1fe){var _0x5503f6=typeof _0x394bfe['offset']==='undefined'&&typeof _0x394bfe[_0x3180('0x1c')]===_0x3180('0x1d');var _0x12379a=_0x12c1fe[_0x3180('0x1e')];var _0x474ac4=_0x5503f6?0x0:_0x394bfe[_0x3180('0x1f')];var _0x3ccf63=_0x5503f6?_0x12c1fe['count']:_0x394bfe[_0x3180('0x1f')]+_0x394bfe['limit'];var _0x2aa541;if(_0x3ccf63>=_0x12379a){_0x3ccf63=_0x12379a;_0x2aa541=0xc8;}else{_0x2aa541=0xce;}_0x52b920['status'](_0x2aa541);return _0x52b920[_0x3180('0x20')](_0x3180('0x21'),_0x474ac4+'-'+_0x3ccf63+'/'+_0x12379a)['json'](_0x12c1fe);}return null;};}function patchUpdates(_0x28a9d7){return function(_0x4f52ad){try{jsonpatch[_0x3180('0x22')](_0x4f52ad,_0x28a9d7,!![]);}catch(_0x344c4f){return BPromise[_0x3180('0x23')](_0x344c4f);}return _0x4f52ad['save']();};}function saveUpdates(_0x27c69e,_0x2a60ed){return function(_0x4a2342){if(_0x4a2342){return _0x4a2342[_0x3180('0x24')](_0x27c69e)[_0x3180('0x25')](function(_0x5a9f83){return _0x5a9f83;});}return null;};}function removeEntity(_0x36dbed,_0x478dce){return function(_0x4a2cf1){if(_0x4a2cf1){return _0x4a2cf1[_0x3180('0x26')]()[_0x3180('0x25')](function(){_0x36dbed[_0x3180('0x1b')](0xcc)[_0x3180('0x1a')]();});}};}function handleEntityNotFound(_0x38e874,_0xbe5aef){return function(_0x5a29e7){if(!_0x5a29e7){_0x38e874['sendStatus'](0x194);}return _0x5a29e7;};}function handleError(_0x2a80a8,_0x4023dc){_0x4023dc=_0x4023dc||0x1f4;return function(_0x48a36c){logger['error'](_0x48a36c['stack']);if(_0x48a36c[_0x3180('0x27')]){delete _0x48a36c[_0x3180('0x27')];}_0x2a80a8['status'](_0x4023dc)[_0x3180('0x28')](_0x48a36c);};}exports['index']=function(_0xad9fa7,_0x2696f5){var _0x5cc875={},_0x366134={},_0x3598f2={'count':0x0,'rows':[]};var _0x5f4227=_[_0x3180('0x29')](db[_0x3180('0x2a')]['rawAttributes'],function(_0x27a78c){return{'name':_0x27a78c[_0x3180('0x2b')],'type':_0x27a78c[_0x3180('0x2c')][_0x3180('0x2d')]};});_0x366134[_0x3180('0x2e')]=_[_0x3180('0x29')](_0x5f4227,'name');_0x366134[_0x3180('0x2f')]=_[_0x3180('0x30')](_0xad9fa7[_0x3180('0x2f')]);_0x366134[_0x3180('0x31')]=_[_0x3180('0x32')](_0x366134['model'],_0x366134[_0x3180('0x2f')]);_0x5cc875[_0x3180('0x33')]=_[_0x3180('0x32')](_0x366134[_0x3180('0x2e')],qs[_0x3180('0x34')](_0xad9fa7[_0x3180('0x2f')][_0x3180('0x34')]));_0x5cc875['attributes']=_0x5cc875[_0x3180('0x33')][_0x3180('0x35')]?_0x5cc875[_0x3180('0x33')]:_0x366134[_0x3180('0x2e')];if(!_0xad9fa7[_0x3180('0x2f')][_0x3180('0x36')](_0x3180('0x37'))){_0x5cc875[_0x3180('0x1c')]=qs[_0x3180('0x1c')](_0xad9fa7[_0x3180('0x2f')]['limit']);_0x5cc875[_0x3180('0x1f')]=qs['offset'](_0xad9fa7[_0x3180('0x2f')]['offset']);}_0x5cc875[_0x3180('0x38')]=qs[_0x3180('0x39')](_0xad9fa7[_0x3180('0x2f')][_0x3180('0x39')]);_0x5cc875[_0x3180('0x3a')]=qs[_0x3180('0x31')](_[_0x3180('0x3b')](_0xad9fa7[_0x3180('0x2f')],_0x366134[_0x3180('0x31')]),_0x5f4227);if(_0xad9fa7[_0x3180('0x2f')]['filter']){_0x5cc875[_0x3180('0x3a')]=_[_0x3180('0x3c')](_0x5cc875[_0x3180('0x3a')],{'$or':_['map'](_0x5f4227,function(_0x2a885a){if(_0x2a885a[_0x3180('0x2c')]!==_0x3180('0x3d')){var _0x228ddb={};_0x228ddb[_0x2a885a['name']]={'$like':'%'+_0xad9fa7[_0x3180('0x2f')]['filter']+'%'};return _0x228ddb;}})});}_0x5cc875=_[_0x3180('0x3c')]({},_0x5cc875,_0xad9fa7[_0x3180('0x3e')]);var _0x14877e={'where':_0x5cc875[_0x3180('0x3a')]};return db[_0x3180('0x2a')]['count'](_0x14877e)[_0x3180('0x25')](function(_0x5437ba){_0x3598f2[_0x3180('0x1e')]=_0x5437ba;if(_0xad9fa7[_0x3180('0x2f')]['includeAll']){_0x5cc875[_0x3180('0x3f')]=[{'all':!![]}];}return db[_0x3180('0x2a')][_0x3180('0x40')](_0x5cc875);})['then'](function(_0x3279f7){_0x3598f2[_0x3180('0x41')]=_0x3279f7;return _0x3598f2;})[_0x3180('0x25')](respondWithFilteredResult(_0x2696f5,_0x5cc875))[_0x3180('0x42')](handleError(_0x2696f5,null));};exports['show']=function(_0x53f8d8,_0x3f2a41){var _0x475631={'raw':!![],'where':{'id':_0x53f8d8[_0x3180('0x43')]['id']}},_0x1a6449={};_0x1a6449[_0x3180('0x2e')]=_[_0x3180('0x30')](db[_0x3180('0x2a')][_0x3180('0x44')]);_0x1a6449['query']=_[_0x3180('0x30')](_0x53f8d8[_0x3180('0x2f')]);_0x1a6449['filters']=_[_0x3180('0x32')](_0x1a6449[_0x3180('0x2e')],_0x1a6449['query']);_0x475631[_0x3180('0x33')]=_[_0x3180('0x32')](_0x1a6449['model'],qs['fields'](_0x53f8d8[_0x3180('0x2f')]['fields']));_0x475631['attributes']=_0x475631[_0x3180('0x33')][_0x3180('0x35')]?_0x475631['attributes']:_0x1a6449[_0x3180('0x2e')];if(_0x53f8d8[_0x3180('0x2f')][_0x3180('0x45')]){_0x475631[_0x3180('0x3f')]=[{'all':!![]}];}_0x475631=_[_0x3180('0x3c')]({},_0x475631,_0x53f8d8[_0x3180('0x3e')]);return db[_0x3180('0x2a')][_0x3180('0x46')](_0x475631)[_0x3180('0x25')](handleEntityNotFound(_0x3f2a41,null))[_0x3180('0x25')](respondWithResult(_0x3f2a41,null))[_0x3180('0x42')](handleError(_0x3f2a41,null));};exports[_0x3180('0x47')]=function(_0x5b3ff5,_0x3c0ac4){return db[_0x3180('0x2a')]['create'](_0x5b3ff5[_0x3180('0x48')],{})[_0x3180('0x25')](respondWithResult(_0x3c0ac4,0xc9))['catch'](handleError(_0x3c0ac4,null));};exports[_0x3180('0x24')]=function(_0x4e476d,_0x4e2e43){if(_0x4e476d[_0x3180('0x48')]['id']){delete _0x4e476d[_0x3180('0x48')]['id'];}return db[_0x3180('0x2a')][_0x3180('0x46')]({'where':{'id':_0x4e476d['params']['id']}})[_0x3180('0x25')](handleEntityNotFound(_0x4e2e43,null))[_0x3180('0x25')](saveUpdates(_0x4e476d['body'],null))[_0x3180('0x25')](respondWithResult(_0x4e2e43,null))[_0x3180('0x42')](handleError(_0x4e2e43,null));};exports[_0x3180('0x26')]=function(_0x4518c3,_0x100da7){return db[_0x3180('0x2a')][_0x3180('0x46')]({'where':{'id':_0x4518c3[_0x3180('0x43')]['id']}})['then'](handleEntityNotFound(_0x100da7,null))[_0x3180('0x25')](removeEntity(_0x100da7,null))[_0x3180('0x42')](handleError(_0x100da7,null));};
\ No newline at end of file
+var _0x7168=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','count','limit','Content-Range','json','apply','save','then','end','sendStatus','error','name','send','index','AnalyticTreeReport','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','find','create','body','params','destroy','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse'];(function(_0x247d58,_0x599006){var _0xd28d2e=function(_0x4bdd55){while(--_0x4bdd55){_0x247d58['push'](_0x247d58['shift']());}};_0xd28d2e(++_0x599006);}(_0x7168,0x1ea));var _0x8716=function(_0x4dec6f,_0x5c679b){_0x4dec6f=_0x4dec6f-0x0;var _0x84fec7=_0x7168[_0x4dec6f];return _0x84fec7;};'use strict';var emlformat=require(_0x8716('0x0'));var rimraf=require(_0x8716('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8716('0x2'));var moment=require(_0x8716('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8716('0x4'));var util=require(_0x8716('0x5'));var path=require('path');var sox=require(_0x8716('0x6'));var csv=require(_0x8716('0x7'));var ejs=require(_0x8716('0x8'));var fs=require('fs');var fs_extra=require(_0x8716('0x9'));var _=require('lodash');var squel=require(_0x8716('0xa'));var crypto=require(_0x8716('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8716('0xc'));var toCsv=require(_0x8716('0x7'));var querystring=require('querystring');var Papa=require(_0x8716('0xd'));var Redis=require(_0x8716('0xe'));var authService=require(_0x8716('0xf'));var qs=require(_0x8716('0x10'));var as=require(_0x8716('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8716('0x12'))(_0x8716('0x13'));var utils=require(_0x8716('0x14'));var config=require(_0x8716('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8716('0x16'))['db'];function respondWithStatusCode(_0x25143e,_0xb39877){_0xb39877=_0xb39877||0xcc;return function(_0x17bc19){if(_0x17bc19){return _0x25143e['sendStatus'](_0xb39877);}return _0x25143e[_0x8716('0x17')](_0xb39877)['end']();};}function respondWithResult(_0x1c601a,_0x3ec4a5){_0x3ec4a5=_0x3ec4a5||0xc8;return function(_0x57a9bc){if(_0x57a9bc){return _0x1c601a[_0x8716('0x17')](_0x3ec4a5)['json'](_0x57a9bc);}};}function respondWithFilteredResult(_0x39c462,_0x55314d){return function(_0x59c233){if(_0x59c233){var _0x9c54bc=typeof _0x55314d[_0x8716('0x18')]===_0x8716('0x19')&&typeof _0x55314d['limit']===_0x8716('0x19');var _0x4ee1c8=_0x59c233[_0x8716('0x1a')];var _0x49cb83=_0x9c54bc?0x0:_0x55314d[_0x8716('0x18')];var _0x32ab8f=_0x9c54bc?_0x59c233['count']:_0x55314d[_0x8716('0x18')]+_0x55314d[_0x8716('0x1b')];var _0x48b05d;if(_0x32ab8f>=_0x4ee1c8){_0x32ab8f=_0x4ee1c8;_0x48b05d=0xc8;}else{_0x48b05d=0xce;}_0x39c462[_0x8716('0x17')](_0x48b05d);return _0x39c462['set'](_0x8716('0x1c'),_0x49cb83+'-'+_0x32ab8f+'/'+_0x4ee1c8)[_0x8716('0x1d')](_0x59c233);}return null;};}function patchUpdates(_0x53b021){return function(_0x3cc87c){try{jsonpatch[_0x8716('0x1e')](_0x3cc87c,_0x53b021,!![]);}catch(_0x4010db){return BPromise['reject'](_0x4010db);}return _0x3cc87c[_0x8716('0x1f')]();};}function saveUpdates(_0x2f2654,_0x124bca){return function(_0x5c7f73){if(_0x5c7f73){return _0x5c7f73['update'](_0x2f2654)[_0x8716('0x20')](function(_0x46aff6){return _0x46aff6;});}return null;};}function removeEntity(_0xed545b,_0x29e097){return function(_0x406e7c){if(_0x406e7c){return _0x406e7c['destroy']()[_0x8716('0x20')](function(){_0xed545b['status'](0xcc)[_0x8716('0x21')]();});}};}function handleEntityNotFound(_0x1ee155,_0x153563){return function(_0x168888){if(!_0x168888){_0x1ee155[_0x8716('0x22')](0x194);}return _0x168888;};}function handleError(_0x3a262b,_0x4c8920){_0x4c8920=_0x4c8920||0x1f4;return function(_0x5caf9c){logger[_0x8716('0x23')](_0x5caf9c['stack']);if(_0x5caf9c[_0x8716('0x24')]){delete _0x5caf9c['name'];}_0x3a262b[_0x8716('0x17')](_0x4c8920)[_0x8716('0x25')](_0x5caf9c);};}exports[_0x8716('0x26')]=function(_0x483539,_0x26aeb3){var _0x322a43={},_0x45516b={},_0x4ca94a={'count':0x0,'rows':[]};var _0x21fd09=_['map'](db[_0x8716('0x27')]['rawAttributes'],function(_0x2f8cbb){return{'name':_0x2f8cbb['fieldName'],'type':_0x2f8cbb[_0x8716('0x28')][_0x8716('0x29')]};});_0x45516b[_0x8716('0x2a')]=_[_0x8716('0x2b')](_0x21fd09,'name');_0x45516b[_0x8716('0x2c')]=_['keys'](_0x483539[_0x8716('0x2c')]);_0x45516b[_0x8716('0x2d')]=_[_0x8716('0x2e')](_0x45516b[_0x8716('0x2a')],_0x45516b[_0x8716('0x2c')]);_0x322a43[_0x8716('0x2f')]=_['intersection'](_0x45516b[_0x8716('0x2a')],qs[_0x8716('0x30')](_0x483539[_0x8716('0x2c')][_0x8716('0x30')]));_0x322a43[_0x8716('0x2f')]=_0x322a43['attributes'][_0x8716('0x31')]?_0x322a43[_0x8716('0x2f')]:_0x45516b[_0x8716('0x2a')];if(!_0x483539[_0x8716('0x2c')][_0x8716('0x32')](_0x8716('0x33'))){_0x322a43[_0x8716('0x1b')]=qs['limit'](_0x483539['query'][_0x8716('0x1b')]);_0x322a43[_0x8716('0x18')]=qs[_0x8716('0x18')](_0x483539[_0x8716('0x2c')][_0x8716('0x18')]);}_0x322a43[_0x8716('0x34')]=qs['sort'](_0x483539[_0x8716('0x2c')][_0x8716('0x35')]);_0x322a43[_0x8716('0x36')]=qs[_0x8716('0x2d')](_['pick'](_0x483539['query'],_0x45516b['filters']),_0x21fd09);if(_0x483539[_0x8716('0x2c')][_0x8716('0x37')]){_0x322a43['where']=_[_0x8716('0x38')](_0x322a43['where'],{'$or':_[_0x8716('0x2b')](_0x21fd09,function(_0x16e732){if(_0x16e732[_0x8716('0x28')]!==_0x8716('0x39')){var _0x43b122={};_0x43b122[_0x16e732[_0x8716('0x24')]]={'$like':'%'+_0x483539[_0x8716('0x2c')]['filter']+'%'};return _0x43b122;}})});}_0x322a43=_[_0x8716('0x38')]({},_0x322a43,_0x483539[_0x8716('0x3a')]);var _0x5ef351={'where':_0x322a43['where']};return db[_0x8716('0x27')][_0x8716('0x1a')](_0x5ef351)[_0x8716('0x20')](function(_0x35201d){_0x4ca94a[_0x8716('0x1a')]=_0x35201d;if(_0x483539[_0x8716('0x2c')][_0x8716('0x3b')]){_0x322a43[_0x8716('0x3c')]=[{'all':!![]}];}return db[_0x8716('0x27')][_0x8716('0x3d')](_0x322a43);})[_0x8716('0x20')](function(_0x59876e){_0x4ca94a[_0x8716('0x3e')]=_0x59876e;return _0x4ca94a;})[_0x8716('0x20')](respondWithFilteredResult(_0x26aeb3,_0x322a43))[_0x8716('0x3f')](handleError(_0x26aeb3,null));};exports[_0x8716('0x40')]=function(_0x5d4e5a,_0x3af137){var _0x4c9b39={'raw':!![],'where':{'id':_0x5d4e5a['params']['id']}},_0x2522be={};_0x2522be[_0x8716('0x2a')]=_['keys'](db['AnalyticTreeReport'][_0x8716('0x41')]);_0x2522be[_0x8716('0x2c')]=_[_0x8716('0x42')](_0x5d4e5a['query']);_0x2522be[_0x8716('0x2d')]=_[_0x8716('0x2e')](_0x2522be[_0x8716('0x2a')],_0x2522be[_0x8716('0x2c')]);_0x4c9b39[_0x8716('0x2f')]=_[_0x8716('0x2e')](_0x2522be[_0x8716('0x2a')],qs[_0x8716('0x30')](_0x5d4e5a[_0x8716('0x2c')][_0x8716('0x30')]));_0x4c9b39['attributes']=_0x4c9b39[_0x8716('0x2f')][_0x8716('0x31')]?_0x4c9b39[_0x8716('0x2f')]:_0x2522be['model'];if(_0x5d4e5a[_0x8716('0x2c')][_0x8716('0x3b')]){_0x4c9b39[_0x8716('0x3c')]=[{'all':!![]}];}_0x4c9b39=_[_0x8716('0x38')]({},_0x4c9b39,_0x5d4e5a[_0x8716('0x3a')]);return db[_0x8716('0x27')][_0x8716('0x43')](_0x4c9b39)[_0x8716('0x20')](handleEntityNotFound(_0x3af137,null))[_0x8716('0x20')](respondWithResult(_0x3af137,null))[_0x8716('0x3f')](handleError(_0x3af137,null));};exports[_0x8716('0x44')]=function(_0x5aaca1,_0x26ffd7){return db[_0x8716('0x27')][_0x8716('0x44')](_0x5aaca1[_0x8716('0x45')],{})[_0x8716('0x20')](respondWithResult(_0x26ffd7,0xc9))[_0x8716('0x3f')](handleError(_0x26ffd7,null));};exports['update']=function(_0x252cf1,_0xfd7df){if(_0x252cf1[_0x8716('0x45')]['id']){delete _0x252cf1[_0x8716('0x45')]['id'];}return db[_0x8716('0x27')][_0x8716('0x43')]({'where':{'id':_0x252cf1[_0x8716('0x46')]['id']}})[_0x8716('0x20')](handleEntityNotFound(_0xfd7df,null))[_0x8716('0x20')](saveUpdates(_0x252cf1['body'],null))['then'](respondWithResult(_0xfd7df,null))[_0x8716('0x3f')](handleError(_0xfd7df,null));};exports[_0x8716('0x47')]=function(_0x3213f4,_0x5a3d5e){return db[_0x8716('0x27')][_0x8716('0x43')]({'where':{'id':_0x3213f4['params']['id']}})[_0x8716('0x20')](handleEntityNotFound(_0x5a3d5e,null))[_0x8716('0x20')](removeEntity(_0x5a3d5e,null))[_0x8716('0x3f')](handleError(_0x5a3d5e,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index a3b139a..d5a4e73 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 _0xdffd=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','bluebird','request-promise','../../config/environment'];(function(_0x47859f,_0x1129cd){var _0x426044=function(_0x5ad499){while(--_0x5ad499){_0x47859f['push'](_0x47859f['shift']());}};_0x426044(++_0x1129cd);}(_0xdffd,0x144));var _0xddff=function(_0x307446,_0x399ee0){_0x307446=_0x307446-0x0;var _0x25ee94=_0xdffd[_0x307446];return _0x25ee94;};'use strict';var _=require(_0xddff('0x0'));var util=require(_0xddff('0x1'));var logger=require('../../config/logger')(_0xddff('0x2'));var moment=require('moment');var BPromise=require(_0xddff('0x3'));var rp=require(_0xddff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xddff('0x5'));var attributes=require(_0xddff('0x6'));module[_0xddff('0x7')]=function(_0x43686f,_0x4fe9c1){return _0x43686f[_0xddff('0x8')](_0xddff('0x9'),attributes,{'tableName':_0xddff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x03c5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x03c5,0x174));var _0x503c=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x03c5[_0x28407a];return _0x8bd6ef;};'use strict';var _=require('lodash');var util=require(_0x503c('0x0'));var logger=require(_0x503c('0x1'))(_0x503c('0x2'));var moment=require(_0x503c('0x3'));var BPromise=require(_0x503c('0x4'));var rp=require(_0x503c('0x5'));var fs=require('fs');var path=require(_0x503c('0x6'));var rimraf=require(_0x503c('0x7'));var config=require(_0x503c('0x8'));var attributes=require(_0x503c('0x9'));module['exports']=function(_0x49720b,_0x6e94b2){return _0x49720b['define'](_0x503c('0xa'),attributes,{'tableName':_0x503c('0xb'),'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 94fa2ec..70c41d5 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(_0x26fcec,_0x151800){var _0x3b1f26=function(_0x658104){while(--_0x658104){_0x26fcec['push'](_0x26fcec['shift']());}};_0x3b1f26(++_0x151800);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1987ca,_0x29497d){_0x1987ca=_0x1987ca-0x0;var _0x3a4b91=_0x5f2f[_0x1987ca];return _0x3a4b91;};'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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x350119,_0x3db5eb){var _0x297b6e=function(_0x515def){while(--_0x515def){_0x350119['push'](_0x350119['shift']());}};_0x297b6e(++_0x3db5eb);}(_0x1261,0x144));var _0x1126=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x1261[_0x3a833e];return _0xdff445;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 676a2ba..5a4f015 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 _0x7db4=['delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','put'];(function(_0x20f363,_0x4a10fc){var _0x126a1e=function(_0x3450e1){while(--_0x3450e1){_0x20f363['push'](_0x20f363['shift']());}};_0x126a1e(++_0x4a10fc);}(_0x7db4,0x103));var _0x47db=function(_0x44cf8a,_0x25b667){_0x44cf8a=_0x44cf8a-0x0;var _0x41d2e3=_0x7db4[_0x44cf8a];return _0x41d2e3;};'use strict';var multer=require('multer');var util=require(_0x47db('0x0'));var path=require(_0x47db('0x1'));var timeout=require(_0x47db('0x2'));var express=require(_0x47db('0x3'));var router=express[_0x47db('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47db('0x5'));var interaction=require(_0x47db('0x6'));var config=require(_0x47db('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x47db('0x8')]('/',auth[_0x47db('0x9')](),controller['index']);router[_0x47db('0x8')]('/:id',auth[_0x47db('0x9')](),controller[_0x47db('0xa')]);router[_0x47db('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47db('0xc')]('/:id',auth[_0x47db('0x9')](),controller['update']);router[_0x47db('0xd')](_0x47db('0xe'),auth['isAuthenticated'](),controller[_0x47db('0xf')]);module[_0x47db('0x10')]=router;
\ No newline at end of file
+var _0xdfc6=['create','put','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../config/environment','get','isAuthenticated','show','post'];(function(_0x506d6d,_0xf98ca2){var _0x46b446=function(_0x89ed30){while(--_0x89ed30){_0x506d6d['push'](_0x506d6d['shift']());}};_0x46b446(++_0xf98ca2);}(_0xdfc6,0x1b6));var _0x6dfc=function(_0x3c5536,_0x3586ae){_0x3c5536=_0x3c5536-0x0;var _0x26023c=_0xdfc6[_0x3c5536];return _0x26023c;};'use strict';var multer=require(_0x6dfc('0x0'));var util=require(_0x6dfc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6dfc('0x2'));var router=express[_0x6dfc('0x3')]();var fs_extra=require(_0x6dfc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6dfc('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x6dfc('0x6')]('/',auth[_0x6dfc('0x7')](),controller['index']);router[_0x6dfc('0x6')]('/:id',auth[_0x6dfc('0x7')](),controller[_0x6dfc('0x8')]);router[_0x6dfc('0x9')]('/',auth[_0x6dfc('0x7')](),controller[_0x6dfc('0xa')]);router[_0x6dfc('0xb')](_0x6dfc('0xc'),auth[_0x6dfc('0x7')](),controller[_0x6dfc('0xd')]);router['delete'](_0x6dfc('0xc'),auth[_0x6dfc('0x7')](),controller[_0x6dfc('0xe')]);module[_0x6dfc('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 921fb5f..80a1f0b 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 _0x83d3=['exports','STRING','sequelize'];(function(_0x48aa92,_0x5af761){var _0x57ef1e=function(_0x2fb737){while(--_0x2fb737){_0x48aa92['push'](_0x48aa92['shift']());}};_0x57ef1e(++_0x5af761);}(_0x83d3,0x17c));var _0x383d=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x83d3[_0x3c5e54];return _0x3ae1f3;};'use strict';var Sequelize=require(_0x383d('0x0'));module[_0x383d('0x1')]={'name':{'type':Sequelize[_0x383d('0x2')]},'basename':{'type':Sequelize[_0x383d('0x2')]},'type':{'type':Sequelize[_0x383d('0x2')]}};
\ No newline at end of file
+var _0xb458=['STRING','sequelize','exports'];(function(_0x59bca6,_0xd955c3){var _0x248cff=function(_0x341326){while(--_0x341326){_0x59bca6['push'](_0x59bca6['shift']());}};_0x248cff(++_0xd955c3);}(_0xb458,0x103));var _0x8b45=function(_0x5bd7f5,_0x106eab){_0x5bd7f5=_0x5bd7f5-0x0;var _0x431ff7=_0xb458[_0x5bd7f5];return _0x431ff7;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')]},'basename':{'type':Sequelize['STRING']},'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 92ee630..f17c646 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 _0x52c2=['ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','intersection','find','clone','params','get','omit','createdAt','updatedAt','body','create','basename','filename','file','download','findOne','root','join','offline-chat/','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox'];(function(_0x55ccd3,_0x61148f){var _0x47bfcb=function(_0x185a86){while(--_0x185a86){_0x55ccd3['push'](_0x55ccd3['shift']());}};_0x47bfcb(++_0x61148f);}(_0x52c2,0x1a2));var _0x252c=function(_0x2b414c,_0xfe5d03){_0x2b414c=_0x2b414c-0x0;var _0x40d2ba=_0x52c2[_0x2b414c];return _0x40d2ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x252c('0x0'));var zipdir=require(_0x252c('0x1'));var jsonpatch=require(_0x252c('0x2'));var rp=require('request-promise');var moment=require(_0x252c('0x3'));var BPromise=require(_0x252c('0x4'));var Mustache=require('mustache');var util=require(_0x252c('0x5'));var path=require('path');var sox=require(_0x252c('0x6'));var csv=require('to-csv');var ejs=require(_0x252c('0x7'));var fs=require('fs');var fs_extra=require(_0x252c('0x8'));var _=require(_0x252c('0x9'));var squel=require('squel');var crypto=require(_0x252c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x252c('0xb'));var toCsv=require(_0x252c('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x252c('0xd'));var authService=require(_0x252c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x252c('0xf'));var hardwareService=require(_0x252c('0x10'));var logger=require(_0x252c('0x11'))('api');var utils=require(_0x252c('0x12'));var config=require(_0x252c('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21526f,_0xcef8fd){_0xcef8fd=_0xcef8fd||0xcc;return function(_0x80b419){if(_0x80b419){return _0x21526f[_0x252c('0x14')](_0xcef8fd);}return _0x21526f[_0x252c('0x15')](_0xcef8fd)[_0x252c('0x16')]();};}function respondWithResult(_0x2bcc53,_0x447f41){_0x447f41=_0x447f41||0xc8;return function(_0x1a0e58){if(_0x1a0e58){return _0x2bcc53['status'](_0x447f41)[_0x252c('0x17')](_0x1a0e58);}};}function respondWithFilteredResult(_0x228e74,_0x3b405d){return function(_0x7cd9be){if(_0x7cd9be){var _0x36481c=typeof _0x3b405d[_0x252c('0x18')]===_0x252c('0x19')&&typeof _0x3b405d[_0x252c('0x1a')]===_0x252c('0x19');var _0x41ffbd=_0x7cd9be[_0x252c('0x1b')];var _0x5e713d=_0x36481c?0x0:_0x3b405d[_0x252c('0x18')];var _0xb5cdfe=_0x36481c?_0x7cd9be[_0x252c('0x1b')]:_0x3b405d[_0x252c('0x18')]+_0x3b405d[_0x252c('0x1a')];var _0x59e9dc;if(_0xb5cdfe>=_0x41ffbd){_0xb5cdfe=_0x41ffbd;_0x59e9dc=0xc8;}else{_0x59e9dc=0xce;}_0x228e74[_0x252c('0x15')](_0x59e9dc);return _0x228e74[_0x252c('0x1c')](_0x252c('0x1d'),_0x5e713d+'-'+_0xb5cdfe+'/'+_0x41ffbd)[_0x252c('0x17')](_0x7cd9be);}return null;};}function patchUpdates(_0x5683a7){return function(_0x1fe3d6){try{jsonpatch[_0x252c('0x1e')](_0x1fe3d6,_0x5683a7,!![]);}catch(_0x23d35a){return BPromise[_0x252c('0x1f')](_0x23d35a);}return _0x1fe3d6[_0x252c('0x20')]();};}function saveUpdates(_0x7ea741,_0xda1643){return function(_0x5750cb){if(_0x5750cb){return _0x5750cb[_0x252c('0x21')](_0x7ea741)[_0x252c('0x22')](function(_0x187f2d){return _0x187f2d;});}return null;};}function removeEntity(_0x410fed,_0x32fe63){return function(_0x1f8d4e){if(_0x1f8d4e){return _0x1f8d4e[_0x252c('0x23')]()[_0x252c('0x22')](function(){_0x410fed[_0x252c('0x15')](0xcc)[_0x252c('0x16')]();});}};}function handleEntityNotFound(_0x971409,_0x1113b1){return function(_0x3af220){if(!_0x3af220){_0x971409[_0x252c('0x14')](0x194);}return _0x3af220;};}function handleError(_0x4b349b,_0x4dbf29){_0x4dbf29=_0x4dbf29||0x1f4;return function(_0x7660dd){logger[_0x252c('0x24')](_0x7660dd[_0x252c('0x25')]);if(_0x7660dd[_0x252c('0x26')]){delete _0x7660dd[_0x252c('0x26')];}_0x4b349b[_0x252c('0x15')](_0x4dbf29)[_0x252c('0x27')](_0x7660dd);};}exports[_0x252c('0x28')]=function(_0x5da3dd,_0x331bc0){var _0x58cafa={},_0x18f302={},_0xb5f6a={'count':0x0,'rows':[]};var _0x34516a=_['map'](db[_0x252c('0x29')][_0x252c('0x2a')],function(_0x344028){return{'name':_0x344028[_0x252c('0x2b')],'type':_0x344028[_0x252c('0x2c')]['key']};});_0x18f302[_0x252c('0x2d')]=_[_0x252c('0x2e')](_0x34516a,_0x252c('0x26'));_0x18f302[_0x252c('0x2f')]=_['keys'](_0x5da3dd[_0x252c('0x2f')]);_0x18f302[_0x252c('0x30')]=_['intersection'](_0x18f302[_0x252c('0x2d')],_0x18f302['query']);_0x58cafa[_0x252c('0x31')]=_['intersection'](_0x18f302[_0x252c('0x2d')],qs[_0x252c('0x32')](_0x5da3dd[_0x252c('0x2f')][_0x252c('0x32')]));_0x58cafa[_0x252c('0x31')]=_0x58cafa[_0x252c('0x31')][_0x252c('0x33')]?_0x58cafa[_0x252c('0x31')]:_0x18f302[_0x252c('0x2d')];if(!_0x5da3dd[_0x252c('0x2f')][_0x252c('0x34')](_0x252c('0x35'))){_0x58cafa[_0x252c('0x1a')]=qs[_0x252c('0x1a')](_0x5da3dd[_0x252c('0x2f')][_0x252c('0x1a')]);_0x58cafa['offset']=qs['offset'](_0x5da3dd['query'][_0x252c('0x18')]);}_0x58cafa['order']=qs[_0x252c('0x36')](_0x5da3dd[_0x252c('0x2f')][_0x252c('0x36')]);_0x58cafa[_0x252c('0x37')]=qs[_0x252c('0x30')](_[_0x252c('0x38')](_0x5da3dd[_0x252c('0x2f')],_0x18f302[_0x252c('0x30')]),_0x34516a);if(_0x5da3dd[_0x252c('0x2f')][_0x252c('0x39')]){_0x58cafa[_0x252c('0x37')]=_['merge'](_0x58cafa[_0x252c('0x37')],{'$or':_['map'](_0x34516a,function(_0x17b40a){if(_0x17b40a[_0x252c('0x2c')]!==_0x252c('0x3a')){var _0x438d39={};_0x438d39[_0x17b40a[_0x252c('0x26')]]={'$like':'%'+_0x5da3dd['query']['filter']+'%'};return _0x438d39;}})});}_0x58cafa=_[_0x252c('0x3b')]({},_0x58cafa,_0x5da3dd[_0x252c('0x3c')]);var _0x37ae5b={'where':_0x58cafa['where']};return db[_0x252c('0x29')][_0x252c('0x1b')](_0x37ae5b)[_0x252c('0x22')](function(_0x5c3980){_0xb5f6a[_0x252c('0x1b')]=_0x5c3980;if(_0x5da3dd[_0x252c('0x2f')][_0x252c('0x3d')]){_0x58cafa[_0x252c('0x3e')]=[{'all':!![]}];}return db['Attachment'][_0x252c('0x3f')](_0x58cafa);})[_0x252c('0x22')](function(_0x51ca82){_0xb5f6a[_0x252c('0x40')]=_0x51ca82;return _0xb5f6a;})['then'](respondWithFilteredResult(_0x331bc0,_0x58cafa))[_0x252c('0x41')](handleError(_0x331bc0,null));};exports['show']=function(_0xc2e9be,_0x2fea03){var _0x723fa8={'raw':!![],'where':{'id':_0xc2e9be['params']['id']}},_0x33007f={};_0x33007f[_0x252c('0x2d')]=_[_0x252c('0x42')](db[_0x252c('0x29')][_0x252c('0x2a')]);_0x33007f[_0x252c('0x2f')]=_[_0x252c('0x42')](_0xc2e9be[_0x252c('0x2f')]);_0x33007f[_0x252c('0x30')]=_[_0x252c('0x43')](_0x33007f['model'],_0x33007f[_0x252c('0x2f')]);_0x723fa8[_0x252c('0x31')]=_['intersection'](_0x33007f[_0x252c('0x2d')],qs[_0x252c('0x32')](_0xc2e9be[_0x252c('0x2f')][_0x252c('0x32')]));_0x723fa8[_0x252c('0x31')]=_0x723fa8[_0x252c('0x31')][_0x252c('0x33')]?_0x723fa8['attributes']:_0x33007f['model'];if(_0xc2e9be['query'][_0x252c('0x3d')]){_0x723fa8[_0x252c('0x3e')]=[{'all':!![]}];}_0x723fa8=_[_0x252c('0x3b')]({},_0x723fa8,_0xc2e9be[_0x252c('0x3c')]);return db[_0x252c('0x29')][_0x252c('0x44')](_0x723fa8)[_0x252c('0x22')](handleEntityNotFound(_0x2fea03,null))['then'](respondWithResult(_0x2fea03,null))[_0x252c('0x41')](handleError(_0x2fea03,null));};exports[_0x252c('0x45')]=function(_0x1e7259,_0x171de7){var _0x1beced={'where':{'id':_0x1e7259[_0x252c('0x46')]['id']}},_0x4013e0={};_0x4013e0[_0x252c('0x2d')]=_[_0x252c('0x42')](db[_0x252c('0x29')][_0x252c('0x2a')]);_0x1beced['attributes']=_[_0x252c('0x43')](_0x4013e0[_0x252c('0x2d')],qs[_0x252c('0x32')](_0x1e7259[_0x252c('0x2f')][_0x252c('0x32')]));_0x1beced['attributes']=_0x1beced[_0x252c('0x31')]['length']?_0x1beced[_0x252c('0x31')]:_0x4013e0[_0x252c('0x2d')];if(_0x1e7259[_0x252c('0x2f')][_0x252c('0x3d')]){_0x1beced[_0x252c('0x3e')]=[{'all':!![]}];}_0x1beced=_[_0x252c('0x3b')]({},_0x1beced,_0x1e7259[_0x252c('0x3c')]);return db['Attachment'][_0x252c('0x44')](_0x1beced)[_0x252c('0x22')](handleEntityNotFound(_0x171de7,null))['then'](function(_0x4deb85){if(_0x4deb85){var _0x2cfbe1=_0x4deb85[_0x252c('0x47')]({'plain':!![]});_0x2cfbe1=qs[_0x252c('0x48')](_0x2cfbe1,['id',_0x252c('0x49'),_0x252c('0x4a')]);_0x1e7259[_0x252c('0x4b')]=_[_0x252c('0x48')](_0x1e7259[_0x252c('0x4b')],['id',_0x252c('0x49'),'updatedAt']);return db[_0x252c('0x29')][_0x252c('0x4c')](_[_0x252c('0x3b')](_0x2cfbe1,_0x1e7259['body']),{'include':_0x1e7259[_0x252c('0x2f')][_0x252c('0x3d')]?[{'all':!![]}]:undefined});}})[_0x252c('0x22')](respondWithResult(_0x171de7,0xc9))[_0x252c('0x41')](handleError(_0x171de7,null));};exports[_0x252c('0x21')]=function(_0x33fa80,_0x319e2a){if(_0x33fa80[_0x252c('0x4b')]['id']){delete _0x33fa80[_0x252c('0x4b')]['id'];}return db[_0x252c('0x29')]['find']({'where':{'id':_0x33fa80[_0x252c('0x46')]['id']}})[_0x252c('0x22')](handleEntityNotFound(_0x319e2a,null))['then'](saveUpdates(_0x33fa80[_0x252c('0x4b')],null))[_0x252c('0x22')](respondWithResult(_0x319e2a,null))[_0x252c('0x41')](handleError(_0x319e2a,null));};exports[_0x252c('0x23')]=function(_0x3002f8,_0x2ce8a9){return db['Attachment'][_0x252c('0x44')]({'where':{'id':_0x3002f8[_0x252c('0x46')]['id']}})[_0x252c('0x22')](handleEntityNotFound(_0x2ce8a9,null))[_0x252c('0x22')](removeEntity(_0x2ce8a9,null))[_0x252c('0x41')](handleError(_0x2ce8a9,null));};exports[_0x252c('0x4c')]=function(_0x1b951a,_0x37c0bc,_0x499661){_0x1b951a[_0x252c('0x4b')][_0x252c('0x26')]=_0x1b951a['file']['originalname'];_0x1b951a[_0x252c('0x4b')][_0x252c('0x4d')]=_0x1b951a['file'][_0x252c('0x4e')];_0x1b951a[_0x252c('0x4b')][_0x252c('0x2c')]=_0x1b951a[_0x252c('0x4f')]['mimetype'];return db[_0x252c('0x29')][_0x252c('0x4c')](_0x1b951a[_0x252c('0x4b')])['then'](respondWithResult(_0x37c0bc,0xc9))[_0x252c('0x41')](handleError(_0x37c0bc,null));};exports[_0x252c('0x50')]=function(_0x9df70d,_0x24be47,_0x5c6b76){return db[_0x252c('0x29')][_0x252c('0x51')]({'where':{'id':_0x9df70d[_0x252c('0x46')]['id']},'raw':!![]})[_0x252c('0x22')](handleEntityNotFound(_0x24be47,null))[_0x252c('0x22')](function(_0x3b5cf0){if(_0x3b5cf0){var _0x4ee27c=_0x3b5cf0['ChatOfflineMessageId']!==null;var _0xcab94e=path['join'](config[_0x252c('0x52')],'server/files/attachments/');if(_0x4ee27c){_0xcab94e=path[_0x252c('0x53')](_0xcab94e,_0x252c('0x54'));}var _0xddd162=path[_0x252c('0x53')](_0xcab94e,_0x3b5cf0[_0x252c('0x4d')]);return _0x24be47['download'](_0xddd162);}})[_0x252c('0x41')](handleError(_0x24be47,null));};
\ No newline at end of file
+var _0xbe58=['filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','name','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','catch','show','keys','options','find','params','omit','updatedAt','body','create','file','originalname','basename'];(function(_0x36067f,_0xba548e){var _0x44f0b3=function(_0x1954af){while(--_0x1954af){_0x36067f['push'](_0x36067f['shift']());}};_0x44f0b3(++_0xba548e);}(_0xbe58,0x1bb));var _0x8be5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xbe58[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x8be5('0x0'));var rimraf=require(_0x8be5('0x1'));var zipdir=require(_0x8be5('0x2'));var jsonpatch=require(_0x8be5('0x3'));var rp=require('request-promise');var moment=require(_0x8be5('0x4'));var BPromise=require(_0x8be5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8be5('0x6'));var sox=require(_0x8be5('0x7'));var csv=require(_0x8be5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8be5('0x9'));var crypto=require(_0x8be5('0xa'));var jsforce=require(_0x8be5('0xb'));var deskjs=require(_0x8be5('0xc'));var toCsv=require(_0x8be5('0x8'));var querystring=require(_0x8be5('0xd'));var Papa=require('papaparse');var Redis=require(_0x8be5('0xe'));var authService=require(_0x8be5('0xf'));var qs=require(_0x8be5('0x10'));var as=require(_0x8be5('0x11'));var hardwareService=require(_0x8be5('0x12'));var logger=require(_0x8be5('0x13'))(_0x8be5('0x14'));var utils=require(_0x8be5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8be5('0x16'));var db=require(_0x8be5('0x17'))['db'];function respondWithStatusCode(_0x5ec4e8,_0xfbcb7d){_0xfbcb7d=_0xfbcb7d||0xcc;return function(_0x4b9151){if(_0x4b9151){return _0x5ec4e8[_0x8be5('0x18')](_0xfbcb7d);}return _0x5ec4e8[_0x8be5('0x19')](_0xfbcb7d)[_0x8be5('0x1a')]();};}function respondWithResult(_0x509f53,_0x305786){_0x305786=_0x305786||0xc8;return function(_0x3b0cca){if(_0x3b0cca){return _0x509f53[_0x8be5('0x19')](_0x305786)[_0x8be5('0x1b')](_0x3b0cca);}};}function respondWithFilteredResult(_0x13d186,_0x5efd6b){return function(_0x13cf67){if(_0x13cf67){var _0x3ede58=typeof _0x5efd6b[_0x8be5('0x1c')]===_0x8be5('0x1d')&&typeof _0x5efd6b[_0x8be5('0x1e')]===_0x8be5('0x1d');var _0x593579=_0x13cf67[_0x8be5('0x1f')];var _0x1fdfda=_0x3ede58?0x0:_0x5efd6b[_0x8be5('0x1c')];var _0x22687c=_0x3ede58?_0x13cf67[_0x8be5('0x1f')]:_0x5efd6b[_0x8be5('0x1c')]+_0x5efd6b[_0x8be5('0x1e')];var _0x3c87e1;if(_0x22687c>=_0x593579){_0x22687c=_0x593579;_0x3c87e1=0xc8;}else{_0x3c87e1=0xce;}_0x13d186[_0x8be5('0x19')](_0x3c87e1);return _0x13d186[_0x8be5('0x20')](_0x8be5('0x21'),_0x1fdfda+'-'+_0x22687c+'/'+_0x593579)[_0x8be5('0x1b')](_0x13cf67);}return null;};}function patchUpdates(_0x40bf01){return function(_0x230781){try{jsonpatch['apply'](_0x230781,_0x40bf01,!![]);}catch(_0x52b8e7){return BPromise[_0x8be5('0x22')](_0x52b8e7);}return _0x230781[_0x8be5('0x23')]();};}function saveUpdates(_0x4bc317,_0x29f6e7){return function(_0xf52956){if(_0xf52956){return _0xf52956[_0x8be5('0x24')](_0x4bc317)[_0x8be5('0x25')](function(_0x28c290){return _0x28c290;});}return null;};}function removeEntity(_0x597538,_0x211edc){return function(_0x5045e6){if(_0x5045e6){return _0x5045e6[_0x8be5('0x26')]()['then'](function(){_0x597538['status'](0xcc)[_0x8be5('0x1a')]();});}};}function handleEntityNotFound(_0x5333aa,_0x2c1103){return function(_0x1481c5){if(!_0x1481c5){_0x5333aa[_0x8be5('0x18')](0x194);}return _0x1481c5;};}function handleError(_0x46763b,_0x92ba94){_0x92ba94=_0x92ba94||0x1f4;return function(_0x3fb0e0){logger[_0x8be5('0x27')](_0x3fb0e0[_0x8be5('0x28')]);if(_0x3fb0e0['name']){delete _0x3fb0e0['name'];}_0x46763b[_0x8be5('0x19')](_0x92ba94)[_0x8be5('0x29')](_0x3fb0e0);};}exports[_0x8be5('0x2a')]=function(_0x330a40,_0x135ccd){var _0x13db14={},_0x2b4e8e={},_0xe380b={'count':0x0,'rows':[]};var _0x5a45b9=_['map'](db[_0x8be5('0x2b')][_0x8be5('0x2c')],function(_0x5f087d){return{'name':_0x5f087d[_0x8be5('0x2d')],'type':_0x5f087d[_0x8be5('0x2e')][_0x8be5('0x2f')]};});_0x2b4e8e[_0x8be5('0x30')]=_[_0x8be5('0x31')](_0x5a45b9,_0x8be5('0x32'));_0x2b4e8e[_0x8be5('0x33')]=_['keys'](_0x330a40[_0x8be5('0x33')]);_0x2b4e8e['filters']=_[_0x8be5('0x34')](_0x2b4e8e[_0x8be5('0x30')],_0x2b4e8e[_0x8be5('0x33')]);_0x13db14['attributes']=_[_0x8be5('0x34')](_0x2b4e8e['model'],qs[_0x8be5('0x35')](_0x330a40[_0x8be5('0x33')][_0x8be5('0x35')]));_0x13db14[_0x8be5('0x36')]=_0x13db14[_0x8be5('0x36')]['length']?_0x13db14[_0x8be5('0x36')]:_0x2b4e8e['model'];if(!_0x330a40[_0x8be5('0x33')][_0x8be5('0x37')](_0x8be5('0x38'))){_0x13db14[_0x8be5('0x1e')]=qs[_0x8be5('0x1e')](_0x330a40[_0x8be5('0x33')][_0x8be5('0x1e')]);_0x13db14['offset']=qs[_0x8be5('0x1c')](_0x330a40[_0x8be5('0x33')][_0x8be5('0x1c')]);}_0x13db14[_0x8be5('0x39')]=qs[_0x8be5('0x3a')](_0x330a40['query'][_0x8be5('0x3a')]);_0x13db14[_0x8be5('0x3b')]=qs[_0x8be5('0x3c')](_['pick'](_0x330a40[_0x8be5('0x33')],_0x2b4e8e['filters']),_0x5a45b9);if(_0x330a40['query'][_0x8be5('0x3d')]){_0x13db14[_0x8be5('0x3b')]=_[_0x8be5('0x3e')](_0x13db14[_0x8be5('0x3b')],{'$or':_[_0x8be5('0x31')](_0x5a45b9,function(_0x21c545){if(_0x21c545['type']!==_0x8be5('0x3f')){var _0x20c56f={};_0x20c56f[_0x21c545[_0x8be5('0x32')]]={'$like':'%'+_0x330a40[_0x8be5('0x33')]['filter']+'%'};return _0x20c56f;}})});}_0x13db14=_[_0x8be5('0x3e')]({},_0x13db14,_0x330a40['options']);var _0x1dce03={'where':_0x13db14[_0x8be5('0x3b')]};return db[_0x8be5('0x2b')]['count'](_0x1dce03)[_0x8be5('0x25')](function(_0x1ddd2a){_0xe380b['count']=_0x1ddd2a;if(_0x330a40[_0x8be5('0x33')][_0x8be5('0x40')]){_0x13db14[_0x8be5('0x41')]=[{'all':!![]}];}return db[_0x8be5('0x2b')]['findAll'](_0x13db14);})[_0x8be5('0x25')](function(_0x4a5b8e){_0xe380b['rows']=_0x4a5b8e;return _0xe380b;})['then'](respondWithFilteredResult(_0x135ccd,_0x13db14))[_0x8be5('0x42')](handleError(_0x135ccd,null));};exports[_0x8be5('0x43')]=function(_0x563670,_0x366da3){var _0x240e45={'raw':!![],'where':{'id':_0x563670['params']['id']}},_0x3662c5={};_0x3662c5[_0x8be5('0x30')]=_[_0x8be5('0x44')](db[_0x8be5('0x2b')]['rawAttributes']);_0x3662c5[_0x8be5('0x33')]=_[_0x8be5('0x44')](_0x563670[_0x8be5('0x33')]);_0x3662c5[_0x8be5('0x3c')]=_[_0x8be5('0x34')](_0x3662c5[_0x8be5('0x30')],_0x3662c5['query']);_0x240e45[_0x8be5('0x36')]=_['intersection'](_0x3662c5[_0x8be5('0x30')],qs[_0x8be5('0x35')](_0x563670['query'][_0x8be5('0x35')]));_0x240e45[_0x8be5('0x36')]=_0x240e45[_0x8be5('0x36')]['length']?_0x240e45[_0x8be5('0x36')]:_0x3662c5[_0x8be5('0x30')];if(_0x563670[_0x8be5('0x33')][_0x8be5('0x40')]){_0x240e45[_0x8be5('0x41')]=[{'all':!![]}];}_0x240e45=_[_0x8be5('0x3e')]({},_0x240e45,_0x563670[_0x8be5('0x45')]);return db[_0x8be5('0x2b')][_0x8be5('0x46')](_0x240e45)[_0x8be5('0x25')](handleEntityNotFound(_0x366da3,null))[_0x8be5('0x25')](respondWithResult(_0x366da3,null))['catch'](handleError(_0x366da3,null));};exports['clone']=function(_0xc052a9,_0x3eb612){var _0x42475d={'where':{'id':_0xc052a9[_0x8be5('0x47')]['id']}},_0x328058={};_0x328058[_0x8be5('0x30')]=_[_0x8be5('0x44')](db['Attachment'][_0x8be5('0x2c')]);_0x42475d['attributes']=_[_0x8be5('0x34')](_0x328058['model'],qs[_0x8be5('0x35')](_0xc052a9[_0x8be5('0x33')][_0x8be5('0x35')]));_0x42475d[_0x8be5('0x36')]=_0x42475d[_0x8be5('0x36')]['length']?_0x42475d[_0x8be5('0x36')]:_0x328058[_0x8be5('0x30')];if(_0xc052a9[_0x8be5('0x33')][_0x8be5('0x40')]){_0x42475d['include']=[{'all':!![]}];}_0x42475d=_[_0x8be5('0x3e')]({},_0x42475d,_0xc052a9[_0x8be5('0x45')]);return db['Attachment'][_0x8be5('0x46')](_0x42475d)['then'](handleEntityNotFound(_0x3eb612,null))['then'](function(_0x5a43a9){if(_0x5a43a9){var _0x11f9d0=_0x5a43a9['get']({'plain':!![]});_0x11f9d0=qs[_0x8be5('0x48')](_0x11f9d0,['id','createdAt',_0x8be5('0x49')]);_0xc052a9[_0x8be5('0x4a')]=_[_0x8be5('0x48')](_0xc052a9[_0x8be5('0x4a')],['id','createdAt',_0x8be5('0x49')]);return db[_0x8be5('0x2b')][_0x8be5('0x4b')](_[_0x8be5('0x3e')](_0x11f9d0,_0xc052a9[_0x8be5('0x4a')]),{'include':_0xc052a9[_0x8be5('0x33')][_0x8be5('0x40')]?[{'all':!![]}]:undefined});}})[_0x8be5('0x25')](respondWithResult(_0x3eb612,0xc9))[_0x8be5('0x42')](handleError(_0x3eb612,null));};exports['update']=function(_0x4f517f,_0xa3bdf5){if(_0x4f517f[_0x8be5('0x4a')]['id']){delete _0x4f517f[_0x8be5('0x4a')]['id'];}return db[_0x8be5('0x2b')][_0x8be5('0x46')]({'where':{'id':_0x4f517f['params']['id']}})[_0x8be5('0x25')](handleEntityNotFound(_0xa3bdf5,null))[_0x8be5('0x25')](saveUpdates(_0x4f517f[_0x8be5('0x4a')],null))[_0x8be5('0x25')](respondWithResult(_0xa3bdf5,null))[_0x8be5('0x42')](handleError(_0xa3bdf5,null));};exports[_0x8be5('0x26')]=function(_0x150b25,_0x4f3a33){return db[_0x8be5('0x2b')][_0x8be5('0x46')]({'where':{'id':_0x150b25[_0x8be5('0x47')]['id']}})[_0x8be5('0x25')](handleEntityNotFound(_0x4f3a33,null))['then'](removeEntity(_0x4f3a33,null))[_0x8be5('0x42')](handleError(_0x4f3a33,null));};exports['create']=function(_0x3e573e,_0x1b9742,_0x446d7d){_0x3e573e[_0x8be5('0x4a')][_0x8be5('0x32')]=_0x3e573e[_0x8be5('0x4c')][_0x8be5('0x4d')];_0x3e573e[_0x8be5('0x4a')][_0x8be5('0x4e')]=_0x3e573e[_0x8be5('0x4c')][_0x8be5('0x4f')];_0x3e573e[_0x8be5('0x4a')]['type']=_0x3e573e[_0x8be5('0x4c')][_0x8be5('0x50')];return db['Attachment'][_0x8be5('0x4b')](_0x3e573e[_0x8be5('0x4a')])[_0x8be5('0x25')](respondWithResult(_0x1b9742,0xc9))[_0x8be5('0x42')](handleError(_0x1b9742,null));};exports[_0x8be5('0x51')]=function(_0x592aab,_0x584c7b,_0x2aee76){return db[_0x8be5('0x2b')]['findOne']({'where':{'id':_0x592aab[_0x8be5('0x47')]['id']},'raw':!![]})[_0x8be5('0x25')](handleEntityNotFound(_0x584c7b,null))[_0x8be5('0x25')](function(_0x5bf0f4){if(_0x5bf0f4){var _0x5c8e0d=_0x5bf0f4[_0x8be5('0x52')]!==null;var _0x2d6de0=path[_0x8be5('0x53')](config[_0x8be5('0x54')],_0x8be5('0x55'));if(_0x5c8e0d){_0x2d6de0=path[_0x8be5('0x53')](_0x2d6de0,_0x8be5('0x56'));}var _0x3163f0=path[_0x8be5('0x53')](_0x2d6de0,_0x5bf0f4[_0x8be5('0x4e')]);return _0x584c7b[_0x8be5('0x51')](_0x3163f0);}})[_0x8be5('0x42')](handleError(_0x584c7b,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index ba8c256..1e82c94 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 _0x174e=['../../config/environment','define','Attachment','util','api','bluebird','path','rimraf'];(function(_0x7e8c80,_0x402cb1){var _0x3bc133=function(_0x38d249){while(--_0x38d249){_0x7e8c80['push'](_0x7e8c80['shift']());}};_0x3bc133(++_0x402cb1);}(_0x174e,0xfb));var _0xe174=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x174e[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0xe174('0x0'));var logger=require('../../config/logger')(_0xe174('0x1'));var moment=require('moment');var BPromise=require(_0xe174('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe174('0x3'));var rimraf=require(_0xe174('0x4'));var config=require(_0xe174('0x5'));var attributes=require('./attachment.attributes');module['exports']=function(_0x52fe13,_0x25bb16){return _0x52fe13[_0xe174('0x6')](_0xe174('0x7'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x138f=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash','util','api','moment','bluebird'];(function(_0x13440b,_0x4b3719){var _0x521722=function(_0x29c3cb){while(--_0x29c3cb){_0x13440b['push'](_0x13440b['shift']());}};_0x521722(++_0x4b3719);}(_0x138f,0x1e9));var _0xf138=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0x138f[_0x5a7112];return _0x3147f7;};'use strict';var _=require(_0xf138('0x0'));var util=require(_0xf138('0x1'));var logger=require('../../config/logger')(_0xf138('0x2'));var moment=require(_0xf138('0x3'));var BPromise=require(_0xf138('0x4'));var rp=require(_0xf138('0x5'));var fs=require('fs');var path=require(_0xf138('0x6'));var rimraf=require(_0xf138('0x7'));var config=require(_0xf138('0x8'));var attributes=require(_0xf138('0x9'));module[_0xf138('0xa')]=function(_0x26eaa3,_0x55d2c6){return _0x26eaa3[_0xf138('0xb')](_0xf138('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index ab1ce32..4d9f011 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 _0xf109=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','create','options','raw','stringify','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error'];(function(_0x342ed7,_0xc25de3){var _0x4a0b5c=function(_0x19ad28){while(--_0x19ad28){_0x342ed7['push'](_0x342ed7['shift']());}};_0x4a0b5c(++_0xc25de3);}(_0xf109,0xce));var _0x9f10=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xf109[_0x616290];return _0x453879;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var moment=require(_0x9f10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f10('0x3'))['db'];var utils=require(_0x9f10('0x4'));var logger=require(_0x9f10('0x5'))(_0x9f10('0x6'));var config=require(_0x9f10('0x7'));var jayson=require(_0x9f10('0x8'));var client=jayson[_0x9f10('0x9')][_0x9f10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227a29,_0x2a877e,_0x3fd82f){return new BPromise(function(_0x5c8719,_0x42a8cd){return client[_0x9f10('0xb')](_0x227a29,_0x3fd82f)[_0x9f10('0xc')](function(_0x1bde2e){logger[_0x9f10('0xd')]('Attachment,\x20%s,\x20%s',_0x2a877e,_0x9f10('0xe'));logger[_0x9f10('0xf')](_0x9f10('0x10'),_0x2a877e,'request\x20sent',JSON['stringify'](_0x1bde2e));if(_0x1bde2e[_0x9f10('0x11')]){if(_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x12')]===0x1f4){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x42a8cd(_0x1bde2e['error'][_0x9f10('0x14')]);}logger[_0x9f10('0x11')]('Attachment,\x20%s,\x20%s',_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x5c8719(_0x1bde2e['error']['message']);}else{logger[_0x9f10('0xd')](_0x9f10('0x13'),_0x2a877e,'request\x20sent');_0x5c8719(_0x1bde2e[_0x9f10('0x15')]['message']);}})[_0x9f10('0x16')](function(_0x1f68d8){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1f68d8);_0x42a8cd(_0x1f68d8);});});}exports[_0x9f10('0x17')]=function(_0x509fba){var _0x150813=this;return new Promise(function(_0x53bfbd,_0xe221d0){return db['Attachment'][_0x9f10('0x18')](_0x509fba['body'],{'raw':_0x509fba['options']?_0x509fba[_0x9f10('0x19')][_0x9f10('0x1a')]===undefined?!![]:![]:!![]})[_0x9f10('0xc')](function(_0x3a78be){logger[_0x9f10('0xd')](_0x9f10('0x17'),_0x509fba);logger[_0x9f10('0xf')]('CreateAttachment',_0x509fba,JSON[_0x9f10('0x1b')](_0x3a78be));_0x53bfbd(_0x3a78be);})['catch'](function(_0x293990){logger[_0x9f10('0x11')](_0x9f10('0x17'),_0x293990['message'],_0x509fba);_0xe221d0(_0x150813[_0x9f10('0x11')](0x1f4,_0x293990[_0x9f10('0x14')]));});});};
\ No newline at end of file
+var _0xa477=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','create','body','options','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xa477,0xe6));var _0x7a47=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa477[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x7a47('0x0'));var util=require(_0x7a47('0x1'));var moment=require('moment');var BPromise=require(_0x7a47('0x2'));var rs=require(_0x7a47('0x3'));var fs=require('fs');var Redis=require(_0x7a47('0x4'));var db=require(_0x7a47('0x5'))['db'];var utils=require(_0x7a47('0x6'));var logger=require(_0x7a47('0x7'))(_0x7a47('0x8'));var config=require('../../config/environment');var jayson=require(_0x7a47('0x9'));var client=jayson[_0x7a47('0xa')][_0x7a47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6e0e,_0x54e9aa,_0x47f594){return new BPromise(function(_0x4276ed,_0x49db4c){return client[_0x7a47('0xc')](_0x4c6e0e,_0x47f594)[_0x7a47('0xd')](function(_0x52eb49){logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,_0x7a47('0x10'));logger[_0x7a47('0x11')](_0x7a47('0x12'),_0x54e9aa,'request\x20sent',JSON[_0x7a47('0x13')](_0x52eb49));if(_0x52eb49[_0x7a47('0x14')]){if(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x15')]===0x1f4){logger['error'](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);return _0x49db4c(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')]['message']);return _0x4276ed(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}else{logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,'request\x20sent');_0x4276ed(_0x52eb49[_0x7a47('0x17')][_0x7a47('0x16')]);}})['catch'](function(_0x4a81fb){logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x4a81fb);_0x49db4c(_0x4a81fb);});});}exports[_0x7a47('0x18')]=function(_0x5a4e79){var _0x444c48=this;return new Promise(function(_0x4a24b6,_0x203ab4){return db[_0x7a47('0x19')][_0x7a47('0x1a')](_0x5a4e79[_0x7a47('0x1b')],{'raw':_0x5a4e79[_0x7a47('0x1c')]?_0x5a4e79[_0x7a47('0x1c')][_0x7a47('0x1d')]===undefined?!![]:![]:!![]})[_0x7a47('0xd')](function(_0x46e58d){logger['info'](_0x7a47('0x18'),_0x5a4e79);logger[_0x7a47('0x11')](_0x7a47('0x18'),_0x5a4e79,JSON[_0x7a47('0x13')](_0x46e58d));_0x4a24b6(_0x46e58d);})[_0x7a47('0x1e')](function(_0x322426){logger[_0x7a47('0x14')](_0x7a47('0x18'),_0x322426[_0x7a47('0x16')],_0x5a4e79);_0x203ab4(_0x444c48[_0x7a47('0x14')](0x1f4,_0x322426[_0x7a47('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index b1d15c0..93def19 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x41ceef,_0x3ea479){var _0x22ab0a=function(_0x145d9a){while(--_0x145d9a){_0x41ceef['push'](_0x41ceef['shift']());}};_0x22ab0a(++_0x3ea479);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b9400,_0x1261de){_0x3b9400=_0x3b9400-0x0;var _0x26ed18=_0x5f2f[_0x3b9400];return _0x26ed18;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x299733,_0x1f9f20){var _0x588c40=function(_0x459427){while(--_0x459427){_0x299733['push'](_0x299733['shift']());}};_0x588c40(++_0x1f9f20);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c4866,_0x255b66){_0x1c4866=_0x1c4866-0x0;var _0x4239e6=_0xb10b[_0x1c4866];return _0x4239e6;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 1d66383..1a70454 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 _0x3f6b=['catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','password','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','disabled','blocked','blockedAt','admin','agent','blockDuration','add','minutes','clearBlockUser','getLicense'];(function(_0xf08acb,_0x510eb2){var _0x1034da=function(_0x4e1c20){while(--_0x4e1c20){_0xf08acb['push'](_0xf08acb['shift']());}};_0x1034da(++_0x510eb2);}(_0x3f6b,0x10b));var _0xb3f6=function(_0x454830,_0x10fa3d){_0x454830=_0x454830-0x0;var _0x36fcf8=_0x3f6b[_0x454830];return _0x36fcf8;};'use strict';var passport=require(_0xb3f6('0x0'));var LocalStrategy=require(_0xb3f6('0x1'))[_0xb3f6('0x2')];var moment=require(_0xb3f6('0x3'));var ActiveDirectory=require(_0xb3f6('0x4'));var BPromise=require(_0xb3f6('0x5'));var util=require(_0xb3f6('0x6'));var db=require(_0xb3f6('0x7'))['db'];var authService=require(_0xb3f6('0x8'));var utils=require(_0xb3f6('0x9'));var config=require(_0xb3f6('0xa'));var logger=require(_0xb3f6('0xb'))('api');function isActiveDirectoryConfigured(_0x1c7401){var _0x5b869b=![];if(typeof _0x1c7401['activedirectory']!=='undefined'){_0x5b869b=_0x1c7401[_0xb3f6('0xc')][_0xb3f6('0xd')]&&_0x1c7401[_0xb3f6('0xc')][_0xb3f6('0xe')]&&_0x1c7401[_0xb3f6('0xc')][_0xb3f6('0xf')];}return _0x5b869b;}function adAuthenticate(_0xb0e34f,_0x216527,_0xe599a7){return new BPromise(function(_0x5b2981,_0x1d6500){try{var _0x4e7519=new ActiveDirectory(_0xb0e34f);_0x4e7519[_0xb3f6('0x10')](_0x216527,_0xe599a7,function(_0x3548d7,_0x847335){if(_0x3548d7){logger['error'](_0xb3f6('0x11'),_0x216527,util[_0xb3f6('0x12')](_0x3548d7,{'showHidden':![],'depth':null}));_0x1d6500(_0xb3f6('0x13'));}else if(!_0x847335){logger[_0xb3f6('0x14')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x216527);_0x1d6500(_0xb3f6('0x13'));}else{_0x5b2981(_0x847335);}});}catch(_0x8be1a5){_0x1d6500(_0x8be1a5);}});}function ActiveDirectoryAuthenticate(_0x1372b5,_0x17bd47,_0x5c1da1,_0x48d7dc){var _0x1d7205,_0x20d35b;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xb3f6('0x15'),_0x17bd47);return _0x48d7dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xb3f6('0x16')][_0xb3f6('0x17')]({'where':{'id':0x1},'attributes':[_0xb3f6('0x18'),'blockDuration'],'raw':!![]})[_0xb3f6('0x19')](function(_0x3a94d3){_0x1d7205=_0x3a94d3;if(!_0x1d7205[_0xb3f6('0x18')]){logger['error'](_0xb3f6('0x1a'),_0x17bd47);throw new Error(_0xb3f6('0x13'));}return _0x1372b5['findOne']({'attributes':['id',_0xb3f6('0x1b'),'password',_0xb3f6('0x1c'),'role',_0xb3f6('0x1d'),_0xb3f6('0x1e'),_0xb3f6('0x1f'),'online'],'where':{'name':_0x17bd47,'role':{'$or':[_0xb3f6('0x20'),'user',_0xb3f6('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x353ca8){if(!_0x353ca8||_0x353ca8&&_0x353ca8['name']!==_0x17bd47){throw new Error(_0xb3f6('0x13'));}_0x20d35b=_0x353ca8;var _0x22619b=_0x20d35b['name']+'@'+config['activedirectory'][_0xb3f6('0xf')];return adAuthenticate(config[_0xb3f6('0xc')],_0x22619b,_0x5c1da1);})[_0xb3f6('0x19')](function(_0x516988){if(_0x20d35b[_0xb3f6('0x1d')]){throw new Error(_0xb3f6('0x13'));}if(_0x1d7205[_0xb3f6('0x22')]>0x0){if(_0x20d35b[_0xb3f6('0x1e')]){if(moment(_0x20d35b[_0xb3f6('0x1f')])[_0xb3f6('0x23')](_0x1d7205[_0xb3f6('0x22')],_0xb3f6('0x24'))>moment()){throw new Error(_0xb3f6('0x13'));}return utils[_0xb3f6('0x25')](_0x20d35b,0x0,![],null)[_0xb3f6('0x19')](function(){return utils['getLicense'](_0x20d35b);})['then'](function(){return _0x48d7dc(null,_0x20d35b);});}else{return utils[_0xb3f6('0x26')](_0x20d35b)[_0xb3f6('0x19')](function(){return _0x48d7dc(null,_0x20d35b);});}}else{return utils[_0xb3f6('0x26')](_0x20d35b)[_0xb3f6('0x19')](function(){return _0x48d7dc(null,_0x20d35b);});}})[_0xb3f6('0x27')](function(_0x5b908d){return _0x48d7dc(null,![],_0x5b908d);});}function handleError(_0x19c8e3,_0x2d41c3,_0x23e2dc){return _0x19c8e3[_0xb3f6('0x28')](_0x2d41c3||0x1f4)['send']({'message':_0x23e2dc?_0x23e2dc[_0xb3f6('0x29')]||_0x23e2dc:''});}exports[_0xb3f6('0x2a')]=function(_0x257ed8,_0x5ca8b4,_0x538fa7){passport[_0xb3f6('0x10')](_0xb3f6('0x2b'),function(_0x5359bf,_0x3f2502,_0x1b9461){var _0x3754e8=_0x5359bf||_0x1b9461;if(_0x3754e8){return handleError(_0x5ca8b4,0x191,_0x3754e8);}if(!_0x3f2502){return handleError(_0x5ca8b4,0x194,{'message':_0xb3f6('0x2c')});}else{var _0x1e4521={'payload':{'id':_0x3f2502['id'],'role':_0x3f2502[_0xb3f6('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0xb3f6('0x2e')](_0x1e4521)[_0xb3f6('0x19')](function(_0x4c6efd){_0x5ca8b4[_0xb3f6('0x2f')]({'id':_0x3f2502['id'],'token':_0x4c6efd,'statusCall':'','isAlreadyLogged':_0x3f2502[_0xb3f6('0x30')]});});}})(_0x257ed8,_0x5ca8b4,_0x538fa7);};passport['use'](_0xb3f6('0x2b'),new LocalStrategy({'usernameField':_0xb3f6('0x1b'),'passwordField':_0xb3f6('0x31')},function(_0x57e027,_0x42599c,_0x5b0af5){return ActiveDirectoryAuthenticate(db[_0xb3f6('0x32')],_0x57e027,_0x42599c,_0x5b0af5);}));
\ No newline at end of file
+var _0x46b1=['User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','api','activedirectory','baseDN','url','domain','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','online','admin','user','agent','add','clearBlockUser','getLicense','message','login','authenticate','ad-login','signToken','json','use'];(function(_0xa4bd21,_0x232b23){var _0x34f8da=function(_0x5642ce){while(--_0x5642ce){_0xa4bd21['push'](_0xa4bd21['shift']());}};_0x34f8da(++_0x232b23);}(_0x46b1,0x143));var _0x146b=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0x46b1[_0x46a3ff];return _0x404bc2;};'use strict';var passport=require(_0x146b('0x0'));var LocalStrategy=require(_0x146b('0x1'))[_0x146b('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x146b('0x3'));var BPromise=require(_0x146b('0x4'));var util=require(_0x146b('0x5'));var db=require(_0x146b('0x6'))['db'];var authService=require(_0x146b('0x7'));var utils=require(_0x146b('0x8'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x146b('0x9'));function isActiveDirectoryConfigured(_0x2622ec){var _0x4bb974=![];if(typeof _0x2622ec[_0x146b('0xa')]!=='undefined'){_0x4bb974=_0x2622ec[_0x146b('0xa')][_0x146b('0xb')]&&_0x2622ec[_0x146b('0xa')][_0x146b('0xc')]&&_0x2622ec[_0x146b('0xa')][_0x146b('0xd')];}return _0x4bb974;}function adAuthenticate(_0x22f636,_0x570709,_0x15526a){return new BPromise(function(_0x5d5f4b,_0x484dfb){try{var _0x270c94=new ActiveDirectory(_0x22f636);_0x270c94['authenticate'](_0x570709,_0x15526a,function(_0x368902,_0x96af3d){if(_0x368902){logger[_0x146b('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x570709,util[_0x146b('0xf')](_0x368902,{'showHidden':![],'depth':null}));_0x484dfb(_0x146b('0x10'));}else if(!_0x96af3d){logger['error'](_0x146b('0x11'),_0x570709);_0x484dfb('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5d5f4b(_0x96af3d);}});}catch(_0xbe67db){_0x484dfb(_0xbe67db);}});}function ActiveDirectoryAuthenticate(_0x4fd47c,_0x3a0930,_0x5b480f,_0x532d77){var _0xd68a18,_0x3bed78;if(!isActiveDirectoryConfigured(config)){logger[_0x146b('0xe')](_0x146b('0x12'),_0x3a0930);return _0x532d77(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x146b('0x13')][_0x146b('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x146b('0x15')],'raw':!![]})[_0x146b('0x16')](function(_0x235785){_0xd68a18=_0x235785;if(!_0xd68a18[_0x146b('0x17')]){logger[_0x146b('0xe')](_0x146b('0x18'),_0x3a0930);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x4fd47c[_0x146b('0x14')]({'attributes':['id',_0x146b('0x19'),_0x146b('0x1a'),_0x146b('0x1b'),_0x146b('0x1c'),_0x146b('0x1d'),_0x146b('0x1e'),'blockedAt',_0x146b('0x1f')],'where':{'name':_0x3a0930,'role':{'$or':[_0x146b('0x20'),_0x146b('0x21'),_0x146b('0x22')]},'adSsoEnabled':!![]}});})[_0x146b('0x16')](function(_0x432045){if(!_0x432045||_0x432045&&_0x432045[_0x146b('0x19')]!==_0x3a0930){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x3bed78=_0x432045;var _0x5ba207=_0x3bed78[_0x146b('0x19')]+'@'+config['activedirectory'][_0x146b('0xd')];return adAuthenticate(config['activedirectory'],_0x5ba207,_0x5b480f);})[_0x146b('0x16')](function(_0x5156ad){if(_0x3bed78[_0x146b('0x1d')]){throw new Error(_0x146b('0x10'));}if(_0xd68a18[_0x146b('0x15')]>0x0){if(_0x3bed78[_0x146b('0x1e')]){if(moment(_0x3bed78['blockedAt'])[_0x146b('0x23')](_0xd68a18[_0x146b('0x15')],'minutes')>moment()){throw new Error(_0x146b('0x10'));}return utils[_0x146b('0x24')](_0x3bed78,0x0,![],null)[_0x146b('0x16')](function(){return utils[_0x146b('0x25')](_0x3bed78);})[_0x146b('0x16')](function(){return _0x532d77(null,_0x3bed78);});}else{return utils[_0x146b('0x25')](_0x3bed78)[_0x146b('0x16')](function(){return _0x532d77(null,_0x3bed78);});}}else{return utils[_0x146b('0x25')](_0x3bed78)[_0x146b('0x16')](function(){return _0x532d77(null,_0x3bed78);});}})['catch'](function(_0x1e8b03){return _0x532d77(null,![],_0x1e8b03);});}function handleError(_0x3107b7,_0x2e6f12,_0x1c7bf2){return _0x3107b7['status'](_0x2e6f12||0x1f4)['send']({'message':_0x1c7bf2?_0x1c7bf2[_0x146b('0x26')]||_0x1c7bf2:''});}exports[_0x146b('0x27')]=function(_0x1886f7,_0x1d9823,_0xb98687){passport[_0x146b('0x28')](_0x146b('0x29'),function(_0x195c63,_0xec8ea1,_0x17ce46){var _0x3e6a6e=_0x195c63||_0x17ce46;if(_0x3e6a6e){return handleError(_0x1d9823,0x191,_0x3e6a6e);}if(!_0xec8ea1){return handleError(_0x1d9823,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x538c98={'payload':{'id':_0xec8ea1['id'],'role':_0xec8ea1[_0x146b('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x146b('0x2a')](_0x538c98)['then'](function(_0x4aadec){_0x1d9823[_0x146b('0x2b')]({'id':_0xec8ea1['id'],'token':_0x4aadec,'statusCall':'','isAlreadyLogged':_0xec8ea1[_0x146b('0x1f')]});});}})(_0x1886f7,_0x1d9823,_0xb98687);};passport[_0x146b('0x2c')](_0x146b('0x29'),new LocalStrategy({'usernameField':_0x146b('0x19'),'passwordField':_0x146b('0x1a')},function(_0x5928e8,_0x514abe,_0x2f07ce){return ActiveDirectoryAuthenticate(db[_0x146b('0x2d')],_0x5928e8,_0x514abe,_0x2f07ce);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index e2dd1d5..a34af44 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 _0x1cce=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x35644c,_0x3c80a0){var _0xc2e514=function(_0x588b4c){while(--_0x588b4c){_0x35644c['push'](_0x35644c['shift']());}};_0xc2e514(++_0x3c80a0);}(_0x1cce,0x12d));var _0xe1cc=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x1cce[_0x5e6ea3];return _0x4048b5;};'use strict';var express=require(_0xe1cc('0x0'));var router=express[_0xe1cc('0x1')]();var controller=require(_0xe1cc('0x2'));router[_0xe1cc('0x3')]('/',controller[_0xe1cc('0x4')]);module[_0xe1cc('0x5')]=router;
\ No newline at end of file
+var _0xa5f0=['Router','./authActiveDirectory.controller','post','login'];(function(_0x47ce01,_0xb97f10){var _0x5c05fc=function(_0x399cec){while(--_0x399cec){_0x47ce01['push'](_0x47ce01['shift']());}};_0x5c05fc(++_0xb97f10);}(_0xa5f0,0xf8));var _0x0a5f=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xa5f0[_0x1b6c6d];return _0x290d9d;};'use strict';var express=require('express');var router=express[_0x0a5f('0x0')]();var controller=require(_0x0a5f('0x1'));router[_0x0a5f('0x2')]('/',controller[_0x0a5f('0x3')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index c5b0b1f..bf52236 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 _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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x7a54,0x106));var _0x47a5=function(_0x5414f8,_0x10af39){_0x5414f8=_0x5414f8-0x0;var _0x5aca3b=_0x7a54[_0x5414f8];return _0x5aca3b;};'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
+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(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x7a54,0x106));var _0x47a5=function(_0x436c51,_0x3c3938){_0x436c51=_0x436c51-0x0;var _0x138c9e=_0x7a54[_0x436c51];return _0x138c9e;};'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 12a9a04..f2308cf 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 _0x6959=['express','passport','Router','../../components/auth/service','login','get','/callback','isMiddleware','setTokenCookie'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6959,0x117));var _0x9695=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6959[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x9695('0x0'));var passport=require(_0x9695('0x1'));var router=express[_0x9695('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x9695('0x3'));router['get']('/',controller[_0x9695('0x4')]);router[_0x9695('0x5')](_0x9695('0x6'),controller['callback'],authService[_0x9695('0x7')],userController[_0x9695('0x4')],authService[_0x9695('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0xaa4b=['../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0xaa4b,0x188));var _0xbaa4=function(_0x25680f,_0x1de103){_0x25680f=_0x25680f-0x0;var _0x3432b1=_0xaa4b[_0x25680f];return _0x3432b1;};'use strict';var express=require(_0xbaa4('0x0'));var passport=require('passport');var router=express[_0xbaa4('0x1')]();var controller=require(_0xbaa4('0x2'));var userController=require(_0xbaa4('0x3'));var authService=require(_0xbaa4('0x4'));router[_0xbaa4('0x5')]('/',controller[_0xbaa4('0x6')]);router[_0xbaa4('0x5')]('/callback',controller[_0xbaa4('0x7')],authService[_0xbaa4('0x8')],userController['login'],authService[_0xbaa4('0x9')]);module[_0xbaa4('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 2935261..db06431 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 _0x69cf=['xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','util','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','then','password','salt','disabled','blocked','blockedAt','loginAttempts','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','CloudProvider','\x22%s\x22\x20<%s>','email','user','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','local-login','json','online','forgot','generate','body','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save'];(function(_0x5cad57,_0x408cb1){var _0x2fe6d5=function(_0x2f10a1){while(--_0x2f10a1){_0x5cad57['push'](_0x5cad57['shift']());}};_0x2fe6d5(++_0x408cb1);}(_0x69cf,0xa6));var _0xf69c=function(_0x35ef7a,_0x2b3df3){_0x35ef7a=_0x35ef7a-0x0;var _0x3e1c56=_0x69cf[_0x35ef7a];return _0x3e1c56;};'use strict';var util=require(_0xf69c('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf69c('0x1'))['Strategy'];var jayson=require(_0xf69c('0x2'));var _=require(_0xf69c('0x3'));var rs=require(_0xf69c('0x4'));var moment=require(_0xf69c('0x5'));var db=require(_0xf69c('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xf69c('0x7'));var client=jayson[_0xf69c('0x8')][_0xf69c('0x9')]({'port':0x232b});function localAuthenticate(_0x298613,_0x4ad161,_0x1c4cd8,_0x5a0e96){var _0x31db93,_0x212cf2;return db[_0xf69c('0xa')][_0xf69c('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf69c('0xc')],'raw':!![]})[_0xf69c('0xd')](function(_0x35f2fd){_0x31db93=_0x35f2fd;return _0x298613[_0xf69c('0xb')]({'attributes':['id','name',_0xf69c('0xe'),_0xf69c('0xf'),'role',_0xf69c('0x10'),_0xf69c('0x11'),_0xf69c('0x12'),_0xf69c('0x13')],'where':{'name':_0x4ad161,'role':{'$or':['admin','user','agent']}}});})[_0xf69c('0xd')](function(_0x2caa7f){if(!_0x2caa7f||_0x2caa7f&&_0x2caa7f[_0xf69c('0x14')]!==_0x4ad161){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x212cf2=_0x2caa7f;return _0x212cf2;}})['then'](function(){_0x212cf2[_0xf69c('0x15')](_0x1c4cd8,function(_0x12832e,_0x32fc7c){var _0x24e469=_0x212cf2[_0xf69c('0x13')]+0x1;if(_0x12832e){return _0x5a0e96(_0x12832e);}else if(!_0x32fc7c){if(_0x212cf2[_0xf69c('0x10')]){return _0x5a0e96(null,![],{'message':_0xf69c('0x16')});}else if(_0x31db93[_0xf69c('0x17')]>0x0){if(_0x212cf2[_0xf69c('0x11')]){if(_0x31db93['blockDuration']>0x0){if(moment(_0x212cf2['blockedAt'])[_0xf69c('0x18')](_0x31db93[_0xf69c('0xc')],_0xf69c('0x19'))>moment()){return _0x5a0e96(null,![],{'message':_0xf69c('0x16')});}else{return utils[_0xf69c('0x1a')](_0x212cf2,_0x24e469,![],null)[_0xf69c('0xd')](function(){return _0x5a0e96(null,![],{'message':_0xf69c('0x16')});});}}else{return _0x5a0e96(null,![],{'message':_0xf69c('0x16')});}}else{if(_0x24e469>=_0x31db93[_0xf69c('0x17')]){return utils[_0xf69c('0x1a')](_0x212cf2,0x0,!![],moment())[_0xf69c('0xd')](function(){return _0x5a0e96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf69c('0x1a')](_0x212cf2,_0x24e469,![],null)[_0xf69c('0xd')](function(){return _0x5a0e96(null,![],{'message':_0xf69c('0x16')});});}}}else{return _0x5a0e96(null,![],{'message':_0xf69c('0x16')});}}else{if(_0x212cf2[_0xf69c('0x10')]){return _0x5a0e96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x31db93[_0xf69c('0x17')]>0x0){if(_0x212cf2['blocked']){if(_0x31db93[_0xf69c('0xc')]>0x0){if(moment(_0x212cf2[_0xf69c('0x12')])[_0xf69c('0x18')](_0x31db93[_0xf69c('0xc')],_0xf69c('0x19'))>moment()){return _0x5a0e96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf69c('0x1a')](_0x212cf2,0x0,![],null)[_0xf69c('0xd')](function(){return utils[_0xf69c('0x1b')](_0x212cf2);})[_0xf69c('0xd')](function(){return _0x5a0e96(null,_0x212cf2);});}}else{return _0x5a0e96(null,![],{'message':_0xf69c('0x16')});}}else{return utils[_0xf69c('0x1a')](_0x212cf2,0x0,![],null)[_0xf69c('0xd')](function(){return utils[_0xf69c('0x1b')](_0x212cf2);})[_0xf69c('0xd')](function(){return _0x5a0e96(null,_0x212cf2);})[_0xf69c('0x1c')](function(_0x3f0917){return _0x5a0e96(null,![],_0x3f0917);});}}else{if(_0x212cf2['blocked']){return _0x5a0e96(null,![],{'message':_0xf69c('0x16')});}else{return utils['getLicense'](_0x212cf2)['then'](function(){return _0x5a0e96(null,_0x212cf2);});}}}});})[_0xf69c('0x1c')](function(_0xc3b590){return _0x5a0e96(null,![],_0xc3b590);});}function sendServiceMail(_0x1abf87){return db['MailAccount'][_0xf69c('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xf69c('0x14'),'email'],'include':[{'model':db[_0xf69c('0x1e')],'as':_0xf69c('0x1f'),'include':[{'model':db[_0xf69c('0x20')],'as':_0xf69c('0x20')}]}]})[_0xf69c('0xd')](function(_0x3411f4){if(!_0x3411f4){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5bb43b=_0x3411f4['getSmtpOptions']();var _0x400cc4={'account':_0x5bb43b,'message':_['merge']({'from':util['format'](_0xf69c('0x21'),_0x3411f4[_0xf69c('0x14')],_0x3411f4[_0xf69c('0x22')]||_0x3411f4[_0xf69c('0x1f')][_0xf69c('0x23')])},_0x1abf87)};return client[_0xf69c('0x24')](_0xf69c('0x25'),_0x400cc4);})[_0xf69c('0xd')](function(_0x345f86){if(_0x345f86['error']){throw new Error(util[_0xf69c('0x26')](_0xf69c('0x27'),_0x345f86[_0xf69c('0x28')][_0xf69c('0x29')]||JSON[_0xf69c('0x2a')](_0x345f86[_0xf69c('0x28')])));}return!![];});}function handleError(_0x199745,_0x5d9955,_0x5543ad){return _0x199745[_0xf69c('0x2b')](_0x5d9955||0x1f4)[_0xf69c('0x2c')]({'message':_0x5543ad?_0x5543ad[_0xf69c('0x29')]||_0x5543ad:''});}exports['login']=function(_0x36be49,_0x394471,_0x204c23){passport[_0xf69c('0x15')](_0xf69c('0x2d'),function(_0xb553cc,_0x549604,_0x57a6cd){var _0x6c0c2d=_0xb553cc||_0x57a6cd;if(_0x6c0c2d){return handleError(_0x394471,0x191,_0x6c0c2d);}if(!_0x549604){return handleError(_0x394471,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x55cfc6={'payload':{'id':_0x549604['id'],'role':_0x549604['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x55cfc6)['then'](function(_0xbe7ae3){_0x394471[_0xf69c('0x2e')]({'id':_0x549604['id'],'token':_0xbe7ae3,'statusCall':'','isAlreadyLogged':_0x549604[_0xf69c('0x2f')]});});}})(_0x36be49,_0x394471,_0x204c23);};exports[_0xf69c('0x30')]=function(_0x5a3ff4,_0x3e6b4c){if(!_0x5a3ff4['body']['email']){return handleError(_0x3e6b4c,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x4e5318=rs[_0xf69c('0x31')]();_0x5a3ff4['body'][_0xf69c('0x22')]=_0x5a3ff4[_0xf69c('0x32')][_0xf69c('0x22')]['trim']()[_0xf69c('0x33')]();var _0x307861;return db[_0xf69c('0xa')][_0xf69c('0xb')]({'where':{'id':0x1},'attributes':[_0xf69c('0x17'),_0xf69c('0xc')],'raw':!![]})[_0xf69c('0xd')](function(_0x494f5a){_0x307861=_0x494f5a;return db[_0xf69c('0x34')][_0xf69c('0x1d')]({'where':{'email':_0x5a3ff4['body'][_0xf69c('0x22')]}});})[_0xf69c('0xd')](function(_0x22da9b){if(!_0x22da9b){throw new Error(_0xf69c('0x35'));}if(_0x22da9b[_0xf69c('0x10')]){throw new Error(_0xf69c('0x36'));}if(_0x22da9b['blocked']){if(moment(_0x22da9b[_0xf69c('0x12')])['add'](_0x307861[_0xf69c('0xc')],_0xf69c('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x22da9b[_0xf69c('0x11')]=![];_0x22da9b[_0xf69c('0x12')]=null;}}_0x22da9b[_0xf69c('0x37')]=_0x4e5318;_0x22da9b[_0xf69c('0x38')]=Date[_0xf69c('0x39')]()+0x36ee80;return _0x22da9b[_0xf69c('0x3a')]();})['then'](function(){return sendServiceMail({'to':_0x5a3ff4[_0xf69c('0x32')][_0xf69c('0x22')],'subject':_0xf69c('0x3b'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf69c('0x3c')+_0xf69c('0x3d')+_0x5a3ff4[_0xf69c('0x3e')][_0xf69c('0x3f')]+_0xf69c('0x40')+_0x4e5318+'\x0a\x0a'+_0xf69c('0x41')});})[_0xf69c('0xd')](function(){_0x3e6b4c[_0xf69c('0x2b')](0xc8)[_0xf69c('0x2c')]({'message':_0xf69c('0x42')});})['catch'](function(_0x2a19a8){return handleError(_0x3e6b4c,0x1f4,_0x2a19a8);});};exports[_0xf69c('0x43')]=function(_0x376dba,_0x43fac1){return db[_0xf69c('0x34')]['find']({'where':{'resetPasswordToken':_0x376dba['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xf69c('0xd')](function(_0x656ecc){if(!_0x656ecc){throw new Error(_0xf69c('0x44'));}return db[_0xf69c('0xa')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x1217d9){if(_0x1217d9[_0xf69c('0x45')])authService[_0xf69c('0x46')](_0x376dba[_0xf69c('0x32')][_0xf69c('0xe')]);if(!_0x1217d9[_0xf69c('0x47')]||!_0x656ecc['previousPasswords'])return _0x656ecc;authService[_0xf69c('0x48')](_0x376dba['body'][_0xf69c('0xe')],_0x656ecc['previousPasswords'],_0x1217d9[_0xf69c('0x49')]);return _0x656ecc;})[_0xf69c('0xd')](function(){_0x656ecc['password']=_0x376dba[_0xf69c('0x32')][_0xf69c('0xe')];_0x656ecc['resetPasswordToken']=null;_0x656ecc['resetPasswordExpires']=null;return _0x656ecc[_0xf69c('0x3a')]();});})['then'](function(){_0x43fac1[_0xf69c('0x2b')](0xc8)[_0xf69c('0x2c')]({'message':_0xf69c('0x4a')});})[_0xf69c('0x1c')](function(_0x23d93e){return handleError(_0x43fac1,0x1f4,_0x23d93e);});};passport['use'](_0xf69c('0x2d'),new LocalStrategy({'usernameField':_0xf69c('0x14'),'passwordField':'password'},function(_0x2c4e08,_0x4ee086,_0x39251b){return localAuthenticate(db[_0xf69c('0x34')],_0x2c4e08,_0x4ee086,_0x39251b);}));
\ No newline at end of file
+var _0xcfc8=['reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','User','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add','clearBlockUser','minutes','catch','getLicense','MailAccount','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','trim','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','body','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'];(function(_0x1e0b1b,_0x339fb7){var _0x332481=function(_0x84430f){while(--_0x84430f){_0x1e0b1b['push'](_0x1e0b1b['shift']());}};_0x332481(++_0x339fb7);}(_0xcfc8,0x1b2));var _0x8cfc=function(_0x369496,_0x32faa7){_0x369496=_0x369496-0x0;var _0x33bda5=_0xcfc8[_0x369496];return _0x33bda5;};'use strict';var util=require(_0x8cfc('0x0'));var passport=require(_0x8cfc('0x1'));var LocalStrategy=require(_0x8cfc('0x2'))[_0x8cfc('0x3')];var jayson=require(_0x8cfc('0x4'));var _=require('lodash');var rs=require(_0x8cfc('0x5'));var moment=require(_0x8cfc('0x6'));var db=require(_0x8cfc('0x7'))['db'];var authService=require(_0x8cfc('0x8'));var utils=require(_0x8cfc('0x9'));var client=jayson[_0x8cfc('0xa')][_0x8cfc('0xb')]({'port':0x232b});function localAuthenticate(_0xd3ae63,_0x1096e2,_0x70b508,_0x96fb9c){var _0x276bfa,_0x2f7ffa;return db['Setting'][_0x8cfc('0xc')]({'where':{'id':0x1},'attributes':[_0x8cfc('0xd'),'blockDuration'],'raw':!![]})[_0x8cfc('0xe')](function(_0x533668){_0x276bfa=_0x533668;return _0xd3ae63[_0x8cfc('0xc')]({'attributes':['id',_0x8cfc('0xf'),_0x8cfc('0x10'),_0x8cfc('0x11'),_0x8cfc('0x12'),_0x8cfc('0x13'),_0x8cfc('0x14'),'blockedAt',_0x8cfc('0x15')],'where':{'name':_0x1096e2,'role':{'$or':[_0x8cfc('0x16'),_0x8cfc('0x17'),_0x8cfc('0x18')]}}});})[_0x8cfc('0xe')](function(_0x13a462){if(!_0x13a462||_0x13a462&&_0x13a462['name']!==_0x1096e2){throw new Error(_0x8cfc('0x19'));}else{_0x2f7ffa=_0x13a462;return _0x2f7ffa;}})['then'](function(){_0x2f7ffa[_0x8cfc('0x1a')](_0x70b508,function(_0x499cde,_0x4227ae){var _0x32bf40=_0x2f7ffa[_0x8cfc('0x15')]+0x1;if(_0x499cde){return _0x96fb9c(_0x499cde);}else if(!_0x4227ae){if(_0x2f7ffa[_0x8cfc('0x13')]){return _0x96fb9c(null,![],{'message':_0x8cfc('0x19')});}else if(_0x276bfa[_0x8cfc('0xd')]>0x0){if(_0x2f7ffa[_0x8cfc('0x14')]){if(_0x276bfa[_0x8cfc('0x1b')]>0x0){if(moment(_0x2f7ffa[_0x8cfc('0x1c')])[_0x8cfc('0x1d')](_0x276bfa[_0x8cfc('0x1b')],'minutes')>moment()){return _0x96fb9c(null,![],{'message':_0x8cfc('0x19')});}else{return utils[_0x8cfc('0x1e')](_0x2f7ffa,_0x32bf40,![],null)[_0x8cfc('0xe')](function(){return _0x96fb9c(null,![],{'message':_0x8cfc('0x19')});});}}else{return _0x96fb9c(null,![],{'message':_0x8cfc('0x19')});}}else{if(_0x32bf40>=_0x276bfa['allowedLoginAttempts']){return utils[_0x8cfc('0x1e')](_0x2f7ffa,0x0,!![],moment())[_0x8cfc('0xe')](function(){return _0x96fb9c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x8cfc('0x1e')](_0x2f7ffa,_0x32bf40,![],null)[_0x8cfc('0xe')](function(){return _0x96fb9c(null,![],{'message':_0x8cfc('0x19')});});}}}else{return _0x96fb9c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2f7ffa[_0x8cfc('0x13')]){return _0x96fb9c(null,![],{'message':_0x8cfc('0x19')});}else if(_0x276bfa[_0x8cfc('0xd')]>0x0){if(_0x2f7ffa[_0x8cfc('0x14')]){if(_0x276bfa[_0x8cfc('0x1b')]>0x0){if(moment(_0x2f7ffa['blockedAt'])[_0x8cfc('0x1d')](_0x276bfa[_0x8cfc('0x1b')],_0x8cfc('0x1f'))>moment()){return _0x96fb9c(null,![],{'message':_0x8cfc('0x19')});}else{return utils[_0x8cfc('0x1e')](_0x2f7ffa,0x0,![],null)['then'](function(){return utils['getLicense'](_0x2f7ffa);})[_0x8cfc('0xe')](function(){return _0x96fb9c(null,_0x2f7ffa);});}}else{return _0x96fb9c(null,![],{'message':_0x8cfc('0x19')});}}else{return utils[_0x8cfc('0x1e')](_0x2f7ffa,0x0,![],null)[_0x8cfc('0xe')](function(){return utils['getLicense'](_0x2f7ffa);})[_0x8cfc('0xe')](function(){return _0x96fb9c(null,_0x2f7ffa);})[_0x8cfc('0x20')](function(_0x32d6c9){return _0x96fb9c(null,![],_0x32d6c9);});}}else{if(_0x2f7ffa[_0x8cfc('0x14')]){return _0x96fb9c(null,![],{'message':_0x8cfc('0x19')});}else{return utils[_0x8cfc('0x21')](_0x2f7ffa)['then'](function(){return _0x96fb9c(null,_0x2f7ffa);});}}}});})['catch'](function(_0x547e98){return _0x96fb9c(null,![],_0x547e98);});}function sendServiceMail(_0x5a2eeb){return db[_0x8cfc('0x22')]['find']({'where':{'service':!![]},'attributes':['id',_0x8cfc('0xf'),_0x8cfc('0x23')],'include':[{'model':db[_0x8cfc('0x24')],'as':_0x8cfc('0x25'),'include':[{'model':db[_0x8cfc('0x26')],'as':_0x8cfc('0x26')}]}]})[_0x8cfc('0xe')](function(_0x1d97e6){if(!_0x1d97e6){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1a7dfc=_0x1d97e6[_0x8cfc('0x27')]();var _0x276bb6={'account':_0x1a7dfc,'message':_[_0x8cfc('0x28')]({'from':util[_0x8cfc('0x29')]('\x22%s\x22\x20<%s>',_0x1d97e6[_0x8cfc('0xf')],_0x1d97e6['email']||_0x1d97e6['Smtp'][_0x8cfc('0x17')])},_0x5a2eeb)};return client['request'](_0x8cfc('0x2a'),_0x276bb6);})[_0x8cfc('0xe')](function(_0x26e451){if(_0x26e451[_0x8cfc('0x2b')]){throw new Error(util[_0x8cfc('0x29')](_0x8cfc('0x2c'),_0x26e451['error'][_0x8cfc('0x2d')]||JSON['stringify'](_0x26e451[_0x8cfc('0x2b')])));}return!![];});}function handleError(_0x5a28a3,_0x35a45b,_0x361d2f){return _0x5a28a3[_0x8cfc('0x2e')](_0x35a45b||0x1f4)[_0x8cfc('0x2f')]({'message':_0x361d2f?_0x361d2f[_0x8cfc('0x2d')]||_0x361d2f:''});}exports[_0x8cfc('0x30')]=function(_0x42d781,_0x478d90,_0x3f6a2e){passport[_0x8cfc('0x1a')](_0x8cfc('0x31'),function(_0x29be9f,_0x255765,_0x34dcd0){var _0x503372=_0x29be9f||_0x34dcd0;if(_0x503372){return handleError(_0x478d90,0x191,_0x503372);}if(!_0x255765){return handleError(_0x478d90,0x194,{'message':_0x8cfc('0x32')});}else{var _0x551a30={'payload':{'id':_0x255765['id'],'role':_0x255765[_0x8cfc('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x8cfc('0x33')](_0x551a30)['then'](function(_0x35b66a){_0x478d90['json']({'id':_0x255765['id'],'token':_0x35b66a,'statusCall':'','isAlreadyLogged':_0x255765[_0x8cfc('0x34')]});});}})(_0x42d781,_0x478d90,_0x3f6a2e);};exports[_0x8cfc('0x35')]=function(_0x364745,_0x5e81fe){if(!_0x364745['body'][_0x8cfc('0x23')]){return handleError(_0x5e81fe,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5e12d1=rs['generate']();_0x364745['body'][_0x8cfc('0x23')]=_0x364745['body']['email'][_0x8cfc('0x36')]()[_0x8cfc('0x37')]();var _0x306f01;return db['Setting'][_0x8cfc('0xc')]({'where':{'id':0x1},'attributes':[_0x8cfc('0xd'),'blockDuration'],'raw':!![]})[_0x8cfc('0xe')](function(_0x1f167b){_0x306f01=_0x1f167b;return db['User'][_0x8cfc('0x38')]({'where':{'email':_0x364745['body'][_0x8cfc('0x23')]}});})['then'](function(_0x584c4f){if(!_0x584c4f){throw new Error(_0x8cfc('0x39'));}if(_0x584c4f['disabled']){throw new Error(_0x8cfc('0x3a'));}if(_0x584c4f[_0x8cfc('0x14')]){if(moment(_0x584c4f[_0x8cfc('0x1c')])[_0x8cfc('0x1d')](_0x306f01[_0x8cfc('0x1b')],_0x8cfc('0x1f'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x584c4f[_0x8cfc('0x14')]=![];_0x584c4f[_0x8cfc('0x1c')]=null;}}_0x584c4f[_0x8cfc('0x3b')]=_0x5e12d1;_0x584c4f[_0x8cfc('0x3c')]=Date[_0x8cfc('0x3d')]()+0x36ee80;return _0x584c4f[_0x8cfc('0x3e')]();})[_0x8cfc('0xe')](function(){return sendServiceMail({'to':_0x364745[_0x8cfc('0x3f')][_0x8cfc('0x23')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x8cfc('0x40')+_0x8cfc('0x41')+_0x364745[_0x8cfc('0x42')][_0x8cfc('0x43')]+_0x8cfc('0x44')+_0x5e12d1+'\x0a\x0a'+_0x8cfc('0x45')});})[_0x8cfc('0xe')](function(){_0x5e81fe['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x8cfc('0x20')](function(_0x3732eb){return handleError(_0x5e81fe,0x1f4,_0x3732eb);});};exports[_0x8cfc('0x46')]=function(_0x3c7fec,_0x17135d){return db['User'][_0x8cfc('0x38')]({'where':{'resetPasswordToken':_0x3c7fec[_0x8cfc('0x47')][_0x8cfc('0x48')],'resetPasswordExpires':{'$gt':Date[_0x8cfc('0x3d')]()}}})[_0x8cfc('0xe')](function(_0x5cec05){if(!_0x5cec05){throw new Error(_0x8cfc('0x49'));}return db[_0x8cfc('0x4a')][_0x8cfc('0xc')]({'attributes':['id',_0x8cfc('0x4b'),'enforcePasswordHistory',_0x8cfc('0x4c')]})[_0x8cfc('0xe')](function(_0x43d5f3){if(_0x43d5f3[_0x8cfc('0x4b')])authService[_0x8cfc('0x4d')](_0x3c7fec[_0x8cfc('0x3f')]['password']);if(!_0x43d5f3[_0x8cfc('0x4e')]||!_0x5cec05[_0x8cfc('0x4f')])return _0x5cec05;authService[_0x8cfc('0x50')](_0x3c7fec[_0x8cfc('0x3f')]['password'],_0x5cec05[_0x8cfc('0x4f')],_0x43d5f3['passwordHistoryLimit']);return _0x5cec05;})[_0x8cfc('0xe')](function(){_0x5cec05['password']=_0x3c7fec[_0x8cfc('0x3f')][_0x8cfc('0x10')];_0x5cec05[_0x8cfc('0x3b')]=null;_0x5cec05[_0x8cfc('0x3c')]=null;return _0x5cec05['save']();});})[_0x8cfc('0xe')](function(){_0x17135d['status'](0xc8)['send']({'message':_0x8cfc('0x51')});})[_0x8cfc('0x20')](function(_0x3c4392){return handleError(_0x17135d,0x1f4,_0x3c4392);});};passport[_0x8cfc('0x52')](_0x8cfc('0x31'),new LocalStrategy({'usernameField':_0x8cfc('0xf'),'passwordField':_0x8cfc('0x10')},function(_0x2e58b9,_0x9bb427,_0x2ea60f){return localAuthenticate(db[_0x8cfc('0x53')],_0x2e58b9,_0x9bb427,_0x2ea60f);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 5b72015..6d904dd 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 _0x5b68=['Router','./authLocal.controller','post','login','forgot','reset','exports','express'];(function(_0x5ce850,_0x28bfe5){var _0x12753a=function(_0x5eacdb){while(--_0x5eacdb){_0x5ce850['push'](_0x5ce850['shift']());}};_0x12753a(++_0x28bfe5);}(_0x5b68,0x15f));var _0x85b6=function(_0x4b34c4,_0xc61ba4){_0x4b34c4=_0x4b34c4-0x0;var _0x418e46=_0x5b68[_0x4b34c4];return _0x418e46;};'use strict';var express=require(_0x85b6('0x0'));var router=express[_0x85b6('0x1')]();var controller=require(_0x85b6('0x2'));router[_0x85b6('0x3')]('/',controller[_0x85b6('0x4')]);router['post']('/forgot',controller[_0x85b6('0x5')]);router[_0x85b6('0x3')]('/reset/:token',controller[_0x85b6('0x6')]);module[_0x85b6('0x7')]=router;
\ No newline at end of file
+var _0xd6fb=['express','post','/reset/:token','exports'];(function(_0x22b5ff,_0x27c560){var _0x16401d=function(_0x46978f){while(--_0x46978f){_0x22b5ff['push'](_0x22b5ff['shift']());}};_0x16401d(++_0x27c560);}(_0xd6fb,0x1bc));var _0xbd6f=function(_0x45fc19,_0x354723){_0x45fc19=_0x45fc19-0x0;var _0x4e8510=_0xd6fb[_0x45fc19];return _0x4e8510;};'use strict';var express=require(_0xbd6f('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xbd6f('0x1')]('/',controller['login']);router[_0xbd6f('0x1')]('/forgot',controller['forgot']);router[_0xbd6f('0x1')](_0xbd6f('0x2'),controller['reset']);module[_0xbd6f('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 61c00a4..be6098a 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 _0xef06=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xef06,0x1a0));var _0x6ef0=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0xef06[_0x5f519b];return _0x2461e2;};'use strict';var Sequelize=require(_0x6ef0('0x0'));module[_0x6ef0('0x1')]={'name':{'type':Sequelize[_0x6ef0('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6ef0('0x2')]},'status':{'type':Sequelize[_0x6ef0('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6ef0('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x7a6c=['STRING','INTEGER','sequelize'];(function(_0x2d5730,_0x5bcd05){var _0x51d28d=function(_0xe36442){while(--_0xe36442){_0x2d5730['push'](_0x2d5730['shift']());}};_0x51d28d(++_0x5bcd05);}(_0x7a6c,0xd7));var _0xc7a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a6c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc7a6('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7a6('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xc7a6('0x1')]},'description':{'type':Sequelize[_0xc7a6('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc7a6('0x2')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 24974eb..4bbc1d8 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 _0x744f=['findAll','rows','catch','show','params','find','create','body','addConditions','Condition','omit','ids','getConditions','order','nolimit','addActions','getActions','findOne','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','where','merge','map','filter','options','Automation','include'];(function(_0x2dc79e,_0xcde3dd){var _0x1679a0=function(_0x1363c8){while(--_0x1363c8){_0x2dc79e['push'](_0x2dc79e['shift']());}};_0x1679a0(++_0xcde3dd);}(_0x744f,0x1e7));var _0xf744=function(_0x192937,_0x445940){_0x192937=_0x192937-0x0;var _0x289d0d=_0x744f[_0x192937];return _0x289d0d;};'use strict';var emlformat=require(_0xf744('0x0'));var rimraf=require(_0xf744('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf744('0x2'));var rp=require(_0xf744('0x3'));var moment=require(_0xf744('0x4'));var BPromise=require(_0xf744('0x5'));var Mustache=require('mustache');var util=require(_0xf744('0x6'));var path=require(_0xf744('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf744('0x8'));var _=require(_0xf744('0x9'));var squel=require(_0xf744('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf744('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf744('0xc'));var Redis=require(_0xf744('0xd'));var authService=require(_0xf744('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf744('0xf'));var hardwareService=require(_0xf744('0x10'));var logger=require(_0xf744('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf744('0x12'));var db=require(_0xf744('0x13'))['db'];function respondWithStatusCode(_0x3dc899,_0x33877c){_0x33877c=_0x33877c||0xcc;return function(_0x1913c4){if(_0x1913c4){return _0x3dc899['sendStatus'](_0x33877c);}return _0x3dc899[_0xf744('0x14')](_0x33877c)[_0xf744('0x15')]();};}function respondWithResult(_0x1b5e1c,_0x546cd8){_0x546cd8=_0x546cd8||0xc8;return function(_0x1dadce){if(_0x1dadce){return _0x1b5e1c[_0xf744('0x14')](_0x546cd8)[_0xf744('0x16')](_0x1dadce);}};}function respondWithFilteredResult(_0xf00208,_0x3c3b47){return function(_0x4a0c38){if(_0x4a0c38){var _0x2bd560=typeof _0x3c3b47[_0xf744('0x17')]==='undefined'&&typeof _0x3c3b47[_0xf744('0x18')]==='undefined';var _0x202f88=_0x4a0c38[_0xf744('0x19')];var _0x3ab722=_0x2bd560?0x0:_0x3c3b47[_0xf744('0x17')];var _0x55914=_0x2bd560?_0x4a0c38[_0xf744('0x19')]:_0x3c3b47[_0xf744('0x17')]+_0x3c3b47['limit'];var _0x244ab8;if(_0x55914>=_0x202f88){_0x55914=_0x202f88;_0x244ab8=0xc8;}else{_0x244ab8=0xce;}_0xf00208[_0xf744('0x14')](_0x244ab8);return _0xf00208[_0xf744('0x1a')](_0xf744('0x1b'),_0x3ab722+'-'+_0x55914+'/'+_0x202f88)['json'](_0x4a0c38);}return null;};}function patchUpdates(_0x35c7f1){return function(_0x14a07b){try{jsonpatch[_0xf744('0x1c')](_0x14a07b,_0x35c7f1,!![]);}catch(_0x249ef9){return BPromise[_0xf744('0x1d')](_0x249ef9);}return _0x14a07b[_0xf744('0x1e')]();};}function saveUpdates(_0x40b907,_0x46b888){return function(_0x4bdce8){if(_0x4bdce8){return _0x4bdce8[_0xf744('0x1f')](_0x40b907)[_0xf744('0x20')](function(_0x1bc6db){return _0x1bc6db;});}return null;};}function removeEntity(_0x4e560b,_0x145e7b){return function(_0x4e195a){if(_0x4e195a){return _0x4e195a[_0xf744('0x21')]()[_0xf744('0x20')](function(){_0x4e560b['status'](0xcc)[_0xf744('0x15')]();});}};}function handleEntityNotFound(_0x4e8c04,_0x3d84f6){return function(_0x42c192){if(!_0x42c192){_0x4e8c04['sendStatus'](0x194);}return _0x42c192;};}function handleError(_0x5127a1,_0x4f32b7){_0x4f32b7=_0x4f32b7||0x1f4;return function(_0x2bf37d){logger['error'](_0x2bf37d[_0xf744('0x22')]);if(_0x2bf37d[_0xf744('0x23')]){delete _0x2bf37d[_0xf744('0x23')];}_0x5127a1['status'](_0x4f32b7)['send'](_0x2bf37d);};}exports[_0xf744('0x24')]=function(_0x2f76c6,_0x3da644){var _0x32c01a={},_0x480479={},_0x46ddb0={'count':0x0,'rows':[]};var _0xd63676=_['map'](db['Automation'][_0xf744('0x25')],function(_0x5bbbbf){return{'name':_0x5bbbbf[_0xf744('0x26')],'type':_0x5bbbbf[_0xf744('0x27')][_0xf744('0x28')]};});_0x480479[_0xf744('0x29')]=_['map'](_0xd63676,_0xf744('0x23'));_0x480479['query']=_[_0xf744('0x2a')](_0x2f76c6[_0xf744('0x2b')]);_0x480479[_0xf744('0x2c')]=_['intersection'](_0x480479['model'],_0x480479[_0xf744('0x2b')]);_0x32c01a[_0xf744('0x2d')]=_[_0xf744('0x2e')](_0x480479[_0xf744('0x29')],qs[_0xf744('0x2f')](_0x2f76c6[_0xf744('0x2b')][_0xf744('0x2f')]));_0x32c01a[_0xf744('0x2d')]=_0x32c01a[_0xf744('0x2d')][_0xf744('0x30')]?_0x32c01a[_0xf744('0x2d')]:_0x480479['model'];if(!_0x2f76c6[_0xf744('0x2b')][_0xf744('0x31')]('nolimit')){_0x32c01a['limit']=qs[_0xf744('0x18')](_0x2f76c6[_0xf744('0x2b')]['limit']);_0x32c01a[_0xf744('0x17')]=qs[_0xf744('0x17')](_0x2f76c6[_0xf744('0x2b')][_0xf744('0x17')]);}_0x32c01a['order']=qs[_0xf744('0x32')](_0x2f76c6['query']['sort']);_0x32c01a['where']=qs[_0xf744('0x2c')](_[_0xf744('0x33')](_0x2f76c6[_0xf744('0x2b')],_0x480479['filters']),_0xd63676);if(_0x2f76c6[_0xf744('0x2b')]['filter']){_0x32c01a[_0xf744('0x34')]=_[_0xf744('0x35')](_0x32c01a[_0xf744('0x34')],{'$or':_[_0xf744('0x36')](_0xd63676,function(_0x189f15){if(_0x189f15[_0xf744('0x27')]!=='VIRTUAL'){var _0x407d73={};_0x407d73[_0x189f15[_0xf744('0x23')]]={'$like':'%'+_0x2f76c6['query'][_0xf744('0x37')]+'%'};return _0x407d73;}})});}_0x32c01a=_['merge']({},_0x32c01a,_0x2f76c6[_0xf744('0x38')]);var _0x46f277={'where':_0x32c01a[_0xf744('0x34')]};return db[_0xf744('0x39')][_0xf744('0x19')](_0x46f277)[_0xf744('0x20')](function(_0x841c0e){_0x46ddb0[_0xf744('0x19')]=_0x841c0e;if(_0x2f76c6[_0xf744('0x2b')]['includeAll']){_0x32c01a[_0xf744('0x3a')]=[{'all':!![]}];}return db['Automation'][_0xf744('0x3b')](_0x32c01a);})[_0xf744('0x20')](function(_0x7692f2){_0x46ddb0[_0xf744('0x3c')]=_0x7692f2;return _0x46ddb0;})[_0xf744('0x20')](respondWithFilteredResult(_0x3da644,_0x32c01a))[_0xf744('0x3d')](handleError(_0x3da644,null));};exports[_0xf744('0x3e')]=function(_0x219ddf,_0x123d35){var _0xa89e27={'raw':![],'where':{'id':_0x219ddf[_0xf744('0x3f')]['id']}},_0x2d076d={};_0x2d076d[_0xf744('0x29')]=_[_0xf744('0x2a')](db[_0xf744('0x39')][_0xf744('0x25')]);_0x2d076d[_0xf744('0x2b')]=_['keys'](_0x219ddf[_0xf744('0x2b')]);_0x2d076d[_0xf744('0x2c')]=_[_0xf744('0x2e')](_0x2d076d[_0xf744('0x29')],_0x2d076d[_0xf744('0x2b')]);_0xa89e27['attributes']=_[_0xf744('0x2e')](_0x2d076d['model'],qs[_0xf744('0x2f')](_0x219ddf[_0xf744('0x2b')]['fields']));_0xa89e27[_0xf744('0x2d')]=_0xa89e27[_0xf744('0x2d')][_0xf744('0x30')]?_0xa89e27['attributes']:_0x2d076d[_0xf744('0x29')];if(_0x219ddf[_0xf744('0x2b')]['includeAll']){_0xa89e27[_0xf744('0x3a')]=[{'all':!![]}];}_0xa89e27=_[_0xf744('0x35')]({},_0xa89e27,_0x219ddf[_0xf744('0x38')]);return db[_0xf744('0x39')][_0xf744('0x40')](_0xa89e27)[_0xf744('0x20')](handleEntityNotFound(_0x123d35,null))[_0xf744('0x20')](respondWithResult(_0x123d35,null))[_0xf744('0x3d')](handleError(_0x123d35,null));};exports['create']=function(_0x44ecd7,_0x243b5b){return db[_0xf744('0x39')][_0xf744('0x41')](_0x44ecd7[_0xf744('0x42')],{})[_0xf744('0x20')](respondWithResult(_0x243b5b,0xc9))[_0xf744('0x3d')](handleError(_0x243b5b,null));};exports[_0xf744('0x1f')]=function(_0x47f1df,_0xb263ef){if(_0x47f1df[_0xf744('0x42')]['id']){delete _0x47f1df['body']['id'];}return db[_0xf744('0x39')]['find']({'where':{'id':_0x47f1df[_0xf744('0x3f')]['id']}})[_0xf744('0x20')](handleEntityNotFound(_0xb263ef,null))['then'](saveUpdates(_0x47f1df['body'],null))[_0xf744('0x20')](respondWithResult(_0xb263ef,null))[_0xf744('0x3d')](handleError(_0xb263ef,null));};exports[_0xf744('0x21')]=function(_0x5198f1,_0x4da51c){return db[_0xf744('0x39')][_0xf744('0x40')]({'where':{'id':_0x5198f1[_0xf744('0x3f')]['id']}})[_0xf744('0x20')](handleEntityNotFound(_0x4da51c,null))[_0xf744('0x20')](removeEntity(_0x4da51c,null))[_0xf744('0x3d')](handleError(_0x4da51c,null));};exports[_0xf744('0x43')]=function(_0x225161,_0x37f881,_0xec9ece){return db[_0xf744('0x44')]['find']({'where':{'id':_0x225161[_0xf744('0x3f')]['id']}})[_0xf744('0x20')](handleEntityNotFound(_0x37f881,null))[_0xf744('0x20')](function(_0x524bcd){if(_0x524bcd){return _0x524bcd[_0xf744('0x43')](_0x225161[_0xf744('0x42')]['ids'],_[_0xf744('0x45')](_0x225161[_0xf744('0x42')],[_0xf744('0x46'),'id'])||{});}})['then'](respondWithResult(_0x37f881,null))[_0xf744('0x3d')](handleError(_0x37f881,null));};exports[_0xf744('0x47')]=function(_0x2e1bf7,_0x4d3721,_0x4a1bab){var _0x5a15c6={};var _0x403467={};var _0x5aae4d;var _0x2bcf2c;return db[_0xf744('0x39')]['findOne']({'where':{'id':_0x2e1bf7[_0xf744('0x3f')]['id']}})[_0xf744('0x20')](handleEntityNotFound(_0x4d3721,null))[_0xf744('0x20')](function(_0x18d59f){if(_0x18d59f){_0x5aae4d=_0x18d59f;_0x403467[_0xf744('0x29')]=_['keys'](db[_0xf744('0x44')][_0xf744('0x25')]);_0x403467['query']=_[_0xf744('0x2a')](_0x2e1bf7[_0xf744('0x2b')]);_0x403467[_0xf744('0x2c')]=_[_0xf744('0x2e')](_0x403467[_0xf744('0x29')],_0x403467[_0xf744('0x2b')]);_0x5a15c6[_0xf744('0x2d')]=_['intersection'](_0x403467[_0xf744('0x29')],qs['fields'](_0x2e1bf7[_0xf744('0x2b')]['fields']));_0x5a15c6[_0xf744('0x2d')]=_0x5a15c6[_0xf744('0x2d')][_0xf744('0x30')]?_0x5a15c6[_0xf744('0x2d')]:_0x403467[_0xf744('0x29')];_0x5a15c6[_0xf744('0x48')]=qs[_0xf744('0x32')](_0x2e1bf7['query'][_0xf744('0x32')]);_0x5a15c6[_0xf744('0x34')]=qs[_0xf744('0x2c')](_[_0xf744('0x33')](_0x2e1bf7[_0xf744('0x2b')],_0x403467[_0xf744('0x2c')]));if(_0x2e1bf7['query']['filter']){_0x5a15c6[_0xf744('0x34')]=_[_0xf744('0x35')](_0x5a15c6[_0xf744('0x34')],{'$or':_[_0xf744('0x36')](_0x5a15c6[_0xf744('0x2d')],function(_0x529815){var _0x1cb35c={};_0x1cb35c[_0x529815]={'$like':'%'+_0x2e1bf7[_0xf744('0x2b')][_0xf744('0x37')]+'%'};return _0x1cb35c;})});}_0x5a15c6=_[_0xf744('0x35')]({},_0x5a15c6,_0x2e1bf7[_0xf744('0x38')]);return _0x5aae4d[_0xf744('0x47')](_0x5a15c6);}})[_0xf744('0x20')](function(_0x55aebe){if(_0x55aebe){_0x2bcf2c=_0x55aebe[_0xf744('0x30')];if(!_0x2e1bf7[_0xf744('0x2b')][_0xf744('0x31')](_0xf744('0x49'))){_0x5a15c6[_0xf744('0x18')]=qs['limit'](_0x2e1bf7[_0xf744('0x2b')][_0xf744('0x18')]);_0x5a15c6[_0xf744('0x17')]=qs[_0xf744('0x17')](_0x2e1bf7[_0xf744('0x2b')]['offset']);}return _0x5aae4d[_0xf744('0x47')](_0x5a15c6);}})[_0xf744('0x20')](function(_0x26b6da){if(_0x26b6da){return _0x26b6da?{'count':_0x2bcf2c,'rows':_0x26b6da}:null;}})['then'](respondWithResult(_0x4d3721,null))[_0xf744('0x3d')](handleError(_0x4d3721,null));};exports[_0xf744('0x4a')]=function(_0x369af0,_0x401cb2,_0x4a4e0b){return db['Action'][_0xf744('0x40')]({'where':{'id':_0x369af0[_0xf744('0x3f')]['id']}})['then'](handleEntityNotFound(_0x401cb2,null))['then'](function(_0x2e3e16){if(_0x2e3e16){return _0x2e3e16[_0xf744('0x4a')](_0x369af0[_0xf744('0x42')][_0xf744('0x46')],_[_0xf744('0x45')](_0x369af0[_0xf744('0x42')],['ids','id'])||{});}})[_0xf744('0x20')](respondWithResult(_0x401cb2,null))[_0xf744('0x3d')](handleError(_0x401cb2,null));};exports[_0xf744('0x4b')]=function(_0x58bc2d,_0x3bc2a0,_0x25a338){var _0x456079={};var _0x58a2db={};var _0x43369d;var _0xba7f3e;return db[_0xf744('0x39')][_0xf744('0x4c')]({'where':{'id':_0x58bc2d['params']['id']}})[_0xf744('0x20')](handleEntityNotFound(_0x3bc2a0,null))[_0xf744('0x20')](function(_0x508447){if(_0x508447){_0x43369d=_0x508447;_0x58a2db['model']=_[_0xf744('0x2a')](db[_0xf744('0x4d')]['rawAttributes']);_0x58a2db[_0xf744('0x2b')]=_['keys'](_0x58bc2d[_0xf744('0x2b')]);_0x58a2db[_0xf744('0x2c')]=_[_0xf744('0x2e')](_0x58a2db[_0xf744('0x29')],_0x58a2db[_0xf744('0x2b')]);_0x456079[_0xf744('0x2d')]=_[_0xf744('0x2e')](_0x58a2db[_0xf744('0x29')],qs[_0xf744('0x2f')](_0x58bc2d['query'][_0xf744('0x2f')]));_0x456079['attributes']=_0x456079[_0xf744('0x2d')][_0xf744('0x30')]?_0x456079[_0xf744('0x2d')]:_0x58a2db[_0xf744('0x29')];_0x456079[_0xf744('0x48')]=qs[_0xf744('0x32')](_0x58bc2d[_0xf744('0x2b')][_0xf744('0x32')]);_0x456079[_0xf744('0x34')]=qs['filters'](_['pick'](_0x58bc2d['query'],_0x58a2db[_0xf744('0x2c')]));if(_0x58bc2d['query'][_0xf744('0x37')]){_0x456079[_0xf744('0x34')]=_[_0xf744('0x35')](_0x456079[_0xf744('0x34')],{'$or':_['map'](_0x456079[_0xf744('0x2d')],function(_0x9b4747){var _0x13cf9b={};_0x13cf9b[_0x9b4747]={'$like':'%'+_0x58bc2d[_0xf744('0x2b')][_0xf744('0x37')]+'%'};return _0x13cf9b;})});}_0x456079=_[_0xf744('0x35')]({},_0x456079,_0x58bc2d[_0xf744('0x38')]);return _0x43369d[_0xf744('0x4b')](_0x456079);}})[_0xf744('0x20')](function(_0x44164d){if(_0x44164d){_0xba7f3e=_0x44164d[_0xf744('0x30')];if(!_0x58bc2d[_0xf744('0x2b')][_0xf744('0x31')](_0xf744('0x49'))){_0x456079['limit']=qs[_0xf744('0x18')](_0x58bc2d[_0xf744('0x2b')][_0xf744('0x18')]);_0x456079[_0xf744('0x17')]=qs[_0xf744('0x17')](_0x58bc2d[_0xf744('0x2b')][_0xf744('0x17')]);}return _0x43369d[_0xf744('0x4b')](_0x456079);}})['then'](function(_0x4dd8fe){if(_0x4dd8fe){return _0x4dd8fe?{'count':_0xba7f3e,'rows':_0x4dd8fe}:null;}})[_0xf744('0x20')](respondWithResult(_0x3bc2a0,null))['catch'](handleError(_0x3bc2a0,null));};
\ No newline at end of file
+var _0xfacc=['keys','length','find','body','addConditions','Condition','ids','omit','getConditions','addActions','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','status','end','name','send','Automation','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params'];(function(_0x380b8f,_0x32271d){var _0x646c69=function(_0x57c77f){while(--_0x57c77f){_0x380b8f['push'](_0x380b8f['shift']());}};_0x646c69(++_0x32271d);}(_0xfacc,0x19c));var _0xcfac=function(_0x3e1926,_0x11e729){_0x3e1926=_0x3e1926-0x0;var _0x5517e9=_0xfacc[_0x3e1926];return _0x5517e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfac('0x0'));var zipdir=require(_0xcfac('0x1'));var jsonpatch=require(_0xcfac('0x2'));var rp=require(_0xcfac('0x3'));var moment=require('moment');var BPromise=require(_0xcfac('0x4'));var Mustache=require(_0xcfac('0x5'));var util=require(_0xcfac('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcfac('0x7'));var squel=require(_0xcfac('0x8'));var crypto=require(_0xcfac('0x9'));var jsforce=require(_0xcfac('0xa'));var deskjs=require(_0xcfac('0xb'));var toCsv=require(_0xcfac('0xc'));var querystring=require(_0xcfac('0xd'));var Papa=require(_0xcfac('0xe'));var Redis=require(_0xcfac('0xf'));var authService=require(_0xcfac('0x10'));var qs=require(_0xcfac('0x11'));var as=require(_0xcfac('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfac('0x13'))(_0xcfac('0x14'));var utils=require(_0xcfac('0x15'));var config=require(_0xcfac('0x16'));var licenseUtil=require(_0xcfac('0x17'));var db=require(_0xcfac('0x18'))['db'];function respondWithStatusCode(_0x5e336a,_0x258223){_0x258223=_0x258223||0xcc;return function(_0x3c967f){if(_0x3c967f){return _0x5e336a[_0xcfac('0x19')](_0x258223);}return _0x5e336a['status'](_0x258223)['end']();};}function respondWithResult(_0x341a91,_0x37a5f7){_0x37a5f7=_0x37a5f7||0xc8;return function(_0x4f1d61){if(_0x4f1d61){return _0x341a91['status'](_0x37a5f7)[_0xcfac('0x1a')](_0x4f1d61);}};}function respondWithFilteredResult(_0x2fabe9,_0x36236e){return function(_0x20f557){if(_0x20f557){var _0x2f9341=typeof _0x36236e[_0xcfac('0x1b')]===_0xcfac('0x1c')&&typeof _0x36236e[_0xcfac('0x1d')]===_0xcfac('0x1c');var _0x5baa42=_0x20f557['count'];var _0x12f47e=_0x2f9341?0x0:_0x36236e['offset'];var _0x234643=_0x2f9341?_0x20f557[_0xcfac('0x1e')]:_0x36236e[_0xcfac('0x1b')]+_0x36236e['limit'];var _0x3f27b0;if(_0x234643>=_0x5baa42){_0x234643=_0x5baa42;_0x3f27b0=0xc8;}else{_0x3f27b0=0xce;}_0x2fabe9['status'](_0x3f27b0);return _0x2fabe9['set']('Content-Range',_0x12f47e+'-'+_0x234643+'/'+_0x5baa42)[_0xcfac('0x1a')](_0x20f557);}return null;};}function patchUpdates(_0x12abef){return function(_0x108246){try{jsonpatch[_0xcfac('0x1f')](_0x108246,_0x12abef,!![]);}catch(_0x3f32dc){return BPromise[_0xcfac('0x20')](_0x3f32dc);}return _0x108246[_0xcfac('0x21')]();};}function saveUpdates(_0x24d8fd,_0x155d73){return function(_0x4755ff){if(_0x4755ff){return _0x4755ff[_0xcfac('0x22')](_0x24d8fd)['then'](function(_0x520c84){return _0x520c84;});}return null;};}function removeEntity(_0x1d9b88,_0x1f72cb){return function(_0x12e68f){if(_0x12e68f){return _0x12e68f[_0xcfac('0x23')]()[_0xcfac('0x24')](function(){_0x1d9b88[_0xcfac('0x25')](0xcc)[_0xcfac('0x26')]();});}};}function handleEntityNotFound(_0x5655d4,_0x4ab0b5){return function(_0x2858e7){if(!_0x2858e7){_0x5655d4[_0xcfac('0x19')](0x194);}return _0x2858e7;};}function handleError(_0x4f9ee3,_0xad035e){_0xad035e=_0xad035e||0x1f4;return function(_0xf8af77){logger['error'](_0xf8af77['stack']);if(_0xf8af77[_0xcfac('0x27')]){delete _0xf8af77[_0xcfac('0x27')];}_0x4f9ee3[_0xcfac('0x25')](_0xad035e)[_0xcfac('0x28')](_0xf8af77);};}exports['index']=function(_0x4fd910,_0x58b0c2){var _0x312263={},_0x564137={},_0x5e6ed0={'count':0x0,'rows':[]};var _0x41c252=_['map'](db[_0xcfac('0x29')][_0xcfac('0x2a')],function(_0x1fdcb0){return{'name':_0x1fdcb0[_0xcfac('0x2b')],'type':_0x1fdcb0[_0xcfac('0x2c')][_0xcfac('0x2d')]};});_0x564137[_0xcfac('0x2e')]=_[_0xcfac('0x2f')](_0x41c252,'name');_0x564137['query']=_['keys'](_0x4fd910[_0xcfac('0x30')]);_0x564137[_0xcfac('0x31')]=_[_0xcfac('0x32')](_0x564137['model'],_0x564137['query']);_0x312263[_0xcfac('0x33')]=_[_0xcfac('0x32')](_0x564137[_0xcfac('0x2e')],qs[_0xcfac('0x34')](_0x4fd910[_0xcfac('0x30')][_0xcfac('0x34')]));_0x312263['attributes']=_0x312263[_0xcfac('0x33')]['length']?_0x312263['attributes']:_0x564137[_0xcfac('0x2e')];if(!_0x4fd910[_0xcfac('0x30')][_0xcfac('0x35')](_0xcfac('0x36'))){_0x312263[_0xcfac('0x1d')]=qs[_0xcfac('0x1d')](_0x4fd910[_0xcfac('0x30')]['limit']);_0x312263[_0xcfac('0x1b')]=qs[_0xcfac('0x1b')](_0x4fd910['query'][_0xcfac('0x1b')]);}_0x312263[_0xcfac('0x37')]=qs[_0xcfac('0x38')](_0x4fd910[_0xcfac('0x30')][_0xcfac('0x38')]);_0x312263[_0xcfac('0x39')]=qs[_0xcfac('0x31')](_[_0xcfac('0x3a')](_0x4fd910[_0xcfac('0x30')],_0x564137[_0xcfac('0x31')]),_0x41c252);if(_0x4fd910[_0xcfac('0x30')][_0xcfac('0x3b')]){_0x312263[_0xcfac('0x39')]=_[_0xcfac('0x3c')](_0x312263['where'],{'$or':_[_0xcfac('0x2f')](_0x41c252,function(_0x4416ac){if(_0x4416ac[_0xcfac('0x2c')]!==_0xcfac('0x3d')){var _0x2f0bc4={};_0x2f0bc4[_0x4416ac['name']]={'$like':'%'+_0x4fd910[_0xcfac('0x30')]['filter']+'%'};return _0x2f0bc4;}})});}_0x312263=_[_0xcfac('0x3c')]({},_0x312263,_0x4fd910[_0xcfac('0x3e')]);var _0x5da6f8={'where':_0x312263[_0xcfac('0x39')]};return db['Automation']['count'](_0x5da6f8)[_0xcfac('0x24')](function(_0x4eceb5){_0x5e6ed0['count']=_0x4eceb5;if(_0x4fd910[_0xcfac('0x30')][_0xcfac('0x3f')]){_0x312263[_0xcfac('0x40')]=[{'all':!![]}];}return db[_0xcfac('0x29')]['findAll'](_0x312263);})[_0xcfac('0x24')](function(_0x3986a4){_0x5e6ed0[_0xcfac('0x41')]=_0x3986a4;return _0x5e6ed0;})[_0xcfac('0x24')](respondWithFilteredResult(_0x58b0c2,_0x312263))[_0xcfac('0x42')](handleError(_0x58b0c2,null));};exports['show']=function(_0x1713ac,_0x53e629){var _0x3616c1={'raw':![],'where':{'id':_0x1713ac[_0xcfac('0x43')]['id']}},_0x2d13e5={};_0x2d13e5[_0xcfac('0x2e')]=_[_0xcfac('0x44')](db[_0xcfac('0x29')][_0xcfac('0x2a')]);_0x2d13e5['query']=_['keys'](_0x1713ac['query']);_0x2d13e5[_0xcfac('0x31')]=_[_0xcfac('0x32')](_0x2d13e5[_0xcfac('0x2e')],_0x2d13e5[_0xcfac('0x30')]);_0x3616c1['attributes']=_['intersection'](_0x2d13e5[_0xcfac('0x2e')],qs[_0xcfac('0x34')](_0x1713ac[_0xcfac('0x30')][_0xcfac('0x34')]));_0x3616c1['attributes']=_0x3616c1[_0xcfac('0x33')][_0xcfac('0x45')]?_0x3616c1[_0xcfac('0x33')]:_0x2d13e5[_0xcfac('0x2e')];if(_0x1713ac['query'][_0xcfac('0x3f')]){_0x3616c1[_0xcfac('0x40')]=[{'all':!![]}];}_0x3616c1=_[_0xcfac('0x3c')]({},_0x3616c1,_0x1713ac[_0xcfac('0x3e')]);return db[_0xcfac('0x29')][_0xcfac('0x46')](_0x3616c1)[_0xcfac('0x24')](handleEntityNotFound(_0x53e629,null))[_0xcfac('0x24')](respondWithResult(_0x53e629,null))[_0xcfac('0x42')](handleError(_0x53e629,null));};exports['create']=function(_0x4252f5,_0x20532a){return db[_0xcfac('0x29')]['create'](_0x4252f5[_0xcfac('0x47')],{})['then'](respondWithResult(_0x20532a,0xc9))[_0xcfac('0x42')](handleError(_0x20532a,null));};exports[_0xcfac('0x22')]=function(_0x1981bb,_0x291d2b){if(_0x1981bb[_0xcfac('0x47')]['id']){delete _0x1981bb[_0xcfac('0x47')]['id'];}return db[_0xcfac('0x29')]['find']({'where':{'id':_0x1981bb['params']['id']}})['then'](handleEntityNotFound(_0x291d2b,null))['then'](saveUpdates(_0x1981bb[_0xcfac('0x47')],null))[_0xcfac('0x24')](respondWithResult(_0x291d2b,null))['catch'](handleError(_0x291d2b,null));};exports[_0xcfac('0x23')]=function(_0x1ee9c4,_0x35c2b5){return db[_0xcfac('0x29')][_0xcfac('0x46')]({'where':{'id':_0x1ee9c4[_0xcfac('0x43')]['id']}})[_0xcfac('0x24')](handleEntityNotFound(_0x35c2b5,null))[_0xcfac('0x24')](removeEntity(_0x35c2b5,null))[_0xcfac('0x42')](handleError(_0x35c2b5,null));};exports[_0xcfac('0x48')]=function(_0x30221b,_0x380973,_0x24cc8c){return db[_0xcfac('0x49')][_0xcfac('0x46')]({'where':{'id':_0x30221b[_0xcfac('0x43')]['id']}})[_0xcfac('0x24')](handleEntityNotFound(_0x380973,null))[_0xcfac('0x24')](function(_0x5d267f){if(_0x5d267f){return _0x5d267f[_0xcfac('0x48')](_0x30221b['body'][_0xcfac('0x4a')],_[_0xcfac('0x4b')](_0x30221b['body'],[_0xcfac('0x4a'),'id'])||{});}})[_0xcfac('0x24')](respondWithResult(_0x380973,null))[_0xcfac('0x42')](handleError(_0x380973,null));};exports[_0xcfac('0x4c')]=function(_0x239048,_0x168fe4,_0x45d9ac){var _0x3fd5a0={};var _0x30a8dd={};var _0x5dcfd2;var _0x2ac7c4;return db['Automation']['findOne']({'where':{'id':_0x239048[_0xcfac('0x43')]['id']}})[_0xcfac('0x24')](handleEntityNotFound(_0x168fe4,null))[_0xcfac('0x24')](function(_0x89c765){if(_0x89c765){_0x5dcfd2=_0x89c765;_0x30a8dd['model']=_[_0xcfac('0x44')](db['Condition'][_0xcfac('0x2a')]);_0x30a8dd[_0xcfac('0x30')]=_[_0xcfac('0x44')](_0x239048[_0xcfac('0x30')]);_0x30a8dd[_0xcfac('0x31')]=_[_0xcfac('0x32')](_0x30a8dd['model'],_0x30a8dd['query']);_0x3fd5a0[_0xcfac('0x33')]=_['intersection'](_0x30a8dd[_0xcfac('0x2e')],qs[_0xcfac('0x34')](_0x239048[_0xcfac('0x30')][_0xcfac('0x34')]));_0x3fd5a0[_0xcfac('0x33')]=_0x3fd5a0[_0xcfac('0x33')][_0xcfac('0x45')]?_0x3fd5a0[_0xcfac('0x33')]:_0x30a8dd[_0xcfac('0x2e')];_0x3fd5a0['order']=qs[_0xcfac('0x38')](_0x239048[_0xcfac('0x30')]['sort']);_0x3fd5a0[_0xcfac('0x39')]=qs['filters'](_[_0xcfac('0x3a')](_0x239048[_0xcfac('0x30')],_0x30a8dd['filters']));if(_0x239048[_0xcfac('0x30')]['filter']){_0x3fd5a0[_0xcfac('0x39')]=_['merge'](_0x3fd5a0[_0xcfac('0x39')],{'$or':_[_0xcfac('0x2f')](_0x3fd5a0['attributes'],function(_0x51e34c){var _0x357f03={};_0x357f03[_0x51e34c]={'$like':'%'+_0x239048[_0xcfac('0x30')][_0xcfac('0x3b')]+'%'};return _0x357f03;})});}_0x3fd5a0=_[_0xcfac('0x3c')]({},_0x3fd5a0,_0x239048[_0xcfac('0x3e')]);return _0x5dcfd2['getConditions'](_0x3fd5a0);}})['then'](function(_0x557586){if(_0x557586){_0x2ac7c4=_0x557586[_0xcfac('0x45')];if(!_0x239048[_0xcfac('0x30')][_0xcfac('0x35')](_0xcfac('0x36'))){_0x3fd5a0['limit']=qs[_0xcfac('0x1d')](_0x239048['query'][_0xcfac('0x1d')]);_0x3fd5a0['offset']=qs['offset'](_0x239048[_0xcfac('0x30')][_0xcfac('0x1b')]);}return _0x5dcfd2['getConditions'](_0x3fd5a0);}})[_0xcfac('0x24')](function(_0xd56e27){if(_0xd56e27){return _0xd56e27?{'count':_0x2ac7c4,'rows':_0xd56e27}:null;}})[_0xcfac('0x24')](respondWithResult(_0x168fe4,null))[_0xcfac('0x42')](handleError(_0x168fe4,null));};exports[_0xcfac('0x4d')]=function(_0x1e0136,_0x30723e,_0x1d1c79){return db['Action']['find']({'where':{'id':_0x1e0136[_0xcfac('0x43')]['id']}})[_0xcfac('0x24')](handleEntityNotFound(_0x30723e,null))[_0xcfac('0x24')](function(_0xd1717){if(_0xd1717){return _0xd1717['addActions'](_0x1e0136['body'][_0xcfac('0x4a')],_[_0xcfac('0x4b')](_0x1e0136['body'],[_0xcfac('0x4a'),'id'])||{});}})[_0xcfac('0x24')](respondWithResult(_0x30723e,null))[_0xcfac('0x42')](handleError(_0x30723e,null));};exports[_0xcfac('0x4e')]=function(_0x3ff825,_0x8c520f,_0x501198){var _0x4f5578={};var _0x2c3789={};var _0x241427;var _0xe86a34;return db[_0xcfac('0x29')][_0xcfac('0x4f')]({'where':{'id':_0x3ff825[_0xcfac('0x43')]['id']}})[_0xcfac('0x24')](handleEntityNotFound(_0x8c520f,null))[_0xcfac('0x24')](function(_0x32b792){if(_0x32b792){_0x241427=_0x32b792;_0x2c3789[_0xcfac('0x2e')]=_['keys'](db['Action'][_0xcfac('0x2a')]);_0x2c3789[_0xcfac('0x30')]=_[_0xcfac('0x44')](_0x3ff825[_0xcfac('0x30')]);_0x2c3789[_0xcfac('0x31')]=_['intersection'](_0x2c3789[_0xcfac('0x2e')],_0x2c3789[_0xcfac('0x30')]);_0x4f5578[_0xcfac('0x33')]=_[_0xcfac('0x32')](_0x2c3789['model'],qs[_0xcfac('0x34')](_0x3ff825[_0xcfac('0x30')][_0xcfac('0x34')]));_0x4f5578[_0xcfac('0x33')]=_0x4f5578['attributes'][_0xcfac('0x45')]?_0x4f5578['attributes']:_0x2c3789['model'];_0x4f5578['order']=qs['sort'](_0x3ff825['query']['sort']);_0x4f5578['where']=qs[_0xcfac('0x31')](_['pick'](_0x3ff825['query'],_0x2c3789['filters']));if(_0x3ff825['query'][_0xcfac('0x3b')]){_0x4f5578[_0xcfac('0x39')]=_[_0xcfac('0x3c')](_0x4f5578['where'],{'$or':_[_0xcfac('0x2f')](_0x4f5578['attributes'],function(_0x56b5a0){var _0x5f27a3={};_0x5f27a3[_0x56b5a0]={'$like':'%'+_0x3ff825[_0xcfac('0x30')]['filter']+'%'};return _0x5f27a3;})});}_0x4f5578=_[_0xcfac('0x3c')]({},_0x4f5578,_0x3ff825[_0xcfac('0x3e')]);return _0x241427[_0xcfac('0x4e')](_0x4f5578);}})[_0xcfac('0x24')](function(_0x125bdf){if(_0x125bdf){_0xe86a34=_0x125bdf[_0xcfac('0x45')];if(!_0x3ff825[_0xcfac('0x30')]['hasOwnProperty']('nolimit')){_0x4f5578[_0xcfac('0x1d')]=qs['limit'](_0x3ff825[_0xcfac('0x30')]['limit']);_0x4f5578[_0xcfac('0x1b')]=qs[_0xcfac('0x1b')](_0x3ff825[_0xcfac('0x30')]['offset']);}return _0x241427['getActions'](_0x4f5578);}})[_0xcfac('0x24')](function(_0x5bac80){if(_0x5bac80){return _0x5bac80?{'count':_0xe86a34,'rows':_0x5bac80}:null;}})[_0xcfac('0x24')](respondWithResult(_0x8c520f,null))[_0xcfac('0x42')](handleError(_0x8c520f,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index a7551cb..89142ce 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 _0x620c=['define','Automation','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x620c,0x106));var _0xc620=function(_0x429468,_0x5e5cc2){_0x429468=_0x429468-0x0;var _0x2c0799=_0x620c[_0x429468];return _0x2c0799;};'use strict';var _=require(_0xc620('0x0'));var util=require('util');var logger=require(_0xc620('0x1'))(_0xc620('0x2'));var moment=require(_0xc620('0x3'));var BPromise=require(_0xc620('0x4'));var rp=require(_0xc620('0x5'));var fs=require('fs');var path=require(_0xc620('0x6'));var rimraf=require(_0xc620('0x7'));var config=require(_0xc620('0x8'));var attributes=require(_0xc620('0x9'));module[_0xc620('0xa')]=function(_0x4cf6fa,_0x1f1212){return _0x4cf6fa[_0xc620('0xb')](_0xc620('0xc'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc08a=['util','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','define','tools_automations'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc08a,0xd0));var _0xac08=function(_0x4aa92e,_0x207b21){_0x4aa92e=_0x4aa92e-0x0;var _0x440f2b=_0xc08a[_0x4aa92e];return _0x440f2b;};'use strict';var _=require('lodash');var util=require(_0xac08('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xac08('0x1'));var rp=require(_0xac08('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac08('0x3'));var config=require(_0xac08('0x4'));var attributes=require(_0xac08('0x5'));module['exports']=function(_0x5cfc44,_0x57a579){return _0x5cfc44[_0xac08('0x6')]('Automation',attributes,{'tableName':_0xac08('0x7'),'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 0b9518e..8ea49a9 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 _0xdac7=['error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5b0208,_0x58666d){var _0x5800b4=function(_0x21dfc5){while(--_0x21dfc5){_0x5b0208['push'](_0x5b0208['shift']());}};_0x5800b4(++_0x58666d);}(_0xdac7,0x180));var _0x7dac=function(_0x25adf6,_0x2d42a2){_0x25adf6=_0x25adf6-0x0;var _0x3aba69=_0xdac7[_0x25adf6];return _0x3aba69;};'use strict';var _=require(_0x7dac('0x0'));var util=require(_0x7dac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dac('0x2'));var db=require(_0x7dac('0x3'))['db'];var utils=require(_0x7dac('0x4'));var logger=require(_0x7dac('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dac('0x6')][_0x7dac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x505705,_0x28cc84,_0x53c460){return new BPromise(function(_0x3b319f,_0x5ccf75){return client[_0x7dac('0x8')](_0x505705,_0x53c460)[_0x7dac('0x9')](function(_0x45fbdc){logger[_0x7dac('0xa')](_0x7dac('0xb'),_0x28cc84,_0x7dac('0xc'));logger[_0x7dac('0xd')](_0x7dac('0xe'),_0x28cc84,_0x7dac('0xc'),JSON[_0x7dac('0xf')](_0x45fbdc));if(_0x45fbdc['error']){if(_0x45fbdc['error']['code']===0x1f4){logger[_0x7dac('0x10')]('Automation,\x20%s,\x20%s',_0x28cc84,_0x45fbdc[_0x7dac('0x10')]['message']);return _0x5ccf75(_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);}logger[_0x7dac('0x10')](_0x7dac('0xb'),_0x28cc84,_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);return _0x3b319f(_0x45fbdc[_0x7dac('0x10')]['message']);}else{logger[_0x7dac('0xa')]('Automation,\x20%s,\x20%s',_0x28cc84,'request\x20sent');_0x3b319f(_0x45fbdc[_0x7dac('0x12')][_0x7dac('0x11')]);}})[_0x7dac('0x13')](function(_0x2de4ea){logger[_0x7dac('0x10')]('Automation,\x20%s,\x20%s',_0x28cc84,_0x2de4ea);_0x5ccf75(_0x2de4ea);});});}
\ No newline at end of file
+var _0xf9ac=['info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then'];(function(_0x5f5ac5,_0x526505){var _0x3697f2=function(_0x49cec5){while(--_0x49cec5){_0x5f5ac5['push'](_0x5f5ac5['shift']());}};_0x3697f2(++_0x526505);}(_0xf9ac,0x87));var _0xcf9a=function(_0x56139e,_0x714ec2){_0x56139e=_0x56139e-0x0;var _0x113526=_0xf9ac[_0x56139e];return _0x113526;};'use strict';var _=require(_0xcf9a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf9a('0x1'));var rs=require(_0xcf9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf9a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf9a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcf9a('0x5'));var client=jayson[_0xcf9a('0x6')][_0xcf9a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x235e47,_0x54ebf6,_0x33a1a6){return new BPromise(function(_0x3d2f54,_0x4c0665){return client['request'](_0x235e47,_0x33a1a6)[_0xcf9a('0x8')](function(_0x579cf9){logger[_0xcf9a('0x9')]('Automation,\x20%s,\x20%s',_0x54ebf6,_0xcf9a('0xa'));logger['debug'](_0xcf9a('0xb'),_0x54ebf6,_0xcf9a('0xa'),JSON[_0xcf9a('0xc')](_0x579cf9));if(_0x579cf9['error']){if(_0x579cf9['error']['code']===0x1f4){logger[_0xcf9a('0xd')](_0xcf9a('0xe'),_0x54ebf6,_0x579cf9['error'][_0xcf9a('0xf')]);return _0x4c0665(_0x579cf9[_0xcf9a('0xd')][_0xcf9a('0xf')]);}logger['error'](_0xcf9a('0xe'),_0x54ebf6,_0x579cf9['error']['message']);return _0x3d2f54(_0x579cf9['error']['message']);}else{logger[_0xcf9a('0x9')](_0xcf9a('0xe'),_0x54ebf6,_0xcf9a('0xa'));_0x3d2f54(_0x579cf9[_0xcf9a('0x10')][_0xcf9a('0xf')]);}})[_0xcf9a('0x11')](function(_0x25dc10){logger['error'](_0xcf9a('0xe'),_0x54ebf6,_0x25dc10);_0x4c0665(_0x25dc10);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 9ada502..d0ae512 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 _0x38d3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','update','destroy','exports','multer','util'];(function(_0x3c4e6c,_0x3b3101){var _0x2eb90c=function(_0x42e9c7){while(--_0x42e9c7){_0x3c4e6c['push'](_0x3c4e6c['shift']());}};_0x2eb90c(++_0x3b3101);}(_0x38d3,0x1a7));var _0x338d=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x38d3[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var path=require('path');var timeout=require(_0x338d('0x2'));var express=require(_0x338d('0x3'));var router=express[_0x338d('0x4')]();var fs_extra=require(_0x338d('0x5'));var auth=require(_0x338d('0x6'));var interaction=require(_0x338d('0x7'));var config=require(_0x338d('0x8'));var controller=require(_0x338d('0x9'));router[_0x338d('0xa')]('/',auth['isAuthenticated'](),controller[_0x338d('0xb')]);router[_0x338d('0xa')](_0x338d('0xc'),auth[_0x338d('0xd')](),controller[_0x338d('0xe')]);router[_0x338d('0xa')](_0x338d('0xf'),auth['isAuthenticated'](),controller[_0x338d('0x10')]);router[_0x338d('0xa')](_0x338d('0x11'),auth[_0x338d('0xd')](),controller[_0x338d('0x12')]);router[_0x338d('0x13')]('/',auth['isAuthenticated'](),controller[_0x338d('0x14')]);router[_0x338d('0x13')](_0x338d('0xf'),auth[_0x338d('0xd')](),controller[_0x338d('0x15')]);router[_0x338d('0x13')](_0x338d('0x11'),auth[_0x338d('0xd')](),controller['addActions']);router['put']('/:id',auth[_0x338d('0xd')](),controller[_0x338d('0x16')]);router['delete'](_0x338d('0xc'),auth['isAuthenticated'](),controller[_0x338d('0x17')]);module[_0x338d('0x18')]=router;
\ No newline at end of file
+var _0x9f60=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','exports','multer','path'];(function(_0x1c6f4b,_0x5b8829){var _0x3f7940=function(_0x38193c){while(--_0x38193c){_0x1c6f4b['push'](_0x1c6f4b['shift']());}};_0x3f7940(++_0x5b8829);}(_0x9f60,0x1ae));var _0x09f6=function(_0x34a8e6,_0x341712){_0x34a8e6=_0x34a8e6-0x0;var _0x56df52=_0x9f60[_0x34a8e6];return _0x56df52;};'use strict';var multer=require(_0x09f6('0x0'));var util=require('util');var path=require(_0x09f6('0x1'));var timeout=require(_0x09f6('0x2'));var express=require(_0x09f6('0x3'));var router=express[_0x09f6('0x4')]();var fs_extra=require(_0x09f6('0x5'));var auth=require(_0x09f6('0x6'));var interaction=require(_0x09f6('0x7'));var config=require('../../config/environment');var controller=require(_0x09f6('0x8'));router[_0x09f6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x09f6('0xa'),auth[_0x09f6('0xb')](),controller[_0x09f6('0xc')]);router[_0x09f6('0x9')](_0x09f6('0xd'),auth[_0x09f6('0xb')](),controller[_0x09f6('0xe')]);router[_0x09f6('0x9')]('/:id/actions',auth[_0x09f6('0xb')](),controller[_0x09f6('0xf')]);router[_0x09f6('0x10')]('/',auth['isAuthenticated'](),controller[_0x09f6('0x11')]);router[_0x09f6('0x10')]('/:id/conditions',auth[_0x09f6('0xb')](),controller[_0x09f6('0x12')]);router[_0x09f6('0x10')](_0x09f6('0x13'),auth[_0x09f6('0xb')](),controller[_0x09f6('0x14')]);router[_0x09f6('0x15')](_0x09f6('0xa'),auth[_0x09f6('0xb')](),controller[_0x09f6('0x16')]);router['delete'](_0x09f6('0xa'),auth[_0x09f6('0xb')](),controller['destroy']);module[_0x09f6('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 9b331ec..8fa1a75 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 _0x257c=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x257c,0x111));var _0xc257=function(_0x281820,_0x47572b){_0x281820=_0x281820-0x0;var _0x2d05f6=_0x257c[_0x281820];return _0x2d05f6;};'use strict';var Sequelize=require('sequelize');module[_0xc257('0x0')]={'name':{'type':Sequelize[_0xc257('0x1')],'unique':_0xc257('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc257('0x3')](_0xc257('0x4')),'allowNull':![],'defaultValue':_0xc257('0x4')},'description':{'type':Sequelize[_0xc257('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc257('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc257('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xc257('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc257('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc257('0x8')](0x3)[_0xc257('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc257('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc257('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc257('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xc257('0x8')](0x3)[_0xc257('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc257('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc257('0x8')](0x5)[_0xc257('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc257('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc257('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc257('0x8')](0x5)[_0xc257('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xc257('0x8')](0x3)[_0xc257('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc257('0xd')},'dialTimezone':{'type':Sequelize[_0xc257('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xc257('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xc257('0x3')](_0xc257('0xf'),_0xc257('0x10'),_0xc257('0x11')),'defaultValue':_0xc257('0xf')},'dialAMDActive':{'type':Sequelize[_0xc257('0x12')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc257('0x8')](0x9)[_0xc257('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc257('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xc257('0x8')](0x9)[_0xc257('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc257('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc257('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc257('0x8')](0x9)[_0xc257('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xc257('0x8')](0x9)[_0xc257('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc257('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc257('0x8')](0x9)[_0xc257('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc257('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xc257('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc257('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xc257('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc257('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc257('0x8')](0x9)[_0xc257('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc257('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc257('0x3')](_0xc257('0x1a'),_0xc257('0x1b')),'defaultValue':_0xc257('0x1a')},'dialPrefix':{'type':Sequelize[_0xc257('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc257('0x8')](0x3)[_0xc257('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc257('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc257('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc257('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc257('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc257('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc257('0x8')](0x5)[_0xc257('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc257('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xc257('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc257('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc257('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc257('0x8')](0x3)[_0xc257('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc257('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc257('0x8')](0x5)[_0xc257('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc257('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xc257('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc257('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc257('0x8')](0x3)[_0xc257('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc257('0x8')](0x5)[_0xc257('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc257('0x24')}};
\ No newline at end of file
+var _0xd2ce=['07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x338b7a,_0xe2fcc3){var _0x15f01a=function(_0x145310){while(--_0x145310){_0x338b7a['push'](_0x338b7a['shift']());}};_0x15f01a(++_0xe2fcc3);}(_0xd2ce,0x158));var _0xed2c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd2ce[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xed2c('0x0'));module['exports']={'name':{'type':Sequelize[_0xed2c('0x1')],'unique':_0xed2c('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xed2c('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xed2c('0x4')},'description':{'type':Sequelize[_0xed2c('0x1')]},'active':{'type':Sequelize[_0xed2c('0x5')],'defaultValue':0x0,'comment':_0xed2c('0x6')},'limitCalls':{'type':Sequelize[_0xed2c('0x7')](0x4)[_0xed2c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xed2c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xed2c('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xed2c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed2c('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xed2c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xed2c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed2c('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xed2c('0x7')](0x3)[_0xed2c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed2c('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xed2c('0x7')](0x5)[_0xed2c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed2c('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xed2c('0x7')](0x3)[_0xed2c('0x8')],'defaultValue':0x3,'comment':_0xed2c('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xed2c('0x7')](0x5)[_0xed2c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed2c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xed2c('0x7')](0x3)[_0xed2c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xed2c('0xf')},'dialTimezone':{'type':Sequelize[_0xed2c('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xed2c('0x1')],'defaultValue':_0xed2c('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xed2c('0x11'),_0xed2c('0x12'),_0xed2c('0x13')),'defaultValue':_0xed2c('0x11')},'dialAMDActive':{'type':Sequelize[_0xed2c('0x5')],'defaultValue':0x0,'comment':_0xed2c('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xed2c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xed2c('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xed2c('0x7')](0x9)[_0xed2c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xed2c('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xed2c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xed2c('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xed2c('0x7')](0x9)[_0xed2c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xed2c('0x18')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xed2c('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xed2c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xed2c('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xed2c('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xed2c('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xed2c('0x7')](0x5)[_0xed2c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xed2c('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xed2c('0x7')](0x9)[_0xed2c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xed2c('0x3')](_0xed2c('0x1d'),'ASC'),'defaultValue':_0xed2c('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xed2c('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xed2c('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xed2c('0x7')](0x3)[_0xed2c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xed2c('0x7')](0x5)[_0xed2c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xed2c('0x7')](0x3)[_0xed2c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed2c('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xed2c('0x7')](0x5)[_0xed2c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed2c('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xed2c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed2c('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xed2c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xed2c('0x7')](0x3)[_0xed2c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed2c('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xed2c('0x7')](0x5)[_0xed2c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed2c('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xed2c('0x7')](0x3)[_0xed2c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed2c('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xed2c('0x7')](0x5)[_0xed2c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index cc0327f..4f3039e 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 _0x4d6e=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','name','send','index','map','Campaign','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','include','findAll','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','error','clone','params','omit','createdAt','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','rows','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','field','NOW()','scheduledAt','ContactId','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','cmHopperId','h.id','ci.item','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x21e040,_0x20e57f){var _0x262b18=function(_0x2322c9){while(--_0x2322c9){_0x21e040['push'](_0x21e040['shift']());}};_0x262b18(++_0x20e57f);}(_0x4d6e,0x77));var _0xe4d6=function(_0xbc6566,_0x32d463){_0xbc6566=_0xbc6566-0x0;var _0x4ed128=_0x4d6e[_0xbc6566];return _0x4ed128;};'use strict';var emlformat=require(_0xe4d6('0x0'));var rimraf=require(_0xe4d6('0x1'));var zipdir=require(_0xe4d6('0x2'));var jsonpatch=require(_0xe4d6('0x3'));var rp=require(_0xe4d6('0x4'));var moment=require('moment');var BPromise=require(_0xe4d6('0x5'));var Mustache=require(_0xe4d6('0x6'));var util=require(_0xe4d6('0x7'));var path=require(_0xe4d6('0x8'));var sox=require(_0xe4d6('0x9'));var csv=require(_0xe4d6('0xa'));var ejs=require(_0xe4d6('0xb'));var fs=require('fs');var fs_extra=require(_0xe4d6('0xc'));var _=require(_0xe4d6('0xd'));var squel=require(_0xe4d6('0xe'));var crypto=require(_0xe4d6('0xf'));var jsforce=require(_0xe4d6('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe4d6('0xa'));var querystring=require(_0xe4d6('0x11'));var Papa=require('papaparse');var Redis=require(_0xe4d6('0x12'));var authService=require(_0xe4d6('0x13'));var qs=require(_0xe4d6('0x14'));var as=require(_0xe4d6('0x15'));var hardwareService=require(_0xe4d6('0x16'));var logger=require(_0xe4d6('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xe4d6('0x18'));var licenseUtil=require(_0xe4d6('0x19'));var db=require(_0xe4d6('0x1a'))['db'];function respondWithStatusCode(_0x5a14e5,_0x1a80eb){_0x1a80eb=_0x1a80eb||0xcc;return function(_0x3f7441){if(_0x3f7441){return _0x5a14e5['sendStatus'](_0x1a80eb);}return _0x5a14e5[_0xe4d6('0x1b')](_0x1a80eb)[_0xe4d6('0x1c')]();};}function respondWithResult(_0x5dbcc5,_0xdc7f40){_0xdc7f40=_0xdc7f40||0xc8;return function(_0x780caa){if(_0x780caa){return _0x5dbcc5[_0xe4d6('0x1b')](_0xdc7f40)[_0xe4d6('0x1d')](_0x780caa);}};}function respondWithFilteredResult(_0x53ca26,_0x2e04a9){return function(_0x28e001){if(_0x28e001){var _0x3dbe31=typeof _0x2e04a9[_0xe4d6('0x1e')]==='undefined'&&typeof _0x2e04a9[_0xe4d6('0x1f')]==='undefined';var _0x526dd6=_0x28e001[_0xe4d6('0x20')];var _0x351a17=_0x3dbe31?0x0:_0x2e04a9[_0xe4d6('0x1e')];var _0x1928f9=_0x3dbe31?_0x28e001[_0xe4d6('0x20')]:_0x2e04a9['offset']+_0x2e04a9[_0xe4d6('0x1f')];var _0x42b261;if(_0x1928f9>=_0x526dd6){_0x1928f9=_0x526dd6;_0x42b261=0xc8;}else{_0x42b261=0xce;}_0x53ca26[_0xe4d6('0x1b')](_0x42b261);return _0x53ca26[_0xe4d6('0x21')](_0xe4d6('0x22'),_0x351a17+'-'+_0x1928f9+'/'+_0x526dd6)[_0xe4d6('0x1d')](_0x28e001);}return null;};}function patchUpdates(_0x26b9b6){return function(_0x27e824){try{jsonpatch['apply'](_0x27e824,_0x26b9b6,!![]);}catch(_0x1afb27){return BPromise['reject'](_0x1afb27);}return _0x27e824[_0xe4d6('0x23')]();};}function saveUpdates(_0x34e7ca,_0x31f569){return function(_0x162b57){if(_0x162b57){return _0x162b57[_0xe4d6('0x24')](_0x34e7ca)[_0xe4d6('0x25')](function(_0x455011){return _0x455011;});}return null;};}function removeEntity(_0x202f67,_0x59233f){return function(_0x404fe1){if(_0x404fe1){return _0x404fe1[_0xe4d6('0x26')]()['then'](function(){var _0xb869f=_0x404fe1[_0xe4d6('0x27')]({'plain':!![]});var _0x2807e7=_0xe4d6('0x28');return db[_0xe4d6('0x29')][_0xe4d6('0x26')]({'where':{'type':_0x2807e7,'resourceId':_0xb869f['id']}})[_0xe4d6('0x25')](function(){return _0x404fe1;});})[_0xe4d6('0x25')](function(){_0x202f67['status'](0xcc)[_0xe4d6('0x1c')]();});}};}function handleEntityNotFound(_0x152d16,_0x4daadb){return function(_0x4ccf6b){if(!_0x4ccf6b){_0x152d16['sendStatus'](0x194);}return _0x4ccf6b;};}function handleError(_0x2b732e,_0x4a7e63){_0x4a7e63=_0x4a7e63||0x1f4;return function(_0x3d2efe){logger['error'](_0x3d2efe['stack']);if(_0x3d2efe[_0xe4d6('0x2a')]){delete _0x3d2efe['name'];}_0x2b732e['status'](_0x4a7e63)[_0xe4d6('0x2b')](_0x3d2efe);};}exports[_0xe4d6('0x2c')]=function(_0x5a0859,_0x580d44){var _0x3fd34f={},_0x4077c1={},_0x4db1fb={'count':0x0,'rows':[]};var _0xc58fcb=_[_0xe4d6('0x2d')](db[_0xe4d6('0x2e')][_0xe4d6('0x2f')],function(_0x279961){return{'name':_0x279961[_0xe4d6('0x30')],'type':_0x279961['type']['key']};});_0x4077c1[_0xe4d6('0x31')]=_[_0xe4d6('0x2d')](_0xc58fcb,'name');_0x4077c1[_0xe4d6('0x32')]=_['keys'](_0x5a0859[_0xe4d6('0x32')]);_0x4077c1['filters']=_['intersection'](_0x4077c1[_0xe4d6('0x31')],_0x4077c1['query']);_0x3fd34f['attributes']=_[_0xe4d6('0x33')](_0x4077c1[_0xe4d6('0x31')],qs[_0xe4d6('0x34')](_0x5a0859[_0xe4d6('0x32')]['fields']));_0x3fd34f[_0xe4d6('0x35')]=_0x3fd34f[_0xe4d6('0x35')][_0xe4d6('0x36')]?_0x3fd34f[_0xe4d6('0x35')]:_0x4077c1[_0xe4d6('0x31')];if(!_0x5a0859[_0xe4d6('0x32')][_0xe4d6('0x37')](_0xe4d6('0x38'))){_0x3fd34f[_0xe4d6('0x1f')]=qs[_0xe4d6('0x1f')](_0x5a0859['query'][_0xe4d6('0x1f')]);_0x3fd34f['offset']=qs[_0xe4d6('0x1e')](_0x5a0859[_0xe4d6('0x32')][_0xe4d6('0x1e')]);}_0x3fd34f[_0xe4d6('0x39')]=qs['sort'](_0x5a0859['query'][_0xe4d6('0x3a')]);_0x3fd34f[_0xe4d6('0x3b')]=qs[_0xe4d6('0x3c')](_[_0xe4d6('0x3d')](_0x5a0859[_0xe4d6('0x32')],_0x4077c1[_0xe4d6('0x3c')]),_0xc58fcb);if(_0x5a0859[_0xe4d6('0x32')]['filter']){_0x3fd34f[_0xe4d6('0x3b')]=_[_0xe4d6('0x3e')](_0x3fd34f['where'],{'$or':_['map'](_0xc58fcb,function(_0x4662c7){if(_0x4662c7[_0xe4d6('0x3f')]!=='VIRTUAL'){var _0x1a577f={};_0x1a577f[_0x4662c7[_0xe4d6('0x2a')]]={'$like':'%'+_0x5a0859[_0xe4d6('0x32')][_0xe4d6('0x40')]+'%'};return _0x1a577f;}})});}_0x3fd34f=_['merge']({},_0x3fd34f,_0x5a0859[_0xe4d6('0x41')]);var _0x222771={'where':_0x3fd34f[_0xe4d6('0x3b')]};return db[_0xe4d6('0x2e')][_0xe4d6('0x20')](_0x222771)[_0xe4d6('0x25')](function(_0x5a32c0){_0x4db1fb['count']=_0x5a32c0;if(_0x5a0859['query'][_0xe4d6('0x42')]){_0x3fd34f[_0xe4d6('0x43')]=[{'all':!![]}];}return db[_0xe4d6('0x2e')][_0xe4d6('0x44')](_0x3fd34f);})['then'](function(_0x3d2516){_0x4db1fb['rows']=_0x3d2516;return _0x4db1fb;})['then'](respondWithFilteredResult(_0x580d44,_0x3fd34f))[_0xe4d6('0x45')](handleError(_0x580d44,null));};exports[_0xe4d6('0x46')]=function(_0x1f3c05,_0x29b3b2){var _0x373bfa={'raw':![],'where':{'id':_0x1f3c05['params']['id']}},_0x978b7c={};_0x978b7c[_0xe4d6('0x31')]=_[_0xe4d6('0x47')](db[_0xe4d6('0x2e')][_0xe4d6('0x2f')]);_0x978b7c[_0xe4d6('0x32')]=_[_0xe4d6('0x47')](_0x1f3c05[_0xe4d6('0x32')]);_0x978b7c[_0xe4d6('0x3c')]=_['intersection'](_0x978b7c[_0xe4d6('0x31')],_0x978b7c[_0xe4d6('0x32')]);_0x373bfa[_0xe4d6('0x35')]=_['intersection'](_0x978b7c['model'],qs[_0xe4d6('0x34')](_0x1f3c05[_0xe4d6('0x32')][_0xe4d6('0x34')]));_0x373bfa[_0xe4d6('0x35')]=_0x373bfa[_0xe4d6('0x35')][_0xe4d6('0x36')]?_0x373bfa[_0xe4d6('0x35')]:_0x978b7c[_0xe4d6('0x31')];if(_0x1f3c05[_0xe4d6('0x32')][_0xe4d6('0x42')]){_0x373bfa[_0xe4d6('0x43')]=[{'all':!![]}];}_0x373bfa=_[_0xe4d6('0x3e')]({},_0x373bfa,_0x1f3c05[_0xe4d6('0x41')]);return db[_0xe4d6('0x2e')][_0xe4d6('0x48')](_0x373bfa)[_0xe4d6('0x25')](handleEntityNotFound(_0x29b3b2,null))['then'](respondWithResult(_0x29b3b2,null))[_0xe4d6('0x45')](handleError(_0x29b3b2,null));};exports[_0xe4d6('0x49')]=function(_0x546a80,_0x2bea52){return db['Campaign'][_0xe4d6('0x49')](_0x546a80[_0xe4d6('0x4a')],{})['then'](function(_0x6c991){var _0x48bcdc=_0x546a80['user'][_0xe4d6('0x27')]({'plain':!![]});if(!_0x48bcdc)throw new Error(_0xe4d6('0x4b'));if(_0x48bcdc['role']===_0xe4d6('0x4c')){var _0x338cda=_0x6c991[_0xe4d6('0x27')]({'plain':!![]});var _0x278c96=_0xe4d6('0x28');return db['UserProfileSection'][_0xe4d6('0x48')]({'where':{'name':_0x278c96,'userProfileId':_0x48bcdc[_0xe4d6('0x4d')]},'raw':!![]})['then'](function(_0x57c178){if(_0x57c178&&_0x57c178[_0xe4d6('0x4e')]===0x0){return db[_0xe4d6('0x29')][_0xe4d6('0x49')]({'name':_0x338cda['name'],'resourceId':_0x338cda['id'],'type':_0x57c178[_0xe4d6('0x2a')],'sectionId':_0x57c178['id']},{})[_0xe4d6('0x25')](function(){return _0x6c991;});}else{return _0x6c991;}})[_0xe4d6('0x45')](function(_0x427575){logger[_0xe4d6('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x427575);throw _0x427575;});}return _0x6c991;})[_0xe4d6('0x25')](respondWithResult(_0x2bea52,0xc9))[_0xe4d6('0x45')](handleError(_0x2bea52,null));};exports[_0xe4d6('0x50')]=function(_0x1b22c2,_0x38a427){var _0x4e1d04={'where':{'id':_0x1b22c2[_0xe4d6('0x51')]['id']}},_0x279056={};_0x279056[_0xe4d6('0x31')]=_[_0xe4d6('0x47')](db[_0xe4d6('0x2e')][_0xe4d6('0x2f')]);_0x4e1d04['attributes']=_[_0xe4d6('0x33')](_0x279056[_0xe4d6('0x31')],qs[_0xe4d6('0x34')](_0x1b22c2[_0xe4d6('0x32')][_0xe4d6('0x34')]));_0x4e1d04[_0xe4d6('0x35')]=_0x4e1d04[_0xe4d6('0x35')][_0xe4d6('0x36')]?_0x4e1d04[_0xe4d6('0x35')]:_0x279056[_0xe4d6('0x31')];if(_0x1b22c2[_0xe4d6('0x32')]['includeAll']){_0x4e1d04[_0xe4d6('0x43')]=[{'all':!![]}];}_0x4e1d04=_[_0xe4d6('0x3e')]({},_0x4e1d04,_0x1b22c2[_0xe4d6('0x41')]);return db[_0xe4d6('0x2e')][_0xe4d6('0x48')](_0x4e1d04)[_0xe4d6('0x25')](handleEntityNotFound(_0x38a427,null))['then'](function(_0x539eca){if(_0x539eca){var _0x6a1df0=_0x539eca[_0xe4d6('0x27')]({'plain':!![]});_0x6a1df0=qs[_0xe4d6('0x52')](_0x6a1df0,['id',_0xe4d6('0x53'),'updatedAt']);_0x1b22c2['body']=_[_0xe4d6('0x52')](_0x1b22c2[_0xe4d6('0x4a')],['id',_0xe4d6('0x53'),_0xe4d6('0x54')]);return db['Campaign'][_0xe4d6('0x49')](_[_0xe4d6('0x3e')](_0x6a1df0,_0x1b22c2['body']),{'include':_0x1b22c2[_0xe4d6('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0xe4d6('0x25')](function(_0x3b155b){var _0x4f13c7=_0x1b22c2[_0xe4d6('0x4c')]['get']({'plain':!![]});if(!_0x4f13c7)throw new Error(_0xe4d6('0x4b'));if(_0x4f13c7[_0xe4d6('0x55')]==='user'){var _0x41ef7b=_0x3b155b[_0xe4d6('0x27')]({'plain':!![]});var _0x18d2d4='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x18d2d4,'userProfileId':_0x4f13c7[_0xe4d6('0x4d')]},'raw':!![]})[_0xe4d6('0x25')](function(_0x2ae27f){if(_0x2ae27f&&_0x2ae27f[_0xe4d6('0x4e')]===0x0){return db[_0xe4d6('0x29')][_0xe4d6('0x49')]({'name':_0x41ef7b['name'],'resourceId':_0x41ef7b['id'],'type':_0x2ae27f[_0xe4d6('0x2a')],'sectionId':_0x2ae27f['id']},{})[_0xe4d6('0x25')](function(){return _0x3b155b;});}else{return _0x3b155b;}})[_0xe4d6('0x45')](function(_0xdd0ded){logger[_0xe4d6('0x4f')](_0xe4d6('0x56'),_0xdd0ded);throw _0xdd0ded;});}return _0x3b155b;});}})[_0xe4d6('0x25')](respondWithResult(_0x38a427,0xc9))[_0xe4d6('0x45')](handleError(_0x38a427,null));};exports[_0xe4d6('0x24')]=function(_0x4fde5e,_0x57ef4e){if(_0x4fde5e[_0xe4d6('0x4a')]['id']){delete _0x4fde5e[_0xe4d6('0x4a')]['id'];}return db['Campaign']['find']({'where':{'id':_0x4fde5e[_0xe4d6('0x51')]['id']}})[_0xe4d6('0x25')](handleEntityNotFound(_0x57ef4e,null))[_0xe4d6('0x25')](saveUpdates(_0x4fde5e[_0xe4d6('0x4a')],null))[_0xe4d6('0x25')](respondWithResult(_0x57ef4e,null))['catch'](handleError(_0x57ef4e,null));};exports[_0xe4d6('0x26')]=function(_0x3bb13b,_0x349b56){return db[_0xe4d6('0x2e')][_0xe4d6('0x48')]({'where':{'id':_0x3bb13b[_0xe4d6('0x51')]['id']}})['then'](handleEntityNotFound(_0x349b56,null))[_0xe4d6('0x25')](removeEntity(_0x349b56,null))['catch'](handleError(_0x349b56,null));};exports[_0xe4d6('0x57')]=function(_0x40e3de,_0xb29ae,_0x148b10){var _0x4f2fc2={'raw':!![],'where':{}};var _0x2a6a5d={};var _0xea686f={'count':0x0,'rows':[]};return db[_0xe4d6('0x2e')][_0xe4d6('0x58')]({'where':{'id':_0x40e3de['params']['id']}})[_0xe4d6('0x25')](handleEntityNotFound(_0xb29ae,null))[_0xe4d6('0x25')](function(_0x16d598){if(_0x16d598){_0x2a6a5d[_0xe4d6('0x31')]=_[_0xe4d6('0x47')](db[_0xe4d6('0x59')][_0xe4d6('0x2f')]);_0x2a6a5d[_0xe4d6('0x32')]=_[_0xe4d6('0x47')](_0x40e3de[_0xe4d6('0x32')]);_0x2a6a5d[_0xe4d6('0x3c')]=_[_0xe4d6('0x33')](_0x2a6a5d[_0xe4d6('0x31')],_0x2a6a5d[_0xe4d6('0x32')]);_0x4f2fc2[_0xe4d6('0x35')]=_[_0xe4d6('0x33')](_0x2a6a5d[_0xe4d6('0x31')],qs[_0xe4d6('0x34')](_0x40e3de['query'][_0xe4d6('0x34')]));_0x4f2fc2[_0xe4d6('0x35')]=_0x4f2fc2[_0xe4d6('0x35')][_0xe4d6('0x36')]?_0x4f2fc2['attributes']:_0x2a6a5d[_0xe4d6('0x31')];if(!_0x40e3de[_0xe4d6('0x32')][_0xe4d6('0x37')]('nolimit')){_0x4f2fc2['limit']=qs[_0xe4d6('0x1f')](_0x40e3de['query'][_0xe4d6('0x1f')]);_0x4f2fc2[_0xe4d6('0x1e')]=qs[_0xe4d6('0x1e')](_0x40e3de['query'][_0xe4d6('0x1e')]);}_0x4f2fc2[_0xe4d6('0x39')]=qs[_0xe4d6('0x3a')](_0x40e3de[_0xe4d6('0x32')][_0xe4d6('0x3a')]);_0x4f2fc2[_0xe4d6('0x3b')]=qs[_0xe4d6('0x3c')](_[_0xe4d6('0x3d')](_0x40e3de[_0xe4d6('0x32')],_0x2a6a5d[_0xe4d6('0x3c')]));_0x4f2fc2[_0xe4d6('0x3b')]['CampaignId']=_0x16d598['id'];if(_0x40e3de[_0xe4d6('0x32')]['filter']){_0x4f2fc2[_0xe4d6('0x3b')]=_['merge'](_0x4f2fc2[_0xe4d6('0x3b')],{'$or':_[_0xe4d6('0x2d')](_0x4f2fc2[_0xe4d6('0x35')],function(_0x437a06){var _0x253355={};_0x253355[_0x437a06]={'$like':'%'+_0x40e3de[_0xe4d6('0x32')][_0xe4d6('0x40')]+'%'};return _0x253355;})});}_0x4f2fc2=_[_0xe4d6('0x3e')]({},_0x4f2fc2,_0x40e3de[_0xe4d6('0x41')]);return db['CmHopper'][_0xe4d6('0x20')]({'where':_0x4f2fc2[_0xe4d6('0x3b')]})['then'](function(_0x14834f){_0xea686f[_0xe4d6('0x20')]=_0x14834f;if(_0x40e3de[_0xe4d6('0x32')]['includeAll']){_0x4f2fc2[_0xe4d6('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0xe4d6('0x44')](_0x4f2fc2);})[_0xe4d6('0x25')](function(_0x36d67d){_0xea686f[_0xe4d6('0x5a')]=_0x36d67d;return _0xea686f;});}})['then'](respondWithFilteredResult(_0xb29ae,_0x4f2fc2))[_0xe4d6('0x45')](handleError(_0xb29ae,null));};exports['getHopperHistories']=function(_0x38aec5,_0x31991a,_0x18048e){var _0x10e4e6={'raw':!![],'where':{}};var _0xa54dfb={};var _0x22a99f={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x38aec5[_0xe4d6('0x51')]['id']}})[_0xe4d6('0x25')](handleEntityNotFound(_0x31991a,null))[_0xe4d6('0x25')](function(_0x47c558){if(_0x47c558){_0xa54dfb[_0xe4d6('0x31')]=_['keys'](db[_0xe4d6('0x5b')][_0xe4d6('0x2f')]);_0xa54dfb[_0xe4d6('0x32')]=_[_0xe4d6('0x47')](_0x38aec5[_0xe4d6('0x32')]);_0xa54dfb[_0xe4d6('0x3c')]=_[_0xe4d6('0x33')](_0xa54dfb['model'],_0xa54dfb[_0xe4d6('0x32')]);_0x10e4e6[_0xe4d6('0x35')]=_[_0xe4d6('0x33')](_0xa54dfb[_0xe4d6('0x31')],qs['fields'](_0x38aec5[_0xe4d6('0x32')][_0xe4d6('0x34')]));_0x10e4e6[_0xe4d6('0x35')]=_0x10e4e6['attributes'][_0xe4d6('0x36')]?_0x10e4e6[_0xe4d6('0x35')]:_0xa54dfb[_0xe4d6('0x31')];if(!_0x38aec5['query'][_0xe4d6('0x37')](_0xe4d6('0x38'))){_0x10e4e6[_0xe4d6('0x1f')]=qs[_0xe4d6('0x1f')](_0x38aec5[_0xe4d6('0x32')][_0xe4d6('0x1f')]);_0x10e4e6[_0xe4d6('0x1e')]=qs[_0xe4d6('0x1e')](_0x38aec5[_0xe4d6('0x32')][_0xe4d6('0x1e')]);}_0x10e4e6['order']=qs[_0xe4d6('0x3a')](_0x38aec5[_0xe4d6('0x32')][_0xe4d6('0x3a')]);_0x10e4e6[_0xe4d6('0x3b')]=qs['filters'](_[_0xe4d6('0x3d')](_0x38aec5[_0xe4d6('0x32')],_0xa54dfb[_0xe4d6('0x3c')]));_0x10e4e6[_0xe4d6('0x3b')][_0xe4d6('0x5c')]=_0x47c558['id'];if(_0x38aec5[_0xe4d6('0x32')][_0xe4d6('0x40')]){_0x10e4e6[_0xe4d6('0x3b')]=_[_0xe4d6('0x3e')](_0x10e4e6[_0xe4d6('0x3b')],{'$or':_['map'](_0x10e4e6[_0xe4d6('0x35')],function(_0x56558c){var _0x572d34={};_0x572d34[_0x56558c]={'$like':'%'+_0x38aec5[_0xe4d6('0x32')][_0xe4d6('0x40')]+'%'};return _0x572d34;})});}_0x10e4e6=_[_0xe4d6('0x3e')]({},_0x10e4e6,_0x38aec5['options']);return db[_0xe4d6('0x5b')]['count']({'where':_0x10e4e6[_0xe4d6('0x3b')]})[_0xe4d6('0x25')](function(_0x20d0c3){_0x22a99f[_0xe4d6('0x20')]=_0x20d0c3;if(_0x38aec5[_0xe4d6('0x32')][_0xe4d6('0x42')]){_0x10e4e6[_0xe4d6('0x43')]=[{'all':!![]}];}return db[_0xe4d6('0x5b')][_0xe4d6('0x44')](_0x10e4e6);})['then'](function(_0x575bbf){_0x22a99f[_0xe4d6('0x5a')]=_0x575bbf;return _0x22a99f;});}})['then'](respondWithFilteredResult(_0x31991a,_0x10e4e6))[_0xe4d6('0x45')](handleError(_0x31991a,null));};exports[_0xe4d6('0x5d')]=function(_0xe0b7bb,_0x2550d6,_0x30aaa7){var _0x4b5132={'raw':!![],'where':{}};var _0x50c43d={};var _0x21c20b={'count':0x0,'rows':[]};return db[_0xe4d6('0x2e')]['findOne']({'where':{'id':_0xe0b7bb[_0xe4d6('0x51')]['id']}})[_0xe4d6('0x25')](handleEntityNotFound(_0x2550d6,null))[_0xe4d6('0x25')](function(_0xa5a102){if(_0xa5a102){_0x50c43d[_0xe4d6('0x31')]=_[_0xe4d6('0x47')](db[_0xe4d6('0x5e')][_0xe4d6('0x2f')]);_0x50c43d[_0xe4d6('0x32')]=_[_0xe4d6('0x47')](_0xe0b7bb[_0xe4d6('0x32')]);_0x50c43d['filters']=_['intersection'](_0x50c43d[_0xe4d6('0x31')],_0x50c43d[_0xe4d6('0x32')]);_0x4b5132['attributes']=_[_0xe4d6('0x33')](_0x50c43d['model'],qs[_0xe4d6('0x34')](_0xe0b7bb[_0xe4d6('0x32')][_0xe4d6('0x34')]));_0x4b5132[_0xe4d6('0x35')]=_0x4b5132['attributes']['length']?_0x4b5132[_0xe4d6('0x35')]:_0x50c43d[_0xe4d6('0x31')];if(!_0xe0b7bb[_0xe4d6('0x32')][_0xe4d6('0x37')](_0xe4d6('0x38'))){_0x4b5132[_0xe4d6('0x1f')]=qs[_0xe4d6('0x1f')](_0xe0b7bb[_0xe4d6('0x32')][_0xe4d6('0x1f')]);_0x4b5132[_0xe4d6('0x1e')]=qs[_0xe4d6('0x1e')](_0xe0b7bb['query'][_0xe4d6('0x1e')]);}_0x4b5132[_0xe4d6('0x39')]=qs[_0xe4d6('0x3a')](_0xe0b7bb[_0xe4d6('0x32')]['sort']);_0x4b5132[_0xe4d6('0x3b')]=qs[_0xe4d6('0x3c')](_['pick'](_0xe0b7bb['query'],_0x50c43d['filters']));_0x4b5132['where']['CampaignId']=_0xa5a102['id'];if(_0xe0b7bb[_0xe4d6('0x32')]['filter']){_0x4b5132['where']=_[_0xe4d6('0x3e')](_0x4b5132[_0xe4d6('0x3b')],{'$or':_[_0xe4d6('0x2d')](_0x4b5132[_0xe4d6('0x35')],function(_0x4b2380){var _0x4e86f7={};_0x4e86f7[_0x4b2380]={'$like':'%'+_0xe0b7bb[_0xe4d6('0x32')][_0xe4d6('0x40')]+'%'};return _0x4e86f7;})});}_0x4b5132=_[_0xe4d6('0x3e')]({},_0x4b5132,_0xe0b7bb[_0xe4d6('0x41')]);return db[_0xe4d6('0x5e')][_0xe4d6('0x20')]({'where':_0x4b5132[_0xe4d6('0x3b')]})[_0xe4d6('0x25')](function(_0x5ce0ac){_0x21c20b[_0xe4d6('0x20')]=_0x5ce0ac;if(_0xe0b7bb['query'][_0xe4d6('0x42')]){_0x4b5132[_0xe4d6('0x43')]=[{'all':!![]}];}return db[_0xe4d6('0x5e')][_0xe4d6('0x44')](_0x4b5132);})[_0xe4d6('0x25')](function(_0x138381){_0x21c20b[_0xe4d6('0x5a')]=_0x138381;return _0x21c20b;});}})[_0xe4d6('0x25')](respondWithFilteredResult(_0x2550d6,_0x4b5132))[_0xe4d6('0x45')](handleError(_0x2550d6,null));};exports['getHopperBlacks']=function(_0x40b1ad,_0x10c2bb,_0x2848ed){var _0x39873f={'raw':!![],'where':{}};var _0x5bd860={};var _0x3a6de3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x40b1ad[_0xe4d6('0x51')]['id']}})['then'](handleEntityNotFound(_0x10c2bb,null))[_0xe4d6('0x25')](function(_0x4bd9e1){if(_0x4bd9e1){_0x5bd860[_0xe4d6('0x31')]=_[_0xe4d6('0x47')](db[_0xe4d6('0x5f')][_0xe4d6('0x2f')]);_0x5bd860['query']=_[_0xe4d6('0x47')](_0x40b1ad['query']);_0x5bd860[_0xe4d6('0x3c')]=_['intersection'](_0x5bd860[_0xe4d6('0x31')],_0x5bd860['query']);_0x39873f[_0xe4d6('0x35')]=_['intersection'](_0x5bd860[_0xe4d6('0x31')],qs['fields'](_0x40b1ad[_0xe4d6('0x32')][_0xe4d6('0x34')]));_0x39873f['attributes']=_0x39873f[_0xe4d6('0x35')][_0xe4d6('0x36')]?_0x39873f[_0xe4d6('0x35')]:_0x5bd860['model'];if(!_0x40b1ad[_0xe4d6('0x32')][_0xe4d6('0x37')](_0xe4d6('0x38'))){_0x39873f[_0xe4d6('0x1f')]=qs[_0xe4d6('0x1f')](_0x40b1ad[_0xe4d6('0x32')][_0xe4d6('0x1f')]);_0x39873f[_0xe4d6('0x1e')]=qs[_0xe4d6('0x1e')](_0x40b1ad[_0xe4d6('0x32')][_0xe4d6('0x1e')]);}_0x39873f[_0xe4d6('0x39')]=qs[_0xe4d6('0x3a')](_0x40b1ad['query'][_0xe4d6('0x3a')]);_0x39873f[_0xe4d6('0x3b')]=qs[_0xe4d6('0x3c')](_[_0xe4d6('0x3d')](_0x40b1ad['query'],_0x5bd860[_0xe4d6('0x3c')]));_0x39873f[_0xe4d6('0x3b')][_0xe4d6('0x5c')]=_0x4bd9e1['id'];if(_0x40b1ad[_0xe4d6('0x32')][_0xe4d6('0x40')]){_0x39873f[_0xe4d6('0x3b')]=_[_0xe4d6('0x3e')](_0x39873f[_0xe4d6('0x3b')],{'$or':_['map'](_0x39873f[_0xe4d6('0x35')],function(_0x29168e){var _0x88ccab={};_0x88ccab[_0x29168e]={'$like':'%'+_0x40b1ad[_0xe4d6('0x32')]['filter']+'%'};return _0x88ccab;})});}_0x39873f=_[_0xe4d6('0x3e')]({},_0x39873f,_0x40b1ad[_0xe4d6('0x41')]);return db[_0xe4d6('0x5f')][_0xe4d6('0x20')]({'where':_0x39873f[_0xe4d6('0x3b')]})['then'](function(_0x409c8f){_0x3a6de3['count']=_0x409c8f;if(_0x40b1ad[_0xe4d6('0x32')][_0xe4d6('0x42')]){_0x39873f[_0xe4d6('0x43')]=[{'all':!![]}];}return db[_0xe4d6('0x5f')][_0xe4d6('0x44')](_0x39873f);})[_0xe4d6('0x25')](function(_0x36ab7f){_0x3a6de3[_0xe4d6('0x5a')]=_0x36ab7f;return _0x3a6de3;});}})[_0xe4d6('0x25')](respondWithFilteredResult(_0x10c2bb,_0x39873f))['catch'](handleError(_0x10c2bb,null));};exports[_0xe4d6('0x60')]=function(_0x3e6142,_0x21d29c,_0x164e9a){var _0x1bb099={};var _0x47f170={};var _0xd4bf7c;var _0x5cd884;return db['Campaign'][_0xe4d6('0x58')]({'where':{'id':_0x3e6142[_0xe4d6('0x51')]['id']}})['then'](handleEntityNotFound(_0x21d29c,null))[_0xe4d6('0x25')](function(_0x59c2f9){if(_0x59c2f9){_0xd4bf7c=_0x59c2f9;_0x47f170[_0xe4d6('0x31')]=_['keys'](db[_0xe4d6('0x61')][_0xe4d6('0x2f')]);_0x47f170[_0xe4d6('0x32')]=_[_0xe4d6('0x47')](_0x3e6142[_0xe4d6('0x32')]);_0x47f170[_0xe4d6('0x3c')]=_[_0xe4d6('0x33')](_0x47f170[_0xe4d6('0x31')],_0x47f170[_0xe4d6('0x32')]);_0x1bb099[_0xe4d6('0x35')]=_[_0xe4d6('0x33')](_0x47f170[_0xe4d6('0x31')],qs['fields'](_0x3e6142[_0xe4d6('0x32')][_0xe4d6('0x34')]));_0x1bb099[_0xe4d6('0x35')]=_0x1bb099[_0xe4d6('0x35')][_0xe4d6('0x36')]?_0x1bb099[_0xe4d6('0x35')]:_0x47f170[_0xe4d6('0x31')];_0x1bb099['order']=qs[_0xe4d6('0x3a')](_0x3e6142[_0xe4d6('0x32')][_0xe4d6('0x3a')]);_0x1bb099[_0xe4d6('0x3b')]=qs[_0xe4d6('0x3c')](_[_0xe4d6('0x3d')](_0x3e6142[_0xe4d6('0x32')],_0x47f170[_0xe4d6('0x3c')]));if(_0x3e6142[_0xe4d6('0x32')][_0xe4d6('0x40')]){_0x1bb099['where']=_[_0xe4d6('0x3e')](_0x1bb099[_0xe4d6('0x3b')],{'$or':_[_0xe4d6('0x2d')](_0x1bb099[_0xe4d6('0x35')],function(_0x1cdd7e){var _0x3aa9ce={};_0x3aa9ce[_0x1cdd7e]={'$like':'%'+_0x3e6142['query'][_0xe4d6('0x40')]+'%'};return _0x3aa9ce;})});}_0x1bb099=_[_0xe4d6('0x3e')]({},_0x1bb099,_0x3e6142[_0xe4d6('0x41')]);return _0xd4bf7c[_0xe4d6('0x60')](_0x1bb099);}})[_0xe4d6('0x25')](function(_0x525508){if(_0x525508){_0x5cd884=_0x525508['length'];if(!_0x3e6142[_0xe4d6('0x32')][_0xe4d6('0x37')](_0xe4d6('0x38'))){_0x1bb099['limit']=qs[_0xe4d6('0x1f')](_0x3e6142[_0xe4d6('0x32')][_0xe4d6('0x1f')]);_0x1bb099[_0xe4d6('0x1e')]=qs[_0xe4d6('0x1e')](_0x3e6142[_0xe4d6('0x32')][_0xe4d6('0x1e')]);}return _0xd4bf7c[_0xe4d6('0x60')](_0x1bb099);}})['then'](function(_0x293c7d){if(_0x293c7d){return _0x293c7d?{'count':_0x5cd884,'rows':_0x293c7d}:null;}})[_0xe4d6('0x25')](respondWithResult(_0x21d29c,null))[_0xe4d6('0x45')](handleError(_0x21d29c,null));};exports[_0xe4d6('0x62')]=function(_0x1e6f6f,_0x2d96b8,_0x5173fb){var _0xd5aa28,_0x20b128;var _0x1305d7=[];var _0x4362c4=moment()[_0xe4d6('0x63')](_0xe4d6('0x64'));return db[_0xe4d6('0x2e')][_0xe4d6('0x48')]({'where':{'id':_0x1e6f6f[_0xe4d6('0x51')]['id']}})[_0xe4d6('0x25')](handleEntityNotFound(_0x2d96b8,null))['then'](function(_0x29ab0a){if(_0x29ab0a){_0x20b128=_0x29ab0a;return _0x29ab0a[_0xe4d6('0x62')](_0x1e6f6f['body'][_0xe4d6('0x65')],_[_0xe4d6('0x52')](_0x1e6f6f[_0xe4d6('0x4a')],[_0xe4d6('0x65'),'id'])||{});}return null;})[_0xe4d6('0x66')](function(_0x3d71cc){var _0x2e8fed;var _0x1af54e;_0xd5aa28=_0x3d71cc||[];var _0x139151=[];if(_0x3d71cc){for(var _0x5ec548=0x0;_0x5ec548<_0x3d71cc[_0xe4d6('0x36')];_0x5ec548+=0x1){var _0x2817d5=_0x3d71cc[_0x5ec548][_0xe4d6('0x27')]({'plain':!![]});_0x20b128['dialCheckDuplicateType']=_0x1e6f6f[_0xe4d6('0x4a')]['dialCheckDuplicateType']?_0x1e6f6f['body'][_0xe4d6('0x67')]:_0x20b128[_0xe4d6('0x67')];switch(_0x20b128['dialCheckDuplicateType']){case _0xe4d6('0x68'):_0x2e8fed=squel[_0xe4d6('0x69')]()[_0xe4d6('0x6a')](_0xe4d6('0x6b'))['fromQuery']([_0xe4d6('0x6c'),'scheduledAt','ContactId','ListId',_0xe4d6('0x5c'),'createdAt',_0xe4d6('0x54')],squel['select']()['field'](_0xe4d6('0x6c'),_0xe4d6('0x6c'))[_0xe4d6('0x6d')](_0xe4d6('0x6e'),_0xe4d6('0x6f'))[_0xe4d6('0x6d')]('id',_0xe4d6('0x70'))[_0xe4d6('0x6d')](_0x2817d5[_0xe4d6('0x71')][_0xe4d6('0x72')](),_0xe4d6('0x73'))[_0xe4d6('0x6d')](_0x1e6f6f['params']['id'][_0xe4d6('0x72')](),'CampaignId')[_0xe4d6('0x6d')]('\x27'+_0x4362c4+'\x27',_0xe4d6('0x53'))['field']('\x27'+_0x4362c4+'\x27',_0xe4d6('0x54'))[_0xe4d6('0x74')](_0xe4d6('0x75'))[_0xe4d6('0x3b')](_0xe4d6('0x76'))['where'](_0xe4d6('0x77'),_0x2817d5['CmListId'][_0xe4d6('0x72')]())['where'](_0xe4d6('0x78'))[_0xe4d6('0x3b')](_0xe4d6('0x79'),squel[_0xe4d6('0x7a')]()[_0xe4d6('0x6d')](_0xe4d6('0x7b'))[_0xe4d6('0x74')]('cm_hopper_final')[_0xe4d6('0x3b')](_0xe4d6('0x7c'),_0x1e6f6f[_0xe4d6('0x51')]['id']['toString']()))['where'](_0xe4d6('0x79'),squel[_0xe4d6('0x7a')]()[_0xe4d6('0x6d')]('COALESCE(phone,\x27\x27)')[_0xe4d6('0x74')](_0xe4d6('0x6b'))['where'](_0xe4d6('0x7c'),_0x1e6f6f[_0xe4d6('0x51')]['id'][_0xe4d6('0x72')]())))[_0xe4d6('0x72')]();break;case _0xe4d6('0x7d'):_0x2e8fed=squel[_0xe4d6('0x69')]()['into'](_0xe4d6('0x6b'))['fromQuery']([_0xe4d6('0x6c'),_0xe4d6('0x6f'),_0xe4d6('0x70'),_0xe4d6('0x73'),'CampaignId','createdAt',_0xe4d6('0x54')],squel['select']()[_0xe4d6('0x6d')](_0xe4d6('0x6c'),_0xe4d6('0x6c'))[_0xe4d6('0x6d')](_0xe4d6('0x6e'),_0xe4d6('0x6f'))[_0xe4d6('0x6d')]('id',_0xe4d6('0x70'))['field'](_0x2817d5['CmListId'][_0xe4d6('0x72')](),_0xe4d6('0x73'))[_0xe4d6('0x6d')](_0x1e6f6f[_0xe4d6('0x51')]['id'][_0xe4d6('0x72')](),_0xe4d6('0x5c'))['field']('\x27'+_0x4362c4+'\x27',_0xe4d6('0x53'))[_0xe4d6('0x6d')]('\x27'+_0x4362c4+'\x27',_0xe4d6('0x54'))[_0xe4d6('0x74')](_0xe4d6('0x75'))[_0xe4d6('0x3b')](_0xe4d6('0x76'))[_0xe4d6('0x3b')](_0xe4d6('0x77'),_0x2817d5[_0xe4d6('0x71')]['toString']())['where'](_0xe4d6('0x78'))[_0xe4d6('0x3b')](_0xe4d6('0x79'),squel[_0xe4d6('0x7a')]()[_0xe4d6('0x6d')]('COALESCE(phone,\x27\x27)')[_0xe4d6('0x74')]('cm_hopper')[_0xe4d6('0x3b')](_0xe4d6('0x7c'),_0x1e6f6f['params']['id'][_0xe4d6('0x72')]())))[_0xe4d6('0x72')]();break;default:_0x2e8fed=squel[_0xe4d6('0x69')]()[_0xe4d6('0x6a')]('cm_hopper')[_0xe4d6('0x7e')](['phone','scheduledAt','ContactId',_0xe4d6('0x73'),_0xe4d6('0x5c'),_0xe4d6('0x53'),'updatedAt'],squel[_0xe4d6('0x7a')]()[_0xe4d6('0x6d')](_0xe4d6('0x6c'),'phone')['field']('NOW()',_0xe4d6('0x6f'))[_0xe4d6('0x6d')]('id',_0xe4d6('0x70'))[_0xe4d6('0x6d')](_0x2817d5['CmListId'][_0xe4d6('0x72')](),'ListId')[_0xe4d6('0x6d')](_0x1e6f6f[_0xe4d6('0x51')]['id']['toString'](),_0xe4d6('0x5c'))[_0xe4d6('0x6d')]('\x27'+_0x4362c4+'\x27',_0xe4d6('0x53'))[_0xe4d6('0x6d')]('\x27'+_0x4362c4+'\x27',_0xe4d6('0x54'))[_0xe4d6('0x74')](_0xe4d6('0x75'))[_0xe4d6('0x3b')](_0xe4d6('0x76'))[_0xe4d6('0x3b')](_0xe4d6('0x77'),_0x2817d5[_0xe4d6('0x71')]['toString']())[_0xe4d6('0x3b')](_0xe4d6('0x78')))[_0xe4d6('0x72')]();}_0x1af54e=squel[_0xe4d6('0x69')]()['into']('cm_hopper_additional_phones')[_0xe4d6('0x7e')]([_0xe4d6('0x7f'),_0xe4d6('0x6f'),'phone','OrderBy',_0xe4d6('0x53'),'updatedAt'],squel[_0xe4d6('0x7a')]()[_0xe4d6('0x6d')](_0xe4d6('0x80'),'id')[_0xe4d6('0x6d')](_0xe4d6('0x6e'),'scheduledAt')['field'](_0xe4d6('0x81'),'phone')[_0xe4d6('0x6d')]('ci.OrderBY',_0xe4d6('0x82'))[_0xe4d6('0x6d')]('\x27'+_0x4362c4+'\x27','createdAt')[_0xe4d6('0x6d')]('\x27'+_0x4362c4+'\x27','updatedAt')[_0xe4d6('0x74')](_0xe4d6('0x83'),'ci')[_0xe4d6('0x84')](_0xe4d6('0x6b'),'h',_0xe4d6('0x85'))['where']('h.ListId\x20=\x20?',_0x2817d5[_0xe4d6('0x71')][_0xe4d6('0x72')]())[_0xe4d6('0x3b')](_0xe4d6('0x86'),_0x1e6f6f[_0xe4d6('0x51')]['id'][_0xe4d6('0x72')]())[_0xe4d6('0x3b')]('h.createdAt\x20=\x20?',_0x4362c4))[_0xe4d6('0x72')]();_0x139151[_0xe4d6('0x87')](db['sequelize'][_0xe4d6('0x32')](_0x2e8fed));_0x1305d7[_0xe4d6('0x87')](db['sequelize']['query'](_0x1af54e));}return BPromise[_0xe4d6('0x88')](_0x139151);}})['then'](function(){return BPromise[_0xe4d6('0x88')](_0x1305d7);})['then'](function(){return _0xd5aa28;})[_0xe4d6('0x25')](respondWithResult(_0x2d96b8,null))[_0xe4d6('0x45')](handleError(_0x2d96b8,null));};exports[_0xe4d6('0x89')]=function(_0x23635d,_0x4dcaa5,_0x38dd51){return db[_0xe4d6('0x2e')][_0xe4d6('0x48')]({'where':{'id':_0x23635d[_0xe4d6('0x51')]['id']}})['then'](handleEntityNotFound(_0x4dcaa5,null))['then'](function(_0x3b597e){if(_0x3b597e){return _0x3b597e[_0xe4d6('0x89')](_0x23635d[_0xe4d6('0x32')][_0xe4d6('0x65')]);}})[_0xe4d6('0x25')](function(_0x5f08ab){if(_0x5f08ab){return db[_0xe4d6('0x59')][_0xe4d6('0x26')]({'where':{'ListId':_0x23635d[_0xe4d6('0x32')][_0xe4d6('0x65')],'CampaignId':_0x23635d['params']['id']}})[_0xe4d6('0x25')](function(){return _0x5f08ab;});}})[_0xe4d6('0x25')](respondWithStatusCode(_0x4dcaa5,null))[_0xe4d6('0x45')](handleError(_0x4dcaa5,null));};exports['getBlackLists']=function(_0x5b354f,_0x40ac96,_0x2bd510){var _0x3cadb9={};var _0x38e0ff={};var _0x3984ed;var _0x286fd6;return db[_0xe4d6('0x2e')]['findOne']({'where':{'id':_0x5b354f[_0xe4d6('0x51')]['id']}})[_0xe4d6('0x25')](handleEntityNotFound(_0x40ac96,null))['then'](function(_0x430212){if(_0x430212){_0x3984ed=_0x430212;_0x38e0ff[_0xe4d6('0x31')]=_[_0xe4d6('0x47')](db[_0xe4d6('0x61')][_0xe4d6('0x2f')]);_0x38e0ff[_0xe4d6('0x32')]=_['keys'](_0x5b354f[_0xe4d6('0x32')]);_0x38e0ff[_0xe4d6('0x3c')]=_[_0xe4d6('0x33')](_0x38e0ff['model'],_0x38e0ff[_0xe4d6('0x32')]);_0x3cadb9['attributes']=_[_0xe4d6('0x33')](_0x38e0ff['model'],qs[_0xe4d6('0x34')](_0x5b354f['query']['fields']));_0x3cadb9[_0xe4d6('0x35')]=_0x3cadb9[_0xe4d6('0x35')]['length']?_0x3cadb9[_0xe4d6('0x35')]:_0x38e0ff['model'];_0x3cadb9[_0xe4d6('0x39')]=qs[_0xe4d6('0x3a')](_0x5b354f[_0xe4d6('0x32')]['sort']);_0x3cadb9[_0xe4d6('0x3b')]=qs[_0xe4d6('0x3c')](_[_0xe4d6('0x3d')](_0x5b354f[_0xe4d6('0x32')],_0x38e0ff[_0xe4d6('0x3c')]));if(_0x5b354f[_0xe4d6('0x32')][_0xe4d6('0x40')]){_0x3cadb9['where']=_[_0xe4d6('0x3e')](_0x3cadb9[_0xe4d6('0x3b')],{'$or':_['map'](_0x3cadb9[_0xe4d6('0x35')],function(_0x3cbeb4){var _0x3a5040={};_0x3a5040[_0x3cbeb4]={'$like':'%'+_0x5b354f[_0xe4d6('0x32')][_0xe4d6('0x40')]+'%'};return _0x3a5040;})});}_0x3cadb9=_['merge']({},_0x3cadb9,_0x5b354f[_0xe4d6('0x41')]);return _0x3984ed[_0xe4d6('0x8a')](_0x3cadb9);}})[_0xe4d6('0x25')](function(_0x3c9a1a){if(_0x3c9a1a){_0x286fd6=_0x3c9a1a['length'];if(!_0x5b354f[_0xe4d6('0x32')][_0xe4d6('0x37')](_0xe4d6('0x38'))){_0x3cadb9[_0xe4d6('0x1f')]=qs[_0xe4d6('0x1f')](_0x5b354f[_0xe4d6('0x32')][_0xe4d6('0x1f')]);_0x3cadb9['offset']=qs[_0xe4d6('0x1e')](_0x5b354f['query']['offset']);}return _0x3984ed[_0xe4d6('0x8a')](_0x3cadb9);}})[_0xe4d6('0x25')](function(_0x3f1007){if(_0x3f1007){return _0x3f1007?{'count':_0x286fd6,'rows':_0x3f1007}:null;}})[_0xe4d6('0x25')](respondWithResult(_0x40ac96,null))[_0xe4d6('0x45')](handleError(_0x40ac96,null));};exports[_0xe4d6('0x8b')]=function(_0x328516,_0x4c4774,_0x47c6f2){var _0x5ad555,_0x1e4cae;var _0x490bf0=[];var _0x5a1ac6=moment()[_0xe4d6('0x63')](_0xe4d6('0x64'));return db[_0xe4d6('0x2e')][_0xe4d6('0x48')]({'where':{'id':_0x328516[_0xe4d6('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c4774,null))[_0xe4d6('0x25')](function(_0x54562f){if(_0x54562f){_0x1e4cae=_0x54562f;return _0x54562f[_0xe4d6('0x8b')](_0x328516[_0xe4d6('0x4a')]['ids'],_[_0xe4d6('0x52')](_0x328516[_0xe4d6('0x4a')],['ids','id'])||{});}return null;})[_0xe4d6('0x66')](function(_0x5e268b){var _0x3b1cb7;var _0x5beeed;_0x5ad555=_0x5e268b||[];var _0x150db3=[];if(_0x5e268b){for(var _0x8ecf96=0x0;_0x8ecf96<_0x5e268b[_0xe4d6('0x36')];_0x8ecf96+=0x1){var _0x3c3542=_0x5e268b[_0x8ecf96][_0xe4d6('0x27')]({'plain':!![]});_0x3b1cb7=squel['insert']()[_0xe4d6('0x6a')](_0xe4d6('0x8c'))['fromQuery'](['phone',_0xe4d6('0x70'),_0xe4d6('0x73'),_0xe4d6('0x5c'),'createdAt','updatedAt'],squel['select']()['field'](_0xe4d6('0x6c'),'phone')[_0xe4d6('0x6d')]('id','ContactId')[_0xe4d6('0x6d')](_0x3c3542['CmListId'][_0xe4d6('0x72')](),_0xe4d6('0x73'))['field'](_0x328516[_0xe4d6('0x51')]['id']['toString'](),'CampaignId')['field'](_0xe4d6('0x6e'),_0xe4d6('0x53'))[_0xe4d6('0x6d')]('NOW()','updatedAt')[_0xe4d6('0x74')](_0xe4d6('0x75'))[_0xe4d6('0x3b')](_0xe4d6('0x76'))[_0xe4d6('0x3b')](_0xe4d6('0x77'),_0x3c3542[_0xe4d6('0x71')][_0xe4d6('0x72')]())[_0xe4d6('0x3b')](_0xe4d6('0x78')))['toString']();_0x150db3[_0xe4d6('0x87')](db[_0xe4d6('0x8d')]['query'](_0x3b1cb7));}return BPromise['all'](_0x150db3);}})[_0xe4d6('0x25')](function(){return _0x5ad555;})[_0xe4d6('0x25')](respondWithResult(_0x4c4774,null))[_0xe4d6('0x45')](handleError(_0x4c4774,null));};exports[_0xe4d6('0x8e')]=function(_0x293c99,_0x56cd8c,_0x49ebda){return db[_0xe4d6('0x2e')][_0xe4d6('0x48')]({'where':{'id':_0x293c99['params']['id']}})['then'](handleEntityNotFound(_0x56cd8c,null))[_0xe4d6('0x25')](function(_0x48cb50){if(_0x48cb50){return _0x48cb50[_0xe4d6('0x8e')](_0x293c99[_0xe4d6('0x32')][_0xe4d6('0x65')]);}})[_0xe4d6('0x25')](function(_0x3f510d){if(_0x3f510d){return db[_0xe4d6('0x5f')][_0xe4d6('0x26')]({'where':{'ListId':_0x293c99['query']['ids'],'CampaignId':_0x293c99['params']['id']}})['then'](function(){return _0x3f510d;});}})[_0xe4d6('0x25')](respondWithStatusCode(_0x56cd8c,null))[_0xe4d6('0x45')](handleError(_0x56cd8c,null));};
\ No newline at end of file
+var _0x351d=['format','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','limit','count','offset','apply','reject','save','update','destroy','then','get','IvrCampaigns','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','find','omit','createdAt','updatedAt','role','user','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','select','field','NOW()','scheduledAt','ContactId','CmListId','ListId','toString','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x351d,0x90));var _0xd351=function(_0x21b21d,_0xf168b7){_0x21b21d=_0x21b21d-0x0;var _0xbd69e9=_0x351d[_0x21b21d];return _0xbd69e9;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb40c,_0x15549a){_0x15549a=_0x15549a||0xcc;return function(_0x23445f){if(_0x23445f){return _0x3eb40c[_0xd351('0x13')](_0x15549a);}return _0x3eb40c['status'](_0x15549a)[_0xd351('0x14')]();};}function respondWithResult(_0x316cf6,_0x597d7c){_0x597d7c=_0x597d7c||0xc8;return function(_0xc5a145){if(_0xc5a145){return _0x316cf6[_0xd351('0x15')](_0x597d7c)[_0xd351('0x16')](_0xc5a145);}};}function respondWithFilteredResult(_0xf1c285,_0x3867fb){return function(_0x4d238c){if(_0x4d238c){var _0x9f790f=typeof _0x3867fb['offset']==='undefined'&&typeof _0x3867fb[_0xd351('0x17')]==='undefined';var _0x21e591=_0x4d238c[_0xd351('0x18')];var _0x4e0164=_0x9f790f?0x0:_0x3867fb['offset'];var _0x1e1a3c=_0x9f790f?_0x4d238c[_0xd351('0x18')]:_0x3867fb[_0xd351('0x19')]+_0x3867fb[_0xd351('0x17')];var _0x51f265;if(_0x1e1a3c>=_0x21e591){_0x1e1a3c=_0x21e591;_0x51f265=0xc8;}else{_0x51f265=0xce;}_0xf1c285[_0xd351('0x15')](_0x51f265);return _0xf1c285['set']('Content-Range',_0x4e0164+'-'+_0x1e1a3c+'/'+_0x21e591)[_0xd351('0x16')](_0x4d238c);}return null;};}function patchUpdates(_0x4a427b){return function(_0x33b1e5){try{jsonpatch[_0xd351('0x1a')](_0x33b1e5,_0x4a427b,!![]);}catch(_0x3634c9){return BPromise[_0xd351('0x1b')](_0x3634c9);}return _0x33b1e5[_0xd351('0x1c')]();};}function saveUpdates(_0x53e729,_0x18625b){return function(_0xbbc58){if(_0xbbc58){return _0xbbc58[_0xd351('0x1d')](_0x53e729)['then'](function(_0x1ce7f7){return _0x1ce7f7;});}return null;};}function removeEntity(_0x2d9aa0,_0x365bbc){return function(_0x59fb6d){if(_0x59fb6d){return _0x59fb6d[_0xd351('0x1e')]()[_0xd351('0x1f')](function(){var _0x4626c4=_0x59fb6d[_0xd351('0x20')]({'plain':!![]});var _0x489c9a=_0xd351('0x21');return db['UserProfileResource'][_0xd351('0x1e')]({'where':{'type':_0x489c9a,'resourceId':_0x4626c4['id']}})[_0xd351('0x1f')](function(){return _0x59fb6d;});})['then'](function(){_0x2d9aa0[_0xd351('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d67e,_0x1d0cb1){return function(_0x560be9){if(!_0x560be9){_0x50d67e['sendStatus'](0x194);}return _0x560be9;};}function handleError(_0x134580,_0x555a50){_0x555a50=_0x555a50||0x1f4;return function(_0x38471c){logger[_0xd351('0x22')](_0x38471c[_0xd351('0x23')]);if(_0x38471c['name']){delete _0x38471c[_0xd351('0x24')];}_0x134580['status'](_0x555a50)[_0xd351('0x25')](_0x38471c);};}exports['index']=function(_0x5f07b1,_0xeb4da9){var _0x38c82f={},_0x3f9ef3={},_0x33b43d={'count':0x0,'rows':[]};var _0x48aa96=_[_0xd351('0x26')](db[_0xd351('0x27')][_0xd351('0x28')],function(_0x41da60){return{'name':_0x41da60[_0xd351('0x29')],'type':_0x41da60[_0xd351('0x2a')][_0xd351('0x2b')]};});_0x3f9ef3[_0xd351('0x2c')]=_[_0xd351('0x26')](_0x48aa96,'name');_0x3f9ef3[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x5f07b1[_0xd351('0x2d')]);_0x3f9ef3[_0xd351('0x2f')]=_['intersection'](_0x3f9ef3[_0xd351('0x2c')],_0x3f9ef3[_0xd351('0x2d')]);_0x38c82f[_0xd351('0x30')]=_[_0xd351('0x31')](_0x3f9ef3[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x32')]));_0x38c82f[_0xd351('0x30')]=_0x38c82f['attributes']['length']?_0x38c82f[_0xd351('0x30')]:_0x3f9ef3[_0xd351('0x2c')];if(!_0x5f07b1[_0xd351('0x2d')][_0xd351('0x33')](_0xd351('0x34'))){_0x38c82f[_0xd351('0x17')]=qs['limit'](_0x5f07b1['query'][_0xd351('0x17')]);_0x38c82f['offset']=qs[_0xd351('0x19')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x19')]);}_0x38c82f[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x36')]);_0x38c82f[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x5f07b1[_0xd351('0x2d')],_0x3f9ef3['filters']),_0x48aa96);if(_0x5f07b1[_0xd351('0x2d')]['filter']){_0x38c82f[_0xd351('0x37')]=_[_0xd351('0x39')](_0x38c82f[_0xd351('0x37')],{'$or':_[_0xd351('0x26')](_0x48aa96,function(_0x3b42e7){if(_0x3b42e7[_0xd351('0x2a')]!=='VIRTUAL'){var _0x3ad98e={};_0x3ad98e[_0x3b42e7[_0xd351('0x24')]]={'$like':'%'+_0x5f07b1['query'][_0xd351('0x3a')]+'%'};return _0x3ad98e;}})});}_0x38c82f=_[_0xd351('0x39')]({},_0x38c82f,_0x5f07b1[_0xd351('0x3b')]);var _0x1fc216={'where':_0x38c82f[_0xd351('0x37')]};return db['Campaign']['count'](_0x1fc216)[_0xd351('0x1f')](function(_0x3935aa){_0x33b43d['count']=_0x3935aa;if(_0x5f07b1['query'][_0xd351('0x3c')]){_0x38c82f[_0xd351('0x3d')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x38c82f);})[_0xd351('0x1f')](function(_0x18f9d1){_0x33b43d[_0xd351('0x3e')]=_0x18f9d1;return _0x33b43d;})[_0xd351('0x1f')](respondWithFilteredResult(_0xeb4da9,_0x38c82f))[_0xd351('0x3f')](handleError(_0xeb4da9,null));};exports[_0xd351('0x40')]=function(_0x6192c3,_0x110458){var _0x129605={'raw':![],'where':{'id':_0x6192c3['params']['id']}},_0x553360={};_0x553360[_0xd351('0x2c')]=_[_0xd351('0x2e')](db[_0xd351('0x27')][_0xd351('0x28')]);_0x553360[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x6192c3[_0xd351('0x2d')]);_0x553360[_0xd351('0x2f')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],_0x553360[_0xd351('0x2d')]);_0x129605[_0xd351('0x30')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x6192c3[_0xd351('0x2d')]['fields']));_0x129605[_0xd351('0x30')]=_0x129605[_0xd351('0x30')][_0xd351('0x41')]?_0x129605['attributes']:_0x553360[_0xd351('0x2c')];if(_0x6192c3[_0xd351('0x2d')][_0xd351('0x3c')]){_0x129605[_0xd351('0x3d')]=[{'all':!![]}];}_0x129605=_[_0xd351('0x39')]({},_0x129605,_0x6192c3['options']);return db[_0xd351('0x27')]['find'](_0x129605)[_0xd351('0x1f')](handleEntityNotFound(_0x110458,null))[_0xd351('0x1f')](respondWithResult(_0x110458,null))['catch'](handleError(_0x110458,null));};exports['create']=function(_0x1bd727,_0x444206){return db[_0xd351('0x27')]['create'](_0x1bd727[_0xd351('0x42')],{})[_0xd351('0x1f')](function(_0x548d90){var _0xf3ce5=_0x1bd727['user'][_0xd351('0x20')]({'plain':!![]});if(!_0xf3ce5)throw new Error(_0xd351('0x43'));if(_0xf3ce5['role']==='user'){var _0x25ea1e=_0x548d90['get']({'plain':!![]});var _0xf9f375=_0xd351('0x21');return db[_0xd351('0x44')]['find']({'where':{'name':_0xf9f375,'userProfileId':_0xf3ce5[_0xd351('0x45')]},'raw':!![]})['then'](function(_0x5527da){if(_0x5527da&&_0x5527da['autoAssociation']===0x0){return db[_0xd351('0x46')][_0xd351('0x47')]({'name':_0x25ea1e[_0xd351('0x24')],'resourceId':_0x25ea1e['id'],'type':_0x5527da['name'],'sectionId':_0x5527da['id']},{})['then'](function(){return _0x548d90;});}else{return _0x548d90;}})[_0xd351('0x3f')](function(_0x42f248){logger['error'](_0xd351('0x48'),_0x42f248);throw _0x42f248;});}return _0x548d90;})[_0xd351('0x1f')](respondWithResult(_0x444206,0xc9))['catch'](handleError(_0x444206,null));};exports[_0xd351('0x49')]=function(_0x59ab0f,_0x22394e){var _0x4d554f={'where':{'id':_0x59ab0f[_0xd351('0x4a')]['id']}},_0x6f0446={};_0x6f0446[_0xd351('0x2c')]=_[_0xd351('0x2e')](db[_0xd351('0x27')][_0xd351('0x28')]);_0x4d554f[_0xd351('0x30')]=_['intersection'](_0x6f0446['model'],qs[_0xd351('0x32')](_0x59ab0f[_0xd351('0x2d')]['fields']));_0x4d554f[_0xd351('0x30')]=_0x4d554f[_0xd351('0x30')][_0xd351('0x41')]?_0x4d554f['attributes']:_0x6f0446[_0xd351('0x2c')];if(_0x59ab0f['query']['includeAll']){_0x4d554f[_0xd351('0x3d')]=[{'all':!![]}];}_0x4d554f=_[_0xd351('0x39')]({},_0x4d554f,_0x59ab0f['options']);return db[_0xd351('0x27')][_0xd351('0x4b')](_0x4d554f)[_0xd351('0x1f')](handleEntityNotFound(_0x22394e,null))[_0xd351('0x1f')](function(_0x21d096){if(_0x21d096){var _0x2dc745=_0x21d096['get']({'plain':!![]});_0x2dc745=qs[_0xd351('0x4c')](_0x2dc745,['id',_0xd351('0x4d'),_0xd351('0x4e')]);_0x59ab0f[_0xd351('0x42')]=_[_0xd351('0x4c')](_0x59ab0f[_0xd351('0x42')],['id',_0xd351('0x4d'),'updatedAt']);return db[_0xd351('0x27')]['create'](_[_0xd351('0x39')](_0x2dc745,_0x59ab0f[_0xd351('0x42')]),{'include':_0x59ab0f[_0xd351('0x2d')][_0xd351('0x3c')]?[{'all':!![]}]:undefined})[_0xd351('0x1f')](function(_0x4eaf18){var _0x413931=_0x59ab0f['user'][_0xd351('0x20')]({'plain':!![]});if(!_0x413931)throw new Error(_0xd351('0x43'));if(_0x413931[_0xd351('0x4f')]===_0xd351('0x50')){var _0x4097ca=_0x4eaf18['get']({'plain':!![]});var _0x5f43a9=_0xd351('0x21');return db[_0xd351('0x44')]['find']({'where':{'name':_0x5f43a9,'userProfileId':_0x413931[_0xd351('0x45')]},'raw':!![]})[_0xd351('0x1f')](function(_0x2718e9){if(_0x2718e9&&_0x2718e9['autoAssociation']===0x0){return db[_0xd351('0x46')][_0xd351('0x47')]({'name':_0x4097ca[_0xd351('0x24')],'resourceId':_0x4097ca['id'],'type':_0x2718e9[_0xd351('0x24')],'sectionId':_0x2718e9['id']},{})['then'](function(){return _0x4eaf18;});}else{return _0x4eaf18;}})['catch'](function(_0x40c78b){logger[_0xd351('0x22')](_0xd351('0x48'),_0x40c78b);throw _0x40c78b;});}return _0x4eaf18;});}})[_0xd351('0x1f')](respondWithResult(_0x22394e,0xc9))[_0xd351('0x3f')](handleError(_0x22394e,null));};exports[_0xd351('0x1d')]=function(_0x2c83fe,_0x5e2e06){if(_0x2c83fe[_0xd351('0x42')]['id']){delete _0x2c83fe['body']['id'];}return db['Campaign'][_0xd351('0x4b')]({'where':{'id':_0x2c83fe[_0xd351('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5e2e06,null))[_0xd351('0x1f')](saveUpdates(_0x2c83fe['body'],null))['then'](respondWithResult(_0x5e2e06,null))['catch'](handleError(_0x5e2e06,null));};exports[_0xd351('0x1e')]=function(_0x33a381,_0x1d22bc){return db['Campaign'][_0xd351('0x4b')]({'where':{'id':_0x33a381[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x1d22bc,null))[_0xd351('0x1f')](removeEntity(_0x1d22bc,null))[_0xd351('0x3f')](handleError(_0x1d22bc,null));};exports[_0xd351('0x51')]=function(_0x15fcab,_0x6bf19c,_0x130617){var _0x22672={'raw':!![],'where':{}};var _0x18c261={};var _0x4d20af={'count':0x0,'rows':[]};return db[_0xd351('0x27')][_0xd351('0x52')]({'where':{'id':_0x15fcab[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x6bf19c,null))[_0xd351('0x1f')](function(_0x17d061){if(_0x17d061){_0x18c261['model']=_[_0xd351('0x2e')](db[_0xd351('0x53')]['rawAttributes']);_0x18c261['query']=_[_0xd351('0x2e')](_0x15fcab[_0xd351('0x2d')]);_0x18c261[_0xd351('0x2f')]=_[_0xd351('0x31')](_0x18c261[_0xd351('0x2c')],_0x18c261[_0xd351('0x2d')]);_0x22672[_0xd351('0x30')]=_[_0xd351('0x31')](_0x18c261[_0xd351('0x2c')],qs['fields'](_0x15fcab[_0xd351('0x2d')][_0xd351('0x32')]));_0x22672['attributes']=_0x22672[_0xd351('0x30')]['length']?_0x22672[_0xd351('0x30')]:_0x18c261['model'];if(!_0x15fcab[_0xd351('0x2d')][_0xd351('0x33')](_0xd351('0x34'))){_0x22672[_0xd351('0x17')]=qs[_0xd351('0x17')](_0x15fcab[_0xd351('0x2d')][_0xd351('0x17')]);_0x22672['offset']=qs[_0xd351('0x19')](_0x15fcab[_0xd351('0x2d')][_0xd351('0x19')]);}_0x22672[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x15fcab['query'][_0xd351('0x36')]);_0x22672[_0xd351('0x37')]=qs[_0xd351('0x2f')](_['pick'](_0x15fcab[_0xd351('0x2d')],_0x18c261[_0xd351('0x2f')]));_0x22672[_0xd351('0x37')][_0xd351('0x54')]=_0x17d061['id'];if(_0x15fcab[_0xd351('0x2d')][_0xd351('0x3a')]){_0x22672[_0xd351('0x37')]=_[_0xd351('0x39')](_0x22672[_0xd351('0x37')],{'$or':_['map'](_0x22672[_0xd351('0x30')],function(_0x190a00){var _0x5036e6={};_0x5036e6[_0x190a00]={'$like':'%'+_0x15fcab[_0xd351('0x2d')]['filter']+'%'};return _0x5036e6;})});}_0x22672=_['merge']({},_0x22672,_0x15fcab['options']);return db[_0xd351('0x53')][_0xd351('0x18')]({'where':_0x22672[_0xd351('0x37')]})['then'](function(_0x8f05e7){_0x4d20af['count']=_0x8f05e7;if(_0x15fcab[_0xd351('0x2d')]['includeAll']){_0x22672[_0xd351('0x3d')]=[{'all':!![]}];}return db[_0xd351('0x53')][_0xd351('0x55')](_0x22672);})[_0xd351('0x1f')](function(_0x35b148){_0x4d20af[_0xd351('0x3e')]=_0x35b148;return _0x4d20af;});}})[_0xd351('0x1f')](respondWithFilteredResult(_0x6bf19c,_0x22672))[_0xd351('0x3f')](handleError(_0x6bf19c,null));};exports[_0xd351('0x56')]=function(_0x2e0e2,_0x2fa076,_0x25694a){var _0x5ac63c={'raw':!![],'where':{}};var _0x46f6a7={};var _0xf8befd={'count':0x0,'rows':[]};return db[_0xd351('0x27')][_0xd351('0x52')]({'where':{'id':_0x2e0e2[_0xd351('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fa076,null))[_0xd351('0x1f')](function(_0x1e6c85){if(_0x1e6c85){_0x46f6a7[_0xd351('0x2c')]=_[_0xd351('0x2e')](db['CmHopperHistory'][_0xd351('0x28')]);_0x46f6a7[_0xd351('0x2d')]=_['keys'](_0x2e0e2[_0xd351('0x2d')]);_0x46f6a7[_0xd351('0x2f')]=_[_0xd351('0x31')](_0x46f6a7[_0xd351('0x2c')],_0x46f6a7['query']);_0x5ac63c['attributes']=_[_0xd351('0x31')](_0x46f6a7[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x2e0e2[_0xd351('0x2d')]['fields']));_0x5ac63c[_0xd351('0x30')]=_0x5ac63c[_0xd351('0x30')][_0xd351('0x41')]?_0x5ac63c[_0xd351('0x30')]:_0x46f6a7[_0xd351('0x2c')];if(!_0x2e0e2['query'][_0xd351('0x33')](_0xd351('0x34'))){_0x5ac63c['limit']=qs[_0xd351('0x17')](_0x2e0e2[_0xd351('0x2d')]['limit']);_0x5ac63c[_0xd351('0x19')]=qs['offset'](_0x2e0e2[_0xd351('0x2d')]['offset']);}_0x5ac63c[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x2e0e2[_0xd351('0x2d')][_0xd351('0x36')]);_0x5ac63c[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x2e0e2[_0xd351('0x2d')],_0x46f6a7[_0xd351('0x2f')]));_0x5ac63c['where'][_0xd351('0x54')]=_0x1e6c85['id'];if(_0x2e0e2[_0xd351('0x2d')][_0xd351('0x3a')]){_0x5ac63c[_0xd351('0x37')]=_[_0xd351('0x39')](_0x5ac63c[_0xd351('0x37')],{'$or':_[_0xd351('0x26')](_0x5ac63c[_0xd351('0x30')],function(_0x56458b){var _0x3b8f86={};_0x3b8f86[_0x56458b]={'$like':'%'+_0x2e0e2['query'][_0xd351('0x3a')]+'%'};return _0x3b8f86;})});}_0x5ac63c=_[_0xd351('0x39')]({},_0x5ac63c,_0x2e0e2[_0xd351('0x3b')]);return db[_0xd351('0x57')][_0xd351('0x18')]({'where':_0x5ac63c['where']})[_0xd351('0x1f')](function(_0x1a95ee){_0xf8befd[_0xd351('0x18')]=_0x1a95ee;if(_0x2e0e2[_0xd351('0x2d')][_0xd351('0x3c')]){_0x5ac63c[_0xd351('0x3d')]=[{'all':!![]}];}return db[_0xd351('0x57')][_0xd351('0x55')](_0x5ac63c);})[_0xd351('0x1f')](function(_0x5e439){_0xf8befd[_0xd351('0x3e')]=_0x5e439;return _0xf8befd;});}})[_0xd351('0x1f')](respondWithFilteredResult(_0x2fa076,_0x5ac63c))[_0xd351('0x3f')](handleError(_0x2fa076,null));};exports['getHopperFinals']=function(_0x5eaaa7,_0x230719,_0x4becc0){var _0x5c202f={'raw':!![],'where':{}};var _0x426964={};var _0x4557ed={'count':0x0,'rows':[]};return db[_0xd351('0x27')][_0xd351('0x52')]({'where':{'id':_0x5eaaa7['params']['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x230719,null))['then'](function(_0x47ebca){if(_0x47ebca){_0x426964[_0xd351('0x2c')]=_[_0xd351('0x2e')](db[_0xd351('0x58')][_0xd351('0x28')]);_0x426964[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x5eaaa7[_0xd351('0x2d')]);_0x426964['filters']=_[_0xd351('0x31')](_0x426964[_0xd351('0x2c')],_0x426964[_0xd351('0x2d')]);_0x5c202f[_0xd351('0x30')]=_[_0xd351('0x31')](_0x426964[_0xd351('0x2c')],qs['fields'](_0x5eaaa7['query'][_0xd351('0x32')]));_0x5c202f['attributes']=_0x5c202f[_0xd351('0x30')][_0xd351('0x41')]?_0x5c202f['attributes']:_0x426964[_0xd351('0x2c')];if(!_0x5eaaa7[_0xd351('0x2d')][_0xd351('0x33')](_0xd351('0x34'))){_0x5c202f[_0xd351('0x17')]=qs['limit'](_0x5eaaa7[_0xd351('0x2d')]['limit']);_0x5c202f[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x5eaaa7['query'][_0xd351('0x19')]);}_0x5c202f[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x5eaaa7[_0xd351('0x2d')]['sort']);_0x5c202f['where']=qs['filters'](_[_0xd351('0x38')](_0x5eaaa7[_0xd351('0x2d')],_0x426964[_0xd351('0x2f')]));_0x5c202f[_0xd351('0x37')][_0xd351('0x54')]=_0x47ebca['id'];if(_0x5eaaa7[_0xd351('0x2d')][_0xd351('0x3a')]){_0x5c202f['where']=_[_0xd351('0x39')](_0x5c202f['where'],{'$or':_[_0xd351('0x26')](_0x5c202f['attributes'],function(_0x4be59d){var _0x3b4eb6={};_0x3b4eb6[_0x4be59d]={'$like':'%'+_0x5eaaa7['query'][_0xd351('0x3a')]+'%'};return _0x3b4eb6;})});}_0x5c202f=_[_0xd351('0x39')]({},_0x5c202f,_0x5eaaa7[_0xd351('0x3b')]);return db[_0xd351('0x58')][_0xd351('0x18')]({'where':_0x5c202f[_0xd351('0x37')]})['then'](function(_0x4ede59){_0x4557ed[_0xd351('0x18')]=_0x4ede59;if(_0x5eaaa7[_0xd351('0x2d')]['includeAll']){_0x5c202f[_0xd351('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd351('0x55')](_0x5c202f);})[_0xd351('0x1f')](function(_0x6fd03b){_0x4557ed[_0xd351('0x3e')]=_0x6fd03b;return _0x4557ed;});}})[_0xd351('0x1f')](respondWithFilteredResult(_0x230719,_0x5c202f))['catch'](handleError(_0x230719,null));};exports[_0xd351('0x59')]=function(_0x52220d,_0x581e66,_0x1fe4b3){var _0x338c15={'raw':!![],'where':{}};var _0x1f0538={};var _0x4e98ac={'count':0x0,'rows':[]};return db['Campaign'][_0xd351('0x52')]({'where':{'id':_0x52220d[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x581e66,null))[_0xd351('0x1f')](function(_0x1ddacf){if(_0x1ddacf){_0x1f0538['model']=_[_0xd351('0x2e')](db[_0xd351('0x5a')][_0xd351('0x28')]);_0x1f0538[_0xd351('0x2d')]=_['keys'](_0x52220d[_0xd351('0x2d')]);_0x1f0538[_0xd351('0x2f')]=_['intersection'](_0x1f0538[_0xd351('0x2c')],_0x1f0538[_0xd351('0x2d')]);_0x338c15[_0xd351('0x30')]=_[_0xd351('0x31')](_0x1f0538[_0xd351('0x2c')],qs['fields'](_0x52220d[_0xd351('0x2d')][_0xd351('0x32')]));_0x338c15['attributes']=_0x338c15[_0xd351('0x30')]['length']?_0x338c15[_0xd351('0x30')]:_0x1f0538[_0xd351('0x2c')];if(!_0x52220d['query'][_0xd351('0x33')](_0xd351('0x34'))){_0x338c15[_0xd351('0x17')]=qs[_0xd351('0x17')](_0x52220d[_0xd351('0x2d')]['limit']);_0x338c15[_0xd351('0x19')]=qs['offset'](_0x52220d[_0xd351('0x2d')][_0xd351('0x19')]);}_0x338c15[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x52220d[_0xd351('0x2d')][_0xd351('0x36')]);_0x338c15[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x52220d['query'],_0x1f0538[_0xd351('0x2f')]));_0x338c15[_0xd351('0x37')][_0xd351('0x54')]=_0x1ddacf['id'];if(_0x52220d[_0xd351('0x2d')]['filter']){_0x338c15[_0xd351('0x37')]=_['merge'](_0x338c15[_0xd351('0x37')],{'$or':_[_0xd351('0x26')](_0x338c15[_0xd351('0x30')],function(_0x403312){var _0x14703b={};_0x14703b[_0x403312]={'$like':'%'+_0x52220d['query'][_0xd351('0x3a')]+'%'};return _0x14703b;})});}_0x338c15=_[_0xd351('0x39')]({},_0x338c15,_0x52220d['options']);return db['CmHopperBlack'][_0xd351('0x18')]({'where':_0x338c15[_0xd351('0x37')]})[_0xd351('0x1f')](function(_0x3fdf18){_0x4e98ac[_0xd351('0x18')]=_0x3fdf18;if(_0x52220d[_0xd351('0x2d')][_0xd351('0x3c')]){_0x338c15[_0xd351('0x3d')]=[{'all':!![]}];}return db[_0xd351('0x5a')][_0xd351('0x55')](_0x338c15);})[_0xd351('0x1f')](function(_0x6f4c1e){_0x4e98ac[_0xd351('0x3e')]=_0x6f4c1e;return _0x4e98ac;});}})['then'](respondWithFilteredResult(_0x581e66,_0x338c15))['catch'](handleError(_0x581e66,null));};exports[_0xd351('0x5b')]=function(_0x52d5b5,_0x1ca1bd,_0x5c0373){var _0x2c1858={};var _0x18a2cd={};var _0xf1100;var _0x3365ce;return db['Campaign'][_0xd351('0x52')]({'where':{'id':_0x52d5b5[_0xd351('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ca1bd,null))[_0xd351('0x1f')](function(_0x51925a){if(_0x51925a){_0xf1100=_0x51925a;_0x18a2cd['model']=_[_0xd351('0x2e')](db[_0xd351('0x5c')]['rawAttributes']);_0x18a2cd[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x52d5b5['query']);_0x18a2cd[_0xd351('0x2f')]=_[_0xd351('0x31')](_0x18a2cd[_0xd351('0x2c')],_0x18a2cd[_0xd351('0x2d')]);_0x2c1858[_0xd351('0x30')]=_['intersection'](_0x18a2cd[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x52d5b5[_0xd351('0x2d')][_0xd351('0x32')]));_0x2c1858[_0xd351('0x30')]=_0x2c1858[_0xd351('0x30')][_0xd351('0x41')]?_0x2c1858[_0xd351('0x30')]:_0x18a2cd[_0xd351('0x2c')];_0x2c1858[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x52d5b5[_0xd351('0x2d')][_0xd351('0x36')]);_0x2c1858['where']=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x52d5b5[_0xd351('0x2d')],_0x18a2cd[_0xd351('0x2f')]));if(_0x52d5b5[_0xd351('0x2d')][_0xd351('0x3a')]){_0x2c1858[_0xd351('0x37')]=_[_0xd351('0x39')](_0x2c1858[_0xd351('0x37')],{'$or':_[_0xd351('0x26')](_0x2c1858[_0xd351('0x30')],function(_0x9f72e1){var _0x5ef051={};_0x5ef051[_0x9f72e1]={'$like':'%'+_0x52d5b5['query'][_0xd351('0x3a')]+'%'};return _0x5ef051;})});}_0x2c1858=_['merge']({},_0x2c1858,_0x52d5b5['options']);return _0xf1100[_0xd351('0x5b')](_0x2c1858);}})[_0xd351('0x1f')](function(_0x22659f){if(_0x22659f){_0x3365ce=_0x22659f[_0xd351('0x41')];if(!_0x52d5b5['query'][_0xd351('0x33')]('nolimit')){_0x2c1858[_0xd351('0x17')]=qs[_0xd351('0x17')](_0x52d5b5[_0xd351('0x2d')]['limit']);_0x2c1858[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x52d5b5['query']['offset']);}return _0xf1100['getLists'](_0x2c1858);}})[_0xd351('0x1f')](function(_0x45bc42){if(_0x45bc42){return _0x45bc42?{'count':_0x3365ce,'rows':_0x45bc42}:null;}})[_0xd351('0x1f')](respondWithResult(_0x1ca1bd,null))[_0xd351('0x3f')](handleError(_0x1ca1bd,null));};exports[_0xd351('0x5d')]=function(_0x3ce802,_0x2942e0,_0x2f72fb){var _0x575060,_0xea076f;var _0x5f3c4c=[];var _0x2d6e5f=moment()['format'](_0xd351('0x5e'));return db['Campaign'][_0xd351('0x4b')]({'where':{'id':_0x3ce802[_0xd351('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2942e0,null))[_0xd351('0x1f')](function(_0x35ad6d){if(_0x35ad6d){_0xea076f=_0x35ad6d;return _0x35ad6d[_0xd351('0x5d')](_0x3ce802[_0xd351('0x42')][_0xd351('0x5f')],_[_0xd351('0x4c')](_0x3ce802[_0xd351('0x42')],[_0xd351('0x5f'),'id'])||{});}return null;})[_0xd351('0x60')](function(_0x1c0290){var _0x413163;var _0x3425c5;_0x575060=_0x1c0290||[];var _0x2d3695=[];if(_0x1c0290){for(var _0x1e14ec=0x0;_0x1e14ec<_0x1c0290[_0xd351('0x41')];_0x1e14ec+=0x1){var _0x228325=_0x1c0290[_0x1e14ec][_0xd351('0x20')]({'plain':!![]});_0xea076f['dialCheckDuplicateType']=_0x3ce802['body'][_0xd351('0x61')]?_0x3ce802['body'][_0xd351('0x61')]:_0xea076f[_0xd351('0x61')];switch(_0xea076f[_0xd351('0x61')]){case _0xd351('0x62'):_0x413163=squel[_0xd351('0x63')]()[_0xd351('0x64')](_0xd351('0x65'))[_0xd351('0x66')]([_0xd351('0x67'),'scheduledAt','ContactId','ListId','CampaignId',_0xd351('0x4d'),_0xd351('0x4e')],squel[_0xd351('0x68')]()[_0xd351('0x69')](_0xd351('0x67'),_0xd351('0x67'))['field'](_0xd351('0x6a'),_0xd351('0x6b'))[_0xd351('0x69')]('id',_0xd351('0x6c'))['field'](_0x228325[_0xd351('0x6d')]['toString'](),_0xd351('0x6e'))[_0xd351('0x69')](_0x3ce802[_0xd351('0x4a')]['id'][_0xd351('0x6f')](),_0xd351('0x54'))['field']('\x27'+_0x2d6e5f+'\x27',_0xd351('0x4d'))[_0xd351('0x69')]('\x27'+_0x2d6e5f+'\x27',_0xd351('0x4e'))['from']('cm_contacts')[_0xd351('0x37')]('deletedAt\x20IS\x20NULL')['where'](_0xd351('0x70'),_0x228325[_0xd351('0x6d')][_0xd351('0x6f')]())[_0xd351('0x37')](_0xd351('0x71'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xd351('0x69')]('COALESCE(calleridnum,\x27\x27)')[_0xd351('0x72')](_0xd351('0x73'))[_0xd351('0x37')](_0xd351('0x74'),_0x3ce802[_0xd351('0x4a')]['id'][_0xd351('0x6f')]()))[_0xd351('0x37')](_0xd351('0x75'),squel[_0xd351('0x68')]()[_0xd351('0x69')](_0xd351('0x76'))[_0xd351('0x72')](_0xd351('0x65'))[_0xd351('0x37')](_0xd351('0x74'),_0x3ce802[_0xd351('0x4a')]['id']['toString']())))[_0xd351('0x6f')]();break;case _0xd351('0x77'):_0x413163=squel['insert']()[_0xd351('0x64')](_0xd351('0x65'))['fromQuery']([_0xd351('0x67'),_0xd351('0x6b'),_0xd351('0x6c'),_0xd351('0x6e'),_0xd351('0x54'),_0xd351('0x4d'),_0xd351('0x4e')],squel[_0xd351('0x68')]()[_0xd351('0x69')](_0xd351('0x67'),_0xd351('0x67'))[_0xd351('0x69')]('NOW()',_0xd351('0x6b'))[_0xd351('0x69')]('id','ContactId')['field'](_0x228325[_0xd351('0x6d')][_0xd351('0x6f')](),'ListId')[_0xd351('0x69')](_0x3ce802['params']['id'][_0xd351('0x6f')](),_0xd351('0x54'))['field']('\x27'+_0x2d6e5f+'\x27',_0xd351('0x4d'))[_0xd351('0x69')]('\x27'+_0x2d6e5f+'\x27',_0xd351('0x4e'))[_0xd351('0x72')](_0xd351('0x78'))[_0xd351('0x37')](_0xd351('0x79'))[_0xd351('0x37')](_0xd351('0x70'),_0x228325[_0xd351('0x6d')]['toString']())['where'](_0xd351('0x71'))[_0xd351('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd351('0x68')]()[_0xd351('0x69')](_0xd351('0x76'))[_0xd351('0x72')](_0xd351('0x65'))[_0xd351('0x37')]('CampaignId\x20=\x20?',_0x3ce802[_0xd351('0x4a')]['id'][_0xd351('0x6f')]())))['toString']();break;default:_0x413163=squel[_0xd351('0x63')]()[_0xd351('0x64')]('cm_hopper')[_0xd351('0x66')]([_0xd351('0x67'),_0xd351('0x6b'),_0xd351('0x6c'),_0xd351('0x6e'),_0xd351('0x54'),'createdAt',_0xd351('0x4e')],squel[_0xd351('0x68')]()[_0xd351('0x69')](_0xd351('0x67'),_0xd351('0x67'))['field'](_0xd351('0x6a'),'scheduledAt')['field']('id','ContactId')[_0xd351('0x69')](_0x228325['CmListId'][_0xd351('0x6f')](),_0xd351('0x6e'))[_0xd351('0x69')](_0x3ce802[_0xd351('0x4a')]['id'][_0xd351('0x6f')](),_0xd351('0x54'))[_0xd351('0x69')]('\x27'+_0x2d6e5f+'\x27',_0xd351('0x4d'))[_0xd351('0x69')]('\x27'+_0x2d6e5f+'\x27',_0xd351('0x4e'))[_0xd351('0x72')](_0xd351('0x78'))[_0xd351('0x37')](_0xd351('0x79'))[_0xd351('0x37')]('ListId\x20=\x20?',_0x228325[_0xd351('0x6d')][_0xd351('0x6f')]())[_0xd351('0x37')](_0xd351('0x71')))[_0xd351('0x6f')]();}_0x3425c5=squel[_0xd351('0x63')]()['into'](_0xd351('0x7a'))[_0xd351('0x66')]([_0xd351('0x7b'),_0xd351('0x6b'),_0xd351('0x67'),'OrderBy',_0xd351('0x4d'),_0xd351('0x4e')],squel[_0xd351('0x68')]()[_0xd351('0x69')](_0xd351('0x7c'),'id')['field'](_0xd351('0x6a'),_0xd351('0x6b'))[_0xd351('0x69')](_0xd351('0x7d'),_0xd351('0x67'))[_0xd351('0x69')](_0xd351('0x7e'),_0xd351('0x7f'))[_0xd351('0x69')]('\x27'+_0x2d6e5f+'\x27',_0xd351('0x4d'))[_0xd351('0x69')]('\x27'+_0x2d6e5f+'\x27',_0xd351('0x4e'))[_0xd351('0x72')]('cm_contact_has_items','ci')['join'](_0xd351('0x65'),'h',_0xd351('0x80'))[_0xd351('0x37')](_0xd351('0x81'),_0x228325[_0xd351('0x6d')][_0xd351('0x6f')]())[_0xd351('0x37')](_0xd351('0x82'),_0x3ce802['params']['id'][_0xd351('0x6f')]())['where'](_0xd351('0x83'),_0x2d6e5f))['toString']();_0x2d3695[_0xd351('0x84')](db[_0xd351('0x85')][_0xd351('0x2d')](_0x413163));_0x5f3c4c[_0xd351('0x84')](db['sequelize'][_0xd351('0x2d')](_0x3425c5));}return BPromise[_0xd351('0x86')](_0x2d3695);}})[_0xd351('0x1f')](function(){return BPromise[_0xd351('0x86')](_0x5f3c4c);})[_0xd351('0x1f')](function(){return _0x575060;})[_0xd351('0x1f')](respondWithResult(_0x2942e0,null))[_0xd351('0x3f')](handleError(_0x2942e0,null));};exports[_0xd351('0x87')]=function(_0x531c99,_0x573d5f,_0x533d01){return db[_0xd351('0x27')][_0xd351('0x4b')]({'where':{'id':_0x531c99[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x573d5f,null))[_0xd351('0x1f')](function(_0x2fcbba){if(_0x2fcbba){return _0x2fcbba[_0xd351('0x87')](_0x531c99['query'][_0xd351('0x5f')]);}})['then'](function(_0x37617d){if(_0x37617d){return db[_0xd351('0x53')]['destroy']({'where':{'ListId':_0x531c99['query'][_0xd351('0x5f')],'CampaignId':_0x531c99[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](function(){return _0x37617d;});}})['then'](respondWithStatusCode(_0x573d5f,null))['catch'](handleError(_0x573d5f,null));};exports[_0xd351('0x88')]=function(_0x35342a,_0x1b0faa,_0xd7a147){var _0x337625={};var _0x1b6432={};var _0x33928a;var _0xfba712;return db['Campaign']['findOne']({'where':{'id':_0x35342a[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x1b0faa,null))[_0xd351('0x1f')](function(_0x2db37e){if(_0x2db37e){_0x33928a=_0x2db37e;_0x1b6432['model']=_[_0xd351('0x2e')](db['CmList'][_0xd351('0x28')]);_0x1b6432[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x35342a[_0xd351('0x2d')]);_0x1b6432[_0xd351('0x2f')]=_[_0xd351('0x31')](_0x1b6432[_0xd351('0x2c')],_0x1b6432[_0xd351('0x2d')]);_0x337625[_0xd351('0x30')]=_[_0xd351('0x31')](_0x1b6432[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x35342a[_0xd351('0x2d')][_0xd351('0x32')]));_0x337625[_0xd351('0x30')]=_0x337625[_0xd351('0x30')]['length']?_0x337625['attributes']:_0x1b6432[_0xd351('0x2c')];_0x337625[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x35342a['query'][_0xd351('0x36')]);_0x337625[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x35342a[_0xd351('0x2d')],_0x1b6432[_0xd351('0x2f')]));if(_0x35342a[_0xd351('0x2d')]['filter']){_0x337625['where']=_[_0xd351('0x39')](_0x337625[_0xd351('0x37')],{'$or':_[_0xd351('0x26')](_0x337625[_0xd351('0x30')],function(_0x37ed3a){var _0x1768e9={};_0x1768e9[_0x37ed3a]={'$like':'%'+_0x35342a[_0xd351('0x2d')]['filter']+'%'};return _0x1768e9;})});}_0x337625=_['merge']({},_0x337625,_0x35342a[_0xd351('0x3b')]);return _0x33928a[_0xd351('0x88')](_0x337625);}})[_0xd351('0x1f')](function(_0x32ff27){if(_0x32ff27){_0xfba712=_0x32ff27['length'];if(!_0x35342a['query'][_0xd351('0x33')]('nolimit')){_0x337625[_0xd351('0x17')]=qs[_0xd351('0x17')](_0x35342a[_0xd351('0x2d')][_0xd351('0x17')]);_0x337625[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x35342a['query'][_0xd351('0x19')]);}return _0x33928a[_0xd351('0x88')](_0x337625);}})['then'](function(_0x3152b0){if(_0x3152b0){return _0x3152b0?{'count':_0xfba712,'rows':_0x3152b0}:null;}})[_0xd351('0x1f')](respondWithResult(_0x1b0faa,null))[_0xd351('0x3f')](handleError(_0x1b0faa,null));};exports[_0xd351('0x89')]=function(_0x5cde55,_0x1cab71,_0x1fb798){var _0x3184d5,_0x6bfc11;var _0x5be410=[];var _0x2f0107=moment()[_0xd351('0x8a')](_0xd351('0x5e'));return db[_0xd351('0x27')][_0xd351('0x4b')]({'where':{'id':_0x5cde55['params']['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x1cab71,null))['then'](function(_0x52f5a4){if(_0x52f5a4){_0x6bfc11=_0x52f5a4;return _0x52f5a4[_0xd351('0x89')](_0x5cde55[_0xd351('0x42')][_0xd351('0x5f')],_[_0xd351('0x4c')](_0x5cde55[_0xd351('0x42')],[_0xd351('0x5f'),'id'])||{});}return null;})['spread'](function(_0x18f942){var _0x2af57a;var _0x4bfaa8;_0x3184d5=_0x18f942||[];var _0x4a604c=[];if(_0x18f942){for(var _0x2bc5e7=0x0;_0x2bc5e7<_0x18f942['length'];_0x2bc5e7+=0x1){var _0x5e60e2=_0x18f942[_0x2bc5e7]['get']({'plain':!![]});_0x2af57a=squel[_0xd351('0x63')]()[_0xd351('0x64')](_0xd351('0x8b'))[_0xd351('0x66')]([_0xd351('0x67'),_0xd351('0x6c'),'ListId',_0xd351('0x54'),'createdAt',_0xd351('0x4e')],squel[_0xd351('0x68')]()[_0xd351('0x69')](_0xd351('0x67'),_0xd351('0x67'))[_0xd351('0x69')]('id',_0xd351('0x6c'))['field'](_0x5e60e2[_0xd351('0x6d')]['toString'](),_0xd351('0x6e'))[_0xd351('0x69')](_0x5cde55['params']['id']['toString'](),_0xd351('0x54'))[_0xd351('0x69')]('NOW()',_0xd351('0x4d'))[_0xd351('0x69')](_0xd351('0x6a'),'updatedAt')[_0xd351('0x72')](_0xd351('0x78'))[_0xd351('0x37')]('deletedAt\x20IS\x20NULL')[_0xd351('0x37')]('ListId\x20=\x20?',_0x5e60e2[_0xd351('0x6d')][_0xd351('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xd351('0x6f')]();_0x4a604c[_0xd351('0x84')](db['sequelize'][_0xd351('0x2d')](_0x2af57a));}return BPromise[_0xd351('0x86')](_0x4a604c);}})[_0xd351('0x1f')](function(){return _0x3184d5;})[_0xd351('0x1f')](respondWithResult(_0x1cab71,null))[_0xd351('0x3f')](handleError(_0x1cab71,null));};exports[_0xd351('0x8c')]=function(_0x2fd44b,_0x4f5fef,_0x54a8be){return db[_0xd351('0x27')][_0xd351('0x4b')]({'where':{'id':_0x2fd44b[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x4f5fef,null))['then'](function(_0x575347){if(_0x575347){return _0x575347[_0xd351('0x8c')](_0x2fd44b[_0xd351('0x2d')][_0xd351('0x5f')]);}})[_0xd351('0x1f')](function(_0xd0834c){if(_0xd0834c){return db[_0xd351('0x5a')][_0xd351('0x1e')]({'where':{'ListId':_0x2fd44b[_0xd351('0x2d')][_0xd351('0x5f')],'CampaignId':_0x2fd44b[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](function(){return _0xd0834c;});}})['then'](respondWithStatusCode(_0x4f5fef,null))[_0xd351('0x3f')](handleError(_0x4f5fef,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 36a38fb..351be69 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index e382ccd..d7969a5 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 _0xe3ed=['code','message','info','catch','GetCampaign','options','raw','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0xe3ed,0x8d));var _0xde3e=function(_0x3a341a,_0x4058c4){_0x3a341a=_0x3a341a-0x0;var _0x142b47=_0xe3ed[_0x3a341a];return _0x142b47;};'use strict';var _=require(_0xde3e('0x0'));var util=require(_0xde3e('0x1'));var moment=require(_0xde3e('0x2'));var BPromise=require(_0xde3e('0x3'));var rs=require(_0xde3e('0x4'));var fs=require('fs');var Redis=require(_0xde3e('0x5'));var db=require(_0xde3e('0x6'))['db'];var utils=require(_0xde3e('0x7'));var logger=require('../../config/logger')(_0xde3e('0x8'));var config=require(_0xde3e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xde3e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x184b02,_0x4c4ac6,_0x47e97f){return new BPromise(function(_0x3e0bb4,_0x3b1597){return client[_0xde3e('0xb')](_0x184b02,_0x47e97f)[_0xde3e('0xc')](function(_0x76daf5){logger['info'](_0xde3e('0xd'),_0x4c4ac6,_0xde3e('0xe'));logger[_0xde3e('0xf')](_0xde3e('0x10'),_0x4c4ac6,'request\x20sent',JSON[_0xde3e('0x11')](_0x76daf5));if(_0x76daf5[_0xde3e('0x12')]){if(_0x76daf5['error'][_0xde3e('0x13')]===0x1f4){logger[_0xde3e('0x12')]('Campaign,\x20%s,\x20%s',_0x4c4ac6,_0x76daf5[_0xde3e('0x12')]['message']);return _0x3b1597(_0x76daf5[_0xde3e('0x12')][_0xde3e('0x14')]);}logger[_0xde3e('0x12')]('Campaign,\x20%s,\x20%s',_0x4c4ac6,_0x76daf5[_0xde3e('0x12')][_0xde3e('0x14')]);return _0x3e0bb4(_0x76daf5['error']['message']);}else{logger[_0xde3e('0x15')](_0xde3e('0xd'),_0x4c4ac6,_0xde3e('0xe'));_0x3e0bb4(_0x76daf5['result']['message']);}})[_0xde3e('0x16')](function(_0x5e041a){logger['error'](_0xde3e('0xd'),_0x4c4ac6,_0x5e041a);_0x3b1597(_0x5e041a);});});}exports[_0xde3e('0x17')]=function(_0x4aa02c){var _0x460d69=this;return new Promise(function(_0x276e83,_0x264603){return db['Campaign']['findAll']({'raw':_0x4aa02c['options']?_0x4aa02c[_0xde3e('0x18')][_0xde3e('0x19')]===undefined?!![]:![]:!![],'where':_0x4aa02c[_0xde3e('0x18')]?_0x4aa02c['options'][_0xde3e('0x1a')]||null:null,'attributes':_0x4aa02c[_0xde3e('0x18')]?_0x4aa02c[_0xde3e('0x18')][_0xde3e('0x1b')]||null:null,'limit':_0x4aa02c[_0xde3e('0x18')]?_0x4aa02c[_0xde3e('0x18')][_0xde3e('0x1c')]||null:null,'include':_0x4aa02c[_0xde3e('0x18')]?_0x4aa02c[_0xde3e('0x18')]['include']?_[_0xde3e('0x1d')](_0x4aa02c[_0xde3e('0x18')][_0xde3e('0x1e')],function(_0x57df9e){return{'model':db[_0x57df9e[_0xde3e('0x1f')]],'as':_0x57df9e['as'],'attributes':_0x57df9e[_0xde3e('0x1b')],'include':_0x57df9e[_0xde3e('0x1e')]?_['map'](_0x57df9e[_0xde3e('0x1e')],function(_0x78647){return{'model':db[_0x78647[_0xde3e('0x1f')]],'as':_0x78647['as'],'attributes':_0x78647[_0xde3e('0x1b')],'include':_0x78647[_0xde3e('0x1e')]?_['map'](_0x78647['include'],function(_0x6c0db0){return{'model':db[_0x6c0db0[_0xde3e('0x1f')]],'as':_0x6c0db0['as'],'attributes':_0x6c0db0[_0xde3e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d1404){logger[_0xde3e('0x15')]('GetCampaign',_0x4aa02c);logger['debug'](_0xde3e('0x17'),_0x4aa02c,JSON[_0xde3e('0x11')](_0x3d1404));_0x276e83(_0x3d1404);})['catch'](function(_0x2e4c62){logger[_0xde3e('0x12')](_0xde3e('0x17'),_0x2e4c62['message'],_0x4aa02c);_0x264603(_0x460d69['error'](0x1f4,_0x2e4c62[_0xde3e('0x14')]));});});};
\ No newline at end of file
+var _0xb7cf=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','debug','stringify','error','code','message','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','lodash','util'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xb7cf,0xca));var _0xfb7c=function(_0x540178,_0x1feb3d){_0x540178=_0x540178-0x0;var _0x58a85c=_0xb7cf[_0x540178];return _0x58a85c;};'use strict';var _=require(_0xfb7c('0x0'));var util=require(_0xfb7c('0x1'));var moment=require(_0xfb7c('0x2'));var BPromise=require(_0xfb7c('0x3'));var rs=require(_0xfb7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb7c('0x5'))['db'];var utils=require(_0xfb7c('0x6'));var logger=require(_0xfb7c('0x7'))(_0xfb7c('0x8'));var config=require(_0xfb7c('0x9'));var jayson=require(_0xfb7c('0xa'));var client=jayson[_0xfb7c('0xb')][_0xfb7c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41dcce,_0x2fd757,_0x3c21f3){return new BPromise(function(_0x34b889,_0x289874){return client[_0xfb7c('0xd')](_0x41dcce,_0x3c21f3)['then'](function(_0x13dcc3){logger[_0xfb7c('0xe')](_0xfb7c('0xf'),_0x2fd757,'request\x20sent');logger[_0xfb7c('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2fd757,'request\x20sent',JSON[_0xfb7c('0x11')](_0x13dcc3));if(_0x13dcc3[_0xfb7c('0x12')]){if(_0x13dcc3[_0xfb7c('0x12')][_0xfb7c('0x13')]===0x1f4){logger[_0xfb7c('0x12')](_0xfb7c('0xf'),_0x2fd757,_0x13dcc3[_0xfb7c('0x12')][_0xfb7c('0x14')]);return _0x289874(_0x13dcc3['error'][_0xfb7c('0x14')]);}logger[_0xfb7c('0x12')]('Campaign,\x20%s,\x20%s',_0x2fd757,_0x13dcc3[_0xfb7c('0x12')][_0xfb7c('0x14')]);return _0x34b889(_0x13dcc3[_0xfb7c('0x12')][_0xfb7c('0x14')]);}else{logger[_0xfb7c('0xe')](_0xfb7c('0xf'),_0x2fd757,'request\x20sent');_0x34b889(_0x13dcc3['result'][_0xfb7c('0x14')]);}})['catch'](function(_0xa66d3a){logger[_0xfb7c('0x12')](_0xfb7c('0xf'),_0x2fd757,_0xa66d3a);_0x289874(_0xa66d3a);});});}exports[_0xfb7c('0x15')]=function(_0x493d7b){var _0x20115a=this;return new Promise(function(_0x4f0c3b,_0xa29a57){return db[_0xfb7c('0x16')][_0xfb7c('0x17')]({'raw':_0x493d7b[_0xfb7c('0x18')]?_0x493d7b[_0xfb7c('0x18')][_0xfb7c('0x19')]===undefined?!![]:![]:!![],'where':_0x493d7b[_0xfb7c('0x18')]?_0x493d7b['options'][_0xfb7c('0x1a')]||null:null,'attributes':_0x493d7b['options']?_0x493d7b[_0xfb7c('0x18')][_0xfb7c('0x1b')]||null:null,'limit':_0x493d7b[_0xfb7c('0x18')]?_0x493d7b[_0xfb7c('0x18')][_0xfb7c('0x1c')]||null:null,'include':_0x493d7b[_0xfb7c('0x18')]?_0x493d7b[_0xfb7c('0x18')][_0xfb7c('0x1d')]?_[_0xfb7c('0x1e')](_0x493d7b['options'][_0xfb7c('0x1d')],function(_0x4b1598){return{'model':db[_0x4b1598['model']],'as':_0x4b1598['as'],'attributes':_0x4b1598[_0xfb7c('0x1b')],'include':_0x4b1598[_0xfb7c('0x1d')]?_['map'](_0x4b1598[_0xfb7c('0x1d')],function(_0x4fcb72){return{'model':db[_0x4fcb72['model']],'as':_0x4fcb72['as'],'attributes':_0x4fcb72[_0xfb7c('0x1b')],'include':_0x4fcb72[_0xfb7c('0x1d')]?_[_0xfb7c('0x1e')](_0x4fcb72[_0xfb7c('0x1d')],function(_0x7a795){return{'model':db[_0x7a795[_0xfb7c('0x1f')]],'as':_0x7a795['as'],'attributes':_0x7a795[_0xfb7c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfb7c('0x20')](function(_0x5f2229){logger[_0xfb7c('0xe')](_0xfb7c('0x15'),_0x493d7b);logger[_0xfb7c('0x10')]('GetCampaign',_0x493d7b,JSON['stringify'](_0x5f2229));_0x4f0c3b(_0x5f2229);})[_0xfb7c('0x21')](function(_0x4d3029){logger['error']('GetCampaign',_0x4d3029[_0xfb7c('0x14')],_0x493d7b);_0xa29a57(_0x20115a[_0xfb7c('0x12')](0x1f4,_0x4d3029[_0xfb7c('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 5688765..731052f 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 _0x201d=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','clone','addLists','update','delete','destroy','removeLists','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','get','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x201d,0xd2));var _0xd201=function(_0x384b33,_0x46d914){_0x384b33=_0x384b33-0x0;var _0x1fe5df=_0x201d[_0x384b33];return _0x1fe5df;};'use strict';var multer=require(_0xd201('0x0'));var util=require('util');var path=require(_0xd201('0x1'));var timeout=require(_0xd201('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd201('0x3'));var interaction=require(_0xd201('0x4'));var config=require('../../config/environment');var controller=require(_0xd201('0x5'));router['get']('/',auth[_0xd201('0x6')](),controller['index']);router[_0xd201('0x7')](_0xd201('0x8'),auth[_0xd201('0x6')](),controller['show']);router['get'](_0xd201('0x9'),auth['isAuthenticated'](),controller[_0xd201('0xa')]);router[_0xd201('0x7')]('/:id/hopper_histories',auth[_0xd201('0x6')](),controller[_0xd201('0xb')]);router[_0xd201('0x7')](_0xd201('0xc'),auth[_0xd201('0x6')](),controller[_0xd201('0xd')]);router[_0xd201('0x7')](_0xd201('0xe'),auth[_0xd201('0x6')](),controller[_0xd201('0xf')]);router[_0xd201('0x7')](_0xd201('0x10'),auth[_0xd201('0x6')](),controller[_0xd201('0x11')]);router[_0xd201('0x7')](_0xd201('0x12'),auth[_0xd201('0x6')](),controller['getBlackLists']);router[_0xd201('0x13')]('/',auth[_0xd201('0x6')](),controller['create']);router[_0xd201('0x13')](_0xd201('0x14'),auth['isAuthenticated'](),controller[_0xd201('0x15')]);router[_0xd201('0x13')](_0xd201('0x10'),auth[_0xd201('0x6')](),controller[_0xd201('0x16')]);router['post'](_0xd201('0x12'),auth[_0xd201('0x6')](),controller['addBlackLists']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd201('0x17')]);router[_0xd201('0x18')](_0xd201('0x8'),auth[_0xd201('0x6')](),controller[_0xd201('0x19')]);router[_0xd201('0x18')](_0xd201('0x10'),auth[_0xd201('0x6')](),controller[_0xd201('0x1a')]);router[_0xd201('0x18')](_0xd201('0x12'),auth[_0xd201('0x6')](),controller['removeBlackLists']);module[_0xd201('0x1b')]=router;
\ No newline at end of file
+var _0xa78e=['isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','update','destroy','delete','removeLists','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa78e,0x1e1));var _0xea78=function(_0x1ed0ad,_0x40d811){_0x1ed0ad=_0x1ed0ad-0x0;var _0x38263b=_0xa78e[_0x1ed0ad];return _0x38263b;};'use strict';var multer=require(_0xea78('0x0'));var util=require(_0xea78('0x1'));var path=require(_0xea78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xea78('0x3')]();var fs_extra=require(_0xea78('0x4'));var auth=require(_0xea78('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea78('0x6'));var controller=require(_0xea78('0x7'));router[_0xea78('0x8')]('/',auth[_0xea78('0x9')](),controller[_0xea78('0xa')]);router['get'](_0xea78('0xb'),auth['isAuthenticated'](),controller[_0xea78('0xc')]);router['get']('/:id/hoppers',auth[_0xea78('0x9')](),controller[_0xea78('0xd')]);router[_0xea78('0x8')](_0xea78('0xe'),auth[_0xea78('0x9')](),controller[_0xea78('0xf')]);router['get'](_0xea78('0x10'),auth['isAuthenticated'](),controller[_0xea78('0x11')]);router[_0xea78('0x8')](_0xea78('0x12'),auth[_0xea78('0x9')](),controller[_0xea78('0x13')]);router[_0xea78('0x8')](_0xea78('0x14'),auth['isAuthenticated'](),controller[_0xea78('0x15')]);router[_0xea78('0x8')](_0xea78('0x16'),auth[_0xea78('0x9')](),controller[_0xea78('0x17')]);router[_0xea78('0x18')]('/',auth['isAuthenticated'](),controller[_0xea78('0x19')]);router[_0xea78('0x18')](_0xea78('0x1a'),auth[_0xea78('0x9')](),controller['clone']);router[_0xea78('0x18')]('/:id/lists',auth['isAuthenticated'](),controller[_0xea78('0x1b')]);router[_0xea78('0x18')]('/:id/blacklists',auth[_0xea78('0x9')](),controller[_0xea78('0x1c')]);router[_0xea78('0x1d')](_0xea78('0xb'),auth['isAuthenticated'](),controller[_0xea78('0x1e')]);router['delete'](_0xea78('0xb'),auth[_0xea78('0x9')](),controller[_0xea78('0x1f')]);router[_0xea78('0x20')]('/:id/lists',auth[_0xea78('0x9')](),controller[_0xea78('0x21')]);router[_0xea78('0x20')](_0xea78('0x16'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xea78('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 66ea7c0..a13f379 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 _0x6d52=['TEXT','medium','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x6d52,0xca));var _0x26d5=function(_0x571d8c,_0x4eb9d7){_0x571d8c=_0x571d8c-0x0;var _0x5d32d7=_0x6d52[_0x571d8c];return _0x5d32d7;};'use strict';var Sequelize=require(_0x26d5('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x26d5('0x1')],'length':_0x26d5('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x26d5('0x3')]},'name':{'type':Sequelize[_0x26d5('0x4')],'get':function(){return this[_0x26d5('0x5')](_0x26d5('0x6'));}}};
\ No newline at end of file
+var _0xbc2d=['STRING','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x54db09,_0x1e4e6b){var _0x40e28e=function(_0x309ba5){while(--_0x309ba5){_0x54db09['push'](_0x54db09['shift']());}};_0x40e28e(++_0x1e4e6b);}(_0xbc2d,0x83));var _0xdbc2=function(_0xf81ba7,_0x3c1adf){_0xf81ba7=_0xf81ba7-0x0;var _0x1a88df=_0xbc2d[_0xf81ba7];return _0x1a88df;};'use strict';var Sequelize=require(_0xdbc2('0x0'));module['exports']={'key':{'type':Sequelize[_0xdbc2('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xdbc2('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xdbc2('0x1')]},'name':{'type':Sequelize[_0xdbc2('0x3')],'get':function(){return this[_0xdbc2('0x4')](_0xdbc2('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index a800c0b..1fdba80 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 _0x9791=['attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','find','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','filters','intersection'];(function(_0x46527b,_0x4faf52){var _0x3cac19=function(_0x2c70bb){while(--_0x2c70bb){_0x46527b['push'](_0x46527b['shift']());}};_0x3cac19(++_0x4faf52);}(_0x9791,0x180));var _0x1979=function(_0x5e90e3,_0x37a3cf){_0x5e90e3=_0x5e90e3-0x0;var _0x487022=_0x9791[_0x5e90e3];return _0x487022;};'use strict';var emlformat=require(_0x1979('0x0'));var rimraf=require(_0x1979('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1979('0x2'));var rp=require(_0x1979('0x3'));var moment=require(_0x1979('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1979('0x5'));var sox=require(_0x1979('0x6'));var csv=require(_0x1979('0x7'));var ejs=require(_0x1979('0x8'));var fs=require('fs');var fs_extra=require(_0x1979('0x9'));var _=require(_0x1979('0xa'));var squel=require(_0x1979('0xb'));var crypto=require(_0x1979('0xc'));var jsforce=require(_0x1979('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1979('0x7'));var querystring=require(_0x1979('0xe'));var Papa=require('papaparse');var Redis=require(_0x1979('0xf'));var authService=require(_0x1979('0x10'));var qs=require(_0x1979('0x11'));var as=require(_0x1979('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1979('0x13'))(_0x1979('0x14'));var utils=require(_0x1979('0x15'));var config=require(_0x1979('0x16'));var licenseUtil=require(_0x1979('0x17'));var db=require(_0x1979('0x18'))['db'];function respondWithStatusCode(_0x5c6c61,_0x19ad1a){_0x19ad1a=_0x19ad1a||0xcc;return function(_0x1b5850){if(_0x1b5850){return _0x5c6c61[_0x1979('0x19')](_0x19ad1a);}return _0x5c6c61[_0x1979('0x1a')](_0x19ad1a)[_0x1979('0x1b')]();};}function respondWithResult(_0x3505d7,_0x242318){_0x242318=_0x242318||0xc8;return function(_0x3f3629){if(_0x3f3629){return _0x3505d7[_0x1979('0x1a')](_0x242318)[_0x1979('0x1c')](_0x3f3629);}};}function respondWithFilteredResult(_0x2a009f,_0x2bf564){return function(_0x2c896b){if(_0x2c896b){var _0xe70144=typeof _0x2bf564['offset']===_0x1979('0x1d')&&typeof _0x2bf564[_0x1979('0x1e')]===_0x1979('0x1d');var _0x529904=_0x2c896b[_0x1979('0x1f')];var _0x4af683=_0xe70144?0x0:_0x2bf564[_0x1979('0x20')];var _0xc9c574=_0xe70144?_0x2c896b[_0x1979('0x1f')]:_0x2bf564[_0x1979('0x20')]+_0x2bf564[_0x1979('0x1e')];var _0x5c4129;if(_0xc9c574>=_0x529904){_0xc9c574=_0x529904;_0x5c4129=0xc8;}else{_0x5c4129=0xce;}_0x2a009f['status'](_0x5c4129);return _0x2a009f['set'](_0x1979('0x21'),_0x4af683+'-'+_0xc9c574+'/'+_0x529904)[_0x1979('0x1c')](_0x2c896b);}return null;};}function patchUpdates(_0x1b326a){return function(_0x55d3ac){try{jsonpatch['apply'](_0x55d3ac,_0x1b326a,!![]);}catch(_0x44d560){return BPromise['reject'](_0x44d560);}return _0x55d3ac[_0x1979('0x22')]();};}function saveUpdates(_0x3ebc59,_0x1b46cf){return function(_0x19cb99){if(_0x19cb99){return _0x19cb99[_0x1979('0x23')](_0x3ebc59)[_0x1979('0x24')](function(_0x355892){return _0x355892;});}return null;};}function removeEntity(_0x446251,_0x1d757b){return function(_0x48dc67){if(_0x48dc67){return _0x48dc67[_0x1979('0x25')]()[_0x1979('0x24')](function(){var _0xaf1c18=_0x48dc67[_0x1979('0x26')]({'plain':!![]});var _0x1f9327=_0x1979('0x27');return db[_0x1979('0x28')][_0x1979('0x25')]({'where':{'type':_0x1f9327,'resourceId':_0xaf1c18['id']}})[_0x1979('0x24')](function(){return _0x48dc67;});})[_0x1979('0x24')](function(){_0x446251[_0x1979('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x65556c,_0x577070){return function(_0x3899f1){if(!_0x3899f1){_0x65556c['sendStatus'](0x194);}return _0x3899f1;};}function handleError(_0xbb9687,_0x5faf67){_0x5faf67=_0x5faf67||0x1f4;return function(_0x2fb2eb){logger[_0x1979('0x29')](_0x2fb2eb[_0x1979('0x2a')]);if(_0x2fb2eb[_0x1979('0x2b')]){delete _0x2fb2eb[_0x1979('0x2b')];}_0xbb9687[_0x1979('0x1a')](_0x5faf67)[_0x1979('0x2c')](_0x2fb2eb);};}exports[_0x1979('0x2d')]=function(_0xf8795,_0x1e5f2f){var _0x2e9128={},_0x3d89a9={},_0x21d34f={'count':0x0,'rows':[]};var _0x4e8b6a=_['map'](db[_0x1979('0x2e')][_0x1979('0x2f')],function(_0x57bd90){return{'name':_0x57bd90[_0x1979('0x30')],'type':_0x57bd90[_0x1979('0x31')][_0x1979('0x32')]};});_0x3d89a9[_0x1979('0x33')]=_[_0x1979('0x34')](_0x4e8b6a,_0x1979('0x2b'));_0x3d89a9[_0x1979('0x35')]=_['keys'](_0xf8795[_0x1979('0x35')]);_0x3d89a9[_0x1979('0x36')]=_[_0x1979('0x37')](_0x3d89a9[_0x1979('0x33')],_0x3d89a9[_0x1979('0x35')]);_0x2e9128[_0x1979('0x38')]=_[_0x1979('0x37')](_0x3d89a9[_0x1979('0x33')],qs['fields'](_0xf8795[_0x1979('0x35')][_0x1979('0x39')]));_0x2e9128[_0x1979('0x38')]=_0x2e9128[_0x1979('0x38')][_0x1979('0x3a')]?_0x2e9128['attributes']:_0x3d89a9[_0x1979('0x33')];if(!_0xf8795[_0x1979('0x35')]['hasOwnProperty'](_0x1979('0x3b'))){_0x2e9128[_0x1979('0x1e')]=qs[_0x1979('0x1e')](_0xf8795[_0x1979('0x35')][_0x1979('0x1e')]);_0x2e9128['offset']=qs[_0x1979('0x20')](_0xf8795[_0x1979('0x35')]['offset']);}_0x2e9128[_0x1979('0x3c')]=qs['sort'](_0xf8795['query'][_0x1979('0x3d')]);_0x2e9128[_0x1979('0x3e')]=qs['filters'](_[_0x1979('0x3f')](_0xf8795[_0x1979('0x35')],_0x3d89a9[_0x1979('0x36')]),_0x4e8b6a);if(_0xf8795[_0x1979('0x35')][_0x1979('0x40')]){_0x2e9128['where']=_[_0x1979('0x41')](_0x2e9128['where'],{'$or':[{'key':{'$like':'%'+_0xf8795['query'][_0x1979('0x40')]+'%'}},{'value':{'$like':'%'+_0xf8795[_0x1979('0x35')][_0x1979('0x40')]+'%'}}]});}_0x2e9128=_[_0x1979('0x41')]({},_0x2e9128,_0xf8795[_0x1979('0x42')]);var _0x32aa5c={'where':_0x2e9128['where']};return db[_0x1979('0x2e')][_0x1979('0x1f')](_0x32aa5c)[_0x1979('0x24')](function(_0x1e0a52){_0x21d34f[_0x1979('0x1f')]=_0x1e0a52;if(_0xf8795[_0x1979('0x35')][_0x1979('0x43')]){_0x2e9128['include']=[{'all':!![]}];}return db[_0x1979('0x2e')][_0x1979('0x44')](_0x2e9128);})[_0x1979('0x24')](function(_0xb1abb2){_0x21d34f[_0x1979('0x45')]=_0xb1abb2;return _0x21d34f;})[_0x1979('0x24')](respondWithFilteredResult(_0x1e5f2f,_0x2e9128))['catch'](handleError(_0x1e5f2f,null));};exports[_0x1979('0x46')]=function(_0xaf0cf4,_0x16241a){var _0x34a3b0={'raw':!![],'where':{'id':_0xaf0cf4[_0x1979('0x47')]['id']}},_0x52bc2c={};_0x52bc2c[_0x1979('0x33')]=_[_0x1979('0x48')](db[_0x1979('0x2e')][_0x1979('0x2f')]);_0x52bc2c[_0x1979('0x35')]=_[_0x1979('0x48')](_0xaf0cf4['query']);_0x52bc2c[_0x1979('0x36')]=_[_0x1979('0x37')](_0x52bc2c[_0x1979('0x33')],_0x52bc2c['query']);_0x34a3b0[_0x1979('0x38')]=_[_0x1979('0x37')](_0x52bc2c['model'],qs[_0x1979('0x39')](_0xaf0cf4['query'][_0x1979('0x39')]));_0x34a3b0[_0x1979('0x38')]=_0x34a3b0[_0x1979('0x38')][_0x1979('0x3a')]?_0x34a3b0[_0x1979('0x38')]:_0x52bc2c['model'];if(_0xaf0cf4[_0x1979('0x35')][_0x1979('0x43')]){_0x34a3b0['include']=[{'all':!![]}];}_0x34a3b0=_[_0x1979('0x41')]({},_0x34a3b0,_0xaf0cf4[_0x1979('0x42')]);return db[_0x1979('0x2e')][_0x1979('0x49')](_0x34a3b0)[_0x1979('0x24')](handleEntityNotFound(_0x16241a,null))[_0x1979('0x24')](respondWithResult(_0x16241a,null))[_0x1979('0x4a')](handleError(_0x16241a,null));};exports[_0x1979('0x23')]=function(_0x244a5e,_0x47caab){if(_0x244a5e[_0x1979('0x4b')]['id']){delete _0x244a5e[_0x1979('0x4b')]['id'];}return db[_0x1979('0x2e')][_0x1979('0x49')]({'where':{'id':_0x244a5e[_0x1979('0x47')]['id']}})[_0x1979('0x24')](handleEntityNotFound(_0x47caab,null))['then'](saveUpdates(_0x244a5e[_0x1979('0x4b')],null))['then'](respondWithResult(_0x47caab,null))['catch'](handleError(_0x47caab,null));};exports['destroy']=function(_0x1d09eb,_0x4959f9){return db[_0x1979('0x2e')][_0x1979('0x49')]({'where':{'id':_0x1d09eb[_0x1979('0x47')]['id']}})[_0x1979('0x24')](handleEntityNotFound(_0x4959f9,null))[_0x1979('0x24')](removeEntity(_0x4959f9,null))[_0x1979('0x4a')](handleError(_0x4959f9,null));};exports['create']=function(_0x1f9774,_0x20adc0){var _0x5a58bc={'key':_0x1f9774[_0x1979('0x4b')]['key']};if(_0x1f9774[_0x1979('0x4b')][_0x1979('0x4c')]){_0x5a58bc[_0x1979('0x4c')]=_0x1f9774[_0x1979('0x4b')][_0x1979('0x4c')];}else if(_0x1f9774['body']['SmsAccountId']){_0x5a58bc['SmsAccountId']=_0x1f9774['body'][_0x1979('0x4d')];}else if(_0x1f9774[_0x1979('0x4b')][_0x1979('0x4e')]){_0x5a58bc[_0x1979('0x4e')]=_0x1f9774[_0x1979('0x4b')]['OpenchannelAccountId'];}else if(_0x1f9774[_0x1979('0x4b')][_0x1979('0x4f')]){_0x5a58bc['ChatWebsiteId']=_0x1f9774[_0x1979('0x4b')][_0x1979('0x4f')];}return db['CannedAnswer']['find']({'where':_0x5a58bc})[_0x1979('0x24')](function(_0x242bcb){if(_0x242bcb){throw new db['Sequelize'][(_0x1979('0x50'))](_0x1979('0x51'));}return db['CannedAnswer'][_0x1979('0x52')](_0x1f9774['body']);})[_0x1979('0x24')](function(_0x22f97d){var _0x67b4c6=_0x1f9774[_0x1979('0x53')][_0x1979('0x26')]({'plain':!![]});if(!_0x67b4c6)throw new Error(_0x1979('0x54'));if(_0x67b4c6['role']===_0x1979('0x53')){var _0x4158cf=_0x22f97d['get']({'plain':!![]});return db['UserProfileSection'][_0x1979('0x49')]({'where':{'name':_0x1979('0x27'),'userProfileId':_0x67b4c6[_0x1979('0x55')]},'raw':!![]})[_0x1979('0x24')](function(_0x2a1e96){if(_0x2a1e96&&_0x2a1e96[_0x1979('0x56')]===0x0){return db[_0x1979('0x28')][_0x1979('0x52')]({'name':_0x4158cf[_0x1979('0x2b')],'resourceId':_0x4158cf['id'],'type':_0x2a1e96['name'],'sectionId':_0x2a1e96['id']},{})[_0x1979('0x24')](function(){return _0x22f97d;});}else{return _0x22f97d;}})[_0x1979('0x4a')](function(_0x56fba7){logger['error'](_0x1979('0x57'),_0x56fba7);throw _0x56fba7;});}return _0x22f97d;})[_0x1979('0x24')](respondWithResult(_0x20adc0,0xc9))[_0x1979('0x4a')](handleError(_0x20adc0,null));};
\ No newline at end of file
+var _0xeb9e=['crypto','jsforce','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','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x4fdb79,_0x12c116){var _0x3ec15b=function(_0x50c82e){while(--_0x50c82e){_0x4fdb79['push'](_0x4fdb79['shift']());}};_0x3ec15b(++_0x12c116);}(_0xeb9e,0x1f3));var _0xeeb9=function(_0x2692d4,_0x1f323c){_0x2692d4=_0x2692d4-0x0;var _0x2c5d1d=_0xeb9e[_0x2692d4];return _0x2c5d1d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeeb9('0x0'));var zipdir=require(_0xeeb9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeeb9('0x2'));var moment=require(_0xeeb9('0x3'));var BPromise=require(_0xeeb9('0x4'));var Mustache=require(_0xeeb9('0x5'));var util=require('util');var path=require('path');var sox=require(_0xeeb9('0x6'));var csv=require(_0xeeb9('0x7'));var ejs=require(_0xeeb9('0x8'));var fs=require('fs');var fs_extra=require(_0xeeb9('0x9'));var _=require(_0xeeb9('0xa'));var squel=require('squel');var crypto=require(_0xeeb9('0xb'));var jsforce=require(_0xeeb9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xeeb9('0x7'));var querystring=require('querystring');var Papa=require(_0xeeb9('0xd'));var Redis=require('ioredis');var authService=require(_0xeeb9('0xe'));var qs=require(_0xeeb9('0xf'));var as=require(_0xeeb9('0x10'));var hardwareService=require(_0xeeb9('0x11'));var logger=require(_0xeeb9('0x12'))(_0xeeb9('0x13'));var utils=require(_0xeeb9('0x14'));var config=require(_0xeeb9('0x15'));var licenseUtil=require(_0xeeb9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4397e2,_0x498afb){_0x498afb=_0x498afb||0xcc;return function(_0x40a5f3){if(_0x40a5f3){return _0x4397e2[_0xeeb9('0x17')](_0x498afb);}return _0x4397e2[_0xeeb9('0x18')](_0x498afb)['end']();};}function respondWithResult(_0x3e1ef3,_0x1e11ec){_0x1e11ec=_0x1e11ec||0xc8;return function(_0x498851){if(_0x498851){return _0x3e1ef3['status'](_0x1e11ec)[_0xeeb9('0x19')](_0x498851);}};}function respondWithFilteredResult(_0x1db606,_0x2caba1){return function(_0x27be5b){if(_0x27be5b){var _0x3d1353=typeof _0x2caba1['offset']===_0xeeb9('0x1a')&&typeof _0x2caba1[_0xeeb9('0x1b')]===_0xeeb9('0x1a');var _0x3cfb50=_0x27be5b[_0xeeb9('0x1c')];var _0x225b93=_0x3d1353?0x0:_0x2caba1[_0xeeb9('0x1d')];var _0x552641=_0x3d1353?_0x27be5b['count']:_0x2caba1[_0xeeb9('0x1d')]+_0x2caba1[_0xeeb9('0x1b')];var _0xdd65f9;if(_0x552641>=_0x3cfb50){_0x552641=_0x3cfb50;_0xdd65f9=0xc8;}else{_0xdd65f9=0xce;}_0x1db606[_0xeeb9('0x18')](_0xdd65f9);return _0x1db606['set'](_0xeeb9('0x1e'),_0x225b93+'-'+_0x552641+'/'+_0x3cfb50)[_0xeeb9('0x19')](_0x27be5b);}return null;};}function patchUpdates(_0x371cde){return function(_0x794e5d){try{jsonpatch[_0xeeb9('0x1f')](_0x794e5d,_0x371cde,!![]);}catch(_0x148a2d){return BPromise[_0xeeb9('0x20')](_0x148a2d);}return _0x794e5d[_0xeeb9('0x21')]();};}function saveUpdates(_0x63685e,_0x336384){return function(_0x2df51b){if(_0x2df51b){return _0x2df51b[_0xeeb9('0x22')](_0x63685e)[_0xeeb9('0x23')](function(_0x6d30ef){return _0x6d30ef;});}return null;};}function removeEntity(_0x5bfd44,_0x477a7c){return function(_0x57004f){if(_0x57004f){return _0x57004f[_0xeeb9('0x24')]()[_0xeeb9('0x23')](function(){var _0x1c0e10=_0x57004f[_0xeeb9('0x25')]({'plain':!![]});var _0x5742a3='CannedAnswers';return db[_0xeeb9('0x26')]['destroy']({'where':{'type':_0x5742a3,'resourceId':_0x1c0e10['id']}})[_0xeeb9('0x23')](function(){return _0x57004f;});})[_0xeeb9('0x23')](function(){_0x5bfd44[_0xeeb9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48ef78,_0x4385c8){return function(_0x45f2e7){if(!_0x45f2e7){_0x48ef78['sendStatus'](0x194);}return _0x45f2e7;};}function handleError(_0x4c801c,_0x12a95d){_0x12a95d=_0x12a95d||0x1f4;return function(_0xc6b615){logger[_0xeeb9('0x27')](_0xc6b615['stack']);if(_0xc6b615[_0xeeb9('0x28')]){delete _0xc6b615[_0xeeb9('0x28')];}_0x4c801c[_0xeeb9('0x18')](_0x12a95d)[_0xeeb9('0x29')](_0xc6b615);};}exports['index']=function(_0x40cb8d,_0x357016){var _0x11e8a5={},_0x12d986={},_0x1f27f4={'count':0x0,'rows':[]};var _0x36cd74=_[_0xeeb9('0x2a')](db['CannedAnswer']['rawAttributes'],function(_0x4ab129){return{'name':_0x4ab129[_0xeeb9('0x2b')],'type':_0x4ab129['type'][_0xeeb9('0x2c')]};});_0x12d986[_0xeeb9('0x2d')]=_['map'](_0x36cd74,_0xeeb9('0x28'));_0x12d986[_0xeeb9('0x2e')]=_[_0xeeb9('0x2f')](_0x40cb8d[_0xeeb9('0x2e')]);_0x12d986[_0xeeb9('0x30')]=_['intersection'](_0x12d986[_0xeeb9('0x2d')],_0x12d986['query']);_0x11e8a5[_0xeeb9('0x31')]=_[_0xeeb9('0x32')](_0x12d986[_0xeeb9('0x2d')],qs[_0xeeb9('0x33')](_0x40cb8d[_0xeeb9('0x2e')]['fields']));_0x11e8a5[_0xeeb9('0x31')]=_0x11e8a5[_0xeeb9('0x31')][_0xeeb9('0x34')]?_0x11e8a5[_0xeeb9('0x31')]:_0x12d986['model'];if(!_0x40cb8d[_0xeeb9('0x2e')]['hasOwnProperty'](_0xeeb9('0x35'))){_0x11e8a5[_0xeeb9('0x1b')]=qs[_0xeeb9('0x1b')](_0x40cb8d['query']['limit']);_0x11e8a5[_0xeeb9('0x1d')]=qs[_0xeeb9('0x1d')](_0x40cb8d[_0xeeb9('0x2e')][_0xeeb9('0x1d')]);}_0x11e8a5[_0xeeb9('0x36')]=qs[_0xeeb9('0x37')](_0x40cb8d['query']['sort']);_0x11e8a5[_0xeeb9('0x38')]=qs[_0xeeb9('0x30')](_[_0xeeb9('0x39')](_0x40cb8d[_0xeeb9('0x2e')],_0x12d986[_0xeeb9('0x30')]),_0x36cd74);if(_0x40cb8d[_0xeeb9('0x2e')][_0xeeb9('0x3a')]){_0x11e8a5[_0xeeb9('0x38')]=_[_0xeeb9('0x3b')](_0x11e8a5[_0xeeb9('0x38')],{'$or':[{'key':{'$like':'%'+_0x40cb8d['query'][_0xeeb9('0x3a')]+'%'}},{'value':{'$like':'%'+_0x40cb8d[_0xeeb9('0x2e')][_0xeeb9('0x3a')]+'%'}}]});}_0x11e8a5=_[_0xeeb9('0x3b')]({},_0x11e8a5,_0x40cb8d['options']);var _0xae4f0c={'where':_0x11e8a5['where']};return db[_0xeeb9('0x3c')][_0xeeb9('0x1c')](_0xae4f0c)[_0xeeb9('0x23')](function(_0x2b41da){_0x1f27f4['count']=_0x2b41da;if(_0x40cb8d[_0xeeb9('0x2e')][_0xeeb9('0x3d')]){_0x11e8a5[_0xeeb9('0x3e')]=[{'all':!![]}];}return db[_0xeeb9('0x3c')][_0xeeb9('0x3f')](_0x11e8a5);})[_0xeeb9('0x23')](function(_0x2cf7cd){_0x1f27f4[_0xeeb9('0x40')]=_0x2cf7cd;return _0x1f27f4;})[_0xeeb9('0x23')](respondWithFilteredResult(_0x357016,_0x11e8a5))[_0xeeb9('0x41')](handleError(_0x357016,null));};exports[_0xeeb9('0x42')]=function(_0x4856cc,_0x16129d){var _0x3e76a3={'raw':!![],'where':{'id':_0x4856cc[_0xeeb9('0x43')]['id']}},_0x3d4f25={};_0x3d4f25['model']=_[_0xeeb9('0x2f')](db[_0xeeb9('0x3c')][_0xeeb9('0x44')]);_0x3d4f25[_0xeeb9('0x2e')]=_[_0xeeb9('0x2f')](_0x4856cc['query']);_0x3d4f25[_0xeeb9('0x30')]=_[_0xeeb9('0x32')](_0x3d4f25[_0xeeb9('0x2d')],_0x3d4f25['query']);_0x3e76a3[_0xeeb9('0x31')]=_['intersection'](_0x3d4f25['model'],qs[_0xeeb9('0x33')](_0x4856cc[_0xeeb9('0x2e')][_0xeeb9('0x33')]));_0x3e76a3[_0xeeb9('0x31')]=_0x3e76a3[_0xeeb9('0x31')]['length']?_0x3e76a3['attributes']:_0x3d4f25['model'];if(_0x4856cc[_0xeeb9('0x2e')][_0xeeb9('0x3d')]){_0x3e76a3[_0xeeb9('0x3e')]=[{'all':!![]}];}_0x3e76a3=_[_0xeeb9('0x3b')]({},_0x3e76a3,_0x4856cc['options']);return db[_0xeeb9('0x3c')][_0xeeb9('0x45')](_0x3e76a3)[_0xeeb9('0x23')](handleEntityNotFound(_0x16129d,null))[_0xeeb9('0x23')](respondWithResult(_0x16129d,null))[_0xeeb9('0x41')](handleError(_0x16129d,null));};exports[_0xeeb9('0x22')]=function(_0x213290,_0x2ee7f2){if(_0x213290[_0xeeb9('0x46')]['id']){delete _0x213290[_0xeeb9('0x46')]['id'];}return db['CannedAnswer'][_0xeeb9('0x45')]({'where':{'id':_0x213290[_0xeeb9('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ee7f2,null))['then'](saveUpdates(_0x213290[_0xeeb9('0x46')],null))[_0xeeb9('0x23')](respondWithResult(_0x2ee7f2,null))['catch'](handleError(_0x2ee7f2,null));};exports[_0xeeb9('0x24')]=function(_0x4b73ad,_0x56dca3){return db[_0xeeb9('0x3c')][_0xeeb9('0x45')]({'where':{'id':_0x4b73ad[_0xeeb9('0x43')]['id']}})[_0xeeb9('0x23')](handleEntityNotFound(_0x56dca3,null))['then'](removeEntity(_0x56dca3,null))[_0xeeb9('0x41')](handleError(_0x56dca3,null));};exports[_0xeeb9('0x47')]=function(_0x24a840,_0x1f3d30){var _0xe90ba7={'key':_0x24a840[_0xeeb9('0x46')]['key']};if(_0x24a840['body']['MailAccountId']){_0xe90ba7['MailAccountId']=_0x24a840[_0xeeb9('0x46')][_0xeeb9('0x48')];}else if(_0x24a840[_0xeeb9('0x46')][_0xeeb9('0x49')]){_0xe90ba7[_0xeeb9('0x49')]=_0x24a840[_0xeeb9('0x46')][_0xeeb9('0x49')];}else if(_0x24a840[_0xeeb9('0x46')][_0xeeb9('0x4a')]){_0xe90ba7[_0xeeb9('0x4a')]=_0x24a840[_0xeeb9('0x46')][_0xeeb9('0x4a')];}else if(_0x24a840[_0xeeb9('0x46')][_0xeeb9('0x4b')]){_0xe90ba7[_0xeeb9('0x4b')]=_0x24a840[_0xeeb9('0x46')][_0xeeb9('0x4b')];}return db[_0xeeb9('0x3c')]['find']({'where':_0xe90ba7})['then'](function(_0x51b55b){if(_0x51b55b){throw new db[(_0xeeb9('0x4c'))][(_0xeeb9('0x4d'))](_0xeeb9('0x4e'));}return db[_0xeeb9('0x3c')][_0xeeb9('0x47')](_0x24a840['body']);})['then'](function(_0x5b5bb8){var _0x31da99=_0x24a840[_0xeeb9('0x4f')][_0xeeb9('0x25')]({'plain':!![]});if(!_0x31da99)throw new Error(_0xeeb9('0x50'));if(_0x31da99[_0xeeb9('0x51')]===_0xeeb9('0x4f')){var _0x749e5=_0x5b5bb8[_0xeeb9('0x25')]({'plain':!![]});return db[_0xeeb9('0x52')][_0xeeb9('0x45')]({'where':{'name':_0xeeb9('0x53'),'userProfileId':_0x31da99['userProfileId']},'raw':!![]})[_0xeeb9('0x23')](function(_0xff6a7e){if(_0xff6a7e&&_0xff6a7e[_0xeeb9('0x54')]===0x0){return db['UserProfileResource'][_0xeeb9('0x47')]({'name':_0x749e5[_0xeeb9('0x28')],'resourceId':_0x749e5['id'],'type':_0xff6a7e[_0xeeb9('0x28')],'sectionId':_0xff6a7e['id']},{})['then'](function(){return _0x5b5bb8;});}else{return _0x5b5bb8;}})[_0xeeb9('0x41')](function(_0x4cd81e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cd81e);throw _0x4cd81e;});}return _0x5b5bb8;})[_0xeeb9('0x23')](respondWithResult(_0x1f3d30,0xc9))[_0xeeb9('0x41')](handleError(_0x1f3d30,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 1eb303a..08dcbbc 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 _0x1006=['api','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1f6923,_0x440d12){var _0x25d600=function(_0x250df8){while(--_0x250df8){_0x1f6923['push'](_0x1f6923['shift']());}};_0x25d600(++_0x440d12);}(_0x1006,0x102));var _0x6100=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1006[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x6100('0x0'));var util=require(_0x6100('0x1'));var logger=require('../../config/logger')(_0x6100('0x2'));var moment=require('moment');var BPromise=require(_0x6100('0x3'));var rp=require(_0x6100('0x4'));var fs=require('fs');var path=require(_0x6100('0x5'));var rimraf=require(_0x6100('0x6'));var config=require('../../config/environment');var attributes=require(_0x6100('0x7'));module[_0x6100('0x8')]=function(_0x5f26e6,_0x2e5166){return _0x5f26e6[_0x6100('0x9')]('CannedAnswer',attributes,{'tableName':_0x6100('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6100('0xb'),'collate':_0x6100('0xc')});};
\ No newline at end of file
+var _0xfb50=['api','moment','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','lodash','util'];(function(_0x28fa12,_0x431959){var _0x5abdeb=function(_0x2769ca){while(--_0x2769ca){_0x28fa12['push'](_0x28fa12['shift']());}};_0x5abdeb(++_0x431959);}(_0xfb50,0x148));var _0x0fb5=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xfb50[_0x55821d];return _0x58ea8a;};'use strict';var _=require(_0x0fb5('0x0'));var util=require(_0x0fb5('0x1'));var logger=require('../../config/logger')(_0x0fb5('0x2'));var moment=require(_0x0fb5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0fb5('0x4'));var config=require(_0x0fb5('0x5'));var attributes=require(_0x0fb5('0x6'));module[_0x0fb5('0x7')]=function(_0x1d689e,_0x2c0d97){return _0x1d689e[_0x0fb5('0x8')]('CannedAnswer',attributes,{'tableName':_0x0fb5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0fb5('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 4866d79..1e7c0da 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(_0x423ee6,_0xaa40a3){var _0x5caeca=function(_0x266960){while(--_0x266960){_0x423ee6['push'](_0x423ee6['shift']());}};_0x5caeca(++_0xaa40a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x384643,_0x51b03f){var _0x3c4c99=function(_0x156f68){while(--_0x156f68){_0x384643['push'](_0x384643['shift']());}};_0x3c4c99(++_0x51b03f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 d256b07..4aa6f18 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 _0x35d7=['get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller'];(function(_0x4877ef,_0x21a8f0){var _0x3b01d5=function(_0x5e76e9){while(--_0x5e76e9){_0x4877ef['push'](_0x4877ef['shift']());}};_0x3b01d5(++_0x21a8f0);}(_0x35d7,0x1cc));var _0x735d=function(_0x2b3bbb,_0x116659){_0x2b3bbb=_0x2b3bbb-0x0;var _0x1b71aa=_0x35d7[_0x2b3bbb];return _0x1b71aa;};'use strict';var multer=require(_0x735d('0x0'));var util=require(_0x735d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x735d('0x2'));var router=express[_0x735d('0x3')]();var fs_extra=require(_0x735d('0x4'));var auth=require(_0x735d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x735d('0x6'));var controller=require(_0x735d('0x7'));router[_0x735d('0x8')]('/',auth[_0x735d('0x9')](),controller[_0x735d('0xa')]);router[_0x735d('0x8')](_0x735d('0xb'),auth[_0x735d('0x9')](),controller[_0x735d('0xc')]);router[_0x735d('0xd')]('/',auth[_0x735d('0x9')](),controller[_0x735d('0xe')]);router['put'](_0x735d('0xb'),auth[_0x735d('0x9')](),controller[_0x735d('0xf')]);router[_0x735d('0x10')](_0x735d('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x735d('0x11')]=router;
\ No newline at end of file
+var _0x08e0=['delete','destroy','multer','path','express','Router','fs-extra','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','update'];(function(_0x4b8cd7,_0x2da774){var _0x1dbab5=function(_0x322891){while(--_0x322891){_0x4b8cd7['push'](_0x4b8cd7['shift']());}};_0x1dbab5(++_0x2da774);}(_0x08e0,0xe3));var _0x008e=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0x08e0[_0x4defd6];return _0x4c9276;};'use strict';var multer=require(_0x008e('0x0'));var util=require('util');var path=require(_0x008e('0x1'));var timeout=require('connect-timeout');var express=require(_0x008e('0x2'));var router=express[_0x008e('0x3')]();var fs_extra=require(_0x008e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x008e('0x5'));var controller=require(_0x008e('0x6'));router[_0x008e('0x7')]('/',auth[_0x008e('0x8')](),controller['index']);router[_0x008e('0x7')](_0x008e('0x9'),auth[_0x008e('0x8')](),controller[_0x008e('0xa')]);router[_0x008e('0xb')]('/',auth[_0x008e('0x8')](),controller['create']);router['put'](_0x008e('0x9'),auth[_0x008e('0x8')](),controller[_0x008e('0xc')]);router[_0x008e('0xd')](_0x008e('0x9'),auth[_0x008e('0x8')](),controller[_0x008e('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index e42ac85..dff1339 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 _0x652b=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x4227e6,_0x202f7c){var _0x44e865=function(_0x1a31ac){while(--_0x1a31ac){_0x4227e6['push'](_0x4227e6['shift']());}};_0x44e865(++_0x202f7c);}(_0x652b,0x68));var _0xb652=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x652b[_0x41d432];return _0x1650f9;};'use strict';var Sequelize=require(_0xb652('0x0'));module[_0xb652('0x1')]={'calldate':{'type':Sequelize[_0xb652('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xb652('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xb652('0x3')]},'channel':{'type':Sequelize[_0xb652('0x3')]},'dstchannel':{'type':Sequelize[_0xb652('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb652('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb652('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xb652('0x3')]},'uniqueid':{'type':Sequelize[_0xb652('0x3')]},'linkedid':{'type':Sequelize[_0xb652('0x3')]},'sequence':{'type':Sequelize[_0xb652('0x3')]},'peeraccount':{'type':Sequelize[_0xb652('0x3')]},'type':{'type':Sequelize[_0xb652('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xda55=['INTEGER','sequelize','exports','STRING'];(function(_0x42a1fb,_0xbbf9dd){var _0x4c109d=function(_0x308d18){while(--_0x308d18){_0x42a1fb['push'](_0x42a1fb['shift']());}};_0x4c109d(++_0xbbf9dd);}(_0xda55,0x6d));var _0x5da5=function(_0x3b7a06,_0x41f79e){_0x3b7a06=_0x3b7a06-0x0;var _0x363e31=_0xda55[_0x3b7a06];return _0x363e31;};'use strict';var Sequelize=require(_0x5da5('0x0'));module[_0x5da5('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x5da5('0x2')]},'src':{'type':Sequelize[_0x5da5('0x2')]},'dst':{'type':Sequelize[_0x5da5('0x2')]},'dcontext':{'type':Sequelize[_0x5da5('0x2')]},'channel':{'type':Sequelize[_0x5da5('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5da5('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x5da5('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5da5('0x2')]},'amaflags':{'type':Sequelize[_0x5da5('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5da5('0x2')]},'userfield':{'type':Sequelize[_0x5da5('0x2')]},'uniqueid':{'type':Sequelize[_0x5da5('0x2')]},'linkedid':{'type':Sequelize[_0x5da5('0x2')]},'sequence':{'type':Sequelize[_0x5da5('0x2')]},'peeraccount':{'type':Sequelize[_0x5da5('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x5da5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 78ecfe9..bbd0e1f 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 _0xd13e=['limit','count','Content-Range','reject','save','update','destroy','then','end','sendStatus','error','name','index','map','Cdr','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','where','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd13e,0x193));var _0xed13=function(_0x17db89,_0x4482c9){_0x17db89=_0x17db89-0x0;var _0x39d187=_0xd13e[_0x17db89];return _0x39d187;};'use strict';var emlformat=require(_0xed13('0x0'));var rimraf=require(_0xed13('0x1'));var zipdir=require(_0xed13('0x2'));var jsonpatch=require(_0xed13('0x3'));var rp=require('request-promise');var moment=require(_0xed13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed13('0x5'));var util=require('util');var path=require(_0xed13('0x6'));var sox=require(_0xed13('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed13('0x8'));var squel=require(_0xed13('0x9'));var crypto=require(_0xed13('0xa'));var jsforce=require(_0xed13('0xb'));var deskjs=require(_0xed13('0xc'));var toCsv=require(_0xed13('0xd'));var querystring=require(_0xed13('0xe'));var Papa=require(_0xed13('0xf'));var Redis=require(_0xed13('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed13('0x11'));var as=require(_0xed13('0x12'));var hardwareService=require(_0xed13('0x13'));var logger=require(_0xed13('0x14'))(_0xed13('0x15'));var utils=require('../../config/utils');var config=require(_0xed13('0x16'));var licenseUtil=require(_0xed13('0x17'));var db=require(_0xed13('0x18'))['db'];function respondWithStatusCode(_0x3c0b22,_0x936103){_0x936103=_0x936103||0xcc;return function(_0x3295ba){if(_0x3295ba){return _0x3c0b22['sendStatus'](_0x936103);}return _0x3c0b22[_0xed13('0x19')](_0x936103)['end']();};}function respondWithResult(_0x257074,_0x56fdc6){_0x56fdc6=_0x56fdc6||0xc8;return function(_0x6e2978){if(_0x6e2978){return _0x257074['status'](_0x56fdc6)[_0xed13('0x1a')](_0x6e2978);}};}function respondWithFilteredResult(_0x4d5435,_0x38901a){return function(_0xf900d2){if(_0xf900d2){var _0x1d3d67=typeof _0x38901a[_0xed13('0x1b')]===_0xed13('0x1c')&&typeof _0x38901a[_0xed13('0x1d')]===_0xed13('0x1c');var _0x1148a3=_0xf900d2[_0xed13('0x1e')];var _0x1e161f=_0x1d3d67?0x0:_0x38901a[_0xed13('0x1b')];var _0x31de07=_0x1d3d67?_0xf900d2[_0xed13('0x1e')]:_0x38901a[_0xed13('0x1b')]+_0x38901a[_0xed13('0x1d')];var _0x2f38c9;if(_0x31de07>=_0x1148a3){_0x31de07=_0x1148a3;_0x2f38c9=0xc8;}else{_0x2f38c9=0xce;}_0x4d5435['status'](_0x2f38c9);return _0x4d5435['set'](_0xed13('0x1f'),_0x1e161f+'-'+_0x31de07+'/'+_0x1148a3)[_0xed13('0x1a')](_0xf900d2);}return null;};}function patchUpdates(_0x4f455b){return function(_0x40dd86){try{jsonpatch['apply'](_0x40dd86,_0x4f455b,!![]);}catch(_0x4e9e3b){return BPromise[_0xed13('0x20')](_0x4e9e3b);}return _0x40dd86[_0xed13('0x21')]();};}function saveUpdates(_0x2d62cd,_0x192d12){return function(_0x1d7621){if(_0x1d7621){return _0x1d7621[_0xed13('0x22')](_0x2d62cd)['then'](function(_0x5c0daf){return _0x5c0daf;});}return null;};}function removeEntity(_0x5d7ae1,_0x19d51b){return function(_0x3b1f23){if(_0x3b1f23){return _0x3b1f23[_0xed13('0x23')]()[_0xed13('0x24')](function(){_0x5d7ae1[_0xed13('0x19')](0xcc)[_0xed13('0x25')]();});}};}function handleEntityNotFound(_0x1f0405,_0x276c57){return function(_0x2410e2){if(!_0x2410e2){_0x1f0405[_0xed13('0x26')](0x194);}return _0x2410e2;};}function handleError(_0x1f064c,_0x3bc666){_0x3bc666=_0x3bc666||0x1f4;return function(_0x2c6c33){logger[_0xed13('0x27')](_0x2c6c33['stack']);if(_0x2c6c33['name']){delete _0x2c6c33[_0xed13('0x28')];}_0x1f064c[_0xed13('0x19')](_0x3bc666)['send'](_0x2c6c33);};}exports[_0xed13('0x29')]=function(_0x40444a,_0x4ed119){var _0x7ce996={},_0x2066ca={},_0x323156={'count':0x0,'rows':[]};var _0x570929=_[_0xed13('0x2a')](db[_0xed13('0x2b')]['rawAttributes'],function(_0x433665){return{'name':_0x433665[_0xed13('0x2c')],'type':_0x433665['type'][_0xed13('0x2d')]};});_0x2066ca[_0xed13('0x2e')]=_[_0xed13('0x2a')](_0x570929,_0xed13('0x28'));_0x2066ca[_0xed13('0x2f')]=_[_0xed13('0x30')](_0x40444a[_0xed13('0x2f')]);_0x2066ca['filters']=_[_0xed13('0x31')](_0x2066ca['model'],_0x2066ca['query']);_0x7ce996[_0xed13('0x32')]=_[_0xed13('0x31')](_0x2066ca[_0xed13('0x2e')],qs['fields'](_0x40444a[_0xed13('0x2f')][_0xed13('0x33')]));_0x7ce996[_0xed13('0x32')]=_0x7ce996['attributes'][_0xed13('0x34')]?_0x7ce996[_0xed13('0x32')]:_0x2066ca[_0xed13('0x2e')];if(!_0x40444a[_0xed13('0x2f')]['hasOwnProperty'](_0xed13('0x35'))){_0x7ce996[_0xed13('0x1d')]=qs[_0xed13('0x1d')](_0x40444a[_0xed13('0x2f')][_0xed13('0x1d')]);_0x7ce996[_0xed13('0x1b')]=qs[_0xed13('0x1b')](_0x40444a[_0xed13('0x2f')][_0xed13('0x1b')]);}_0x7ce996[_0xed13('0x36')]=qs['sort'](_0x40444a[_0xed13('0x2f')][_0xed13('0x37')]);_0x7ce996['where']=qs['filters'](_['pick'](_0x40444a[_0xed13('0x2f')],_0x2066ca[_0xed13('0x38')]),_0x570929);if(_0x40444a['query']['filter']){_0x7ce996[_0xed13('0x39')]=_[_0xed13('0x3a')](_0x7ce996[_0xed13('0x39')],{'$or':_[_0xed13('0x2a')](_0x570929,function(_0x358098){if(_0x358098['type']!=='VIRTUAL'){var _0x1e943a={};_0x1e943a[_0x358098['name']]={'$like':'%'+_0x40444a[_0xed13('0x2f')]['filter']+'%'};return _0x1e943a;}})});}_0x7ce996=_[_0xed13('0x3a')]({},_0x7ce996,_0x40444a['options']);var _0x4d6429={'where':_0x7ce996['where']};return db[_0xed13('0x2b')][_0xed13('0x1e')](_0x4d6429)[_0xed13('0x24')](function(_0x42d5f7){_0x323156[_0xed13('0x1e')]=_0x42d5f7;if(_0x40444a['query'][_0xed13('0x3b')]){_0x7ce996[_0xed13('0x3c')]=[{'all':!![]}];}return db[_0xed13('0x2b')][_0xed13('0x3d')](_0x7ce996);})[_0xed13('0x24')](function(_0x5a8cfb){_0x323156[_0xed13('0x3e')]=_0x5a8cfb;return _0x323156;})[_0xed13('0x24')](respondWithFilteredResult(_0x4ed119,_0x7ce996))[_0xed13('0x3f')](handleError(_0x4ed119,null));};exports[_0xed13('0x40')]=function(_0x187e28,_0x2e43b5){var _0x535de7={'raw':!![],'where':{'id':_0x187e28[_0xed13('0x41')]['id']}},_0x2f04ef={};_0x2f04ef[_0xed13('0x2e')]=_[_0xed13('0x30')](db[_0xed13('0x2b')][_0xed13('0x42')]);_0x2f04ef[_0xed13('0x2f')]=_[_0xed13('0x30')](_0x187e28[_0xed13('0x2f')]);_0x2f04ef[_0xed13('0x38')]=_[_0xed13('0x31')](_0x2f04ef[_0xed13('0x2e')],_0x2f04ef[_0xed13('0x2f')]);_0x535de7[_0xed13('0x32')]=_['intersection'](_0x2f04ef[_0xed13('0x2e')],qs[_0xed13('0x33')](_0x187e28['query'][_0xed13('0x33')]));_0x535de7[_0xed13('0x32')]=_0x535de7[_0xed13('0x32')]['length']?_0x535de7[_0xed13('0x32')]:_0x2f04ef[_0xed13('0x2e')];if(_0x187e28[_0xed13('0x2f')]['includeAll']){_0x535de7['include']=[{'all':!![]}];}_0x535de7=_[_0xed13('0x3a')]({},_0x535de7,_0x187e28[_0xed13('0x43')]);return db['Cdr'][_0xed13('0x44')](_0x535de7)[_0xed13('0x24')](handleEntityNotFound(_0x2e43b5,null))[_0xed13('0x24')](respondWithResult(_0x2e43b5,null))[_0xed13('0x3f')](handleError(_0x2e43b5,null));};exports['create']=function(_0x1df911,_0xf4ea89){return db[_0xed13('0x2b')][_0xed13('0x45')](_0x1df911['body'],{})[_0xed13('0x24')](respondWithResult(_0xf4ea89,0xc9))['catch'](handleError(_0xf4ea89,null));};exports[_0xed13('0x22')]=function(_0x50d12f,_0x5a0828){if(_0x50d12f[_0xed13('0x46')]['id']){delete _0x50d12f[_0xed13('0x46')]['id'];}return db['Cdr'][_0xed13('0x44')]({'where':{'id':_0x50d12f[_0xed13('0x41')]['id']}})[_0xed13('0x24')](handleEntityNotFound(_0x5a0828,null))[_0xed13('0x24')](saveUpdates(_0x50d12f['body'],null))[_0xed13('0x24')](respondWithResult(_0x5a0828,null))['catch'](handleError(_0x5a0828,null));};exports[_0xed13('0x23')]=function(_0x365e50,_0x19762a){return db[_0xed13('0x2b')][_0xed13('0x44')]({'where':{'id':_0x365e50[_0xed13('0x41')]['id']}})[_0xed13('0x24')](handleEntityNotFound(_0x19762a,null))[_0xed13('0x24')](removeEntity(_0x19762a,null))['catch'](handleError(_0x19762a,null));};exports[_0xed13('0x47')]=function(_0x38f66d,_0x372deb){return db[_0xed13('0x2b')]['describe']()[_0xed13('0x24')](respondWithResult(_0x372deb,null))['catch'](handleError(_0x372deb,null));};
\ No newline at end of file
+var _0xe0ae=['where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','catch','create','body','update','find','describe','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort'];(function(_0x185d2a,_0x308609){var _0x4dea27=function(_0x513443){while(--_0x513443){_0x185d2a['push'](_0x185d2a['shift']());}};_0x4dea27(++_0x308609);}(_0xe0ae,0xa1));var _0xee0a=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xe0ae[_0x44946b];return _0x249bc4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee0a('0x0'));var jsonpatch=require(_0xee0a('0x1'));var rp=require('request-promise');var moment=require(_0xee0a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xee0a('0x3'));var util=require(_0xee0a('0x4'));var path=require('path');var sox=require(_0xee0a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee0a('0x6'));var _=require(_0xee0a('0x7'));var squel=require(_0xee0a('0x8'));var crypto=require(_0xee0a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xee0a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee0a('0xb'));var Redis=require(_0xee0a('0xc'));var authService=require(_0xee0a('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xee0a('0xe'));var hardwareService=require(_0xee0a('0xf'));var logger=require('../../config/logger')(_0xee0a('0x10'));var utils=require('../../config/utils');var config=require(_0xee0a('0x11'));var licenseUtil=require(_0xee0a('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fcf59,_0x5c56d9){_0x5c56d9=_0x5c56d9||0xcc;return function(_0x32fad9){if(_0x32fad9){return _0x1fcf59[_0xee0a('0x13')](_0x5c56d9);}return _0x1fcf59['status'](_0x5c56d9)['end']();};}function respondWithResult(_0x325a8e,_0x41b70a){_0x41b70a=_0x41b70a||0xc8;return function(_0x347604){if(_0x347604){return _0x325a8e[_0xee0a('0x14')](_0x41b70a)[_0xee0a('0x15')](_0x347604);}};}function respondWithFilteredResult(_0x57afe6,_0xb891a9){return function(_0xd39431){if(_0xd39431){var _0x50063f=typeof _0xb891a9[_0xee0a('0x16')]===_0xee0a('0x17')&&typeof _0xb891a9[_0xee0a('0x18')]===_0xee0a('0x17');var _0x4f711b=_0xd39431[_0xee0a('0x19')];var _0x1d7a8a=_0x50063f?0x0:_0xb891a9[_0xee0a('0x16')];var _0x55c474=_0x50063f?_0xd39431[_0xee0a('0x19')]:_0xb891a9[_0xee0a('0x16')]+_0xb891a9[_0xee0a('0x18')];var _0x24f8f1;if(_0x55c474>=_0x4f711b){_0x55c474=_0x4f711b;_0x24f8f1=0xc8;}else{_0x24f8f1=0xce;}_0x57afe6['status'](_0x24f8f1);return _0x57afe6[_0xee0a('0x1a')](_0xee0a('0x1b'),_0x1d7a8a+'-'+_0x55c474+'/'+_0x4f711b)[_0xee0a('0x15')](_0xd39431);}return null;};}function patchUpdates(_0x201d32){return function(_0x5c981e){try{jsonpatch[_0xee0a('0x1c')](_0x5c981e,_0x201d32,!![]);}catch(_0xff2f14){return BPromise[_0xee0a('0x1d')](_0xff2f14);}return _0x5c981e[_0xee0a('0x1e')]();};}function saveUpdates(_0x39fa96,_0x1eb176){return function(_0x2c543c){if(_0x2c543c){return _0x2c543c['update'](_0x39fa96)[_0xee0a('0x1f')](function(_0x3d5459){return _0x3d5459;});}return null;};}function removeEntity(_0x27989c,_0x38d029){return function(_0x567810){if(_0x567810){return _0x567810[_0xee0a('0x20')]()[_0xee0a('0x1f')](function(){_0x27989c[_0xee0a('0x14')](0xcc)[_0xee0a('0x21')]();});}};}function handleEntityNotFound(_0x4c61e2,_0x50e9d1){return function(_0x578ecf){if(!_0x578ecf){_0x4c61e2[_0xee0a('0x13')](0x194);}return _0x578ecf;};}function handleError(_0x4f9f56,_0x5c7cfa){_0x5c7cfa=_0x5c7cfa||0x1f4;return function(_0x1c9ad8){logger[_0xee0a('0x22')](_0x1c9ad8[_0xee0a('0x23')]);if(_0x1c9ad8['name']){delete _0x1c9ad8[_0xee0a('0x24')];}_0x4f9f56[_0xee0a('0x14')](_0x5c7cfa)[_0xee0a('0x25')](_0x1c9ad8);};}exports[_0xee0a('0x26')]=function(_0x2e7f18,_0x45538d){var _0x145332={},_0x408909={},_0x65e054={'count':0x0,'rows':[]};var _0x7b472b=_['map'](db[_0xee0a('0x27')][_0xee0a('0x28')],function(_0x284be5){return{'name':_0x284be5[_0xee0a('0x29')],'type':_0x284be5[_0xee0a('0x2a')][_0xee0a('0x2b')]};});_0x408909['model']=_[_0xee0a('0x2c')](_0x7b472b,_0xee0a('0x24'));_0x408909[_0xee0a('0x2d')]=_[_0xee0a('0x2e')](_0x2e7f18['query']);_0x408909[_0xee0a('0x2f')]=_['intersection'](_0x408909[_0xee0a('0x30')],_0x408909[_0xee0a('0x2d')]);_0x145332[_0xee0a('0x31')]=_[_0xee0a('0x32')](_0x408909[_0xee0a('0x30')],qs[_0xee0a('0x33')](_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x33')]));_0x145332['attributes']=_0x145332[_0xee0a('0x31')][_0xee0a('0x34')]?_0x145332['attributes']:_0x408909[_0xee0a('0x30')];if(!_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x35')]('nolimit')){_0x145332[_0xee0a('0x18')]=qs[_0xee0a('0x18')](_0x2e7f18[_0xee0a('0x2d')]['limit']);_0x145332[_0xee0a('0x16')]=qs[_0xee0a('0x16')](_0x2e7f18[_0xee0a('0x2d')]['offset']);}_0x145332['order']=qs[_0xee0a('0x36')](_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x36')]);_0x145332[_0xee0a('0x37')]=qs[_0xee0a('0x2f')](_[_0xee0a('0x38')](_0x2e7f18[_0xee0a('0x2d')],_0x408909[_0xee0a('0x2f')]),_0x7b472b);if(_0x2e7f18[_0xee0a('0x2d')]['filter']){_0x145332[_0xee0a('0x37')]=_[_0xee0a('0x39')](_0x145332['where'],{'$or':_[_0xee0a('0x2c')](_0x7b472b,function(_0x20a6f2){if(_0x20a6f2['type']!==_0xee0a('0x3a')){var _0x22b1c0={};_0x22b1c0[_0x20a6f2[_0xee0a('0x24')]]={'$like':'%'+_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x3b')]+'%'};return _0x22b1c0;}})});}_0x145332=_[_0xee0a('0x39')]({},_0x145332,_0x2e7f18[_0xee0a('0x3c')]);var _0x1b88df={'where':_0x145332[_0xee0a('0x37')]};return db['Cdr'][_0xee0a('0x19')](_0x1b88df)[_0xee0a('0x1f')](function(_0x41eba8){_0x65e054[_0xee0a('0x19')]=_0x41eba8;if(_0x2e7f18['query']['includeAll']){_0x145332[_0xee0a('0x3d')]=[{'all':!![]}];}return db[_0xee0a('0x27')][_0xee0a('0x3e')](_0x145332);})[_0xee0a('0x1f')](function(_0x1b69b9){_0x65e054[_0xee0a('0x3f')]=_0x1b69b9;return _0x65e054;})[_0xee0a('0x1f')](respondWithFilteredResult(_0x45538d,_0x145332))['catch'](handleError(_0x45538d,null));};exports['show']=function(_0x285543,_0x283062){var _0x587ee3={'raw':!![],'where':{'id':_0x285543[_0xee0a('0x40')]['id']}},_0x3293b5={};_0x3293b5['model']=_[_0xee0a('0x2e')](db[_0xee0a('0x27')][_0xee0a('0x28')]);_0x3293b5[_0xee0a('0x2d')]=_[_0xee0a('0x2e')](_0x285543[_0xee0a('0x2d')]);_0x3293b5[_0xee0a('0x2f')]=_['intersection'](_0x3293b5['model'],_0x3293b5[_0xee0a('0x2d')]);_0x587ee3['attributes']=_['intersection'](_0x3293b5['model'],qs[_0xee0a('0x33')](_0x285543[_0xee0a('0x2d')]['fields']));_0x587ee3['attributes']=_0x587ee3['attributes']['length']?_0x587ee3[_0xee0a('0x31')]:_0x3293b5[_0xee0a('0x30')];if(_0x285543[_0xee0a('0x2d')][_0xee0a('0x41')]){_0x587ee3[_0xee0a('0x3d')]=[{'all':!![]}];}_0x587ee3=_[_0xee0a('0x39')]({},_0x587ee3,_0x285543['options']);return db[_0xee0a('0x27')]['find'](_0x587ee3)[_0xee0a('0x1f')](handleEntityNotFound(_0x283062,null))[_0xee0a('0x1f')](respondWithResult(_0x283062,null))[_0xee0a('0x42')](handleError(_0x283062,null));};exports[_0xee0a('0x43')]=function(_0x567680,_0x3ef07b){return db[_0xee0a('0x27')][_0xee0a('0x43')](_0x567680[_0xee0a('0x44')],{})[_0xee0a('0x1f')](respondWithResult(_0x3ef07b,0xc9))[_0xee0a('0x42')](handleError(_0x3ef07b,null));};exports[_0xee0a('0x45')]=function(_0x4cd7d3,_0x51300e){if(_0x4cd7d3[_0xee0a('0x44')]['id']){delete _0x4cd7d3[_0xee0a('0x44')]['id'];}return db[_0xee0a('0x27')][_0xee0a('0x46')]({'where':{'id':_0x4cd7d3[_0xee0a('0x40')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x51300e,null))[_0xee0a('0x1f')](saveUpdates(_0x4cd7d3[_0xee0a('0x44')],null))[_0xee0a('0x1f')](respondWithResult(_0x51300e,null))[_0xee0a('0x42')](handleError(_0x51300e,null));};exports[_0xee0a('0x20')]=function(_0x335356,_0x57face){return db[_0xee0a('0x27')][_0xee0a('0x46')]({'where':{'id':_0x335356[_0xee0a('0x40')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x57face,null))[_0xee0a('0x1f')](removeEntity(_0x57face,null))['catch'](handleError(_0x57face,null));};exports[_0xee0a('0x47')]=function(_0x160123,_0xc9c3a3){return db[_0xee0a('0x27')][_0xee0a('0x47')]()['then'](respondWithResult(_0xc9c3a3,null))[_0xee0a('0x42')](handleError(_0xc9c3a3,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 2b7e2f0..f00f463 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x261408,_0x213155){var _0x41cd82=function(_0x2135d8){while(--_0x2135d8){_0x261408['push'](_0x261408['shift']());}};_0x41cd82(++_0x213155);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x501eaf,_0x48b211){var _0x15c5b1=function(_0x4d7d1d){while(--_0x4d7d1d){_0x501eaf['push'](_0x501eaf['shift']());}};_0x15c5b1(++_0x48b211);}(_0x7a54,0x106));var _0x47a5=function(_0x20b406,_0x52c9f4){_0x20b406=_0x20b406-0x0;var _0x1ccf53=_0x7a54[_0x20b406];return _0x1ccf53;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index e8ebe65..7bdb560 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 _0xbfac=['request\x20sent','error','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s'];(function(_0xb6c6f1,_0x12fa19){var _0xb8552f=function(_0x3b2dc7){while(--_0x3b2dc7){_0xb6c6f1['push'](_0xb6c6f1['shift']());}};_0xb8552f(++_0x12fa19);}(_0xbfac,0x110));var _0xcbfa=function(_0xff3bc2,_0x1d1b8e){_0xff3bc2=_0xff3bc2-0x0;var _0x18b857=_0xbfac[_0xff3bc2];return _0x18b857;};'use strict';var _=require('lodash');var util=require(_0xcbfa('0x0'));var moment=require(_0xcbfa('0x1'));var BPromise=require(_0xcbfa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbfa('0x3'));var db=require(_0xcbfa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbfa('0x5'))(_0xcbfa('0x6'));var config=require(_0xcbfa('0x7'));var jayson=require(_0xcbfa('0x8'));var client=jayson[_0xcbfa('0x9')][_0xcbfa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x241c96,_0x25426a,_0x3e7494){return new BPromise(function(_0x395361,_0x19127a){return client[_0xcbfa('0xb')](_0x241c96,_0x3e7494)['then'](function(_0x49543f){logger['info'](_0xcbfa('0xc'),_0x25426a,_0xcbfa('0xd'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x25426a,'request\x20sent',JSON['stringify'](_0x49543f));if(_0x49543f['error']){if(_0x49543f[_0xcbfa('0xe')]['code']===0x1f4){logger['error'](_0xcbfa('0xc'),_0x25426a,_0x49543f[_0xcbfa('0xe')]['message']);return _0x19127a(_0x49543f[_0xcbfa('0xe')][_0xcbfa('0xf')]);}logger['error'](_0xcbfa('0xc'),_0x25426a,_0x49543f[_0xcbfa('0xe')][_0xcbfa('0xf')]);return _0x395361(_0x49543f[_0xcbfa('0xe')][_0xcbfa('0xf')]);}else{logger[_0xcbfa('0x10')](_0xcbfa('0xc'),_0x25426a,_0xcbfa('0xd'));_0x395361(_0x49543f[_0xcbfa('0x11')][_0xcbfa('0xf')]);}})[_0xcbfa('0x12')](function(_0xe56d5d){logger[_0xcbfa('0xe')](_0xcbfa('0xc'),_0x25426a,_0xe56d5d);_0x19127a(_0xe56d5d);});});}
\ No newline at end of file
+var _0xf1f9=['debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf1f9,0x153));var _0x9f1f=function(_0x1bf77e,_0x3e3daa){_0x1bf77e=_0x1bf77e-0x0;var _0x33473d=_0xf1f9[_0x1bf77e];return _0x33473d;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require(_0x9f1f('0x3'));var rs=require(_0x9f1f('0x4'));var fs=require('fs');var Redis=require(_0x9f1f('0x5'));var db=require(_0x9f1f('0x6'))['db'];var utils=require(_0x9f1f('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9f1f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9f1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x123f17,_0x15ecad,_0x41c687){return new BPromise(function(_0x258f43,_0x2aa253){return client[_0x9f1f('0xa')](_0x123f17,_0x41c687)['then'](function(_0x3a0bb8){logger['info'](_0x9f1f('0xb'),_0x15ecad,_0x9f1f('0xc'));logger[_0x9f1f('0xd')](_0x9f1f('0xe'),_0x15ecad,_0x9f1f('0xc'),JSON[_0x9f1f('0xf')](_0x3a0bb8));if(_0x3a0bb8['error']){if(_0x3a0bb8[_0x9f1f('0x10')][_0x9f1f('0x11')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x15ecad,_0x3a0bb8['error'][_0x9f1f('0x12')]);return _0x2aa253(_0x3a0bb8['error'][_0x9f1f('0x12')]);}logger[_0x9f1f('0x10')](_0x9f1f('0xb'),_0x15ecad,_0x3a0bb8[_0x9f1f('0x10')][_0x9f1f('0x12')]);return _0x258f43(_0x3a0bb8[_0x9f1f('0x10')]['message']);}else{logger[_0x9f1f('0x13')](_0x9f1f('0xb'),_0x15ecad,'request\x20sent');_0x258f43(_0x3a0bb8[_0x9f1f('0x14')][_0x9f1f('0x12')]);}})[_0x9f1f('0x15')](function(_0x37ee03){logger['error']('Cdr,\x20%s,\x20%s',_0x15ecad,_0x37ee03);_0x2aa253(_0x37ee03);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 539ba14..3910d4c 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(_0x25a972,_0x5d2fcd){var _0x24ad56=function(_0x3d0e5f){while(--_0x3d0e5f){_0x25a972['push'](_0x25a972['shift']());}};_0x24ad56(++_0x5d2fcd);}(_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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x325111,_0x5a9c59){var _0x34362d=function(_0x24e95a){while(--_0x24e95a){_0x325111['push'](_0x325111['shift']());}};_0x34362d(++_0x5a9c59);}(_0xb10b,0x12a));var _0xbb10=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0xb10b[_0x1399d6];return _0x4a9db4;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 d4175fc..59259fe 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 _0xd0fe=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0xd0fe,0x1f2));var _0xed0f=function(_0x362ba1,_0x55f987){_0x362ba1=_0x362ba1-0x0;var _0x4977e7=_0xd0fe[_0x362ba1];return _0x4977e7;};'use strict';var Sequelize=require(_0xed0f('0x0'));module[_0xed0f('0x1')]={'priority':{'type':Sequelize[_0xed0f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xed0f('0x3')],'allowNull':![],'defaultValue':_0xed0f('0x4')},'appdata':{'type':Sequelize[_0xed0f('0x5')]()},'description':{'type':Sequelize[_0xed0f('0x3')]},'interval':{'type':Sequelize[_0xed0f('0x3')],'defaultValue':_0xed0f('0x6')}};
\ No newline at end of file
+var _0x04d0=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x2800ea,_0x54d58a){var _0x3d37aa=function(_0x13251c){while(--_0x13251c){_0x2800ea['push'](_0x2800ea['shift']());}};_0x3d37aa(++_0x54d58a);}(_0x04d0,0x7e));var _0x004d=function(_0x1b7433,_0x3f4f45){_0x1b7433=_0x1b7433-0x0;var _0x2b116f=_0x04d0[_0x1b7433];return _0x2b116f;};'use strict';var Sequelize=require(_0x004d('0x0'));module[_0x004d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x004d('0x2')],'allowNull':![],'defaultValue':_0x004d('0x3')},'appdata':{'type':Sequelize[_0x004d('0x4')]()},'description':{'type':Sequelize[_0x004d('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x004d('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 18d8a5a..6380806 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 _0x3ae9=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','show','params','model','query','filters','attributes','intersection','fields','length','includeAll','include','merge','ChatApplication','catch','body','find','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x252884,_0x117ddf){var _0x4de0e6=function(_0x442519){while(--_0x442519){_0x252884['push'](_0x252884['shift']());}};_0x4de0e6(++_0x117ddf);}(_0x3ae9,0xdb));var _0x93ae=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x3ae9[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93ae('0x0'));var jsonpatch=require(_0x93ae('0x1'));var rp=require(_0x93ae('0x2'));var moment=require('moment');var BPromise=require(_0x93ae('0x3'));var Mustache=require(_0x93ae('0x4'));var util=require(_0x93ae('0x5'));var path=require(_0x93ae('0x6'));var sox=require('sox');var csv=require(_0x93ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ae('0x8'));var _=require(_0x93ae('0x9'));var squel=require(_0x93ae('0xa'));var crypto=require(_0x93ae('0xb'));var jsforce=require(_0x93ae('0xc'));var deskjs=require(_0x93ae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x93ae('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x93ae('0xf'));var as=require(_0x93ae('0x10'));var hardwareService=require(_0x93ae('0x11'));var logger=require(_0x93ae('0x12'))(_0x93ae('0x13'));var utils=require(_0x93ae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x93ae('0x15'))['db'];function respondWithStatusCode(_0x1a23a3,_0x4a9f52){_0x4a9f52=_0x4a9f52||0xcc;return function(_0x571e5f){if(_0x571e5f){return _0x1a23a3[_0x93ae('0x16')](_0x4a9f52);}return _0x1a23a3['status'](_0x4a9f52)[_0x93ae('0x17')]();};}function respondWithResult(_0xbaf0e,_0x5b4ea1){_0x5b4ea1=_0x5b4ea1||0xc8;return function(_0x392a55){if(_0x392a55){return _0xbaf0e[_0x93ae('0x18')](_0x5b4ea1)[_0x93ae('0x19')](_0x392a55);}};}function respondWithFilteredResult(_0x1f8aa2,_0x121937){return function(_0x2d1df5){if(_0x2d1df5){var _0x5ed82a=typeof _0x121937[_0x93ae('0x1a')]===_0x93ae('0x1b')&&typeof _0x121937[_0x93ae('0x1c')]==='undefined';var _0x1a1718=_0x2d1df5['count'];var _0x54cfd0=_0x5ed82a?0x0:_0x121937[_0x93ae('0x1a')];var _0x51c77d=_0x5ed82a?_0x2d1df5[_0x93ae('0x1d')]:_0x121937[_0x93ae('0x1a')]+_0x121937['limit'];var _0x2dd19a;if(_0x51c77d>=_0x1a1718){_0x51c77d=_0x1a1718;_0x2dd19a=0xc8;}else{_0x2dd19a=0xce;}_0x1f8aa2[_0x93ae('0x18')](_0x2dd19a);return _0x1f8aa2[_0x93ae('0x1e')](_0x93ae('0x1f'),_0x54cfd0+'-'+_0x51c77d+'/'+_0x1a1718)['json'](_0x2d1df5);}return null;};}function patchUpdates(_0x128913){return function(_0x2f4187){try{jsonpatch['apply'](_0x2f4187,_0x128913,!![]);}catch(_0x3e0407){return BPromise[_0x93ae('0x20')](_0x3e0407);}return _0x2f4187[_0x93ae('0x21')]();};}function saveUpdates(_0x29922f,_0x26d5ac){return function(_0x468fdf){if(_0x468fdf){return _0x468fdf[_0x93ae('0x22')](_0x29922f)['then'](function(_0x5e7c32){return _0x5e7c32;});}return null;};}function removeEntity(_0xd33af5,_0x283e50){return function(_0x4f9f43){if(_0x4f9f43){return _0x4f9f43['destroy']()[_0x93ae('0x23')](function(){_0xd33af5[_0x93ae('0x18')](0xcc)[_0x93ae('0x17')]();});}};}function handleEntityNotFound(_0x10f6a3,_0x1abea7){return function(_0xe17086){if(!_0xe17086){_0x10f6a3[_0x93ae('0x16')](0x194);}return _0xe17086;};}function handleError(_0x32ddca,_0x542656){_0x542656=_0x542656||0x1f4;return function(_0x564c15){logger['error'](_0x564c15[_0x93ae('0x24')]);if(_0x564c15[_0x93ae('0x25')]){delete _0x564c15[_0x93ae('0x25')];}_0x32ddca[_0x93ae('0x18')](_0x542656)[_0x93ae('0x26')](_0x564c15);};}exports[_0x93ae('0x27')]=function(_0x520d6d,_0x54a37b){var _0x223f42={'raw':!![],'where':{'id':_0x520d6d[_0x93ae('0x28')]['id']}},_0x115ac5={};_0x115ac5[_0x93ae('0x29')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x115ac5[_0x93ae('0x2a')]=_['keys'](_0x520d6d[_0x93ae('0x2a')]);_0x115ac5[_0x93ae('0x2b')]=_['intersection'](_0x115ac5[_0x93ae('0x29')],_0x115ac5[_0x93ae('0x2a')]);_0x223f42[_0x93ae('0x2c')]=_[_0x93ae('0x2d')](_0x115ac5[_0x93ae('0x29')],qs[_0x93ae('0x2e')](_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x2e')]));_0x223f42['attributes']=_0x223f42[_0x93ae('0x2c')][_0x93ae('0x2f')]?_0x223f42[_0x93ae('0x2c')]:_0x115ac5[_0x93ae('0x29')];if(_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x30')]){_0x223f42[_0x93ae('0x31')]=[{'all':!![]}];}_0x223f42=_[_0x93ae('0x32')]({},_0x223f42,_0x520d6d['options']);return db[_0x93ae('0x33')]['find'](_0x223f42)[_0x93ae('0x23')](handleEntityNotFound(_0x54a37b,null))[_0x93ae('0x23')](respondWithResult(_0x54a37b,null))[_0x93ae('0x34')](handleError(_0x54a37b,null));};exports[_0x93ae('0x22')]=function(_0x1778f7,_0x46ade5){if(_0x1778f7['body']['id']){delete _0x1778f7[_0x93ae('0x35')]['id'];}return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x1778f7['params']['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x46ade5,null))[_0x93ae('0x23')](saveUpdates(_0x1778f7[_0x93ae('0x35')],null))['then'](respondWithResult(_0x46ade5,null))['catch'](handleError(_0x46ade5,null));};exports[_0x93ae('0x37')]=function(_0x266126,_0x31e9b0){return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x266126[_0x93ae('0x28')]['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x31e9b0,null))[_0x93ae('0x23')](removeEntity(_0x31e9b0,null))[_0x93ae('0x34')](handleError(_0x31e9b0,null));};
\ No newline at end of file
+var _0x30fe=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','status','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','includeAll','merge','options','find','catch','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x30fe,0x149));var _0xe30f=function(_0x3871a0,_0x435b1c){_0x3871a0=_0x3871a0-0x0;var _0x44e180=_0x30fe[_0x3871a0];return _0x44e180;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe30f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe30f('0x1'));var rp=require('request-promise');var moment=require(_0xe30f('0x2'));var BPromise=require(_0xe30f('0x3'));var Mustache=require(_0xe30f('0x4'));var util=require(_0xe30f('0x5'));var path=require(_0xe30f('0x6'));var sox=require('sox');var csv=require(_0xe30f('0x7'));var ejs=require(_0xe30f('0x8'));var fs=require('fs');var fs_extra=require(_0xe30f('0x9'));var _=require(_0xe30f('0xa'));var squel=require(_0xe30f('0xb'));var crypto=require(_0xe30f('0xc'));var jsforce=require(_0xe30f('0xd'));var deskjs=require(_0xe30f('0xe'));var toCsv=require(_0xe30f('0x7'));var querystring=require(_0xe30f('0xf'));var Papa=require('papaparse');var Redis=require(_0xe30f('0x10'));var authService=require(_0xe30f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe30f('0x12'));var hardwareService=require(_0xe30f('0x13'));var logger=require(_0xe30f('0x14'))(_0xe30f('0x15'));var utils=require('../../config/utils');var config=require(_0xe30f('0x16'));var licenseUtil=require(_0xe30f('0x17'));var db=require(_0xe30f('0x18'))['db'];function respondWithStatusCode(_0x583eb9,_0x3859df){_0x3859df=_0x3859df||0xcc;return function(_0x19970e){if(_0x19970e){return _0x583eb9[_0xe30f('0x19')](_0x3859df);}return _0x583eb9['status'](_0x3859df)[_0xe30f('0x1a')]();};}function respondWithResult(_0x460e07,_0x122e2a){_0x122e2a=_0x122e2a||0xc8;return function(_0x7d684c){if(_0x7d684c){return _0x460e07['status'](_0x122e2a)['json'](_0x7d684c);}};}function respondWithFilteredResult(_0x5ac4b2,_0x3c9680){return function(_0x494ad3){if(_0x494ad3){var _0x2b6a9b=typeof _0x3c9680[_0xe30f('0x1b')]==='undefined'&&typeof _0x3c9680[_0xe30f('0x1c')]==='undefined';var _0x2dbb2b=_0x494ad3[_0xe30f('0x1d')];var _0x406c98=_0x2b6a9b?0x0:_0x3c9680[_0xe30f('0x1b')];var _0x17024a=_0x2b6a9b?_0x494ad3['count']:_0x3c9680['offset']+_0x3c9680[_0xe30f('0x1c')];var _0x535873;if(_0x17024a>=_0x2dbb2b){_0x17024a=_0x2dbb2b;_0x535873=0xc8;}else{_0x535873=0xce;}_0x5ac4b2[_0xe30f('0x1e')](_0x535873);return _0x5ac4b2['set'](_0xe30f('0x1f'),_0x406c98+'-'+_0x17024a+'/'+_0x2dbb2b)[_0xe30f('0x20')](_0x494ad3);}return null;};}function patchUpdates(_0x2c4d1f){return function(_0x2a0432){try{jsonpatch[_0xe30f('0x21')](_0x2a0432,_0x2c4d1f,!![]);}catch(_0x5b33fa){return BPromise[_0xe30f('0x22')](_0x5b33fa);}return _0x2a0432['save']();};}function saveUpdates(_0xf66c5a,_0x5af7b5){return function(_0x322ee0){if(_0x322ee0){return _0x322ee0[_0xe30f('0x23')](_0xf66c5a)[_0xe30f('0x24')](function(_0x42833a){return _0x42833a;});}return null;};}function removeEntity(_0x7f7b1f,_0x378d6f){return function(_0x50bca4){if(_0x50bca4){return _0x50bca4[_0xe30f('0x25')]()['then'](function(){_0x7f7b1f[_0xe30f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4fbe,_0x4fc220){return function(_0x11a539){if(!_0x11a539){_0x4d4fbe['sendStatus'](0x194);}return _0x11a539;};}function handleError(_0x412015,_0x25e3cf){_0x25e3cf=_0x25e3cf||0x1f4;return function(_0x37c716){logger[_0xe30f('0x26')](_0x37c716[_0xe30f('0x27')]);if(_0x37c716[_0xe30f('0x28')]){delete _0x37c716['name'];}_0x412015[_0xe30f('0x1e')](_0x25e3cf)[_0xe30f('0x29')](_0x37c716);};}exports['show']=function(_0x15a217,_0x2d67d4){var _0x5a6cc3={'raw':!![],'where':{'id':_0x15a217['params']['id']}},_0x500626={};_0x500626[_0xe30f('0x2a')]=_[_0xe30f('0x2b')](db[_0xe30f('0x2c')][_0xe30f('0x2d')]);_0x500626[_0xe30f('0x2e')]=_[_0xe30f('0x2b')](_0x15a217['query']);_0x500626[_0xe30f('0x2f')]=_['intersection'](_0x500626[_0xe30f('0x2a')],_0x500626[_0xe30f('0x2e')]);_0x5a6cc3[_0xe30f('0x30')]=_[_0xe30f('0x31')](_0x500626['model'],qs[_0xe30f('0x32')](_0x15a217[_0xe30f('0x2e')][_0xe30f('0x32')]));_0x5a6cc3['attributes']=_0x5a6cc3[_0xe30f('0x30')]['length']?_0x5a6cc3[_0xe30f('0x30')]:_0x500626[_0xe30f('0x2a')];if(_0x15a217[_0xe30f('0x2e')][_0xe30f('0x33')]){_0x5a6cc3['include']=[{'all':!![]}];}_0x5a6cc3=_[_0xe30f('0x34')]({},_0x5a6cc3,_0x15a217[_0xe30f('0x35')]);return db[_0xe30f('0x2c')][_0xe30f('0x36')](_0x5a6cc3)[_0xe30f('0x24')](handleEntityNotFound(_0x2d67d4,null))[_0xe30f('0x24')](respondWithResult(_0x2d67d4,null))[_0xe30f('0x37')](handleError(_0x2d67d4,null));};exports['update']=function(_0x139915,_0xcc659c){if(_0x139915[_0xe30f('0x38')]['id']){delete _0x139915['body']['id'];}return db[_0xe30f('0x2c')][_0xe30f('0x36')]({'where':{'id':_0x139915['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0xcc659c,null))['then'](saveUpdates(_0x139915[_0xe30f('0x38')],null))['then'](respondWithResult(_0xcc659c,null))['catch'](handleError(_0xcc659c,null));};exports['destroy']=function(_0xf09327,_0x86fbbc){return db['ChatApplication'][_0xe30f('0x36')]({'where':{'id':_0xf09327['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0x86fbbc,null))[_0xe30f('0x24')](removeEntity(_0x86fbbc,null))[_0xe30f('0x37')](handleError(_0x86fbbc,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d88ae86..ad11634 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 _0x71e2=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','../../config/environment','./chatApplication.attributes','exports'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0x71e2,0x1c0));var _0x271e=function(_0x1712c9,_0x4cd577){_0x1712c9=_0x1712c9-0x0;var _0x4097e9=_0x71e2[_0x1712c9];return _0x4097e9;};'use strict';var _=require('lodash');var util=require(_0x271e('0x0'));var logger=require('../../config/logger')(_0x271e('0x1'));var moment=require(_0x271e('0x2'));var BPromise=require(_0x271e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x271e('0x4'));var rimraf=require('rimraf');var config=require(_0x271e('0x5'));var attributes=require(_0x271e('0x6'));module[_0x271e('0x7')]=function(_0x147b7f,_0x55ac72){return _0x147b7f['define'](_0x271e('0x8'),attributes,{'tableName':_0x271e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x271e('0xa'),'collate':_0x271e('0xb')});};
\ No newline at end of file
+var _0x27e6=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x14f78e,_0x9b82f5){var _0x20fa1c=function(_0x591bf1){while(--_0x591bf1){_0x14f78e['push'](_0x14f78e['shift']());}};_0x20fa1c(++_0x9b82f5);}(_0x27e6,0x121));var _0x627e=function(_0x11a7bd,_0x3126ac){_0x11a7bd=_0x11a7bd-0x0;var _0x3418a2=_0x27e6[_0x11a7bd];return _0x3418a2;};'use strict';var _=require(_0x627e('0x0'));var util=require(_0x627e('0x1'));var logger=require(_0x627e('0x2'))(_0x627e('0x3'));var moment=require(_0x627e('0x4'));var BPromise=require('bluebird');var rp=require(_0x627e('0x5'));var fs=require('fs');var path=require(_0x627e('0x6'));var rimraf=require(_0x627e('0x7'));var config=require(_0x627e('0x8'));var attributes=require('./chatApplication.attributes');module[_0x627e('0x9')]=function(_0x480c11,_0x516027){return _0x480c11[_0x627e('0xa')](_0x627e('0xb'),attributes,{'tableName':_0x627e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x627e('0xd'),'collate':_0x627e('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index c8e032b..64bf0d7 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 _0x6e03=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','util','moment','bluebird','randomstring'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x6e03,0xa7));var _0x36e0=function(_0x180a58,_0x2e70f5){_0x180a58=_0x180a58-0x0;var _0xc40946=_0x6e03[_0x180a58];return _0xc40946;};'use strict';var _=require('lodash');var util=require(_0x36e0('0x0'));var moment=require(_0x36e0('0x1'));var BPromise=require(_0x36e0('0x2'));var rs=require(_0x36e0('0x3'));var fs=require('fs');var Redis=require(_0x36e0('0x4'));var db=require(_0x36e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x36e0('0x6'))('rpc');var config=require(_0x36e0('0x7'));var jayson=require(_0x36e0('0x8'));var client=jayson[_0x36e0('0x9')][_0x36e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f54d5,_0x3125b4,_0xc07829){return new BPromise(function(_0x3e7571,_0xa7144c){return client['request'](_0x3f54d5,_0xc07829)[_0x36e0('0xb')](function(_0x2295b9){logger['info'](_0x36e0('0xc'),_0x3125b4,_0x36e0('0xd'));logger[_0x36e0('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x3125b4,'request\x20sent',JSON['stringify'](_0x2295b9));if(_0x2295b9[_0x36e0('0xf')]){if(_0x2295b9['error']['code']===0x1f4){logger[_0x36e0('0xf')](_0x36e0('0xc'),_0x3125b4,_0x2295b9[_0x36e0('0xf')][_0x36e0('0x10')]);return _0xa7144c(_0x2295b9[_0x36e0('0xf')][_0x36e0('0x10')]);}logger[_0x36e0('0xf')](_0x36e0('0xc'),_0x3125b4,_0x2295b9[_0x36e0('0xf')]['message']);return _0x3e7571(_0x2295b9['error'][_0x36e0('0x10')]);}else{logger[_0x36e0('0x11')]('ChatApplication,\x20%s,\x20%s',_0x3125b4,'request\x20sent');_0x3e7571(_0x2295b9[_0x36e0('0x12')][_0x36e0('0x10')]);}})['catch'](function(_0x5372f9){logger['error']('ChatApplication,\x20%s,\x20%s',_0x3125b4,_0x5372f9);_0xa7144c(_0x5372f9);});});}
\ No newline at end of file
+var _0x0fe0=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1e46d8,_0x44fe74){var _0x52bd0f=function(_0x30e28a){while(--_0x30e28a){_0x1e46d8['push'](_0x1e46d8['shift']());}};_0x52bd0f(++_0x44fe74);}(_0x0fe0,0x133));var _0x00fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fe0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x00fe('0x0'));var util=require(_0x00fe('0x1'));var moment=require(_0x00fe('0x2'));var BPromise=require(_0x00fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00fe('0x4'));var db=require(_0x00fe('0x5'))['db'];var utils=require(_0x00fe('0x6'));var logger=require('../../config/logger')(_0x00fe('0x7'));var config=require(_0x00fe('0x8'));var jayson=require(_0x00fe('0x9'));var client=jayson[_0x00fe('0xa')][_0x00fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x144d2d,_0x21f9f1,_0x2bec27){return new BPromise(function(_0x23540b,_0x36232f){return client[_0x00fe('0xc')](_0x144d2d,_0x2bec27)['then'](function(_0x3a3a36){logger[_0x00fe('0xd')]('ChatApplication,\x20%s,\x20%s',_0x21f9f1,_0x00fe('0xe'));logger[_0x00fe('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x21f9f1,_0x00fe('0xe'),JSON[_0x00fe('0x10')](_0x3a3a36));if(_0x3a3a36[_0x00fe('0x11')]){if(_0x3a3a36[_0x00fe('0x11')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x21f9f1,_0x3a3a36[_0x00fe('0x11')]['message']);return _0x36232f(_0x3a3a36[_0x00fe('0x11')]['message']);}logger[_0x00fe('0x11')](_0x00fe('0x12'),_0x21f9f1,_0x3a3a36[_0x00fe('0x11')][_0x00fe('0x13')]);return _0x23540b(_0x3a3a36[_0x00fe('0x11')]['message']);}else{logger[_0x00fe('0xd')](_0x00fe('0x12'),_0x21f9f1,_0x00fe('0xe'));_0x23540b(_0x3a3a36['result'][_0x00fe('0x13')]);}})[_0x00fe('0x14')](function(_0xb17a67){logger['error'](_0x00fe('0x12'),_0x21f9f1,_0xb17a67);_0x36232f(_0xb17a67);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index b3bd625..374f68f 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 _0x93a7=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path'];(function(_0x232ec0,_0x45fdd0){var _0x356705=function(_0x4099ea){while(--_0x4099ea){_0x232ec0['push'](_0x232ec0['shift']());}};_0x356705(++_0x45fdd0);}(_0x93a7,0x75));var _0x793a=function(_0x472056,_0x5d2d46){_0x472056=_0x472056-0x0;var _0x5ded8b=_0x93a7[_0x472056];return _0x5ded8b;};'use strict';var multer=require('multer');var util=require(_0x793a('0x0'));var path=require(_0x793a('0x1'));var timeout=require(_0x793a('0x2'));var express=require(_0x793a('0x3'));var router=express[_0x793a('0x4')]();var fs_extra=require(_0x793a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x793a('0x6'));var config=require(_0x793a('0x7'));var controller=require(_0x793a('0x8'));router['get'](_0x793a('0x9'),auth[_0x793a('0xa')](),controller[_0x793a('0xb')]);router[_0x793a('0xc')](_0x793a('0x9'),auth[_0x793a('0xa')](),controller[_0x793a('0xd')]);router[_0x793a('0xe')](_0x793a('0x9'),auth[_0x793a('0xa')](),controller[_0x793a('0xf')]);module[_0x793a('0x10')]=router;
\ No newline at end of file
+var _0x3740=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','put','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x126d3b,_0x5c6195){var _0x136fe3=function(_0x555633){while(--_0x555633){_0x126d3b['push'](_0x126d3b['shift']());}};_0x136fe3(++_0x5c6195);}(_0x3740,0xcc));var _0x0374=function(_0x4855fa,_0x490cf3){_0x4855fa=_0x4855fa-0x0;var _0x4b7a91=_0x3740[_0x4855fa];return _0x4b7a91;};'use strict';var multer=require(_0x0374('0x0'));var util=require(_0x0374('0x1'));var path=require(_0x0374('0x2'));var timeout=require(_0x0374('0x3'));var express=require('express');var router=express[_0x0374('0x4')]();var fs_extra=require(_0x0374('0x5'));var auth=require(_0x0374('0x6'));var interaction=require(_0x0374('0x7'));var config=require(_0x0374('0x8'));var controller=require('./chatApplication.controller');router[_0x0374('0x9')]('/:id',auth[_0x0374('0xa')](),controller['show']);router[_0x0374('0xb')]('/:id',auth[_0x0374('0xa')](),controller['update']);router[_0x0374('0xc')](_0x0374('0xd'),auth[_0x0374('0xa')](),controller['destroy']);module[_0x0374('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 22d4d9e..20fe260 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 _0xb778=['sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb778,0x1c8));var _0x8b77=function(_0x2c90c1,_0x446eda){_0x2c90c1=_0x2c90c1-0x0;var _0xcb55d4=_0xb778[_0x2c90c1];return _0xcb55d4;};'use strict';var Sequelize=require(_0x8b77('0x0'));module['exports']={'name':{'type':Sequelize[_0x8b77('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x7097=['exports','STRING','sequelize'];(function(_0x4e813f,_0x301c69){var _0x49c4f1=function(_0x84ac36){while(--_0x84ac36){_0x4e813f['push'](_0x4e813f['shift']());}};_0x49c4f1(++_0x301c69);}(_0x7097,0x1be));var _0x7709=function(_0x18de0f,_0x4c40e5){_0x18de0f=_0x18de0f-0x0;var _0x16ab8e=_0x7097[_0x18de0f];return _0x16ab8e;};'use strict';var Sequelize=require(_0x7709('0x0'));module[_0x7709('0x1')]={'name':{'type':Sequelize[_0x7709('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 34011c9..8194735 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 _0xa7b9=['destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','register','sendStatus','end','json','offset','undefined','count','limit','status','set','save','update','then'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa7b9,0x154));var _0x9a7b=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0xa7b9[_0xed5f9c];return _0x3a1c43;};'use strict';var emlformat=require(_0x9a7b('0x0'));var rimraf=require(_0x9a7b('0x1'));var zipdir=require(_0x9a7b('0x2'));var jsonpatch=require(_0x9a7b('0x3'));var rp=require(_0x9a7b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9a7b('0x5'));var util=require(_0x9a7b('0x6'));var path=require(_0x9a7b('0x7'));var sox=require(_0x9a7b('0x8'));var csv=require(_0x9a7b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a7b('0xa'));var _=require(_0x9a7b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9a7b('0xc'));var deskjs=require(_0x9a7b('0xd'));var toCsv=require(_0x9a7b('0x9'));var querystring=require(_0x9a7b('0xe'));var Papa=require(_0x9a7b('0xf'));var Redis=require(_0x9a7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9a7b('0x11'));var as=require(_0x9a7b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a7b('0x13'))(_0x9a7b('0x14'));var utils=require(_0x9a7b('0x15'));var config=require(_0x9a7b('0x16'));var licenseUtil=require(_0x9a7b('0x17'));var db=require(_0x9a7b('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9a7b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a7b('0x1a')]));require('./chatGroup.socket')[_0x9a7b('0x1b')](socket);function respondWithStatusCode(_0x14b5f6,_0x29ae7a){_0x29ae7a=_0x29ae7a||0xcc;return function(_0x47065c){if(_0x47065c){return _0x14b5f6[_0x9a7b('0x1c')](_0x29ae7a);}return _0x14b5f6['status'](_0x29ae7a)[_0x9a7b('0x1d')]();};}function respondWithResult(_0xa830ad,_0x39b855){_0x39b855=_0x39b855||0xc8;return function(_0x1f5fd3){if(_0x1f5fd3){return _0xa830ad['status'](_0x39b855)[_0x9a7b('0x1e')](_0x1f5fd3);}};}function respondWithFilteredResult(_0x6c62e9,_0x1b1a37){return function(_0x40ecdc){if(_0x40ecdc){var _0x5217ab=typeof _0x1b1a37[_0x9a7b('0x1f')]===_0x9a7b('0x20')&&typeof _0x1b1a37['limit']===_0x9a7b('0x20');var _0x192466=_0x40ecdc['count'];var _0x35f3f2=_0x5217ab?0x0:_0x1b1a37['offset'];var _0x9731be=_0x5217ab?_0x40ecdc[_0x9a7b('0x21')]:_0x1b1a37[_0x9a7b('0x1f')]+_0x1b1a37[_0x9a7b('0x22')];var _0x1e8dd2;if(_0x9731be>=_0x192466){_0x9731be=_0x192466;_0x1e8dd2=0xc8;}else{_0x1e8dd2=0xce;}_0x6c62e9[_0x9a7b('0x23')](_0x1e8dd2);return _0x6c62e9[_0x9a7b('0x24')]('Content-Range',_0x35f3f2+'-'+_0x9731be+'/'+_0x192466)[_0x9a7b('0x1e')](_0x40ecdc);}return null;};}function patchUpdates(_0x26f52e){return function(_0x40eca6){try{jsonpatch['apply'](_0x40eca6,_0x26f52e,!![]);}catch(_0x34c059){return BPromise['reject'](_0x34c059);}return _0x40eca6[_0x9a7b('0x25')]();};}function saveUpdates(_0x4f4870,_0x2332f4){return function(_0x43e53d){if(_0x43e53d){return _0x43e53d[_0x9a7b('0x26')](_0x4f4870)[_0x9a7b('0x27')](function(_0x3e3a6e){return _0x3e3a6e;});}return null;};}function removeEntity(_0x4c606a,_0x48fa1c){return function(_0x28e71a){if(_0x28e71a){return _0x28e71a[_0x9a7b('0x28')]()[_0x9a7b('0x27')](function(){_0x4c606a['status'](0xcc)[_0x9a7b('0x1d')]();});}};}function handleEntityNotFound(_0x5cb6b7,_0x2b86a4){return function(_0x1cc563){if(!_0x1cc563){_0x5cb6b7[_0x9a7b('0x1c')](0x194);}return _0x1cc563;};}function handleError(_0x5569b1,_0x1ca3ad){_0x1ca3ad=_0x1ca3ad||0x1f4;return function(_0x11adca){logger[_0x9a7b('0x29')](_0x11adca[_0x9a7b('0x2a')]);if(_0x11adca[_0x9a7b('0x2b')]){delete _0x11adca[_0x9a7b('0x2b')];}_0x5569b1[_0x9a7b('0x23')](_0x1ca3ad)[_0x9a7b('0x2c')](_0x11adca);};}exports[_0x9a7b('0x2d')]=function(_0x485fd9,_0x3c5394){var _0x1fd313={},_0x5371bf={},_0x28a26f={'count':0x0,'rows':[]};var _0x4776a2=_[_0x9a7b('0x2e')](db[_0x9a7b('0x2f')][_0x9a7b('0x30')],function(_0x22e76d){return{'name':_0x22e76d['fieldName'],'type':_0x22e76d[_0x9a7b('0x31')][_0x9a7b('0x32')]};});_0x5371bf[_0x9a7b('0x33')]=_[_0x9a7b('0x2e')](_0x4776a2,_0x9a7b('0x2b'));_0x5371bf[_0x9a7b('0x34')]=_[_0x9a7b('0x35')](_0x485fd9[_0x9a7b('0x34')]);_0x5371bf[_0x9a7b('0x36')]=_[_0x9a7b('0x37')](_0x5371bf[_0x9a7b('0x33')],_0x5371bf[_0x9a7b('0x34')]);_0x1fd313[_0x9a7b('0x38')]=_[_0x9a7b('0x37')](_0x5371bf['model'],qs[_0x9a7b('0x39')](_0x485fd9[_0x9a7b('0x34')][_0x9a7b('0x39')]));_0x1fd313[_0x9a7b('0x38')]=_0x1fd313['attributes'][_0x9a7b('0x3a')]?_0x1fd313[_0x9a7b('0x38')]:_0x5371bf[_0x9a7b('0x33')];if(!_0x485fd9[_0x9a7b('0x34')][_0x9a7b('0x3b')](_0x9a7b('0x3c'))){_0x1fd313[_0x9a7b('0x22')]=qs[_0x9a7b('0x22')](_0x485fd9[_0x9a7b('0x34')][_0x9a7b('0x22')]);_0x1fd313[_0x9a7b('0x1f')]=qs['offset'](_0x485fd9['query'][_0x9a7b('0x1f')]);}_0x1fd313[_0x9a7b('0x3d')]=qs[_0x9a7b('0x3e')](_0x485fd9[_0x9a7b('0x34')][_0x9a7b('0x3e')]);_0x1fd313[_0x9a7b('0x3f')]=qs['filters'](_[_0x9a7b('0x40')](_0x485fd9[_0x9a7b('0x34')],_0x5371bf[_0x9a7b('0x36')]),_0x4776a2);if(_0x485fd9[_0x9a7b('0x34')][_0x9a7b('0x41')]){_0x1fd313['where']=_[_0x9a7b('0x42')](_0x1fd313[_0x9a7b('0x3f')],{'$or':_[_0x9a7b('0x2e')](_0x4776a2,function(_0x2d6003){if(_0x2d6003['type']!=='VIRTUAL'){var _0x26e7a8={};_0x26e7a8[_0x2d6003['name']]={'$like':'%'+_0x485fd9[_0x9a7b('0x34')][_0x9a7b('0x41')]+'%'};return _0x26e7a8;}})});}_0x1fd313=_[_0x9a7b('0x42')]({},_0x1fd313,_0x485fd9[_0x9a7b('0x43')]);var _0x2526e4={'where':_0x1fd313['where']};return db[_0x9a7b('0x2f')][_0x9a7b('0x21')](_0x2526e4)[_0x9a7b('0x27')](function(_0x3225d8){_0x28a26f['count']=_0x3225d8;if(_0x485fd9[_0x9a7b('0x34')][_0x9a7b('0x44')]){_0x1fd313[_0x9a7b('0x45')]=[{'all':!![]}];}return db[_0x9a7b('0x2f')]['findAll'](_0x1fd313);})[_0x9a7b('0x27')](function(_0x5ab8f5){_0x28a26f[_0x9a7b('0x46')]=_0x5ab8f5;return _0x28a26f;})[_0x9a7b('0x27')](respondWithFilteredResult(_0x3c5394,_0x1fd313))['catch'](handleError(_0x3c5394,null));};exports[_0x9a7b('0x47')]=function(_0xd76ac7,_0x2fbdf0){var _0x4d558c={'raw':!![],'where':{'id':_0xd76ac7[_0x9a7b('0x48')]['id']}},_0x3c347f={};_0x3c347f[_0x9a7b('0x33')]=_[_0x9a7b('0x35')](db['ChatGroup'][_0x9a7b('0x30')]);_0x3c347f[_0x9a7b('0x34')]=_[_0x9a7b('0x35')](_0xd76ac7[_0x9a7b('0x34')]);_0x3c347f[_0x9a7b('0x36')]=_[_0x9a7b('0x37')](_0x3c347f['model'],_0x3c347f[_0x9a7b('0x34')]);_0x4d558c[_0x9a7b('0x38')]=_[_0x9a7b('0x37')](_0x3c347f[_0x9a7b('0x33')],qs[_0x9a7b('0x39')](_0xd76ac7[_0x9a7b('0x34')]['fields']));_0x4d558c[_0x9a7b('0x38')]=_0x4d558c['attributes'][_0x9a7b('0x3a')]?_0x4d558c['attributes']:_0x3c347f[_0x9a7b('0x33')];if(_0xd76ac7[_0x9a7b('0x34')]['includeAll']){_0x4d558c[_0x9a7b('0x45')]=[{'all':!![]}];}_0x4d558c=_[_0x9a7b('0x42')]({},_0x4d558c,_0xd76ac7[_0x9a7b('0x43')]);return db[_0x9a7b('0x2f')][_0x9a7b('0x49')](_0x4d558c)[_0x9a7b('0x27')](handleEntityNotFound(_0x2fbdf0,null))[_0x9a7b('0x27')](respondWithResult(_0x2fbdf0,null))[_0x9a7b('0x4a')](handleError(_0x2fbdf0,null));};exports[_0x9a7b('0x4b')]=function(_0x28add3,_0x1df749){return db[_0x9a7b('0x2f')][_0x9a7b('0x4b')](_0x28add3[_0x9a7b('0x4c')],{})[_0x9a7b('0x27')](respondWithResult(_0x1df749,0xc9))['catch'](handleError(_0x1df749,null));};exports[_0x9a7b('0x26')]=function(_0x3dcfd4,_0x2d6545){if(_0x3dcfd4['body']['id']){delete _0x3dcfd4['body']['id'];}return db[_0x9a7b('0x2f')]['find']({'where':{'id':_0x3dcfd4[_0x9a7b('0x48')]['id']}})[_0x9a7b('0x27')](handleEntityNotFound(_0x2d6545,null))[_0x9a7b('0x27')](saveUpdates(_0x3dcfd4[_0x9a7b('0x4c')],null))[_0x9a7b('0x27')](respondWithResult(_0x2d6545,null))['catch'](handleError(_0x2d6545,null));};exports[_0x9a7b('0x28')]=function(_0x247a98,_0x274be1){return db['ChatGroup'][_0x9a7b('0x49')]({'where':{'id':_0x247a98[_0x9a7b('0x48')]['id']}})[_0x9a7b('0x27')](handleEntityNotFound(_0x274be1,null))['then'](removeEntity(_0x274be1,null))[_0x9a7b('0x4a')](handleError(_0x274be1,null));};exports[_0x9a7b('0x4d')]=function(_0x492dbd,_0x22119b){return db[_0x9a7b('0x2f')][_0x9a7b('0x4d')]()[_0x9a7b('0x27')](respondWithResult(_0x22119b,null))[_0x9a7b('0x4a')](handleError(_0x22119b,null));};exports[_0x9a7b('0x4e')]=function(_0x2816a0,_0x2de27f,_0x1c3b7d){return db[_0x9a7b('0x4f')]['count']({'where':{'ChatGroupId':_0x2816a0[_0x9a7b('0x48')]['id'],'ToId':_0x2816a0[_0x9a7b('0x50')]['id'],'read':![]}})['then'](function(_0x428c28){return{'id':_[_0x9a7b('0x51')](_0x2816a0[_0x9a7b('0x48')]['id']),'count':_0x428c28};})[_0x9a7b('0x27')](respondWithResult(_0x2de27f,null))[_0x9a7b('0x4a')](handleError(_0x2de27f,null));};exports[_0x9a7b('0x52')]=function(_0x436414,_0x55f23d,_0x5180c4){return db['ChatGroup'][_0x9a7b('0x49')]({'where':{'id':_0x436414[_0x9a7b('0x48')]['id']}})['then'](handleEntityNotFound(_0x55f23d,null))[_0x9a7b('0x27')](function(_0x2f1370){if(_0x2f1370){return _0x2f1370[_0x9a7b('0x52')](_0x436414[_0x9a7b('0x4c')][_0x9a7b('0x53')],_[_0x9a7b('0x54')](_0x436414[_0x9a7b('0x4c')],[_0x9a7b('0x53'),'id'])||{});}})['then'](respondWithResult(_0x55f23d,null))[_0x9a7b('0x4a')](handleError(_0x55f23d,null));};exports[_0x9a7b('0x55')]=function(_0xb82aec,_0x49fac5,_0x5ed2c3){var _0x25e571={};var _0x59018e={};var _0x43a819;var _0x497daf;return db[_0x9a7b('0x2f')][_0x9a7b('0x56')]({'where':{'id':_0xb82aec['params']['id']}})['then'](handleEntityNotFound(_0x49fac5,null))['then'](function(_0x11bce4){if(_0x11bce4){_0x43a819=_0x11bce4;_0x59018e[_0x9a7b('0x33')]=_[_0x9a7b('0x35')](db[_0x9a7b('0x57')]['rawAttributes']);_0x59018e[_0x9a7b('0x34')]=_[_0x9a7b('0x35')](_0xb82aec[_0x9a7b('0x34')]);_0x59018e[_0x9a7b('0x36')]=_[_0x9a7b('0x37')](_0x59018e[_0x9a7b('0x33')],_0x59018e[_0x9a7b('0x34')]);_0x25e571[_0x9a7b('0x38')]=_['intersection'](_0x59018e[_0x9a7b('0x33')],qs[_0x9a7b('0x39')](_0xb82aec[_0x9a7b('0x34')][_0x9a7b('0x39')]));_0x25e571[_0x9a7b('0x38')]=_0x25e571[_0x9a7b('0x38')][_0x9a7b('0x3a')]?_0x25e571[_0x9a7b('0x38')]:_0x59018e[_0x9a7b('0x33')];_0x25e571[_0x9a7b('0x3d')]=qs['sort'](_0xb82aec[_0x9a7b('0x34')][_0x9a7b('0x3e')]);_0x25e571['where']=qs[_0x9a7b('0x36')](_[_0x9a7b('0x40')](_0xb82aec['query'],_0x59018e[_0x9a7b('0x36')]));if(_0xb82aec[_0x9a7b('0x34')][_0x9a7b('0x41')]){_0x25e571['where']=_[_0x9a7b('0x42')](_0x25e571[_0x9a7b('0x3f')],{'$or':_[_0x9a7b('0x2e')](_0x25e571[_0x9a7b('0x38')],function(_0x507c9e){var _0x2ac152={};_0x2ac152[_0x507c9e]={'$like':'%'+_0xb82aec[_0x9a7b('0x34')]['filter']+'%'};return _0x2ac152;})});}_0x25e571=_[_0x9a7b('0x42')]({},_0x25e571,_0xb82aec[_0x9a7b('0x43')]);return _0x43a819['getMembers'](_0x25e571);}})['then'](function(_0x5ada24){if(_0x5ada24){_0x497daf=_0x5ada24[_0x9a7b('0x3a')];if(!_0xb82aec['query'][_0x9a7b('0x3b')](_0x9a7b('0x3c'))){_0x25e571[_0x9a7b('0x22')]=qs['limit'](_0xb82aec[_0x9a7b('0x34')]['limit']);_0x25e571['offset']=qs['offset'](_0xb82aec[_0x9a7b('0x34')][_0x9a7b('0x1f')]);}return _0x43a819[_0x9a7b('0x55')](_0x25e571);}})['then'](function(_0x447edc){if(_0x447edc){return _0x447edc?{'count':_0x497daf,'rows':_0x447edc}:null;}})[_0x9a7b('0x27')](respondWithResult(_0x49fac5,null))['catch'](handleError(_0x49fac5,null));};exports['removeMembers']=function(_0x137863,_0xe93210,_0x4cfaa2){return db[_0x9a7b('0x2f')][_0x9a7b('0x49')]({'where':{'id':_0x137863[_0x9a7b('0x48')]['id']}})['then'](handleEntityNotFound(_0xe93210,null))['then'](function(_0x179e9b){if(_0x179e9b){return _0x179e9b['removeMembers'](_0x137863[_0x9a7b('0x34')]['ids']);}})[_0x9a7b('0x27')](respondWithStatusCode(_0xe93210,null))[_0x9a7b('0x4a')](handleError(_0xe93210,null));};exports[_0x9a7b('0x58')]=function(_0x60e9ff,_0x58e17f,_0x487da8){if(_0x60e9ff[_0x9a7b('0x4c')]['id']){delete _0x60e9ff[_0x9a7b('0x4c')]['id'];}return db['ChatGroup'][_0x9a7b('0x49')]({'where':{'id':_0x60e9ff[_0x9a7b('0x48')]['id']}})[_0x9a7b('0x27')](handleEntityNotFound(_0x58e17f,null))[_0x9a7b('0x27')](function(_0x153381){if(_0x153381){_0x60e9ff[_0x9a7b('0x4c')][_0x9a7b('0x59')]=_0x153381['id'];return db[_0x9a7b('0x4f')][_0x9a7b('0x4b')](_0x60e9ff[_0x9a7b('0x4c')]);}})[_0x9a7b('0x27')](respondWithResult(_0x58e17f,null))[_0x9a7b('0x4a')](handleError(_0x58e17f,null));};exports[_0x9a7b('0x5a')]=function(_0x4b8312,_0x3584b9,_0x2ff79f){var _0xf5281f={};var _0x39a81a={};var _0x4511dd;var _0x933cfa;return db[_0x9a7b('0x2f')][_0x9a7b('0x56')]({'where':{'id':_0x4b8312['params']['id']}})[_0x9a7b('0x27')](handleEntityNotFound(_0x3584b9,null))[_0x9a7b('0x27')](function(_0xa33561){if(_0xa33561){_0x4511dd=_0xa33561;_0x39a81a['model']=_[_0x9a7b('0x35')](db[_0x9a7b('0x4f')][_0x9a7b('0x30')]);_0x39a81a[_0x9a7b('0x34')]=_[_0x9a7b('0x35')](_0x4b8312[_0x9a7b('0x34')]);_0x39a81a[_0x9a7b('0x36')]=_[_0x9a7b('0x37')](_0x39a81a[_0x9a7b('0x33')],_0x39a81a[_0x9a7b('0x34')]);_0xf5281f[_0x9a7b('0x38')]=_[_0x9a7b('0x37')](_0x39a81a[_0x9a7b('0x33')],qs[_0x9a7b('0x39')](_0x4b8312[_0x9a7b('0x34')][_0x9a7b('0x39')]));_0xf5281f[_0x9a7b('0x38')]=_0xf5281f[_0x9a7b('0x38')][_0x9a7b('0x3a')]?_0xf5281f[_0x9a7b('0x38')]:_0x39a81a[_0x9a7b('0x33')];_0xf5281f['order']=qs['sort'](_0x4b8312['query'][_0x9a7b('0x3e')]);_0xf5281f[_0x9a7b('0x3f')]=qs[_0x9a7b('0x36')](_[_0x9a7b('0x40')](_0x4b8312[_0x9a7b('0x34')],_0x39a81a[_0x9a7b('0x36')]));if(_0x4b8312[_0x9a7b('0x34')][_0x9a7b('0x41')]){_0xf5281f[_0x9a7b('0x3f')]=_[_0x9a7b('0x42')](_0xf5281f['where'],{'$or':_[_0x9a7b('0x2e')](_0xf5281f[_0x9a7b('0x38')],function(_0x1a5c5b){var _0x136cc8={};_0x136cc8[_0x1a5c5b]={'$like':'%'+_0x4b8312['query'][_0x9a7b('0x41')]+'%'};return _0x136cc8;})});}if(_0x4b8312[_0x9a7b('0x34')][_0x9a7b('0x5b')]){var _0x4ec4c7=_0x4b8312['query'][_0x9a7b('0x5b')][_0x9a7b('0x5c')](',');var _0xd099da={};_0xd099da[_0x4ec4c7[0x0]]={'$gte':moment(_0x4ec4c7[0x1])[_0x9a7b('0x5d')](_0x9a7b('0x5e'))};_0xf5281f[_0x9a7b('0x3f')]=_[_0x9a7b('0x42')](_0xf5281f[_0x9a7b('0x3f')],_0xd099da);}_0xf5281f=_[_0x9a7b('0x42')]({},_0xf5281f,_0x4b8312[_0x9a7b('0x43')]);return _0x4511dd['getMessages'](_0xf5281f);}})[_0x9a7b('0x27')](function(_0x76e584){if(_0x76e584){_0x933cfa=_0x76e584[_0x9a7b('0x3a')];if(!_0x4b8312[_0x9a7b('0x34')]['hasOwnProperty'](_0x9a7b('0x3c'))){_0xf5281f[_0x9a7b('0x22')]=qs[_0x9a7b('0x22')](_0x4b8312[_0x9a7b('0x34')][_0x9a7b('0x22')]);_0xf5281f[_0x9a7b('0x1f')]=qs['offset'](_0x4b8312['query']['offset']);}return _0x4511dd[_0x9a7b('0x5a')](_0xf5281f);}})[_0x9a7b('0x27')](function(_0x4b57f9){if(_0x4b57f9){return _0x4b57f9?{'count':_0x933cfa,'rows':_0x4b57f9}:null;}})[_0x9a7b('0x27')](respondWithResult(_0x3584b9,null))[_0x9a7b('0x4a')](handleError(_0x3584b9,null));};
\ No newline at end of file
+var _0x6959=['user','toInteger','addMembers','omit','ids','User','getMembers','nolimit','removeMembers','addMessage','create','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','find','body','describe','ChatInternalMessage'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0x6959,0x1e7));var _0x9695=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6959[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9695('0x0'));var rp=require(_0x9695('0x1'));var moment=require(_0x9695('0x2'));var BPromise=require(_0x9695('0x3'));var Mustache=require('mustache');var util=require(_0x9695('0x4'));var path=require(_0x9695('0x5'));var sox=require(_0x9695('0x6'));var csv=require(_0x9695('0x7'));var ejs=require(_0x9695('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9695('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9695('0xa'));var toCsv=require(_0x9695('0x7'));var querystring=require(_0x9695('0xb'));var Papa=require(_0x9695('0xc'));var Redis=require(_0x9695('0xd'));var authService=require(_0x9695('0xe'));var qs=require(_0x9695('0xf'));var as=require(_0x9695('0x10'));var hardwareService=require(_0x9695('0x11'));var logger=require(_0x9695('0x12'))('api');var utils=require(_0x9695('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9695('0x14'));var db=require(_0x9695('0x15'))['db'];config[_0x9695('0x16')]=_[_0x9695('0x17')](config[_0x9695('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x9695('0x18'))(new Redis(config[_0x9695('0x16')]));require(_0x9695('0x19'))[_0x9695('0x1a')](socket);function respondWithStatusCode(_0x45e7e3,_0x262b4c){_0x262b4c=_0x262b4c||0xcc;return function(_0x5570a9){if(_0x5570a9){return _0x45e7e3[_0x9695('0x1b')](_0x262b4c);}return _0x45e7e3[_0x9695('0x1c')](_0x262b4c)[_0x9695('0x1d')]();};}function respondWithResult(_0x280b30,_0x461c04){_0x461c04=_0x461c04||0xc8;return function(_0x65e57b){if(_0x65e57b){return _0x280b30[_0x9695('0x1c')](_0x461c04)[_0x9695('0x1e')](_0x65e57b);}};}function respondWithFilteredResult(_0x1fc81f,_0x2ad476){return function(_0x314715){if(_0x314715){var _0x325f12=typeof _0x2ad476[_0x9695('0x1f')]==='undefined'&&typeof _0x2ad476[_0x9695('0x20')]===_0x9695('0x21');var _0x597c0f=_0x314715[_0x9695('0x22')];var _0x44bcd9=_0x325f12?0x0:_0x2ad476[_0x9695('0x1f')];var _0x342cb4=_0x325f12?_0x314715['count']:_0x2ad476[_0x9695('0x1f')]+_0x2ad476['limit'];var _0x5d7b6f;if(_0x342cb4>=_0x597c0f){_0x342cb4=_0x597c0f;_0x5d7b6f=0xc8;}else{_0x5d7b6f=0xce;}_0x1fc81f['status'](_0x5d7b6f);return _0x1fc81f[_0x9695('0x23')](_0x9695('0x24'),_0x44bcd9+'-'+_0x342cb4+'/'+_0x597c0f)[_0x9695('0x1e')](_0x314715);}return null;};}function patchUpdates(_0x514d6a){return function(_0x4b6302){try{jsonpatch['apply'](_0x4b6302,_0x514d6a,!![]);}catch(_0x272a39){return BPromise['reject'](_0x272a39);}return _0x4b6302['save']();};}function saveUpdates(_0x13f7a7,_0x251276){return function(_0x43af33){if(_0x43af33){return _0x43af33[_0x9695('0x25')](_0x13f7a7)[_0x9695('0x26')](function(_0x5238b8){return _0x5238b8;});}return null;};}function removeEntity(_0x54f48a,_0xbbbba0){return function(_0x4a04a6){if(_0x4a04a6){return _0x4a04a6[_0x9695('0x27')]()[_0x9695('0x26')](function(){_0x54f48a['status'](0xcc)[_0x9695('0x1d')]();});}};}function handleEntityNotFound(_0x33d731,_0x4698b0){return function(_0x79d9c5){if(!_0x79d9c5){_0x33d731[_0x9695('0x1b')](0x194);}return _0x79d9c5;};}function handleError(_0x52d1d4,_0xc27eb9){_0xc27eb9=_0xc27eb9||0x1f4;return function(_0x3b342e){logger['error'](_0x3b342e[_0x9695('0x28')]);if(_0x3b342e[_0x9695('0x29')]){delete _0x3b342e[_0x9695('0x29')];}_0x52d1d4[_0x9695('0x1c')](_0xc27eb9)[_0x9695('0x2a')](_0x3b342e);};}exports[_0x9695('0x2b')]=function(_0x352df9,_0x5ce624){var _0x2c4e3a={},_0x2e0de4={},_0x446569={'count':0x0,'rows':[]};var _0x15f5e4=_[_0x9695('0x2c')](db[_0x9695('0x2d')][_0x9695('0x2e')],function(_0x5a3c8a){return{'name':_0x5a3c8a[_0x9695('0x2f')],'type':_0x5a3c8a[_0x9695('0x30')][_0x9695('0x31')]};});_0x2e0de4[_0x9695('0x32')]=_[_0x9695('0x2c')](_0x15f5e4,_0x9695('0x29'));_0x2e0de4[_0x9695('0x33')]=_['keys'](_0x352df9[_0x9695('0x33')]);_0x2e0de4[_0x9695('0x34')]=_[_0x9695('0x35')](_0x2e0de4['model'],_0x2e0de4[_0x9695('0x33')]);_0x2c4e3a[_0x9695('0x36')]=_[_0x9695('0x35')](_0x2e0de4[_0x9695('0x32')],qs['fields'](_0x352df9[_0x9695('0x33')]['fields']));_0x2c4e3a['attributes']=_0x2c4e3a[_0x9695('0x36')][_0x9695('0x37')]?_0x2c4e3a[_0x9695('0x36')]:_0x2e0de4[_0x9695('0x32')];if(!_0x352df9[_0x9695('0x33')][_0x9695('0x38')]('nolimit')){_0x2c4e3a[_0x9695('0x20')]=qs[_0x9695('0x20')](_0x352df9['query'][_0x9695('0x20')]);_0x2c4e3a['offset']=qs[_0x9695('0x1f')](_0x352df9[_0x9695('0x33')][_0x9695('0x1f')]);}_0x2c4e3a[_0x9695('0x39')]=qs[_0x9695('0x3a')](_0x352df9[_0x9695('0x33')][_0x9695('0x3a')]);_0x2c4e3a[_0x9695('0x3b')]=qs[_0x9695('0x34')](_[_0x9695('0x3c')](_0x352df9[_0x9695('0x33')],_0x2e0de4[_0x9695('0x34')]),_0x15f5e4);if(_0x352df9['query'][_0x9695('0x3d')]){_0x2c4e3a[_0x9695('0x3b')]=_[_0x9695('0x3e')](_0x2c4e3a[_0x9695('0x3b')],{'$or':_[_0x9695('0x2c')](_0x15f5e4,function(_0x2fe060){if(_0x2fe060[_0x9695('0x30')]!==_0x9695('0x3f')){var _0x4d68bd={};_0x4d68bd[_0x2fe060['name']]={'$like':'%'+_0x352df9['query'][_0x9695('0x3d')]+'%'};return _0x4d68bd;}})});}_0x2c4e3a=_[_0x9695('0x3e')]({},_0x2c4e3a,_0x352df9[_0x9695('0x40')]);var _0x567eb0={'where':_0x2c4e3a[_0x9695('0x3b')]};return db[_0x9695('0x2d')][_0x9695('0x22')](_0x567eb0)[_0x9695('0x26')](function(_0x510b5e){_0x446569[_0x9695('0x22')]=_0x510b5e;if(_0x352df9[_0x9695('0x33')][_0x9695('0x41')]){_0x2c4e3a[_0x9695('0x42')]=[{'all':!![]}];}return db[_0x9695('0x2d')][_0x9695('0x43')](_0x2c4e3a);})[_0x9695('0x26')](function(_0x14b8b1){_0x446569['rows']=_0x14b8b1;return _0x446569;})[_0x9695('0x26')](respondWithFilteredResult(_0x5ce624,_0x2c4e3a))[_0x9695('0x44')](handleError(_0x5ce624,null));};exports[_0x9695('0x45')]=function(_0xc21b0d,_0x3d78c0){var _0x50eed5={'raw':!![],'where':{'id':_0xc21b0d[_0x9695('0x46')]['id']}},_0x3781d2={};_0x3781d2['model']=_[_0x9695('0x47')](db[_0x9695('0x2d')][_0x9695('0x2e')]);_0x3781d2['query']=_[_0x9695('0x47')](_0xc21b0d[_0x9695('0x33')]);_0x3781d2[_0x9695('0x34')]=_[_0x9695('0x35')](_0x3781d2[_0x9695('0x32')],_0x3781d2[_0x9695('0x33')]);_0x50eed5[_0x9695('0x36')]=_[_0x9695('0x35')](_0x3781d2[_0x9695('0x32')],qs['fields'](_0xc21b0d[_0x9695('0x33')][_0x9695('0x48')]));_0x50eed5[_0x9695('0x36')]=_0x50eed5[_0x9695('0x36')]['length']?_0x50eed5[_0x9695('0x36')]:_0x3781d2[_0x9695('0x32')];if(_0xc21b0d[_0x9695('0x33')][_0x9695('0x41')]){_0x50eed5['include']=[{'all':!![]}];}_0x50eed5=_[_0x9695('0x3e')]({},_0x50eed5,_0xc21b0d[_0x9695('0x40')]);return db[_0x9695('0x2d')][_0x9695('0x49')](_0x50eed5)['then'](handleEntityNotFound(_0x3d78c0,null))[_0x9695('0x26')](respondWithResult(_0x3d78c0,null))[_0x9695('0x44')](handleError(_0x3d78c0,null));};exports['create']=function(_0x5a9631,_0xd5d1e3){return db[_0x9695('0x2d')]['create'](_0x5a9631[_0x9695('0x4a')],{})[_0x9695('0x26')](respondWithResult(_0xd5d1e3,0xc9))[_0x9695('0x44')](handleError(_0xd5d1e3,null));};exports[_0x9695('0x25')]=function(_0x97edbd,_0x56d4ed){if(_0x97edbd['body']['id']){delete _0x97edbd[_0x9695('0x4a')]['id'];}return db[_0x9695('0x2d')]['find']({'where':{'id':_0x97edbd['params']['id']}})[_0x9695('0x26')](handleEntityNotFound(_0x56d4ed,null))['then'](saveUpdates(_0x97edbd['body'],null))['then'](respondWithResult(_0x56d4ed,null))[_0x9695('0x44')](handleError(_0x56d4ed,null));};exports[_0x9695('0x27')]=function(_0x56ef9b,_0x36e635){return db[_0x9695('0x2d')][_0x9695('0x49')]({'where':{'id':_0x56ef9b['params']['id']}})['then'](handleEntityNotFound(_0x36e635,null))[_0x9695('0x26')](removeEntity(_0x36e635,null))[_0x9695('0x44')](handleError(_0x36e635,null));};exports[_0x9695('0x4b')]=function(_0x4a8ffd,_0x32f6b8){return db[_0x9695('0x2d')][_0x9695('0x4b')]()[_0x9695('0x26')](respondWithResult(_0x32f6b8,null))[_0x9695('0x44')](handleError(_0x32f6b8,null));};exports['getUnread']=function(_0x2a331c,_0x1ef95f,_0x58429e){return db[_0x9695('0x4c')][_0x9695('0x22')]({'where':{'ChatGroupId':_0x2a331c[_0x9695('0x46')]['id'],'ToId':_0x2a331c[_0x9695('0x4d')]['id'],'read':![]}})[_0x9695('0x26')](function(_0x252cb7){return{'id':_[_0x9695('0x4e')](_0x2a331c[_0x9695('0x46')]['id']),'count':_0x252cb7};})[_0x9695('0x26')](respondWithResult(_0x1ef95f,null))[_0x9695('0x44')](handleError(_0x1ef95f,null));};exports[_0x9695('0x4f')]=function(_0xaff686,_0x58bcff,_0x3b0077){return db[_0x9695('0x2d')]['find']({'where':{'id':_0xaff686[_0x9695('0x46')]['id']}})[_0x9695('0x26')](handleEntityNotFound(_0x58bcff,null))[_0x9695('0x26')](function(_0x13b9e6){if(_0x13b9e6){return _0x13b9e6[_0x9695('0x4f')](_0xaff686[_0x9695('0x4a')]['ids'],_[_0x9695('0x50')](_0xaff686[_0x9695('0x4a')],[_0x9695('0x51'),'id'])||{});}})['then'](respondWithResult(_0x58bcff,null))[_0x9695('0x44')](handleError(_0x58bcff,null));};exports['getMembers']=function(_0x4ba9ee,_0x513182,_0x51b192){var _0x36a4ac={};var _0x32bf00={};var _0x2b1cef;var _0x2df1f1;return db[_0x9695('0x2d')]['findOne']({'where':{'id':_0x4ba9ee['params']['id']}})[_0x9695('0x26')](handleEntityNotFound(_0x513182,null))[_0x9695('0x26')](function(_0x26994d){if(_0x26994d){_0x2b1cef=_0x26994d;_0x32bf00['model']=_[_0x9695('0x47')](db[_0x9695('0x52')][_0x9695('0x2e')]);_0x32bf00['query']=_[_0x9695('0x47')](_0x4ba9ee[_0x9695('0x33')]);_0x32bf00[_0x9695('0x34')]=_[_0x9695('0x35')](_0x32bf00['model'],_0x32bf00[_0x9695('0x33')]);_0x36a4ac[_0x9695('0x36')]=_[_0x9695('0x35')](_0x32bf00[_0x9695('0x32')],qs['fields'](_0x4ba9ee[_0x9695('0x33')][_0x9695('0x48')]));_0x36a4ac[_0x9695('0x36')]=_0x36a4ac[_0x9695('0x36')][_0x9695('0x37')]?_0x36a4ac['attributes']:_0x32bf00['model'];_0x36a4ac['order']=qs[_0x9695('0x3a')](_0x4ba9ee['query'][_0x9695('0x3a')]);_0x36a4ac[_0x9695('0x3b')]=qs[_0x9695('0x34')](_[_0x9695('0x3c')](_0x4ba9ee[_0x9695('0x33')],_0x32bf00[_0x9695('0x34')]));if(_0x4ba9ee[_0x9695('0x33')][_0x9695('0x3d')]){_0x36a4ac[_0x9695('0x3b')]=_['merge'](_0x36a4ac['where'],{'$or':_[_0x9695('0x2c')](_0x36a4ac[_0x9695('0x36')],function(_0x148061){var _0x5ae665={};_0x5ae665[_0x148061]={'$like':'%'+_0x4ba9ee[_0x9695('0x33')][_0x9695('0x3d')]+'%'};return _0x5ae665;})});}_0x36a4ac=_[_0x9695('0x3e')]({},_0x36a4ac,_0x4ba9ee['options']);return _0x2b1cef[_0x9695('0x53')](_0x36a4ac);}})['then'](function(_0x141ff0){if(_0x141ff0){_0x2df1f1=_0x141ff0[_0x9695('0x37')];if(!_0x4ba9ee[_0x9695('0x33')][_0x9695('0x38')](_0x9695('0x54'))){_0x36a4ac[_0x9695('0x20')]=qs[_0x9695('0x20')](_0x4ba9ee[_0x9695('0x33')][_0x9695('0x20')]);_0x36a4ac[_0x9695('0x1f')]=qs[_0x9695('0x1f')](_0x4ba9ee[_0x9695('0x33')][_0x9695('0x1f')]);}return _0x2b1cef[_0x9695('0x53')](_0x36a4ac);}})[_0x9695('0x26')](function(_0x10940c){if(_0x10940c){return _0x10940c?{'count':_0x2df1f1,'rows':_0x10940c}:null;}})[_0x9695('0x26')](respondWithResult(_0x513182,null))[_0x9695('0x44')](handleError(_0x513182,null));};exports[_0x9695('0x55')]=function(_0x596b05,_0x37e26b,_0x1853bb){return db[_0x9695('0x2d')][_0x9695('0x49')]({'where':{'id':_0x596b05[_0x9695('0x46')]['id']}})[_0x9695('0x26')](handleEntityNotFound(_0x37e26b,null))[_0x9695('0x26')](function(_0x390c88){if(_0x390c88){return _0x390c88[_0x9695('0x55')](_0x596b05[_0x9695('0x33')]['ids']);}})[_0x9695('0x26')](respondWithStatusCode(_0x37e26b,null))[_0x9695('0x44')](handleError(_0x37e26b,null));};exports[_0x9695('0x56')]=function(_0x1945ef,_0x4f18f9,_0x381f0d){if(_0x1945ef[_0x9695('0x4a')]['id']){delete _0x1945ef['body']['id'];}return db[_0x9695('0x2d')][_0x9695('0x49')]({'where':{'id':_0x1945ef[_0x9695('0x46')]['id']}})[_0x9695('0x26')](handleEntityNotFound(_0x4f18f9,null))[_0x9695('0x26')](function(_0x329371){if(_0x329371){_0x1945ef['body']['ChatGroupId']=_0x329371['id'];return db[_0x9695('0x4c')][_0x9695('0x57')](_0x1945ef[_0x9695('0x4a')]);}})[_0x9695('0x26')](respondWithResult(_0x4f18f9,null))['catch'](handleError(_0x4f18f9,null));};exports[_0x9695('0x58')]=function(_0x1a59f0,_0x4f13a4,_0x1ed816){var _0x49009b={};var _0x108e09={};var _0x4dcbd9;var _0x1077e3;return db['ChatGroup'][_0x9695('0x59')]({'where':{'id':_0x1a59f0[_0x9695('0x46')]['id']}})[_0x9695('0x26')](handleEntityNotFound(_0x4f13a4,null))[_0x9695('0x26')](function(_0x21c976){if(_0x21c976){_0x4dcbd9=_0x21c976;_0x108e09['model']=_[_0x9695('0x47')](db[_0x9695('0x4c')][_0x9695('0x2e')]);_0x108e09[_0x9695('0x33')]=_[_0x9695('0x47')](_0x1a59f0['query']);_0x108e09[_0x9695('0x34')]=_[_0x9695('0x35')](_0x108e09[_0x9695('0x32')],_0x108e09[_0x9695('0x33')]);_0x49009b['attributes']=_[_0x9695('0x35')](_0x108e09[_0x9695('0x32')],qs[_0x9695('0x48')](_0x1a59f0[_0x9695('0x33')][_0x9695('0x48')]));_0x49009b[_0x9695('0x36')]=_0x49009b[_0x9695('0x36')][_0x9695('0x37')]?_0x49009b[_0x9695('0x36')]:_0x108e09[_0x9695('0x32')];_0x49009b['order']=qs[_0x9695('0x3a')](_0x1a59f0[_0x9695('0x33')][_0x9695('0x3a')]);_0x49009b[_0x9695('0x3b')]=qs['filters'](_['pick'](_0x1a59f0['query'],_0x108e09[_0x9695('0x34')]));if(_0x1a59f0['query'][_0x9695('0x3d')]){_0x49009b[_0x9695('0x3b')]=_['merge'](_0x49009b[_0x9695('0x3b')],{'$or':_['map'](_0x49009b[_0x9695('0x36')],function(_0x5109a1){var _0x2eb356={};_0x2eb356[_0x5109a1]={'$like':'%'+_0x1a59f0[_0x9695('0x33')][_0x9695('0x3d')]+'%'};return _0x2eb356;})});}if(_0x1a59f0[_0x9695('0x33')][_0x9695('0x5a')]){var _0x50f131=_0x1a59f0[_0x9695('0x33')]['$gte'][_0x9695('0x5b')](',');var _0x5c6315={};_0x5c6315[_0x50f131[0x0]]={'$gte':moment(_0x50f131[0x1])[_0x9695('0x5c')](_0x9695('0x5d'))};_0x49009b[_0x9695('0x3b')]=_[_0x9695('0x3e')](_0x49009b[_0x9695('0x3b')],_0x5c6315);}_0x49009b=_['merge']({},_0x49009b,_0x1a59f0[_0x9695('0x40')]);return _0x4dcbd9['getMessages'](_0x49009b);}})[_0x9695('0x26')](function(_0x2337df){if(_0x2337df){_0x1077e3=_0x2337df[_0x9695('0x37')];if(!_0x1a59f0['query'][_0x9695('0x38')]('nolimit')){_0x49009b[_0x9695('0x20')]=qs[_0x9695('0x20')](_0x1a59f0[_0x9695('0x33')]['limit']);_0x49009b[_0x9695('0x1f')]=qs[_0x9695('0x1f')](_0x1a59f0[_0x9695('0x33')][_0x9695('0x1f')]);}return _0x4dcbd9[_0x9695('0x58')](_0x49009b);}})[_0x9695('0x26')](function(_0x2e78f4){if(_0x2e78f4){return _0x2e78f4?{'count':_0x1077e3,'rows':_0x2e78f4}:null;}})['then'](respondWithResult(_0x4f13a4,null))[_0x9695('0x44')](handleError(_0x4f13a4,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 09691ea..54eae1f 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 _0xa3fe=['ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','events'];(function(_0x1659c0,_0x5b4a18){var _0x82934a=function(_0x3d73d1){while(--_0x3d73d1){_0x1659c0['push'](_0x1659c0['shift']());}};_0x82934a(++_0x5b4a18);}(_0xa3fe,0xd8));var _0xea3f=function(_0x1016aa,_0x1e3d5f){_0x1016aa=_0x1016aa-0x0;var _0x1d340f=_0xa3fe[_0x1016aa];return _0x1d340f;};'use strict';var EventEmitter=require(_0xea3f('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xea3f('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xea3f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea3f('0x3'),'afterDestroy':_0xea3f('0x4')};function emitEvent(_0xc23ba9){return function(_0x5d6309,_0x2880a2,_0x4e8978){ChatGroupEvents[_0xea3f('0x5')](_0xc23ba9+':'+_0x5d6309['id'],_0x5d6309);ChatGroupEvents[_0xea3f('0x5')](_0xc23ba9,_0x5d6309);_0x4e8978(null);};}for(var e in events){if(events[_0xea3f('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xbde2=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0xc835d8,_0x413012){var _0x25950f=function(_0x752daa){while(--_0x752daa){_0xc835d8['push'](_0xc835d8['shift']());}};_0x25950f(++_0x413012);}(_0xbde2,0x111));var _0x2bde=function(_0x2fc7d4,_0x3db10f){_0x2fc7d4=_0x2fc7d4-0x0;var _0xaa4af2=_0xbde2[_0x2fc7d4];return _0xaa4af2;};'use strict';var EventEmitter=require(_0x2bde('0x0'));var ChatGroup=require(_0x2bde('0x1'))['db'][_0x2bde('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2bde('0x3')](0x0);var events={'afterCreate':_0x2bde('0x4'),'afterUpdate':_0x2bde('0x5'),'afterDestroy':'remove'};function emitEvent(_0xb82ff){return function(_0x12729e,_0x24d16c,_0x85ba82){ChatGroupEvents[_0x2bde('0x6')](_0xb82ff+':'+_0x12729e['id'],_0x12729e);ChatGroupEvents[_0x2bde('0x6')](_0xb82ff,_0x12729e);_0x85ba82(null);};}for(var e in events){if(events[_0x2bde('0x7')](e)){var event=events[e];ChatGroup[_0x2bde('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 00c8397..6ba3b54 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 _0x26ad=['ChatGroup','chat_groups','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x15445a,_0x28a4f4){var _0x4a2a27=function(_0x179401){while(--_0x179401){_0x15445a['push'](_0x15445a['shift']());}};_0x4a2a27(++_0x28a4f4);}(_0x26ad,0x1be));var _0xd26a=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0x26ad[_0x2468b5];return _0x1056e4;};'use strict';var _=require(_0xd26a('0x0'));var util=require(_0xd26a('0x1'));var logger=require(_0xd26a('0x2'))('api');var moment=require(_0xd26a('0x3'));var BPromise=require('bluebird');var rp=require(_0xd26a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd26a('0x5'));var config=require(_0xd26a('0x6'));var attributes=require(_0xd26a('0x7'));module[_0xd26a('0x8')]=function(_0x559912,_0x8d94c0){return _0x559912[_0xd26a('0x9')](_0xd26a('0xa'),attributes,{'tableName':_0xd26a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6821=['bluebird','request-promise','path','rimraf','../../config/environment','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0x6821,0x8a));var _0x1682=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x6821[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x1682('0x0'));var util=require(_0x1682('0x1'));var logger=require(_0x1682('0x2'))(_0x1682('0x3'));var moment=require(_0x1682('0x4'));var BPromise=require(_0x1682('0x5'));var rp=require(_0x1682('0x6'));var fs=require('fs');var path=require(_0x1682('0x7'));var rimraf=require(_0x1682('0x8'));var config=require(_0x1682('0x9'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x3ec660,_0x18fc81){return _0x3ec660[_0x1682('0xa')](_0x1682('0xb'),attributes,{'tableName':_0x1682('0xc'),'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 5d3d53d..3d5aab6 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 _0x946e=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','request','then','ChatGroup,\x20%s,\x20%s'];(function(_0x54212c,_0x5aaa27){var _0x384f5e=function(_0x37661e){while(--_0x37661e){_0x54212c['push'](_0x54212c['shift']());}};_0x384f5e(++_0x5aaa27);}(_0x946e,0x1d0));var _0xe946=function(_0x2799fa,_0x4e822b){_0x2799fa=_0x2799fa-0x0;var _0x47ec47=_0x946e[_0x2799fa];return _0x47ec47;};'use strict';var _=require(_0xe946('0x0'));var util=require('util');var moment=require(_0xe946('0x1'));var BPromise=require('bluebird');var rs=require(_0xe946('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe946('0x3'));var logger=require(_0xe946('0x4'))(_0xe946('0x5'));var config=require(_0xe946('0x6'));var jayson=require(_0xe946('0x7'));var client=jayson['client'][_0xe946('0x8')]({'port':0x232a});config[_0xe946('0x9')]=_[_0xe946('0xa')](config['redis'],{'host':_0xe946('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe946('0x9')]));require(_0xe946('0xc'))['register'](socket);function respondWithRpcPromise(_0x47e7a1,_0x49e9fc,_0x286140){return new BPromise(function(_0x49b412,_0x5679f6){return client[_0xe946('0xd')](_0x47e7a1,_0x286140)[_0xe946('0xe')](function(_0x56d82e){logger['info'](_0xe946('0xf'),_0x49e9fc,_0xe946('0x10'));logger['debug'](_0xe946('0x11'),_0x49e9fc,_0xe946('0x10'),JSON[_0xe946('0x12')](_0x56d82e));if(_0x56d82e[_0xe946('0x13')]){if(_0x56d82e[_0xe946('0x13')][_0xe946('0x14')]===0x1f4){logger[_0xe946('0x13')]('ChatGroup,\x20%s,\x20%s',_0x49e9fc,_0x56d82e['error'][_0xe946('0x15')]);return _0x5679f6(_0x56d82e[_0xe946('0x13')][_0xe946('0x15')]);}logger['error'](_0xe946('0xf'),_0x49e9fc,_0x56d82e[_0xe946('0x13')][_0xe946('0x15')]);return _0x49b412(_0x56d82e['error'][_0xe946('0x15')]);}else{logger[_0xe946('0x16')](_0xe946('0xf'),_0x49e9fc,'request\x20sent');_0x49b412(_0x56d82e[_0xe946('0x17')][_0xe946('0x15')]);}})['catch'](function(_0x2b2b66){logger['error'](_0xe946('0xf'),_0x49e9fc,_0x2b2b66);_0x5679f6(_0x2b2b66);});});}
\ No newline at end of file
+var _0x8ccb=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatGroup,\x20%s,\x20%s'];(function(_0x89f265,_0x5e2d96){var _0x5b0b9a=function(_0x271469){while(--_0x271469){_0x89f265['push'](_0x89f265['shift']());}};_0x5b0b9a(++_0x5e2d96);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0x8ccb[_0x1f7996];return _0x584609;};'use strict';var _=require(_0xb8cc('0x0'));var util=require(_0xb8cc('0x1'));var moment=require('moment');var BPromise=require(_0xb8cc('0x2'));var rs=require(_0xb8cc('0x3'));var fs=require('fs');var Redis=require(_0xb8cc('0x4'));var db=require(_0xb8cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb8cc('0x6'));var config=require(_0xb8cc('0x7'));var jayson=require(_0xb8cc('0x8'));var client=jayson['client'][_0xb8cc('0x9')]({'port':0x232a});config[_0xb8cc('0xa')]=_[_0xb8cc('0xb')](config['redis'],{'host':_0xb8cc('0xc'),'port':0x18eb});var socket=require(_0xb8cc('0xd'))(new Redis(config[_0xb8cc('0xa')]));require('./chatGroup.socket')[_0xb8cc('0xe')](socket);function respondWithRpcPromise(_0x1bb3ab,_0x4a6dba,_0x54b0b4){return new BPromise(function(_0x454465,_0x91df57){return client['request'](_0x1bb3ab,_0x54b0b4)['then'](function(_0x14c621){logger[_0xb8cc('0xf')]('ChatGroup,\x20%s,\x20%s',_0x4a6dba,_0xb8cc('0x10'));logger[_0xb8cc('0x11')](_0xb8cc('0x12'),_0x4a6dba,_0xb8cc('0x10'),JSON[_0xb8cc('0x13')](_0x14c621));if(_0x14c621[_0xb8cc('0x14')]){if(_0x14c621[_0xb8cc('0x14')]['code']===0x1f4){logger[_0xb8cc('0x14')]('ChatGroup,\x20%s,\x20%s',_0x4a6dba,_0x14c621[_0xb8cc('0x14')][_0xb8cc('0x15')]);return _0x91df57(_0x14c621[_0xb8cc('0x14')]['message']);}logger[_0xb8cc('0x14')](_0xb8cc('0x16'),_0x4a6dba,_0x14c621[_0xb8cc('0x14')]['message']);return _0x454465(_0x14c621[_0xb8cc('0x14')]['message']);}else{logger[_0xb8cc('0xf')]('ChatGroup,\x20%s,\x20%s',_0x4a6dba,_0xb8cc('0x10'));_0x454465(_0x14c621[_0xb8cc('0x17')][_0xb8cc('0x15')]);}})[_0xb8cc('0x18')](function(_0xf59627){logger['error'](_0xb8cc('0x16'),_0x4a6dba,_0xf59627);_0x91df57(_0xf59627);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 1bcb4e8..d810e63 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 _0xf645=['removeListener','register','./chatGroup.events','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf645,0x129));var _0x5f64=function(_0x222ac2,_0x57ec8c){_0x222ac2=_0x222ac2-0x0;var _0x4b6f35=_0xf645[_0x222ac2];return _0x4b6f35;};'use strict';var ChatGroupEvents=require(_0x5f64('0x0'));var events=[_0x5f64('0x1'),'remove',_0x5f64('0x2')];function createListener(_0xa78e79,_0x34cbf4){return function(_0x41c6b8){_0x34cbf4['emit'](_0xa78e79,_0x41c6b8);};}function removeListener(_0x1182ed,_0x3305a0){return function(){ChatGroupEvents[_0x5f64('0x3')](_0x1182ed,_0x3305a0);};}exports[_0x5f64('0x4')]=function(_0x4f7470){for(var _0x450120=0x0,_0x3339a1=events['length'];_0x450120<_0x3339a1;_0x450120++){var _0x1d0749=events[_0x450120];var _0x226c92=createListener('chatGroup:'+_0x1d0749,_0x4f7470);ChatGroupEvents['on'](_0x1d0749,_0x226c92);}};
\ No newline at end of file
+var _0x602a=['update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','remove'];(function(_0x478970,_0x3d45d9){var _0x493237=function(_0x40fce3){while(--_0x40fce3){_0x478970['push'](_0x478970['shift']());}};_0x493237(++_0x3d45d9);}(_0x602a,0x1de));var _0xa602=function(_0x4314fe,_0x36b15c){_0x4314fe=_0x4314fe-0x0;var _0x47ac83=_0x602a[_0x4314fe];return _0x47ac83;};'use strict';var ChatGroupEvents=require(_0xa602('0x0'));var events=['save',_0xa602('0x1'),_0xa602('0x2')];function createListener(_0x403c06,_0x1e9fa4){return function(_0x4f8890){_0x1e9fa4[_0xa602('0x3')](_0x403c06,_0x4f8890);};}function removeListener(_0x25afef,_0x583cba){return function(){ChatGroupEvents[_0xa602('0x4')](_0x25afef,_0x583cba);};}exports[_0xa602('0x5')]=function(_0x5c79a1){for(var _0x2a9d2f=0x0,_0x58d7d5=events[_0xa602('0x6')];_0x2a9d2f<_0x58d7d5;_0x2a9d2f++){var _0x1c4ee9=events[_0x2a9d2f];var _0x31bc1b=createListener(_0xa602('0x7')+_0x1c4ee9,_0x5c79a1);ChatGroupEvents['on'](_0x1c4ee9,_0x31bc1b);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 55ce0fb..83436c4 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 _0xaf40=['update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMessage','put'];(function(_0x4afee3,_0x4b7714){var _0xdb146a=function(_0x429b44){while(--_0x429b44){_0x4afee3['push'](_0x4afee3['shift']());}};_0xdb146a(++_0x4b7714);}(_0xaf40,0x155));var _0x0af4=function(_0x506851,_0x11f505){_0x506851=_0x506851-0x0;var _0x4fbd47=_0xaf40[_0x506851];return _0x4fbd47;};'use strict';var multer=require(_0x0af4('0x0'));var util=require(_0x0af4('0x1'));var path=require(_0x0af4('0x2'));var timeout=require('connect-timeout');var express=require(_0x0af4('0x3'));var router=express['Router']();var fs_extra=require(_0x0af4('0x4'));var auth=require(_0x0af4('0x5'));var interaction=require(_0x0af4('0x6'));var config=require(_0x0af4('0x7'));var controller=require(_0x0af4('0x8'));router[_0x0af4('0x9')]('/',auth[_0x0af4('0xa')](),controller[_0x0af4('0xb')]);router['get'](_0x0af4('0xc'),auth[_0x0af4('0xa')](),controller['describe']);router[_0x0af4('0x9')](_0x0af4('0xd'),auth[_0x0af4('0xa')](),controller['show']);router[_0x0af4('0x9')](_0x0af4('0xe'),auth[_0x0af4('0xa')](),controller[_0x0af4('0xf')]);router[_0x0af4('0x9')](_0x0af4('0x10'),auth['isAuthenticated'](),controller[_0x0af4('0x11')]);router[_0x0af4('0x9')](_0x0af4('0x12'),auth[_0x0af4('0xa')](),controller['getMessages']);router[_0x0af4('0x13')]('/',auth[_0x0af4('0xa')](),controller[_0x0af4('0x14')]);router['post'](_0x0af4('0x10'),auth['isAuthenticated'](),controller['addMembers']);router[_0x0af4('0x13')]('/:id/messages',auth[_0x0af4('0xa')](),controller[_0x0af4('0x15')]);router[_0x0af4('0x16')](_0x0af4('0xd'),auth['isAuthenticated'](),controller[_0x0af4('0x17')]);router['delete']('/:id',auth[_0x0af4('0xa')](),controller['destroy']);router[_0x0af4('0x18')]('/:id/members',auth[_0x0af4('0xa')](),controller['removeMembers']);module[_0x0af4('0x19')]=router;
\ No newline at end of file
+var _0x54ec=['addMessage','update','delete','destroy','removeMembers','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','/:id','/:id/unread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers'];(function(_0x2bc498,_0x3cb268){var _0x2a53a2=function(_0x327eea){while(--_0x327eea){_0x2bc498['push'](_0x2bc498['shift']());}};_0x2a53a2(++_0x3cb268);}(_0x54ec,0x1c8));var _0xc54e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x54ec[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xc54e('0x0'));var util=require(_0xc54e('0x1'));var path=require(_0xc54e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc54e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc54e('0x4'));var interaction=require(_0xc54e('0x5'));var config=require('../../config/environment');var controller=require(_0xc54e('0x6'));router[_0xc54e('0x7')]('/',auth[_0xc54e('0x8')](),controller['index']);router[_0xc54e('0x7')](_0xc54e('0x9'),auth[_0xc54e('0x8')](),controller['describe']);router['get'](_0xc54e('0xa'),auth[_0xc54e('0x8')](),controller['show']);router[_0xc54e('0x7')](_0xc54e('0xb'),auth[_0xc54e('0x8')](),controller['getUnread']);router['get']('/:id/members',auth[_0xc54e('0x8')](),controller[_0xc54e('0xc')]);router[_0xc54e('0x7')](_0xc54e('0xd'),auth[_0xc54e('0x8')](),controller[_0xc54e('0xe')]);router[_0xc54e('0xf')]('/',auth[_0xc54e('0x8')](),controller[_0xc54e('0x10')]);router[_0xc54e('0xf')](_0xc54e('0x11'),auth[_0xc54e('0x8')](),controller[_0xc54e('0x12')]);router[_0xc54e('0xf')](_0xc54e('0xd'),auth[_0xc54e('0x8')](),controller[_0xc54e('0x13')]);router['put'](_0xc54e('0xa'),auth[_0xc54e('0x8')](),controller[_0xc54e('0x14')]);router[_0xc54e('0x15')](_0xc54e('0xa'),auth['isAuthenticated'](),controller[_0xc54e('0x16')]);router[_0xc54e('0x15')]('/:id/members',auth[_0xc54e('0x8')](),controller[_0xc54e('0x17')]);module[_0xc54e('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 0145647..44efd04 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 _0x0f5a=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out','sequelize','exports'];(function(_0x554a86,_0x3b78fe){var _0x21f1ef=function(_0x2dd308){while(--_0x2dd308){_0x554a86['push'](_0x554a86['shift']());}};_0x21f1ef(++_0x3b78fe);}(_0x0f5a,0x1e2));var _0xa0f5=function(_0x4c99ee,_0x2d8768){_0x4c99ee=_0x4c99ee-0x0;var _0x24bc5f=_0x0f5a[_0x4c99ee];return _0x24bc5f;};'use strict';var Sequelize=require(_0xa0f5('0x0'));module[_0xa0f5('0x1')]={'closed':{'type':Sequelize[_0xa0f5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa0f5('0x3')]},'ratingType':{'type':Sequelize[_0xa0f5('0x4')](_0xa0f5('0x5'),_0xa0f5('0x6')),'defaultValue':_0xa0f5('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xa0f5('0x7')]},'mailTranscript':{'type':Sequelize[_0xa0f5('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa0f5('0x9')]},'disposition':{'type':Sequelize[_0xa0f5('0x8')]},'secondDisposition':{'type':Sequelize[_0xa0f5('0x8')]},'thirdDisposition':{'type':Sequelize[_0xa0f5('0x8')]},'note':{'type':Sequelize[_0xa0f5('0x8')]},'browserName':{'type':Sequelize[_0xa0f5('0x8')]},'browserVersion':{'type':Sequelize[_0xa0f5('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa0f5('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xa0f5('0x8')]},'deviceType':{'type':Sequelize[_0xa0f5('0x8')]},'referer':{'type':Sequelize[_0xa0f5('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa0f5('0x7')]('long')},'read1stAt':{'type':Sequelize[_0xa0f5('0x9')]},'lastMsgAt':{'type':Sequelize[_0xa0f5('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa0f5('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa0f5('0x8')]},'customerPort':{'type':Sequelize[_0xa0f5('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xa0f5('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xa0f5('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x0c35=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','exports'];(function(_0x2aa6a9,_0xcc04d3){var _0x272634=function(_0x2f6b10){while(--_0x2f6b10){_0x2aa6a9['push'](_0x2aa6a9['shift']());}};_0x272634(++_0xcc04d3);}(_0x0c35,0x196));var _0x50c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0c35[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x50c3('0x0'));module[_0x50c3('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x50c3('0x2')]},'ratingType':{'type':Sequelize[_0x50c3('0x3')](_0x50c3('0x4'),_0x50c3('0x5')),'defaultValue':_0x50c3('0x4')},'ratingMessage':{'type':Sequelize[_0x50c3('0x6')]},'pathTranscript':{'type':Sequelize[_0x50c3('0x6')]},'mailTranscript':{'type':Sequelize[_0x50c3('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x50c3('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x50c3('0x7')]},'note':{'type':Sequelize[_0x50c3('0x7')]},'browserName':{'type':Sequelize[_0x50c3('0x7')]},'browserVersion':{'type':Sequelize[_0x50c3('0x7')]},'osName':{'type':Sequelize[_0x50c3('0x7')]},'osVersion':{'type':Sequelize[_0x50c3('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x50c3('0x7')]},'deviceType':{'type':Sequelize[_0x50c3('0x7')]},'referer':{'type':Sequelize[_0x50c3('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x50c3('0x6')](_0x50c3('0x9'))},'read1stAt':{'type':Sequelize[_0x50c3('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x50c3('0x3')]('in',_0x50c3('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x50c3('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x50c3('0xb')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x50c3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index d10fdad..132f63a 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 _0x73ad=['ids','getMessages','filters','hasOwnProperty','order','sort','where','pick','filter','map','$gte','split','ChatInteractionId','push','rows','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','attachments','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','osName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','sendStatus','stack','name','merge','body','contact','agent','interaction','account','index','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','user','show','params','model','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','follow','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','originalname','filename','file','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','CmContact','Messages','UserId','agentAlias','%s%d','ContactId','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage'];(function(_0x23dbda,_0x5977dc){var _0x5298f6=function(_0x1b87ab){while(--_0x1b87ab){_0x23dbda['push'](_0x23dbda['shift']());}};_0x5298f6(++_0x5977dc);}(_0x73ad,0x1c7));var _0xd73a=function(_0x490041,_0x903c15){_0x490041=_0x490041-0x0;var _0x4aa9a3=_0x73ad[_0x490041];return _0x4aa9a3;};'use strict';var rimraf=require(_0xd73a('0x0'));var zipdir=require(_0xd73a('0x1'));var rp=require(_0xd73a('0x2'));var moment=require('moment');var BPromise=require(_0xd73a('0x3'));var Mustache=require(_0xd73a('0x4'));var util=require(_0xd73a('0x5'));var path=require(_0xd73a('0x6'));var ejs=require(_0xd73a('0x7'));var fs=require('fs');var _=require(_0xd73a('0x8'));var Redis=require(_0xd73a('0x9'));var interaction=require('../../components/interaction/service');var qs=require(_0xd73a('0xa'));var pdf=require(_0xd73a('0xb'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xd73a('0xc'))['db'];config[_0xd73a('0xd')]=_['defaults'](config[_0xd73a('0xd')],{'host':_0xd73a('0xe'),'port':0x18eb});var socket=require(_0xd73a('0xf'))(new Redis(config[_0xd73a('0xd')]));require(_0xd73a('0x10'))[_0xd73a('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd73a('0x12')][_0xd73a('0x13')]({'port':0x232b});var client9004=jayson[_0xd73a('0x12')][_0xd73a('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x3733dd,_0x893ae8,_0x3c17fd,_0x489aea){return new BPromise(function(_0x5c5799,_0x6405da){var _0x1da722=_0x489aea||client;return _0x1da722[_0xd73a('0x14')](_0x3733dd,_0x3c17fd)[_0xd73a('0x15')](function(_0x26db88){logger[_0xd73a('0x16')](_0xd73a('0x17'),_0x893ae8,_0xd73a('0x18'));logger[_0xd73a('0x19')](_0xd73a('0x1a'),_0x893ae8,'request\x20sent',JSON[_0xd73a('0x1b')](_0x26db88));if(_0x26db88[_0xd73a('0x1c')]){if(_0x26db88['error'][_0xd73a('0x1d')]===0x1f4){logger[_0xd73a('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x893ae8,_0x26db88[_0xd73a('0x1c')][_0xd73a('0x1e')]);return _0x6405da(_0x26db88[_0xd73a('0x1c')][_0xd73a('0x1e')]);}logger['error'](_0xd73a('0x17'),_0x893ae8,_0x26db88[_0xd73a('0x1c')]['message']);return _0x5c5799(_0x26db88[_0xd73a('0x1c')]['message']);}else{logger[_0xd73a('0x16')](_0xd73a('0x17'),_0x893ae8,_0xd73a('0x18'));_0x5c5799(_0x26db88[_0xd73a('0x1f')][_0xd73a('0x1e')]);}})[_0xd73a('0x20')](function(_0x61fb06){logger['error'](_0xd73a('0x17'),_0x893ae8,_0x61fb06);_0x6405da(_0x61fb06);});});}function respondWithStatusCode(_0x3c9ab6,_0x1d66ea){_0x1d66ea=_0x1d66ea||0xcc;return function(_0x5c9dd9){if(_0x5c9dd9){return _0x3c9ab6['sendStatus'](_0x1d66ea);}return _0x3c9ab6[_0xd73a('0x21')](_0x1d66ea)[_0xd73a('0x22')]();};}function respondWithResult(_0x173b7b,_0x3e1a35){_0x3e1a35=_0x3e1a35||0xc8;return function(_0x3a4df3){if(_0x3a4df3){return _0x173b7b[_0xd73a('0x21')](_0x3e1a35)[_0xd73a('0x23')](_0x3a4df3);}};}function respondWithFilteredResult(_0x2c5106,_0x45f2e8){return function(_0x50eb7d){if(_0x50eb7d){var _0xf5362a=typeof _0x45f2e8[_0xd73a('0x24')]===_0xd73a('0x25')&&typeof _0x45f2e8[_0xd73a('0x26')]===_0xd73a('0x25');var _0x521fd4=_0x50eb7d[_0xd73a('0x27')];var _0x458be1=_0xf5362a?0x0:_0x45f2e8[_0xd73a('0x24')];var _0x51ebb6=_0xf5362a?_0x50eb7d[_0xd73a('0x27')]:_0x45f2e8[_0xd73a('0x24')]+_0x45f2e8[_0xd73a('0x26')];var _0xe973d1;if(_0x51ebb6>=_0x521fd4){_0x51ebb6=_0x521fd4;_0xe973d1=0xc8;}else{_0xe973d1=0xce;}_0x2c5106['status'](_0xe973d1);return _0x2c5106[_0xd73a('0x28')](_0xd73a('0x29'),_0x458be1+'-'+_0x51ebb6+'/'+_0x521fd4)['json'](_0x50eb7d);}return null;};}function saveUpdates(_0x508a73){return function(_0x2dcebf){if(_0x2dcebf){return _0x2dcebf[_0xd73a('0x2a')](_0x508a73)[_0xd73a('0x15')](function(_0x4a294c){return _0x4a294c;});}return null;};}function removeEntity(_0x4fda3a){return function(_0x46796b){if(_0x46796b){return _0x46796b[_0xd73a('0x2b')]()['then'](function(){_0x4fda3a[_0xd73a('0x21')](0xcc)[_0xd73a('0x22')]();});}};}function handleEntityNotFound(_0x1ba488){return function(_0x34b95d){if(!_0x34b95d){_0x1ba488[_0xd73a('0x2c')](0x194);}return _0x34b95d;};}function handleError(_0x43ce24,_0x21bc22){_0x21bc22=_0x21bc22||0x1f4;return function(_0x2da040){logger[_0xd73a('0x1c')](_0x2da040[_0xd73a('0x2d')]);if(_0x2da040[_0xd73a('0x2e')]){delete _0x2da040[_0xd73a('0x2e')];}_0x43ce24[_0xd73a('0x21')](_0x21bc22)['send'](_0x2da040);};}function getMustacheRender(_0xbd7ff8,_0x54573a){return Mustache['render'](_0xbd7ff8,_[_0xd73a('0x2f')](_0x54573a[_0xd73a('0x30')],{'contact':_0x54573a[_0xd73a('0x31')],'message':_0x54573a[_0xd73a('0x1e')],'agent':_0x54573a[_0xd73a('0x32')],'interaction':_0x54573a[_0xd73a('0x33')],'account':_0x54573a[_0xd73a('0x34')]}))||'';}exports[_0xd73a('0x35')]=function(_0x1224aa,_0x4ba260){var _0x570a30={};var _0x1d161c=_['map'](db[_0xd73a('0x36')]['rawAttributes'],function(_0x401149){return{'name':_0x401149[_0xd73a('0x37')],'type':_0x401149[_0xd73a('0x38')][_0xd73a('0x39')]};});_0x570a30=qs[_0xd73a('0x3a')](_0x1d161c,_0x1224aa);return interaction[_0xd73a('0x3b')](_0xd73a('0x3c'),_0x1224aa['query'],_0x1224aa[_0xd73a('0x3d')],_0x570a30,_0x1d161c)[_0xd73a('0x15')](respondWithFilteredResult(_0x4ba260,_0x570a30))[_0xd73a('0x20')](handleError(_0x4ba260,null));};exports[_0xd73a('0x3e')]=function(_0x47cc33,_0x286497){var _0x1f368a={'raw':![],'where':{'id':_0x47cc33[_0xd73a('0x3f')]['id']}},_0x19c63b={};_0x19c63b[_0xd73a('0x40')]=_['keys'](db[_0xd73a('0x36')][_0xd73a('0x41')]);_0x19c63b[_0xd73a('0x42')]=_[_0xd73a('0x43')](_0x47cc33[_0xd73a('0x42')]);_0x19c63b['filters']=_[_0xd73a('0x44')](_0x19c63b[_0xd73a('0x40')],_0x19c63b[_0xd73a('0x42')]);_0x1f368a[_0xd73a('0x45')]=_[_0xd73a('0x44')](_0x19c63b[_0xd73a('0x40')],qs[_0xd73a('0x46')](_0x47cc33[_0xd73a('0x42')]['fields']));_0x1f368a[_0xd73a('0x45')]=_0x1f368a['attributes'][_0xd73a('0x47')]?_0x1f368a[_0xd73a('0x45')]:_0x19c63b[_0xd73a('0x40')];if(_0x47cc33[_0xd73a('0x42')][_0xd73a('0x48')]){_0x1f368a[_0xd73a('0x49')]=[{'all':!![]}];}_0x1f368a=_['merge']({},_0x1f368a,_0x47cc33[_0xd73a('0x4a')]);return db[_0xd73a('0x36')][_0xd73a('0x4b')](_0x1f368a)['then'](handleEntityNotFound(_0x286497,null))[_0xd73a('0x15')](respondWithResult(_0x286497,null))['catch'](handleError(_0x286497,null));};exports[_0xd73a('0x4c')]=function(_0x305576,_0x41ae0a){return db[_0xd73a('0x36')][_0xd73a('0x4c')](_0x305576[_0xd73a('0x30')],{})[_0xd73a('0x15')](respondWithResult(_0x41ae0a,0xc9))['catch'](handleError(_0x41ae0a,null));};exports[_0xd73a('0x2a')]=function(_0x10f900,_0x4a02a1){if(_0x10f900[_0xd73a('0x30')]['id']){delete _0x10f900[_0xd73a('0x30')]['id'];}return db[_0xd73a('0x36')][_0xd73a('0x4b')]({'where':{'id':_0x10f900[_0xd73a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a02a1,null))[_0xd73a('0x15')](saveUpdates(_0x10f900[_0xd73a('0x30')],null))[_0xd73a('0x15')](respondWithResult(_0x4a02a1,null))['catch'](handleError(_0x4a02a1,null));};exports[_0xd73a('0x2b')]=function(_0x48caac,_0x311678){return db[_0xd73a('0x36')][_0xd73a('0x4b')]({'where':{'id':_0x48caac[_0xd73a('0x3f')]['id']}})[_0xd73a('0x15')](handleEntityNotFound(_0x311678,null))[_0xd73a('0x15')](removeEntity(_0x311678,null))['catch'](handleError(_0x311678,null));};exports[_0xd73a('0x4d')]=function(_0x4b75ed,_0x47cd76){return db[_0xd73a('0x36')][_0xd73a('0x4d')]()['then'](respondWithResult(_0x47cd76,null))['catch'](handleError(_0x47cd76,null));};exports[_0xd73a('0x4e')]=function(_0x4d4344,_0x456052){var _0x2627e2=_0x4d4344[_0xd73a('0x3f')]['id'];var _0x18e84e;var _0x38174a;var _0x4297b1;return db['ChatInteraction'][_0xd73a('0x4f')]({'where':{'id':_0x2627e2}})[_0xd73a('0x15')](function(_0x58ff52){_0x18e84e=_0x58ff52;return db[_0xd73a('0x50')][_0xd73a('0x4f')]({'where':{'id':_0x58ff52[_0xd73a('0x51')]},'attributes':['id',_0xd73a('0x52'),_0xd73a('0x53'),_0xd73a('0x54'),_0xd73a('0x55'),_0xd73a('0x56')],'raw':!![]});})['then'](function(_0x138c82){if(_0x138c82&&_0x138c82[_0xd73a('0x52')]&&_0x138c82[_0xd73a('0x53')]){_0x38174a=_0x138c82;var _0x3e23ac={'interaction':{'id':_0x2627e2},'agent':{'id':_0x4d4344[_0xd73a('0x3d')]['id'],'name':_0x4d4344[_0xd73a('0x3d')][_0xd73a('0x2e')],'fullname':_0x4d4344[_0xd73a('0x3d')][_0xd73a('0x57')],'email':_0x4d4344['user'][_0xd73a('0x58')]},'contact':_0x4d4344['body'][_0xd73a('0x31')],'account':_0x4d4344[_0xd73a('0x30')][_0xd73a('0x34')]};var _0x8dc5d3={'rejectUnauthorized':![],'method':'POST','url':_0xd73a('0x59'),'headers':{'X-APIKEY':_0x138c82[_0xd73a('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4d4344[_0xd73a('0x3d')][_0xd73a('0x58')]],'buttons':null,'topic':_0x38174a[_0xd73a('0x54')],'note':_['isNull'](_0x38174a[_0xd73a('0x55')])?null:getMustacheRender(_0x38174a[_0xd73a('0x55')],_0x3e23ac),'metadata':null},'redirect':_0xd73a('0x5a'),'json':!![]};try{if(!_['isNull'](_0x38174a['vidaooMetadata'])){var _0x252f18=getMustacheRender(_0x38174a[_0xd73a('0x56')],_0x3e23ac);var _0x1cc0cb=JSON['parse'](_0x252f18);_0x8dc5d3[_0xd73a('0x30')]['metadata']=_0x1cc0cb;}}catch(_0xf79de3){throw new db[(_0xd73a('0x5b'))][(_0xd73a('0x5c'))](_0xd73a('0x5d'));}return rp(_0x8dc5d3);}else{throw new db[(_0xd73a('0x5b'))][(_0xd73a('0x5c'))](_0xd73a('0x5e'));}})['then'](function(_0x2cc852){_0x4297b1=_0x2cc852;if(_0x4297b1['id']){var _0x54fb96={'body':_0x4297b1[_0xd73a('0x5f')],'ChatWebsiteId':_0x38174a['id'],'ChatInteractionId':_0x18e84e['id'],'direction':_0xd73a('0x60'),'UserId':_0x4d4344[_0xd73a('0x3d')]['id']};return db[_0xd73a('0x61')][_0xd73a('0x4c')](_0x54fb96,{});}else{throw new db[(_0xd73a('0x5b'))][(_0xd73a('0x5c'))](_0xd73a('0x62'));}})[_0xd73a('0x15')](function(){return _0x18e84e[_0xd73a('0x63')]({'vidaooSessionId':_0x4297b1['id']});})[_0xd73a('0x15')](respondWithResult(_0x456052,null))['catch'](handleError(_0x456052,null));};exports['customUpdate']=function(_0x594737,_0x25da65){if(_0x594737[_0xd73a('0x30')]['id']){delete _0x594737['body']['id'];}return db['ChatInteraction'][_0xd73a('0x4b')]({'where':{'id':_0x594737['params']['id']},'include':[{'model':db['CmContact'],'as':_0xd73a('0x64')}]})[_0xd73a('0x15')](handleEntityNotFound(_0x25da65,null))[_0xd73a('0x15')](saveUpdates(_0x594737[_0xd73a('0x30')],null))[_0xd73a('0x15')](respondWithResult(_0x25da65,null))['catch'](handleError(_0x25da65,null));};exports[_0xd73a('0x65')]=function(_0x125eb8,_0x1a85a1){if(_0x125eb8[_0xd73a('0x30')]['id']){delete _0x125eb8[_0xd73a('0x30')]['id'];}return db[_0xd73a('0x36')][_0xd73a('0x4b')]({'where':{'id':_0x125eb8[_0xd73a('0x3f')]['id']}})['then'](function(_0x521423){if(!_0x521423){logger[_0xd73a('0x1c')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xd73a('0x65'),0x194,_0xd73a('0x66'));_0x1a85a1[_0xd73a('0x2c')](0x194);}else{if(_0x521423['UserId']){throw new db['Sequelize'][(_0xd73a('0x5c'))](_0xd73a('0x67'));}}return _0x521423;})[_0xd73a('0x15')](function(_0x45fe11){if(_0x45fe11){return _0x45fe11[_0xd73a('0x2a')]({'closed':_0x125eb8[_0xd73a('0x30')][_0xd73a('0x68')],'disposition':_0x125eb8[_0xd73a('0x30')][_0xd73a('0x69')]})[_0xd73a('0x15')](function(_0x258aa8){return _0x258aa8;});}})['then'](function(){return respondWithRpcPromise(_0xd73a('0x6a'),_0xd73a('0x65'),_0x125eb8[_0xd73a('0x30')],client9004);})[_0xd73a('0x15')](respondWithResult(_0x1a85a1,null))[_0xd73a('0x20')](handleError(_0x1a85a1,null));};exports['attachmentUpload']=function(_0x29f821,_0x4afb2c){_0x29f821[_0xd73a('0x30')][_0xd73a('0x2e')]=_0x29f821['file'][_0xd73a('0x6b')];_0x29f821[_0xd73a('0x30')]['basename']=_0x29f821['file'][_0xd73a('0x6c')];_0x29f821[_0xd73a('0x30')][_0xd73a('0x38')]=_0x29f821[_0xd73a('0x6d')][_0xd73a('0x6e')];return db['Attachment'][_0xd73a('0x4c')](_0x29f821[_0xd73a('0x30')])[_0xd73a('0x15')](respondWithResult(_0x4afb2c,0xc9))[_0xd73a('0x20')](handleError(_0x4afb2c,null));};exports[_0xd73a('0x6f')]=function(_0x59cd92,_0x33e68f){return db[_0xd73a('0x36')][_0xd73a('0x4f')]({'where':{'id':_0x59cd92[_0xd73a('0x3f')]['id']},'raw':!![]})[_0xd73a('0x15')](handleEntityNotFound(_0x33e68f,null))[_0xd73a('0x15')](function(_0x2365b3){if(_0x2365b3){if(_0x2365b3[_0xd73a('0x68')]){return _0x33e68f['status'](0x193)['json']({'status':0x193,'message':_0xd73a('0x70')});}return db[_0xd73a('0x71')][_0xd73a('0x4f')]({'where':{'id':_0x59cd92[_0xd73a('0x42')][_0xd73a('0x72')]},'raw':!![]})[_0xd73a('0x15')](handleEntityNotFound(_0x33e68f,null));}})['then'](function(_0x3a8ba1){if(_0x3a8ba1){var _0x1d7884=_0x3a8ba1[_0xd73a('0x73')]!==null;var _0x1d44df=path[_0xd73a('0x74')](config['root'],'server/files/attachments/');if(_0x1d7884){_0x1d44df=path[_0xd73a('0x74')](_0x1d44df,'offline-chat/');}var _0x14fb84=path[_0xd73a('0x74')](_0x1d44df,_0x3a8ba1[_0xd73a('0x75')]);return _0x33e68f[_0xd73a('0x76')](_0x14fb84);}})[_0xd73a('0x20')](handleError(_0x33e68f,null));};exports['close']=function(_0x30457c,_0x3c7fec){var _0x200ad6=null;var _0x54540d=null;var _0x44abcd=null;if(_0x30457c[_0xd73a('0x30')]['id']){delete _0x30457c['body']['id'];}if(_0x30457c[_0xd73a('0x30')][_0xd73a('0x77')]){_0x44abcd=path['join'](config['root'],_0xd73a('0x78'),util[_0xd73a('0x79')](_0xd73a('0x7a'),Date[_0xd73a('0x7b')]()));_0x30457c[_0xd73a('0x30')][_0xd73a('0x7c')]=_0x44abcd;}return db['ChatInteraction'][_0xd73a('0x4b')]({'where':{'id':_0x30457c['params']['id']},'include':[{'model':db[_0xd73a('0x61')],'as':'Messages','include':[{'model':db[_0xd73a('0x7d')],'as':_0xd73a('0x7d')}]}]})[_0xd73a('0x15')](handleEntityNotFound(_0x3c7fec,null))[_0xd73a('0x15')](saveUpdates(_0x30457c[_0xd73a('0x30')],null))[_0xd73a('0x15')](function(_0x57e46c){if(_0x57e46c){_0x200ad6=_0x57e46c;return db[_0xd73a('0x50')][_0xd73a('0x4b')]({'where':{'id':_0x200ad6['ChatWebsiteId']}});}})[_0xd73a('0x15')](function(_0x479f8c){if(_0x479f8c){_0x54540d=_0x479f8c;return db[_0xd73a('0x7e')][_0xd73a('0x4b')]({'where':{'id':_0x200ad6['ContactId']}});}})[_0xd73a('0x15')](function(_0x4705ca){if(_0x4705ca){if(_0x44abcd){var _0x55cfd1=null;for(var _0xb15e72=0x1;_0xb15e72<_0x200ad6[_0xd73a('0x7f')][_0xd73a('0x47')];++_0xb15e72){_0x55cfd1=_0x200ad6['Messages'][_0xb15e72];var _0x1bf2d6=_0x55cfd1[_0xd73a('0x80')]?util['format']('%s%d',_0x54540d[_0xd73a('0x81')],_0x55cfd1[_0xd73a('0x80')]):'System';var _0x3182e7=_0x30457c[_0xd73a('0x30')]['customer']||util[_0xd73a('0x79')](_0xd73a('0x82'),'Visitor',_0x55cfd1[_0xd73a('0x83')]);switch(_0x54540d['agentIdentifier']){case _0xd73a('0x84'):_0x1bf2d6=_0x55cfd1[_0xd73a('0x80')]?util[_0xd73a('0x79')]('%s%d',_0x54540d['agentAlias'],_0x55cfd1[_0xd73a('0x80')]):_0xd73a('0x85');break;case _0xd73a('0x86'):_0x1bf2d6=_0x55cfd1[_0xd73a('0x80')]?_0x55cfd1[_0xd73a('0x7d')][_0xd73a('0x87')]||_0x55cfd1['User'][_0xd73a('0x57')]:_0xd73a('0x85');break;case'agent_fullname':_0x1bf2d6=_0x55cfd1[_0xd73a('0x80')]?_0x55cfd1[_0xd73a('0x7d')]['fullname']:_0xd73a('0x85');break;default:_0x1bf2d6=_0x55cfd1[_0xd73a('0x80')]?util[_0xd73a('0x79')]('%s%d',_0x54540d[_0xd73a('0x81')],_0x55cfd1['UserId']):'System';}var _0x2b9f93=util[_0xd73a('0x79')](_0xd73a('0x88'),moment(_0x55cfd1[_0xd73a('0x89')])[_0xd73a('0x79')](_0xd73a('0x8a')),_0x55cfd1['direction']==='in'?_0x3182e7:_0x1bf2d6,_0x55cfd1[_0xd73a('0x30')]);if(!_0x55cfd1[_0xd73a('0x8b')]){fs[_0xd73a('0x8c')](_0x44abcd,_0x2b9f93);}}return db[_0xd73a('0x8d')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xd73a('0x8e')],'as':_0xd73a('0x8f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xd73a('0x15')](function(_0x5901a3){if(!_0x5901a3||!_0x5901a3['Smtp']||!_0x30457c[_0xd73a('0x30')])return _0x200ad6;var _0x54d2f4=_0x5901a3[_0xd73a('0x90')]();return respondWithRpcPromise(_0xd73a('0x91'),_0xd73a('0x92'),{'account':_0x54d2f4,'message':{'from':util[_0xd73a('0x79')](_0xd73a('0x93'),_0x5901a3['name'],_0x5901a3['email']||_0x5901a3[_0xd73a('0x8f')]['user']),'to':_0x30457c['body'][_0xd73a('0x77')],'subject':_0xd73a('0x94'),'text':util[_0xd73a('0x79')](_0xd73a('0x95'),_0x30457c[_0xd73a('0x30')]['mailTranscript']),'attachments':[{'path':_0x44abcd}]}})[_0xd73a('0x15')](function(){return _0x200ad6;})['catch'](function(_0x3f9fbe){logger[_0xd73a('0x1c')](_0x3f9fbe);});})[_0xd73a('0x15')](respondWithStatusCode(_0x3c7fec,0xc8))['catch'](handleError(_0x3c7fec,null));};exports[_0xd73a('0x96')]=function(_0x459cf1,_0x51d306){return db[_0xd73a('0x61')][_0xd73a('0x4b')]({'where':{'id':_0x459cf1[_0xd73a('0x3f')]['id']}})[_0xd73a('0x15')](handleEntityNotFound(_0x51d306,null))['then'](function(_0x3f8497){if(_0x3f8497){return _0x3f8497[_0xd73a('0x96')](_0x459cf1[_0xd73a('0x30')]['ids'],_['omit'](_0x459cf1['body'],[_0xd73a('0x97'),'id'])||{});}})[_0xd73a('0x15')](respondWithResult(_0x51d306,null))[_0xd73a('0x20')](handleError(_0x51d306,null));};exports[_0xd73a('0x98')]=function(_0x58c8a5,_0x5cd2a3){var _0x20fb27={'raw':![],'where':{}};var _0x5c3a34={};var _0x52aae2={'count':0x0,'rows':[]};return db[_0xd73a('0x36')][_0xd73a('0x4f')]({'where':{'id':_0x58c8a5[_0xd73a('0x3f')]['id']}})[_0xd73a('0x15')](handleEntityNotFound(_0x5cd2a3,null))[_0xd73a('0x15')](function(_0x5c87d7){if(_0x5c87d7){_0x5c3a34[_0xd73a('0x40')]=_['keys'](db[_0xd73a('0x61')]['rawAttributes']);_0x5c3a34[_0xd73a('0x42')]=_[_0xd73a('0x43')](_0x58c8a5[_0xd73a('0x42')]);_0x5c3a34[_0xd73a('0x99')]=_[_0xd73a('0x44')](_0x5c3a34[_0xd73a('0x40')],_0x5c3a34['query']);_0x20fb27['attributes']=_[_0xd73a('0x44')](_0x5c3a34[_0xd73a('0x40')],qs['fields'](_0x58c8a5['query'][_0xd73a('0x46')]));_0x20fb27['attributes']=_0x20fb27[_0xd73a('0x45')][_0xd73a('0x47')]?_0x20fb27[_0xd73a('0x45')]:_0x5c3a34[_0xd73a('0x40')];if(!_0x58c8a5[_0xd73a('0x42')][_0xd73a('0x9a')]('nolimit')){_0x20fb27[_0xd73a('0x26')]=qs[_0xd73a('0x26')](_0x58c8a5[_0xd73a('0x42')][_0xd73a('0x26')]);_0x20fb27[_0xd73a('0x24')]=qs[_0xd73a('0x24')](_0x58c8a5[_0xd73a('0x42')][_0xd73a('0x24')]);}_0x20fb27[_0xd73a('0x9b')]=qs[_0xd73a('0x9c')](_0x58c8a5['query']['sort']);_0x20fb27[_0xd73a('0x9d')]=qs['filters'](_[_0xd73a('0x9e')](_0x58c8a5['query'],_0x5c3a34['filters']));_0x20fb27[_0xd73a('0x9d')]['ChatInteractionId']=_0x5c87d7['id'];if(_0x58c8a5[_0xd73a('0x42')][_0xd73a('0x9f')]){_0x20fb27[_0xd73a('0x9d')]=_['merge'](_0x20fb27[_0xd73a('0x9d')],{'$or':_[_0xd73a('0xa0')](_0x20fb27[_0xd73a('0x45')],function(_0x121339){var _0x51f573={};_0x51f573[_0x121339]={'$like':'%'+_0x58c8a5[_0xd73a('0x42')][_0xd73a('0x9f')]+'%'};return _0x51f573;})});}if(_0x58c8a5[_0xd73a('0x42')][_0xd73a('0xa1')]){var _0x582e6e=_0x58c8a5[_0xd73a('0x42')][_0xd73a('0xa1')][_0xd73a('0xa2')](',');var _0x286bd2={};_0x286bd2[_0x582e6e[0x0]]={'$gte':moment(_0x582e6e[0x1])[_0xd73a('0x79')]('YYYY-MM-DD\x20HH:mm:ss')};_0x20fb27[_0xd73a('0x9d')]=_[_0xd73a('0x2f')](_0x20fb27[_0xd73a('0x9d')],_0x286bd2);}_0x20fb27=_['merge']({},_0x20fb27,_0x58c8a5[_0xd73a('0x4a')]);return db[_0xd73a('0x61')][_0xd73a('0x27')]({'where':_0x20fb27[_0xd73a('0x9d')]})[_0xd73a('0x15')](function(_0x47c5fc){_0x52aae2[_0xd73a('0x27')]=_0x47c5fc;if(_0x58c8a5[_0xd73a('0x42')][_0xd73a('0x48')]){_0x20fb27[_0xd73a('0x49')]=[{'all':!![]}];}return db[_0xd73a('0x61')][_0xd73a('0x3b')](_0x20fb27);})['then'](function(_0x43e3a7){_0x52aae2['rows']=_0x43e3a7;return _0x52aae2;});}})[_0xd73a('0x15')](respondWithFilteredResult(_0x5cd2a3,_0x20fb27))['catch'](handleError(_0x5cd2a3,null));};exports['getMyMessages']=function(_0x1c0b90,_0x1c8dc8){var _0x34b6da={'where':{}},_0x20550d={},_0x2472a7={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xd73a('0x4f')]({'where':{'id':_0x1c0b90[_0xd73a('0x3f')]['id']}})[_0xd73a('0x15')](handleEntityNotFound(_0x1c8dc8,null))['then'](function(_0x3ba533){if(_0x3ba533){_0x20550d[_0xd73a('0x40')]=_[_0xd73a('0x43')](db[_0xd73a('0x61')][_0xd73a('0x41')]);_0x20550d[_0xd73a('0x42')]=_[_0xd73a('0x43')](_0x1c0b90['query']);_0x20550d['filters']=_['intersection'](_0x20550d[_0xd73a('0x40')],_0x20550d[_0xd73a('0x42')]);_0x34b6da['attributes']=_[_0xd73a('0x44')](_0x20550d[_0xd73a('0x40')],qs[_0xd73a('0x46')](_0x1c0b90[_0xd73a('0x42')]['fields']));_0x34b6da[_0xd73a('0x45')]=_0x34b6da[_0xd73a('0x45')][_0xd73a('0x47')]?_0x34b6da['attributes']:_0x20550d[_0xd73a('0x40')];if(!_0x1c0b90[_0xd73a('0x42')][_0xd73a('0x9a')]('nolimit')){_0x34b6da[_0xd73a('0x26')]=qs['limit'](_0x1c0b90[_0xd73a('0x42')][_0xd73a('0x26')]);_0x34b6da[_0xd73a('0x24')]=qs[_0xd73a('0x24')](_0x1c0b90[_0xd73a('0x42')][_0xd73a('0x24')]);}_0x34b6da[_0xd73a('0x9b')]=qs[_0xd73a('0x9c')](_0x1c0b90[_0xd73a('0x42')][_0xd73a('0x9c')]);_0x34b6da['where']=qs[_0xd73a('0x99')](_['pick'](_0x1c0b90['query'],_0x20550d['filters']));_0x34b6da[_0xd73a('0x9d')][_0xd73a('0xa3')]=_0x3ba533['id'];if(_0x1c0b90['query'][_0xd73a('0x9f')]){_0x34b6da['where']=_['merge'](_0x34b6da['where'],{'$or':_['map'](_0x34b6da[_0xd73a('0x45')],function(_0x3897b7){var _0x2d2706={};_0x2d2706[_0x3897b7]={'$like':'%'+_0x1c0b90[_0xd73a('0x42')]['filter']+'%'};return _0x2d2706;})});}_0x34b6da['where']['secret']=![];if(_0x1c0b90[_0xd73a('0x42')]['id']){_0x34b6da['where']['id']={'$gt':_0x1c0b90[_0xd73a('0x42')]['id']};}_0x34b6da=_['merge']({},_0x34b6da,_0x1c0b90['options']);return db[_0xd73a('0x61')][_0xd73a('0x27')]({'where':_0x34b6da[_0xd73a('0x9d')]})[_0xd73a('0x15')](function(_0x2960b3){_0x2472a7[_0xd73a('0x27')]=_0x2960b3;_0x34b6da['include']=[];if(_0x1c0b90[_0xd73a('0x42')]['includeAgent']){_0x34b6da['include'][_0xd73a('0xa4')]({'model':db[_0xd73a('0x7d')],'as':_0xd73a('0x7d'),'attributes':['id',_0xd73a('0x57'),_0xd73a('0x87')]});}if(_0x1c0b90[_0xd73a('0x42')]['includeAll']){_0x34b6da[_0xd73a('0x49')]=[{'all':!![]}];}return db[_0xd73a('0x61')]['findAll'](_0x34b6da);})[_0xd73a('0x15')](function(_0x2a836b){_0x2472a7[_0xd73a('0xa5')]=_0x2a836b;return _0x2472a7;});}})[_0xd73a('0x15')](respondWithFilteredResult(_0x1c8dc8,_0x34b6da))[_0xd73a('0x20')](handleError(_0x1c8dc8,null));};exports['addTags']=function(_0x154642,_0x9a04bf){return db[_0xd73a('0x36')]['find']({'where':{'id':_0x154642[_0xd73a('0x3f')]['id']}})[_0xd73a('0x15')](handleEntityNotFound(_0x9a04bf,null))['then'](function(_0x187a9a){if(_0x187a9a){return _0x187a9a['setTags'](_0x154642[_0xd73a('0x30')]['ids'],_[_0xd73a('0xa6')](_0x154642[_0xd73a('0x30')],[_0xd73a('0x97'),'id'])||{})[_0xd73a('0xa7')](function(){return db[_0xd73a('0xa8')][_0xd73a('0x3b')]({'attributes':['id',_0xd73a('0x2e'),_0xd73a('0xa9')],'where':{'id':_0x154642[_0xd73a('0x30')]['ids']}});})[_0xd73a('0x15')](function(_0x1e1a92){socket[_0xd73a('0xaa')](_0xd73a('0xab'),{'id':Number(_0x154642[_0xd73a('0x3f')]['id']),'tags':_0x1e1a92||[]});return{'id':Number(_0x154642['params']['id']),'tags':_0x1e1a92||[]};});}})[_0xd73a('0x15')](respondWithResult(_0x9a04bf,null))[_0xd73a('0x20')](handleError(_0x9a04bf,null));};exports[_0xd73a('0xac')]=function(_0x54a3cf,_0x50e40d){return db['ChatInteraction']['find']({'where':{'id':_0x54a3cf[_0xd73a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x50e40d,null))[_0xd73a('0x15')](function(_0x231819){if(_0x231819){return _0x231819['removeTags'](_0x54a3cf[_0xd73a('0x42')][_0xd73a('0x97')]);}})['then'](respondWithStatusCode(_0x50e40d,null))[_0xd73a('0x20')](handleError(_0x50e40d,null));};exports[_0xd73a('0x76')]=function(_0x28f376,_0x8eaccc){var _0x597a55=moment()[_0xd73a('0xad')]()[_0xd73a('0xae')]();var _0x193117=path[_0xd73a('0x74')](config['root'],_0xd73a('0xaf'),'files','tmp');var _0x5123f9=path[_0xd73a('0x74')](config['root'],'server',_0xd73a('0xb0'),_0xd73a('0xb1'));var _0xb69059=path[_0xd73a('0x74')](_0x193117,_0x597a55);var _0xb1a0e6=util[_0xd73a('0x79')]('transcript-%d-%s.zip',_0x28f376[_0xd73a('0x3f')]['id'],_0x597a55);var _0x1e6203=path[_0xd73a('0x74')](_0x193117,_0xb1a0e6);var _0x233289=[];_0x233289[_0xd73a('0xa4')]({'model':db[_0xd73a('0x7d')],'as':_0xd73a('0x7d'),'attributes':['id',_0xd73a('0x57')],'raw':!![]});_0x233289[_0xd73a('0xa4')]({'model':db[_0xd73a('0x7e')],'as':_0xd73a('0x64'),'attributes':['id',_0xd73a('0xb2'),_0xd73a('0xb3')],'raw':!![]});if(_0x28f376[_0xd73a('0x42')]['attachments']){_0x233289[_0xd73a('0xa4')]({'model':db[_0xd73a('0x71')],'as':_0xd73a('0x71'),'raw':!![]});}var _0x15dd6f=[{'model':db['ChatMessage'],'as':_0xd73a('0x7f'),'attributes':['id',_0xd73a('0x30'),_0xd73a('0x89'),_0xd73a('0xb4'),_0xd73a('0x8b'),'read'],'include':_0x233289}];_0x15dd6f[_0xd73a('0xa4')]({'model':db[_0xd73a('0x50')],'as':_0xd73a('0xb5'),'attributes':['id',_0xd73a('0x2e')]});_0x15dd6f['push']({'model':db[_0xd73a('0x7d')],'as':_0xd73a('0xb6'),'attributes':['id','fullname']});return db[_0xd73a('0x36')][_0xd73a('0x4b')]({'where':{'id':_0x28f376[_0xd73a('0x3f')]['id']},'include':_0x15dd6f})[_0xd73a('0x15')](handleEntityNotFound(_0x8eaccc,null))[_0xd73a('0x15')](function(_0xaa7c9e){if(_0xaa7c9e){var _0x3b2bfd=_0xaa7c9e[_0xd73a('0xb7')]({'plain':!![]});fs[_0xd73a('0xb8')](_0xb69059);var _0x4f4160={'channel':_0xd73a('0xb9'),'account':_0x3b2bfd['Account']['name'],'agent':_0x3b2bfd['Owner']?_0x3b2bfd['Owner']['fullname']:_0xd73a('0xba'),'createdAt':moment(_0x3b2bfd['createdAt'])['format'](_0xd73a('0xbb'))['toString'](),'closedAt':_0x3b2bfd[_0xd73a('0x68')]?moment(_0x3b2bfd['closedAt'])['format'](_0xd73a('0xbb'))[_0xd73a('0xae')]():'','disposition':_0x3b2bfd[_0xd73a('0x69')],'chatInfo':{'browser':_0x3b2bfd['browserName'],'os':_0x3b2bfd[_0xd73a('0xbc')],'referer':_0x3b2bfd['referer'],'customerIp':_0x3b2bfd[_0xd73a('0xbd')],'customerPort':_0x3b2bfd[_0xd73a('0xbe')]?_0x3b2bfd[_0xd73a('0xbe')]:_0xd73a('0xba')},'messages':_(_0x3b2bfd[_0xd73a('0x7f')])['tail']()[_0xd73a('0x9f')]({'secret':![]})[_0xd73a('0xa0')](function(_0x122c5a){if(_0x122c5a[_0xd73a('0x71')]){var _0xfbd6d6=path[_0xd73a('0x74')](_0x5123f9,_0x122c5a[_0xd73a('0x71')][_0xd73a('0x75')]);if(fs[_0xd73a('0xbf')](_0xfbd6d6)){fs[_0xd73a('0xc0')](_0xfbd6d6)[_0xd73a('0xc1')](fs[_0xd73a('0xc2')](path[_0xd73a('0x74')](_0xb69059,_0x122c5a[_0xd73a('0x71')][_0xd73a('0x75')])));}}return{'date':moment(_0x122c5a[_0xd73a('0x89')])[_0xd73a('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd73a('0xae')](),'sender':_0x122c5a[_0xd73a('0xb4')]===_0xd73a('0x60')?_0x122c5a[_0xd73a('0x7d')]?_0x122c5a['User'][_0xd73a('0x57')]:'System':_0x122c5a[_0xd73a('0x64')][_0xd73a('0xb2')]+(_0x122c5a[_0xd73a('0x64')]['lastName']?'\x20'+_0x122c5a[_0xd73a('0x64')][_0xd73a('0xb3')]:''),'body':_0x122c5a[_0xd73a('0x71')]?_0x122c5a[_0xd73a('0x71')][_0xd73a('0x75')]:_0x122c5a[_0xd73a('0x30')],'direction':_0x122c5a[_0xd73a('0xb4')]===_0xd73a('0x60')?'A':'C','secret':_0x122c5a[_0xd73a('0x8b')],'read':_0x122c5a['read'],'attachment':_0x122c5a[_0xd73a('0x71')]};})[_0xd73a('0xc3')]()};return ejs[_0xd73a('0xc4')](path['join'](config['root'],_0xd73a('0xaf'),'views','downloadInteraction.ejs'),{'interaction':_0x4f4160})[_0xd73a('0x15')](function(_0x4e3375){var _0x1acf4e=path['join'](_0xb69059,_0xd73a('0xc5')+_0x3b2bfd['id']+'-'+_0x597a55+_0xd73a('0xc6'));var _0x373f90={'path':_0x1acf4e,'channel':_0xd73a('0xb9'),'interactionId':_0x3b2bfd['id']};return pdf[_0xd73a('0xc7')](_0x4e3375,_0x373f90);})[_0xd73a('0x15')](function(){return new Promise(function(_0x250654,_0x10d47d){zipdir(_0xb69059,{'saveTo':_0x1e6203},function(_0x384337,_0x468edc){if(_0x384337)return _0x10d47d(_0x384337);return _0x250654(_0x468edc);});})['then'](function(){return new BPromise(function(_0x5714e7,_0xa56fea){rimraf(_0xb69059,function(_0x13e12d){if(_0x13e12d)_0xa56fea(_0x13e12d);return _0x5714e7();});});})[_0xd73a('0x15')](function(){return _0x8eaccc['download'](_0x1e6203,_0xb1a0e6,function(_0x58b22c){if(_0x58b22c){logger[_0xd73a('0x1c')](_0xd73a('0xc8'),_0x58b22c);}else{fs[_0xd73a('0xc9')](_0x1e6203);}});});});}else{return _0x8eaccc['sendStatus'](0xc8);}})[_0xd73a('0x20')](handleError(_0x8eaccc,null));};
\ No newline at end of file
+var _0xa06f=['customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','pathTranscript','User','ChatWebsite','ChatWebsiteId','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','options','includeAgent','push','alias','rows','spread','Tag','color','emit','chatInteractionTags:save','toString','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','attachments','direction','Account','Owner','get','closedAt','browserName','osName','referer','customerIp','customerPort','N.A.','Messages','basename','pipe','out','value','renderFile','views','transcript-','.pdf','Chat','createPdfFromHTML','err','request-promise','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','stack','name','send','render','merge','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','chat','user','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','find','create','body','destroy','describe','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes'];(function(_0x4c16c4,_0x1f4fb2){var _0x2d2ddf=function(_0xfa51f8){while(--_0xfa51f8){_0x4c16c4['push'](_0x4c16c4['shift']());}};_0x2d2ddf(++_0x1f4fb2);}(_0xa06f,0x73));var _0xfa06=function(_0x52fa9a,_0x2026f9){_0x52fa9a=_0x52fa9a-0x0;var _0xa5ee31=_0xa06f[_0x52fa9a];return _0xa5ee31;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0xfa06('0x0'));var moment=require('moment');var BPromise=require(_0xfa06('0x1'));var Mustache=require(_0xfa06('0x2'));var util=require(_0xfa06('0x3'));var path=require(_0xfa06('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfa06('0x5'));var Redis=require(_0xfa06('0x6'));var interaction=require(_0xfa06('0x7'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xfa06('0x8'))('api');var config=require(_0xfa06('0x9'));var db=require(_0xfa06('0xa'))['db'];config[_0xfa06('0xb')]=_[_0xfa06('0xc')](config[_0xfa06('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa06('0xd'))(new Redis(config['redis']));require(_0xfa06('0xe'))['register'](socket);var jayson=require(_0xfa06('0xf'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0xfa06('0x10')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3c9f78,_0x1b10d5,_0x5a048a,_0x2880ef){return new BPromise(function(_0x79d15a,_0x5dcba1){var _0x57e5e0=_0x2880ef||client;return _0x57e5e0['request'](_0x3c9f78,_0x5a048a)[_0xfa06('0x11')](function(_0x6464cd){logger[_0xfa06('0x12')](_0xfa06('0x13'),_0x1b10d5,_0xfa06('0x14'));logger[_0xfa06('0x15')](_0xfa06('0x16'),_0x1b10d5,_0xfa06('0x14'),JSON[_0xfa06('0x17')](_0x6464cd));if(_0x6464cd[_0xfa06('0x18')]){if(_0x6464cd[_0xfa06('0x18')]['code']===0x1f4){logger[_0xfa06('0x18')](_0xfa06('0x13'),_0x1b10d5,_0x6464cd[_0xfa06('0x18')][_0xfa06('0x19')]);return _0x5dcba1(_0x6464cd[_0xfa06('0x18')][_0xfa06('0x19')]);}logger[_0xfa06('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1b10d5,_0x6464cd[_0xfa06('0x18')]['message']);return _0x79d15a(_0x6464cd[_0xfa06('0x18')]['message']);}else{logger[_0xfa06('0x12')](_0xfa06('0x13'),_0x1b10d5,_0xfa06('0x14'));_0x79d15a(_0x6464cd['result'][_0xfa06('0x19')]);}})[_0xfa06('0x1a')](function(_0x2be302){logger[_0xfa06('0x18')](_0xfa06('0x13'),_0x1b10d5,_0x2be302);_0x5dcba1(_0x2be302);});});}function respondWithStatusCode(_0x378406,_0x1cb7d7){_0x1cb7d7=_0x1cb7d7||0xcc;return function(_0x93f3c9){if(_0x93f3c9){return _0x378406[_0xfa06('0x1b')](_0x1cb7d7);}return _0x378406['status'](_0x1cb7d7)[_0xfa06('0x1c')]();};}function respondWithResult(_0x3515ea,_0x40288f){_0x40288f=_0x40288f||0xc8;return function(_0x4e818f){if(_0x4e818f){return _0x3515ea[_0xfa06('0x1d')](_0x40288f)[_0xfa06('0x1e')](_0x4e818f);}};}function respondWithFilteredResult(_0x548146,_0x131d19){return function(_0x5ab739){if(_0x5ab739){var _0x1b2e81=typeof _0x131d19[_0xfa06('0x1f')]===_0xfa06('0x20')&&typeof _0x131d19['limit']===_0xfa06('0x20');var _0x43e303=_0x5ab739[_0xfa06('0x21')];var _0x330dd8=_0x1b2e81?0x0:_0x131d19[_0xfa06('0x1f')];var _0x2ba30e=_0x1b2e81?_0x5ab739['count']:_0x131d19[_0xfa06('0x1f')]+_0x131d19['limit'];var _0x123134;if(_0x2ba30e>=_0x43e303){_0x2ba30e=_0x43e303;_0x123134=0xc8;}else{_0x123134=0xce;}_0x548146[_0xfa06('0x1d')](_0x123134);return _0x548146[_0xfa06('0x22')](_0xfa06('0x23'),_0x330dd8+'-'+_0x2ba30e+'/'+_0x43e303)['json'](_0x5ab739);}return null;};}function saveUpdates(_0x2873c5){return function(_0x3140c8){if(_0x3140c8){return _0x3140c8['update'](_0x2873c5)[_0xfa06('0x11')](function(_0x2870f9){return _0x2870f9;});}return null;};}function removeEntity(_0x23c433){return function(_0x12c98c){if(_0x12c98c){return _0x12c98c['destroy']()[_0xfa06('0x11')](function(){_0x23c433[_0xfa06('0x1d')](0xcc)[_0xfa06('0x1c')]();});}};}function handleEntityNotFound(_0x5ee9f6){return function(_0x18be50){if(!_0x18be50){_0x5ee9f6[_0xfa06('0x1b')](0x194);}return _0x18be50;};}function handleError(_0x433fe1,_0x2ae2c2){_0x2ae2c2=_0x2ae2c2||0x1f4;return function(_0x1f7586){logger[_0xfa06('0x18')](_0x1f7586[_0xfa06('0x24')]);if(_0x1f7586[_0xfa06('0x25')]){delete _0x1f7586[_0xfa06('0x25')];}_0x433fe1[_0xfa06('0x1d')](_0x2ae2c2)[_0xfa06('0x26')](_0x1f7586);};}function getMustacheRender(_0x4e5688,_0x514836){return Mustache[_0xfa06('0x27')](_0x4e5688,_[_0xfa06('0x28')](_0x514836['body'],{'contact':_0x514836[_0xfa06('0x29')],'message':_0x514836[_0xfa06('0x19')],'agent':_0x514836[_0xfa06('0x2a')],'interaction':_0x514836[_0xfa06('0x2b')],'account':_0x514836['account']}))||'';}exports[_0xfa06('0x2c')]=function(_0x50699c,_0x4856ad){var _0x8b2f70={};var _0x32cbf1=_[_0xfa06('0x2d')](db[_0xfa06('0x2e')][_0xfa06('0x2f')],function(_0x10f42c){return{'name':_0x10f42c[_0xfa06('0x30')],'type':_0x10f42c[_0xfa06('0x31')][_0xfa06('0x32')]};});_0x8b2f70=qs[_0xfa06('0x33')](_0x32cbf1,_0x50699c);return interaction['findAll'](_0xfa06('0x34'),_0x50699c['query'],_0x50699c[_0xfa06('0x35')],_0x8b2f70,_0x32cbf1)[_0xfa06('0x11')](respondWithFilteredResult(_0x4856ad,_0x8b2f70))['catch'](handleError(_0x4856ad,null));};exports[_0xfa06('0x36')]=function(_0x5ccb85,_0x3333ba){var _0x4d9679={'raw':![],'where':{'id':_0x5ccb85[_0xfa06('0x37')]['id']}},_0x226991={};_0x226991[_0xfa06('0x38')]=_[_0xfa06('0x39')](db[_0xfa06('0x2e')]['rawAttributes']);_0x226991['query']=_[_0xfa06('0x39')](_0x5ccb85[_0xfa06('0x3a')]);_0x226991['filters']=_[_0xfa06('0x3b')](_0x226991[_0xfa06('0x38')],_0x226991['query']);_0x4d9679[_0xfa06('0x3c')]=_[_0xfa06('0x3b')](_0x226991[_0xfa06('0x38')],qs['fields'](_0x5ccb85[_0xfa06('0x3a')][_0xfa06('0x3d')]));_0x4d9679[_0xfa06('0x3c')]=_0x4d9679[_0xfa06('0x3c')][_0xfa06('0x3e')]?_0x4d9679[_0xfa06('0x3c')]:_0x226991[_0xfa06('0x38')];if(_0x5ccb85[_0xfa06('0x3a')][_0xfa06('0x3f')]){_0x4d9679['include']=[{'all':!![]}];}_0x4d9679=_[_0xfa06('0x28')]({},_0x4d9679,_0x5ccb85['options']);return db[_0xfa06('0x2e')][_0xfa06('0x40')](_0x4d9679)['then'](handleEntityNotFound(_0x3333ba,null))[_0xfa06('0x11')](respondWithResult(_0x3333ba,null))['catch'](handleError(_0x3333ba,null));};exports['create']=function(_0x3a746d,_0x212bab){return db[_0xfa06('0x2e')][_0xfa06('0x41')](_0x3a746d[_0xfa06('0x42')],{})[_0xfa06('0x11')](respondWithResult(_0x212bab,0xc9))[_0xfa06('0x1a')](handleError(_0x212bab,null));};exports['update']=function(_0x4db1e8,_0x390281){if(_0x4db1e8['body']['id']){delete _0x4db1e8['body']['id'];}return db[_0xfa06('0x2e')][_0xfa06('0x40')]({'where':{'id':_0x4db1e8[_0xfa06('0x37')]['id']}})['then'](handleEntityNotFound(_0x390281,null))[_0xfa06('0x11')](saveUpdates(_0x4db1e8[_0xfa06('0x42')],null))[_0xfa06('0x11')](respondWithResult(_0x390281,null))[_0xfa06('0x1a')](handleError(_0x390281,null));};exports[_0xfa06('0x43')]=function(_0xeb89d1,_0x1c9223){return db[_0xfa06('0x2e')][_0xfa06('0x40')]({'where':{'id':_0xeb89d1[_0xfa06('0x37')]['id']}})[_0xfa06('0x11')](handleEntityNotFound(_0x1c9223,null))['then'](removeEntity(_0x1c9223,null))['catch'](handleError(_0x1c9223,null));};exports['describe']=function(_0x23d165,_0x217724){return db[_0xfa06('0x2e')][_0xfa06('0x44')]()[_0xfa06('0x11')](respondWithResult(_0x217724,null))[_0xfa06('0x1a')](handleError(_0x217724,null));};exports['createVidaooSession']=function(_0x80b2e0,_0x2c2189){var _0x40b78a=_0x80b2e0[_0xfa06('0x37')]['id'];var _0x1b4bb1;var _0x3ec7f8;var _0xc6c530;return db[_0xfa06('0x2e')][_0xfa06('0x45')]({'where':{'id':_0x40b78a}})[_0xfa06('0x11')](function(_0x2811f3){_0x1b4bb1=_0x2811f3;return db['ChatWebsite']['findOne']({'where':{'id':_0x2811f3['ChatWebsiteId']},'attributes':['id',_0xfa06('0x46'),_0xfa06('0x47'),_0xfa06('0x48'),_0xfa06('0x49'),_0xfa06('0x4a')],'raw':!![]});})[_0xfa06('0x11')](function(_0x1ad57c){if(_0x1ad57c&&_0x1ad57c[_0xfa06('0x46')]&&_0x1ad57c[_0xfa06('0x47')]){_0x3ec7f8=_0x1ad57c;var _0x71041f={'interaction':{'id':_0x40b78a},'agent':{'id':_0x80b2e0[_0xfa06('0x35')]['id'],'name':_0x80b2e0[_0xfa06('0x35')]['name'],'fullname':_0x80b2e0[_0xfa06('0x35')][_0xfa06('0x4b')],'email':_0x80b2e0[_0xfa06('0x35')][_0xfa06('0x4c')]},'contact':_0x80b2e0['body']['contact'],'account':_0x80b2e0['body']['account']};var _0x546b9c={'rejectUnauthorized':![],'method':_0xfa06('0x4d'),'url':_0xfa06('0x4e'),'headers':{'X-APIKEY':_0x1ad57c[_0xfa06('0x46')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x80b2e0[_0xfa06('0x35')][_0xfa06('0x4c')]],'buttons':null,'topic':_0x3ec7f8[_0xfa06('0x48')],'note':_[_0xfa06('0x4f')](_0x3ec7f8[_0xfa06('0x49')])?null:getMustacheRender(_0x3ec7f8[_0xfa06('0x49')],_0x71041f),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xfa06('0x4f')](_0x3ec7f8[_0xfa06('0x4a')])){var _0x240d76=getMustacheRender(_0x3ec7f8['vidaooMetadata'],_0x71041f);var _0x5c62f7=JSON[_0xfa06('0x50')](_0x240d76);_0x546b9c[_0xfa06('0x42')][_0xfa06('0x51')]=_0x5c62f7;}}catch(_0x41ff8a){throw new db['Sequelize'][(_0xfa06('0x52'))](_0xfa06('0x53'));}return rp(_0x546b9c);}else{throw new db[(_0xfa06('0x54'))][(_0xfa06('0x52'))](_0xfa06('0x55'));}})[_0xfa06('0x11')](function(_0x5469a3){_0xc6c530=_0x5469a3;if(_0xc6c530['id']){var _0x421c2e={'body':_0xc6c530[_0xfa06('0x56')],'ChatWebsiteId':_0x3ec7f8['id'],'ChatInteractionId':_0x1b4bb1['id'],'direction':'out','UserId':_0x80b2e0[_0xfa06('0x35')]['id']};return db[_0xfa06('0x57')][_0xfa06('0x41')](_0x421c2e,{});}else{throw new db[(_0xfa06('0x54'))][(_0xfa06('0x52'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x1b4bb1[_0xfa06('0x58')]({'vidaooSessionId':_0xc6c530['id']});})[_0xfa06('0x11')](respondWithResult(_0x2c2189,null))[_0xfa06('0x1a')](handleError(_0x2c2189,null));};exports[_0xfa06('0x59')]=function(_0x44c74a,_0x230d23){if(_0x44c74a[_0xfa06('0x42')]['id']){delete _0x44c74a['body']['id'];}return db[_0xfa06('0x2e')][_0xfa06('0x40')]({'where':{'id':_0x44c74a['params']['id']},'include':[{'model':db['CmContact'],'as':_0xfa06('0x5a')}]})[_0xfa06('0x11')](handleEntityNotFound(_0x230d23,null))[_0xfa06('0x11')](saveUpdates(_0x44c74a['body'],null))[_0xfa06('0x11')](respondWithResult(_0x230d23,null))[_0xfa06('0x1a')](handleError(_0x230d23,null));};exports['abandon']=function(_0x3a30bf,_0xef924c){if(_0x3a30bf[_0xfa06('0x42')]['id']){delete _0x3a30bf[_0xfa06('0x42')]['id'];}return db[_0xfa06('0x2e')][_0xfa06('0x40')]({'where':{'id':_0x3a30bf[_0xfa06('0x37')]['id']}})['then'](function(_0x5263f2){if(!_0x5263f2){logger[_0xfa06('0x18')](_0xfa06('0x5b'),_0xfa06('0x5c'),0x194,'entity\x20not\x20found');_0xef924c[_0xfa06('0x1b')](0x194);}else{if(_0x5263f2[_0xfa06('0x5d')]){throw new db[(_0xfa06('0x54'))][(_0xfa06('0x52'))](_0xfa06('0x5e'));}}return _0x5263f2;})[_0xfa06('0x11')](function(_0x2872f9){if(_0x2872f9){return _0x2872f9[_0xfa06('0x5f')]({'closed':_0x3a30bf[_0xfa06('0x42')][_0xfa06('0x60')],'disposition':_0x3a30bf[_0xfa06('0x42')][_0xfa06('0x61')]})['then'](function(_0x954e17){return _0x954e17;});}})['then'](function(){return respondWithRpcPromise(_0xfa06('0x62'),'abandon',_0x3a30bf[_0xfa06('0x42')],client9004);})[_0xfa06('0x11')](respondWithResult(_0xef924c,null))[_0xfa06('0x1a')](handleError(_0xef924c,null));};exports[_0xfa06('0x63')]=function(_0x2f2023,_0x509e4f){_0x2f2023['body'][_0xfa06('0x25')]=_0x2f2023[_0xfa06('0x64')]['originalname'];_0x2f2023[_0xfa06('0x42')]['basename']=_0x2f2023[_0xfa06('0x64')][_0xfa06('0x65')];_0x2f2023[_0xfa06('0x42')][_0xfa06('0x31')]=_0x2f2023[_0xfa06('0x64')][_0xfa06('0x66')];return db[_0xfa06('0x67')][_0xfa06('0x41')](_0x2f2023[_0xfa06('0x42')])[_0xfa06('0x11')](respondWithResult(_0x509e4f,0xc9))['catch'](handleError(_0x509e4f,null));};exports[_0xfa06('0x68')]=function(_0x48d3b5,_0x45eaa5){return db[_0xfa06('0x2e')][_0xfa06('0x45')]({'where':{'id':_0x48d3b5['params']['id']},'raw':!![]})[_0xfa06('0x11')](handleEntityNotFound(_0x45eaa5,null))[_0xfa06('0x11')](function(_0x3bf5c6){if(_0x3bf5c6){if(_0x3bf5c6[_0xfa06('0x60')]){return _0x45eaa5[_0xfa06('0x1d')](0x193)['json']({'status':0x193,'message':_0xfa06('0x69')});}return db[_0xfa06('0x67')][_0xfa06('0x45')]({'where':{'id':_0x48d3b5[_0xfa06('0x3a')][_0xfa06('0x6a')]},'raw':!![]})['then'](handleEntityNotFound(_0x45eaa5,null));}})[_0xfa06('0x11')](function(_0x21a920){if(_0x21a920){var _0x593315=_0x21a920[_0xfa06('0x6b')]!==null;var _0x55efc2=path['join'](config[_0xfa06('0x6c')],'server/files/attachments/');if(_0x593315){_0x55efc2=path[_0xfa06('0x6d')](_0x55efc2,_0xfa06('0x6e'));}var _0x68410=path[_0xfa06('0x6d')](_0x55efc2,_0x21a920['basename']);return _0x45eaa5[_0xfa06('0x6f')](_0x68410);}})['catch'](handleError(_0x45eaa5,null));};exports['close']=function(_0x2f2f90,_0x5bedeb){var _0x43d972=null;var _0x18b594=null;var _0x507a31=null;if(_0x2f2f90['body']['id']){delete _0x2f2f90[_0xfa06('0x42')]['id'];}if(_0x2f2f90[_0xfa06('0x42')][_0xfa06('0x70')]){_0x507a31=path[_0xfa06('0x6d')](config['root'],_0xfa06('0x71'),util[_0xfa06('0x72')]('transcript-%s.txt',Date['now']()));_0x2f2f90[_0xfa06('0x42')][_0xfa06('0x73')]=_0x507a31;}return db['ChatInteraction']['find']({'where':{'id':_0x2f2f90[_0xfa06('0x37')]['id']},'include':[{'model':db[_0xfa06('0x57')],'as':'Messages','include':[{'model':db[_0xfa06('0x74')],'as':_0xfa06('0x74')}]}]})[_0xfa06('0x11')](handleEntityNotFound(_0x5bedeb,null))[_0xfa06('0x11')](saveUpdates(_0x2f2f90['body'],null))[_0xfa06('0x11')](function(_0x444995){if(_0x444995){_0x43d972=_0x444995;return db[_0xfa06('0x75')]['find']({'where':{'id':_0x43d972[_0xfa06('0x76')]}});}})[_0xfa06('0x11')](function(_0x5174ce){if(_0x5174ce){_0x18b594=_0x5174ce;return db[_0xfa06('0x77')]['find']({'where':{'id':_0x43d972[_0xfa06('0x78')]}});}})[_0xfa06('0x11')](function(_0x90eea1){if(_0x90eea1){if(_0x507a31){var _0xbeb00a=null;for(var _0x2bc10d=0x1;_0x2bc10d<_0x43d972['Messages'][_0xfa06('0x3e')];++_0x2bc10d){_0xbeb00a=_0x43d972['Messages'][_0x2bc10d];var _0x41f8e4=_0xbeb00a[_0xfa06('0x5d')]?util['format'](_0xfa06('0x79'),_0x18b594[_0xfa06('0x7a')],_0xbeb00a[_0xfa06('0x5d')]):_0xfa06('0x7b');var _0x2bff57=_0x2f2f90[_0xfa06('0x42')][_0xfa06('0x7c')]||util[_0xfa06('0x72')]('%s%d',_0xfa06('0x7d'),_0xbeb00a[_0xfa06('0x78')]);switch(_0x18b594[_0xfa06('0x7e')]){case _0xfa06('0x7f'):_0x41f8e4=_0xbeb00a[_0xfa06('0x5d')]?util['format']('%s%d',_0x18b594[_0xfa06('0x7a')],_0xbeb00a[_0xfa06('0x5d')]):_0xfa06('0x7b');break;case _0xfa06('0x80'):_0x41f8e4=_0xbeb00a[_0xfa06('0x5d')]?_0xbeb00a['User']['alias']||_0xbeb00a[_0xfa06('0x74')]['fullname']:_0xfa06('0x7b');break;case _0xfa06('0x81'):_0x41f8e4=_0xbeb00a['UserId']?_0xbeb00a['User'][_0xfa06('0x4b')]:'System';break;default:_0x41f8e4=_0xbeb00a[_0xfa06('0x5d')]?util['format'](_0xfa06('0x79'),_0x18b594[_0xfa06('0x7a')],_0xbeb00a[_0xfa06('0x5d')]):'System';}var _0x579ca1=util[_0xfa06('0x72')](_0xfa06('0x82'),moment(_0xbeb00a[_0xfa06('0x83')])[_0xfa06('0x72')](_0xfa06('0x84')),_0xbeb00a['direction']==='in'?_0x2bff57:_0x41f8e4,_0xbeb00a[_0xfa06('0x42')]);if(!_0xbeb00a[_0xfa06('0x85')]){fs['appendFileSync'](_0x507a31,_0x579ca1);}}return db[_0xfa06('0x86')][_0xfa06('0x45')]({'where':{'service':!![]},'include':[{'model':db[_0xfa06('0x87')],'as':_0xfa06('0x88'),'raw':!![],'include':[{'model':db[_0xfa06('0x89')],'as':_0xfa06('0x89'),'raw':!![]}]}]});}}})[_0xfa06('0x11')](function(_0xb02d75){if(!_0xb02d75||!_0xb02d75[_0xfa06('0x88')]||!_0x2f2f90['body'])return _0x43d972;var _0x3add96=_0xb02d75[_0xfa06('0x8a')]();return respondWithRpcPromise(_0xfa06('0x8b'),_0xfa06('0x8c'),{'account':_0x3add96,'message':{'from':util[_0xfa06('0x72')](_0xfa06('0x8d'),_0xb02d75[_0xfa06('0x25')],_0xb02d75['email']||_0xb02d75['Smtp'][_0xfa06('0x35')]),'to':_0x2f2f90[_0xfa06('0x42')]['mailTranscript'],'subject':_0xfa06('0x8e'),'text':util[_0xfa06('0x72')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2f2f90[_0xfa06('0x42')][_0xfa06('0x70')]),'attachments':[{'path':_0x507a31}]}})[_0xfa06('0x11')](function(){return _0x43d972;})[_0xfa06('0x1a')](function(_0x147969){logger[_0xfa06('0x18')](_0x147969);});})[_0xfa06('0x11')](respondWithStatusCode(_0x5bedeb,0xc8))['catch'](handleError(_0x5bedeb,null));};exports[_0xfa06('0x8f')]=function(_0x559f69,_0x5ca78b){return db[_0xfa06('0x57')][_0xfa06('0x40')]({'where':{'id':_0x559f69[_0xfa06('0x37')]['id']}})['then'](handleEntityNotFound(_0x5ca78b,null))[_0xfa06('0x11')](function(_0x6910c6){if(_0x6910c6){return _0x6910c6[_0xfa06('0x8f')](_0x559f69[_0xfa06('0x42')][_0xfa06('0x90')],_[_0xfa06('0x91')](_0x559f69[_0xfa06('0x42')],[_0xfa06('0x90'),'id'])||{});}})[_0xfa06('0x11')](respondWithResult(_0x5ca78b,null))[_0xfa06('0x1a')](handleError(_0x5ca78b,null));};exports[_0xfa06('0x92')]=function(_0x21ec61,_0x36aa41){var _0xe0ade6={'raw':![],'where':{}};var _0x12df69={};var _0x2e6683={'count':0x0,'rows':[]};return db[_0xfa06('0x2e')][_0xfa06('0x45')]({'where':{'id':_0x21ec61[_0xfa06('0x37')]['id']}})[_0xfa06('0x11')](handleEntityNotFound(_0x36aa41,null))[_0xfa06('0x11')](function(_0xb0ac61){if(_0xb0ac61){_0x12df69['model']=_[_0xfa06('0x39')](db['ChatMessage'][_0xfa06('0x2f')]);_0x12df69['query']=_['keys'](_0x21ec61[_0xfa06('0x3a')]);_0x12df69['filters']=_[_0xfa06('0x3b')](_0x12df69[_0xfa06('0x38')],_0x12df69[_0xfa06('0x3a')]);_0xe0ade6[_0xfa06('0x3c')]=_[_0xfa06('0x3b')](_0x12df69['model'],qs[_0xfa06('0x3d')](_0x21ec61[_0xfa06('0x3a')][_0xfa06('0x3d')]));_0xe0ade6[_0xfa06('0x3c')]=_0xe0ade6[_0xfa06('0x3c')][_0xfa06('0x3e')]?_0xe0ade6[_0xfa06('0x3c')]:_0x12df69['model'];if(!_0x21ec61[_0xfa06('0x3a')][_0xfa06('0x93')](_0xfa06('0x94'))){_0xe0ade6[_0xfa06('0x95')]=qs[_0xfa06('0x95')](_0x21ec61[_0xfa06('0x3a')][_0xfa06('0x95')]);_0xe0ade6[_0xfa06('0x1f')]=qs[_0xfa06('0x1f')](_0x21ec61[_0xfa06('0x3a')]['offset']);}_0xe0ade6[_0xfa06('0x96')]=qs[_0xfa06('0x97')](_0x21ec61[_0xfa06('0x3a')][_0xfa06('0x97')]);_0xe0ade6[_0xfa06('0x98')]=qs[_0xfa06('0x99')](_[_0xfa06('0x9a')](_0x21ec61[_0xfa06('0x3a')],_0x12df69[_0xfa06('0x99')]));_0xe0ade6['where'][_0xfa06('0x9b')]=_0xb0ac61['id'];if(_0x21ec61[_0xfa06('0x3a')][_0xfa06('0x9c')]){_0xe0ade6[_0xfa06('0x98')]=_[_0xfa06('0x28')](_0xe0ade6['where'],{'$or':_[_0xfa06('0x2d')](_0xe0ade6[_0xfa06('0x3c')],function(_0x2e65df){var _0x5cd305={};_0x5cd305[_0x2e65df]={'$like':'%'+_0x21ec61['query'][_0xfa06('0x9c')]+'%'};return _0x5cd305;})});}if(_0x21ec61[_0xfa06('0x3a')][_0xfa06('0x9d')]){var _0xffb293=_0x21ec61[_0xfa06('0x3a')][_0xfa06('0x9d')][_0xfa06('0x9e')](',');var _0x198b80={};_0x198b80[_0xffb293[0x0]]={'$gte':moment(_0xffb293[0x1])['format'](_0xfa06('0x9f'))};_0xe0ade6[_0xfa06('0x98')]=_[_0xfa06('0x28')](_0xe0ade6['where'],_0x198b80);}_0xe0ade6=_['merge']({},_0xe0ade6,_0x21ec61['options']);return db[_0xfa06('0x57')]['count']({'where':_0xe0ade6['where']})[_0xfa06('0x11')](function(_0x474f0b){_0x2e6683['count']=_0x474f0b;if(_0x21ec61[_0xfa06('0x3a')][_0xfa06('0x3f')]){_0xe0ade6[_0xfa06('0xa0')]=[{'all':!![]}];}return db[_0xfa06('0x57')][_0xfa06('0xa1')](_0xe0ade6);})[_0xfa06('0x11')](function(_0x359630){_0x2e6683['rows']=_0x359630;return _0x2e6683;});}})[_0xfa06('0x11')](respondWithFilteredResult(_0x36aa41,_0xe0ade6))[_0xfa06('0x1a')](handleError(_0x36aa41,null));};exports[_0xfa06('0xa2')]=function(_0x4b7cfd,_0x1f22a7){var _0x4e20b4={'where':{}},_0x53ce5d={},_0x2a3f50={'count':0x0,'rows':[]};return db[_0xfa06('0x2e')][_0xfa06('0x45')]({'where':{'id':_0x4b7cfd[_0xfa06('0x37')]['id']}})[_0xfa06('0x11')](handleEntityNotFound(_0x1f22a7,null))['then'](function(_0x2402e8){if(_0x2402e8){_0x53ce5d[_0xfa06('0x38')]=_[_0xfa06('0x39')](db[_0xfa06('0x57')][_0xfa06('0x2f')]);_0x53ce5d[_0xfa06('0x3a')]=_['keys'](_0x4b7cfd['query']);_0x53ce5d['filters']=_[_0xfa06('0x3b')](_0x53ce5d[_0xfa06('0x38')],_0x53ce5d[_0xfa06('0x3a')]);_0x4e20b4[_0xfa06('0x3c')]=_[_0xfa06('0x3b')](_0x53ce5d[_0xfa06('0x38')],qs[_0xfa06('0x3d')](_0x4b7cfd['query'][_0xfa06('0x3d')]));_0x4e20b4[_0xfa06('0x3c')]=_0x4e20b4[_0xfa06('0x3c')][_0xfa06('0x3e')]?_0x4e20b4[_0xfa06('0x3c')]:_0x53ce5d[_0xfa06('0x38')];if(!_0x4b7cfd['query'][_0xfa06('0x93')](_0xfa06('0x94'))){_0x4e20b4[_0xfa06('0x95')]=qs[_0xfa06('0x95')](_0x4b7cfd[_0xfa06('0x3a')]['limit']);_0x4e20b4[_0xfa06('0x1f')]=qs[_0xfa06('0x1f')](_0x4b7cfd[_0xfa06('0x3a')][_0xfa06('0x1f')]);}_0x4e20b4['order']=qs['sort'](_0x4b7cfd['query'][_0xfa06('0x97')]);_0x4e20b4['where']=qs[_0xfa06('0x99')](_[_0xfa06('0x9a')](_0x4b7cfd[_0xfa06('0x3a')],_0x53ce5d[_0xfa06('0x99')]));_0x4e20b4['where'][_0xfa06('0x9b')]=_0x2402e8['id'];if(_0x4b7cfd[_0xfa06('0x3a')][_0xfa06('0x9c')]){_0x4e20b4[_0xfa06('0x98')]=_[_0xfa06('0x28')](_0x4e20b4['where'],{'$or':_[_0xfa06('0x2d')](_0x4e20b4[_0xfa06('0x3c')],function(_0x27a982){var _0x3d6167={};_0x3d6167[_0x27a982]={'$like':'%'+_0x4b7cfd[_0xfa06('0x3a')][_0xfa06('0x9c')]+'%'};return _0x3d6167;})});}_0x4e20b4[_0xfa06('0x98')][_0xfa06('0x85')]=![];if(_0x4b7cfd[_0xfa06('0x3a')]['id']){_0x4e20b4[_0xfa06('0x98')]['id']={'$gt':_0x4b7cfd[_0xfa06('0x3a')]['id']};}_0x4e20b4=_[_0xfa06('0x28')]({},_0x4e20b4,_0x4b7cfd[_0xfa06('0xa3')]);return db['ChatMessage']['count']({'where':_0x4e20b4[_0xfa06('0x98')]})['then'](function(_0x4cad6a){_0x2a3f50[_0xfa06('0x21')]=_0x4cad6a;_0x4e20b4[_0xfa06('0xa0')]=[];if(_0x4b7cfd[_0xfa06('0x3a')][_0xfa06('0xa4')]){_0x4e20b4[_0xfa06('0xa0')][_0xfa06('0xa5')]({'model':db[_0xfa06('0x74')],'as':_0xfa06('0x74'),'attributes':['id',_0xfa06('0x4b'),_0xfa06('0xa6')]});}if(_0x4b7cfd[_0xfa06('0x3a')][_0xfa06('0x3f')]){_0x4e20b4[_0xfa06('0xa0')]=[{'all':!![]}];}return db[_0xfa06('0x57')][_0xfa06('0xa1')](_0x4e20b4);})[_0xfa06('0x11')](function(_0x617b24){_0x2a3f50[_0xfa06('0xa7')]=_0x617b24;return _0x2a3f50;});}})[_0xfa06('0x11')](respondWithFilteredResult(_0x1f22a7,_0x4e20b4))[_0xfa06('0x1a')](handleError(_0x1f22a7,null));};exports['addTags']=function(_0x33a91d,_0x201866){return db[_0xfa06('0x2e')][_0xfa06('0x40')]({'where':{'id':_0x33a91d[_0xfa06('0x37')]['id']}})['then'](handleEntityNotFound(_0x201866,null))[_0xfa06('0x11')](function(_0x4b225c){if(_0x4b225c){return _0x4b225c['setTags'](_0x33a91d['body'][_0xfa06('0x90')],_[_0xfa06('0x91')](_0x33a91d[_0xfa06('0x42')],[_0xfa06('0x90'),'id'])||{})[_0xfa06('0xa8')](function(){return db[_0xfa06('0xa9')][_0xfa06('0xa1')]({'attributes':['id',_0xfa06('0x25'),_0xfa06('0xaa')],'where':{'id':_0x33a91d['body'][_0xfa06('0x90')]}});})[_0xfa06('0x11')](function(_0x4322ae){socket[_0xfa06('0xab')](_0xfa06('0xac'),{'id':Number(_0x33a91d['params']['id']),'tags':_0x4322ae||[]});return{'id':Number(_0x33a91d[_0xfa06('0x37')]['id']),'tags':_0x4322ae||[]};});}})[_0xfa06('0x11')](respondWithResult(_0x201866,null))['catch'](handleError(_0x201866,null));};exports['removeTags']=function(_0x1ffe14,_0x1f5fc5){return db[_0xfa06('0x2e')][_0xfa06('0x40')]({'where':{'id':_0x1ffe14[_0xfa06('0x37')]['id']}})[_0xfa06('0x11')](handleEntityNotFound(_0x1f5fc5,null))[_0xfa06('0x11')](function(_0x52c190){if(_0x52c190){return _0x52c190['removeTags'](_0x1ffe14[_0xfa06('0x3a')]['ids']);}})[_0xfa06('0x11')](respondWithStatusCode(_0x1f5fc5,null))[_0xfa06('0x1a')](handleError(_0x1f5fc5,null));};exports['download']=function(_0x395eee,_0x5cda7d){var _0x3f5a53=moment()['unix']()[_0xfa06('0xad')]();var _0x430109=path[_0xfa06('0x6d')](config[_0xfa06('0x6c')],_0xfa06('0xae'),_0xfa06('0xaf'),_0xfa06('0xb0'));var _0x375902=path[_0xfa06('0x6d')](config['root'],'server',_0xfa06('0xaf'),'attachments');var _0x10280b=path['join'](_0x430109,_0x3f5a53);var _0x442b09=util[_0xfa06('0x72')](_0xfa06('0xb1'),_0x395eee['params']['id'],_0x3f5a53);var _0x55cbdc=path[_0xfa06('0x6d')](_0x430109,_0x442b09);var _0x565113=[];_0x565113[_0xfa06('0xa5')]({'model':db[_0xfa06('0x74')],'as':_0xfa06('0x74'),'attributes':['id',_0xfa06('0x4b')],'raw':!![]});_0x565113[_0xfa06('0xa5')]({'model':db[_0xfa06('0x77')],'as':_0xfa06('0x5a'),'attributes':['id',_0xfa06('0xb2'),_0xfa06('0xb3')],'raw':!![]});if(_0x395eee[_0xfa06('0x3a')][_0xfa06('0xb4')]){_0x565113[_0xfa06('0xa5')]({'model':db[_0xfa06('0x67')],'as':'Attachment','raw':!![]});}var _0x36371d=[{'model':db[_0xfa06('0x57')],'as':'Messages','attributes':['id',_0xfa06('0x42'),_0xfa06('0x83'),_0xfa06('0xb5'),_0xfa06('0x85'),'read'],'include':_0x565113}];_0x36371d['push']({'model':db[_0xfa06('0x75')],'as':_0xfa06('0xb6'),'attributes':['id',_0xfa06('0x25')]});_0x36371d[_0xfa06('0xa5')]({'model':db[_0xfa06('0x74')],'as':_0xfa06('0xb7'),'attributes':['id',_0xfa06('0x4b')]});return db[_0xfa06('0x2e')][_0xfa06('0x40')]({'where':{'id':_0x395eee[_0xfa06('0x37')]['id']},'include':_0x36371d})[_0xfa06('0x11')](handleEntityNotFound(_0x5cda7d,null))[_0xfa06('0x11')](function(_0xaf430d){if(_0xaf430d){var _0x4960dd=_0xaf430d[_0xfa06('0xb8')]({'plain':!![]});fs['mkdirSync'](_0x10280b);var _0x9329e5={'channel':'Chat','account':_0x4960dd[_0xfa06('0xb6')][_0xfa06('0x25')],'agent':_0x4960dd[_0xfa06('0xb7')]?_0x4960dd[_0xfa06('0xb7')]['fullname']:'N.A.','createdAt':moment(_0x4960dd[_0xfa06('0x83')])[_0xfa06('0x72')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x4960dd['closed']?moment(_0x4960dd[_0xfa06('0xb9')])[_0xfa06('0x72')](_0xfa06('0x9f'))[_0xfa06('0xad')]():'','disposition':_0x4960dd[_0xfa06('0x61')],'chatInfo':{'browser':_0x4960dd[_0xfa06('0xba')],'os':_0x4960dd[_0xfa06('0xbb')],'referer':_0x4960dd[_0xfa06('0xbc')],'customerIp':_0x4960dd[_0xfa06('0xbd')],'customerPort':_0x4960dd[_0xfa06('0xbe')]?_0x4960dd['customerPort']:_0xfa06('0xbf')},'messages':_(_0x4960dd[_0xfa06('0xc0')])['tail']()['filter']({'secret':![]})[_0xfa06('0x2d')](function(_0x4e8c51){if(_0x4e8c51['Attachment']){var _0xa988cb=path[_0xfa06('0x6d')](_0x375902,_0x4e8c51[_0xfa06('0x67')][_0xfa06('0xc1')]);if(fs['existsSync'](_0xa988cb)){fs['createReadStream'](_0xa988cb)[_0xfa06('0xc2')](fs['createWriteStream'](path['join'](_0x10280b,_0x4e8c51['Attachment'][_0xfa06('0xc1')])));}}return{'date':moment(_0x4e8c51[_0xfa06('0x83')])[_0xfa06('0x72')](_0xfa06('0x9f'))[_0xfa06('0xad')](),'sender':_0x4e8c51[_0xfa06('0xb5')]===_0xfa06('0xc3')?_0x4e8c51[_0xfa06('0x74')]?_0x4e8c51['User'][_0xfa06('0x4b')]:_0xfa06('0x7b'):_0x4e8c51['Contact'][_0xfa06('0xb2')]+(_0x4e8c51['Contact']['lastName']?'\x20'+_0x4e8c51[_0xfa06('0x5a')][_0xfa06('0xb3')]:''),'body':_0x4e8c51['Attachment']?_0x4e8c51[_0xfa06('0x67')]['basename']:_0x4e8c51[_0xfa06('0x42')],'direction':_0x4e8c51['direction']===_0xfa06('0xc3')?'A':'C','secret':_0x4e8c51[_0xfa06('0x85')],'read':_0x4e8c51['read'],'attachment':_0x4e8c51['Attachment']};})[_0xfa06('0xc4')]()};return ejs[_0xfa06('0xc5')](path['join'](config[_0xfa06('0x6c')],_0xfa06('0xae'),_0xfa06('0xc6'),'downloadInteraction.ejs'),{'interaction':_0x9329e5})[_0xfa06('0x11')](function(_0xe2c3e6){var _0xc49619=path[_0xfa06('0x6d')](_0x10280b,_0xfa06('0xc7')+_0x4960dd['id']+'-'+_0x3f5a53+_0xfa06('0xc8'));var _0x43c246={'path':_0xc49619,'channel':_0xfa06('0xc9'),'interactionId':_0x4960dd['id']};return pdf[_0xfa06('0xca')](_0xe2c3e6,_0x43c246);})[_0xfa06('0x11')](function(){return new Promise(function(_0x2a0504,_0x2b540b){zipdir(_0x10280b,{'saveTo':_0x55cbdc},function(_0x4b77ee,_0x218c5e){if(_0x4b77ee)return _0x2b540b(_0x4b77ee);return _0x2a0504(_0x218c5e);});})[_0xfa06('0x11')](function(){return new BPromise(function(_0x1242ed,_0x18a5f9){rimraf(_0x10280b,function(_0x270245){if(_0x270245)_0x18a5f9(_0x270245);return _0x1242ed();});});})[_0xfa06('0x11')](function(){return _0x5cda7d['download'](_0x55cbdc,_0x442b09,function(_0x6a08e2){if(_0x6a08e2){logger[_0xfa06('0x18')](_0xfa06('0xcb'),_0x6a08e2);}else{fs['unlinkSync'](_0x55cbdc);}});});});}else{return _0x5cda7d[_0xfa06('0x1b')](0xc8);}})[_0xfa06('0x1a')](handleError(_0x5cda7d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 3eca891..da336e5 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 _0x89d9=['Users','map','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x55e4e1,_0x352a79){var _0x1644e8=function(_0x4a2446){while(--_0x4a2446){_0x55e4e1['push'](_0x55e4e1['shift']());}};_0x1644e8(++_0x352a79);}(_0x89d9,0x6e));var _0x989d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x89d9[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require(_0x989d('0x0'));var ChatInteraction=require(_0x989d('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x989d('0x1'))['db'][_0x989d('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x989d('0x3')](0x0);var events={'afterCreate':_0x989d('0x4'),'afterUpdate':_0x989d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x42a5d5){return function(_0x39d123,_0x582595,_0x37ce51){_0x39d123[_0x989d('0x6')]({'attributes':['id'],'raw':!![]})[_0x989d('0x7')](function(_0x21b93c){_0x39d123[_0x989d('0x8')](_0x989d('0x9'),_0x21b93c[_0x989d('0xa')](function(_0x185765){return{'id':_0x185765['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x39d123['id'],'direction':'in','read':![]},'raw':!![]});})[_0x989d('0x7')](function(_0x5a4345){_0x39d123[_0x989d('0x8')](_0x989d('0xb'),_0x5a4345[_0x989d('0xc')]);ChatInteractionEvents[_0x989d('0xd')](_0x42a5d5+':'+_0x39d123['id'],_0x39d123);ChatInteractionEvents[_0x989d('0xd')](_0x42a5d5,_0x39d123);_0x37ce51(null);})['catch'](_0x37ce51(null));};}for(var e in events){if(events[_0x989d('0xe')](e)){var event=events[e];ChatInteraction[_0x989d('0xf')](e,emitEvent(event));}}module[_0x989d('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x5f0a=['setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb'];(function(_0x2ae529,_0x2f7071){var _0x5e9735=function(_0x4413b0){while(--_0x4413b0){_0x2ae529['push'](_0x2ae529['shift']());}};_0x5e9735(++_0x2f7071);}(_0x5f0a,0xfc));var _0xa5f0=function(_0x4cdd80,_0xbf8a2f){_0x4cdd80=_0x4cdd80-0x0;var _0x3b20bf=_0x5f0a[_0x4cdd80];return _0x3b20bf;};'use strict';var EventEmitter=require(_0xa5f0('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xa5f0('0x1')];var ChatMessage=require(_0xa5f0('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa5f0('0x3')](0x0);var events={'afterCreate':_0xa5f0('0x4'),'afterUpdate':_0xa5f0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d1ae5){return function(_0x2d253e,_0x3a0e2f,_0x23cd85){_0x2d253e[_0xa5f0('0x6')]({'attributes':['id'],'raw':!![]})[_0xa5f0('0x7')](function(_0x11fff0){_0x2d253e[_0xa5f0('0x8')](_0xa5f0('0x9'),_0x11fff0[_0xa5f0('0xa')](function(_0x50f586){return{'id':_0x50f586['id']};}));return ChatMessage[_0xa5f0('0xb')]({'where':{'ChatInteractionId':_0x2d253e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa5f0('0x7')](function(_0x261033){_0x2d253e['setDataValue'](_0xa5f0('0xc'),_0x261033['length']);ChatInteractionEvents[_0xa5f0('0xd')](_0x4d1ae5+':'+_0x2d253e['id'],_0x2d253e);ChatInteractionEvents[_0xa5f0('0xd')](_0x4d1ae5,_0x2d253e);_0x23cd85(null);})['catch'](_0x23cd85(null));};}for(var e in events){if(events[_0xa5f0('0xe')](e)){var event=events[e];ChatInteraction[_0xa5f0('0xf')](e,emitEvent(event));}}module[_0xa5f0('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 866791e..16c8a01 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 _0x39ed=['moment','path','../../config/environment','exports','ChatInteraction','chat_interactions','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x2bc400,_0x27208f){var _0x36ab53=function(_0x257660){while(--_0x257660){_0x2bc400['push'](_0x2bc400['shift']());}};_0x36ab53(++_0x27208f);}(_0x39ed,0x14e));var _0xd39e=function(_0x1d4586,_0xb42dc7){_0x1d4586=_0x1d4586-0x0;var _0x5c3059=_0x39ed[_0x1d4586];return _0x5c3059;};'use strict';var _=require('lodash');var util=require(_0xd39e('0x0'));var logger=require(_0xd39e('0x1'))('api');var moment=require(_0xd39e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd39e('0x3'));var rimraf=require('rimraf');var config=require(_0xd39e('0x4'));var attributes=require('./chatInteraction.attributes');module[_0xd39e('0x5')]=function(_0x598bd9,_0x528d65){return _0x598bd9['define'](_0xd39e('0x6'),attributes,{'tableName':_0xd39e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1006b4,_0x4d1c72,_0x353c43){if(_0x1006b4['changed']('closed')){_0x1006b4['closedAt']=moment()[_0xd39e('0x8')](_0xd39e('0x9'));}_0x353c43(null,_0x1006b4);}},'charset':_0xd39e('0xa'),'collate':_0xd39e('0xb')});};
\ No newline at end of file
+var _0x3856=['rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','bluebird','request-promise','path'];(function(_0x5a8f34,_0x11c27b){var _0x497614=function(_0x2089e3){while(--_0x2089e3){_0x5a8f34['push'](_0x5a8f34['shift']());}};_0x497614(++_0x11c27b);}(_0x3856,0x100));var _0x6385=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x3856[_0x10004e];return _0x5af990;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6385('0x0'))('api');var moment=require('moment');var BPromise=require(_0x6385('0x1'));var rp=require(_0x6385('0x2'));var fs=require('fs');var path=require(_0x6385('0x3'));var rimraf=require(_0x6385('0x4'));var config=require(_0x6385('0x5'));var attributes=require(_0x6385('0x6'));module[_0x6385('0x7')]=function(_0x2064b0,_0x28ed2c){return _0x2064b0['define'](_0x6385('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38360a,_0x23980c,_0x18f5f8){if(_0x38360a[_0x6385('0x9')](_0x6385('0xa'))){_0x38360a['closedAt']=moment()[_0x6385('0xb')](_0x6385('0xc'));}_0x18f5f8(null,_0x38360a);}},'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 415df25..54d2be2 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 _0x389d=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateChatInteraction','ChatInteraction','body','options','raw','attributes','limit','then','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0x389d,0xc6));var _0xd389=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0x389d[_0x3bd52b];return _0x1e5b89;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd389('0x0'));var BPromise=require(_0xd389('0x1'));var rs=require(_0xd389('0x2'));var fs=require('fs');var Redis=require(_0xd389('0x3'));var db=require(_0xd389('0x4'))['db'];var utils=require(_0xd389('0x5'));var logger=require(_0xd389('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd389('0x7'));var client=jayson[_0xd389('0x8')][_0xd389('0x9')]({'port':0x232a});config[_0xd389('0xa')]=_[_0xd389('0xb')](config[_0xd389('0xa')],{'host':_0xd389('0xc'),'port':0x18eb});var socket=require(_0xd389('0xd'))(new Redis(config[_0xd389('0xa')]));require(_0xd389('0xe'))['register'](socket);function respondWithRpcPromise(_0x40654c,_0x2a28eb,_0x27ee9b){return new BPromise(function(_0xb7b633,_0xa6450a){return client[_0xd389('0xf')](_0x40654c,_0x27ee9b)['then'](function(_0xdf4523){logger[_0xd389('0x10')](_0xd389('0x11'),_0x2a28eb,'request\x20sent');logger[_0xd389('0x12')](_0xd389('0x13'),_0x2a28eb,_0xd389('0x14'),JSON[_0xd389('0x15')](_0xdf4523));if(_0xdf4523[_0xd389('0x16')]){if(_0xdf4523['error']['code']===0x1f4){logger[_0xd389('0x16')](_0xd389('0x11'),_0x2a28eb,_0xdf4523['error'][_0xd389('0x17')]);return _0xa6450a(_0xdf4523[_0xd389('0x16')][_0xd389('0x17')]);}logger[_0xd389('0x16')](_0xd389('0x11'),_0x2a28eb,_0xdf4523['error'][_0xd389('0x17')]);return _0xb7b633(_0xdf4523['error'][_0xd389('0x17')]);}else{logger[_0xd389('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2a28eb,_0xd389('0x14'));_0xb7b633(_0xdf4523[_0xd389('0x18')][_0xd389('0x17')]);}})['catch'](function(_0x36bce5){logger['error'](_0xd389('0x11'),_0x2a28eb,_0x36bce5);_0xa6450a(_0x36bce5);});});}exports[_0xd389('0x19')]=function(_0x68032d){var _0x40a030=this;return new Promise(function(_0x40f6f3,_0xb041ac){return db[_0xd389('0x1a')]['update'](_0x68032d[_0xd389('0x1b')],{'raw':_0x68032d['options']?_0x68032d[_0xd389('0x1c')][_0xd389('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x68032d[_0xd389('0x1c')]?_0x68032d[_0xd389('0x1c')]['where']||null:null,'attributes':_0x68032d['options']?_0x68032d['options'][_0xd389('0x1e')]||null:null,'limit':_0x68032d[_0xd389('0x1c')]?_0x68032d[_0xd389('0x1c')][_0xd389('0x1f')]||null:null})[_0xd389('0x20')](function(_0x1d4ff5){logger[_0xd389('0x10')](_0xd389('0x19'),_0x68032d);logger[_0xd389('0x12')](_0xd389('0x19'),_0x68032d,JSON['stringify'](_0x1d4ff5));_0x40f6f3(_0x1d4ff5);})['catch'](function(_0x5b9be5){logger[_0xd389('0x16')](_0xd389('0x19'),_0x5b9be5[_0xd389('0x17')],_0x68032d);_0xb041ac(_0x40a030[_0xd389('0x16')](0x1f4,_0x5b9be5[_0xd389('0x17')]));});});};exports[_0xd389('0x21')]=function(_0x172edc){return new Promise(function(_0x4d10c3,_0x2dae25){return db[_0xd389('0x1a')][_0xd389('0x22')]({'where':_0x172edc[_0xd389('0x1c')]?_0x172edc[_0xd389('0x1c')][_0xd389('0x23')]||null:null})[_0xd389('0x20')](function(_0x402b00){if(_0x402b00){return _0x402b00[_0xd389('0x24')](_0x172edc[_0xd389('0x1b')][_0xd389('0x25')],_[_0xd389('0x26')](_0x172edc[_0xd389('0x1b')],[_0xd389('0x25'),'id'])||{});}})[_0xd389('0x27')](function(_0x14aca4){logger[_0xd389('0x10')](_0xd389('0x28'),_0x172edc);logger[_0xd389('0x12')](_0xd389('0x28'),_0x172edc,JSON[_0xd389('0x15')](_0x14aca4));_0x4d10c3(_0x14aca4);})['catch'](function(_0x354ba2){logger[_0xd389('0x16')](_0xd389('0x28'),_0x354ba2[_0xd389('0x17')],_0x172edc);_0x2dae25(_this[_0xd389('0x16')](0x1f4,_0x354ba2[_0xd389('0x17')]));});});};
\ No newline at end of file
+var _0xcf21=['./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','debug','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter'];(function(_0x1cbfc5,_0x4cfaae){var _0x555830=function(_0x5f5728){while(--_0x5f5728){_0x1cbfc5['push'](_0x1cbfc5['shift']());}};_0x555830(++_0x4cfaae);}(_0xcf21,0x69));var _0x1cf2=function(_0x176258,_0x58a87d){_0x176258=_0x176258-0x0;var _0x3633f9=_0xcf21[_0x176258];return _0x3633f9;};'use strict';var _=require(_0x1cf2('0x0'));var util=require(_0x1cf2('0x1'));var moment=require(_0x1cf2('0x2'));var BPromise=require(_0x1cf2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cf2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cf2('0x5'));var logger=require(_0x1cf2('0x6'))('rpc');var config=require(_0x1cf2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1cf2('0x8')]['http']({'port':0x232a});config[_0x1cf2('0x9')]=_[_0x1cf2('0xa')](config[_0x1cf2('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x1cf2('0xb'))(new Redis(config[_0x1cf2('0x9')]));require(_0x1cf2('0xc'))['register'](socket);function respondWithRpcPromise(_0x1963c5,_0x1ed4bd,_0x51716f){return new BPromise(function(_0x105083,_0x355f29){return client['request'](_0x1963c5,_0x51716f)[_0x1cf2('0xd')](function(_0x2b8297){logger[_0x1cf2('0xe')](_0x1cf2('0xf'),_0x1ed4bd,_0x1cf2('0x10'));logger['debug'](_0x1cf2('0x11'),_0x1ed4bd,'request\x20sent',JSON['stringify'](_0x2b8297));if(_0x2b8297[_0x1cf2('0x12')]){if(_0x2b8297[_0x1cf2('0x12')][_0x1cf2('0x13')]===0x1f4){logger[_0x1cf2('0x12')](_0x1cf2('0xf'),_0x1ed4bd,_0x2b8297['error']['message']);return _0x355f29(_0x2b8297[_0x1cf2('0x12')]['message']);}logger[_0x1cf2('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1ed4bd,_0x2b8297[_0x1cf2('0x12')]['message']);return _0x105083(_0x2b8297[_0x1cf2('0x12')][_0x1cf2('0x14')]);}else{logger[_0x1cf2('0xe')](_0x1cf2('0xf'),_0x1ed4bd,_0x1cf2('0x10'));_0x105083(_0x2b8297[_0x1cf2('0x15')][_0x1cf2('0x14')]);}})[_0x1cf2('0x16')](function(_0x5106d6){logger[_0x1cf2('0x12')](_0x1cf2('0xf'),_0x1ed4bd,_0x5106d6);_0x355f29(_0x5106d6);});});}exports[_0x1cf2('0x17')]=function(_0x2cd305){var _0x318952=this;return new Promise(function(_0x4a0959,_0x341af6){return db[_0x1cf2('0x18')][_0x1cf2('0x19')](_0x2cd305[_0x1cf2('0x1a')],{'raw':_0x2cd305[_0x1cf2('0x1b')]?_0x2cd305['options'][_0x1cf2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cd305['options']?_0x2cd305[_0x1cf2('0x1b')][_0x1cf2('0x1d')]||null:null,'attributes':_0x2cd305[_0x1cf2('0x1b')]?_0x2cd305[_0x1cf2('0x1b')][_0x1cf2('0x1e')]||null:null,'limit':_0x2cd305[_0x1cf2('0x1b')]?_0x2cd305[_0x1cf2('0x1b')]['limit']||null:null})[_0x1cf2('0xd')](function(_0xbc447d){logger[_0x1cf2('0xe')](_0x1cf2('0x17'),_0x2cd305);logger[_0x1cf2('0x1f')](_0x1cf2('0x17'),_0x2cd305,JSON['stringify'](_0xbc447d));_0x4a0959(_0xbc447d);})['catch'](function(_0x29405e){logger['error']('UpdateChatInteraction',_0x29405e['message'],_0x2cd305);_0x341af6(_0x318952[_0x1cf2('0x12')](0x1f4,_0x29405e[_0x1cf2('0x14')]));});});};exports[_0x1cf2('0x20')]=function(_0x3c4411){return new Promise(function(_0x326a5a,_0x5513ef){return db[_0x1cf2('0x18')][_0x1cf2('0x21')]({'where':_0x3c4411[_0x1cf2('0x1b')]?_0x3c4411[_0x1cf2('0x1b')][_0x1cf2('0x1d')]||null:null})['then'](function(_0x369572){if(_0x369572){return _0x369572[_0x1cf2('0x22')](_0x3c4411[_0x1cf2('0x1a')][_0x1cf2('0x23')],_[_0x1cf2('0x24')](_0x3c4411['body'],['ids','id'])||{});}})['spread'](function(_0xda80cd){logger[_0x1cf2('0xe')]('AddTags',_0x3c4411);logger[_0x1cf2('0x1f')](_0x1cf2('0x25'),_0x3c4411,JSON[_0x1cf2('0x26')](_0xda80cd));_0x326a5a(_0xda80cd);})['catch'](function(_0x50855b){logger['error'](_0x1cf2('0x25'),_0x50855b['message'],_0x3c4411);_0x5513ef(_this[_0x1cf2('0x12')](0x1f4,_0x50855b[_0x1cf2('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 2747d9d..e63c2e6 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 _0x6c6f=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x1bafe4,_0x1cdfd4){var _0x25fa81=function(_0x1793a1){while(--_0x1793a1){_0x1bafe4['push'](_0x1bafe4['shift']());}};_0x25fa81(++_0x1cdfd4);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x13d577,_0x54156b){_0x13d577=_0x13d577-0x0;var _0x54304e=_0x6c6f[_0x13d577];return _0x54304e;};'use strict';var ChatInteractionEvents=require(_0xf6c6('0x0'));var events=[_0xf6c6('0x1'),_0xf6c6('0x2'),_0xf6c6('0x3')];function createListener(_0x2f571d,_0x3c8fc3){return function(_0x332916){_0x3c8fc3[_0xf6c6('0x4')](_0x2f571d,_0x332916);};}function removeListener(_0x36fcd2,_0xa1183){return function(){ChatInteractionEvents[_0xf6c6('0x5')](_0x36fcd2,_0xa1183);};}exports['register']=function(_0x3b4e7b){for(var _0x4f8e34=0x0,_0x4c27f8=events[_0xf6c6('0x6')];_0x4f8e34<_0x4c27f8;_0x4f8e34++){var _0x5b34df=events[_0x4f8e34];var _0x308c42=createListener(_0xf6c6('0x7')+_0x5b34df,_0x3b4e7b);ChatInteractionEvents['on'](_0x5b34df,_0x308c42);}};
\ No newline at end of file
+var _0x92d7=['length','chatInteraction:','./chatInteraction.events','save','remove','update','removeListener'];(function(_0x23bf7f,_0x578f6c){var _0x64b00e=function(_0x3e6da9){while(--_0x3e6da9){_0x23bf7f['push'](_0x23bf7f['shift']());}};_0x64b00e(++_0x578f6c);}(_0x92d7,0x79));var _0x792d=function(_0xf3e76b,_0x213ce7){_0xf3e76b=_0xf3e76b-0x0;var _0x13f72c=_0x92d7[_0xf3e76b];return _0x13f72c;};'use strict';var ChatInteractionEvents=require(_0x792d('0x0'));var events=[_0x792d('0x1'),_0x792d('0x2'),_0x792d('0x3')];function createListener(_0x51687a,_0x460304){return function(_0x12b12f){_0x460304['emit'](_0x51687a,_0x12b12f);};}function removeListener(_0x5343b2,_0x1a96d5){return function(){ChatInteractionEvents[_0x792d('0x4')](_0x5343b2,_0x1a96d5);};}exports['register']=function(_0x5b8320){for(var _0x383b31=0x0,_0x35ad7f=events[_0x792d('0x5')];_0x383b31<_0x35ad7f;_0x383b31++){var _0x1dd67d=events[_0x383b31];var _0xdc1464=createListener(_0x792d('0x6')+_0x1dd67d,_0x5b8320);ChatInteractionEvents['on'](_0x1dd67d,_0xdc1464);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 504cfcd..2e8d722 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 _0x2723=['isChatInteractionAuthorized','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','/:id/attachment_upload','single','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x73d4ff,_0x52a911){var _0x453042=function(_0x2b3700){while(--_0x2b3700){_0x73d4ff['push'](_0x73d4ff['shift']());}};_0x453042(++_0x52a911);}(_0x2723,0x87));var _0x3272=function(_0xb3d3ba,_0x493c86){_0xb3d3ba=_0xb3d3ba-0x0;var _0x5aee93=_0x2723[_0xb3d3ba];return _0x5aee93;};'use strict';var multer=require(_0x3272('0x0'));var util=require(_0x3272('0x1'));var path=require(_0x3272('0x2'));var timeout=require('connect-timeout');var express=require(_0x3272('0x3'));var router=express[_0x3272('0x4')]();var fs_extra=require(_0x3272('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3272('0x6'));var config=require(_0x3272('0x7'));var controller=require(_0x3272('0x8'));router['get']('/',auth[_0x3272('0x9')](),controller[_0x3272('0xa')]);router[_0x3272('0xb')](_0x3272('0xc'),auth[_0x3272('0x9')](),controller[_0x3272('0xd')]);router['get'](_0x3272('0xe'),auth[_0x3272('0xf')](),controller[_0x3272('0x10')]);router[_0x3272('0xb')]('/:id/attachment_download',auth[_0x3272('0xf')](),controller['attachmentDownload']);router[_0x3272('0xb')](_0x3272('0x11'),auth[_0x3272('0x9')](),controller[_0x3272('0x12')]);router[_0x3272('0xb')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x3272('0xb')](_0x3272('0x13'),auth[_0x3272('0x9')](),controller[_0x3272('0x14')]);router[_0x3272('0x15')]('/',auth[_0x3272('0x9')](),controller[_0x3272('0x16')]);router[_0x3272('0x15')](_0x3272('0x17'),auth[_0x3272('0x9')](),controller[_0x3272('0x18')]);var upload=multer({'storage':multer[_0x3272('0x19')]({'destination':function(_0x5c44ec,_0x1e1d86,_0x41c964){_0x41c964(null,path[_0x3272('0x1a')](config[_0x3272('0x1b')],_0x3272('0x1c')));},'filename':function(_0x4c4876,_0x3e05f0,_0x3265c7){_0x3265c7(null,util['format'](_0x3272('0x1d'),Date[_0x3272('0x1e')](),_0x3e05f0['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3272('0x15')](_0x3272('0x1f'),upload[_0x3272('0x20')]('file'),controller[_0x3272('0x21')]);router[_0x3272('0x15')](_0x3272('0x11'),auth[_0x3272('0xf')](),controller['addMessage']);router[_0x3272('0x15')](_0x3272('0x22'),auth[_0x3272('0x9')](),interaction[_0x3272('0x23')](_0x3272('0x24'),_0x3272('0x25')),controller[_0x3272('0x26')]);router[_0x3272('0x27')](_0x3272('0xe'),auth[_0x3272('0x9')](),interaction[_0x3272('0x23')]('chat','chatinteraction:update'),controller[_0x3272('0x28')]);router[_0x3272('0x27')](_0x3272('0x29'),controller[_0x3272('0x2a')]);router['put'](_0x3272('0x2b'),auth[_0x3272('0xf')](),controller[_0x3272('0x2c')]);router[_0x3272('0x27')](_0x3272('0x2d'),controller['close']);router[_0x3272('0x2e')](_0x3272('0xe'),auth[_0x3272('0x9')](),interaction[_0x3272('0x23')](_0x3272('0x24'),_0x3272('0x2f')),controller[_0x3272('0x30')]);router[_0x3272('0x2e')](_0x3272('0x22'),auth[_0x3272('0x9')](),controller[_0x3272('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0xfc23=['customUpdate','/:id/abandon','chatinteraction:destroy','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','/:id/custom_update'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0xfc23,0x98));var _0x3fc2=function(_0x319b26,_0x150b80){_0x319b26=_0x319b26-0x0;var _0x3f5ec5=_0xfc23[_0x319b26];return _0x3f5ec5;};'use strict';var multer=require(_0x3fc2('0x0'));var util=require('util');var path=require(_0x3fc2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3fc2('0x2')]();var fs_extra=require(_0x3fc2('0x3'));var auth=require(_0x3fc2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3fc2('0x5'));var controller=require(_0x3fc2('0x6'));router['get']('/',auth[_0x3fc2('0x7')](),controller[_0x3fc2('0x8')]);router[_0x3fc2('0x9')](_0x3fc2('0xa'),auth['isAuthenticated'](),controller[_0x3fc2('0xb')]);router['get'](_0x3fc2('0xc'),auth[_0x3fc2('0xd')](),controller[_0x3fc2('0xe')]);router['get'](_0x3fc2('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x3fc2('0x10')]);router[_0x3fc2('0x9')](_0x3fc2('0x11'),auth['isAuthenticated'](),controller[_0x3fc2('0x12')]);router['get']('/:id/my_messages',auth[_0x3fc2('0xd')](),controller[_0x3fc2('0x13')]);router[_0x3fc2('0x9')](_0x3fc2('0x14'),auth[_0x3fc2('0x7')](),controller['download']);router[_0x3fc2('0x15')]('/',auth[_0x3fc2('0x7')](),controller['create']);router[_0x3fc2('0x15')](_0x3fc2('0x16'),auth[_0x3fc2('0x7')](),controller[_0x3fc2('0x17')]);var upload=multer({'storage':multer[_0x3fc2('0x18')]({'destination':function(_0x1c56bc,_0x214338,_0x384ee3){_0x384ee3(null,path[_0x3fc2('0x19')](config[_0x3fc2('0x1a')],_0x3fc2('0x1b')));},'filename':function(_0x217b4b,_0x5331ba,_0x54436a){_0x54436a(null,util[_0x3fc2('0x1c')](_0x3fc2('0x1d'),Date[_0x3fc2('0x1e')](),_0x5331ba[_0x3fc2('0x1f')][_0x3fc2('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x3fc2('0x21')](_0x3fc2('0x22')),controller[_0x3fc2('0x23')]);router[_0x3fc2('0x15')](_0x3fc2('0x11'),auth[_0x3fc2('0xd')](),controller[_0x3fc2('0x24')]);router[_0x3fc2('0x15')](_0x3fc2('0x25'),auth[_0x3fc2('0x7')](),interaction['tracked'](_0x3fc2('0x26'),_0x3fc2('0x27')),controller[_0x3fc2('0x28')]);router[_0x3fc2('0x29')](_0x3fc2('0xc'),auth['isAuthenticated'](),interaction[_0x3fc2('0x2a')](_0x3fc2('0x26'),'chatinteraction:update'),controller['update']);router['put'](_0x3fc2('0x2b'),controller[_0x3fc2('0x2c')]);router[_0x3fc2('0x29')](_0x3fc2('0x2d'),auth[_0x3fc2('0xd')](),controller['abandon']);router['put']('/:id/close',controller['close']);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x3fc2('0x26'),_0x3fc2('0x2e')),controller[_0x3fc2('0x2f')]);router['delete'](_0x3fc2('0x25'),auth[_0x3fc2('0x7')](),controller['removeTags']);module[_0x3fc2('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 3246e19..024ce24 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 _0xc58c=['INTEGER','sequelize','TEXT','medium'];(function(_0x3707dc,_0x2b0a3a){var _0x3d8361=function(_0x3fb76d){while(--_0x3fb76d){_0x3707dc['push'](_0x3707dc['shift']());}};_0x3d8361(++_0x2b0a3a);}(_0xc58c,0x17d));var _0xcc58=function(_0x159301,_0x36eee4){_0x159301=_0x159301-0x0;var _0x32e257=_0xc58c[_0x159301];return _0x32e257;};'use strict';var Sequelize=require(_0xcc58('0x0'));module['exports']={'body':{'type':Sequelize[_0xcc58('0x1')](_0xcc58('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcc58('0x3')]}};
\ No newline at end of file
+var _0x22e7=['INTEGER','sequelize','exports'];(function(_0xb5fc3e,_0x234703){var _0x2efc3c=function(_0x4e4e44){while(--_0x4e4e44){_0xb5fc3e['push'](_0xb5fc3e['shift']());}};_0x2efc3c(++_0x234703);}(_0x22e7,0x157));var _0x722e=function(_0xfaaf84,_0x4196c0){_0xfaaf84=_0xfaaf84-0x0;var _0x249547=_0x22e7[_0xfaaf84];return _0x249547;};'use strict';var Sequelize=require(_0x722e('0x0'));module[_0x722e('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x722e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 1485606..4bd5114 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 _0xdbfc=['format','YYYY-MM-DD\x20HH:mm:ss','agent','user','fullname','role','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','Agents','userProfileId','UserProfileResource','resourceId','push','FromId','ToId','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','stack','send','ChatInternalMessage','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','lastMessage'];(function(_0x33b770,_0x113bf3){var _0x5083e8=function(_0x2fbf32){while(--_0x2fbf32){_0x33b770['push'](_0x33b770['shift']());}};_0x5083e8(++_0x113bf3);}(_0xdbfc,0xe5));var _0xcdbf=function(_0x288417,_0x48f76d){_0x288417=_0x288417-0x0;var _0x5cb215=_0xdbfc[_0x288417];return _0x5cb215;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdbf('0x0'));var zipdir=require(_0xcdbf('0x1'));var jsonpatch=require(_0xcdbf('0x2'));var rp=require(_0xcdbf('0x3'));var moment=require('moment');var BPromise=require(_0xcdbf('0x4'));var Mustache=require(_0xcdbf('0x5'));var util=require(_0xcdbf('0x6'));var path=require(_0xcdbf('0x7'));var sox=require(_0xcdbf('0x8'));var csv=require(_0xcdbf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcdbf('0xa'));var squel=require(_0xcdbf('0xb'));var crypto=require(_0xcdbf('0xc'));var jsforce=require(_0xcdbf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdbf('0x9'));var querystring=require(_0xcdbf('0xe'));var Papa=require(_0xcdbf('0xf'));var Redis=require(_0xcdbf('0x10'));var authService=require(_0xcdbf('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcdbf('0x12'));var logger=require(_0xcdbf('0x13'))(_0xcdbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcdbf('0x15'));var db=require('../../mysqldb')['db'];config[_0xcdbf('0x16')]=_[_0xcdbf('0x17')](config[_0xcdbf('0x16')],{'host':_0xcdbf('0x18'),'port':0x18eb});var socket=require(_0xcdbf('0x19'))(new Redis(config[_0xcdbf('0x16')]));require(_0xcdbf('0x1a'))[_0xcdbf('0x1b')](socket);function respondWithStatusCode(_0x9bb892,_0x44386e){_0x44386e=_0x44386e||0xcc;return function(_0x1180f9){if(_0x1180f9){return _0x9bb892[_0xcdbf('0x1c')](_0x44386e);}return _0x9bb892['status'](_0x44386e)['end']();};}function respondWithResult(_0x1a139c,_0x1446de){_0x1446de=_0x1446de||0xc8;return function(_0x407772){if(_0x407772){return _0x1a139c[_0xcdbf('0x1d')](_0x1446de)[_0xcdbf('0x1e')](_0x407772);}};}function respondWithFilteredResult(_0x597d6b,_0x2f5386){return function(_0x441336){if(_0x441336){var _0x1d735d=typeof _0x2f5386[_0xcdbf('0x1f')]===_0xcdbf('0x20')&&typeof _0x2f5386[_0xcdbf('0x21')]===_0xcdbf('0x20');var _0x4056fd=_0x441336['count'];var _0x3da6db=_0x1d735d?0x0:_0x2f5386[_0xcdbf('0x1f')];var _0x1cb1e5=_0x1d735d?_0x441336['count']:_0x2f5386[_0xcdbf('0x1f')]+_0x2f5386[_0xcdbf('0x21')];var _0x5b0d9d;if(_0x1cb1e5>=_0x4056fd){_0x1cb1e5=_0x4056fd;_0x5b0d9d=0xc8;}else{_0x5b0d9d=0xce;}_0x597d6b[_0xcdbf('0x1d')](_0x5b0d9d);return _0x597d6b[_0xcdbf('0x22')](_0xcdbf('0x23'),_0x3da6db+'-'+_0x1cb1e5+'/'+_0x4056fd)[_0xcdbf('0x1e')](_0x441336);}return null;};}function patchUpdates(_0x3054ba){return function(_0x4be81){try{jsonpatch[_0xcdbf('0x24')](_0x4be81,_0x3054ba,!![]);}catch(_0x4026a7){return BPromise[_0xcdbf('0x25')](_0x4026a7);}return _0x4be81['save']();};}function saveUpdates(_0x3c61ee,_0x43a012){return function(_0x3364ac){if(_0x3364ac){return _0x3364ac[_0xcdbf('0x26')](_0x3c61ee)[_0xcdbf('0x27')](function(_0x4fece){return _0x4fece;});}return null;};}function removeEntity(_0x326a79,_0x41e43a){return function(_0xc0427b){if(_0xc0427b){return _0xc0427b[_0xcdbf('0x28')]()['then'](function(){_0x326a79['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30f69d,_0x51f082){return function(_0x107fe5){if(!_0x107fe5){_0x30f69d[_0xcdbf('0x1c')](0x194);}return _0x107fe5;};}function handleError(_0x46da79,_0x2eea81){_0x2eea81=_0x2eea81||0x1f4;return function(_0x286a89){logger['error'](_0x286a89[_0xcdbf('0x29')]);if(_0x286a89['name']){delete _0x286a89['name'];}_0x46da79['status'](_0x2eea81)[_0xcdbf('0x2a')](_0x286a89);};}exports['index']=function(_0x199b32,_0x3a2474){var _0x58b76a={},_0x440e73={},_0x56a4e2={'count':0x0,'rows':[]};var _0x25ed74=_['map'](db[_0xcdbf('0x2b')][_0xcdbf('0x2c')],function(_0x250b27){return{'name':_0x250b27['fieldName'],'type':_0x250b27[_0xcdbf('0x2d')][_0xcdbf('0x2e')]};});_0x440e73[_0xcdbf('0x2f')]=_['map'](_0x25ed74,_0xcdbf('0x30'));_0x440e73[_0xcdbf('0x31')]=_[_0xcdbf('0x32')](_0x199b32['query']);_0x440e73[_0xcdbf('0x33')]=_['intersection'](_0x440e73['model'],_0x440e73[_0xcdbf('0x31')]);_0x58b76a[_0xcdbf('0x34')]=_[_0xcdbf('0x35')](_0x440e73[_0xcdbf('0x2f')],qs[_0xcdbf('0x36')](_0x199b32[_0xcdbf('0x31')][_0xcdbf('0x36')]));_0x58b76a['attributes']=_0x58b76a[_0xcdbf('0x34')]['length']?_0x58b76a[_0xcdbf('0x34')]:_0x440e73[_0xcdbf('0x2f')];if(!_0x199b32['query']['hasOwnProperty'](_0xcdbf('0x37'))){_0x58b76a[_0xcdbf('0x21')]=qs[_0xcdbf('0x21')](_0x199b32['query'][_0xcdbf('0x21')]);_0x58b76a[_0xcdbf('0x1f')]=qs[_0xcdbf('0x1f')](_0x199b32[_0xcdbf('0x31')][_0xcdbf('0x1f')]);}_0x58b76a[_0xcdbf('0x38')]=qs[_0xcdbf('0x39')](_0x199b32[_0xcdbf('0x31')][_0xcdbf('0x39')]);_0x58b76a[_0xcdbf('0x3a')]=qs['filters'](_[_0xcdbf('0x3b')](_0x199b32[_0xcdbf('0x31')],_0x440e73['filters']),_0x25ed74);if(_0x199b32[_0xcdbf('0x31')][_0xcdbf('0x3c')]){_0x58b76a['where']=_[_0xcdbf('0x3d')](_0x58b76a[_0xcdbf('0x3a')],{'$or':_[_0xcdbf('0x3e')](_0x25ed74,function(_0x1c9359){if(_0x1c9359['type']!==_0xcdbf('0x3f')){var _0x56d9b7={};_0x56d9b7[_0x1c9359['name']]={'$like':'%'+_0x199b32[_0xcdbf('0x31')]['filter']+'%'};return _0x56d9b7;}})});}_0x58b76a=_['merge']({},_0x58b76a,_0x199b32['options']);var _0x5a2101={'where':_0x58b76a['where']};return db['ChatInternalMessage']['count'](_0x5a2101)[_0xcdbf('0x27')](function(_0x51b9c2){_0x56a4e2[_0xcdbf('0x40')]=_0x51b9c2;if(_0x199b32[_0xcdbf('0x31')][_0xcdbf('0x41')]){_0x58b76a[_0xcdbf('0x42')]=[{'all':!![]}];}return db[_0xcdbf('0x2b')][_0xcdbf('0x43')](_0x58b76a);})[_0xcdbf('0x27')](function(_0x21a274){_0x56a4e2[_0xcdbf('0x44')]=_0x21a274;return _0x56a4e2;})[_0xcdbf('0x27')](respondWithFilteredResult(_0x3a2474,_0x58b76a))[_0xcdbf('0x45')](handleError(_0x3a2474,null));};exports[_0xcdbf('0x46')]=function(_0x5b3607,_0x26684f){var _0x55ada2={'raw':!![],'where':{'id':_0x5b3607['params']['id']}},_0x5d6fd7={};_0x5d6fd7[_0xcdbf('0x2f')]=_[_0xcdbf('0x32')](db[_0xcdbf('0x2b')][_0xcdbf('0x2c')]);_0x5d6fd7[_0xcdbf('0x31')]=_[_0xcdbf('0x32')](_0x5b3607[_0xcdbf('0x31')]);_0x5d6fd7[_0xcdbf('0x33')]=_[_0xcdbf('0x35')](_0x5d6fd7['model'],_0x5d6fd7['query']);_0x55ada2[_0xcdbf('0x34')]=_[_0xcdbf('0x35')](_0x5d6fd7[_0xcdbf('0x2f')],qs[_0xcdbf('0x36')](_0x5b3607[_0xcdbf('0x31')][_0xcdbf('0x36')]));_0x55ada2[_0xcdbf('0x34')]=_0x55ada2[_0xcdbf('0x34')][_0xcdbf('0x47')]?_0x55ada2[_0xcdbf('0x34')]:_0x5d6fd7[_0xcdbf('0x2f')];if(_0x5b3607['query']['includeAll']){_0x55ada2['include']=[{'all':!![]}];}_0x55ada2=_['merge']({},_0x55ada2,_0x5b3607[_0xcdbf('0x48')]);return db[_0xcdbf('0x2b')][_0xcdbf('0x49')](_0x55ada2)[_0xcdbf('0x27')](handleEntityNotFound(_0x26684f,null))[_0xcdbf('0x27')](respondWithResult(_0x26684f,null))[_0xcdbf('0x45')](handleError(_0x26684f,null));};exports[_0xcdbf('0x4a')]=function(_0x12d272,_0x40d22e){return db[_0xcdbf('0x2b')][_0xcdbf('0x4a')](_0x12d272[_0xcdbf('0x4b')],{})[_0xcdbf('0x27')](respondWithResult(_0x40d22e,0xc9))[_0xcdbf('0x45')](handleError(_0x40d22e,null));};exports[_0xcdbf('0x26')]=function(_0x583cbb,_0x798612){if(_0x583cbb[_0xcdbf('0x4b')]['id']){delete _0x583cbb[_0xcdbf('0x4b')]['id'];}return db[_0xcdbf('0x2b')][_0xcdbf('0x49')]({'where':{'id':_0x583cbb[_0xcdbf('0x4c')]['id']}})[_0xcdbf('0x27')](handleEntityNotFound(_0x798612,null))['then'](saveUpdates(_0x583cbb['body'],null))[_0xcdbf('0x27')](respondWithResult(_0x798612,null))['catch'](handleError(_0x798612,null));};exports['destroy']=function(_0x18b722,_0x5ea48c){return db[_0xcdbf('0x2b')][_0xcdbf('0x49')]({'where':{'id':_0x18b722[_0xcdbf('0x4c')]['id']}})[_0xcdbf('0x27')](handleEntityNotFound(_0x5ea48c,null))[_0xcdbf('0x27')](removeEntity(_0x5ea48c,null))[_0xcdbf('0x45')](handleError(_0x5ea48c,null));};exports[_0xcdbf('0x4d')]=function(_0x5f1567,_0x169e84){return db[_0xcdbf('0x2b')][_0xcdbf('0x4d')]()[_0xcdbf('0x27')](respondWithResult(_0x169e84,null))['catch'](handleError(_0x169e84,null));};function wrapUser(_0x3467de){return function(_0x564952){var _0x38ab64=_0x3467de[_0xcdbf('0x4e')]({'plain':!![]});_0x38ab64[_0xcdbf('0x4f')]=[];if(_0x564952){_0x38ab64[_0xcdbf('0x50')]=_0x564952[_0xcdbf('0x51')];_0x38ab64[_0xcdbf('0x52')]=_0x564952;}else{_0x38ab64[_0xcdbf('0x50')]=moment(0x0)[_0xcdbf('0x53')](_0xcdbf('0x54'));_0x38ab64[_0xcdbf('0x52')]={};}return _0x38ab64;};}exports['getUsers']=function(_0x382bd9,_0x4d3120,_0x17007){var _0x3c06e1=[];return db['User'][_0xcdbf('0x43')]({'where':{'role':[_0xcdbf('0x55'),'admin',_0xcdbf('0x56')]},'attributes':['id',_0xcdbf('0x57'),'name',_0xcdbf('0x58'),'userpic',_0xcdbf('0x59'),_0xcdbf('0x5a'),'lastLoginAt',_0xcdbf('0x5b'),_0xcdbf('0x5c')],'order':qs['sort'](_0xcdbf('0x5d')),'include':[{'model':db[_0xcdbf('0x5e')],'as':'VoiceQueues','attributes':['id',_0xcdbf('0x30'),_0xcdbf('0x2d')],'through':{'attributes':[]}}]})[_0xcdbf('0x27')](function(_0x46182f){if(_0x46182f){var _0x3070d3=_0x382bd9[_0xcdbf('0x56')][_0xcdbf('0x4e')]({'plain':!![]});if(!_0x3070d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3070d3[_0xcdbf('0x58')]===_0xcdbf('0x56')){return db['UserProfileSection'][_0xcdbf('0x49')]({'where':{'name':_0xcdbf('0x5f'),'userProfileId':_0x3070d3[_0xcdbf('0x60')]},'raw':!![]})['then'](function(_0x1fd337){if(_0x1fd337){if(_0x1fd337['autoAssociation']===0x0){return db[_0xcdbf('0x61')]['findAll']({'where':{'sectionId':_0x1fd337['id']},'raw':!![]})[_0xcdbf('0x27')](function(_0x37c5d7){var _0x583ecd=[];if(_['isEmpty'](_0x37c5d7)){_0x583ecd=_['filter'](_0x46182f,function(_0x20af5b){if(_0x20af5b[_0xcdbf('0x58')]!==_0xcdbf('0x55')){return _0x20af5b;}});return _0x583ecd;}else{for(var _0x92e106=0x0;_0x92e106<_0x46182f[_0xcdbf('0x47')];_0x92e106++){var _0x5b8f1f=_0x46182f[_0x92e106];if(_0x5b8f1f[_0xcdbf('0x58')]===_0xcdbf('0x55')){var _0x27844b=_[_0xcdbf('0x49')](_0x37c5d7,function(_0x5d97b9){return _0x5d97b9[_0xcdbf('0x62')]===_0x5b8f1f['id'];});if(_0x27844b)_0x583ecd['push'](_0x5b8f1f);}else{_0x583ecd[_0xcdbf('0x63')](_0x5b8f1f);}}return _0x583ecd;}});}else{return _0x46182f;}}else{var _0x3fa553=_[_0xcdbf('0x3c')](_0x46182f,function(_0x2d8934){if(_0x2d8934['role']!==_0xcdbf('0x55')){return _0x2d8934;}});return _0x3fa553;}});}else{return _0x46182f;}}})['then'](function(_0x5ed73d){var _0x3a3f9b=[];if(_0x5ed73d){_0x3c06e1=_0x5ed73d;for(var _0x240b84=0x0;_0x240b84<_0x5ed73d[_0xcdbf('0x47')];_0x240b84+=0x1){_0x3c06e1[_0x240b84][_0xcdbf('0x4f')]=[];_0x3a3f9b[_0xcdbf('0x63')](db[_0xcdbf('0x2b')]['find']({'where':{'FromId':[_0x382bd9[_0xcdbf('0x56')]['id'],_0x5ed73d[_0x240b84]['id']],'ToId':[_0x382bd9['user']['id'],_0x5ed73d[_0x240b84]['id']],'ChatGroupId':null},'attributes':['id',_0xcdbf('0x51'),_0xcdbf('0x64'),_0xcdbf('0x65'),'read','body'],'order':qs[_0xcdbf('0x39')](_0xcdbf('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xcdbf('0x27')](wrapUser(_0x5ed73d[_0x240b84])));}return BPromise[_0xcdbf('0x67')](_0x3a3f9b);}return[];})[_0xcdbf('0x27')](function(_0x5cfb6d){return{'rows':_0x5cfb6d,'count':_0x5cfb6d['length']};})[_0xcdbf('0x27')](respondWithResult(_0x4d3120,null))[_0xcdbf('0x45')](handleError(_0x4d3120,null));};
\ No newline at end of file
+var _0x8f5a=['sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','body','params','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','admin','user','userpic','online','lastLoginAt','allowmessenger','sort','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0x8f5a,0xd5));var _0xa8f5=function(_0x338a0c,_0xd91210){_0x338a0c=_0x338a0c-0x0;var _0x19e594=_0x8f5a[_0x338a0c];return _0x19e594;};'use strict';var emlformat=require(_0xa8f5('0x0'));var rimraf=require(_0xa8f5('0x1'));var zipdir=require(_0xa8f5('0x2'));var jsonpatch=require(_0xa8f5('0x3'));var rp=require(_0xa8f5('0x4'));var moment=require(_0xa8f5('0x5'));var BPromise=require(_0xa8f5('0x6'));var Mustache=require('mustache');var util=require(_0xa8f5('0x7'));var path=require(_0xa8f5('0x8'));var sox=require(_0xa8f5('0x9'));var csv=require(_0xa8f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8f5('0xb'));var _=require(_0xa8f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa8f5('0xd'));var toCsv=require(_0xa8f5('0xa'));var querystring=require(_0xa8f5('0xe'));var Papa=require(_0xa8f5('0xf'));var Redis=require(_0xa8f5('0x10'));var authService=require(_0xa8f5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa8f5('0x12'));var hardwareService=require(_0xa8f5('0x13'));var logger=require(_0xa8f5('0x14'))(_0xa8f5('0x15'));var utils=require(_0xa8f5('0x16'));var config=require(_0xa8f5('0x17'));var licenseUtil=require(_0xa8f5('0x18'));var db=require(_0xa8f5('0x19'))['db'];config[_0xa8f5('0x1a')]=_[_0xa8f5('0x1b')](config[_0xa8f5('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xa8f5('0x1c'))(new Redis(config[_0xa8f5('0x1a')]));require(_0xa8f5('0x1d'))[_0xa8f5('0x1e')](socket);function respondWithStatusCode(_0x4bca60,_0x5a53f9){_0x5a53f9=_0x5a53f9||0xcc;return function(_0x57d1ea){if(_0x57d1ea){return _0x4bca60[_0xa8f5('0x1f')](_0x5a53f9);}return _0x4bca60[_0xa8f5('0x20')](_0x5a53f9)[_0xa8f5('0x21')]();};}function respondWithResult(_0xf0d6c8,_0xa8339c){_0xa8339c=_0xa8339c||0xc8;return function(_0x100f8c){if(_0x100f8c){return _0xf0d6c8[_0xa8f5('0x20')](_0xa8339c)[_0xa8f5('0x22')](_0x100f8c);}};}function respondWithFilteredResult(_0x1437f5,_0x180835){return function(_0xa702cc){if(_0xa702cc){var _0x2eed4b=typeof _0x180835[_0xa8f5('0x23')]===_0xa8f5('0x24')&&typeof _0x180835[_0xa8f5('0x25')]==='undefined';var _0x3a07be=_0xa702cc[_0xa8f5('0x26')];var _0x403a84=_0x2eed4b?0x0:_0x180835[_0xa8f5('0x23')];var _0x229be1=_0x2eed4b?_0xa702cc[_0xa8f5('0x26')]:_0x180835[_0xa8f5('0x23')]+_0x180835[_0xa8f5('0x25')];var _0x828cfe;if(_0x229be1>=_0x3a07be){_0x229be1=_0x3a07be;_0x828cfe=0xc8;}else{_0x828cfe=0xce;}_0x1437f5[_0xa8f5('0x20')](_0x828cfe);return _0x1437f5[_0xa8f5('0x27')](_0xa8f5('0x28'),_0x403a84+'-'+_0x229be1+'/'+_0x3a07be)[_0xa8f5('0x22')](_0xa702cc);}return null;};}function patchUpdates(_0x8a30b0){return function(_0x434341){try{jsonpatch[_0xa8f5('0x29')](_0x434341,_0x8a30b0,!![]);}catch(_0x3f9ecf){return BPromise[_0xa8f5('0x2a')](_0x3f9ecf);}return _0x434341[_0xa8f5('0x2b')]();};}function saveUpdates(_0x463867,_0x2f651f){return function(_0x542418){if(_0x542418){return _0x542418[_0xa8f5('0x2c')](_0x463867)['then'](function(_0x1f0023){return _0x1f0023;});}return null;};}function removeEntity(_0x1ba262,_0x14b7ca){return function(_0x422414){if(_0x422414){return _0x422414['destroy']()[_0xa8f5('0x2d')](function(){_0x1ba262['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cd0d5,_0x51b130){return function(_0x1c7cd6){if(!_0x1c7cd6){_0x3cd0d5[_0xa8f5('0x1f')](0x194);}return _0x1c7cd6;};}function handleError(_0x353673,_0x206975){_0x206975=_0x206975||0x1f4;return function(_0x8a7ad0){logger[_0xa8f5('0x2e')](_0x8a7ad0['stack']);if(_0x8a7ad0[_0xa8f5('0x2f')]){delete _0x8a7ad0[_0xa8f5('0x2f')];}_0x353673['status'](_0x206975)[_0xa8f5('0x30')](_0x8a7ad0);};}exports[_0xa8f5('0x31')]=function(_0x1c071d,_0x29b8d5){var _0x471775={},_0x17cb24={},_0x41b1f1={'count':0x0,'rows':[]};var _0x279b85=_[_0xa8f5('0x32')](db[_0xa8f5('0x33')][_0xa8f5('0x34')],function(_0x2627f1){return{'name':_0x2627f1['fieldName'],'type':_0x2627f1[_0xa8f5('0x35')][_0xa8f5('0x36')]};});_0x17cb24[_0xa8f5('0x37')]=_[_0xa8f5('0x32')](_0x279b85,_0xa8f5('0x2f'));_0x17cb24[_0xa8f5('0x38')]=_[_0xa8f5('0x39')](_0x1c071d[_0xa8f5('0x38')]);_0x17cb24[_0xa8f5('0x3a')]=_[_0xa8f5('0x3b')](_0x17cb24[_0xa8f5('0x37')],_0x17cb24['query']);_0x471775['attributes']=_[_0xa8f5('0x3b')](_0x17cb24[_0xa8f5('0x37')],qs['fields'](_0x1c071d[_0xa8f5('0x38')][_0xa8f5('0x3c')]));_0x471775[_0xa8f5('0x3d')]=_0x471775[_0xa8f5('0x3d')]['length']?_0x471775['attributes']:_0x17cb24[_0xa8f5('0x37')];if(!_0x1c071d[_0xa8f5('0x38')][_0xa8f5('0x3e')]('nolimit')){_0x471775[_0xa8f5('0x25')]=qs[_0xa8f5('0x25')](_0x1c071d[_0xa8f5('0x38')][_0xa8f5('0x25')]);_0x471775[_0xa8f5('0x23')]=qs[_0xa8f5('0x23')](_0x1c071d[_0xa8f5('0x38')][_0xa8f5('0x23')]);}_0x471775['order']=qs['sort'](_0x1c071d[_0xa8f5('0x38')]['sort']);_0x471775[_0xa8f5('0x3f')]=qs[_0xa8f5('0x3a')](_[_0xa8f5('0x40')](_0x1c071d['query'],_0x17cb24[_0xa8f5('0x3a')]),_0x279b85);if(_0x1c071d[_0xa8f5('0x38')][_0xa8f5('0x41')]){_0x471775[_0xa8f5('0x3f')]=_[_0xa8f5('0x42')](_0x471775[_0xa8f5('0x3f')],{'$or':_[_0xa8f5('0x32')](_0x279b85,function(_0x49e4a7){if(_0x49e4a7['type']!==_0xa8f5('0x43')){var _0x1f7646={};_0x1f7646[_0x49e4a7[_0xa8f5('0x2f')]]={'$like':'%'+_0x1c071d[_0xa8f5('0x38')][_0xa8f5('0x41')]+'%'};return _0x1f7646;}})});}_0x471775=_[_0xa8f5('0x42')]({},_0x471775,_0x1c071d[_0xa8f5('0x44')]);var _0x39c45b={'where':_0x471775['where']};return db[_0xa8f5('0x33')][_0xa8f5('0x26')](_0x39c45b)['then'](function(_0x449738){_0x41b1f1[_0xa8f5('0x26')]=_0x449738;if(_0x1c071d[_0xa8f5('0x38')][_0xa8f5('0x45')]){_0x471775['include']=[{'all':!![]}];}return db[_0xa8f5('0x33')]['findAll'](_0x471775);})[_0xa8f5('0x2d')](function(_0x184e98){_0x41b1f1[_0xa8f5('0x46')]=_0x184e98;return _0x41b1f1;})[_0xa8f5('0x2d')](respondWithFilteredResult(_0x29b8d5,_0x471775))[_0xa8f5('0x47')](handleError(_0x29b8d5,null));};exports[_0xa8f5('0x48')]=function(_0x47b6ec,_0xd9a62){var _0x187d11={'raw':!![],'where':{'id':_0x47b6ec['params']['id']}},_0x1a092c={};_0x1a092c[_0xa8f5('0x37')]=_[_0xa8f5('0x39')](db['ChatInternalMessage'][_0xa8f5('0x34')]);_0x1a092c[_0xa8f5('0x38')]=_[_0xa8f5('0x39')](_0x47b6ec['query']);_0x1a092c['filters']=_[_0xa8f5('0x3b')](_0x1a092c[_0xa8f5('0x37')],_0x1a092c[_0xa8f5('0x38')]);_0x187d11[_0xa8f5('0x3d')]=_[_0xa8f5('0x3b')](_0x1a092c[_0xa8f5('0x37')],qs[_0xa8f5('0x3c')](_0x47b6ec[_0xa8f5('0x38')][_0xa8f5('0x3c')]));_0x187d11[_0xa8f5('0x3d')]=_0x187d11[_0xa8f5('0x3d')][_0xa8f5('0x49')]?_0x187d11[_0xa8f5('0x3d')]:_0x1a092c[_0xa8f5('0x37')];if(_0x47b6ec[_0xa8f5('0x38')][_0xa8f5('0x45')]){_0x187d11[_0xa8f5('0x4a')]=[{'all':!![]}];}_0x187d11=_[_0xa8f5('0x42')]({},_0x187d11,_0x47b6ec['options']);return db[_0xa8f5('0x33')][_0xa8f5('0x4b')](_0x187d11)['then'](handleEntityNotFound(_0xd9a62,null))['then'](respondWithResult(_0xd9a62,null))[_0xa8f5('0x47')](handleError(_0xd9a62,null));};exports[_0xa8f5('0x4c')]=function(_0x24176c,_0x5cad96){return db['ChatInternalMessage']['create'](_0x24176c['body'],{})[_0xa8f5('0x2d')](respondWithResult(_0x5cad96,0xc9))[_0xa8f5('0x47')](handleError(_0x5cad96,null));};exports['update']=function(_0x3b5ee0,_0x563142){if(_0x3b5ee0[_0xa8f5('0x4d')]['id']){delete _0x3b5ee0['body']['id'];}return db[_0xa8f5('0x33')][_0xa8f5('0x4b')]({'where':{'id':_0x3b5ee0['params']['id']}})[_0xa8f5('0x2d')](handleEntityNotFound(_0x563142,null))[_0xa8f5('0x2d')](saveUpdates(_0x3b5ee0[_0xa8f5('0x4d')],null))['then'](respondWithResult(_0x563142,null))[_0xa8f5('0x47')](handleError(_0x563142,null));};exports['destroy']=function(_0x583158,_0x49c2a9){return db[_0xa8f5('0x33')][_0xa8f5('0x4b')]({'where':{'id':_0x583158[_0xa8f5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x49c2a9,null))[_0xa8f5('0x2d')](removeEntity(_0x49c2a9,null))['catch'](handleError(_0x49c2a9,null));};exports['describe']=function(_0x8069b4,_0x169bbd){return db[_0xa8f5('0x33')]['describe']()[_0xa8f5('0x2d')](respondWithResult(_0x169bbd,null))[_0xa8f5('0x47')](handleError(_0x169bbd,null));};function wrapUser(_0x15ee9e){return function(_0x5cd195){var _0x3e99a9=_0x15ee9e[_0xa8f5('0x4f')]({'plain':!![]});_0x3e99a9[_0xa8f5('0x50')]=[];if(_0x5cd195){_0x3e99a9[_0xa8f5('0x51')]=_0x5cd195[_0xa8f5('0x52')];_0x3e99a9[_0xa8f5('0x53')]=_0x5cd195;}else{_0x3e99a9[_0xa8f5('0x51')]=moment(0x0)[_0xa8f5('0x54')](_0xa8f5('0x55'));_0x3e99a9['lastMessage']={};}return _0x3e99a9;};}exports[_0xa8f5('0x56')]=function(_0x3405e9,_0x48c315,_0x3c509d){var _0x3c87fe=[];return db['User'][_0xa8f5('0x57')]({'where':{'role':['agent',_0xa8f5('0x58'),_0xa8f5('0x59')]},'attributes':['id','fullname','name','role',_0xa8f5('0x5a'),'internal',_0xa8f5('0x5b'),_0xa8f5('0x5c'),_0xa8f5('0x5d'),'showWebBar'],'order':qs[_0xa8f5('0x5e')]('-online'),'include':[{'model':db[_0xa8f5('0x5f')],'as':_0xa8f5('0x60'),'attributes':['id',_0xa8f5('0x2f'),_0xa8f5('0x35')],'through':{'attributes':[]}}]})[_0xa8f5('0x2d')](function(_0x1840bc){if(_0x1840bc){var _0x2416c2=_0x3405e9['user']['get']({'plain':!![]});if(!_0x2416c2)throw new Error(_0xa8f5('0x61'));if(_0x2416c2[_0xa8f5('0x62')]===_0xa8f5('0x59')){return db['UserProfileSection']['find']({'where':{'name':_0xa8f5('0x63'),'userProfileId':_0x2416c2[_0xa8f5('0x64')]},'raw':!![]})[_0xa8f5('0x2d')](function(_0x654a2c){if(_0x654a2c){if(_0x654a2c[_0xa8f5('0x65')]===0x0){return db[_0xa8f5('0x66')][_0xa8f5('0x57')]({'where':{'sectionId':_0x654a2c['id']},'raw':!![]})[_0xa8f5('0x2d')](function(_0x4a245f){var _0x134075=[];if(_[_0xa8f5('0x67')](_0x4a245f)){_0x134075=_[_0xa8f5('0x41')](_0x1840bc,function(_0x2ee20b){if(_0x2ee20b[_0xa8f5('0x62')]!==_0xa8f5('0x68')){return _0x2ee20b;}});return _0x134075;}else{for(var _0x26b054=0x0;_0x26b054<_0x1840bc[_0xa8f5('0x49')];_0x26b054++){var _0x4b7173=_0x1840bc[_0x26b054];if(_0x4b7173[_0xa8f5('0x62')]==='agent'){var _0x3e79e4=_[_0xa8f5('0x4b')](_0x4a245f,function(_0x3a1233){return _0x3a1233[_0xa8f5('0x69')]===_0x4b7173['id'];});if(_0x3e79e4)_0x134075[_0xa8f5('0x6a')](_0x4b7173);}else{_0x134075[_0xa8f5('0x6a')](_0x4b7173);}}return _0x134075;}});}else{return _0x1840bc;}}else{var _0x416265=_[_0xa8f5('0x41')](_0x1840bc,function(_0x1bf5bc){if(_0x1bf5bc['role']!=='agent'){return _0x1bf5bc;}});return _0x416265;}});}else{return _0x1840bc;}}})[_0xa8f5('0x2d')](function(_0x42c6d2){var _0x3bf2c1=[];if(_0x42c6d2){_0x3c87fe=_0x42c6d2;for(var _0x4df976=0x0;_0x4df976<_0x42c6d2['length'];_0x4df976+=0x1){_0x3c87fe[_0x4df976][_0xa8f5('0x50')]=[];_0x3bf2c1['push'](db[_0xa8f5('0x33')][_0xa8f5('0x4b')]({'where':{'FromId':[_0x3405e9[_0xa8f5('0x59')]['id'],_0x42c6d2[_0x4df976]['id']],'ToId':[_0x3405e9[_0xa8f5('0x59')]['id'],_0x42c6d2[_0x4df976]['id']],'ChatGroupId':null},'attributes':['id',_0xa8f5('0x52'),_0xa8f5('0x6b'),_0xa8f5('0x6c'),'read',_0xa8f5('0x4d')],'order':qs['sort'](_0xa8f5('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x42c6d2[_0x4df976])));}return BPromise[_0xa8f5('0x6e')](_0x3bf2c1);}return[];})[_0xa8f5('0x2d')](function(_0x2d8aed){return{'rows':_0x2d8aed,'count':_0x2d8aed[_0xa8f5('0x49')]};})['then'](respondWithResult(_0x48c315,null))[_0xa8f5('0x47')](handleError(_0x48c315,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 0dd436e..aec30b2 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 _0x2a39=['exports','events','ChatInternalMessage','update','remove','emit','hasOwnProperty','hook'];(function(_0x16e95b,_0x41ebba){var _0x160dcc=function(_0x28b933){while(--_0x28b933){_0x16e95b['push'](_0x16e95b['shift']());}};_0x160dcc(++_0x41ebba);}(_0x2a39,0x101));var _0x92a3=function(_0x187f4b,_0x12fd52){_0x187f4b=_0x187f4b-0x0;var _0x132087=_0x2a39[_0x187f4b];return _0x132087;};'use strict';var EventEmitter=require(_0x92a3('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x92a3('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x92a3('0x2'),'afterDestroy':_0x92a3('0x3')};function emitEvent(_0xa4280e){return function(_0x43f481,_0x128ac8,_0x3778aa){ChatInternalMessageEvents[_0x92a3('0x4')](_0xa4280e+':'+_0x43f481['id'],_0x43f481);ChatInternalMessageEvents[_0x92a3('0x4')](_0xa4280e,_0x43f481);_0x3778aa(null);};}for(var e in events){if(events[_0x92a3('0x5')](e)){var event=events[e];ChatInternalMessage[_0x92a3('0x6')](e,emitEvent(event));}}module[_0x92a3('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x9be8=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x46a30c,_0x6d3772){var _0xc5fbcd=function(_0x344280){while(--_0x344280){_0x46a30c['push'](_0x46a30c['shift']());}};_0xc5fbcd(++_0x6d3772);}(_0x9be8,0x103));var _0x89be=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9be8[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require(_0x89be('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x89be('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x89be('0x2')](0x0);var events={'afterCreate':_0x89be('0x3'),'afterUpdate':_0x89be('0x4'),'afterDestroy':_0x89be('0x5')};function emitEvent(_0x1436d5){return function(_0x2950d7,_0x58ac89,_0x23b134){ChatInternalMessageEvents['emit'](_0x1436d5+':'+_0x2950d7['id'],_0x2950d7);ChatInternalMessageEvents[_0x89be('0x6')](_0x1436d5,_0x2950d7);_0x23b134(null);};}for(var e in events){if(events[_0x89be('0x7')](e)){var event=events[e];ChatInternalMessage[_0x89be('0x8')](e,emitEvent(event));}}module[_0x89be('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index caa45b6..ccec92f 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 _0x1ff3=['utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x1ff3,0xd2));var _0x31ff=function(_0x234bbf,_0xac44ad){_0x234bbf=_0x234bbf-0x0;var _0x57b207=_0x1ff3[_0x234bbf];return _0x57b207;};'use strict';var _=require('lodash');var util=require(_0x31ff('0x0'));var logger=require(_0x31ff('0x1'))(_0x31ff('0x2'));var moment=require('moment');var BPromise=require(_0x31ff('0x3'));var rp=require(_0x31ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x31ff('0x5'));module[_0x31ff('0x6')]=function(_0x3a6786,_0x294cbd){return _0x3a6786['define'](_0x31ff('0x7'),attributes,{'tableName':_0x31ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x31ff('0x9'),'collate':_0x31ff('0xa')});};
\ No newline at end of file
+var _0x322c=['../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x490046,_0x293a0e){var _0x13233f=function(_0x3640c4){while(--_0x3640c4){_0x490046['push'](_0x490046['shift']());}};_0x13233f(++_0x293a0e);}(_0x322c,0xe7));var _0xc322=function(_0x4a2037,_0x157834){_0x4a2037=_0x4a2037-0x0;var _0x1b2838=_0x322c[_0x4a2037];return _0x1b2838;};'use strict';var _=require(_0xc322('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc322('0x1'));var moment=require(_0xc322('0x2'));var BPromise=require(_0xc322('0x3'));var rp=require(_0xc322('0x4'));var fs=require('fs');var path=require(_0xc322('0x5'));var rimraf=require(_0xc322('0x6'));var config=require(_0xc322('0x7'));var attributes=require(_0xc322('0x8'));module[_0xc322('0x9')]=function(_0x868c5a,_0x3f5daf){return _0x868c5a[_0xc322('0xa')]('ChatInternalMessage',attributes,{'tableName':_0xc322('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc322('0xc'),'collate':_0xc322('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 652a3ac..ec1b3fb 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 _0xfec2=['stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x32f940,_0x2fc9ef){var _0x1a8feb=function(_0x2f27a0){while(--_0x2f27a0){_0x32f940['push'](_0x32f940['shift']());}};_0x1a8feb(++_0x2fc9ef);}(_0xfec2,0x17c));var _0x2fec=function(_0x62fc86,_0x5b7a30){_0x62fc86=_0x62fc86-0x0;var _0x29f9fe=_0xfec2[_0x62fc86];return _0x29f9fe;};'use strict';var _=require('lodash');var util=require(_0x2fec('0x0'));var moment=require(_0x2fec('0x1'));var BPromise=require('bluebird');var rs=require(_0x2fec('0x2'));var fs=require('fs');var Redis=require(_0x2fec('0x3'));var db=require(_0x2fec('0x4'))['db'];var utils=require(_0x2fec('0x5'));var logger=require(_0x2fec('0x6'))('rpc');var config=require(_0x2fec('0x7'));var jayson=require(_0x2fec('0x8'));var client=jayson[_0x2fec('0x9')][_0x2fec('0xa')]({'port':0x232a});config['redis']=_[_0x2fec('0xb')](config['redis'],{'host':_0x2fec('0xc'),'port':0x18eb});var socket=require(_0x2fec('0xd'))(new Redis(config[_0x2fec('0xe')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x426ff0,_0x169b4c,_0x13fafa){return new BPromise(function(_0x358220,_0x3349e7){return client[_0x2fec('0xf')](_0x426ff0,_0x13fafa)['then'](function(_0x34a041){logger[_0x2fec('0x10')](_0x2fec('0x11'),_0x169b4c,_0x2fec('0x12'));logger[_0x2fec('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x169b4c,_0x2fec('0x12'),JSON[_0x2fec('0x14')](_0x34a041));if(_0x34a041[_0x2fec('0x15')]){if(_0x34a041[_0x2fec('0x15')][_0x2fec('0x16')]===0x1f4){logger['error'](_0x2fec('0x11'),_0x169b4c,_0x34a041[_0x2fec('0x15')]['message']);return _0x3349e7(_0x34a041[_0x2fec('0x15')][_0x2fec('0x17')]);}logger['error'](_0x2fec('0x11'),_0x169b4c,_0x34a041['error'][_0x2fec('0x17')]);return _0x358220(_0x34a041[_0x2fec('0x15')][_0x2fec('0x17')]);}else{logger[_0x2fec('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x169b4c,_0x2fec('0x12'));_0x358220(_0x34a041['result']['message']);}})[_0x2fec('0x18')](function(_0x15c4dd){logger['error'](_0x2fec('0x11'),_0x169b4c,_0x15c4dd);_0x3349e7(_0x15c4dd);});});}
\ No newline at end of file
+var _0xea52=['code','message','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0xea52,0x162));var _0x2ea5=function(_0x381f21,_0x5dea54){_0x381f21=_0x381f21-0x0;var _0x45f14b=_0xea52[_0x381f21];return _0x45f14b;};'use strict';var _=require('lodash');var util=require(_0x2ea5('0x0'));var moment=require(_0x2ea5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2ea5('0x2'));var logger=require(_0x2ea5('0x3'))(_0x2ea5('0x4'));var config=require(_0x2ea5('0x5'));var jayson=require(_0x2ea5('0x6'));var client=jayson['client'][_0x2ea5('0x7')]({'port':0x232a});config[_0x2ea5('0x8')]=_[_0x2ea5('0x9')](config[_0x2ea5('0x8')],{'host':_0x2ea5('0xa'),'port':0x18eb});var socket=require(_0x2ea5('0xb'))(new Redis(config['redis']));require(_0x2ea5('0xc'))[_0x2ea5('0xd')](socket);function respondWithRpcPromise(_0x1107ef,_0x1f2a52,_0x462fbc){return new BPromise(function(_0x42916a,_0x5a3afd){return client[_0x2ea5('0xe')](_0x1107ef,_0x462fbc)[_0x2ea5('0xf')](function(_0x543d45){logger[_0x2ea5('0x10')](_0x2ea5('0x11'),_0x1f2a52,_0x2ea5('0x12'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1f2a52,_0x2ea5('0x12'),JSON[_0x2ea5('0x13')](_0x543d45));if(_0x543d45[_0x2ea5('0x14')]){if(_0x543d45[_0x2ea5('0x14')][_0x2ea5('0x15')]===0x1f4){logger[_0x2ea5('0x14')](_0x2ea5('0x11'),_0x1f2a52,_0x543d45['error'][_0x2ea5('0x16')]);return _0x5a3afd(_0x543d45[_0x2ea5('0x14')][_0x2ea5('0x16')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1f2a52,_0x543d45[_0x2ea5('0x14')][_0x2ea5('0x16')]);return _0x42916a(_0x543d45[_0x2ea5('0x14')][_0x2ea5('0x16')]);}else{logger[_0x2ea5('0x10')](_0x2ea5('0x11'),_0x1f2a52,'request\x20sent');_0x42916a(_0x543d45[_0x2ea5('0x17')][_0x2ea5('0x16')]);}})[_0x2ea5('0x18')](function(_0x49a43d){logger[_0x2ea5('0x14')](_0x2ea5('0x11'),_0x1f2a52,_0x49a43d);_0x5a3afd(_0x49a43d);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 5ca23bf..be86573 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 _0x7ce4=['./chatInternalMessage.events','update','emit','length','chatInternalMessage:'];(function(_0x257852,_0x7ab85){var _0x3a278c=function(_0xec50da){while(--_0xec50da){_0x257852['push'](_0x257852['shift']());}};_0x3a278c(++_0x7ab85);}(_0x7ce4,0x181));var _0x47ce=function(_0x235f5a,_0x5425a1){_0x235f5a=_0x235f5a-0x0;var _0x2fc979=_0x7ce4[_0x235f5a];return _0x2fc979;};'use strict';var ChatInternalMessageEvents=require(_0x47ce('0x0'));var events=['save','remove',_0x47ce('0x1')];function createListener(_0x36ec6e,_0x4f008e){return function(_0x1c167a){_0x4f008e[_0x47ce('0x2')](_0x36ec6e,_0x1c167a);};}function removeListener(_0x23769d,_0x472092){return function(){ChatInternalMessageEvents['removeListener'](_0x23769d,_0x472092);};}exports['register']=function(_0x5cf098){for(var _0x3ba1dd=0x0,_0x214195=events[_0x47ce('0x3')];_0x3ba1dd<_0x214195;_0x3ba1dd++){var _0x3540f5=events[_0x3ba1dd];var _0x55f59e=createListener(_0x47ce('0x4')+_0x3540f5,_0x5cf098);ChatInternalMessageEvents['on'](_0x3540f5,_0x55f59e);}};
\ No newline at end of file
+var _0x59a4=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x150c65,_0x303f38){var _0x4ca489=function(_0x2c2e26){while(--_0x2c2e26){_0x150c65['push'](_0x150c65['shift']());}};_0x4ca489(++_0x303f38);}(_0x59a4,0x101));var _0x459a=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0x59a4[_0x305c31];return _0x17f39f;};'use strict';var ChatInternalMessageEvents=require(_0x459a('0x0'));var events=['save',_0x459a('0x1'),_0x459a('0x2')];function createListener(_0x63b68a,_0x1ee4a7){return function(_0x1fc099){_0x1ee4a7[_0x459a('0x3')](_0x63b68a,_0x1fc099);};}function removeListener(_0x4df779,_0x4e7402){return function(){ChatInternalMessageEvents[_0x459a('0x4')](_0x4df779,_0x4e7402);};}exports[_0x459a('0x5')]=function(_0x40c671){for(var _0x3dfc50=0x0,_0x128ff7=events['length'];_0x3dfc50<_0x128ff7;_0x3dfc50++){var _0x394a9b=events[_0x3dfc50];var _0x4a0c6c=createListener(_0x459a('0x6')+_0x394a9b,_0x40c671);ChatInternalMessageEvents['on'](_0x394a9b,_0x4a0c6c);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 6a9b848..631dcda 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 _0xc077=['getUsers','/:id','show','post','put','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/users'];(function(_0x3d4ace,_0x568c73){var _0x47c799=function(_0x57d9ca){while(--_0x57d9ca){_0x3d4ace['push'](_0x3d4ace['shift']());}};_0x47c799(++_0x568c73);}(_0xc077,0x197));var _0x7c07=function(_0x208749,_0x2b7b66){_0x208749=_0x208749-0x0;var _0x3e0042=_0xc077[_0x208749];return _0x3e0042;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7c07('0x0'));var timeout=require(_0x7c07('0x1'));var express=require(_0x7c07('0x2'));var router=express['Router']();var fs_extra=require(_0x7c07('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7c07('0x4'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x7c07('0x5')]('/',auth['isAuthenticated'](),controller[_0x7c07('0x6')]);router[_0x7c07('0x5')](_0x7c07('0x7'),auth[_0x7c07('0x8')](),controller[_0x7c07('0x9')]);router[_0x7c07('0x5')](_0x7c07('0xa'),auth[_0x7c07('0x8')](),controller[_0x7c07('0xb')]);router[_0x7c07('0x5')](_0x7c07('0xc'),auth[_0x7c07('0x8')](),controller[_0x7c07('0xd')]);router[_0x7c07('0xe')]('/',auth[_0x7c07('0x8')](),controller['create']);router[_0x7c07('0xf')](_0x7c07('0xc'),controller[_0x7c07('0x10')]);router[_0x7c07('0x11')](_0x7c07('0xc'),auth[_0x7c07('0x8')](),controller['destroy']);module[_0x7c07('0x12')]=router;
\ No newline at end of file
+var _0x7bf8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','getUsers','/:id','post','create','update','delete','multer','util','path','connect-timeout','express'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x7bf8,0xb9));var _0x87bf=function(_0x42a945,_0x1afb1b){_0x42a945=_0x42a945-0x0;var _0x1d2fee=_0x7bf8[_0x42a945];return _0x1d2fee;};'use strict';var multer=require(_0x87bf('0x0'));var util=require(_0x87bf('0x1'));var path=require(_0x87bf('0x2'));var timeout=require(_0x87bf('0x3'));var express=require(_0x87bf('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x87bf('0x5'));var interaction=require(_0x87bf('0x6'));var config=require(_0x87bf('0x7'));var controller=require(_0x87bf('0x8'));router[_0x87bf('0x9')]('/',auth['isAuthenticated'](),controller[_0x87bf('0xa')]);router[_0x87bf('0x9')](_0x87bf('0xb'),auth[_0x87bf('0xc')](),controller['describe']);router[_0x87bf('0x9')]('/users',auth[_0x87bf('0xc')](),controller[_0x87bf('0xd')]);router[_0x87bf('0x9')](_0x87bf('0xe'),auth[_0x87bf('0xc')](),controller['show']);router[_0x87bf('0xf')]('/',auth[_0x87bf('0xc')](),controller[_0x87bf('0x10')]);router['put']('/:id',controller[_0x87bf('0x11')]);router[_0x87bf('0x12')](_0x87bf('0xe'),auth[_0x87bf('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 989a88f..0c1e9bc 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 _0x02a7=['medium','BOOLEAN','ENUM','out','DATE','STRING','exports','TEXT'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x02a7,0x1a6));var _0x702a=function(_0x437e28,_0x504535){_0x437e28=_0x437e28-0x0;var _0x39dc81=_0x02a7[_0x437e28];return _0x39dc81;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'body':{'type':Sequelize[_0x702a('0x1')](_0x702a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x702a('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x702a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x702a('0x4')]('in',_0x702a('0x5')),'defaultValue':_0x702a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x702a('0x6')]},'providerName':{'type':Sequelize[_0x702a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x3266=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3ea8b7,_0xf567a0){var _0x4ca438=function(_0x58f233){while(--_0x58f233){_0x3ea8b7['push'](_0x3ea8b7['shift']());}};_0x4ca438(++_0xf567a0);}(_0x3266,0x6a));var _0x6326=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x3266[_0x5eaa0b];return _0x28b295;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'body':{'type':Sequelize[_0x6326('0x2')](_0x6326('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6326('0x5')]('in',_0x6326('0x6')),'defaultValue':_0x6326('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6326('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 797a5a9..c5faeab 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 _0xdf6b=['params','includeAll','options','find','create','body','describe','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','reject','chat','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','rejectmessage','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','destroy','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','ChatMessage','include','findAll','show'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xdf6b,0x138));var _0xbdf6=function(_0x2ce5af,_0x487e0a){_0x2ce5af=_0x2ce5af-0x0;var _0x19fbb8=_0xdf6b[_0x2ce5af];return _0x19fbb8;};'use strict';var emlformat=require(_0xbdf6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbdf6('0x1'));var rp=require('request-promise');var moment=require(_0xbdf6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbdf6('0x3'));var util=require(_0xbdf6('0x4'));var path=require(_0xbdf6('0x5'));var sox=require(_0xbdf6('0x6'));var csv=require(_0xbdf6('0x7'));var ejs=require(_0xbdf6('0x8'));var fs=require('fs');var fs_extra=require(_0xbdf6('0x9'));var _=require(_0xbdf6('0xa'));var squel=require(_0xbdf6('0xb'));var crypto=require(_0xbdf6('0xc'));var jsforce=require(_0xbdf6('0xd'));var deskjs=require(_0xbdf6('0xe'));var toCsv=require(_0xbdf6('0x7'));var querystring=require(_0xbdf6('0xf'));var Papa=require(_0xbdf6('0x10'));var Redis=require(_0xbdf6('0x11'));var authService=require(_0xbdf6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbdf6('0x13'));var hardwareService=require(_0xbdf6('0x14'));var logger=require(_0xbdf6('0x15'))(_0xbdf6('0x16'));var utils=require(_0xbdf6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbdf6('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbdf6('0x19')](config[_0xbdf6('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbdf6('0x1b'))[_0xbdf6('0x1c')](socket);var jayson=require(_0xbdf6('0x1d'));var client=jayson[_0xbdf6('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xbdf6('0x1e')][_0xbdf6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x42d471,_0x4d23e5,_0x405680,_0x5e952a){return new BPromise(function(_0xb116ca,_0xca4faf){var _0x462fd0=_0x5e952a||client;return _0x462fd0[_0xbdf6('0x20')](_0x42d471,_0x405680)[_0xbdf6('0x21')](function(_0x509d5d){logger['info'](_0xbdf6('0x22'),_0x4d23e5,'request\x20sent');logger[_0xbdf6('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4d23e5,_0xbdf6('0x24'),JSON[_0xbdf6('0x25')](_0x509d5d));if(_0x509d5d['error']){if(_0x509d5d['error']['code']===0x1f4){logger[_0xbdf6('0x26')](_0xbdf6('0x22'),_0x4d23e5,_0x509d5d[_0xbdf6('0x26')]['message']);return _0xca4faf(_0x509d5d[_0xbdf6('0x26')][_0xbdf6('0x27')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4d23e5,_0x509d5d[_0xbdf6('0x26')][_0xbdf6('0x27')]);return _0xb116ca(_0x509d5d[_0xbdf6('0x26')][_0xbdf6('0x27')]);}else{logger[_0xbdf6('0x28')](_0xbdf6('0x22'),_0x4d23e5,_0xbdf6('0x24'));_0xb116ca(_0x509d5d[_0xbdf6('0x29')][_0xbdf6('0x27')]);}})[_0xbdf6('0x2a')](function(_0x175c94){logger['error'](_0xbdf6('0x22'),_0x4d23e5,_0x175c94);_0xca4faf(_0x175c94);});});}function respondWithStatusCode(_0x439056,_0x257ee3){_0x257ee3=_0x257ee3||0xcc;return function(_0x4b4cc6){if(_0x4b4cc6){return _0x439056[_0xbdf6('0x2b')](_0x257ee3);}return _0x439056[_0xbdf6('0x2c')](_0x257ee3)['end']();};}function respondWithResult(_0x2afc52,_0x3aa135){_0x3aa135=_0x3aa135||0xc8;return function(_0x1ab404){if(_0x1ab404){return _0x2afc52[_0xbdf6('0x2c')](_0x3aa135)[_0xbdf6('0x2d')](_0x1ab404);}};}function respondWithFilteredResult(_0x105bcd,_0x44b3fd){return function(_0x32db27){if(_0x32db27){var _0x4d2736=typeof _0x44b3fd['offset']===_0xbdf6('0x2e')&&typeof _0x44b3fd['limit']===_0xbdf6('0x2e');var _0xc2e368=_0x32db27['count'];var _0x40fe6e=_0x4d2736?0x0:_0x44b3fd[_0xbdf6('0x2f')];var _0x58e939=_0x4d2736?_0x32db27[_0xbdf6('0x30')]:_0x44b3fd[_0xbdf6('0x2f')]+_0x44b3fd[_0xbdf6('0x31')];var _0x2d0c9e;if(_0x58e939>=_0xc2e368){_0x58e939=_0xc2e368;_0x2d0c9e=0xc8;}else{_0x2d0c9e=0xce;}_0x105bcd[_0xbdf6('0x2c')](_0x2d0c9e);return _0x105bcd[_0xbdf6('0x32')](_0xbdf6('0x33'),_0x40fe6e+'-'+_0x58e939+'/'+_0xc2e368)[_0xbdf6('0x2d')](_0x32db27);}return null;};}function patchUpdates(_0x15f1ac){return function(_0x378004){try{jsonpatch[_0xbdf6('0x34')](_0x378004,_0x15f1ac,!![]);}catch(_0x47b274){return BPromise['reject'](_0x47b274);}return _0x378004[_0xbdf6('0x35')]();};}function saveUpdates(_0xb22843,_0x5132b3){return function(_0x2a4757){if(_0x2a4757){return _0x2a4757[_0xbdf6('0x36')](_0xb22843)['then'](function(_0x10e721){return _0x10e721;});}return null;};}function removeEntity(_0x2baee4,_0x1f671f){return function(_0x409190){if(_0x409190){return _0x409190[_0xbdf6('0x37')]()['then'](function(){_0x2baee4[_0xbdf6('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x249139,_0x2c1c4f){return function(_0x2fdc0f){if(!_0x2fdc0f){_0x249139['sendStatus'](0x194);}return _0x2fdc0f;};}function handleError(_0xbd2ca6,_0x1ce7d5){_0x1ce7d5=_0x1ce7d5||0x1f4;return function(_0x366303){logger[_0xbdf6('0x26')](_0x366303['stack']);if(_0x366303[_0xbdf6('0x38')]){delete _0x366303[_0xbdf6('0x38')];}_0xbd2ca6[_0xbdf6('0x2c')](_0x1ce7d5)[_0xbdf6('0x39')](_0x366303);};}exports['index']=function(_0x10d21c,_0x4d5ff9){var _0x5a6966={},_0x58182e={},_0x1ac365={'count':0x0,'rows':[]};var _0xa3b4a=_[_0xbdf6('0x3a')](db['ChatMessage'][_0xbdf6('0x3b')],function(_0x102365){return{'name':_0x102365[_0xbdf6('0x3c')],'type':_0x102365[_0xbdf6('0x3d')][_0xbdf6('0x3e')]};});_0x58182e[_0xbdf6('0x3f')]=_[_0xbdf6('0x3a')](_0xa3b4a,'name');_0x58182e[_0xbdf6('0x40')]=_[_0xbdf6('0x41')](_0x10d21c[_0xbdf6('0x40')]);_0x58182e[_0xbdf6('0x42')]=_[_0xbdf6('0x43')](_0x58182e[_0xbdf6('0x3f')],_0x58182e['query']);_0x5a6966['attributes']=_[_0xbdf6('0x43')](_0x58182e[_0xbdf6('0x3f')],qs[_0xbdf6('0x44')](_0x10d21c[_0xbdf6('0x40')][_0xbdf6('0x44')]));_0x5a6966[_0xbdf6('0x45')]=_0x5a6966[_0xbdf6('0x45')][_0xbdf6('0x46')]?_0x5a6966[_0xbdf6('0x45')]:_0x58182e[_0xbdf6('0x3f')];if(!_0x10d21c[_0xbdf6('0x40')]['hasOwnProperty']('nolimit')){_0x5a6966[_0xbdf6('0x31')]=qs[_0xbdf6('0x31')](_0x10d21c[_0xbdf6('0x40')]['limit']);_0x5a6966[_0xbdf6('0x2f')]=qs['offset'](_0x10d21c[_0xbdf6('0x40')]['offset']);}_0x5a6966[_0xbdf6('0x47')]=qs[_0xbdf6('0x48')](_0x10d21c[_0xbdf6('0x40')][_0xbdf6('0x48')]);_0x5a6966[_0xbdf6('0x49')]=qs[_0xbdf6('0x42')](_[_0xbdf6('0x4a')](_0x10d21c[_0xbdf6('0x40')],_0x58182e[_0xbdf6('0x42')]),_0xa3b4a);if(_0x10d21c['query']['filter']){_0x5a6966[_0xbdf6('0x49')]=_[_0xbdf6('0x4b')](_0x5a6966[_0xbdf6('0x49')],{'$or':_[_0xbdf6('0x3a')](_0xa3b4a,function(_0x3d0deb){if(_0x3d0deb[_0xbdf6('0x3d')]!==_0xbdf6('0x4c')){var _0x35eea4={};_0x35eea4[_0x3d0deb[_0xbdf6('0x38')]]={'$like':'%'+_0x10d21c[_0xbdf6('0x40')]['filter']+'%'};return _0x35eea4;}})});}_0x5a6966=_[_0xbdf6('0x4b')]({},_0x5a6966,_0x10d21c['options']);var _0x498b5a={'where':_0x5a6966[_0xbdf6('0x49')]};return db[_0xbdf6('0x4d')]['count'](_0x498b5a)[_0xbdf6('0x21')](function(_0x39d9fa){_0x1ac365[_0xbdf6('0x30')]=_0x39d9fa;if(_0x10d21c[_0xbdf6('0x40')]['includeAll']){_0x5a6966[_0xbdf6('0x4e')]=[{'all':!![]}];}return db['ChatMessage'][_0xbdf6('0x4f')](_0x5a6966);})[_0xbdf6('0x21')](function(_0x18a899){_0x1ac365['rows']=_0x18a899;return _0x1ac365;})[_0xbdf6('0x21')](respondWithFilteredResult(_0x4d5ff9,_0x5a6966))['catch'](handleError(_0x4d5ff9,null));};exports[_0xbdf6('0x50')]=function(_0x1dfbba,_0x48dffa){var _0x356f78={'raw':!![],'where':{'id':_0x1dfbba[_0xbdf6('0x51')]['id']}},_0xd97653={};_0xd97653[_0xbdf6('0x3f')]=_[_0xbdf6('0x41')](db['ChatMessage']['rawAttributes']);_0xd97653[_0xbdf6('0x40')]=_[_0xbdf6('0x41')](_0x1dfbba['query']);_0xd97653[_0xbdf6('0x42')]=_[_0xbdf6('0x43')](_0xd97653[_0xbdf6('0x3f')],_0xd97653[_0xbdf6('0x40')]);_0x356f78[_0xbdf6('0x45')]=_[_0xbdf6('0x43')](_0xd97653[_0xbdf6('0x3f')],qs[_0xbdf6('0x44')](_0x1dfbba['query']['fields']));_0x356f78['attributes']=_0x356f78[_0xbdf6('0x45')][_0xbdf6('0x46')]?_0x356f78[_0xbdf6('0x45')]:_0xd97653[_0xbdf6('0x3f')];if(_0x1dfbba[_0xbdf6('0x40')][_0xbdf6('0x52')]){_0x356f78[_0xbdf6('0x4e')]=[{'all':!![]}];}_0x356f78=_['merge']({},_0x356f78,_0x1dfbba[_0xbdf6('0x53')]);return db['ChatMessage'][_0xbdf6('0x54')](_0x356f78)[_0xbdf6('0x21')](handleEntityNotFound(_0x48dffa,null))[_0xbdf6('0x21')](respondWithResult(_0x48dffa,null))[_0xbdf6('0x2a')](handleError(_0x48dffa,null));};exports['create']=function(_0x2bad72,_0x612b62){return db[_0xbdf6('0x4d')][_0xbdf6('0x55')](_0x2bad72[_0xbdf6('0x56')],{})[_0xbdf6('0x21')](respondWithResult(_0x612b62,0xc9))[_0xbdf6('0x2a')](handleError(_0x612b62,null));};exports[_0xbdf6('0x36')]=function(_0x187919,_0x62865f){if(_0x187919[_0xbdf6('0x56')]['id']){delete _0x187919[_0xbdf6('0x56')]['id'];}return db[_0xbdf6('0x4d')][_0xbdf6('0x54')]({'where':{'id':_0x187919[_0xbdf6('0x51')]['id']}})['then'](handleEntityNotFound(_0x62865f,null))[_0xbdf6('0x21')](saveUpdates(_0x187919[_0xbdf6('0x56')],null))['then'](respondWithResult(_0x62865f,null))['catch'](handleError(_0x62865f,null));};exports[_0xbdf6('0x37')]=function(_0x28e0b7,_0x17ab28){return db[_0xbdf6('0x4d')][_0xbdf6('0x54')]({'where':{'id':_0x28e0b7['params']['id']}})[_0xbdf6('0x21')](handleEntityNotFound(_0x17ab28,null))[_0xbdf6('0x21')](removeEntity(_0x17ab28,null))['catch'](handleError(_0x17ab28,null));};exports[_0xbdf6('0x57')]=function(_0x9296a4,_0x118646){return db[_0xbdf6('0x4d')]['describe']()[_0xbdf6('0x21')](respondWithResult(_0x118646,null))[_0xbdf6('0x2a')](handleError(_0x118646,null));};var interaction_log=require(_0xbdf6('0x15'))('chat-interactions');exports['accept']=function(_0x4718b4,_0x44d815,_0x350f06){var _0x4e205d={'agent':{},'channel':'chat'};if(_0x4718b4[_0xbdf6('0x56')]['id']){delete _0x4718b4[_0xbdf6('0x56')]['id'];}_0x4718b4[_0xbdf6('0x56')][_0xbdf6('0x58')]=!![];_0x4718b4['body'][_0xbdf6('0x59')]=moment()['format'](_0xbdf6('0x5a'));_0x4718b4['body'][_0xbdf6('0x5b')]=_0x4718b4[_0xbdf6('0x56')][_0xbdf6('0x5b')]||_0x4718b4[_0xbdf6('0x5c')]['id'];_0x4e205d['agent']['id']=_0x4718b4[_0xbdf6('0x56')][_0xbdf6('0x5b')];return db[_0xbdf6('0x4d')][_0xbdf6('0x54')]({'where':{'id':_0x4718b4[_0xbdf6('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x44d815,null))[_0xbdf6('0x21')](saveUpdates(_0x4718b4[_0xbdf6('0x56')],null))[_0xbdf6('0x21')](function(_0x20930a){if(_0x20930a){_0x4e205d[_0xbdf6('0x27')]=_0x20930a[_0xbdf6('0x5d')]({'plain':!![]});return db[_0xbdf6('0x5e')][_0xbdf6('0x54')]({'where':{'id':_0x20930a['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x44d815,null))[_0xbdf6('0x21')](function(_0x5ea94e){if(_0x5ea94e){return _0x5ea94e[_0xbdf6('0x36')]({'UserId':_0x4718b4[_0xbdf6('0x56')]['UserId'],'read1stAt':_[_0xbdf6('0x5f')](_0x5ea94e[_0xbdf6('0x60')])?moment()[_0xbdf6('0x61')](_0xbdf6('0x5a')):undefined});}return null;})['then'](function(_0x2f73b7){if(_0x2f73b7){_0x4e205d[_0xbdf6('0x62')]=_0x2f73b7[_0xbdf6('0x5d')]({'plain':!![]});interaction_log['info'](_0xbdf6('0x63'),_0x4718b4[_0xbdf6('0x5c')]['id'],_0x4718b4[_0xbdf6('0x5c')][_0xbdf6('0x38')],_0x4718b4[_0xbdf6('0x5c')][_0xbdf6('0x64')],_0x4e205d[_0xbdf6('0x62')]['id'],_0x4718b4[_0xbdf6('0x56')]?JSON[_0xbdf6('0x25')](_0x4718b4['body']):_0xbdf6('0x65'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x4e205d);}return null;})[_0xbdf6('0x21')](function(_0x2e3e3c){var _0x38f7d9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e3e3c[_0xbdf6('0x27')][_0xbdf6('0x66')];return db[_0xbdf6('0x67')][_0xbdf6('0x40')](_0x38f7d9,{'type':db[_0xbdf6('0x68')][_0xbdf6('0x69')][_0xbdf6('0x6a')],'raw':!![]})[_0xbdf6('0x21')](function(_0x43d707){return _0x43d707;});})[_0xbdf6('0x21')](function(_0xc0732){if(_0xc0732){_0x4e205d[_0xbdf6('0x27')][_0xbdf6('0x6b')]=_0xc0732[0x0];if(!_0x4718b4[_0xbdf6('0x56')]['UserId'])return;return db[_0xbdf6('0x6c')][_0xbdf6('0x54')]({'where':{'id':_0x4718b4[_0xbdf6('0x56')][_0xbdf6('0x5b')],'role':_0xbdf6('0x6d')},'attributes':['id',_0xbdf6('0x38'),_0xbdf6('0x6e'),'email',_0xbdf6('0x6f')],'raw':!![]});}return null;})['then'](function(_0x498404){if(!_0x498404)return null;_0x4e205d[_0xbdf6('0x27')][_0xbdf6('0x6d')]=_0x498404;return _0x4e205d;})[_0xbdf6('0x21')](function(_0x18eeae){if(_0x18eeae){if(_0x4718b4[_0xbdf6('0x56')][_0xbdf6('0x70')]){_0x4e205d['message'][_0xbdf6('0x71')]=util[_0xbdf6('0x61')](_0xbdf6('0x72'),_0x4718b4['user']['name']);_0x4e205d[_0xbdf6('0x27')]['channel']=_0x4e205d[_0xbdf6('0x73')];_0x4e205d[_0xbdf6('0x27')][_0xbdf6('0x74')]=_0x4e205d[_0xbdf6('0x73')];_0x4e205d[_0xbdf6('0x27')][_0xbdf6('0x75')]=_0xbdf6('0x76');return respondWithRpcPromise(_0xbdf6('0x77'),_0xbdf6('0x77'),{'event':_0xbdf6('0x78'),'message':_[_0xbdf6('0x4b')](_0x4e205d[_0xbdf6('0x27')],JSON[_0xbdf6('0x79')](_0x4e205d[_0xbdf6('0x62')]['formData']))},client9002)['then'](function(){return _0x4e205d;});}return _0x4e205d;}return null;})[_0xbdf6('0x21')](respondWithResult(_0x44d815,null))[_0xbdf6('0x2a')](handleError(_0x44d815,null));};var interaction_log=require(_0xbdf6('0x15'))('chat-interactions');exports[_0xbdf6('0x7a')]=function(_0x1cf53e,_0x3cec00,_0x479db6){var _0x183fd1={'agent':{},'channel':_0xbdf6('0x7b')};if(_0x1cf53e[_0xbdf6('0x56')]['id']){delete _0x1cf53e['body']['id'];}_0x1cf53e[_0xbdf6('0x56')]['UserId']=_0x1cf53e[_0xbdf6('0x56')]['UserId']||_0x1cf53e[_0xbdf6('0x5c')]['id'];_0x183fd1[_0xbdf6('0x6d')]['id']=_0x1cf53e[_0xbdf6('0x56')]['UserId'];return db[_0xbdf6('0x4d')]['find']({'where':{'id':_0x1cf53e[_0xbdf6('0x51')]['id'],'UserId':null}})[_0xbdf6('0x21')](handleEntityNotFound(_0x3cec00,null))[_0xbdf6('0x21')](function(_0x1d2225){if(_0x1d2225){_0x183fd1[_0xbdf6('0x27')]=_0x1d2225[_0xbdf6('0x5d')]({'plain':!![]});return db['ChatInteraction'][_0xbdf6('0x54')]({'where':{'id':_0x1d2225[_0xbdf6('0x7c')]}});}return null;})['then'](handleEntityNotFound(_0x3cec00,null))[_0xbdf6('0x21')](function(_0x4e3d26){if(_0x4e3d26){_0x183fd1[_0xbdf6('0x62')]=_0x4e3d26[_0xbdf6('0x5d')]({'plain':!![]});interaction_log[_0xbdf6('0x28')](_0xbdf6('0x7d'),_0x1cf53e[_0xbdf6('0x5c')]['id'],_0x1cf53e['user'][_0xbdf6('0x38')],_0x1cf53e['user'][_0xbdf6('0x64')],_0x183fd1[_0xbdf6('0x62')]['id'],_0x1cf53e[_0xbdf6('0x56')]?JSON[_0xbdf6('0x25')](_0x1cf53e[_0xbdf6('0x56')]):_0xbdf6('0x65'));return respondWithRpcPromise(_0xbdf6('0x7e'),_0xbdf6('0x7f'),_0x183fd1);}return null;})[_0xbdf6('0x21')](function(_0x17c6eb){var _0x2e5667=_0xbdf6('0x80')+_0x17c6eb[_0xbdf6('0x27')]['ContactId'];return db[_0xbdf6('0x67')][_0xbdf6('0x40')](_0x2e5667,{'type':db[_0xbdf6('0x68')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x116329){return _0x116329;});})[_0xbdf6('0x21')](function(_0x4a87c9){if(_0x4a87c9){_0x183fd1['message'][_0xbdf6('0x6b')]=_0x4a87c9[0x0];if(!_0x1cf53e[_0xbdf6('0x56')][_0xbdf6('0x5b')])return;return db[_0xbdf6('0x6c')][_0xbdf6('0x54')]({'where':{'id':_0x1cf53e[_0xbdf6('0x56')]['UserId'],'role':_0xbdf6('0x6d')},'attributes':['id','name',_0xbdf6('0x6e'),_0xbdf6('0x81'),_0xbdf6('0x6f')],'raw':!![]});}return null;})[_0xbdf6('0x21')](function(_0x46f5f3){if(!_0x46f5f3)return null;_0x183fd1[_0xbdf6('0x27')][_0xbdf6('0x6d')]=_0x46f5f3;return _0x183fd1;})[_0xbdf6('0x21')](function(_0x44e935){if(_0x44e935){_0x44e935[_0xbdf6('0x27')]['interface']=util['format'](_0xbdf6('0x72'),_0x1cf53e[_0xbdf6('0x5c')]['name']);_0x44e935[_0xbdf6('0x27')][_0xbdf6('0x73')]=_0x183fd1['channel'];_0x44e935[_0xbdf6('0x27')][_0xbdf6('0x74')]=_0x183fd1[_0xbdf6('0x73')];_0x44e935[_0xbdf6('0x27')]['event']=_0xbdf6('0x7a');respondWithRpcPromise(_0xbdf6('0x77'),_0xbdf6('0x77'),{'event':_0xbdf6('0x82'),'message':_[_0xbdf6('0x4b')](_0x183fd1[_0xbdf6('0x27')],JSON[_0xbdf6('0x79')](_0x183fd1[_0xbdf6('0x62')]['formData']))},client9002);return _0x183fd1;}return null;})['then'](respondWithResult(_0x3cec00,null))[_0xbdf6('0x2a')](handleError(_0x3cec00,null));};
\ No newline at end of file
+var _0x0ca9=['ChatMessage','includeAll','findAll','rows','catch','params','keys','include','find','create','body','describe','chat-interactions','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','name','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','Sequelize','QueryTypes','contact','User','interface','rejectmessage','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','send','index','map','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options'];(function(_0x3495e7,_0x2f6a1f){var _0x5cbb6f=function(_0x247f30){while(--_0x247f30){_0x3495e7['push'](_0x3495e7['shift']());}};_0x5cbb6f(++_0x2f6a1f);}(_0x0ca9,0xbc));var _0x90ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ca9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90ca('0x0'));var zipdir=require(_0x90ca('0x1'));var jsonpatch=require(_0x90ca('0x2'));var rp=require('request-promise');var moment=require(_0x90ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x90ca('0x4'));var util=require(_0x90ca('0x5'));var path=require(_0x90ca('0x6'));var sox=require(_0x90ca('0x7'));var csv=require(_0x90ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90ca('0x9'));var _=require('lodash');var squel=require(_0x90ca('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90ca('0xb'));var toCsv=require(_0x90ca('0x8'));var querystring=require(_0x90ca('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x90ca('0xd'));var qs=require(_0x90ca('0xe'));var as=require(_0x90ca('0xf'));var hardwareService=require(_0x90ca('0x10'));var logger=require(_0x90ca('0x11'))(_0x90ca('0x12'));var utils=require(_0x90ca('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x90ca('0x14'));var db=require(_0x90ca('0x15'))['db'];config[_0x90ca('0x16')]=_[_0x90ca('0x17')](config[_0x90ca('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x90ca('0x18'))(new Redis(config['redis']));require(_0x90ca('0x19'))[_0x90ca('0x1a')](socket);var jayson=require(_0x90ca('0x1b'));var client=jayson[_0x90ca('0x1c')][_0x90ca('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x90ca('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xfca5fc,_0x3d7cba,_0x389247,_0xcc839f){return new BPromise(function(_0x357a87,_0xfa2fe0){var _0x6e0465=_0xcc839f||client;return _0x6e0465[_0x90ca('0x1e')](_0xfca5fc,_0x389247)[_0x90ca('0x1f')](function(_0x4b0a59){logger[_0x90ca('0x20')](_0x90ca('0x21'),_0x3d7cba,'request\x20sent');logger[_0x90ca('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3d7cba,_0x90ca('0x23'),JSON[_0x90ca('0x24')](_0x4b0a59));if(_0x4b0a59[_0x90ca('0x25')]){if(_0x4b0a59[_0x90ca('0x25')]['code']===0x1f4){logger['error'](_0x90ca('0x21'),_0x3d7cba,_0x4b0a59['error'][_0x90ca('0x26')]);return _0xfa2fe0(_0x4b0a59['error'][_0x90ca('0x26')]);}logger[_0x90ca('0x25')](_0x90ca('0x21'),_0x3d7cba,_0x4b0a59[_0x90ca('0x25')]['message']);return _0x357a87(_0x4b0a59[_0x90ca('0x25')][_0x90ca('0x26')]);}else{logger[_0x90ca('0x20')]('ChatMessage,\x20%s,\x20%s',_0x3d7cba,_0x90ca('0x23'));_0x357a87(_0x4b0a59[_0x90ca('0x27')][_0x90ca('0x26')]);}})['catch'](function(_0x2953f8){logger[_0x90ca('0x25')](_0x90ca('0x21'),_0x3d7cba,_0x2953f8);_0xfa2fe0(_0x2953f8);});});}function respondWithStatusCode(_0x4bdc10,_0x4df407){_0x4df407=_0x4df407||0xcc;return function(_0x3c8895){if(_0x3c8895){return _0x4bdc10['sendStatus'](_0x4df407);}return _0x4bdc10['status'](_0x4df407)[_0x90ca('0x28')]();};}function respondWithResult(_0x45da61,_0x25224c){_0x25224c=_0x25224c||0xc8;return function(_0x428c00){if(_0x428c00){return _0x45da61[_0x90ca('0x29')](_0x25224c)[_0x90ca('0x2a')](_0x428c00);}};}function respondWithFilteredResult(_0x35bf72,_0x3067ea){return function(_0x7461b1){if(_0x7461b1){var _0x21dafc=typeof _0x3067ea[_0x90ca('0x2b')]==='undefined'&&typeof _0x3067ea[_0x90ca('0x2c')]===_0x90ca('0x2d');var _0x3acfb6=_0x7461b1[_0x90ca('0x2e')];var _0x19fefb=_0x21dafc?0x0:_0x3067ea[_0x90ca('0x2b')];var _0x2b03e4=_0x21dafc?_0x7461b1['count']:_0x3067ea[_0x90ca('0x2b')]+_0x3067ea[_0x90ca('0x2c')];var _0x58c5e4;if(_0x2b03e4>=_0x3acfb6){_0x2b03e4=_0x3acfb6;_0x58c5e4=0xc8;}else{_0x58c5e4=0xce;}_0x35bf72[_0x90ca('0x29')](_0x58c5e4);return _0x35bf72[_0x90ca('0x2f')](_0x90ca('0x30'),_0x19fefb+'-'+_0x2b03e4+'/'+_0x3acfb6)['json'](_0x7461b1);}return null;};}function patchUpdates(_0x30aa73){return function(_0x146173){try{jsonpatch[_0x90ca('0x31')](_0x146173,_0x30aa73,!![]);}catch(_0x4b5fe6){return BPromise[_0x90ca('0x32')](_0x4b5fe6);}return _0x146173[_0x90ca('0x33')]();};}function saveUpdates(_0x4bf1c4,_0x5062b8){return function(_0x2a0092){if(_0x2a0092){return _0x2a0092[_0x90ca('0x34')](_0x4bf1c4)['then'](function(_0x55ad85){return _0x55ad85;});}return null;};}function removeEntity(_0x2d2c05,_0x4f5beb){return function(_0xdd34ad){if(_0xdd34ad){return _0xdd34ad[_0x90ca('0x35')]()[_0x90ca('0x1f')](function(){_0x2d2c05['status'](0xcc)[_0x90ca('0x28')]();});}};}function handleEntityNotFound(_0xab3fb7,_0x2004bf){return function(_0x39c4ac){if(!_0x39c4ac){_0xab3fb7[_0x90ca('0x36')](0x194);}return _0x39c4ac;};}function handleError(_0x5b130e,_0x4581b0){_0x4581b0=_0x4581b0||0x1f4;return function(_0x2c90a0){logger[_0x90ca('0x25')](_0x2c90a0[_0x90ca('0x37')]);if(_0x2c90a0['name']){delete _0x2c90a0['name'];}_0x5b130e['status'](_0x4581b0)[_0x90ca('0x38')](_0x2c90a0);};}exports[_0x90ca('0x39')]=function(_0x205ab2,_0x47c696){var _0x5144a9={},_0x1dce6f={},_0xbdaf36={'count':0x0,'rows':[]};var _0x2664ca=_[_0x90ca('0x3a')](db['ChatMessage'][_0x90ca('0x3b')],function(_0x535ad0){return{'name':_0x535ad0[_0x90ca('0x3c')],'type':_0x535ad0['type'][_0x90ca('0x3d')]};});_0x1dce6f['model']=_[_0x90ca('0x3a')](_0x2664ca,'name');_0x1dce6f[_0x90ca('0x3e')]=_['keys'](_0x205ab2[_0x90ca('0x3e')]);_0x1dce6f['filters']=_[_0x90ca('0x3f')](_0x1dce6f[_0x90ca('0x40')],_0x1dce6f[_0x90ca('0x3e')]);_0x5144a9[_0x90ca('0x41')]=_[_0x90ca('0x3f')](_0x1dce6f[_0x90ca('0x40')],qs['fields'](_0x205ab2['query'][_0x90ca('0x42')]));_0x5144a9['attributes']=_0x5144a9['attributes'][_0x90ca('0x43')]?_0x5144a9[_0x90ca('0x41')]:_0x1dce6f[_0x90ca('0x40')];if(!_0x205ab2['query'][_0x90ca('0x44')](_0x90ca('0x45'))){_0x5144a9['limit']=qs[_0x90ca('0x2c')](_0x205ab2['query']['limit']);_0x5144a9[_0x90ca('0x2b')]=qs[_0x90ca('0x2b')](_0x205ab2[_0x90ca('0x3e')]['offset']);}_0x5144a9[_0x90ca('0x46')]=qs[_0x90ca('0x47')](_0x205ab2['query'][_0x90ca('0x47')]);_0x5144a9['where']=qs[_0x90ca('0x48')](_[_0x90ca('0x49')](_0x205ab2[_0x90ca('0x3e')],_0x1dce6f['filters']),_0x2664ca);if(_0x205ab2[_0x90ca('0x3e')][_0x90ca('0x4a')]){_0x5144a9['where']=_[_0x90ca('0x4b')](_0x5144a9[_0x90ca('0x4c')],{'$or':_[_0x90ca('0x3a')](_0x2664ca,function(_0x41d41b){if(_0x41d41b[_0x90ca('0x4d')]!==_0x90ca('0x4e')){var _0xa3c832={};_0xa3c832[_0x41d41b['name']]={'$like':'%'+_0x205ab2[_0x90ca('0x3e')][_0x90ca('0x4a')]+'%'};return _0xa3c832;}})});}_0x5144a9=_[_0x90ca('0x4b')]({},_0x5144a9,_0x205ab2[_0x90ca('0x4f')]);var _0x258e73={'where':_0x5144a9[_0x90ca('0x4c')]};return db[_0x90ca('0x50')][_0x90ca('0x2e')](_0x258e73)['then'](function(_0x534655){_0xbdaf36[_0x90ca('0x2e')]=_0x534655;if(_0x205ab2[_0x90ca('0x3e')][_0x90ca('0x51')]){_0x5144a9['include']=[{'all':!![]}];}return db['ChatMessage'][_0x90ca('0x52')](_0x5144a9);})[_0x90ca('0x1f')](function(_0x31833b){_0xbdaf36[_0x90ca('0x53')]=_0x31833b;return _0xbdaf36;})[_0x90ca('0x1f')](respondWithFilteredResult(_0x47c696,_0x5144a9))[_0x90ca('0x54')](handleError(_0x47c696,null));};exports['show']=function(_0x56bab0,_0x3bcc1d){var _0x2e5016={'raw':!![],'where':{'id':_0x56bab0[_0x90ca('0x55')]['id']}},_0x50f571={};_0x50f571['model']=_['keys'](db[_0x90ca('0x50')][_0x90ca('0x3b')]);_0x50f571[_0x90ca('0x3e')]=_[_0x90ca('0x56')](_0x56bab0[_0x90ca('0x3e')]);_0x50f571['filters']=_[_0x90ca('0x3f')](_0x50f571[_0x90ca('0x40')],_0x50f571[_0x90ca('0x3e')]);_0x2e5016['attributes']=_[_0x90ca('0x3f')](_0x50f571[_0x90ca('0x40')],qs[_0x90ca('0x42')](_0x56bab0[_0x90ca('0x3e')][_0x90ca('0x42')]));_0x2e5016[_0x90ca('0x41')]=_0x2e5016[_0x90ca('0x41')][_0x90ca('0x43')]?_0x2e5016[_0x90ca('0x41')]:_0x50f571[_0x90ca('0x40')];if(_0x56bab0[_0x90ca('0x3e')][_0x90ca('0x51')]){_0x2e5016[_0x90ca('0x57')]=[{'all':!![]}];}_0x2e5016=_[_0x90ca('0x4b')]({},_0x2e5016,_0x56bab0[_0x90ca('0x4f')]);return db['ChatMessage'][_0x90ca('0x58')](_0x2e5016)[_0x90ca('0x1f')](handleEntityNotFound(_0x3bcc1d,null))[_0x90ca('0x1f')](respondWithResult(_0x3bcc1d,null))['catch'](handleError(_0x3bcc1d,null));};exports[_0x90ca('0x59')]=function(_0x5526cf,_0x3b8c02){return db[_0x90ca('0x50')][_0x90ca('0x59')](_0x5526cf[_0x90ca('0x5a')],{})[_0x90ca('0x1f')](respondWithResult(_0x3b8c02,0xc9))[_0x90ca('0x54')](handleError(_0x3b8c02,null));};exports[_0x90ca('0x34')]=function(_0x26db81,_0x188f66){if(_0x26db81['body']['id']){delete _0x26db81[_0x90ca('0x5a')]['id'];}return db[_0x90ca('0x50')][_0x90ca('0x58')]({'where':{'id':_0x26db81[_0x90ca('0x55')]['id']}})[_0x90ca('0x1f')](handleEntityNotFound(_0x188f66,null))[_0x90ca('0x1f')](saveUpdates(_0x26db81[_0x90ca('0x5a')],null))[_0x90ca('0x1f')](respondWithResult(_0x188f66,null))[_0x90ca('0x54')](handleError(_0x188f66,null));};exports[_0x90ca('0x35')]=function(_0x382822,_0x2bb0cc){return db[_0x90ca('0x50')]['find']({'where':{'id':_0x382822['params']['id']}})[_0x90ca('0x1f')](handleEntityNotFound(_0x2bb0cc,null))[_0x90ca('0x1f')](removeEntity(_0x2bb0cc,null))[_0x90ca('0x54')](handleError(_0x2bb0cc,null));};exports[_0x90ca('0x5b')]=function(_0x5a9d3a,_0x4679e6){return db[_0x90ca('0x50')][_0x90ca('0x5b')]()[_0x90ca('0x1f')](respondWithResult(_0x4679e6,null))[_0x90ca('0x54')](handleError(_0x4679e6,null));};var interaction_log=require(_0x90ca('0x11'))(_0x90ca('0x5c'));exports[_0x90ca('0x5d')]=function(_0x26ffb2,_0x458d65,_0x467460){var _0x2650d4={'agent':{},'channel':'chat'};if(_0x26ffb2[_0x90ca('0x5a')]['id']){delete _0x26ffb2['body']['id'];}_0x26ffb2['body']['read']=!![];_0x26ffb2['body']['readAt']=moment()['format'](_0x90ca('0x5e'));_0x26ffb2[_0x90ca('0x5a')][_0x90ca('0x5f')]=_0x26ffb2['body'][_0x90ca('0x5f')]||_0x26ffb2[_0x90ca('0x60')]['id'];_0x2650d4['agent']['id']=_0x26ffb2[_0x90ca('0x5a')][_0x90ca('0x5f')];return db['ChatMessage']['find']({'where':{'id':_0x26ffb2[_0x90ca('0x55')]['id'],'UserId':null}})[_0x90ca('0x1f')](handleEntityNotFound(_0x458d65,null))[_0x90ca('0x1f')](saveUpdates(_0x26ffb2[_0x90ca('0x5a')],null))[_0x90ca('0x1f')](function(_0x569a1f){if(_0x569a1f){_0x2650d4['message']=_0x569a1f[_0x90ca('0x61')]({'plain':!![]});return db[_0x90ca('0x62')][_0x90ca('0x58')]({'where':{'id':_0x569a1f[_0x90ca('0x63')]}});}return null;})[_0x90ca('0x1f')](handleEntityNotFound(_0x458d65,null))[_0x90ca('0x1f')](function(_0x41cdfe){if(_0x41cdfe){return _0x41cdfe['update']({'UserId':_0x26ffb2[_0x90ca('0x5a')][_0x90ca('0x5f')],'read1stAt':_[_0x90ca('0x64')](_0x41cdfe[_0x90ca('0x65')])?moment()[_0x90ca('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0xf3a9c0){if(_0xf3a9c0){_0x2650d4['interaction']=_0xf3a9c0[_0x90ca('0x61')]({'plain':!![]});interaction_log[_0x90ca('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x26ffb2[_0x90ca('0x60')]['id'],_0x26ffb2['user'][_0x90ca('0x67')],_0x26ffb2[_0x90ca('0x60')]['role'],_0x2650d4[_0x90ca('0x68')]['id'],_0x26ffb2[_0x90ca('0x5a')]?JSON[_0x90ca('0x24')](_0x26ffb2[_0x90ca('0x5a')]):_0x90ca('0x69'));return respondWithRpcPromise(_0x90ca('0x6a'),_0x90ca('0x6b'),_0x2650d4);}return null;})[_0x90ca('0x1f')](function(_0xc26cfc){var _0x44cc82=_0x90ca('0x6c')+_0xc26cfc[_0x90ca('0x26')]['ContactId'];return db['sequelize'][_0x90ca('0x3e')](_0x44cc82,{'type':db['Sequelize']['QueryTypes'][_0x90ca('0x6d')],'raw':!![]})['then'](function(_0x489abc){return _0x489abc;});})[_0x90ca('0x1f')](function(_0x16e579){if(_0x16e579){_0x2650d4[_0x90ca('0x26')]['contact']=_0x16e579[0x0];if(!_0x26ffb2[_0x90ca('0x5a')][_0x90ca('0x5f')])return;return db['User']['find']({'where':{'id':_0x26ffb2[_0x90ca('0x5a')][_0x90ca('0x5f')],'role':_0x90ca('0x6e')},'attributes':['id',_0x90ca('0x67'),_0x90ca('0x6f'),_0x90ca('0x70'),_0x90ca('0x71')],'raw':!![]});}return null;})['then'](function(_0x1640d4){if(!_0x1640d4)return null;_0x2650d4[_0x90ca('0x26')][_0x90ca('0x6e')]=_0x1640d4;return _0x2650d4;})[_0x90ca('0x1f')](function(_0xea76dc){if(_0xea76dc){if(_0x26ffb2[_0x90ca('0x5a')][_0x90ca('0x72')]){_0x2650d4[_0x90ca('0x26')]['interface']=util[_0x90ca('0x66')](_0x90ca('0x73'),_0x26ffb2['user'][_0x90ca('0x67')]);_0x2650d4[_0x90ca('0x26')][_0x90ca('0x74')]=_0x2650d4[_0x90ca('0x74')];_0x2650d4[_0x90ca('0x26')][_0x90ca('0x75')]=_0x2650d4['channel'];_0x2650d4[_0x90ca('0x26')][_0x90ca('0x76')]=_0x90ca('0x5d');return respondWithRpcPromise(_0x90ca('0x77'),'EventManager',{'event':'acceptmessage','message':_[_0x90ca('0x4b')](_0x2650d4['message'],JSON[_0x90ca('0x78')](_0x2650d4[_0x90ca('0x68')][_0x90ca('0x79')]))},client9002)[_0x90ca('0x1f')](function(){return _0x2650d4;});}return _0x2650d4;}return null;})[_0x90ca('0x1f')](respondWithResult(_0x458d65,null))['catch'](handleError(_0x458d65,null));};var interaction_log=require(_0x90ca('0x11'))(_0x90ca('0x5c'));exports['reject']=function(_0x301a65,_0x40c1f9,_0x288b01){var _0xc59adf={'agent':{},'channel':_0x90ca('0x7a')};if(_0x301a65[_0x90ca('0x5a')]['id']){delete _0x301a65[_0x90ca('0x5a')]['id'];}_0x301a65[_0x90ca('0x5a')][_0x90ca('0x5f')]=_0x301a65['body'][_0x90ca('0x5f')]||_0x301a65[_0x90ca('0x60')]['id'];_0xc59adf[_0x90ca('0x6e')]['id']=_0x301a65[_0x90ca('0x5a')][_0x90ca('0x5f')];return db[_0x90ca('0x50')][_0x90ca('0x58')]({'where':{'id':_0x301a65[_0x90ca('0x55')]['id'],'UserId':null}})[_0x90ca('0x1f')](handleEntityNotFound(_0x40c1f9,null))[_0x90ca('0x1f')](function(_0xbf292a){if(_0xbf292a){_0xc59adf[_0x90ca('0x26')]=_0xbf292a[_0x90ca('0x61')]({'plain':!![]});return db[_0x90ca('0x62')][_0x90ca('0x58')]({'where':{'id':_0xbf292a[_0x90ca('0x63')]}});}return null;})[_0x90ca('0x1f')](handleEntityNotFound(_0x40c1f9,null))[_0x90ca('0x1f')](function(_0x5763d8){if(_0x5763d8){_0xc59adf[_0x90ca('0x68')]=_0x5763d8['get']({'plain':!![]});interaction_log[_0x90ca('0x20')](_0x90ca('0x7b'),_0x301a65['user']['id'],_0x301a65[_0x90ca('0x60')][_0x90ca('0x67')],_0x301a65['user'][_0x90ca('0x7c')],_0xc59adf[_0x90ca('0x68')]['id'],_0x301a65[_0x90ca('0x5a')]?JSON[_0x90ca('0x24')](_0x301a65[_0x90ca('0x5a')]):_0x90ca('0x69'));return respondWithRpcPromise(_0x90ca('0x7d'),_0x90ca('0x7e'),_0xc59adf);}return null;})[_0x90ca('0x1f')](function(_0x314569){var _0x3cda27=_0x90ca('0x6c')+_0x314569[_0x90ca('0x26')][_0x90ca('0x7f')];return db['sequelize'][_0x90ca('0x3e')](_0x3cda27,{'type':db[_0x90ca('0x80')][_0x90ca('0x81')][_0x90ca('0x6d')],'raw':!![]})[_0x90ca('0x1f')](function(_0x40216e){return _0x40216e;});})[_0x90ca('0x1f')](function(_0x2ad97e){if(_0x2ad97e){_0xc59adf['message'][_0x90ca('0x82')]=_0x2ad97e[0x0];if(!_0x301a65['body'][_0x90ca('0x5f')])return;return db[_0x90ca('0x83')]['find']({'where':{'id':_0x301a65['body'][_0x90ca('0x5f')],'role':_0x90ca('0x6e')},'attributes':['id',_0x90ca('0x67'),'fullname',_0x90ca('0x70'),_0x90ca('0x71')],'raw':!![]});}return null;})[_0x90ca('0x1f')](function(_0xb6f57a){if(!_0xb6f57a)return null;_0xc59adf[_0x90ca('0x26')][_0x90ca('0x6e')]=_0xb6f57a;return _0xc59adf;})[_0x90ca('0x1f')](function(_0x5e1305){if(_0x5e1305){_0x5e1305['message'][_0x90ca('0x84')]=util[_0x90ca('0x66')](_0x90ca('0x73'),_0x301a65['user']['name']);_0x5e1305[_0x90ca('0x26')][_0x90ca('0x74')]=_0xc59adf[_0x90ca('0x74')];_0x5e1305[_0x90ca('0x26')][_0x90ca('0x75')]=_0xc59adf[_0x90ca('0x74')];_0x5e1305[_0x90ca('0x26')]['event']='reject';respondWithRpcPromise('EventManager',_0x90ca('0x77'),{'event':_0x90ca('0x85'),'message':_[_0x90ca('0x4b')](_0xc59adf[_0x90ca('0x26')],JSON['parse'](_0xc59adf[_0x90ca('0x68')][_0x90ca('0x79')]))},client9002);return _0xc59adf;}return null;})[_0x90ca('0x1f')](respondWithResult(_0x40c1f9,null))[_0x90ca('0x54')](handleError(_0x40c1f9,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index f0a5ee2..c0adbcd 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 _0x792f=['events','ChatMessage','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x792f,0xb0));var _0xf792=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0x792f[_0x555ebb];return _0x3c0a4a;};'use strict';var EventEmitter=require(_0xf792('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xf792('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf792('0x2'),'afterUpdate':_0xf792('0x3'),'afterDestroy':_0xf792('0x4')};function emitEvent(_0x2ae700){return function(_0x49a3d0,_0x2ce722,_0x5a9883){ChatMessageEvents[_0xf792('0x5')](_0x2ae700+':'+_0x49a3d0['id'],_0x49a3d0);ChatMessageEvents[_0xf792('0x5')](_0x2ae700,_0x49a3d0);_0x5a9883(null);};}for(var e in events){if(events[_0xf792('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xf792('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xe0b7=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatMessage'];(function(_0x28ecc1,_0x3adcab){var _0x574b40=function(_0x1b7d78){while(--_0x1b7d78){_0x28ecc1['push'](_0x28ecc1['shift']());}};_0x574b40(++_0x3adcab);}(_0xe0b7,0x9e));var _0x7e0b=function(_0x36fa08,_0x5c94cb){_0x36fa08=_0x36fa08-0x0;var _0x2f4fd1=_0xe0b7[_0x36fa08];return _0x2f4fd1;};'use strict';var EventEmitter=require(_0x7e0b('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x7e0b('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7e0b('0x2')](0x0);var events={'afterCreate':_0x7e0b('0x3'),'afterUpdate':_0x7e0b('0x4'),'afterDestroy':_0x7e0b('0x5')};function emitEvent(_0x3f92d0){return function(_0x187b6b,_0x220e17,_0x3382e5){ChatMessageEvents[_0x7e0b('0x6')](_0x3f92d0+':'+_0x187b6b['id'],_0x187b6b);ChatMessageEvents[_0x7e0b('0x6')](_0x3f92d0,_0x187b6b);_0x3382e5(null);};}for(var e in events){if(events[_0x7e0b('0x7')](e)){var event=events[e];ChatMessage[_0x7e0b('0x8')](e,emitEvent(event));}}module[_0x7e0b('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 8d55f73..b41f8e1 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 _0x4fba=['request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird'];(function(_0x156dee,_0x48937d){var _0x847c00=function(_0xd8425e){while(--_0xd8425e){_0x156dee['push'](_0x156dee['shift']());}};_0x847c00(++_0x48937d);}(_0x4fba,0x11e));var _0xa4fb=function(_0x1b4b8f,_0x1e3080){_0x1b4b8f=_0x1b4b8f-0x0;var _0x178821=_0x4fba[_0x1b4b8f];return _0x178821;};'use strict';var _=require(_0xa4fb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa4fb('0x1'));var moment=require(_0xa4fb('0x2'));var BPromise=require(_0xa4fb('0x3'));var rp=require(_0xa4fb('0x4'));var fs=require('fs');var path=require(_0xa4fb('0x5'));var rimraf=require(_0xa4fb('0x6'));var config=require(_0xa4fb('0x7'));var attributes=require('./chatMessage.attributes');module[_0xa4fb('0x8')]=function(_0x15c3bf,_0x4c71d7){return _0x15c3bf[_0xa4fb('0x9')](_0xa4fb('0xa'),attributes,{'tableName':_0xa4fb('0xb'),'paranoid':![],'indexes':[{'name':_0xa4fb('0xc'),'fields':[_0xa4fb('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1591c5,_0xd1c870,_0x263fed){var _0x924d7f=_0x15c3bf['models'];var _0x2c46f0=_0x1591c5[_0xa4fb('0xe')]({'plain':!![]});if(_0x2c46f0[_0xa4fb('0xf')][_0xa4fb('0x10')]()==='in'||_0x2c46f0[_0xa4fb('0xf')]['toLowerCase']()==='out'&&!_0x2c46f0[_0xa4fb('0x11')]&&!_[_0xa4fb('0x12')](_0x2c46f0[_0xa4fb('0x13')])){_0x924d7f[_0xa4fb('0x14')]['findOne']({'where':{'id':_0x2c46f0[_0xa4fb('0x15')]}})[_0xa4fb('0x16')](function(_0x2fb990){if(_0x2fb990){_0x2fb990[_0xa4fb('0x17')]({'lastMsgAt':_0x2c46f0[_0xa4fb('0x18')],'lastMsgDirection':_0x2c46f0['direction'][_0xa4fb('0x10')]()});}})[_0xa4fb('0x19')](function(_0x4efbf5){console[_0xa4fb('0x1a')](_0x4efbf5);});}_0x263fed();}},'charset':_0xa4fb('0x1b'),'collate':_0xa4fb('0x1c')});};
\ No newline at end of file
+var _0x0571=['out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','chat_messages','body','direction'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x0571,0xa4));var _0x1057=function(_0x3b9d5f,_0x2e9039){_0x3b9d5f=_0x3b9d5f-0x0;var _0x39924e=_0x0571[_0x3b9d5f];return _0x39924e;};'use strict';var _=require(_0x1057('0x0'));var util=require(_0x1057('0x1'));var logger=require('../../config/logger')(_0x1057('0x2'));var moment=require('moment');var BPromise=require(_0x1057('0x3'));var rp=require(_0x1057('0x4'));var fs=require('fs');var path=require(_0x1057('0x5'));var rimraf=require(_0x1057('0x6'));var config=require(_0x1057('0x7'));var attributes=require(_0x1057('0x8'));module['exports']=function(_0x13cc55,_0x944f90){return _0x13cc55['define']('ChatMessage',attributes,{'tableName':_0x1057('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1057('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e2ebc,_0x1d0e1a,_0x5d93bf){var _0x4aafcc=_0x13cc55['models'];var _0x3ba2c9=_0x4e2ebc['get']({'plain':!![]});if(_0x3ba2c9['direction']['toLowerCase']()==='in'||_0x3ba2c9[_0x1057('0xb')]['toLowerCase']()===_0x1057('0xc')&&!_0x3ba2c9[_0x1057('0xd')]&&!_[_0x1057('0xe')](_0x3ba2c9[_0x1057('0xf')])){_0x4aafcc[_0x1057('0x10')][_0x1057('0x11')]({'where':{'id':_0x3ba2c9[_0x1057('0x12')]}})[_0x1057('0x13')](function(_0x5690b8){if(_0x5690b8){_0x5690b8['update']({'lastMsgAt':_0x3ba2c9[_0x1057('0x14')],'lastMsgDirection':_0x3ba2c9[_0x1057('0xb')]['toLowerCase']()});}})['catch'](function(_0x7e30cf){console['error'](_0x7e30cf);});}_0x5d93bf();}},'charset':'utf8mb4','collate':_0x1057('0x15')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index e8a898e..fecb01f 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 _0xe485=['stringify','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xe485,0x114));var _0x5e48=function(_0x4f6cfc,_0x2cdf93){_0x4f6cfc=_0x4f6cfc-0x0;var _0x41a947=_0xe485[_0x4f6cfc];return _0x41a947;};'use strict';var _=require(_0x5e48('0x0'));var util=require('util');var moment=require(_0x5e48('0x1'));var BPromise=require(_0x5e48('0x2'));var rs=require(_0x5e48('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e48('0x4'))['db'];var utils=require(_0x5e48('0x5'));var logger=require('../../config/logger')(_0x5e48('0x6'));var config=require(_0x5e48('0x7'));var jayson=require(_0x5e48('0x8'));var client=jayson[_0x5e48('0x9')][_0x5e48('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5e48('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5e48('0xc'))(new Redis(config['redis']));require(_0x5e48('0xd'))[_0x5e48('0xe')](socket);function respondWithRpcPromise(_0x4d5905,_0x2ac2f6,_0x2cf654){return new BPromise(function(_0x3fd04e,_0x406075){return client[_0x5e48('0xf')](_0x4d5905,_0x2cf654)[_0x5e48('0x10')](function(_0xbd868){logger[_0x5e48('0x11')](_0x5e48('0x12'),_0x2ac2f6,_0x5e48('0x13'));logger['debug'](_0x5e48('0x14'),_0x2ac2f6,'request\x20sent',JSON[_0x5e48('0x15')](_0xbd868));if(_0xbd868[_0x5e48('0x16')]){if(_0xbd868[_0x5e48('0x16')][_0x5e48('0x17')]===0x1f4){logger[_0x5e48('0x16')](_0x5e48('0x12'),_0x2ac2f6,_0xbd868['error'][_0x5e48('0x18')]);return _0x406075(_0xbd868[_0x5e48('0x16')][_0x5e48('0x18')]);}logger[_0x5e48('0x16')](_0x5e48('0x12'),_0x2ac2f6,_0xbd868[_0x5e48('0x16')]['message']);return _0x3fd04e(_0xbd868[_0x5e48('0x16')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2ac2f6,_0x5e48('0x13'));_0x3fd04e(_0xbd868[_0x5e48('0x19')][_0x5e48('0x18')]);}})[_0x5e48('0x1a')](function(_0x479411){logger[_0x5e48('0x16')](_0x5e48('0x12'),_0x2ac2f6,_0x479411);_0x406075(_0x479411);});});}exports[_0x5e48('0x1b')]=function(_0x38cbc5){var _0x7ebb5=this;return new Promise(function(_0x5ac8d5,_0x412089){return db['ChatMessage'][_0x5e48('0x1c')](_0x38cbc5[_0x5e48('0x1d')],{'raw':_0x38cbc5[_0x5e48('0x1e')]?_0x38cbc5[_0x5e48('0x1e')][_0x5e48('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x4e8080){logger[_0x5e48('0x11')](_0x5e48('0x1b'),_0x38cbc5);logger[_0x5e48('0x20')](_0x5e48('0x1b'),_0x38cbc5,JSON[_0x5e48('0x15')](_0x4e8080));_0x5ac8d5(_0x4e8080);})[_0x5e48('0x1a')](function(_0x541208){logger[_0x5e48('0x16')](_0x5e48('0x1b'),_0x541208['message'],_0x38cbc5);_0x412089(_0x7ebb5['error'](0x1f4,_0x541208[_0x5e48('0x18')]));});});};
\ No newline at end of file
+var _0xc6ac=['ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateChatMessage','create','options','raw','stringify','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x5c6de0,_0x5ab8d4){var _0x332182=function(_0x368ad2){while(--_0x368ad2){_0x5c6de0['push'](_0x5c6de0['shift']());}};_0x332182(++_0x5ab8d4);}(_0xc6ac,0xb3));var _0xcc6a=function(_0x38bf29,_0x3eb867){_0x38bf29=_0x38bf29-0x0;var _0x547480=_0xc6ac[_0x38bf29];return _0x547480;};'use strict';var _=require(_0xcc6a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc6a('0x1'));var fs=require('fs');var Redis=require(_0xcc6a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc6a('0x3'));var logger=require('../../config/logger')(_0xcc6a('0x4'));var config=require(_0xcc6a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcc6a('0x6')][_0xcc6a('0x7')]({'port':0x232a});config['redis']=_[_0xcc6a('0x8')](config[_0xcc6a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xcc6a('0xa'))(new Redis(config[_0xcc6a('0x9')]));require(_0xcc6a('0xb'))[_0xcc6a('0xc')](socket);function respondWithRpcPromise(_0x2f4f82,_0x3b2035,_0x565017){return new BPromise(function(_0x4920cd,_0x56f5b7){return client[_0xcc6a('0xd')](_0x2f4f82,_0x565017)[_0xcc6a('0xe')](function(_0x16230b){logger['info'](_0xcc6a('0xf'),_0x3b2035,'request\x20sent');logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3b2035,_0xcc6a('0x12'),JSON['stringify'](_0x16230b));if(_0x16230b[_0xcc6a('0x13')]){if(_0x16230b[_0xcc6a('0x13')]['code']===0x1f4){logger[_0xcc6a('0x13')](_0xcc6a('0xf'),_0x3b2035,_0x16230b['error'][_0xcc6a('0x14')]);return _0x56f5b7(_0x16230b[_0xcc6a('0x13')][_0xcc6a('0x14')]);}logger['error'](_0xcc6a('0xf'),_0x3b2035,_0x16230b[_0xcc6a('0x13')]['message']);return _0x4920cd(_0x16230b[_0xcc6a('0x13')]['message']);}else{logger[_0xcc6a('0x15')]('ChatMessage,\x20%s,\x20%s',_0x3b2035,_0xcc6a('0x12'));_0x4920cd(_0x16230b['result'][_0xcc6a('0x14')]);}})[_0xcc6a('0x16')](function(_0x25fb64){logger[_0xcc6a('0x13')](_0xcc6a('0xf'),_0x3b2035,_0x25fb64);_0x56f5b7(_0x25fb64);});});}exports[_0xcc6a('0x17')]=function(_0x440d05){var _0x4d1848=this;return new Promise(function(_0x33356e,_0x22b551){return db['ChatMessage'][_0xcc6a('0x18')](_0x440d05['body'],{'raw':_0x440d05[_0xcc6a('0x19')]?_0x440d05[_0xcc6a('0x19')][_0xcc6a('0x1a')]===undefined?!![]:![]:!![]})[_0xcc6a('0xe')](function(_0x4d461b){logger[_0xcc6a('0x15')](_0xcc6a('0x17'),_0x440d05);logger[_0xcc6a('0x10')]('CreateChatMessage',_0x440d05,JSON[_0xcc6a('0x1b')](_0x4d461b));_0x33356e(_0x4d461b);})[_0xcc6a('0x16')](function(_0x1225a8){logger[_0xcc6a('0x13')](_0xcc6a('0x17'),_0x1225a8[_0xcc6a('0x14')],_0x440d05);_0x22b551(_0x4d1848[_0xcc6a('0x13')](0x1f4,_0x1225a8[_0xcc6a('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index e063a43..9b5d5c4 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 _0x102b=['length','chatMessage:','save','update','emit','removeListener'];(function(_0x45b9c6,_0xa7acf9){var _0x214665=function(_0x3c9701){while(--_0x3c9701){_0x45b9c6['push'](_0x45b9c6['shift']());}};_0x214665(++_0xa7acf9);}(_0x102b,0x1be));var _0xb102=function(_0x1b6165,_0x2a6401){_0x1b6165=_0x1b6165-0x0;var _0x23fce1=_0x102b[_0x1b6165];return _0x23fce1;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xb102('0x0'),'remove',_0xb102('0x1')];function createListener(_0x3e1311,_0x42172c){return function(_0x1be904){_0x42172c[_0xb102('0x2')](_0x3e1311,_0x1be904);};}function removeListener(_0x1402fb,_0x19e35d){return function(){ChatMessageEvents[_0xb102('0x3')](_0x1402fb,_0x19e35d);};}exports['register']=function(_0x3325b7){for(var _0x370baa=0x0,_0xd131eb=events[_0xb102('0x4')];_0x370baa<_0xd131eb;_0x370baa++){var _0x1ee0c0=events[_0x370baa];var _0x5879bb=createListener(_0xb102('0x5')+_0x1ee0c0,_0x3325b7);ChatMessageEvents['on'](_0x1ee0c0,_0x5879bb);}};
\ No newline at end of file
+var _0xcea5=['save','remove','update','emit','register','chatMessage:','./chatMessage.events'];(function(_0x1d77b4,_0x53f449){var _0x57fbd8=function(_0x553fac){while(--_0x553fac){_0x1d77b4['push'](_0x1d77b4['shift']());}};_0x57fbd8(++_0x53f449);}(_0xcea5,0xed));var _0x5cea=function(_0x211703,_0x3060bd){_0x211703=_0x211703-0x0;var _0x405be6=_0xcea5[_0x211703];return _0x405be6;};'use strict';var ChatMessageEvents=require(_0x5cea('0x0'));var events=[_0x5cea('0x1'),_0x5cea('0x2'),_0x5cea('0x3')];function createListener(_0x2c6970,_0x52a9b8){return function(_0x20a2d9){_0x52a9b8[_0x5cea('0x4')](_0x2c6970,_0x20a2d9);};}function removeListener(_0x382c21,_0x319dba){return function(){ChatMessageEvents['removeListener'](_0x382c21,_0x319dba);};}exports[_0x5cea('0x5')]=function(_0x31e6f3){for(var _0x599bc5=0x0,_0x49db13=events['length'];_0x599bc5<_0x49db13;_0x599bc5++){var _0x502d95=events[_0x599bc5];var _0x3b6fbc=createListener(_0x5cea('0x6')+_0x502d95,_0x31e6f3);ChatMessageEvents['on'](_0x502d95,_0x3b6fbc);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 75b7252..c3a074f 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 _0x9711=['post','tracked','chat','put','update','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0x9711,0x135));var _0x1971=function(_0x3b09f8,_0x18e503){_0x3b09f8=_0x3b09f8-0x0;var _0x5ccbe0=_0x9711[_0x3b09f8];return _0x5ccbe0;};'use strict';var multer=require(_0x1971('0x0'));var util=require('util');var path=require(_0x1971('0x1'));var timeout=require(_0x1971('0x2'));var express=require(_0x1971('0x3'));var router=express[_0x1971('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1971('0x5'));var interaction=require(_0x1971('0x6'));var config=require('../../config/environment');var controller=require(_0x1971('0x7'));router[_0x1971('0x8')]('/',auth[_0x1971('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1971('0xa')]);router[_0x1971('0x8')](_0x1971('0xb'),auth[_0x1971('0x9')](),controller[_0x1971('0xc')]);router[_0x1971('0xd')]('/',auth[_0x1971('0x9')](),interaction[_0x1971('0xe')](_0x1971('0xf'),'chatmessage:create'),controller['create']);router[_0x1971('0x10')](_0x1971('0xb'),controller[_0x1971('0x11')]);router[_0x1971('0x10')]('/:id/accept',auth[_0x1971('0x9')](),controller[_0x1971('0x12')]);router[_0x1971('0x10')](_0x1971('0x13'),auth[_0x1971('0x9')](),controller[_0x1971('0x14')]);router[_0x1971('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1971('0x16')]=router;
\ No newline at end of file
+var _0xfab7=['create','put','update','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create'];(function(_0x1bb145,_0x533b57){var _0x5a0b5c=function(_0x55613e){while(--_0x55613e){_0x1bb145['push'](_0x1bb145['shift']());}};_0x5a0b5c(++_0x533b57);}(_0xfab7,0x14c));var _0x7fab=function(_0x5e901f,_0x29ca09){_0x5e901f=_0x5e901f-0x0;var _0x30bb1b=_0xfab7[_0x5e901f];return _0x30bb1b;};'use strict';var multer=require(_0x7fab('0x0'));var util=require('util');var path=require(_0x7fab('0x1'));var timeout=require(_0x7fab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7fab('0x3'));var auth=require(_0x7fab('0x4'));var interaction=require(_0x7fab('0x5'));var config=require(_0x7fab('0x6'));var controller=require(_0x7fab('0x7'));router['get']('/',auth[_0x7fab('0x8')](),controller[_0x7fab('0x9')]);router[_0x7fab('0xa')](_0x7fab('0xb'),auth[_0x7fab('0x8')](),controller[_0x7fab('0xc')]);router['get'](_0x7fab('0xd'),auth['isAuthenticated'](),controller[_0x7fab('0xe')]);router[_0x7fab('0xf')]('/',auth[_0x7fab('0x8')](),interaction[_0x7fab('0x10')](_0x7fab('0x11'),_0x7fab('0x12')),controller[_0x7fab('0x13')]);router[_0x7fab('0x14')](_0x7fab('0xd'),controller[_0x7fab('0x15')]);router['put']('/:id/accept',auth[_0x7fab('0x8')](),controller[_0x7fab('0x16')]);router['put'](_0x7fab('0x17'),auth[_0x7fab('0x8')](),controller[_0x7fab('0x18')]);router[_0x7fab('0x19')](_0x7fab('0xd'),auth[_0x7fab('0x8')](),controller[_0x7fab('0x1a')]);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 e0dfbb8..77e6d53 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 _0xadb5=['medium','TEXT','exports'];(function(_0x556bed,_0x2be59e){var _0x23787d=function(_0x5655cc){while(--_0x5655cc){_0x556bed['push'](_0x556bed['shift']());}};_0x23787d(++_0x2be59e);}(_0xadb5,0xad));var _0x5adb=function(_0x57a364,_0x1ca64){_0x57a364=_0x57a364-0x0;var _0x359c20=_0xadb5[_0x57a364];return _0x359c20;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x56b368,_0x51d063){var _0x29c7e0=function(_0x3ad95c){while(--_0x3ad95c){_0x56b368['push'](_0x56b368['shift']());}};_0x29c7e0(++_0x51d063);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index fe2d2e1..75a9546 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x283e91,_0x1889d0){_0x283e91=_0x283e91-0x0;var _0x22f43c=_0x7a54[_0x283e91];return _0x22f43c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x7a54,0x106));var _0x47a5=function(_0x435707,_0x3e180a){_0x435707=_0x435707-0x0;var _0x21ab30=_0x7a54[_0x435707];return _0x21ab30;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index c1c02af..48d09e1 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 _0x4677=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xf8d86a,_0x4c5b98){var _0x2a3775=function(_0x2d36cc){while(--_0x2d36cc){_0xf8d86a['push'](_0xf8d86a['shift']());}};_0x2a3775(++_0x4c5b98);}(_0x4677,0x105));var _0x7467=function(_0x21017d,_0x49513c){_0x21017d=_0x21017d-0x0;var _0x5c66d2=_0x4677[_0x21017d];return _0x5c66d2;};'use strict';var EventEmitter=require(_0x7467('0x0'));var ChatOfflineMessage=require(_0x7467('0x1'))['db'][_0x7467('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7467('0x3')](0x0);var events={'afterCreate':_0x7467('0x4'),'afterUpdate':_0x7467('0x5'),'afterDestroy':_0x7467('0x6')};function emitEvent(_0x12d8c6){return function(_0x242012,_0x344a0e,_0x29a3b7){ChatOfflineMessageEvents[_0x7467('0x7')](_0x12d8c6+':'+_0x242012['id'],_0x242012);ChatOfflineMessageEvents[_0x7467('0x7')](_0x12d8c6,_0x242012);_0x29a3b7(null);};}for(var e in events){if(events[_0x7467('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x7467('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x4b36=['update','remove','emit','hasOwnProperty','exports','events','ChatOfflineMessage','setMaxListeners','save'];(function(_0x7d80c1,_0x20b039){var _0x20a123=function(_0x3a63fb){while(--_0x3a63fb){_0x7d80c1['push'](_0x7d80c1['shift']());}};_0x20a123(++_0x20b039);}(_0x4b36,0xcb));var _0x64b3=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x4b36[_0x1ccdf7];return _0x52a0ae;};'use strict';var EventEmitter=require(_0x64b3('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x64b3('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x64b3('0x2')](0x0);var events={'afterCreate':_0x64b3('0x3'),'afterUpdate':_0x64b3('0x4'),'afterDestroy':_0x64b3('0x5')};function emitEvent(_0x2381bf){return function(_0xf24537,_0x35462d,_0x54d190){ChatOfflineMessageEvents[_0x64b3('0x6')](_0x2381bf+':'+_0xf24537['id'],_0xf24537);ChatOfflineMessageEvents[_0x64b3('0x6')](_0x2381bf,_0xf24537);_0x54d190(null);};}for(var e in events){if(events[_0x64b3('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x64b3('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 3ab87fe..2c5ea3e 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 _0x2777=['ChatOfflineMessage','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2777,0x1cf));var _0x7277=function(_0x5a5391,_0x45acbf){_0x5a5391=_0x5a5391-0x0;var _0x59966c=_0x2777[_0x5a5391];return _0x59966c;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x7277('0x0')]=function(_0x6957f4){return _0x6957f4[_0x7277('0x1')](_0x7277('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd45e=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x47f370,_0xe59903){var _0x4eb63e=function(_0x3ea81e){while(--_0x3ea81e){_0x47f370['push'](_0x47f370['shift']());}};_0x4eb63e(++_0xe59903);}(_0xd45e,0xd6));var _0xed45=function(_0xa78994,_0x4a568d){_0xa78994=_0xa78994-0x0;var _0x3a14a7=_0xd45e[_0xa78994];return _0x3a14a7;};'use strict';var attributes=require(_0xed45('0x0'));module[_0xed45('0x1')]=function(_0x1a9696){return _0x1a9696[_0xed45('0x2')](_0xed45('0x3'),attributes,{'tableName':_0xed45('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed45('0x5'),'collate':_0xed45('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 2fbc9d5..613d3df 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 _0xdfea=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x169045,_0x36511c){var _0x5a78ef=function(_0x21ccd0){while(--_0x21ccd0){_0x169045['push'](_0x169045['shift']());}};_0x5a78ef(++_0x36511c);}(_0xdfea,0x1cd));var _0xadfe=function(_0x57ffe6,_0xee95cc){_0x57ffe6=_0x57ffe6-0x0;var _0x59698f=_0xdfea[_0x57ffe6];return _0x59698f;};'use strict';var _=require(_0xadfe('0x0'));var util=require(_0xadfe('0x1'));var moment=require('moment');var BPromise=require(_0xadfe('0x2'));var rs=require(_0xadfe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadfe('0x4'))['db'];var utils=require(_0xadfe('0x5'));var logger=require(_0xadfe('0x6'))(_0xadfe('0x7'));var config=require('../../config/environment');var jayson=require(_0xadfe('0x8'));var client=jayson['client'][_0xadfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15d3b1,_0x253e70,_0x238db5){return new BPromise(function(_0x4ba44f,_0x2bdbf0){return client['request'](_0x15d3b1,_0x238db5)[_0xadfe('0xa')](function(_0x1863e1){logger[_0xadfe('0xb')](_0xadfe('0xc'),_0x253e70,'request\x20sent');logger[_0xadfe('0xd')](_0xadfe('0xe'),_0x253e70,_0xadfe('0xf'),JSON[_0xadfe('0x10')](_0x1863e1));if(_0x1863e1[_0xadfe('0x11')]){if(_0x1863e1['error'][_0xadfe('0x12')]===0x1f4){logger['error'](_0xadfe('0xc'),_0x253e70,_0x1863e1[_0xadfe('0x11')][_0xadfe('0x13')]);return _0x2bdbf0(_0x1863e1[_0xadfe('0x11')][_0xadfe('0x13')]);}logger[_0xadfe('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x253e70,_0x1863e1[_0xadfe('0x11')][_0xadfe('0x13')]);return _0x4ba44f(_0x1863e1['error'][_0xadfe('0x13')]);}else{logger[_0xadfe('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x253e70,'request\x20sent');_0x4ba44f(_0x1863e1[_0xadfe('0x14')][_0xadfe('0x13')]);}})[_0xadfe('0x15')](function(_0x1fa58f){logger[_0xadfe('0x11')](_0xadfe('0xc'),_0x253e70,_0x1fa58f);_0x2bdbf0(_0x1fa58f);});});}
\ No newline at end of file
+var _0xc777=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x40643a,_0x12ba82){var _0x53ea1b=function(_0x3cbb17){while(--_0x3cbb17){_0x40643a['push'](_0x40643a['shift']());}};_0x53ea1b(++_0x12ba82);}(_0xc777,0x1b7));var _0x7c77=function(_0x343b00,_0x1525ed){_0x343b00=_0x343b00-0x0;var _0x3f73eb=_0xc777[_0x343b00];return _0x3f73eb;};'use strict';var _=require(_0x7c77('0x0'));var util=require(_0x7c77('0x1'));var moment=require('moment');var BPromise=require(_0x7c77('0x2'));var rs=require(_0x7c77('0x3'));var fs=require('fs');var Redis=require(_0x7c77('0x4'));var db=require(_0x7c77('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c77('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c77('0x7'));var client=jayson[_0x7c77('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x392218,_0x27c6ce,_0x32adc2){return new BPromise(function(_0x5a6e0e,_0x21a24e){return client['request'](_0x392218,_0x32adc2)[_0x7c77('0x9')](function(_0x224f4c){logger[_0x7c77('0xa')](_0x7c77('0xb'),_0x27c6ce,_0x7c77('0xc'));logger[_0x7c77('0xd')](_0x7c77('0xe'),_0x27c6ce,_0x7c77('0xc'),JSON['stringify'](_0x224f4c));if(_0x224f4c[_0x7c77('0xf')]){if(_0x224f4c['error'][_0x7c77('0x10')]===0x1f4){logger[_0x7c77('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27c6ce,_0x224f4c[_0x7c77('0xf')][_0x7c77('0x11')]);return _0x21a24e(_0x224f4c[_0x7c77('0xf')]['message']);}logger[_0x7c77('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27c6ce,_0x224f4c['error']['message']);return _0x5a6e0e(_0x224f4c[_0x7c77('0xf')][_0x7c77('0x11')]);}else{logger['info'](_0x7c77('0xb'),_0x27c6ce,_0x7c77('0xc'));_0x5a6e0e(_0x224f4c[_0x7c77('0x12')][_0x7c77('0x11')]);}})[_0x7c77('0x13')](function(_0x1d83bd){logger[_0x7c77('0xf')](_0x7c77('0xb'),_0x27c6ce,_0x1d83bd);_0x21a24e(_0x1d83bd);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 484604c..ad9e65b 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 _0x8e0d=['index','/describe','describe','/:id','show','post','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated'];(function(_0x30d6da,_0x2d3b39){var _0x175667=function(_0x5ab094){while(--_0x5ab094){_0x30d6da['push'](_0x30d6da['shift']());}};_0x175667(++_0x2d3b39);}(_0x8e0d,0x9c));var _0xd8e0=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x8e0d[_0xdc37a1];return _0x99b4fe;};'use strict';var multer=require(_0xd8e0('0x0'));var util=require(_0xd8e0('0x1'));var path=require(_0xd8e0('0x2'));var timeout=require('connect-timeout');var express=require(_0xd8e0('0x3'));var router=express[_0xd8e0('0x4')]();var fs_extra=require(_0xd8e0('0x5'));var auth=require(_0xd8e0('0x6'));var interaction=require(_0xd8e0('0x7'));var config=require(_0xd8e0('0x8'));var controller=require(_0xd8e0('0x9'));router[_0xd8e0('0xa')]('/',auth[_0xd8e0('0xb')](),controller[_0xd8e0('0xc')]);router[_0xd8e0('0xa')](_0xd8e0('0xd'),auth['isAuthenticated'](),controller[_0xd8e0('0xe')]);router[_0xd8e0('0xa')](_0xd8e0('0xf'),auth['isAuthenticated'](),controller[_0xd8e0('0x10')]);router[_0xd8e0('0x11')]('/',auth[_0xd8e0('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd8e0('0x12')]);router['delete'](_0xd8e0('0xf'),auth['isAuthenticated'](),controller[_0xd8e0('0x13')]);module[_0xd8e0('0x14')]=router;
\ No newline at end of file
+var _0xf9e7=['/describe','describe','/:id','post','put','update','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x12aba8,_0x40a036){var _0x2aac66=function(_0x3e56b7){while(--_0x3e56b7){_0x12aba8['push'](_0x12aba8['shift']());}};_0x2aac66(++_0x40a036);}(_0xf9e7,0x196));var _0x7f9e=function(_0x1bd822,_0x1c8078){_0x1bd822=_0x1bd822-0x0;var _0x3c3a69=_0xf9e7[_0x1bd822];return _0x3c3a69;};'use strict';var multer=require(_0x7f9e('0x0'));var util=require('util');var path=require(_0x7f9e('0x1'));var timeout=require(_0x7f9e('0x2'));var express=require(_0x7f9e('0x3'));var router=express['Router']();var fs_extra=require(_0x7f9e('0x4'));var auth=require(_0x7f9e('0x5'));var interaction=require(_0x7f9e('0x6'));var config=require(_0x7f9e('0x7'));var controller=require(_0x7f9e('0x8'));router[_0x7f9e('0x9')]('/',auth[_0x7f9e('0xa')](),controller[_0x7f9e('0xb')]);router[_0x7f9e('0x9')](_0x7f9e('0xc'),auth[_0x7f9e('0xa')](),controller[_0x7f9e('0xd')]);router['get'](_0x7f9e('0xe'),auth[_0x7f9e('0xa')](),controller['show']);router[_0x7f9e('0xf')]('/',auth[_0x7f9e('0xa')](),controller['create']);router[_0x7f9e('0x10')](_0x7f9e('0xe'),auth['isAuthenticated'](),controller[_0x7f9e('0x11')]);router['delete'](_0x7f9e('0xe'),auth[_0x7f9e('0xa')](),controller[_0x7f9e('0x12')]);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 ed48de4..679450b 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 _0x1bc0=['mouseOver','INTEGER','sequelize','exports','STRING','ENUM','timeout'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x1bc0,0x11a));var _0x01bc=function(_0x24ae3f,_0x1d0ba2){_0x24ae3f=_0x24ae3f-0x0;var _0x944aeb=_0x1bc0[_0x24ae3f];return _0x944aeb;};'use strict';var Sequelize=require(_0x01bc('0x0'));module[_0x01bc('0x1')]={'name':{'type':Sequelize[_0x01bc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x01bc('0x3')]('mouseOver',_0x01bc('0x4')),'defaultValue':_0x01bc('0x5')},'selector':{'type':Sequelize[_0x01bc('0x2')]},'timeout':{'type':Sequelize[_0x01bc('0x6')]}};
\ No newline at end of file
+var _0xe0af=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x4147ff,_0x154530){var _0x1e71e6=function(_0x21f992){while(--_0x21f992){_0x4147ff['push'](_0x4147ff['shift']());}};_0x1e71e6(++_0x154530);}(_0xe0af,0x8d));var _0xfe0a=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xe0af[_0xfedc72];return _0x2c7c78;};'use strict';var Sequelize=require(_0xfe0a('0x0'));module[_0xfe0a('0x1')]={'name':{'type':Sequelize[_0xfe0a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfe0a('0x3')](_0xfe0a('0x4'),_0xfe0a('0x5')),'defaultValue':_0xfe0a('0x4')},'selector':{'type':Sequelize[_0xfe0a('0x2')]},'timeout':{'type':Sequelize[_0xfe0a('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 6649257..bcd3035 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 _0xac0a=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','send','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','include','merge','options','find','catch','create','body','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x319fd8,_0x535e92){var _0x65cfd=function(_0x4ea40e){while(--_0x4ea40e){_0x319fd8['push'](_0x319fd8['shift']());}};_0x65cfd(++_0x535e92);}(_0xac0a,0x11e));var _0xaac0=function(_0x28ba9e,_0x1e8204){_0x28ba9e=_0x28ba9e-0x0;var _0x18c3cb=_0xac0a[_0x28ba9e];return _0x18c3cb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaac0('0x0'));var jsonpatch=require(_0xaac0('0x1'));var rp=require('request-promise');var moment=require(_0xaac0('0x2'));var BPromise=require(_0xaac0('0x3'));var Mustache=require(_0xaac0('0x4'));var util=require(_0xaac0('0x5'));var path=require(_0xaac0('0x6'));var sox=require(_0xaac0('0x7'));var csv=require(_0xaac0('0x8'));var ejs=require(_0xaac0('0x9'));var fs=require('fs');var fs_extra=require(_0xaac0('0xa'));var _=require(_0xaac0('0xb'));var squel=require(_0xaac0('0xc'));var crypto=require(_0xaac0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaac0('0xe'));var toCsv=require(_0xaac0('0x8'));var querystring=require('querystring');var Papa=require(_0xaac0('0xf'));var Redis=require(_0xaac0('0x10'));var authService=require(_0xaac0('0x11'));var qs=require(_0xaac0('0x12'));var as=require(_0xaac0('0x13'));var hardwareService=require(_0xaac0('0x14'));var logger=require(_0xaac0('0x15'))(_0xaac0('0x16'));var utils=require(_0xaac0('0x17'));var config=require(_0xaac0('0x18'));var licenseUtil=require(_0xaac0('0x19'));var db=require(_0xaac0('0x1a'))['db'];function respondWithStatusCode(_0x418abc,_0x2d19b8){_0x2d19b8=_0x2d19b8||0xcc;return function(_0x1a28a8){if(_0x1a28a8){return _0x418abc[_0xaac0('0x1b')](_0x2d19b8);}return _0x418abc[_0xaac0('0x1c')](_0x2d19b8)[_0xaac0('0x1d')]();};}function respondWithResult(_0x41a054,_0x259ce3){_0x259ce3=_0x259ce3||0xc8;return function(_0x8f2200){if(_0x8f2200){return _0x41a054[_0xaac0('0x1c')](_0x259ce3)[_0xaac0('0x1e')](_0x8f2200);}};}function respondWithFilteredResult(_0x3bbf93,_0x186cc1){return function(_0x3182fe){if(_0x3182fe){var _0x259d9f=typeof _0x186cc1['offset']===_0xaac0('0x1f')&&typeof _0x186cc1['limit']==='undefined';var _0x1ec445=_0x3182fe[_0xaac0('0x20')];var _0x4a7b58=_0x259d9f?0x0:_0x186cc1[_0xaac0('0x21')];var _0x3cdc8f=_0x259d9f?_0x3182fe['count']:_0x186cc1[_0xaac0('0x21')]+_0x186cc1[_0xaac0('0x22')];var _0x57cdd5;if(_0x3cdc8f>=_0x1ec445){_0x3cdc8f=_0x1ec445;_0x57cdd5=0xc8;}else{_0x57cdd5=0xce;}_0x3bbf93[_0xaac0('0x1c')](_0x57cdd5);return _0x3bbf93[_0xaac0('0x23')](_0xaac0('0x24'),_0x4a7b58+'-'+_0x3cdc8f+'/'+_0x1ec445)['json'](_0x3182fe);}return null;};}function patchUpdates(_0x58f4ba){return function(_0x3dcbe9){try{jsonpatch[_0xaac0('0x25')](_0x3dcbe9,_0x58f4ba,!![]);}catch(_0x4f6947){return BPromise['reject'](_0x4f6947);}return _0x3dcbe9[_0xaac0('0x26')]();};}function saveUpdates(_0x20a65e,_0x5aefda){return function(_0x222baa){if(_0x222baa){return _0x222baa[_0xaac0('0x27')](_0x20a65e)[_0xaac0('0x28')](function(_0x4aa2cc){return _0x4aa2cc;});}return null;};}function removeEntity(_0x430517,_0x206fb4){return function(_0x2269fd){if(_0x2269fd){return _0x2269fd[_0xaac0('0x29')]()[_0xaac0('0x28')](function(){_0x430517[_0xaac0('0x1c')](0xcc)[_0xaac0('0x1d')]();});}};}function handleEntityNotFound(_0x50106e,_0xa05ba7){return function(_0x37fa18){if(!_0x37fa18){_0x50106e[_0xaac0('0x1b')](0x194);}return _0x37fa18;};}function handleError(_0x3a0dc0,_0x48a8b4){_0x48a8b4=_0x48a8b4||0x1f4;return function(_0x2f626f){logger[_0xaac0('0x2a')](_0x2f626f[_0xaac0('0x2b')]);if(_0x2f626f['name']){delete _0x2f626f['name'];}_0x3a0dc0[_0xaac0('0x1c')](_0x48a8b4)[_0xaac0('0x2c')](_0x2f626f);};}exports['show']=function(_0x5c8563,_0x2bc7b6){var _0x8432d7={'raw':!![],'where':{'id':_0x5c8563['params']['id']}},_0x50aae6={};_0x50aae6[_0xaac0('0x2d')]=_[_0xaac0('0x2e')](db[_0xaac0('0x2f')][_0xaac0('0x30')]);_0x50aae6[_0xaac0('0x31')]=_['keys'](_0x5c8563[_0xaac0('0x31')]);_0x50aae6[_0xaac0('0x32')]=_[_0xaac0('0x33')](_0x50aae6[_0xaac0('0x2d')],_0x50aae6[_0xaac0('0x31')]);_0x8432d7['attributes']=_[_0xaac0('0x33')](_0x50aae6['model'],qs[_0xaac0('0x34')](_0x5c8563[_0xaac0('0x31')]['fields']));_0x8432d7[_0xaac0('0x35')]=_0x8432d7[_0xaac0('0x35')]['length']?_0x8432d7[_0xaac0('0x35')]:_0x50aae6['model'];if(_0x5c8563[_0xaac0('0x31')]['includeAll']){_0x8432d7[_0xaac0('0x36')]=[{'all':!![]}];}_0x8432d7=_[_0xaac0('0x37')]({},_0x8432d7,_0x5c8563[_0xaac0('0x38')]);return db[_0xaac0('0x2f')][_0xaac0('0x39')](_0x8432d7)[_0xaac0('0x28')](handleEntityNotFound(_0x2bc7b6,null))[_0xaac0('0x28')](respondWithResult(_0x2bc7b6,null))[_0xaac0('0x3a')](handleError(_0x2bc7b6,null));};exports[_0xaac0('0x3b')]=function(_0x36a8a8,_0x30a33a){return db['ChatProactiveAction'][_0xaac0('0x3b')](_0x36a8a8[_0xaac0('0x3c')],{})[_0xaac0('0x28')](respondWithResult(_0x30a33a,0xc9))[_0xaac0('0x3a')](handleError(_0x30a33a,null));};exports['update']=function(_0x4f6e4c,_0x5814c8){if(_0x4f6e4c['body']['id']){delete _0x4f6e4c[_0xaac0('0x3c')]['id'];}return db[_0xaac0('0x2f')][_0xaac0('0x39')]({'where':{'id':_0x4f6e4c['params']['id']}})['then'](handleEntityNotFound(_0x5814c8,null))[_0xaac0('0x28')](saveUpdates(_0x4f6e4c[_0xaac0('0x3c')],null))[_0xaac0('0x28')](respondWithResult(_0x5814c8,null))[_0xaac0('0x3a')](handleError(_0x5814c8,null));};exports['destroy']=function(_0x545544,_0x47ab5d){return db[_0xaac0('0x2f')][_0xaac0('0x39')]({'where':{'id':_0x545544[_0xaac0('0x3d')]['id']}})[_0xaac0('0x28')](handleEntityNotFound(_0x47ab5d,null))[_0xaac0('0x28')](removeEntity(_0x47ab5d,null))['catch'](handleError(_0x47ab5d,null));};
\ No newline at end of file
+var _0xa87e=['length','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields'];(function(_0x5828f4,_0xc0a643){var _0x4ab242=function(_0x727a6d){while(--_0x727a6d){_0x5828f4['push'](_0x5828f4['shift']());}};_0x4ab242(++_0xc0a643);}(_0xa87e,0x1c2));var _0xea87=function(_0x2cd2bf,_0x327362){_0x2cd2bf=_0x2cd2bf-0x0;var _0x1ffed5=_0xa87e[_0x2cd2bf];return _0x1ffed5;};'use strict';var emlformat=require(_0xea87('0x0'));var rimraf=require(_0xea87('0x1'));var zipdir=require(_0xea87('0x2'));var jsonpatch=require(_0xea87('0x3'));var rp=require('request-promise');var moment=require(_0xea87('0x4'));var BPromise=require(_0xea87('0x5'));var Mustache=require(_0xea87('0x6'));var util=require('util');var path=require(_0xea87('0x7'));var sox=require(_0xea87('0x8'));var csv=require(_0xea87('0x9'));var ejs=require(_0xea87('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea87('0xb'));var squel=require(_0xea87('0xc'));var crypto=require(_0xea87('0xd'));var jsforce=require(_0xea87('0xe'));var deskjs=require(_0xea87('0xf'));var toCsv=require(_0xea87('0x9'));var querystring=require(_0xea87('0x10'));var Papa=require(_0xea87('0x11'));var Redis=require(_0xea87('0x12'));var authService=require(_0xea87('0x13'));var qs=require(_0xea87('0x14'));var as=require(_0xea87('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea87('0x16'))(_0xea87('0x17'));var utils=require(_0xea87('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xea87('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcfefe4,_0x34eab0){_0x34eab0=_0x34eab0||0xcc;return function(_0x15c163){if(_0x15c163){return _0xcfefe4['sendStatus'](_0x34eab0);}return _0xcfefe4[_0xea87('0x1a')](_0x34eab0)[_0xea87('0x1b')]();};}function respondWithResult(_0xe33198,_0x2d1d7c){_0x2d1d7c=_0x2d1d7c||0xc8;return function(_0x2c7787){if(_0x2c7787){return _0xe33198[_0xea87('0x1a')](_0x2d1d7c)[_0xea87('0x1c')](_0x2c7787);}};}function respondWithFilteredResult(_0x488658,_0x2f170f){return function(_0x4f3b7d){if(_0x4f3b7d){var _0x58622e=typeof _0x2f170f['offset']==='undefined'&&typeof _0x2f170f[_0xea87('0x1d')]===_0xea87('0x1e');var _0x25af8f=_0x4f3b7d['count'];var _0x540d7d=_0x58622e?0x0:_0x2f170f['offset'];var _0x1ef58e=_0x58622e?_0x4f3b7d[_0xea87('0x1f')]:_0x2f170f[_0xea87('0x20')]+_0x2f170f[_0xea87('0x1d')];var _0x4b42a1;if(_0x1ef58e>=_0x25af8f){_0x1ef58e=_0x25af8f;_0x4b42a1=0xc8;}else{_0x4b42a1=0xce;}_0x488658[_0xea87('0x1a')](_0x4b42a1);return _0x488658[_0xea87('0x21')](_0xea87('0x22'),_0x540d7d+'-'+_0x1ef58e+'/'+_0x25af8f)['json'](_0x4f3b7d);}return null;};}function patchUpdates(_0x57ee13){return function(_0x1a4096){try{jsonpatch[_0xea87('0x23')](_0x1a4096,_0x57ee13,!![]);}catch(_0x1f449f){return BPromise[_0xea87('0x24')](_0x1f449f);}return _0x1a4096[_0xea87('0x25')]();};}function saveUpdates(_0x41cf0c,_0x2280f8){return function(_0x1f553f){if(_0x1f553f){return _0x1f553f['update'](_0x41cf0c)[_0xea87('0x26')](function(_0x275a7a){return _0x275a7a;});}return null;};}function removeEntity(_0x5a0ea1,_0x233058){return function(_0x452425){if(_0x452425){return _0x452425[_0xea87('0x27')]()[_0xea87('0x26')](function(){_0x5a0ea1['status'](0xcc)[_0xea87('0x1b')]();});}};}function handleEntityNotFound(_0x2d0f03,_0x510a2c){return function(_0xb65c63){if(!_0xb65c63){_0x2d0f03['sendStatus'](0x194);}return _0xb65c63;};}function handleError(_0x4452aa,_0x37f58c){_0x37f58c=_0x37f58c||0x1f4;return function(_0x417847){logger[_0xea87('0x28')](_0x417847[_0xea87('0x29')]);if(_0x417847[_0xea87('0x2a')]){delete _0x417847[_0xea87('0x2a')];}_0x4452aa[_0xea87('0x1a')](_0x37f58c)[_0xea87('0x2b')](_0x417847);};}exports['show']=function(_0x5d2b86,_0x475734){var _0x453bc3={'raw':!![],'where':{'id':_0x5d2b86[_0xea87('0x2c')]['id']}},_0x97db5c={};_0x97db5c[_0xea87('0x2d')]=_[_0xea87('0x2e')](db[_0xea87('0x2f')][_0xea87('0x30')]);_0x97db5c['query']=_['keys'](_0x5d2b86[_0xea87('0x31')]);_0x97db5c[_0xea87('0x32')]=_['intersection'](_0x97db5c[_0xea87('0x2d')],_0x97db5c[_0xea87('0x31')]);_0x453bc3[_0xea87('0x33')]=_[_0xea87('0x34')](_0x97db5c['model'],qs[_0xea87('0x35')](_0x5d2b86[_0xea87('0x31')][_0xea87('0x35')]));_0x453bc3['attributes']=_0x453bc3['attributes'][_0xea87('0x36')]?_0x453bc3[_0xea87('0x33')]:_0x97db5c[_0xea87('0x2d')];if(_0x5d2b86['query'][_0xea87('0x37')]){_0x453bc3[_0xea87('0x38')]=[{'all':!![]}];}_0x453bc3=_[_0xea87('0x39')]({},_0x453bc3,_0x5d2b86[_0xea87('0x3a')]);return db[_0xea87('0x2f')][_0xea87('0x3b')](_0x453bc3)[_0xea87('0x26')](handleEntityNotFound(_0x475734,null))['then'](respondWithResult(_0x475734,null))[_0xea87('0x3c')](handleError(_0x475734,null));};exports[_0xea87('0x3d')]=function(_0x235e2f,_0x1b9daf){return db[_0xea87('0x2f')][_0xea87('0x3d')](_0x235e2f[_0xea87('0x3e')],{})[_0xea87('0x26')](respondWithResult(_0x1b9daf,0xc9))[_0xea87('0x3c')](handleError(_0x1b9daf,null));};exports['update']=function(_0x303f8e,_0x494c53){if(_0x303f8e[_0xea87('0x3e')]['id']){delete _0x303f8e[_0xea87('0x3e')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x303f8e[_0xea87('0x2c')]['id']}})[_0xea87('0x26')](handleEntityNotFound(_0x494c53,null))[_0xea87('0x26')](saveUpdates(_0x303f8e[_0xea87('0x3e')],null))[_0xea87('0x26')](respondWithResult(_0x494c53,null))[_0xea87('0x3c')](handleError(_0x494c53,null));};exports['destroy']=function(_0x583e6c,_0x533869){return db['ChatProactiveAction']['find']({'where':{'id':_0x583e6c['params']['id']}})['then'](handleEntityNotFound(_0x533869,null))[_0xea87('0x26')](removeEntity(_0x533869,null))['catch'](handleError(_0x533869,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 8b58f14..275b86a 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 _0x2aaf=['request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','moment','bluebird'];(function(_0x171635,_0x1e9d6b){var _0x5bb29f=function(_0x1b5bef){while(--_0x1b5bef){_0x171635['push'](_0x171635['shift']());}};_0x5bb29f(++_0x1e9d6b);}(_0x2aaf,0x18e));var _0xf2aa=function(_0x4c5a9f,_0x184db7){_0x4c5a9f=_0x4c5a9f-0x0;var _0x548f59=_0x2aaf[_0x4c5a9f];return _0x548f59;};'use strict';var _=require(_0xf2aa('0x0'));var util=require(_0xf2aa('0x1'));var logger=require('../../config/logger')(_0xf2aa('0x2'));var moment=require(_0xf2aa('0x3'));var BPromise=require(_0xf2aa('0x4'));var rp=require(_0xf2aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2aa('0x6'));var config=require(_0xf2aa('0x7'));var attributes=require(_0xf2aa('0x8'));module[_0xf2aa('0x9')]=function(_0x2938e8,_0x536380){return _0x2938e8[_0xf2aa('0xa')](_0xf2aa('0xb'),attributes,{'tableName':_0xf2aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6af5=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','api','moment'];(function(_0x11d3ae,_0xce4cf3){var _0x33d1fc=function(_0xb3e53c){while(--_0xb3e53c){_0x11d3ae['push'](_0x11d3ae['shift']());}};_0x33d1fc(++_0xce4cf3);}(_0x6af5,0x1ca));var _0x56af=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x6af5[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x56af('0x0'));var util=require(_0x56af('0x1'));var logger=require('../../config/logger')(_0x56af('0x2'));var moment=require(_0x56af('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x56af('0x4'));var rimraf=require(_0x56af('0x5'));var config=require(_0x56af('0x6'));var attributes=require(_0x56af('0x7'));module[_0x56af('0x8')]=function(_0x49428a,_0x1d692b){return _0x49428a[_0x56af('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x56af('0xa'),'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 2ed4d75..fd6e8be 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 _0x8332=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','result'];(function(_0x1335cd,_0x5d41b5){var _0x391787=function(_0x11bd94){while(--_0x11bd94){_0x1335cd['push'](_0x1335cd['shift']());}};_0x391787(++_0x5d41b5);}(_0x8332,0x6b));var _0x2833=function(_0x30cffe,_0x5b0a2d){_0x30cffe=_0x30cffe-0x0;var _0x46cf4e=_0x8332[_0x30cffe];return _0x46cf4e;};'use strict';var _=require(_0x2833('0x0'));var util=require('util');var moment=require(_0x2833('0x1'));var BPromise=require(_0x2833('0x2'));var rs=require(_0x2833('0x3'));var fs=require('fs');var Redis=require(_0x2833('0x4'));var db=require(_0x2833('0x5'))['db'];var utils=require(_0x2833('0x6'));var logger=require(_0x2833('0x7'))('rpc');var config=require(_0x2833('0x8'));var jayson=require(_0x2833('0x9'));var client=jayson['client'][_0x2833('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d99b5,_0x1e0c0e,_0x4b7add){return new BPromise(function(_0x324e40,_0x58be64){return client['request'](_0x2d99b5,_0x4b7add)[_0x2833('0xb')](function(_0x4ca852){logger[_0x2833('0xc')](_0x2833('0xd'),_0x1e0c0e,_0x2833('0xe'));logger[_0x2833('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1e0c0e,_0x2833('0xe'),JSON[_0x2833('0x10')](_0x4ca852));if(_0x4ca852['error']){if(_0x4ca852[_0x2833('0x11')]['code']===0x1f4){logger['error'](_0x2833('0xd'),_0x1e0c0e,_0x4ca852[_0x2833('0x11')]['message']);return _0x58be64(_0x4ca852[_0x2833('0x11')]['message']);}logger[_0x2833('0x11')](_0x2833('0xd'),_0x1e0c0e,_0x4ca852[_0x2833('0x11')]['message']);return _0x324e40(_0x4ca852[_0x2833('0x11')]['message']);}else{logger[_0x2833('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x1e0c0e,_0x2833('0xe'));_0x324e40(_0x4ca852[_0x2833('0x12')][_0x2833('0x13')]);}})[_0x2833('0x14')](function(_0x328cab){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1e0c0e,_0x328cab);_0x58be64(_0x328cab);});});}
\ No newline at end of file
+var _0x9904=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9904,0x1a4));var _0x4990=function(_0x1057cb,_0x7b8162){_0x1057cb=_0x1057cb-0x0;var _0x7fbf7e=_0x9904[_0x1057cb];return _0x7fbf7e;};'use strict';var _=require(_0x4990('0x0'));var util=require('util');var moment=require(_0x4990('0x1'));var BPromise=require('bluebird');var rs=require(_0x4990('0x2'));var fs=require('fs');var Redis=require(_0x4990('0x3'));var db=require(_0x4990('0x4'))['db'];var utils=require(_0x4990('0x5'));var logger=require(_0x4990('0x6'))(_0x4990('0x7'));var config=require('../../config/environment');var jayson=require(_0x4990('0x8'));var client=jayson[_0x4990('0x9')][_0x4990('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a7554,_0x490778,_0x2a2030){return new BPromise(function(_0x5e7967,_0x1d32dd){return client[_0x4990('0xb')](_0x3a7554,_0x2a2030)['then'](function(_0x358469){logger[_0x4990('0xc')](_0x4990('0xd'),_0x490778,_0x4990('0xe'));logger[_0x4990('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x490778,'request\x20sent',JSON[_0x4990('0x10')](_0x358469));if(_0x358469[_0x4990('0x11')]){if(_0x358469[_0x4990('0x11')]['code']===0x1f4){logger[_0x4990('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x490778,_0x358469[_0x4990('0x11')][_0x4990('0x12')]);return _0x1d32dd(_0x358469[_0x4990('0x11')][_0x4990('0x12')]);}logger[_0x4990('0x11')](_0x4990('0xd'),_0x490778,_0x358469[_0x4990('0x11')][_0x4990('0x12')]);return _0x5e7967(_0x358469['error'][_0x4990('0x12')]);}else{logger['info'](_0x4990('0xd'),_0x490778,_0x4990('0xe'));_0x5e7967(_0x358469['result']['message']);}})[_0x4990('0x13')](function(_0x1c2b47){logger['error'](_0x4990('0xd'),_0x490778,_0x1c2b47);_0x1d32dd(_0x1c2b47);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index a585c27..8491635 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 _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x2bd8,0x130));var _0x82bd=function(_0x8c4603,_0x2c0c2c){_0x8c4603=_0x8c4603-0x0;var _0x3cf1f9=_0x2bd8[_0x8c4603];return _0x3cf1f9;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router;
\ No newline at end of file
+var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x27c1cc,_0x18cee7){var _0x4ee271=function(_0x391308){while(--_0x391308){_0x27c1cc['push'](_0x27c1cc['shift']());}};_0x4ee271(++_0x18cee7);}(_0x032e,0x124));var _0xe032=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x032e[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 803f229..86fcb9b 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 _0xaca4=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3ec9cc,_0x7659b0){var _0x215f11=function(_0x370554){while(--_0x370554){_0x3ec9cc['push'](_0x3ec9cc['shift']());}};_0x215f11(++_0x7659b0);}(_0xaca4,0x179));var _0x4aca=function(_0x2b6876,_0x193ced){_0x2b6876=_0x2b6876-0x0;var _0x5e613e=_0xaca4[_0x2b6876];return _0x5e613e;};'use strict';var Sequelize=require(_0x4aca('0x0'));module[_0x4aca('0x1')]={'name':{'type':Sequelize[_0x4aca('0x2')],'unique':_0x4aca('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4aca('0x2')]},'timeout':{'type':Sequelize[_0x4aca('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4aca('0x5')](_0x4aca('0x6'),_0x4aca('0x7'),_0x4aca('0x8'))}};
\ No newline at end of file
+var _0x05c1=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x3ce0d2,_0x245c50){var _0x5322a0=function(_0x17ba88){while(--_0x17ba88){_0x3ce0d2['push'](_0x3ce0d2['shift']());}};_0x5322a0(++_0x245c50);}(_0x05c1,0xed));var _0x105c=function(_0x3c5735,_0x1f4f53){_0x3c5735=_0x3c5735-0x0;var _0x2cd61d=_0x05c1[_0x3c5735];return _0x2cd61d;};'use strict';var Sequelize=require(_0x105c('0x0'));module[_0x105c('0x1')]={'name':{'type':Sequelize[_0x105c('0x2')],'unique':_0x105c('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x105c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x105c('0x5')](_0x105c('0x6'),_0x105c('0x7'),_0x105c('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 0bcfe76..1f4ec87 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 _0x96ae=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','status','offset','undefined','count','limit','set','json','update','then','destroy','get','ChatQueues','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','query','findAll','show','params','ChatQueue','keys','model','intersection','fields','attributes','includeAll','include','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','describe','getMembers','findOne','UserChatQueue','filters','length','hasOwnProperty','order','sort','ChatQueueId','filter','merge','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','pick','nolimit','Team','Agents','online','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','util','lodash','squel','ioredis'];(function(_0x555d1e,_0x4bcfdb){var _0x3aee29=function(_0x3a5311){while(--_0x3a5311){_0x555d1e['push'](_0x555d1e['shift']());}};_0x3aee29(++_0x4bcfdb);}(_0x96ae,0xfc));var _0xe96a=function(_0x1e2f72,_0x4ecd3d){_0x1e2f72=_0x1e2f72-0x0;var _0x2f00a8=_0x96ae[_0x1e2f72];return _0x2f00a8;};'use strict';var BPromise=require('bluebird');var util=require(_0xe96a('0x0'));var _=require(_0xe96a('0x1'));var squel=require(_0xe96a('0x2'));var Redis=require(_0xe96a('0x3'));var qs=require(_0xe96a('0x4'));var logger=require(_0xe96a('0x5'))(_0xe96a('0x6'));var config=require(_0xe96a('0x7'));var db=require(_0xe96a('0x8'))['db'];config[_0xe96a('0x9')]=_[_0xe96a('0xa')](config['redis'],{'host':_0xe96a('0xb'),'port':0x18eb});var socket=require(_0xe96a('0xc'))(new Redis(config[_0xe96a('0x9')]));require(_0xe96a('0xd'))[_0xe96a('0xe')](socket);function respondWithStatusCode(_0x5b5f3d,_0x2d57ae){_0x2d57ae=_0x2d57ae||0xcc;return function(_0x408d26){if(_0x408d26){return _0x5b5f3d['sendStatus'](_0x2d57ae);}return _0x5b5f3d[_0xe96a('0xf')](_0x2d57ae)['end']();};}function respondWithResult(_0x323567,_0x4bae6c){_0x4bae6c=_0x4bae6c||0xc8;return function(_0x53e3a1){if(_0x53e3a1){return _0x323567['status'](_0x4bae6c)['json'](_0x53e3a1);}};}function respondWithFilteredResult(_0xf32694,_0x3dd7aa){return function(_0x74b282){if(_0x74b282){var _0x4f10a0=typeof _0x3dd7aa[_0xe96a('0x10')]===_0xe96a('0x11')&&typeof _0x3dd7aa['limit']===_0xe96a('0x11');var _0x41bc1d=_0x74b282[_0xe96a('0x12')];var _0x210224=_0x4f10a0?0x0:_0x3dd7aa[_0xe96a('0x10')];var _0x427237=_0x4f10a0?_0x74b282[_0xe96a('0x12')]:_0x3dd7aa[_0xe96a('0x10')]+_0x3dd7aa[_0xe96a('0x13')];var _0x4552ca;if(_0x427237>=_0x41bc1d){_0x427237=_0x41bc1d;_0x4552ca=0xc8;}else{_0x4552ca=0xce;}_0xf32694['status'](_0x4552ca);return _0xf32694[_0xe96a('0x14')]('Content-Range',_0x210224+'-'+_0x427237+'/'+_0x41bc1d)[_0xe96a('0x15')](_0x74b282);}return null;};}function saveUpdates(_0x1fd976){return function(_0xe5ab2c){if(_0xe5ab2c){return _0xe5ab2c[_0xe96a('0x16')](_0x1fd976)[_0xe96a('0x17')](function(_0x136c76){return _0x136c76;});}return null;};}function removeEntity(_0x5d7005){return function(_0x18fb44){if(_0x18fb44){return _0x18fb44[_0xe96a('0x18')]()[_0xe96a('0x17')](function(){var _0x338b60=_0x18fb44[_0xe96a('0x19')]({'plain':!![]});var _0x19e67c=_0xe96a('0x1a');return db['UserProfileResource'][_0xe96a('0x18')]({'where':{'type':_0x19e67c,'resourceId':_0x338b60['id']}})[_0xe96a('0x17')](function(){return _0x18fb44;});})['then'](function(){_0x5d7005[_0xe96a('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f6493){return function(_0x526fd2){if(!_0x526fd2){_0x4f6493[_0xe96a('0x1b')](0x194);}return _0x526fd2;};}function handleError(_0x2da20b,_0x3a0e2e){_0x3a0e2e=_0x3a0e2e||0x1f4;return function(_0x2fb83e){logger[_0xe96a('0x1c')](_0x2fb83e[_0xe96a('0x1d')]);if(_0x2fb83e['name']){delete _0x2fb83e[_0xe96a('0x1e')];}_0x2da20b[_0xe96a('0xf')](_0x3a0e2e)[_0xe96a('0x1f')](_0x2fb83e);};}exports[_0xe96a('0x20')]=function(_0x1fd315,_0x418bd0){var _0x52e9b8={};var _0x308bd6={'count':0x0,'rows':[]};var _0xe09d50=_[_0xe96a('0x21')](db['ChatQueue'][_0xe96a('0x22')],function(_0x8928e0){return{'name':_0x8928e0[_0xe96a('0x23')],'type':_0x8928e0[_0xe96a('0x24')][_0xe96a('0x25')]};});_0x52e9b8=qs[_0xe96a('0x26')](_0xe09d50,_0x1fd315);var _0x41b84c={'where':_0x52e9b8[_0xe96a('0x27')]};return db['ChatQueue'][_0xe96a('0x12')](_0x41b84c)[_0xe96a('0x17')](function(_0x12b724){_0x308bd6[_0xe96a('0x12')]=_0x12b724;_0x52e9b8['include']=qs['include'](_0x1fd315[_0xe96a('0x28')]);return db['ChatQueue'][_0xe96a('0x29')](_0x52e9b8);})['then'](function(_0x26a7d7){_0x308bd6['rows']=_0x26a7d7;return _0x308bd6;})[_0xe96a('0x17')](respondWithFilteredResult(_0x418bd0,_0x52e9b8))['catch'](handleError(_0x418bd0,null));};exports[_0xe96a('0x2a')]=function(_0x3d175a,_0x533d4f){var _0x1fba9d={'raw':!![],'where':{'id':_0x3d175a[_0xe96a('0x2b')]['id']}},_0x5e51e2={};_0x5e51e2['model']=_['keys'](db[_0xe96a('0x2c')][_0xe96a('0x22')]);_0x5e51e2[_0xe96a('0x28')]=_[_0xe96a('0x2d')](_0x3d175a['query']);_0x5e51e2['filters']=_['intersection'](_0x5e51e2[_0xe96a('0x2e')],_0x5e51e2['query']);_0x1fba9d['attributes']=_[_0xe96a('0x2f')](_0x5e51e2[_0xe96a('0x2e')],qs[_0xe96a('0x30')](_0x3d175a[_0xe96a('0x28')][_0xe96a('0x30')]));_0x1fba9d[_0xe96a('0x31')]=_0x1fba9d[_0xe96a('0x31')]['length']?_0x1fba9d['attributes']:_0x5e51e2['model'];if(_0x3d175a[_0xe96a('0x28')][_0xe96a('0x32')]){_0x1fba9d[_0xe96a('0x33')]=[{'all':!![]}];}_0x1fba9d=_['merge']({},_0x1fba9d,_0x3d175a[_0xe96a('0x34')]);return db[_0xe96a('0x2c')][_0xe96a('0x35')](_0x1fba9d)['then'](handleEntityNotFound(_0x533d4f,null))['then'](respondWithResult(_0x533d4f,null))[_0xe96a('0x36')](handleError(_0x533d4f,null));};exports['create']=function(_0x55e891,_0x18c151){return db[_0xe96a('0x2c')][_0xe96a('0x37')](_0x55e891['body'],{})['then'](function(_0x93e172){var _0x1bec3b=_0x55e891['user'][_0xe96a('0x19')]({'plain':!![]});if(!_0x1bec3b)throw new Error(_0xe96a('0x38'));if(_0x1bec3b['role']==='user'){var _0x3a076d=_0x93e172['get']({'plain':!![]});var _0x5a6a58=_0xe96a('0x1a');return db[_0xe96a('0x39')][_0xe96a('0x35')]({'where':{'name':_0x5a6a58,'userProfileId':_0x1bec3b[_0xe96a('0x3a')]},'raw':!![]})[_0xe96a('0x17')](function(_0x2593ff){if(_0x2593ff&&_0x2593ff[_0xe96a('0x3b')]===0x0){return db[_0xe96a('0x3c')][_0xe96a('0x37')]({'name':_0x3a076d['name'],'resourceId':_0x3a076d['id'],'type':_0x2593ff['name'],'sectionId':_0x2593ff['id']},{})[_0xe96a('0x17')](function(){return _0x93e172;});}else{return _0x93e172;}})['catch'](function(_0x50ea3b){logger[_0xe96a('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ea3b);throw _0x50ea3b;});}return _0x93e172;})[_0xe96a('0x17')](respondWithResult(_0x18c151,0xc9))[_0xe96a('0x36')](handleError(_0x18c151,null));};exports[_0xe96a('0x16')]=function(_0x5e6e6c,_0x3d836d){if(_0x5e6e6c[_0xe96a('0x3d')]['id']){delete _0x5e6e6c['body']['id'];}return db[_0xe96a('0x2c')][_0xe96a('0x35')]({'where':{'id':_0x5e6e6c[_0xe96a('0x2b')]['id']}})[_0xe96a('0x17')](handleEntityNotFound(_0x3d836d,null))['then'](saveUpdates(_0x5e6e6c[_0xe96a('0x3d')],null))[_0xe96a('0x17')](respondWithResult(_0x3d836d,null))[_0xe96a('0x36')](handleError(_0x3d836d,null));};exports[_0xe96a('0x18')]=function(_0x28f0fa,_0x120b67){return db[_0xe96a('0x2c')][_0xe96a('0x35')]({'where':{'id':_0x28f0fa[_0xe96a('0x2b')]['id']}})[_0xe96a('0x17')](handleEntityNotFound(_0x120b67,null))[_0xe96a('0x17')](removeEntity(_0x120b67,null))['catch'](handleError(_0x120b67,null));};exports[_0xe96a('0x3e')]=function(_0x5abc9c,_0x4df340){return db[_0xe96a('0x2c')][_0xe96a('0x3e')]()['then'](respondWithResult(_0x4df340,null))[_0xe96a('0x36')](handleError(_0x4df340,null));};exports[_0xe96a('0x3f')]=function(_0x23cdb3,_0x2aeecf){var _0x12045d={'raw':!![],'where':{}},_0x376506={},_0x4752c2;return db['ChatQueue'][_0xe96a('0x40')]({'where':{'id':_0x23cdb3[_0xe96a('0x2b')]['id']}})[_0xe96a('0x17')](handleEntityNotFound(_0x2aeecf,null))[_0xe96a('0x17')](function(_0x1713c2){if(_0x1713c2){_0x4752c2=_0x1713c2[_0xe96a('0x19')]({'plain':!![]});_0x376506[_0xe96a('0x2e')]=_[_0xe96a('0x2d')](db[_0xe96a('0x41')][_0xe96a('0x22')]);_0x376506[_0xe96a('0x28')]=_['keys'](_0x23cdb3['query']);_0x376506[_0xe96a('0x42')]=_[_0xe96a('0x2f')](_0x376506[_0xe96a('0x2e')],_0x376506[_0xe96a('0x28')]);_0x12045d['attributes']=_[_0xe96a('0x2f')](_0x376506[_0xe96a('0x2e')],qs['fields'](_0x23cdb3[_0xe96a('0x28')][_0xe96a('0x30')]));_0x12045d[_0xe96a('0x31')]=_0x12045d[_0xe96a('0x31')][_0xe96a('0x43')]?_0x12045d['attributes']:_0x376506[_0xe96a('0x2e')];if(!_0x23cdb3[_0xe96a('0x28')][_0xe96a('0x44')]('nolimit')){_0x12045d[_0xe96a('0x13')]=qs[_0xe96a('0x13')](_0x23cdb3[_0xe96a('0x28')]['limit']);_0x12045d[_0xe96a('0x10')]=qs[_0xe96a('0x10')](_0x23cdb3[_0xe96a('0x28')][_0xe96a('0x10')]);}_0x12045d[_0xe96a('0x45')]=qs['sort'](_0x23cdb3[_0xe96a('0x28')][_0xe96a('0x46')]);_0x12045d['where']=qs[_0xe96a('0x42')](_['pick'](_0x23cdb3[_0xe96a('0x28')],_0x376506[_0xe96a('0x42')]));_0x12045d[_0xe96a('0x27')][_0xe96a('0x47')]=_0x1713c2['id'];if(_0x23cdb3[_0xe96a('0x28')][_0xe96a('0x48')]){_0x12045d[_0xe96a('0x27')]=_['merge'](_0x12045d[_0xe96a('0x27')],{'$or':_[_0xe96a('0x21')](_0x12045d[_0xe96a('0x31')],function(_0x257117){var _0x2b59c2={};_0x2b59c2[_0x257117]={'$like':'%'+_0x23cdb3['query'][_0xe96a('0x48')]+'%'};return _0x2b59c2;})});}_0x12045d=_[_0xe96a('0x49')]({},_0x12045d,_0x23cdb3[_0xe96a('0x34')]);return db[_0xe96a('0x41')]['findAll'](_0x12045d);}})[_0xe96a('0x17')](function(_0x564dca){if(_0x564dca){return db[_0xe96a('0x4a')][_0xe96a('0x4b')]({'where':{'id':_[_0xe96a('0x21')](_0x564dca,_0xe96a('0x4c')),'role':_0xe96a('0x4d')},'attributes':['id',_0xe96a('0x1e'),_0xe96a('0x4e'),_0xe96a('0x4f'),_0xe96a('0x50')]});}})[_0xe96a('0x17')](function(_0x1a79ea){if(_0x1a79ea){return{'count':_0x1a79ea[_0xe96a('0x12')],'rows':_[_0xe96a('0x21')](_0x1a79ea[_0xe96a('0x51')],function(_0x332dc2){return{'membername':_0x332dc2['name'],'UserId':_0x332dc2['id'],'queue_name':_0x4752c2[_0xe96a('0x1e')],'ChatQueueId':_0x4752c2['id'],'interface':util[_0xe96a('0x52')](_0xe96a('0x53'),_0xe96a('0x54'),_0x332dc2[_0xe96a('0x1e')]),'penalty':0x0,'paused':_0x332dc2[_0xe96a('0x4e')],'createdAt':_0x332dc2[_0xe96a('0x50')],'updatedAt':_0x332dc2[_0xe96a('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe96a('0x17')](respondWithFilteredResult(_0x2aeecf,_0x12045d))['catch'](handleError(_0x2aeecf,null));};exports[_0xe96a('0x55')]=function(_0x24a9a6,_0x4c076c){var _0x447262={};var _0x2e5ea2={};var _0x5f2488;var _0x447794;return db[_0xe96a('0x2c')][_0xe96a('0x40')]({'where':{'id':_0x24a9a6[_0xe96a('0x2b')]['id']}})[_0xe96a('0x17')](handleEntityNotFound(_0x4c076c,null))[_0xe96a('0x17')](function(_0x5378b7){if(_0x5378b7){_0x5f2488=_0x5378b7;_0x2e5ea2[_0xe96a('0x2e')]=_['keys'](db['Team']['rawAttributes']);_0x2e5ea2['query']=_[_0xe96a('0x2d')](_0x24a9a6['query']);_0x2e5ea2['filters']=_['intersection'](_0x2e5ea2[_0xe96a('0x2e')],_0x2e5ea2[_0xe96a('0x28')]);_0x447262['attributes']=_[_0xe96a('0x2f')](_0x2e5ea2[_0xe96a('0x2e')],qs['fields'](_0x24a9a6[_0xe96a('0x28')][_0xe96a('0x30')]));_0x447262[_0xe96a('0x31')]=_0x447262[_0xe96a('0x31')]['length']?_0x447262[_0xe96a('0x31')]:_0x2e5ea2[_0xe96a('0x2e')];_0x447262[_0xe96a('0x45')]=qs[_0xe96a('0x46')](_0x24a9a6[_0xe96a('0x28')][_0xe96a('0x46')]);_0x447262[_0xe96a('0x27')]=qs[_0xe96a('0x42')](_[_0xe96a('0x56')](_0x24a9a6['query'],_0x2e5ea2[_0xe96a('0x42')]));if(_0x24a9a6['query']['filter']){_0x447262[_0xe96a('0x27')]=_[_0xe96a('0x49')](_0x447262[_0xe96a('0x27')],{'$or':_[_0xe96a('0x21')](_0x447262[_0xe96a('0x31')],function(_0x556674){var _0x39acec={};_0x39acec[_0x556674]={'$like':'%'+_0x24a9a6[_0xe96a('0x28')][_0xe96a('0x48')]+'%'};return _0x39acec;})});}_0x447262=_['merge']({},_0x447262,_0x24a9a6['options']);return _0x5f2488[_0xe96a('0x55')](_0x447262);}})[_0xe96a('0x17')](function(_0x58bc1a){if(_0x58bc1a){_0x447794=_0x58bc1a[_0xe96a('0x43')];if(!_0x24a9a6[_0xe96a('0x28')][_0xe96a('0x44')](_0xe96a('0x57'))){_0x447262[_0xe96a('0x13')]=qs[_0xe96a('0x13')](_0x24a9a6[_0xe96a('0x28')][_0xe96a('0x13')]);_0x447262[_0xe96a('0x10')]=qs['offset'](_0x24a9a6[_0xe96a('0x28')]['offset']);}return _0x5f2488[_0xe96a('0x55')](_0x447262);}})['then'](function(_0x1eb844){if(_0x1eb844){return _0x1eb844?{'count':_0x447794,'rows':_0x1eb844}:null;}})[_0xe96a('0x17')](respondWithResult(_0x4c076c,null))[_0xe96a('0x36')](handleError(_0x4c076c,null));};exports['addTeams']=function(_0x323c06,_0x32b035){var _0x5ae6e7=_0x323c06[_0xe96a('0x3d')]['ids'];return db[_0xe96a('0x58')][_0xe96a('0x29')]({'where':{'id':_0x5ae6e7},'attributes':['id'],'include':[{'model':db[_0xe96a('0x4a')],'as':_0xe96a('0x59'),'attributes':['id','name',_0xe96a('0x5a'),'voicePause','interface'],'raw':!![]}]})[_0xe96a('0x17')](function(_0x36421b){if(_0x36421b){var _0x19bc49=_[_0xe96a('0x5b')](_0x36421b,function(_0x2db234){var _0x109986=_0x2db234['get']({'plain':!![]});return _0x109986[_0xe96a('0x59')];});return db['ChatQueue'][_0xe96a('0x35')]({'where':{'id':_0x323c06['params']['id']}})['then'](function(_0x4b5d4d){return db[_0xe96a('0x5c')][_0xe96a('0x5d')](function(_0x263916){return _0x4b5d4d[_0xe96a('0x5e')](_0x5ae6e7,{'transaction':_0x263916})[_0xe96a('0x17')](function(){return BPromise[_0xe96a('0x5f')](_0x19bc49,function(_0x5c2383){return db['UserChatQueue'][_0xe96a('0x60')]({'where':{'UserId':_0x5c2383['id'],'ChatQueueId':_0x323c06['params']['id']},'transaction':_0x263916});});})[_0xe96a('0x17')](function(){_0x19bc49[_0xe96a('0x61')](function(_0x12f779){socket[_0xe96a('0x62')](_0xe96a('0x63'),{'UserId':_0x12f779['id'],'ChatQueueId':_0x4b5d4d['id']});});});});});}})[_0xe96a('0x17')](respondWithStatusCode(_0x32b035,null))['catch'](handleError(_0x32b035,null));};exports[_0xe96a('0x64')]=function(_0x4cf705,_0x803fd0){return db[_0xe96a('0x58')]['findAll']({'where':{'id':_0x4cf705[_0xe96a('0x28')][_0xe96a('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe96a('0x59'),'attributes':['id'],'raw':!![]}]})[_0xe96a('0x17')](handleEntityNotFound(_0x803fd0,null))[_0xe96a('0x17')](function(_0xb515e0){var _0x4d1a0b=_[_0xe96a('0x21')](_0xb515e0,'id');var _0x3c084b=[];var _0x4bc803=[];var _0x5a8104=squel[_0xe96a('0x66')]();_0x5a8104['field']('tq.TeamId')['from'](_0xe96a('0x67'),'tq')[_0xe96a('0x68')](_0xe96a('0x69'),'ut',_0xe96a('0x6a'))[_0xe96a('0x27')](_0xe96a('0x6b'),_0x4cf705[_0xe96a('0x2b')]['id']);for(var _0x1bd8ac=0x0;_0x1bd8ac<_0xb515e0[_0xe96a('0x43')];_0x1bd8ac+=0x1){let _0x4cf6d5=_0xb515e0[_0x1bd8ac];for(var _0x4055fb=0x0;_0x4055fb<_0x4cf6d5['Agents'][_0xe96a('0x43')];_0x4055fb+=0x1){let _0x387bc8=_0x4cf6d5['Agents'][_0x4055fb];var _0x23b97b=_0x5a8104[_0xe96a('0x6c')]();_0x23b97b[_0xe96a('0x27')](_0xe96a('0x6d'),_0x387bc8['id']);_0x4bc803[_0xe96a('0x6e')](db[_0xe96a('0x5c')][_0xe96a('0x28')](_0x23b97b[_0xe96a('0x6f')](),{'type':db[_0xe96a('0x5c')][_0xe96a('0x70')][_0xe96a('0x71')]})[_0xe96a('0x17')](function(_0x4eca53){if(_0x4eca53[_0xe96a('0x43')]===0x1){return _0x387bc8['id'];}else{var _0x5c11c5=_[_0xe96a('0x72')](_['map'](_0x4eca53,_0xe96a('0x73')),function(_0x3eb557){return _[_0xe96a('0x74')](_0x4d1a0b,_0x3eb557);});if(_0x5c11c5){return _0x387bc8['id'];}}}));}}return BPromise[_0xe96a('0x75')](_0x4bc803)[_0xe96a('0x17')](function(_0x3f5f73){_0x3c084b=_(_0x3c084b)['union'](_0x3f5f73)[_0xe96a('0x76')]()[_0xe96a('0x77')]();return db[_0xe96a('0x2c')][_0xe96a('0x35')]({'where':{'id':_0x4cf705[_0xe96a('0x2b')]['id']}})[_0xe96a('0x17')](function(_0x3d948d){return db['sequelize'][_0xe96a('0x5d')](function(_0x5bbd16){return _0x3d948d[_0xe96a('0x64')](_0x4cf705['query']['ids'],{'transaction':_0x5bbd16})[_0xe96a('0x17')](function(){if(!_[_0xe96a('0x78')](_0x3c084b)){return _0x3d948d[_0xe96a('0x79')](_0x3c084b,{'transaction':_0x5bbd16});}})[_0xe96a('0x17')](function(){_0x3c084b[_0xe96a('0x61')](function(_0x510846){socket[_0xe96a('0x62')](_0xe96a('0x7a'),{'UserId':_0x510846,'ChatQueueId':_0x3d948d['id']});});});});});});})['then'](respondWithStatusCode(_0x803fd0,null))[_0xe96a('0x36')](handleError(_0x803fd0,null));};exports[_0xe96a('0x7b')]=function(_0x5624cf,_0x5e76d4){return db[_0xe96a('0x2c')]['find']({'where':{'id':_0x5624cf['params']['id']}})[_0xe96a('0x17')](handleEntityNotFound(_0x5e76d4,null))[_0xe96a('0x17')](function(_0x7addce){if(_0x7addce){return _0x7addce[_0xe96a('0x7b')](_0x5624cf[_0xe96a('0x3d')][_0xe96a('0x65')],_[_0xe96a('0x7c')](_0x5624cf['body'],[_0xe96a('0x65'),'id'])||{})[_0xe96a('0x7d')](function(_0x1a61e5){for(var _0x41083f=0x0;_0x41083f<_0x5624cf[_0xe96a('0x3d')][_0xe96a('0x65')][_0xe96a('0x43')];_0x41083f+=0x1){socket[_0xe96a('0x62')](_0xe96a('0x63'),{'UserId':Number(_0x5624cf['body'][_0xe96a('0x65')][_0x41083f]),'ChatQueueId':Number(_0x5624cf[_0xe96a('0x2b')]['id'])});}return _0x1a61e5;});}})[_0xe96a('0x17')](respondWithResult(_0x5e76d4,null))[_0xe96a('0x36')](handleError(_0x5e76d4,null));};exports[_0xe96a('0x79')]=function(_0x4171be,_0x2a4777){return db[_0xe96a('0x2c')]['find']({'where':{'id':_0x4171be[_0xe96a('0x2b')]['id']}})[_0xe96a('0x17')](handleEntityNotFound(_0x2a4777,null))[_0xe96a('0x17')](function(_0x3ea0a6){if(_0x3ea0a6){return _0x3ea0a6[_0xe96a('0x79')](_0x4171be[_0xe96a('0x28')]['ids'])[_0xe96a('0x17')](function(){if(_[_0xe96a('0x7e')](_0x4171be[_0xe96a('0x28')][_0xe96a('0x65')])){for(var _0x229630=0x0;_0x229630<_0x4171be[_0xe96a('0x28')]['ids'][_0xe96a('0x43')];_0x229630+=0x1){socket[_0xe96a('0x62')](_0xe96a('0x7a'),{'UserId':Number(_0x4171be['query'][_0xe96a('0x65')][_0x229630]),'ChatQueueId':Number(_0x4171be[_0xe96a('0x2b')]['id'])});}}else{socket['emit'](_0xe96a('0x7a'),{'UserId':Number(_0x4171be['query']['ids']),'ChatQueueId':Number(_0x4171be[_0xe96a('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a4777,null))[_0xe96a('0x36')](handleError(_0x2a4777,null));};exports[_0xe96a('0x7f')]=function(_0x1295f6,_0x3d5181){var _0x1cbfce={};var _0x27b937={};var _0x49c2cb;var _0x49408a;return db[_0xe96a('0x2c')][_0xe96a('0x40')]({'where':{'id':_0x1295f6[_0xe96a('0x2b')]['id']}})[_0xe96a('0x17')](handleEntityNotFound(_0x3d5181,null))['then'](function(_0x3754ad){if(_0x3754ad){_0x49c2cb=_0x3754ad;_0x27b937[_0xe96a('0x2e')]=_[_0xe96a('0x2d')](db[_0xe96a('0x4a')][_0xe96a('0x22')]);_0x27b937[_0xe96a('0x28')]=_[_0xe96a('0x2d')](_0x1295f6[_0xe96a('0x28')]);_0x27b937['filters']=_[_0xe96a('0x2f')](_0x27b937[_0xe96a('0x2e')],_0x27b937[_0xe96a('0x28')]);_0x1cbfce['attributes']=_[_0xe96a('0x2f')](_0x27b937[_0xe96a('0x2e')],qs[_0xe96a('0x30')](_0x1295f6[_0xe96a('0x28')][_0xe96a('0x30')]));_0x1cbfce[_0xe96a('0x31')]=_0x1cbfce[_0xe96a('0x31')]['length']?_0x1cbfce['attributes']:_0x27b937[_0xe96a('0x2e')];_0x1cbfce[_0xe96a('0x45')]=qs['sort'](_0x1295f6[_0xe96a('0x28')]['sort']);_0x1cbfce[_0xe96a('0x27')]=qs['filters'](_[_0xe96a('0x56')](_0x1295f6['query'],_0x27b937['filters']));if(_0x1295f6[_0xe96a('0x28')]['filter']){_0x1cbfce[_0xe96a('0x27')]=_['merge'](_0x1cbfce[_0xe96a('0x27')],{'$or':_[_0xe96a('0x21')](_0x1cbfce[_0xe96a('0x31')],function(_0x23408f){var _0x194e91={};_0x194e91[_0x23408f]={'$like':'%'+_0x1295f6[_0xe96a('0x28')][_0xe96a('0x48')]+'%'};return _0x194e91;})});}_0x1cbfce=_[_0xe96a('0x49')]({},_0x1cbfce,_0x1295f6['options']);return _0x49c2cb[_0xe96a('0x7f')](_0x1cbfce);}})[_0xe96a('0x17')](function(_0x239724){if(_0x239724){_0x49408a=_0x239724[_0xe96a('0x43')];if(!_0x1295f6[_0xe96a('0x28')][_0xe96a('0x44')](_0xe96a('0x57'))){_0x1cbfce[_0xe96a('0x13')]=qs[_0xe96a('0x13')](_0x1295f6['query'][_0xe96a('0x13')]);_0x1cbfce['offset']=qs[_0xe96a('0x10')](_0x1295f6[_0xe96a('0x28')][_0xe96a('0x10')]);}return _0x49c2cb[_0xe96a('0x7f')](_0x1cbfce);}})[_0xe96a('0x17')](function(_0x50fa66){if(_0x50fa66){return _0x50fa66?{'count':_0x49408a,'rows':_0x50fa66}:null;}})[_0xe96a('0x17')](respondWithResult(_0x3d5181,null))[_0xe96a('0x36')](handleError(_0x3d5181,null));};
\ No newline at end of file
+var _0xb7a5=['json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','key','getOptions','where','ChatQueue','query','findAll','rows','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','findAndCountAll','UserId','agent','chatPause','createdAt','format','SIP','updatedAt','Team','getTeams','addTeams','User','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','end','status'];(function(_0x39f445,_0x4d192e){var _0x5b1bf8=function(_0x2f0445){while(--_0x2f0445){_0x39f445['push'](_0x39f445['shift']());}};_0x5b1bf8(++_0x4d192e);}(_0xb7a5,0x6b));var _0x5b7a=function(_0x1651e5,_0x56d279){_0x1651e5=_0x1651e5-0x0;var _0x43369b=_0xb7a5[_0x1651e5];return _0x43369b;};'use strict';var BPromise=require(_0x5b7a('0x0'));var util=require(_0x5b7a('0x1'));var _=require(_0x5b7a('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x5b7a('0x3'));var logger=require(_0x5b7a('0x4'))(_0x5b7a('0x5'));var config=require('../../config/environment');var db=require(_0x5b7a('0x6'))['db'];config[_0x5b7a('0x7')]=_[_0x5b7a('0x8')](config[_0x5b7a('0x7')],{'host':_0x5b7a('0x9'),'port':0x18eb});var socket=require(_0x5b7a('0xa'))(new Redis(config['redis']));require(_0x5b7a('0xb'))[_0x5b7a('0xc')](socket);function respondWithStatusCode(_0x3e7181,_0x2ff886){_0x2ff886=_0x2ff886||0xcc;return function(_0x1475fd){if(_0x1475fd){return _0x3e7181['sendStatus'](_0x2ff886);}return _0x3e7181['status'](_0x2ff886)[_0x5b7a('0xd')]();};}function respondWithResult(_0x36b009,_0x35eaee){_0x35eaee=_0x35eaee||0xc8;return function(_0x13a38d){if(_0x13a38d){return _0x36b009[_0x5b7a('0xe')](_0x35eaee)[_0x5b7a('0xf')](_0x13a38d);}};}function respondWithFilteredResult(_0x1fb973,_0x459320){return function(_0x2f6b13){if(_0x2f6b13){var _0x3d7e7f=typeof _0x459320[_0x5b7a('0x10')]===_0x5b7a('0x11')&&typeof _0x459320[_0x5b7a('0x12')]===_0x5b7a('0x11');var _0x5f280f=_0x2f6b13[_0x5b7a('0x13')];var _0x53910e=_0x3d7e7f?0x0:_0x459320[_0x5b7a('0x10')];var _0x28a41c=_0x3d7e7f?_0x2f6b13['count']:_0x459320[_0x5b7a('0x10')]+_0x459320['limit'];var _0x3e50df;if(_0x28a41c>=_0x5f280f){_0x28a41c=_0x5f280f;_0x3e50df=0xc8;}else{_0x3e50df=0xce;}_0x1fb973[_0x5b7a('0xe')](_0x3e50df);return _0x1fb973[_0x5b7a('0x14')](_0x5b7a('0x15'),_0x53910e+'-'+_0x28a41c+'/'+_0x5f280f)[_0x5b7a('0xf')](_0x2f6b13);}return null;};}function saveUpdates(_0xd14809){return function(_0x1340b8){if(_0x1340b8){return _0x1340b8[_0x5b7a('0x16')](_0xd14809)[_0x5b7a('0x17')](function(_0x48a46c){return _0x48a46c;});}return null;};}function removeEntity(_0x54e4e9){return function(_0x252a5e){if(_0x252a5e){return _0x252a5e[_0x5b7a('0x18')]()[_0x5b7a('0x17')](function(){var _0x14dacf=_0x252a5e[_0x5b7a('0x19')]({'plain':!![]});var _0x32d008=_0x5b7a('0x1a');return db[_0x5b7a('0x1b')]['destroy']({'where':{'type':_0x32d008,'resourceId':_0x14dacf['id']}})[_0x5b7a('0x17')](function(){return _0x252a5e;});})[_0x5b7a('0x17')](function(){_0x54e4e9[_0x5b7a('0xe')](0xcc)[_0x5b7a('0xd')]();});}};}function handleEntityNotFound(_0x16b4ba){return function(_0x5b53d0){if(!_0x5b53d0){_0x16b4ba['sendStatus'](0x194);}return _0x5b53d0;};}function handleError(_0x27e2cf,_0x2609f2){_0x2609f2=_0x2609f2||0x1f4;return function(_0x311b02){logger['error'](_0x311b02[_0x5b7a('0x1c')]);if(_0x311b02[_0x5b7a('0x1d')]){delete _0x311b02['name'];}_0x27e2cf[_0x5b7a('0xe')](_0x2609f2)[_0x5b7a('0x1e')](_0x311b02);};}exports['index']=function(_0x483dd9,_0x318d89){var _0x530d8c={};var _0x1a937e={'count':0x0,'rows':[]};var _0x373ae6=_[_0x5b7a('0x1f')](db['ChatQueue']['rawAttributes'],function(_0x4b362b){return{'name':_0x4b362b['fieldName'],'type':_0x4b362b['type'][_0x5b7a('0x20')]};});_0x530d8c=qs[_0x5b7a('0x21')](_0x373ae6,_0x483dd9);var _0x209147={'where':_0x530d8c[_0x5b7a('0x22')]};return db[_0x5b7a('0x23')][_0x5b7a('0x13')](_0x209147)[_0x5b7a('0x17')](function(_0x36c4fc){_0x1a937e['count']=_0x36c4fc;_0x530d8c['include']=qs['include'](_0x483dd9[_0x5b7a('0x24')]);return db['ChatQueue'][_0x5b7a('0x25')](_0x530d8c);})[_0x5b7a('0x17')](function(_0x5c7361){_0x1a937e[_0x5b7a('0x26')]=_0x5c7361;return _0x1a937e;})[_0x5b7a('0x17')](respondWithFilteredResult(_0x318d89,_0x530d8c))[_0x5b7a('0x27')](handleError(_0x318d89,null));};exports[_0x5b7a('0x28')]=function(_0x495b62,_0x340403){var _0x1c79fa={'raw':!![],'where':{'id':_0x495b62[_0x5b7a('0x29')]['id']}},_0x5568cd={};_0x5568cd[_0x5b7a('0x2a')]=_[_0x5b7a('0x2b')](db['ChatQueue'][_0x5b7a('0x2c')]);_0x5568cd[_0x5b7a('0x24')]=_['keys'](_0x495b62[_0x5b7a('0x24')]);_0x5568cd[_0x5b7a('0x2d')]=_[_0x5b7a('0x2e')](_0x5568cd[_0x5b7a('0x2a')],_0x5568cd['query']);_0x1c79fa[_0x5b7a('0x2f')]=_[_0x5b7a('0x2e')](_0x5568cd[_0x5b7a('0x2a')],qs['fields'](_0x495b62[_0x5b7a('0x24')][_0x5b7a('0x30')]));_0x1c79fa[_0x5b7a('0x2f')]=_0x1c79fa[_0x5b7a('0x2f')][_0x5b7a('0x31')]?_0x1c79fa[_0x5b7a('0x2f')]:_0x5568cd[_0x5b7a('0x2a')];if(_0x495b62[_0x5b7a('0x24')][_0x5b7a('0x32')]){_0x1c79fa[_0x5b7a('0x33')]=[{'all':!![]}];}_0x1c79fa=_[_0x5b7a('0x34')]({},_0x1c79fa,_0x495b62[_0x5b7a('0x35')]);return db[_0x5b7a('0x23')][_0x5b7a('0x36')](_0x1c79fa)[_0x5b7a('0x17')](handleEntityNotFound(_0x340403,null))[_0x5b7a('0x17')](respondWithResult(_0x340403,null))['catch'](handleError(_0x340403,null));};exports[_0x5b7a('0x37')]=function(_0x2939b3,_0x3021c6){return db[_0x5b7a('0x23')][_0x5b7a('0x37')](_0x2939b3[_0x5b7a('0x38')],{})['then'](function(_0x21aaf7){var _0xef2b4=_0x2939b3[_0x5b7a('0x39')][_0x5b7a('0x19')]({'plain':!![]});if(!_0xef2b4)throw new Error(_0x5b7a('0x3a'));if(_0xef2b4[_0x5b7a('0x3b')]===_0x5b7a('0x39')){var _0x5816e7=_0x21aaf7[_0x5b7a('0x19')]({'plain':!![]});var _0x55ec6f=_0x5b7a('0x1a');return db[_0x5b7a('0x3c')][_0x5b7a('0x36')]({'where':{'name':_0x55ec6f,'userProfileId':_0xef2b4[_0x5b7a('0x3d')]},'raw':!![]})[_0x5b7a('0x17')](function(_0x736a94){if(_0x736a94&&_0x736a94[_0x5b7a('0x3e')]===0x0){return db[_0x5b7a('0x1b')][_0x5b7a('0x37')]({'name':_0x5816e7[_0x5b7a('0x1d')],'resourceId':_0x5816e7['id'],'type':_0x736a94[_0x5b7a('0x1d')],'sectionId':_0x736a94['id']},{})[_0x5b7a('0x17')](function(){return _0x21aaf7;});}else{return _0x21aaf7;}})[_0x5b7a('0x27')](function(_0x1aa0e5){logger['error'](_0x5b7a('0x3f'),_0x1aa0e5);throw _0x1aa0e5;});}return _0x21aaf7;})[_0x5b7a('0x17')](respondWithResult(_0x3021c6,0xc9))[_0x5b7a('0x27')](handleError(_0x3021c6,null));};exports['update']=function(_0x5d0f52,_0x5b5b05){if(_0x5d0f52[_0x5b7a('0x38')]['id']){delete _0x5d0f52['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x5d0f52['params']['id']}})[_0x5b7a('0x17')](handleEntityNotFound(_0x5b5b05,null))[_0x5b7a('0x17')](saveUpdates(_0x5d0f52['body'],null))[_0x5b7a('0x17')](respondWithResult(_0x5b5b05,null))[_0x5b7a('0x27')](handleError(_0x5b5b05,null));};exports[_0x5b7a('0x18')]=function(_0x171070,_0x25be0e){return db[_0x5b7a('0x23')][_0x5b7a('0x36')]({'where':{'id':_0x171070[_0x5b7a('0x29')]['id']}})[_0x5b7a('0x17')](handleEntityNotFound(_0x25be0e,null))[_0x5b7a('0x17')](removeEntity(_0x25be0e,null))['catch'](handleError(_0x25be0e,null));};exports[_0x5b7a('0x40')]=function(_0x5bce08,_0x5de87a){return db[_0x5b7a('0x23')][_0x5b7a('0x40')]()[_0x5b7a('0x17')](respondWithResult(_0x5de87a,null))[_0x5b7a('0x27')](handleError(_0x5de87a,null));};exports[_0x5b7a('0x41')]=function(_0x39124d,_0x28afb6){var _0x275d3c={'raw':!![],'where':{}},_0x14d90f={},_0x4e57c6;return db[_0x5b7a('0x23')][_0x5b7a('0x42')]({'where':{'id':_0x39124d[_0x5b7a('0x29')]['id']}})[_0x5b7a('0x17')](handleEntityNotFound(_0x28afb6,null))[_0x5b7a('0x17')](function(_0x215614){if(_0x215614){_0x4e57c6=_0x215614['get']({'plain':!![]});_0x14d90f[_0x5b7a('0x2a')]=_['keys'](db[_0x5b7a('0x43')][_0x5b7a('0x2c')]);_0x14d90f['query']=_[_0x5b7a('0x2b')](_0x39124d[_0x5b7a('0x24')]);_0x14d90f[_0x5b7a('0x2d')]=_[_0x5b7a('0x2e')](_0x14d90f[_0x5b7a('0x2a')],_0x14d90f[_0x5b7a('0x24')]);_0x275d3c[_0x5b7a('0x2f')]=_[_0x5b7a('0x2e')](_0x14d90f[_0x5b7a('0x2a')],qs[_0x5b7a('0x30')](_0x39124d[_0x5b7a('0x24')][_0x5b7a('0x30')]));_0x275d3c[_0x5b7a('0x2f')]=_0x275d3c[_0x5b7a('0x2f')][_0x5b7a('0x31')]?_0x275d3c[_0x5b7a('0x2f')]:_0x14d90f[_0x5b7a('0x2a')];if(!_0x39124d['query'][_0x5b7a('0x44')](_0x5b7a('0x45'))){_0x275d3c[_0x5b7a('0x12')]=qs[_0x5b7a('0x12')](_0x39124d[_0x5b7a('0x24')][_0x5b7a('0x12')]);_0x275d3c[_0x5b7a('0x10')]=qs[_0x5b7a('0x10')](_0x39124d[_0x5b7a('0x24')]['offset']);}_0x275d3c[_0x5b7a('0x46')]=qs[_0x5b7a('0x47')](_0x39124d[_0x5b7a('0x24')][_0x5b7a('0x47')]);_0x275d3c[_0x5b7a('0x22')]=qs[_0x5b7a('0x2d')](_[_0x5b7a('0x48')](_0x39124d[_0x5b7a('0x24')],_0x14d90f[_0x5b7a('0x2d')]));_0x275d3c[_0x5b7a('0x22')][_0x5b7a('0x49')]=_0x215614['id'];if(_0x39124d['query'][_0x5b7a('0x4a')]){_0x275d3c['where']=_['merge'](_0x275d3c[_0x5b7a('0x22')],{'$or':_[_0x5b7a('0x1f')](_0x275d3c['attributes'],function(_0x300838){var _0x2689fb={};_0x2689fb[_0x300838]={'$like':'%'+_0x39124d['query'][_0x5b7a('0x4a')]+'%'};return _0x2689fb;})});}_0x275d3c=_['merge']({},_0x275d3c,_0x39124d['options']);return db[_0x5b7a('0x43')][_0x5b7a('0x25')](_0x275d3c);}})[_0x5b7a('0x17')](function(_0x3e6ac3){if(_0x3e6ac3){return db['User'][_0x5b7a('0x4b')]({'where':{'id':_[_0x5b7a('0x1f')](_0x3e6ac3,_0x5b7a('0x4c')),'role':_0x5b7a('0x4d')},'attributes':['id',_0x5b7a('0x1d'),_0x5b7a('0x4e'),'updatedAt',_0x5b7a('0x4f')]});}})[_0x5b7a('0x17')](function(_0x3e8238){if(_0x3e8238){return{'count':_0x3e8238[_0x5b7a('0x13')],'rows':_[_0x5b7a('0x1f')](_0x3e8238[_0x5b7a('0x26')],function(_0xd86ab3){return{'membername':_0xd86ab3[_0x5b7a('0x1d')],'UserId':_0xd86ab3['id'],'queue_name':_0x4e57c6[_0x5b7a('0x1d')],'ChatQueueId':_0x4e57c6['id'],'interface':util[_0x5b7a('0x50')]('%s/%s',_0x5b7a('0x51'),_0xd86ab3[_0x5b7a('0x1d')]),'penalty':0x0,'paused':_0xd86ab3[_0x5b7a('0x4e')],'createdAt':_0xd86ab3[_0x5b7a('0x4f')],'updatedAt':_0xd86ab3[_0x5b7a('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5b7a('0x17')](respondWithFilteredResult(_0x28afb6,_0x275d3c))[_0x5b7a('0x27')](handleError(_0x28afb6,null));};exports['getTeams']=function(_0x4e6fc1,_0xf85181){var _0x1627e1={};var _0x429451={};var _0xa77d7a;var _0x441b85;return db[_0x5b7a('0x23')][_0x5b7a('0x42')]({'where':{'id':_0x4e6fc1[_0x5b7a('0x29')]['id']}})[_0x5b7a('0x17')](handleEntityNotFound(_0xf85181,null))[_0x5b7a('0x17')](function(_0x5237dd){if(_0x5237dd){_0xa77d7a=_0x5237dd;_0x429451[_0x5b7a('0x2a')]=_[_0x5b7a('0x2b')](db[_0x5b7a('0x53')][_0x5b7a('0x2c')]);_0x429451[_0x5b7a('0x24')]=_[_0x5b7a('0x2b')](_0x4e6fc1[_0x5b7a('0x24')]);_0x429451[_0x5b7a('0x2d')]=_[_0x5b7a('0x2e')](_0x429451[_0x5b7a('0x2a')],_0x429451[_0x5b7a('0x24')]);_0x1627e1[_0x5b7a('0x2f')]=_[_0x5b7a('0x2e')](_0x429451[_0x5b7a('0x2a')],qs['fields'](_0x4e6fc1[_0x5b7a('0x24')][_0x5b7a('0x30')]));_0x1627e1[_0x5b7a('0x2f')]=_0x1627e1[_0x5b7a('0x2f')][_0x5b7a('0x31')]?_0x1627e1[_0x5b7a('0x2f')]:_0x429451[_0x5b7a('0x2a')];_0x1627e1['order']=qs['sort'](_0x4e6fc1[_0x5b7a('0x24')][_0x5b7a('0x47')]);_0x1627e1[_0x5b7a('0x22')]=qs['filters'](_[_0x5b7a('0x48')](_0x4e6fc1[_0x5b7a('0x24')],_0x429451[_0x5b7a('0x2d')]));if(_0x4e6fc1[_0x5b7a('0x24')]['filter']){_0x1627e1['where']=_[_0x5b7a('0x34')](_0x1627e1[_0x5b7a('0x22')],{'$or':_['map'](_0x1627e1['attributes'],function(_0x106d81){var _0x4babef={};_0x4babef[_0x106d81]={'$like':'%'+_0x4e6fc1['query'][_0x5b7a('0x4a')]+'%'};return _0x4babef;})});}_0x1627e1=_[_0x5b7a('0x34')]({},_0x1627e1,_0x4e6fc1[_0x5b7a('0x35')]);return _0xa77d7a['getTeams'](_0x1627e1);}})[_0x5b7a('0x17')](function(_0x1e2caf){if(_0x1e2caf){_0x441b85=_0x1e2caf[_0x5b7a('0x31')];if(!_0x4e6fc1[_0x5b7a('0x24')][_0x5b7a('0x44')](_0x5b7a('0x45'))){_0x1627e1[_0x5b7a('0x12')]=qs['limit'](_0x4e6fc1[_0x5b7a('0x24')][_0x5b7a('0x12')]);_0x1627e1[_0x5b7a('0x10')]=qs[_0x5b7a('0x10')](_0x4e6fc1[_0x5b7a('0x24')][_0x5b7a('0x10')]);}return _0xa77d7a[_0x5b7a('0x54')](_0x1627e1);}})[_0x5b7a('0x17')](function(_0x57c0a0){if(_0x57c0a0){return _0x57c0a0?{'count':_0x441b85,'rows':_0x57c0a0}:null;}})[_0x5b7a('0x17')](respondWithResult(_0xf85181,null))[_0x5b7a('0x27')](handleError(_0xf85181,null));};exports[_0x5b7a('0x55')]=function(_0x1660ee,_0x3158e0){var _0x327c20=_0x1660ee[_0x5b7a('0x38')]['ids'];return db[_0x5b7a('0x53')]['findAll']({'where':{'id':_0x327c20},'attributes':['id'],'include':[{'model':db[_0x5b7a('0x56')],'as':_0x5b7a('0x57'),'attributes':['id','name','online','voicePause',_0x5b7a('0x58')],'raw':!![]}]})[_0x5b7a('0x17')](function(_0x239f66){if(_0x239f66){var _0x3efcfc=_[_0x5b7a('0x59')](_0x239f66,function(_0x2bf572){var _0x164f34=_0x2bf572[_0x5b7a('0x19')]({'plain':!![]});return _0x164f34[_0x5b7a('0x57')];});return db[_0x5b7a('0x23')][_0x5b7a('0x36')]({'where':{'id':_0x1660ee[_0x5b7a('0x29')]['id']}})['then'](function(_0x3cb002){return db[_0x5b7a('0x5a')][_0x5b7a('0x5b')](function(_0x2c951d){return _0x3cb002['addTeams'](_0x327c20,{'transaction':_0x2c951d})[_0x5b7a('0x17')](function(){return BPromise[_0x5b7a('0x5c')](_0x3efcfc,function(_0x369bf2){return db['UserChatQueue'][_0x5b7a('0x5d')]({'where':{'UserId':_0x369bf2['id'],'ChatQueueId':_0x1660ee[_0x5b7a('0x29')]['id']},'transaction':_0x2c951d});});})[_0x5b7a('0x17')](function(){_0x3efcfc['forEach'](function(_0x46031f){socket['emit'](_0x5b7a('0x5e'),{'UserId':_0x46031f['id'],'ChatQueueId':_0x3cb002['id']});});});});});}})[_0x5b7a('0x17')](respondWithStatusCode(_0x3158e0,null))[_0x5b7a('0x27')](handleError(_0x3158e0,null));};exports[_0x5b7a('0x5f')]=function(_0x2ed11f,_0x5f4d23){return db[_0x5b7a('0x53')][_0x5b7a('0x25')]({'where':{'id':_0x2ed11f['query'][_0x5b7a('0x60')]},'attributes':['id'],'include':[{'model':db[_0x5b7a('0x56')],'as':_0x5b7a('0x57'),'attributes':['id'],'raw':!![]}]})[_0x5b7a('0x17')](handleEntityNotFound(_0x5f4d23,null))[_0x5b7a('0x17')](function(_0x16233c){var _0x31effd=_[_0x5b7a('0x1f')](_0x16233c,'id');var _0x5322b9=[];var _0x51c858=[];var _0x468887=squel[_0x5b7a('0x61')]();_0x468887[_0x5b7a('0x62')](_0x5b7a('0x63'))[_0x5b7a('0x64')]('team_has_chat_queues','tq')[_0x5b7a('0x65')]('user_has_teams','ut',_0x5b7a('0x66'))['where']('ChatQueueId\x20=\x20?',_0x2ed11f[_0x5b7a('0x29')]['id']);for(var _0x73aa8c=0x0;_0x73aa8c<_0x16233c[_0x5b7a('0x31')];_0x73aa8c+=0x1){let _0x5886ce=_0x16233c[_0x73aa8c];for(var _0x58b382=0x0;_0x58b382<_0x5886ce[_0x5b7a('0x57')][_0x5b7a('0x31')];_0x58b382+=0x1){let _0x3432dd=_0x5886ce[_0x5b7a('0x57')][_0x58b382];var _0x4a2934=_0x468887['clone']();_0x4a2934[_0x5b7a('0x22')](_0x5b7a('0x67'),_0x3432dd['id']);_0x51c858[_0x5b7a('0x68')](db['sequelize'][_0x5b7a('0x24')](_0x4a2934['toString'](),{'type':db['sequelize'][_0x5b7a('0x69')][_0x5b7a('0x6a')]})['then'](function(_0x4fc618){if(_0x4fc618['length']===0x1){return _0x3432dd['id'];}else{var _0x4415e1=_['every'](_[_0x5b7a('0x1f')](_0x4fc618,_0x5b7a('0x6b')),function(_0x174782){return _[_0x5b7a('0x6c')](_0x31effd,_0x174782);});if(_0x4415e1){return _0x3432dd['id'];}}}));}}return BPromise['all'](_0x51c858)[_0x5b7a('0x17')](function(_0x2187c4){_0x5322b9=_(_0x5322b9)[_0x5b7a('0x6d')](_0x2187c4)[_0x5b7a('0x6e')]()[_0x5b7a('0x6f')]();return db[_0x5b7a('0x23')]['find']({'where':{'id':_0x2ed11f['params']['id']}})[_0x5b7a('0x17')](function(_0x5806a8){return db[_0x5b7a('0x5a')]['transaction'](function(_0x31ab24){return _0x5806a8[_0x5b7a('0x5f')](_0x2ed11f['query'][_0x5b7a('0x60')],{'transaction':_0x31ab24})['then'](function(){if(!_[_0x5b7a('0x70')](_0x5322b9)){return _0x5806a8[_0x5b7a('0x71')](_0x5322b9,{'transaction':_0x31ab24});}})['then'](function(){_0x5322b9[_0x5b7a('0x72')](function(_0x1c774b){socket[_0x5b7a('0x73')](_0x5b7a('0x74'),{'UserId':_0x1c774b,'ChatQueueId':_0x5806a8['id']});});});});});});})[_0x5b7a('0x17')](respondWithStatusCode(_0x5f4d23,null))[_0x5b7a('0x27')](handleError(_0x5f4d23,null));};exports['addAgents']=function(_0x2f5267,_0x13d155){return db[_0x5b7a('0x23')]['find']({'where':{'id':_0x2f5267['params']['id']}})[_0x5b7a('0x17')](handleEntityNotFound(_0x13d155,null))[_0x5b7a('0x17')](function(_0x164823){if(_0x164823){return _0x164823[_0x5b7a('0x75')](_0x2f5267['body'][_0x5b7a('0x60')],_[_0x5b7a('0x76')](_0x2f5267[_0x5b7a('0x38')],[_0x5b7a('0x60'),'id'])||{})[_0x5b7a('0x77')](function(_0xbf572b){for(var _0x19a0c9=0x0;_0x19a0c9<_0x2f5267[_0x5b7a('0x38')][_0x5b7a('0x60')][_0x5b7a('0x31')];_0x19a0c9+=0x1){socket[_0x5b7a('0x73')](_0x5b7a('0x5e'),{'UserId':Number(_0x2f5267[_0x5b7a('0x38')][_0x5b7a('0x60')][_0x19a0c9]),'ChatQueueId':Number(_0x2f5267[_0x5b7a('0x29')]['id'])});}return _0xbf572b;});}})[_0x5b7a('0x17')](respondWithResult(_0x13d155,null))[_0x5b7a('0x27')](handleError(_0x13d155,null));};exports['removeAgents']=function(_0x4fcbfd,_0x306dbe){return db[_0x5b7a('0x23')]['find']({'where':{'id':_0x4fcbfd['params']['id']}})['then'](handleEntityNotFound(_0x306dbe,null))[_0x5b7a('0x17')](function(_0x37132c){if(_0x37132c){return _0x37132c[_0x5b7a('0x71')](_0x4fcbfd[_0x5b7a('0x24')][_0x5b7a('0x60')])['then'](function(){if(_[_0x5b7a('0x78')](_0x4fcbfd[_0x5b7a('0x24')][_0x5b7a('0x60')])){for(var _0x485a18=0x0;_0x485a18<_0x4fcbfd['query'][_0x5b7a('0x60')][_0x5b7a('0x31')];_0x485a18+=0x1){socket['emit'](_0x5b7a('0x74'),{'UserId':Number(_0x4fcbfd[_0x5b7a('0x24')]['ids'][_0x485a18]),'ChatQueueId':Number(_0x4fcbfd['params']['id'])});}}else{socket[_0x5b7a('0x73')](_0x5b7a('0x74'),{'UserId':Number(_0x4fcbfd['query'][_0x5b7a('0x60')]),'ChatQueueId':Number(_0x4fcbfd[_0x5b7a('0x29')]['id'])});}});}})[_0x5b7a('0x17')](respondWithStatusCode(_0x306dbe,null))['catch'](handleError(_0x306dbe,null));};exports[_0x5b7a('0x79')]=function(_0x200743,_0x41cf65){var _0x3de00d={};var _0x59f230={};var _0x506bc5;var _0x29612f;return db[_0x5b7a('0x23')][_0x5b7a('0x42')]({'where':{'id':_0x200743[_0x5b7a('0x29')]['id']}})[_0x5b7a('0x17')](handleEntityNotFound(_0x41cf65,null))[_0x5b7a('0x17')](function(_0x538d63){if(_0x538d63){_0x506bc5=_0x538d63;_0x59f230[_0x5b7a('0x2a')]=_[_0x5b7a('0x2b')](db['User'][_0x5b7a('0x2c')]);_0x59f230[_0x5b7a('0x24')]=_[_0x5b7a('0x2b')](_0x200743[_0x5b7a('0x24')]);_0x59f230[_0x5b7a('0x2d')]=_['intersection'](_0x59f230[_0x5b7a('0x2a')],_0x59f230[_0x5b7a('0x24')]);_0x3de00d[_0x5b7a('0x2f')]=_[_0x5b7a('0x2e')](_0x59f230[_0x5b7a('0x2a')],qs['fields'](_0x200743[_0x5b7a('0x24')]['fields']));_0x3de00d[_0x5b7a('0x2f')]=_0x3de00d[_0x5b7a('0x2f')][_0x5b7a('0x31')]?_0x3de00d[_0x5b7a('0x2f')]:_0x59f230[_0x5b7a('0x2a')];_0x3de00d[_0x5b7a('0x46')]=qs[_0x5b7a('0x47')](_0x200743[_0x5b7a('0x24')][_0x5b7a('0x47')]);_0x3de00d['where']=qs['filters'](_[_0x5b7a('0x48')](_0x200743[_0x5b7a('0x24')],_0x59f230[_0x5b7a('0x2d')]));if(_0x200743[_0x5b7a('0x24')][_0x5b7a('0x4a')]){_0x3de00d[_0x5b7a('0x22')]=_['merge'](_0x3de00d[_0x5b7a('0x22')],{'$or':_['map'](_0x3de00d[_0x5b7a('0x2f')],function(_0x140f8d){var _0xa4734f={};_0xa4734f[_0x140f8d]={'$like':'%'+_0x200743[_0x5b7a('0x24')][_0x5b7a('0x4a')]+'%'};return _0xa4734f;})});}_0x3de00d=_[_0x5b7a('0x34')]({},_0x3de00d,_0x200743['options']);return _0x506bc5['getAgents'](_0x3de00d);}})[_0x5b7a('0x17')](function(_0x2eda4b){if(_0x2eda4b){_0x29612f=_0x2eda4b[_0x5b7a('0x31')];if(!_0x200743[_0x5b7a('0x24')]['hasOwnProperty']('nolimit')){_0x3de00d[_0x5b7a('0x12')]=qs['limit'](_0x200743[_0x5b7a('0x24')][_0x5b7a('0x12')]);_0x3de00d[_0x5b7a('0x10')]=qs[_0x5b7a('0x10')](_0x200743['query'][_0x5b7a('0x10')]);}return _0x506bc5[_0x5b7a('0x79')](_0x3de00d);}})[_0x5b7a('0x17')](function(_0x3c24f5){if(_0x3c24f5){return _0x3c24f5?{'count':_0x29612f,'rows':_0x3c24f5}:null;}})[_0x5b7a('0x17')](respondWithResult(_0x41cf65,null))[_0x5b7a('0x27')](handleError(_0x41cf65,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index a99f26f..9227e69 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 _0xb584=['events','ChatQueue','emit','hasOwnProperty','hook','exports'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0xb584,0x16e));var _0x4b58=function(_0xf1eadc,_0x118c22){_0xf1eadc=_0xf1eadc-0x0;var _0x3e53e1=_0xb584[_0xf1eadc];return _0x3e53e1;};'use strict';var EventEmitter=require(_0x4b58('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4b58('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c4e27){return function(_0x3813d6,_0xf07418,_0x3a8164){ChatQueueEvents[_0x4b58('0x2')](_0x5c4e27+':'+_0x3813d6['id'],_0x3813d6);ChatQueueEvents[_0x4b58('0x2')](_0x5c4e27,_0x3813d6);_0x3a8164(null);};}for(var e in events){if(events[_0x4b58('0x3')](e)){var event=events[e];ChatQueue[_0x4b58('0x4')](e,emitEvent(event));}}module[_0x4b58('0x5')]=ChatQueueEvents;
\ No newline at end of file
+var _0x75fd=['exports','events','ChatQueue','setMaxListeners','update','emit','hook'];(function(_0x58ec6b,_0x55bf35){var _0x5396e8=function(_0x305f7f){while(--_0x305f7f){_0x58ec6b['push'](_0x58ec6b['shift']());}};_0x5396e8(++_0x55bf35);}(_0x75fd,0x197));var _0xd75f=function(_0x5bcfe2,_0x348f00){_0x5bcfe2=_0x5bcfe2-0x0;var _0x45d45d=_0x75fd[_0x5bcfe2];return _0x45d45d;};'use strict';var EventEmitter=require(_0xd75f('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xd75f('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd75f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd75f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x18cb0b){return function(_0x2182c9,_0x172207,_0x1d2033){ChatQueueEvents[_0xd75f('0x4')](_0x18cb0b+':'+_0x2182c9['id'],_0x2182c9);ChatQueueEvents[_0xd75f('0x4')](_0x18cb0b,_0x2182c9);_0x1d2033(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xd75f('0x5')](e,emitEvent(event));}}module[_0xd75f('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index fa7ffc6..d4b41f9 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 _0xaa9a=['chat_queues','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue'];(function(_0x372129,_0x539547){var _0x2385b4=function(_0x17969f){while(--_0x17969f){_0x372129['push'](_0x372129['shift']());}};_0x2385b4(++_0x539547);}(_0xaa9a,0x6f));var _0xaaa9=function(_0x15f468,_0x10b42b){_0x15f468=_0x15f468-0x0;var _0x29decb=_0xaa9a[_0x15f468];return _0x29decb;};'use strict';var _=require(_0xaaa9('0x0'));var util=require(_0xaaa9('0x1'));var logger=require(_0xaaa9('0x2'))(_0xaaa9('0x3'));var moment=require(_0xaaa9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaaa9('0x5'));var rimraf=require(_0xaaa9('0x6'));var config=require(_0xaaa9('0x7'));var attributes=require(_0xaaa9('0x8'));module['exports']=function(_0x486007,_0x99af58){return _0x486007['define'](_0xaaa9('0x9'),attributes,{'tableName':_0xaaa9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12db=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatQueue.attributes','ChatQueue','chat_queues','util'];(function(_0x112923,_0x341874){var _0x10a022=function(_0x4e644a){while(--_0x4e644a){_0x112923['push'](_0x112923['shift']());}};_0x10a022(++_0x341874);}(_0x12db,0x13f));var _0xb12d=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x12db[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0xb12d('0x0'));var logger=require(_0xb12d('0x1'))(_0xb12d('0x2'));var moment=require(_0xb12d('0x3'));var BPromise=require(_0xb12d('0x4'));var rp=require(_0xb12d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb12d('0x6'));var config=require('../../config/environment');var attributes=require(_0xb12d('0x7'));module['exports']=function(_0x205abc,_0xc9bdb7){return _0x205abc['define'](_0xb12d('0x8'),attributes,{'tableName':_0xb12d('0x9'),'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 de632b1..0473723 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 _0x51f9=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','model','map','attributes','stringify','catch','ShowChatQueue','find','lodash','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x51f9,0x132));var _0x951f=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0x51f9[_0x466247];return _0x4b352e;};'use strict';var _=require(_0x951f('0x0'));var util=require(_0x951f('0x1'));var moment=require('moment');var BPromise=require(_0x951f('0x2'));var rs=require(_0x951f('0x3'));var fs=require('fs');var Redis=require(_0x951f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x951f('0x5'));var logger=require(_0x951f('0x6'))(_0x951f('0x7'));var config=require(_0x951f('0x8'));var jayson=require(_0x951f('0x9'));var client=jayson[_0x951f('0xa')][_0x951f('0xb')]({'port':0x232a});config['redis']=_[_0x951f('0xc')](config[_0x951f('0xd')],{'host':_0x951f('0xe'),'port':0x18eb});var socket=require(_0x951f('0xf'))(new Redis(config[_0x951f('0xd')]));require(_0x951f('0x10'))[_0x951f('0x11')](socket);function respondWithRpcPromise(_0x3b0a01,_0x453eac,_0x110e9a){return new BPromise(function(_0xf8c622,_0x135985){return client[_0x951f('0x12')](_0x3b0a01,_0x110e9a)[_0x951f('0x13')](function(_0x2c582b){logger[_0x951f('0x14')]('ChatQueue,\x20%s,\x20%s',_0x453eac,'request\x20sent');logger[_0x951f('0x15')](_0x951f('0x16'),_0x453eac,_0x951f('0x17'),JSON['stringify'](_0x2c582b));if(_0x2c582b[_0x951f('0x18')]){if(_0x2c582b['error'][_0x951f('0x19')]===0x1f4){logger[_0x951f('0x18')](_0x951f('0x1a'),_0x453eac,_0x2c582b[_0x951f('0x18')][_0x951f('0x1b')]);return _0x135985(_0x2c582b['error'][_0x951f('0x1b')]);}logger[_0x951f('0x18')](_0x951f('0x1a'),_0x453eac,_0x2c582b[_0x951f('0x18')][_0x951f('0x1b')]);return _0xf8c622(_0x2c582b[_0x951f('0x18')][_0x951f('0x1b')]);}else{logger[_0x951f('0x14')](_0x951f('0x1a'),_0x453eac,_0x951f('0x17'));_0xf8c622(_0x2c582b[_0x951f('0x1c')][_0x951f('0x1b')]);}})['catch'](function(_0x3b7994){logger[_0x951f('0x18')](_0x951f('0x1a'),_0x453eac,_0x3b7994);_0x135985(_0x3b7994);});});}exports[_0x951f('0x1d')]=function(_0x36bed2){var _0x4a72fc=this;return new Promise(function(_0xd65ad2,_0x492e75){return db[_0x951f('0x1e')][_0x951f('0x1f')]({'raw':_0x36bed2['options']?_0x36bed2[_0x951f('0x20')][_0x951f('0x21')]===undefined?!![]:![]:!![],'where':_0x36bed2[_0x951f('0x20')]?_0x36bed2['options'][_0x951f('0x22')]||null:null,'attributes':_0x36bed2[_0x951f('0x20')]?_0x36bed2['options']['attributes']||null:null,'limit':_0x36bed2[_0x951f('0x20')]?_0x36bed2[_0x951f('0x20')][_0x951f('0x23')]||null:null,'include':_0x36bed2[_0x951f('0x20')]?_0x36bed2[_0x951f('0x20')]['include']?_['map'](_0x36bed2[_0x951f('0x20')][_0x951f('0x24')],function(_0x5d5698){return{'model':db[_0x5d5698[_0x951f('0x25')]],'as':_0x5d5698['as'],'attributes':_0x5d5698['attributes'],'include':_0x5d5698[_0x951f('0x24')]?_[_0x951f('0x26')](_0x5d5698['include'],function(_0x5f5af3){return{'model':db[_0x5f5af3[_0x951f('0x25')]],'as':_0x5f5af3['as'],'attributes':_0x5f5af3['attributes'],'include':_0x5f5af3['include']?_['map'](_0x5f5af3['include'],function(_0x1d69a1){return{'model':db[_0x1d69a1['model']],'as':_0x1d69a1['as'],'attributes':_0x1d69a1[_0x951f('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b50b){logger[_0x951f('0x14')](_0x951f('0x1d'),_0x36bed2);logger[_0x951f('0x15')]('GetChatQueue',_0x36bed2,JSON[_0x951f('0x28')](_0x59b50b));_0xd65ad2(_0x59b50b);})[_0x951f('0x29')](function(_0x57ed97){logger['error'](_0x951f('0x1d'),_0x57ed97[_0x951f('0x1b')],_0x36bed2);_0x492e75(_0x4a72fc[_0x951f('0x18')](0x1f4,_0x57ed97[_0x951f('0x1b')]));});});};exports[_0x951f('0x2a')]=function(_0x2355bf){var _0x56ad04=this;return new Promise(function(_0x41f82a,_0x154bec){return db[_0x951f('0x1e')][_0x951f('0x2b')]({'raw':_0x2355bf[_0x951f('0x20')]?_0x2355bf[_0x951f('0x20')][_0x951f('0x21')]===undefined?!![]:![]:!![],'where':_0x2355bf[_0x951f('0x20')]?_0x2355bf[_0x951f('0x20')][_0x951f('0x22')]||null:null,'attributes':_0x2355bf['options']?_0x2355bf[_0x951f('0x20')][_0x951f('0x27')]||null:null,'include':_0x2355bf[_0x951f('0x20')]?_0x2355bf[_0x951f('0x20')][_0x951f('0x24')]?_['map'](_0x2355bf[_0x951f('0x20')]['include'],function(_0x1e52b4){return{'model':db[_0x1e52b4[_0x951f('0x25')]],'as':_0x1e52b4['as'],'attributes':_0x1e52b4[_0x951f('0x27')],'include':_0x1e52b4[_0x951f('0x24')]?_[_0x951f('0x26')](_0x1e52b4[_0x951f('0x24')],function(_0x35f1ed){return{'model':db[_0x35f1ed[_0x951f('0x25')]],'as':_0x35f1ed['as'],'attributes':_0x35f1ed[_0x951f('0x27')],'include':_0x35f1ed['include']?_[_0x951f('0x26')](_0x35f1ed[_0x951f('0x24')],function(_0x424143){return{'model':db[_0x424143[_0x951f('0x25')]],'as':_0x424143['as'],'attributes':_0x424143[_0x951f('0x27')]};}):[]};}):[]};}):[]:[]})[_0x951f('0x13')](function(_0x593f0f){logger['info'](_0x951f('0x2a'),_0x2355bf);logger[_0x951f('0x15')]('ShowChatQueue',_0x2355bf,JSON[_0x951f('0x28')](_0x593f0f));_0x41f82a(_0x593f0f);})[_0x951f('0x29')](function(_0x36da2d){logger[_0x951f('0x18')](_0x951f('0x2a'),_0x36da2d[_0x951f('0x1b')],_0x2355bf);_0x154bec(_0x56ad04[_0x951f('0x18')](0x1f4,_0x36da2d['message']));});});};
\ No newline at end of file
+var _0xaa56=['../../config/utils','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','options','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','where','util','moment','randomstring','ioredis'];(function(_0x4c59c1,_0x2529ec){var _0x2fc4bd=function(_0x1795a0){while(--_0x1795a0){_0x4c59c1['push'](_0x4c59c1['shift']());}};_0x2fc4bd(++_0x2529ec);}(_0xaa56,0x1ac));var _0x6aa5=function(_0x51949d,_0x5715bc){_0x51949d=_0x51949d-0x0;var _0x4614e8=_0xaa56[_0x51949d];return _0x4614e8;};'use strict';var _=require('lodash');var util=require(_0x6aa5('0x0'));var moment=require(_0x6aa5('0x1'));var BPromise=require('bluebird');var rs=require(_0x6aa5('0x2'));var fs=require('fs');var Redis=require(_0x6aa5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6aa5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6aa5('0x5'));var jayson=require(_0x6aa5('0x6'));var client=jayson[_0x6aa5('0x7')][_0x6aa5('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6aa5('0x9'),'port':0x18eb});var socket=require(_0x6aa5('0xa'))(new Redis(config['redis']));require(_0x6aa5('0xb'))[_0x6aa5('0xc')](socket);function respondWithRpcPromise(_0x268e07,_0xe703f1,_0x24e44c){return new BPromise(function(_0x2c689f,_0x17c0df){return client[_0x6aa5('0xd')](_0x268e07,_0x24e44c)[_0x6aa5('0xe')](function(_0x643691){logger[_0x6aa5('0xf')]('ChatQueue,\x20%s,\x20%s',_0xe703f1,_0x6aa5('0x10'));logger[_0x6aa5('0x11')](_0x6aa5('0x12'),_0xe703f1,'request\x20sent',JSON[_0x6aa5('0x13')](_0x643691));if(_0x643691[_0x6aa5('0x14')]){if(_0x643691[_0x6aa5('0x14')][_0x6aa5('0x15')]===0x1f4){logger[_0x6aa5('0x14')](_0x6aa5('0x16'),_0xe703f1,_0x643691[_0x6aa5('0x14')][_0x6aa5('0x17')]);return _0x17c0df(_0x643691[_0x6aa5('0x14')]['message']);}logger[_0x6aa5('0x14')]('ChatQueue,\x20%s,\x20%s',_0xe703f1,_0x643691[_0x6aa5('0x14')][_0x6aa5('0x17')]);return _0x2c689f(_0x643691['error'][_0x6aa5('0x17')]);}else{logger[_0x6aa5('0xf')]('ChatQueue,\x20%s,\x20%s',_0xe703f1,_0x6aa5('0x10'));_0x2c689f(_0x643691[_0x6aa5('0x18')][_0x6aa5('0x17')]);}})[_0x6aa5('0x19')](function(_0x2fded3){logger['error'](_0x6aa5('0x16'),_0xe703f1,_0x2fded3);_0x17c0df(_0x2fded3);});});}exports[_0x6aa5('0x1a')]=function(_0x1f6458){var _0x1e0b1a=this;return new Promise(function(_0xd80c38,_0x1c1a91){return db['ChatQueue']['findAll']({'raw':_0x1f6458['options']?_0x1f6458[_0x6aa5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1f6458[_0x6aa5('0x1b')]?_0x1f6458[_0x6aa5('0x1b')]['where']||null:null,'attributes':_0x1f6458[_0x6aa5('0x1b')]?_0x1f6458[_0x6aa5('0x1b')][_0x6aa5('0x1c')]||null:null,'limit':_0x1f6458[_0x6aa5('0x1b')]?_0x1f6458['options'][_0x6aa5('0x1d')]||null:null,'include':_0x1f6458[_0x6aa5('0x1b')]?_0x1f6458[_0x6aa5('0x1b')][_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x1f6458[_0x6aa5('0x1b')][_0x6aa5('0x1e')],function(_0x132f13){return{'model':db[_0x132f13['model']],'as':_0x132f13['as'],'attributes':_0x132f13['attributes'],'include':_0x132f13[_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x132f13['include'],function(_0x563805){return{'model':db[_0x563805[_0x6aa5('0x20')]],'as':_0x563805['as'],'attributes':_0x563805['attributes'],'include':_0x563805[_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x563805[_0x6aa5('0x1e')],function(_0x482e8f){return{'model':db[_0x482e8f[_0x6aa5('0x20')]],'as':_0x482e8f['as'],'attributes':_0x482e8f[_0x6aa5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ca2a3){logger[_0x6aa5('0xf')](_0x6aa5('0x1a'),_0x1f6458);logger[_0x6aa5('0x11')](_0x6aa5('0x1a'),_0x1f6458,JSON[_0x6aa5('0x13')](_0x2ca2a3));_0xd80c38(_0x2ca2a3);})[_0x6aa5('0x19')](function(_0x2f4952){logger[_0x6aa5('0x14')](_0x6aa5('0x1a'),_0x2f4952[_0x6aa5('0x17')],_0x1f6458);_0x1c1a91(_0x1e0b1a[_0x6aa5('0x14')](0x1f4,_0x2f4952[_0x6aa5('0x17')]));});});};exports[_0x6aa5('0x21')]=function(_0x44bf86){var _0x263e1e=this;return new Promise(function(_0x40e3c7,_0x5d2669){return db[_0x6aa5('0x22')]['find']({'raw':_0x44bf86[_0x6aa5('0x1b')]?_0x44bf86[_0x6aa5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x44bf86[_0x6aa5('0x1b')]?_0x44bf86[_0x6aa5('0x1b')][_0x6aa5('0x23')]||null:null,'attributes':_0x44bf86[_0x6aa5('0x1b')]?_0x44bf86[_0x6aa5('0x1b')][_0x6aa5('0x1c')]||null:null,'include':_0x44bf86['options']?_0x44bf86['options'][_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x44bf86['options'][_0x6aa5('0x1e')],function(_0x9e3915){return{'model':db[_0x9e3915[_0x6aa5('0x20')]],'as':_0x9e3915['as'],'attributes':_0x9e3915[_0x6aa5('0x1c')],'include':_0x9e3915[_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x9e3915['include'],function(_0x52a091){return{'model':db[_0x52a091[_0x6aa5('0x20')]],'as':_0x52a091['as'],'attributes':_0x52a091[_0x6aa5('0x1c')],'include':_0x52a091['include']?_['map'](_0x52a091['include'],function(_0x4d8494){return{'model':db[_0x4d8494[_0x6aa5('0x20')]],'as':_0x4d8494['as'],'attributes':_0x4d8494[_0x6aa5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6aa5('0xe')](function(_0x15aa86){logger[_0x6aa5('0xf')](_0x6aa5('0x21'),_0x44bf86);logger[_0x6aa5('0x11')](_0x6aa5('0x21'),_0x44bf86,JSON[_0x6aa5('0x13')](_0x15aa86));_0x40e3c7(_0x15aa86);})[_0x6aa5('0x19')](function(_0x262558){logger[_0x6aa5('0x14')](_0x6aa5('0x21'),_0x262558['message'],_0x44bf86);_0x5d2669(_0x263e1e[_0x6aa5('0x14')](0x1f4,_0x262558['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 9a320c5..1ec5018 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 _0x579c=['chatQueue:','./chatQueue.events','save','remove','update','removeListener','register'];(function(_0x130b0b,_0x23bdf4){var _0x48062d=function(_0x1cf46b){while(--_0x1cf46b){_0x130b0b['push'](_0x130b0b['shift']());}};_0x48062d(++_0x23bdf4);}(_0x579c,0xda));var _0xc579=function(_0x3ab0bc,_0xc5a476){_0x3ab0bc=_0x3ab0bc-0x0;var _0x4625b4=_0x579c[_0x3ab0bc];return _0x4625b4;};'use strict';var ChatQueueEvents=require(_0xc579('0x0'));var events=[_0xc579('0x1'),_0xc579('0x2'),_0xc579('0x3')];function createListener(_0x397136,_0x586948){return function(_0x1e2808){_0x586948['emit'](_0x397136,_0x1e2808);};}function removeListener(_0x21a0a2,_0x3b913c){return function(){ChatQueueEvents[_0xc579('0x4')](_0x21a0a2,_0x3b913c);};}exports[_0xc579('0x5')]=function(_0x124ee5){for(var _0x1bd276=0x0,_0x2e451b=events['length'];_0x1bd276<_0x2e451b;_0x1bd276++){var _0x1c6d9c=events[_0x1bd276];var _0x293c4a=createListener(_0xc579('0x6')+_0x1c6d9c,_0x124ee5);ChatQueueEvents['on'](_0x1c6d9c,_0x293c4a);}};
\ No newline at end of file
+var _0x04de=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x04de,0x107));var _0xe04d=function(_0x3df0da,_0x4046f7){_0x3df0da=_0x3df0da-0x0;var _0x4afedb=_0x04de[_0x3df0da];return _0x4afedb;};'use strict';var ChatQueueEvents=require(_0xe04d('0x0'));var events=[_0xe04d('0x1'),_0xe04d('0x2'),_0xe04d('0x3')];function createListener(_0x1e650d,_0x28f63f){return function(_0x1113af){_0x28f63f[_0xe04d('0x4')](_0x1e650d,_0x1113af);};}function removeListener(_0x2593a4,_0x70ead0){return function(){ChatQueueEvents[_0xe04d('0x5')](_0x2593a4,_0x70ead0);};}exports['register']=function(_0x4bb925){for(var _0x4f7637=0x0,_0x531688=events[_0xe04d('0x6')];_0x4f7637<_0x531688;_0x4f7637++){var _0x210e93=events[_0x4f7637];var _0x72b1ce=createListener(_0xe04d('0x7')+_0x210e93,_0x4bb925);ChatQueueEvents['on'](_0x210e93,_0x72b1ce);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ca509f7..7c85b38 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x202e0a,_0x4fd76b){var _0xf368ba=function(_0x2865c7){while(--_0x2865c7){_0x202e0a['push'](_0x202e0a['shift']());}};_0xf368ba(++_0x4fd76b);}(_0x814b,0x1a2));var _0xb814=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x814b[_0x2a5b3b];return _0xae665a;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5fc3,0xa8));var _0x35fc=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0x5fc3[_0x254b22];return _0x1279db;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 6045beb..59192e1 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 _0x0e39=['STRING','DATE','moment','sequelize','exports'];(function(_0xb5e1dd,_0x2dc4c2){var _0xfa5b12=function(_0x38f0a4){while(--_0x38f0a4){_0xb5e1dd['push'](_0xb5e1dd['shift']());}};_0xfa5b12(++_0x2dc4c2);}(_0x0e39,0x11a));var _0x90e3=function(_0x2cee34,_0x7e21a9){_0x2cee34=_0x2cee34-0x0;var _0x5a369e=_0x0e39[_0x2cee34];return _0x5a369e;};'use strict';var moment=require(_0x90e3('0x0'));var Sequelize=require(_0x90e3('0x1'));module[_0x90e3('0x2')]={'uniqueid':{'type':Sequelize[_0x90e3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x90e3('0x3')]},'joinAt':{'type':Sequelize[_0x90e3('0x4')]},'leaveAt':{'type':Sequelize[_0x90e3('0x4')]},'acceptAt':{'type':Sequelize[_0x90e3('0x4')]},'exitAt':{'type':Sequelize[_0x90e3('0x4')]},'reason':{'type':Sequelize[_0x90e3('0x3')]}};
\ No newline at end of file
+var _0x7ea0=['moment','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ea0,0x1b0));var _0x07ea=function(_0x17a472,_0x324bb8){_0x17a472=_0x17a472-0x0;var _0x1cbad3=_0x7ea0[_0x17a472];return _0x1cbad3;};'use strict';var moment=require(_0x07ea('0x0'));var Sequelize=require('sequelize');module[_0x07ea('0x1')]={'uniqueid':{'type':Sequelize[_0x07ea('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x07ea('0x3')]},'leaveAt':{'type':Sequelize[_0x07ea('0x3')]},'acceptAt':{'type':Sequelize[_0x07ea('0x3')]},'exitAt':{'type':Sequelize[_0x07ea('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 697f524..39aaa4b 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 _0x5d95=['count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x290e98,_0x368978){var _0x48fbd1=function(_0x26fa98){while(--_0x26fa98){_0x290e98['push'](_0x290e98['shift']());}};_0x48fbd1(++_0x368978);}(_0x5d95,0x77));var _0x55d9=function(_0x1fdfe1,_0xeabf7b){_0x1fdfe1=_0x1fdfe1-0x0;var _0x2708cc=_0x5d95[_0x1fdfe1];return _0x2708cc;};'use strict';var emlformat=require(_0x55d9('0x0'));var rimraf=require(_0x55d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55d9('0x2'));var rp=require(_0x55d9('0x3'));var moment=require(_0x55d9('0x4'));var BPromise=require(_0x55d9('0x5'));var Mustache=require(_0x55d9('0x6'));var util=require('util');var path=require(_0x55d9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x55d9('0x8'));var fs=require('fs');var fs_extra=require(_0x55d9('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x55d9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x55d9('0xb'));var authService=require(_0x55d9('0xc'));var qs=require(_0x55d9('0xd'));var as=require(_0x55d9('0xe'));var hardwareService=require(_0x55d9('0xf'));var logger=require(_0x55d9('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x55d9('0x11'));var licenseUtil=require(_0x55d9('0x12'));var db=require(_0x55d9('0x13'))['db'];function respondWithStatusCode(_0x44e501,_0x134318){_0x134318=_0x134318||0xcc;return function(_0x244af1){if(_0x244af1){return _0x44e501[_0x55d9('0x14')](_0x134318);}return _0x44e501[_0x55d9('0x15')](_0x134318)[_0x55d9('0x16')]();};}function respondWithResult(_0x581e43,_0x97a577){_0x97a577=_0x97a577||0xc8;return function(_0x39967c){if(_0x39967c){return _0x581e43[_0x55d9('0x15')](_0x97a577)[_0x55d9('0x17')](_0x39967c);}};}function respondWithFilteredResult(_0x2c3111,_0x3ec410){return function(_0x25fcf7){if(_0x25fcf7){var _0x5c66e2=typeof _0x3ec410[_0x55d9('0x18')]===_0x55d9('0x19')&&typeof _0x3ec410[_0x55d9('0x1a')]===_0x55d9('0x19');var _0x45a0cc=_0x25fcf7[_0x55d9('0x1b')];var _0x50faa6=_0x5c66e2?0x0:_0x3ec410[_0x55d9('0x18')];var _0x1af997=_0x5c66e2?_0x25fcf7['count']:_0x3ec410['offset']+_0x3ec410['limit'];var _0xed70ef;if(_0x1af997>=_0x45a0cc){_0x1af997=_0x45a0cc;_0xed70ef=0xc8;}else{_0xed70ef=0xce;}_0x2c3111[_0x55d9('0x15')](_0xed70ef);return _0x2c3111[_0x55d9('0x1c')](_0x55d9('0x1d'),_0x50faa6+'-'+_0x1af997+'/'+_0x45a0cc)['json'](_0x25fcf7);}return null;};}function patchUpdates(_0x13d435){return function(_0x2f4811){try{jsonpatch[_0x55d9('0x1e')](_0x2f4811,_0x13d435,!![]);}catch(_0x556d6f){return BPromise[_0x55d9('0x1f')](_0x556d6f);}return _0x2f4811[_0x55d9('0x20')]();};}function saveUpdates(_0x368cc7,_0xbfb957){return function(_0x54c648){if(_0x54c648){return _0x54c648['update'](_0x368cc7)[_0x55d9('0x21')](function(_0x416cc6){return _0x416cc6;});}return null;};}function removeEntity(_0x1f1b46,_0x3e1eef){return function(_0x334a6b){if(_0x334a6b){return _0x334a6b[_0x55d9('0x22')]()[_0x55d9('0x21')](function(){_0x1f1b46[_0x55d9('0x15')](0xcc)[_0x55d9('0x16')]();});}};}function handleEntityNotFound(_0x4bd725,_0x2686d7){return function(_0x2c5d21){if(!_0x2c5d21){_0x4bd725['sendStatus'](0x194);}return _0x2c5d21;};}function handleError(_0x267e5f,_0x581ee8){_0x581ee8=_0x581ee8||0x1f4;return function(_0x2c1890){logger[_0x55d9('0x23')](_0x2c1890[_0x55d9('0x24')]);if(_0x2c1890[_0x55d9('0x25')]){delete _0x2c1890[_0x55d9('0x25')];}_0x267e5f['status'](_0x581ee8)[_0x55d9('0x26')](_0x2c1890);};}exports['index']=function(_0x4c1bbe,_0x224c2a){var _0x3bb455={},_0x1b18bb={},_0x4d0027={'count':0x0,'rows':[]};var _0x3536a7=_[_0x55d9('0x27')](db[_0x55d9('0x28')][_0x55d9('0x29')],function(_0x1c89cd){return{'name':_0x1c89cd[_0x55d9('0x2a')],'type':_0x1c89cd[_0x55d9('0x2b')][_0x55d9('0x2c')]};});_0x1b18bb[_0x55d9('0x2d')]=_[_0x55d9('0x27')](_0x3536a7,_0x55d9('0x25'));_0x1b18bb[_0x55d9('0x2e')]=_[_0x55d9('0x2f')](_0x4c1bbe[_0x55d9('0x2e')]);_0x1b18bb[_0x55d9('0x30')]=_[_0x55d9('0x31')](_0x1b18bb[_0x55d9('0x2d')],_0x1b18bb[_0x55d9('0x2e')]);_0x3bb455[_0x55d9('0x32')]=_[_0x55d9('0x31')](_0x1b18bb[_0x55d9('0x2d')],qs[_0x55d9('0x33')](_0x4c1bbe[_0x55d9('0x2e')][_0x55d9('0x33')]));_0x3bb455['attributes']=_0x3bb455['attributes'][_0x55d9('0x34')]?_0x3bb455[_0x55d9('0x32')]:_0x1b18bb[_0x55d9('0x2d')];if(!_0x4c1bbe[_0x55d9('0x2e')][_0x55d9('0x35')](_0x55d9('0x36'))){_0x3bb455[_0x55d9('0x1a')]=qs[_0x55d9('0x1a')](_0x4c1bbe['query'][_0x55d9('0x1a')]);_0x3bb455[_0x55d9('0x18')]=qs[_0x55d9('0x18')](_0x4c1bbe[_0x55d9('0x2e')][_0x55d9('0x18')]);}_0x3bb455['order']=qs[_0x55d9('0x37')](_0x4c1bbe[_0x55d9('0x2e')][_0x55d9('0x37')]);_0x3bb455[_0x55d9('0x38')]=qs[_0x55d9('0x30')](_[_0x55d9('0x39')](_0x4c1bbe[_0x55d9('0x2e')],_0x1b18bb[_0x55d9('0x30')]),_0x3536a7);if(_0x4c1bbe[_0x55d9('0x2e')][_0x55d9('0x3a')]){_0x3bb455[_0x55d9('0x38')]=_[_0x55d9('0x3b')](_0x3bb455[_0x55d9('0x38')],{'$or':_[_0x55d9('0x27')](_0x3536a7,function(_0xc8484d){if(_0xc8484d[_0x55d9('0x2b')]!==_0x55d9('0x3c')){var _0x5f47ba={};_0x5f47ba[_0xc8484d[_0x55d9('0x25')]]={'$like':'%'+_0x4c1bbe['query'][_0x55d9('0x3a')]+'%'};return _0x5f47ba;}})});}_0x3bb455=_[_0x55d9('0x3b')]({},_0x3bb455,_0x4c1bbe[_0x55d9('0x3d')]);var _0x1b8969={'where':_0x3bb455['where']};return db[_0x55d9('0x28')][_0x55d9('0x1b')](_0x1b8969)[_0x55d9('0x21')](function(_0x1ee925){_0x4d0027['count']=_0x1ee925;if(_0x4c1bbe['query'][_0x55d9('0x3e')]){_0x3bb455[_0x55d9('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x3bb455);})[_0x55d9('0x21')](function(_0x3f0cee){_0x4d0027[_0x55d9('0x40')]=_0x3f0cee;return _0x4d0027;})[_0x55d9('0x21')](respondWithFilteredResult(_0x224c2a,_0x3bb455))[_0x55d9('0x41')](handleError(_0x224c2a,null));};exports[_0x55d9('0x42')]=function(_0x59a39e,_0x4236aa){var _0x16424b={'raw':!![],'where':{'id':_0x59a39e[_0x55d9('0x43')]['id']}},_0xb71831={};_0xb71831[_0x55d9('0x2d')]=_['keys'](db['ChatQueueReport'][_0x55d9('0x29')]);_0xb71831[_0x55d9('0x2e')]=_[_0x55d9('0x2f')](_0x59a39e[_0x55d9('0x2e')]);_0xb71831[_0x55d9('0x30')]=_[_0x55d9('0x31')](_0xb71831[_0x55d9('0x2d')],_0xb71831['query']);_0x16424b[_0x55d9('0x32')]=_[_0x55d9('0x31')](_0xb71831[_0x55d9('0x2d')],qs[_0x55d9('0x33')](_0x59a39e[_0x55d9('0x2e')]['fields']));_0x16424b['attributes']=_0x16424b[_0x55d9('0x32')]['length']?_0x16424b[_0x55d9('0x32')]:_0xb71831['model'];if(_0x59a39e[_0x55d9('0x2e')][_0x55d9('0x3e')]){_0x16424b[_0x55d9('0x3f')]=[{'all':!![]}];}_0x16424b=_[_0x55d9('0x3b')]({},_0x16424b,_0x59a39e['options']);return db[_0x55d9('0x28')]['find'](_0x16424b)['then'](handleEntityNotFound(_0x4236aa,null))['then'](respondWithResult(_0x4236aa,null))[_0x55d9('0x41')](handleError(_0x4236aa,null));};exports[_0x55d9('0x44')]=function(_0x5f0954,_0x246b81){return db['ChatQueueReport'][_0x55d9('0x44')](_0x5f0954[_0x55d9('0x45')],{})[_0x55d9('0x21')](respondWithResult(_0x246b81,0xc9))[_0x55d9('0x41')](handleError(_0x246b81,null));};exports[_0x55d9('0x46')]=function(_0x576013,_0x5c853b){if(_0x576013[_0x55d9('0x45')]['id']){delete _0x576013[_0x55d9('0x45')]['id'];}return db[_0x55d9('0x28')][_0x55d9('0x47')]({'where':{'id':_0x576013[_0x55d9('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c853b,null))[_0x55d9('0x21')](saveUpdates(_0x576013[_0x55d9('0x45')],null))[_0x55d9('0x21')](respondWithResult(_0x5c853b,null))[_0x55d9('0x41')](handleError(_0x5c853b,null));};exports[_0x55d9('0x22')]=function(_0x3b8e1f,_0x8e8814){return db['ChatQueueReport'][_0x55d9('0x47')]({'where':{'id':_0x3b8e1f[_0x55d9('0x43')]['id']}})[_0x55d9('0x21')](handleEntityNotFound(_0x8e8814,null))[_0x55d9('0x21')](removeEntity(_0x8e8814,null))[_0x55d9('0x41')](handleError(_0x8e8814,null));};exports['describe']=function(_0x345e6c,_0x595644){return db[_0x55d9('0x28')][_0x55d9('0x48')]()[_0x55d9('0x21')](respondWithResult(_0x595644,null))[_0x55d9('0x41')](handleError(_0x595644,null));};
\ No newline at end of file
+var _0x5e8d=['then','end','error','stack','name','index','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','length','includeAll','include','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x34d867,_0x3b8f27){_0x34d867=_0x34d867-0x0;var _0x3412f4=_0x5e8d[_0x34d867];return _0x3412f4;};'use strict';var emlformat=require(_0xd5e8('0x0'));var rimraf=require(_0xd5e8('0x1'));var zipdir=require(_0xd5e8('0x2'));var jsonpatch=require(_0xd5e8('0x3'));var rp=require(_0xd5e8('0x4'));var moment=require(_0xd5e8('0x5'));var BPromise=require(_0xd5e8('0x6'));var Mustache=require('mustache');var util=require(_0xd5e8('0x7'));var path=require(_0xd5e8('0x8'));var sox=require('sox');var csv=require(_0xd5e8('0x9'));var ejs=require(_0xd5e8('0xa'));var fs=require('fs');var fs_extra=require(_0xd5e8('0xb'));var _=require('lodash');var squel=require(_0xd5e8('0xc'));var crypto=require(_0xd5e8('0xd'));var jsforce=require(_0xd5e8('0xe'));var deskjs=require(_0xd5e8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd5e8('0x10'));var Redis=require(_0xd5e8('0x11'));var authService=require(_0xd5e8('0x12'));var qs=require(_0xd5e8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd5e8('0x14'));var logger=require(_0xd5e8('0x15'))('api');var utils=require(_0xd5e8('0x16'));var config=require(_0xd5e8('0x17'));var licenseUtil=require(_0xd5e8('0x18'));var db=require(_0xd5e8('0x19'))['db'];function respondWithStatusCode(_0xd8fa54,_0x3b2780){_0x3b2780=_0x3b2780||0xcc;return function(_0x397eb3){if(_0x397eb3){return _0xd8fa54[_0xd5e8('0x1a')](_0x3b2780);}return _0xd8fa54[_0xd5e8('0x1b')](_0x3b2780)['end']();};}function respondWithResult(_0x5a6665,_0x457bfb){_0x457bfb=_0x457bfb||0xc8;return function(_0x32de91){if(_0x32de91){return _0x5a6665[_0xd5e8('0x1b')](_0x457bfb)[_0xd5e8('0x1c')](_0x32de91);}};}function respondWithFilteredResult(_0x5a35cd,_0x399cb1){return function(_0x489a8e){if(_0x489a8e){var _0x2ef357=typeof _0x399cb1[_0xd5e8('0x1d')]===_0xd5e8('0x1e')&&typeof _0x399cb1[_0xd5e8('0x1f')]==='undefined';var _0x3daf6a=_0x489a8e[_0xd5e8('0x20')];var _0x529d45=_0x2ef357?0x0:_0x399cb1[_0xd5e8('0x1d')];var _0x1be884=_0x2ef357?_0x489a8e[_0xd5e8('0x20')]:_0x399cb1[_0xd5e8('0x1d')]+_0x399cb1[_0xd5e8('0x1f')];var _0x196648;if(_0x1be884>=_0x3daf6a){_0x1be884=_0x3daf6a;_0x196648=0xc8;}else{_0x196648=0xce;}_0x5a35cd[_0xd5e8('0x1b')](_0x196648);return _0x5a35cd[_0xd5e8('0x21')]('Content-Range',_0x529d45+'-'+_0x1be884+'/'+_0x3daf6a)[_0xd5e8('0x1c')](_0x489a8e);}return null;};}function patchUpdates(_0x1b1631){return function(_0x2c4fde){try{jsonpatch[_0xd5e8('0x22')](_0x2c4fde,_0x1b1631,!![]);}catch(_0x26b187){return BPromise[_0xd5e8('0x23')](_0x26b187);}return _0x2c4fde[_0xd5e8('0x24')]();};}function saveUpdates(_0x1d515d,_0x45bb02){return function(_0x33a4ff){if(_0x33a4ff){return _0x33a4ff[_0xd5e8('0x25')](_0x1d515d)[_0xd5e8('0x26')](function(_0x4592e5){return _0x4592e5;});}return null;};}function removeEntity(_0x5bfbb2,_0x4a133e){return function(_0x5f177c){if(_0x5f177c){return _0x5f177c['destroy']()[_0xd5e8('0x26')](function(){_0x5bfbb2['status'](0xcc)[_0xd5e8('0x27')]();});}};}function handleEntityNotFound(_0x3b1a69,_0x4add91){return function(_0x4efec6){if(!_0x4efec6){_0x3b1a69[_0xd5e8('0x1a')](0x194);}return _0x4efec6;};}function handleError(_0xfaad96,_0x2e220b){_0x2e220b=_0x2e220b||0x1f4;return function(_0x26018b){logger[_0xd5e8('0x28')](_0x26018b[_0xd5e8('0x29')]);if(_0x26018b[_0xd5e8('0x2a')]){delete _0x26018b[_0xd5e8('0x2a')];}_0xfaad96[_0xd5e8('0x1b')](_0x2e220b)['send'](_0x26018b);};}exports[_0xd5e8('0x2b')]=function(_0x570e6a,_0x2aa786){var _0x24f7e1={},_0x38414b={},_0x180d1f={'count':0x0,'rows':[]};var _0x1bbcb7=_['map'](db[_0xd5e8('0x2c')][_0xd5e8('0x2d')],function(_0x49276c){return{'name':_0x49276c[_0xd5e8('0x2e')],'type':_0x49276c['type'][_0xd5e8('0x2f')]};});_0x38414b[_0xd5e8('0x30')]=_[_0xd5e8('0x31')](_0x1bbcb7,_0xd5e8('0x2a'));_0x38414b[_0xd5e8('0x32')]=_[_0xd5e8('0x33')](_0x570e6a[_0xd5e8('0x32')]);_0x38414b[_0xd5e8('0x34')]=_['intersection'](_0x38414b[_0xd5e8('0x30')],_0x38414b[_0xd5e8('0x32')]);_0x24f7e1[_0xd5e8('0x35')]=_[_0xd5e8('0x36')](_0x38414b[_0xd5e8('0x30')],qs[_0xd5e8('0x37')](_0x570e6a[_0xd5e8('0x32')][_0xd5e8('0x37')]));_0x24f7e1['attributes']=_0x24f7e1['attributes']['length']?_0x24f7e1[_0xd5e8('0x35')]:_0x38414b[_0xd5e8('0x30')];if(!_0x570e6a[_0xd5e8('0x32')][_0xd5e8('0x38')](_0xd5e8('0x39'))){_0x24f7e1[_0xd5e8('0x1f')]=qs[_0xd5e8('0x1f')](_0x570e6a['query']['limit']);_0x24f7e1[_0xd5e8('0x1d')]=qs[_0xd5e8('0x1d')](_0x570e6a[_0xd5e8('0x32')][_0xd5e8('0x1d')]);}_0x24f7e1[_0xd5e8('0x3a')]=qs[_0xd5e8('0x3b')](_0x570e6a[_0xd5e8('0x32')][_0xd5e8('0x3b')]);_0x24f7e1[_0xd5e8('0x3c')]=qs[_0xd5e8('0x34')](_[_0xd5e8('0x3d')](_0x570e6a['query'],_0x38414b[_0xd5e8('0x34')]),_0x1bbcb7);if(_0x570e6a['query'][_0xd5e8('0x3e')]){_0x24f7e1['where']=_[_0xd5e8('0x3f')](_0x24f7e1['where'],{'$or':_[_0xd5e8('0x31')](_0x1bbcb7,function(_0x3f89fa){if(_0x3f89fa[_0xd5e8('0x40')]!==_0xd5e8('0x41')){var _0x39655c={};_0x39655c[_0x3f89fa[_0xd5e8('0x2a')]]={'$like':'%'+_0x570e6a['query']['filter']+'%'};return _0x39655c;}})});}_0x24f7e1=_[_0xd5e8('0x3f')]({},_0x24f7e1,_0x570e6a[_0xd5e8('0x42')]);var _0x4dc9d3={'where':_0x24f7e1['where']};return db[_0xd5e8('0x2c')][_0xd5e8('0x20')](_0x4dc9d3)[_0xd5e8('0x26')](function(_0x1c381c){_0x180d1f[_0xd5e8('0x20')]=_0x1c381c;if(_0x570e6a[_0xd5e8('0x32')]['includeAll']){_0x24f7e1['include']=[{'all':!![]}];}return db[_0xd5e8('0x2c')][_0xd5e8('0x43')](_0x24f7e1);})['then'](function(_0x13c718){_0x180d1f[_0xd5e8('0x44')]=_0x13c718;return _0x180d1f;})[_0xd5e8('0x26')](respondWithFilteredResult(_0x2aa786,_0x24f7e1))[_0xd5e8('0x45')](handleError(_0x2aa786,null));};exports[_0xd5e8('0x46')]=function(_0xc682e6,_0x488c46){var _0x53813a={'raw':!![],'where':{'id':_0xc682e6['params']['id']}},_0x26b14e={};_0x26b14e['model']=_[_0xd5e8('0x33')](db[_0xd5e8('0x2c')][_0xd5e8('0x2d')]);_0x26b14e['query']=_['keys'](_0xc682e6[_0xd5e8('0x32')]);_0x26b14e[_0xd5e8('0x34')]=_['intersection'](_0x26b14e[_0xd5e8('0x30')],_0x26b14e[_0xd5e8('0x32')]);_0x53813a[_0xd5e8('0x35')]=_[_0xd5e8('0x36')](_0x26b14e[_0xd5e8('0x30')],qs[_0xd5e8('0x37')](_0xc682e6[_0xd5e8('0x32')]['fields']));_0x53813a[_0xd5e8('0x35')]=_0x53813a[_0xd5e8('0x35')][_0xd5e8('0x47')]?_0x53813a[_0xd5e8('0x35')]:_0x26b14e[_0xd5e8('0x30')];if(_0xc682e6[_0xd5e8('0x32')][_0xd5e8('0x48')]){_0x53813a[_0xd5e8('0x49')]=[{'all':!![]}];}_0x53813a=_['merge']({},_0x53813a,_0xc682e6[_0xd5e8('0x42')]);return db[_0xd5e8('0x2c')][_0xd5e8('0x4a')](_0x53813a)[_0xd5e8('0x26')](handleEntityNotFound(_0x488c46,null))[_0xd5e8('0x26')](respondWithResult(_0x488c46,null))['catch'](handleError(_0x488c46,null));};exports[_0xd5e8('0x4b')]=function(_0x363051,_0x38c9be){return db[_0xd5e8('0x2c')]['create'](_0x363051[_0xd5e8('0x4c')],{})[_0xd5e8('0x26')](respondWithResult(_0x38c9be,0xc9))[_0xd5e8('0x45')](handleError(_0x38c9be,null));};exports['update']=function(_0x58a40b,_0x4b2f79){if(_0x58a40b['body']['id']){delete _0x58a40b[_0xd5e8('0x4c')]['id'];}return db[_0xd5e8('0x2c')][_0xd5e8('0x4a')]({'where':{'id':_0x58a40b['params']['id']}})[_0xd5e8('0x26')](handleEntityNotFound(_0x4b2f79,null))[_0xd5e8('0x26')](saveUpdates(_0x58a40b['body'],null))['then'](respondWithResult(_0x4b2f79,null))['catch'](handleError(_0x4b2f79,null));};exports[_0xd5e8('0x4d')]=function(_0x1c9926,_0x294c3f){return db[_0xd5e8('0x2c')]['find']({'where':{'id':_0x1c9926[_0xd5e8('0x4e')]['id']}})[_0xd5e8('0x26')](handleEntityNotFound(_0x294c3f,null))[_0xd5e8('0x26')](removeEntity(_0x294c3f,null))[_0xd5e8('0x45')](handleError(_0x294c3f,null));};exports[_0xd5e8('0x4f')]=function(_0x187a8a,_0x37e83d){return db['ChatQueueReport'][_0xd5e8('0x4f')]()[_0xd5e8('0x26')](respondWithResult(_0x37e83d,null))['catch'](handleError(_0x37e83d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 881f2ac..91e96bb 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x4d5a16,_0x72c052){var _0x49163b=function(_0xa69992){while(--_0xa69992){_0x4d5a16['push'](_0x4d5a16['shift']());}};_0x49163b(++_0x72c052);}(_0xb7e7,0x121));var _0x7b7e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xb7e7[_0x710815];return _0x5b3b89;};'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 fa729f4..55c3662 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 _0x0419=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','stringify','UpdateChatQueueReport','update','raw','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x0419,0x153));var _0x9041=function(_0x11c361,_0x4f5b42){_0x11c361=_0x11c361-0x0;var _0x1f5355=_0x0419[_0x11c361];return _0x1f5355;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9041('0x0'));var BPromise=require(_0x9041('0x1'));var rs=require(_0x9041('0x2'));var fs=require('fs');var Redis=require(_0x9041('0x3'));var db=require(_0x9041('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9041('0x5'));var config=require(_0x9041('0x6'));var jayson=require(_0x9041('0x7'));var client=jayson[_0x9041('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x118c44,_0x11a488,_0x5457be){return new BPromise(function(_0x48ac45,_0x39296c){return client[_0x9041('0x9')](_0x118c44,_0x5457be)[_0x9041('0xa')](function(_0x5afe95){logger[_0x9041('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x11a488,_0x9041('0xc'));logger[_0x9041('0xd')](_0x9041('0xe'),_0x11a488,'request\x20sent',JSON['stringify'](_0x5afe95));if(_0x5afe95[_0x9041('0xf')]){if(_0x5afe95[_0x9041('0xf')]['code']===0x1f4){logger['error'](_0x9041('0x10'),_0x11a488,_0x5afe95[_0x9041('0xf')][_0x9041('0x11')]);return _0x39296c(_0x5afe95[_0x9041('0xf')][_0x9041('0x11')]);}logger[_0x9041('0xf')](_0x9041('0x10'),_0x11a488,_0x5afe95[_0x9041('0xf')][_0x9041('0x11')]);return _0x48ac45(_0x5afe95[_0x9041('0xf')][_0x9041('0x11')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x11a488,'request\x20sent');_0x48ac45(_0x5afe95[_0x9041('0x12')][_0x9041('0x11')]);}})[_0x9041('0x13')](function(_0x54c323){logger[_0x9041('0xf')](_0x9041('0x10'),_0x11a488,_0x54c323);_0x39296c(_0x54c323);});});}exports[_0x9041('0x14')]=function(_0x4ebe42){var _0xe4a017=this;return new Promise(function(_0xf0630d,_0x3daf50){return db[_0x9041('0x15')][_0x9041('0x16')](_0x4ebe42[_0x9041('0x17')],{'raw':_0x4ebe42[_0x9041('0x18')]?_0x4ebe42[_0x9041('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x9041('0xa')](function(_0xa8ee07){logger[_0x9041('0xb')]('CreateChatQueueReport',_0x4ebe42);logger[_0x9041('0xd')](_0x9041('0x14'),_0x4ebe42,JSON[_0x9041('0x19')](_0xa8ee07));_0xf0630d(_0xa8ee07);})['catch'](function(_0x12c81c){logger['error'](_0x9041('0x14'),_0x12c81c[_0x9041('0x11')],_0x4ebe42);_0x3daf50(_0xe4a017['error'](0x1f4,_0x12c81c['message']));});});};exports[_0x9041('0x1a')]=function(_0x3d0002){var _0x9d7f9a=this;return new Promise(function(_0x3fe32e,_0x5b164d){return db['ChatQueueReport'][_0x9041('0x1b')](_0x3d0002[_0x9041('0x17')],{'raw':_0x3d0002[_0x9041('0x18')]?_0x3d0002[_0x9041('0x18')][_0x9041('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d0002['options']?_0x3d0002[_0x9041('0x18')][_0x9041('0x1d')]||null:null,'attributes':_0x3d0002['options']?_0x3d0002[_0x9041('0x18')][_0x9041('0x1e')]||null:null,'limit':_0x3d0002[_0x9041('0x18')]?_0x3d0002[_0x9041('0x18')][_0x9041('0x1f')]||null:null})[_0x9041('0xa')](function(_0x20b434){logger[_0x9041('0xb')](_0x9041('0x1a'),_0x3d0002);logger[_0x9041('0xd')](_0x9041('0x1a'),_0x3d0002,JSON[_0x9041('0x19')](_0x20b434));_0x3fe32e(_0x20b434);})[_0x9041('0x13')](function(_0x36f89d){logger[_0x9041('0xf')](_0x9041('0x1a'),_0x36f89d['message'],_0x3d0002);_0x5b164d(_0x9d7f9a[_0x9041('0xf')](0x1f4,_0x36f89d[_0x9041('0x11')]));});});};
\ No newline at end of file
+var _0x9f05=['ChatQueueReport','create','body','options','info','debug','UpdateChatQueueReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatQueueReport'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x9f05,0xf9));var _0x59f0=function(_0x305b94,_0x103317){_0x305b94=_0x305b94-0x0;var _0x5ebacd=_0x9f05[_0x305b94];return _0x5ebacd;};'use strict';var _=require(_0x59f0('0x0'));var util=require(_0x59f0('0x1'));var moment=require(_0x59f0('0x2'));var BPromise=require(_0x59f0('0x3'));var rs=require(_0x59f0('0x4'));var fs=require('fs');var Redis=require(_0x59f0('0x5'));var db=require(_0x59f0('0x6'))['db'];var utils=require(_0x59f0('0x7'));var logger=require(_0x59f0('0x8'))('rpc');var config=require(_0x59f0('0x9'));var jayson=require(_0x59f0('0xa'));var client=jayson[_0x59f0('0xb')][_0x59f0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b7b82,_0x2dbd8e,_0x252889){return new BPromise(function(_0x48263f,_0x45c883){return client[_0x59f0('0xd')](_0x4b7b82,_0x252889)[_0x59f0('0xe')](function(_0x59a0c8){logger['info'](_0x59f0('0xf'),_0x2dbd8e,'request\x20sent');logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x2dbd8e,_0x59f0('0x10'),JSON['stringify'](_0x59a0c8));if(_0x59a0c8[_0x59f0('0x11')]){if(_0x59a0c8['error'][_0x59f0('0x12')]===0x1f4){logger[_0x59f0('0x11')](_0x59f0('0xf'),_0x2dbd8e,_0x59a0c8[_0x59f0('0x11')][_0x59f0('0x13')]);return _0x45c883(_0x59a0c8[_0x59f0('0x11')][_0x59f0('0x13')]);}logger[_0x59f0('0x11')](_0x59f0('0xf'),_0x2dbd8e,_0x59a0c8[_0x59f0('0x11')][_0x59f0('0x13')]);return _0x48263f(_0x59a0c8[_0x59f0('0x11')][_0x59f0('0x13')]);}else{logger['info'](_0x59f0('0xf'),_0x2dbd8e,'request\x20sent');_0x48263f(_0x59a0c8[_0x59f0('0x14')][_0x59f0('0x13')]);}})[_0x59f0('0x15')](function(_0x3aae73){logger['error'](_0x59f0('0xf'),_0x2dbd8e,_0x3aae73);_0x45c883(_0x3aae73);});});}exports[_0x59f0('0x16')]=function(_0x54a71a){var _0x4eced8=this;return new Promise(function(_0x52c5d9,_0xa75eb7){return db[_0x59f0('0x17')][_0x59f0('0x18')](_0x54a71a[_0x59f0('0x19')],{'raw':_0x54a71a[_0x59f0('0x1a')]?_0x54a71a[_0x59f0('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x59f0('0xe')](function(_0x29ce7f){logger[_0x59f0('0x1b')]('CreateChatQueueReport',_0x54a71a);logger[_0x59f0('0x1c')](_0x59f0('0x16'),_0x54a71a,JSON['stringify'](_0x29ce7f));_0x52c5d9(_0x29ce7f);})[_0x59f0('0x15')](function(_0x57cd4e){logger[_0x59f0('0x11')](_0x59f0('0x16'),_0x57cd4e[_0x59f0('0x13')],_0x54a71a);_0xa75eb7(_0x4eced8[_0x59f0('0x11')](0x1f4,_0x57cd4e[_0x59f0('0x13')]));});});};exports[_0x59f0('0x1d')]=function(_0xd2d993){var _0x318fb7=this;return new Promise(function(_0x34ffa1,_0xee0084){return db[_0x59f0('0x17')][_0x59f0('0x1e')](_0xd2d993[_0x59f0('0x19')],{'raw':_0xd2d993[_0x59f0('0x1a')]?_0xd2d993[_0x59f0('0x1a')][_0x59f0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd2d993[_0x59f0('0x1a')]?_0xd2d993[_0x59f0('0x1a')][_0x59f0('0x20')]||null:null,'attributes':_0xd2d993[_0x59f0('0x1a')]?_0xd2d993[_0x59f0('0x1a')][_0x59f0('0x21')]||null:null,'limit':_0xd2d993[_0x59f0('0x1a')]?_0xd2d993['options']['limit']||null:null})[_0x59f0('0xe')](function(_0x2f3a8b){logger[_0x59f0('0x1b')](_0x59f0('0x1d'),_0xd2d993);logger[_0x59f0('0x1c')]('UpdateChatQueueReport',_0xd2d993,JSON['stringify'](_0x2f3a8b));_0x34ffa1(_0x2f3a8b);})[_0x59f0('0x15')](function(_0x522fb5){logger['error'](_0x59f0('0x1d'),_0x522fb5[_0x59f0('0x13')],_0xd2d993);_0xee0084(_0x318fb7[_0x59f0('0x11')](0x1f4,_0x522fb5[_0x59f0('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index e647012..44e028e 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 _0xdfd7=['path','express','fs-extra','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','describe','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xdfd7,0x83));var _0x7dfd=function(_0x1d2e49,_0x5d2a1c){_0x1d2e49=_0x1d2e49-0x0;var _0x30ee76=_0xdfd7[_0x1d2e49];return _0x30ee76;};'use strict';var multer=require(_0x7dfd('0x0'));var util=require(_0x7dfd('0x1'));var path=require(_0x7dfd('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dfd('0x3'));var router=express['Router']();var fs_extra=require(_0x7dfd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7dfd('0x5'));var controller=require(_0x7dfd('0x6'));router['get']('/',auth[_0x7dfd('0x7')](),controller[_0x7dfd('0x8')]);router[_0x7dfd('0x9')]('/describe',auth[_0x7dfd('0x7')](),controller[_0x7dfd('0xa')]);router[_0x7dfd('0x9')]('/:id',auth[_0x7dfd('0x7')](),controller['show']);router[_0x7dfd('0xb')]('/',auth[_0x7dfd('0x7')](),controller[_0x7dfd('0xc')]);router[_0x7dfd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x7dfd('0xe')]);router[_0x7dfd('0xf')](_0x7dfd('0x10'),auth[_0x7dfd('0x7')](),controller[_0x7dfd('0x11')]);module[_0x7dfd('0x12')]=router;
\ No newline at end of file
+var _0x3b7c=['update','destroy','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','create','put'];(function(_0x4f8877,_0x2af478){var _0x597b3e=function(_0x327587){while(--_0x327587){_0x4f8877['push'](_0x4f8877['shift']());}};_0x597b3e(++_0x2af478);}(_0x3b7c,0x192));var _0xc3b7=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0x3b7c[_0x24392f];return _0x591e33;};'use strict';var multer=require(_0xc3b7('0x0'));var util=require(_0xc3b7('0x1'));var path=require(_0xc3b7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc3b7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc3b7('0x4'));var config=require(_0xc3b7('0x5'));var controller=require(_0xc3b7('0x6'));router[_0xc3b7('0x7')]('/',auth[_0xc3b7('0x8')](),controller[_0xc3b7('0x9')]);router['get'](_0xc3b7('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xc3b7('0xb'),auth[_0xc3b7('0x8')](),controller['show']);router['post']('/',auth[_0xc3b7('0x8')](),controller[_0xc3b7('0xc')]);router[_0xc3b7('0xd')](_0xc3b7('0xb'),auth[_0xc3b7('0x8')](),controller[_0xc3b7('0xe')]);router['delete'](_0xc3b7('0xb'),auth[_0xc3b7('0x8')](),controller[_0xc3b7('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index e9c1cc4..e9095b7 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x643b2,_0x14e495){var _0x2e5346=function(_0x3ed065){while(--_0x3ed065){_0x643b2['push'](_0x643b2['shift']());}};_0x2e5346(++_0x14e495);}(_0x008c,0x188));var _0xc008=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0x008c[_0x5ce8b9];return _0xe34be0;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x5aa023,_0x1cf1d2){var _0x31ceb5=function(_0x40f643){while(--_0x40f643){_0x5aa023['push'](_0x5aa023['shift']());}};_0x31ceb5(++_0x1cf1d2);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 03cc2fd..904c33b 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 _0xff6f=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','ChatTransferReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','catch','show','keys','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x43ccac,_0x2c7511){var _0x384b91=function(_0x448e0){while(--_0x448e0){_0x43ccac['push'](_0x43ccac['shift']());}};_0x384b91(++_0x2c7511);}(_0xff6f,0x1f2));var _0xfff6=function(_0x357169,_0x68edd6){_0x357169=_0x357169-0x0;var _0x55dad1=_0xff6f[_0x357169];return _0x55dad1;};'use strict';var emlformat=require(_0xfff6('0x0'));var rimraf=require(_0xfff6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfff6('0x2'));var rp=require(_0xfff6('0x3'));var moment=require(_0xfff6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfff6('0x5'));var util=require(_0xfff6('0x6'));var path=require(_0xfff6('0x7'));var sox=require(_0xfff6('0x8'));var csv=require(_0xfff6('0x9'));var ejs=require(_0xfff6('0xa'));var fs=require('fs');var fs_extra=require(_0xfff6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfff6('0xc'));var jsforce=require(_0xfff6('0xd'));var deskjs=require(_0xfff6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfff6('0xf'));var Papa=require(_0xfff6('0x10'));var Redis=require(_0xfff6('0x11'));var authService=require(_0xfff6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfff6('0x13'));var hardwareService=require(_0xfff6('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfff6('0x15'));var config=require(_0xfff6('0x16'));var licenseUtil=require(_0xfff6('0x17'));var db=require(_0xfff6('0x18'))['db'];function respondWithStatusCode(_0x2dbae7,_0x3440cb){_0x3440cb=_0x3440cb||0xcc;return function(_0x4fb107){if(_0x4fb107){return _0x2dbae7[_0xfff6('0x19')](_0x3440cb);}return _0x2dbae7['status'](_0x3440cb)[_0xfff6('0x1a')]();};}function respondWithResult(_0x386d7d,_0x235ce0){_0x235ce0=_0x235ce0||0xc8;return function(_0xbf20a6){if(_0xbf20a6){return _0x386d7d['status'](_0x235ce0)[_0xfff6('0x1b')](_0xbf20a6);}};}function respondWithFilteredResult(_0x5d1f54,_0x33a827){return function(_0x3c06ef){if(_0x3c06ef){var _0x204e53=typeof _0x33a827[_0xfff6('0x1c')]===_0xfff6('0x1d')&&typeof _0x33a827[_0xfff6('0x1e')]===_0xfff6('0x1d');var _0x436c42=_0x3c06ef['count'];var _0x422b28=_0x204e53?0x0:_0x33a827[_0xfff6('0x1c')];var _0xa37963=_0x204e53?_0x3c06ef[_0xfff6('0x1f')]:_0x33a827[_0xfff6('0x1c')]+_0x33a827['limit'];var _0x292a3e;if(_0xa37963>=_0x436c42){_0xa37963=_0x436c42;_0x292a3e=0xc8;}else{_0x292a3e=0xce;}_0x5d1f54[_0xfff6('0x20')](_0x292a3e);return _0x5d1f54['set'](_0xfff6('0x21'),_0x422b28+'-'+_0xa37963+'/'+_0x436c42)[_0xfff6('0x1b')](_0x3c06ef);}return null;};}function patchUpdates(_0x57630f){return function(_0x367f53){try{jsonpatch[_0xfff6('0x22')](_0x367f53,_0x57630f,!![]);}catch(_0x175b27){return BPromise[_0xfff6('0x23')](_0x175b27);}return _0x367f53[_0xfff6('0x24')]();};}function saveUpdates(_0x3ea21c,_0x3d2bf8){return function(_0x1244bd){if(_0x1244bd){return _0x1244bd[_0xfff6('0x25')](_0x3ea21c)[_0xfff6('0x26')](function(_0x20e5e4){return _0x20e5e4;});}return null;};}function removeEntity(_0x3251b8,_0x21cd52){return function(_0x214c72){if(_0x214c72){return _0x214c72[_0xfff6('0x27')]()[_0xfff6('0x26')](function(){_0x3251b8['status'](0xcc)[_0xfff6('0x1a')]();});}};}function handleEntityNotFound(_0x14c2cc,_0x175ea7){return function(_0x2b80a6){if(!_0x2b80a6){_0x14c2cc[_0xfff6('0x19')](0x194);}return _0x2b80a6;};}function handleError(_0x7448e0,_0x3f6db1){_0x3f6db1=_0x3f6db1||0x1f4;return function(_0xb93e20){logger[_0xfff6('0x28')](_0xb93e20[_0xfff6('0x29')]);if(_0xb93e20[_0xfff6('0x2a')]){delete _0xb93e20[_0xfff6('0x2a')];}_0x7448e0[_0xfff6('0x20')](_0x3f6db1)['send'](_0xb93e20);};}exports[_0xfff6('0x2b')]=function(_0x27799c,_0x544bfe){var _0x3b0451={},_0x5434cf={},_0x1d5da7={'count':0x0,'rows':[]};var _0x1388cc=_['map'](db[_0xfff6('0x2c')]['rawAttributes'],function(_0x47246b){return{'name':_0x47246b[_0xfff6('0x2d')],'type':_0x47246b[_0xfff6('0x2e')][_0xfff6('0x2f')]};});_0x5434cf[_0xfff6('0x30')]=_['map'](_0x1388cc,_0xfff6('0x2a'));_0x5434cf[_0xfff6('0x31')]=_['keys'](_0x27799c[_0xfff6('0x31')]);_0x5434cf[_0xfff6('0x32')]=_[_0xfff6('0x33')](_0x5434cf[_0xfff6('0x30')],_0x5434cf[_0xfff6('0x31')]);_0x3b0451[_0xfff6('0x34')]=_[_0xfff6('0x33')](_0x5434cf[_0xfff6('0x30')],qs[_0xfff6('0x35')](_0x27799c['query'][_0xfff6('0x35')]));_0x3b0451['attributes']=_0x3b0451[_0xfff6('0x34')][_0xfff6('0x36')]?_0x3b0451[_0xfff6('0x34')]:_0x5434cf[_0xfff6('0x30')];if(!_0x27799c[_0xfff6('0x31')][_0xfff6('0x37')](_0xfff6('0x38'))){_0x3b0451[_0xfff6('0x1e')]=qs[_0xfff6('0x1e')](_0x27799c['query']['limit']);_0x3b0451[_0xfff6('0x1c')]=qs[_0xfff6('0x1c')](_0x27799c[_0xfff6('0x31')][_0xfff6('0x1c')]);}_0x3b0451[_0xfff6('0x39')]=qs[_0xfff6('0x3a')](_0x27799c[_0xfff6('0x31')]['sort']);_0x3b0451[_0xfff6('0x3b')]=qs[_0xfff6('0x32')](_[_0xfff6('0x3c')](_0x27799c['query'],_0x5434cf[_0xfff6('0x32')]),_0x1388cc);if(_0x27799c[_0xfff6('0x31')]['filter']){_0x3b0451[_0xfff6('0x3b')]=_[_0xfff6('0x3d')](_0x3b0451['where'],{'$or':_[_0xfff6('0x3e')](_0x1388cc,function(_0x4c3b53){if(_0x4c3b53[_0xfff6('0x2e')]!==_0xfff6('0x3f')){var _0x1fc640={};_0x1fc640[_0x4c3b53['name']]={'$like':'%'+_0x27799c[_0xfff6('0x31')]['filter']+'%'};return _0x1fc640;}})});}_0x3b0451=_['merge']({},_0x3b0451,_0x27799c[_0xfff6('0x40')]);var _0x51f4a9={'where':_0x3b0451['where']};return db[_0xfff6('0x2c')][_0xfff6('0x1f')](_0x51f4a9)[_0xfff6('0x26')](function(_0x3d1ac6){_0x1d5da7['count']=_0x3d1ac6;if(_0x27799c[_0xfff6('0x31')][_0xfff6('0x41')]){_0x3b0451['include']=[{'all':!![]}];}return db[_0xfff6('0x2c')]['findAll'](_0x3b0451);})[_0xfff6('0x26')](function(_0x1544c5){_0x1d5da7['rows']=_0x1544c5;return _0x1d5da7;})[_0xfff6('0x26')](respondWithFilteredResult(_0x544bfe,_0x3b0451))[_0xfff6('0x42')](handleError(_0x544bfe,null));};exports[_0xfff6('0x43')]=function(_0x1a8dae,_0x236f24){var _0x4f9872={'raw':!![],'where':{'id':_0x1a8dae['params']['id']}},_0x26c582={};_0x26c582[_0xfff6('0x30')]=_[_0xfff6('0x44')](db[_0xfff6('0x2c')]['rawAttributes']);_0x26c582['query']=_[_0xfff6('0x44')](_0x1a8dae[_0xfff6('0x31')]);_0x26c582['filters']=_[_0xfff6('0x33')](_0x26c582[_0xfff6('0x30')],_0x26c582[_0xfff6('0x31')]);_0x4f9872['attributes']=_['intersection'](_0x26c582[_0xfff6('0x30')],qs['fields'](_0x1a8dae['query'][_0xfff6('0x35')]));_0x4f9872[_0xfff6('0x34')]=_0x4f9872[_0xfff6('0x34')]['length']?_0x4f9872[_0xfff6('0x34')]:_0x26c582[_0xfff6('0x30')];if(_0x1a8dae[_0xfff6('0x31')]['includeAll']){_0x4f9872['include']=[{'all':!![]}];}_0x4f9872=_[_0xfff6('0x3d')]({},_0x4f9872,_0x1a8dae[_0xfff6('0x40')]);return db[_0xfff6('0x2c')]['find'](_0x4f9872)[_0xfff6('0x26')](handleEntityNotFound(_0x236f24,null))[_0xfff6('0x26')](respondWithResult(_0x236f24,null))['catch'](handleError(_0x236f24,null));};exports[_0xfff6('0x45')]=function(_0x5352cb,_0xa72982){return db['ChatTransferReport']['create'](_0x5352cb['body'],{})[_0xfff6('0x26')](respondWithResult(_0xa72982,0xc9))[_0xfff6('0x42')](handleError(_0xa72982,null));};exports[_0xfff6('0x25')]=function(_0x5ceb80,_0x45aa6c){if(_0x5ceb80[_0xfff6('0x46')]['id']){delete _0x5ceb80[_0xfff6('0x46')]['id'];}return db['ChatTransferReport'][_0xfff6('0x47')]({'where':{'id':_0x5ceb80[_0xfff6('0x48')]['id']}})['then'](handleEntityNotFound(_0x45aa6c,null))[_0xfff6('0x26')](saveUpdates(_0x5ceb80[_0xfff6('0x46')],null))['then'](respondWithResult(_0x45aa6c,null))[_0xfff6('0x42')](handleError(_0x45aa6c,null));};exports[_0xfff6('0x27')]=function(_0x5f46e6,_0x53c1b2){return db[_0xfff6('0x2c')][_0xfff6('0x47')]({'where':{'id':_0x5f46e6['params']['id']}})['then'](handleEntityNotFound(_0x53c1b2,null))[_0xfff6('0x26')](removeEntity(_0x53c1b2,null))['catch'](handleError(_0x53c1b2,null));};exports[_0xfff6('0x49')]=function(_0x15f89a,_0x57818c){return db[_0xfff6('0x2c')]['describe']()['then'](respondWithResult(_0x57818c,null))[_0xfff6('0x42')](handleError(_0x57818c,null));};
\ No newline at end of file
+var _0x7451=['type','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','ChatTransferReport'];(function(_0x4a2743,_0x1572fd){var _0x58b0d2=function(_0x2bc153){while(--_0x2bc153){_0x4a2743['push'](_0x4a2743['shift']());}};_0x58b0d2(++_0x1572fd);}(_0x7451,0x140));var _0x1745=function(_0x1e7c56,_0x304c82){_0x1e7c56=_0x1e7c56-0x0;var _0x5bb5e9=_0x7451[_0x1e7c56];return _0x5bb5e9;};'use strict';var emlformat=require(_0x1745('0x0'));var rimraf=require(_0x1745('0x1'));var zipdir=require(_0x1745('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1745('0x3'));var moment=require(_0x1745('0x4'));var BPromise=require(_0x1745('0x5'));var Mustache=require(_0x1745('0x6'));var util=require(_0x1745('0x7'));var path=require(_0x1745('0x8'));var sox=require(_0x1745('0x9'));var csv=require(_0x1745('0xa'));var ejs=require(_0x1745('0xb'));var fs=require('fs');var fs_extra=require(_0x1745('0xc'));var _=require(_0x1745('0xd'));var squel=require(_0x1745('0xe'));var crypto=require(_0x1745('0xf'));var jsforce=require(_0x1745('0x10'));var deskjs=require(_0x1745('0x11'));var toCsv=require(_0x1745('0xa'));var querystring=require('querystring');var Papa=require(_0x1745('0x12'));var Redis=require(_0x1745('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1745('0x14'));var hardwareService=require(_0x1745('0x15'));var logger=require('../../config/logger')(_0x1745('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1745('0x17'));var db=require(_0x1745('0x18'))['db'];function respondWithStatusCode(_0x9fb94d,_0x59b146){_0x59b146=_0x59b146||0xcc;return function(_0x2a8d8e){if(_0x2a8d8e){return _0x9fb94d[_0x1745('0x19')](_0x59b146);}return _0x9fb94d[_0x1745('0x1a')](_0x59b146)['end']();};}function respondWithResult(_0x4bd09e,_0x21f192){_0x21f192=_0x21f192||0xc8;return function(_0xecad73){if(_0xecad73){return _0x4bd09e[_0x1745('0x1a')](_0x21f192)[_0x1745('0x1b')](_0xecad73);}};}function respondWithFilteredResult(_0x46b7f8,_0x405140){return function(_0xf4ef4a){if(_0xf4ef4a){var _0x4f8ac6=typeof _0x405140[_0x1745('0x1c')]==='undefined'&&typeof _0x405140[_0x1745('0x1d')]==='undefined';var _0x992770=_0xf4ef4a[_0x1745('0x1e')];var _0x245498=_0x4f8ac6?0x0:_0x405140['offset'];var _0x1179f6=_0x4f8ac6?_0xf4ef4a[_0x1745('0x1e')]:_0x405140[_0x1745('0x1c')]+_0x405140[_0x1745('0x1d')];var _0x5960c8;if(_0x1179f6>=_0x992770){_0x1179f6=_0x992770;_0x5960c8=0xc8;}else{_0x5960c8=0xce;}_0x46b7f8['status'](_0x5960c8);return _0x46b7f8[_0x1745('0x1f')](_0x1745('0x20'),_0x245498+'-'+_0x1179f6+'/'+_0x992770)['json'](_0xf4ef4a);}return null;};}function patchUpdates(_0x376769){return function(_0xe89c3d){try{jsonpatch[_0x1745('0x21')](_0xe89c3d,_0x376769,!![]);}catch(_0x5d1b58){return BPromise[_0x1745('0x22')](_0x5d1b58);}return _0xe89c3d[_0x1745('0x23')]();};}function saveUpdates(_0x1f7506,_0x1dcaa2){return function(_0x5bad83){if(_0x5bad83){return _0x5bad83[_0x1745('0x24')](_0x1f7506)[_0x1745('0x25')](function(_0x373568){return _0x373568;});}return null;};}function removeEntity(_0xd5a17f,_0x32e8e2){return function(_0x5ab634){if(_0x5ab634){return _0x5ab634[_0x1745('0x26')]()[_0x1745('0x25')](function(){_0xd5a17f['status'](0xcc)[_0x1745('0x27')]();});}};}function handleEntityNotFound(_0x1f7fb5,_0x1ecfd){return function(_0x2f6a1d){if(!_0x2f6a1d){_0x1f7fb5[_0x1745('0x19')](0x194);}return _0x2f6a1d;};}function handleError(_0x39b45f,_0x2d8e4b){_0x2d8e4b=_0x2d8e4b||0x1f4;return function(_0x311467){logger['error'](_0x311467[_0x1745('0x28')]);if(_0x311467[_0x1745('0x29')]){delete _0x311467[_0x1745('0x29')];}_0x39b45f[_0x1745('0x1a')](_0x2d8e4b)[_0x1745('0x2a')](_0x311467);};}exports['index']=function(_0x3c0b29,_0x3616e7){var _0x800834={},_0xdf9628={},_0x27e72d={'count':0x0,'rows':[]};var _0x2481b4=_[_0x1745('0x2b')](db[_0x1745('0x2c')]['rawAttributes'],function(_0x3ce03f){return{'name':_0x3ce03f['fieldName'],'type':_0x3ce03f[_0x1745('0x2d')]['key']};});_0xdf9628['model']=_[_0x1745('0x2b')](_0x2481b4,_0x1745('0x29'));_0xdf9628[_0x1745('0x2e')]=_[_0x1745('0x2f')](_0x3c0b29['query']);_0xdf9628['filters']=_[_0x1745('0x30')](_0xdf9628['model'],_0xdf9628[_0x1745('0x2e')]);_0x800834[_0x1745('0x31')]=_[_0x1745('0x30')](_0xdf9628[_0x1745('0x32')],qs[_0x1745('0x33')](_0x3c0b29[_0x1745('0x2e')]['fields']));_0x800834[_0x1745('0x31')]=_0x800834[_0x1745('0x31')][_0x1745('0x34')]?_0x800834['attributes']:_0xdf9628[_0x1745('0x32')];if(!_0x3c0b29[_0x1745('0x2e')]['hasOwnProperty'](_0x1745('0x35'))){_0x800834[_0x1745('0x1d')]=qs[_0x1745('0x1d')](_0x3c0b29['query'][_0x1745('0x1d')]);_0x800834[_0x1745('0x1c')]=qs[_0x1745('0x1c')](_0x3c0b29[_0x1745('0x2e')][_0x1745('0x1c')]);}_0x800834[_0x1745('0x36')]=qs['sort'](_0x3c0b29[_0x1745('0x2e')][_0x1745('0x37')]);_0x800834[_0x1745('0x38')]=qs['filters'](_['pick'](_0x3c0b29[_0x1745('0x2e')],_0xdf9628[_0x1745('0x39')]),_0x2481b4);if(_0x3c0b29[_0x1745('0x2e')][_0x1745('0x3a')]){_0x800834['where']=_['merge'](_0x800834[_0x1745('0x38')],{'$or':_['map'](_0x2481b4,function(_0x4771b3){if(_0x4771b3[_0x1745('0x2d')]!==_0x1745('0x3b')){var _0x4e6664={};_0x4e6664[_0x4771b3[_0x1745('0x29')]]={'$like':'%'+_0x3c0b29[_0x1745('0x2e')][_0x1745('0x3a')]+'%'};return _0x4e6664;}})});}_0x800834=_[_0x1745('0x3c')]({},_0x800834,_0x3c0b29['options']);var _0x3cc171={'where':_0x800834['where']};return db['ChatTransferReport'][_0x1745('0x1e')](_0x3cc171)[_0x1745('0x25')](function(_0x37f854){_0x27e72d[_0x1745('0x1e')]=_0x37f854;if(_0x3c0b29[_0x1745('0x2e')][_0x1745('0x3d')]){_0x800834[_0x1745('0x3e')]=[{'all':!![]}];}return db[_0x1745('0x2c')][_0x1745('0x3f')](_0x800834);})[_0x1745('0x25')](function(_0x21c633){_0x27e72d[_0x1745('0x40')]=_0x21c633;return _0x27e72d;})[_0x1745('0x25')](respondWithFilteredResult(_0x3616e7,_0x800834))[_0x1745('0x41')](handleError(_0x3616e7,null));};exports['show']=function(_0x234501,_0x599523){var _0x47c49f={'raw':!![],'where':{'id':_0x234501[_0x1745('0x42')]['id']}},_0x157e6d={};_0x157e6d['model']=_[_0x1745('0x2f')](db[_0x1745('0x2c')][_0x1745('0x43')]);_0x157e6d[_0x1745('0x2e')]=_[_0x1745('0x2f')](_0x234501[_0x1745('0x2e')]);_0x157e6d[_0x1745('0x39')]=_[_0x1745('0x30')](_0x157e6d[_0x1745('0x32')],_0x157e6d[_0x1745('0x2e')]);_0x47c49f[_0x1745('0x31')]=_[_0x1745('0x30')](_0x157e6d[_0x1745('0x32')],qs['fields'](_0x234501[_0x1745('0x2e')][_0x1745('0x33')]));_0x47c49f['attributes']=_0x47c49f['attributes'][_0x1745('0x34')]?_0x47c49f[_0x1745('0x31')]:_0x157e6d[_0x1745('0x32')];if(_0x234501[_0x1745('0x2e')][_0x1745('0x3d')]){_0x47c49f[_0x1745('0x3e')]=[{'all':!![]}];}_0x47c49f=_[_0x1745('0x3c')]({},_0x47c49f,_0x234501[_0x1745('0x44')]);return db[_0x1745('0x2c')][_0x1745('0x45')](_0x47c49f)[_0x1745('0x25')](handleEntityNotFound(_0x599523,null))[_0x1745('0x25')](respondWithResult(_0x599523,null))['catch'](handleError(_0x599523,null));};exports[_0x1745('0x46')]=function(_0x30674c,_0x52432d){return db['ChatTransferReport']['create'](_0x30674c[_0x1745('0x47')],{})[_0x1745('0x25')](respondWithResult(_0x52432d,0xc9))['catch'](handleError(_0x52432d,null));};exports[_0x1745('0x24')]=function(_0x228456,_0xc86480){if(_0x228456[_0x1745('0x47')]['id']){delete _0x228456[_0x1745('0x47')]['id'];}return db[_0x1745('0x2c')][_0x1745('0x45')]({'where':{'id':_0x228456['params']['id']}})[_0x1745('0x25')](handleEntityNotFound(_0xc86480,null))[_0x1745('0x25')](saveUpdates(_0x228456[_0x1745('0x47')],null))['then'](respondWithResult(_0xc86480,null))[_0x1745('0x41')](handleError(_0xc86480,null));};exports['destroy']=function(_0xa3ae47,_0x254f8c){return db[_0x1745('0x2c')][_0x1745('0x45')]({'where':{'id':_0xa3ae47['params']['id']}})[_0x1745('0x25')](handleEntityNotFound(_0x254f8c,null))[_0x1745('0x25')](removeEntity(_0x254f8c,null))[_0x1745('0x41')](handleError(_0x254f8c,null));};exports[_0x1745('0x48')]=function(_0x56cd02,_0x3355ae){return db['ChatTransferReport'][_0x1745('0x48')]()['then'](respondWithResult(_0x3355ae,null))[_0x1745('0x41')](handleError(_0x3355ae,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 7d6c31a..59e150e 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 _0x3c9a=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x259c84,_0x51de45){var _0x4ecbab=function(_0x18c1eb){while(--_0x18c1eb){_0x259c84['push'](_0x259c84['shift']());}};_0x4ecbab(++_0x51de45);}(_0x3c9a,0x144));var _0xa3c9=function(_0x274d1a,_0x1a4f13){_0x274d1a=_0x274d1a-0x0;var _0x5c05d7=_0x3c9a[_0x274d1a];return _0x5c05d7;};'use strict';var _=require(_0xa3c9('0x0'));var util=require('util');var logger=require(_0xa3c9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa3c9('0x2'));var rp=require(_0xa3c9('0x3'));var fs=require('fs');var path=require(_0xa3c9('0x4'));var rimraf=require(_0xa3c9('0x5'));var config=require(_0xa3c9('0x6'));var attributes=require(_0xa3c9('0x7'));module[_0xa3c9('0x8')]=function(_0x2df3a6,_0x330c30){return _0x2df3a6[_0xa3c9('0x9')](_0xa3c9('0xa'),attributes,{'tableName':_0xa3c9('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa3c9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x218d=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','define'];(function(_0x51c1cd,_0x16afbe){var _0x5c0836=function(_0x22b1ca){while(--_0x22b1ca){_0x51c1cd['push'](_0x51c1cd['shift']());}};_0x5c0836(++_0x16afbe);}(_0x218d,0x1a3));var _0xd218=function(_0x532440,_0x11d6cb){_0x532440=_0x532440-0x0;var _0x15caff=_0x218d[_0x532440];return _0x15caff;};'use strict';var _=require(_0xd218('0x0'));var util=require(_0xd218('0x1'));var logger=require(_0xd218('0x2'))(_0xd218('0x3'));var moment=require('moment');var BPromise=require(_0xd218('0x4'));var rp=require(_0xd218('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd218('0x6'));var config=require(_0xd218('0x7'));var attributes=require(_0xd218('0x8'));module['exports']=function(_0x1c344e,_0x5d1c3d){return _0x1c344e[_0xd218('0x9')](_0xd218('0xa'),attributes,{'tableName':_0xd218('0xb'),'paranoid':![],'indexes':[{'name':_0xd218('0xc'),'fields':[_0xd218('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 471cdf4..8547cae 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 _0x102a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x48dfc9,_0x182be1){var _0x4c9b9c=function(_0x1c0e95){while(--_0x1c0e95){_0x48dfc9['push'](_0x48dfc9['shift']());}};_0x4c9b9c(++_0x182be1);}(_0x102a,0xe3));var _0xa102=function(_0x3d6d11,_0x4e4815){_0x3d6d11=_0x3d6d11-0x0;var _0x44f745=_0x102a[_0x3d6d11];return _0x44f745;};'use strict';var _=require(_0xa102('0x0'));var util=require('util');var moment=require(_0xa102('0x1'));var BPromise=require(_0xa102('0x2'));var rs=require(_0xa102('0x3'));var fs=require('fs');var Redis=require(_0xa102('0x4'));var db=require(_0xa102('0x5'))['db'];var utils=require(_0xa102('0x6'));var logger=require(_0xa102('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa102('0x8'));var client=jayson[_0xa102('0x9')][_0xa102('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d9c35,_0x2f1e59,_0x18249a){return new BPromise(function(_0x1f13ed,_0x48cd69){return client[_0xa102('0xb')](_0x1d9c35,_0x18249a)['then'](function(_0x46f5bd){logger[_0xa102('0xc')](_0xa102('0xd'),_0x2f1e59,_0xa102('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2f1e59,_0xa102('0xe'),JSON[_0xa102('0xf')](_0x46f5bd));if(_0x46f5bd['error']){if(_0x46f5bd[_0xa102('0x10')][_0xa102('0x11')]===0x1f4){logger['error'](_0xa102('0xd'),_0x2f1e59,_0x46f5bd['error'][_0xa102('0x12')]);return _0x48cd69(_0x46f5bd[_0xa102('0x10')]['message']);}logger[_0xa102('0x10')](_0xa102('0xd'),_0x2f1e59,_0x46f5bd['error'][_0xa102('0x12')]);return _0x1f13ed(_0x46f5bd[_0xa102('0x10')][_0xa102('0x12')]);}else{logger[_0xa102('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x2f1e59,'request\x20sent');_0x1f13ed(_0x46f5bd[_0xa102('0x13')][_0xa102('0x12')]);}})[_0xa102('0x14')](function(_0x46102e){logger[_0xa102('0x10')](_0xa102('0xd'),_0x2f1e59,_0x46102e);_0x48cd69(_0x46102e);});});}
\ No newline at end of file
+var _0x17c0=['message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1905f5,_0x52e8ee){var _0x35a32a=function(_0x3b5644){while(--_0x3b5644){_0x1905f5['push'](_0x1905f5['shift']());}};_0x35a32a(++_0x52e8ee);}(_0x17c0,0x191));var _0x017c=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0x17c0[_0x104a84];return _0x4973ff;};'use strict';var _=require(_0x017c('0x0'));var util=require(_0x017c('0x1'));var moment=require(_0x017c('0x2'));var BPromise=require('bluebird');var rs=require(_0x017c('0x3'));var fs=require('fs');var Redis=require(_0x017c('0x4'));var db=require(_0x017c('0x5'))['db'];var utils=require(_0x017c('0x6'));var logger=require(_0x017c('0x7'))('rpc');var config=require(_0x017c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x017c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1118e3,_0x47af27,_0x113c95){return new BPromise(function(_0x575c99,_0x588267){return client[_0x017c('0xa')](_0x1118e3,_0x113c95)['then'](function(_0x25400d){logger[_0x017c('0xb')](_0x017c('0xc'),_0x47af27,_0x017c('0xd'));logger[_0x017c('0xe')](_0x017c('0xf'),_0x47af27,_0x017c('0xd'),JSON[_0x017c('0x10')](_0x25400d));if(_0x25400d['error']){if(_0x25400d[_0x017c('0x11')][_0x017c('0x12')]===0x1f4){logger[_0x017c('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x47af27,_0x25400d[_0x017c('0x11')]['message']);return _0x588267(_0x25400d[_0x017c('0x11')]['message']);}logger[_0x017c('0x11')](_0x017c('0xc'),_0x47af27,_0x25400d[_0x017c('0x11')][_0x017c('0x13')]);return _0x575c99(_0x25400d[_0x017c('0x11')][_0x017c('0x13')]);}else{logger[_0x017c('0xb')](_0x017c('0xc'),_0x47af27,_0x017c('0xd'));_0x575c99(_0x25400d['result'][_0x017c('0x13')]);}})[_0x017c('0x14')](function(_0x53145c){logger[_0x017c('0x11')](_0x017c('0xc'),_0x47af27,_0x53145c);_0x588267(_0x53145c);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 8931f77..cedf073 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 _0xaa39=['delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update'];(function(_0x372632,_0x539bcc){var _0x5f2006=function(_0xe5b6bc){while(--_0xe5b6bc){_0x372632['push'](_0x372632['shift']());}};_0x5f2006(++_0x539bcc);}(_0xaa39,0xae));var _0x9aa3=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0xaa39[_0x3e3bee];return _0x3ae14c;};'use strict';var multer=require(_0x9aa3('0x0'));var util=require('util');var path=require(_0x9aa3('0x1'));var timeout=require('connect-timeout');var express=require(_0x9aa3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9aa3('0x3'));var interaction=require(_0x9aa3('0x4'));var config=require('../../config/environment');var controller=require(_0x9aa3('0x5'));router[_0x9aa3('0x6')]('/',auth[_0x9aa3('0x7')](),controller[_0x9aa3('0x8')]);router[_0x9aa3('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x9aa3('0x9')]);router['get'](_0x9aa3('0xa'),auth['isAuthenticated'](),controller[_0x9aa3('0xb')]);router[_0x9aa3('0xc')]('/',auth['isAuthenticated'](),controller[_0x9aa3('0xd')]);router[_0x9aa3('0xe')](_0x9aa3('0xa'),auth[_0x9aa3('0x7')](),controller[_0x9aa3('0xf')]);router[_0x9aa3('0x10')]('/:id',auth[_0x9aa3('0x7')](),controller[_0x9aa3('0x11')]);module[_0x9aa3('0x12')]=router;
\ No newline at end of file
+var _0x4426=['index','/describe','describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4426,0x198));var _0x6442=function(_0x237845,_0x49efa5){_0x237845=_0x237845-0x0;var _0x1bd715=_0x4426[_0x237845];return _0x1bd715;};'use strict';var multer=require(_0x6442('0x0'));var util=require(_0x6442('0x1'));var path=require(_0x6442('0x2'));var timeout=require(_0x6442('0x3'));var express=require(_0x6442('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6442('0x5'));var config=require(_0x6442('0x6'));var controller=require(_0x6442('0x7'));router[_0x6442('0x8')]('/',auth[_0x6442('0x9')](),controller[_0x6442('0xa')]);router[_0x6442('0x8')](_0x6442('0xb'),auth[_0x6442('0x9')](),controller[_0x6442('0xc')]);router['get'](_0x6442('0xd'),auth['isAuthenticated'](),controller[_0x6442('0xe')]);router[_0x6442('0xf')]('/',auth['isAuthenticated'](),controller[_0x6442('0x10')]);router['put']('/:id',auth[_0x6442('0x9')](),controller['update']);router[_0x6442('0x11')]('/:id',auth[_0x6442('0x9')](),controller['destroy']);module[_0x6442('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 76c2ae7..15a628e 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 _0x9edf=['ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','TEXT','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#ffffff','INTEGER','BOOLEAN'];(function(_0x48924d,_0xc70b2f){var _0xb4c95c=function(_0x46400e){while(--_0x46400e){_0x48924d['push'](_0x48924d['shift']());}};_0xb4c95c(++_0xc70b2f);}(_0x9edf,0xe7));var _0xf9ed=function(_0x113166,_0x58e406){_0x113166=_0x113166-0x0;var _0x5483f0=_0x9edf[_0x113166];return _0x5483f0;};'use strict';var Sequelize=require(_0xf9ed('0x0'));var rs=require(_0xf9ed('0x1'));module[_0xf9ed('0x2')]={'name':{'type':Sequelize[_0xf9ed('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x4')},'mapKeyOffline':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x4')},'key':{'type':Sequelize[_0xf9ed('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x5')},'customerAlias':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf9ed('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf9ed('0x3')],'allowNull':![],'defaultValue':_0xf9ed('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf9ed('0x3')],'allowNull':![],'defaultValue':_0xf9ed('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf9ed('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf9ed('0x3')]},'animation':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf9ed('0x9')](_0xf9ed('0xa'),_0xf9ed('0xb')),'defaultValue':_0xf9ed('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xf9ed('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0xd')},'header_offline':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0xe')},'download_transcript':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf9ed('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf9ed('0x10')},'noteTitle':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf9ed('0x11')},'closingMessage':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x12')},'closingMessageButton':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0xd')},'skipMessageButton':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x13')},'conditionAgreement':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x14')},'ratingType':{'type':Sequelize['ENUM']('star',_0xf9ed('0x15')),'defaultValue':_0xf9ed('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xf9ed('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf9ed('0x17')]({'items':[{'type':_0xf9ed('0x18'),'variable':null,'config':{'placeholder':_0xf9ed('0x19'),'type':_0xf9ed('0x1a'),'required':!![]},'props':{'title':_0xf9ed('0x19'),'helpText':''}},{'type':_0xf9ed('0x18'),'props':{'title':_0xf9ed('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xf9ed('0x4'),'type':_0xf9ed('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf9ed('0x1b')](_0xf9ed('0x1c'))?JSON[_0xf9ed('0x1d')](this['getDataValue'](_0xf9ed('0x1c'))):{};},'set':function(_0x2301b4){return this['setDataValue']('onlineForm',JSON[_0xf9ed('0x17')](_0x2301b4));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf9ed('0x17')]({'items':[{'type':_0xf9ed('0x18'),'props':{'title':_0xf9ed('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xf9ed('0x4'),'type':_0xf9ed('0x4')},'variable':null},{'type':_0xf9ed('0x1e'),'config':{'placeholder':_0xf9ed('0x1f')},'props':{'title':_0xf9ed('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xf9ed('0x20'))?JSON['parse'](this[_0xf9ed('0x1b')](_0xf9ed('0x20'))):{};},'set':function(_0x5a2bb2){return this[_0xf9ed('0x21')](_0xf9ed('0x20'),JSON[_0xf9ed('0x17')](_0x5a2bb2));}},'token':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':function(){return rs[_0xf9ed('0x22')]();}},'autoclose':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf9ed('0x3')]},'forwardOffline':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf9ed('0x23')},'waitingMessage':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x25')},'offlineMessageBody':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x13')},'sendUnmanaged':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf9ed('0x27')]},'showAgentAvatar':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf9ed('0x3')]},'notificationTemplate':{'type':Sequelize[_0xf9ed('0x27')],'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[_0xf9ed('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xf9ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf9ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xf9ed('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xf9ed('0x28')},'messagesAlignment':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x29')},'defaultTitle':{'type':Sequelize[_0xf9ed('0x3')]},'customerAvatar':{'type':Sequelize[_0xf9ed('0x27')]},'showCustomerAvatar':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf9ed('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf9ed('0x3')],'allowNull':![],'defaultValue':_0xf9ed('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf9ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':_0xf9ed('0x2b')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf9ed('0x7')],'comment':_0xf9ed('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1a4cd9){if(!_0x1a4cd9)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xf9ed('0x2d'),_0x1a4cd9);}},'vidaooEscalation':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf9ed('0x3')]},'vidaooTopic':{'type':Sequelize[_0xf9ed('0x3')],'allowNull':![],'defaultValue':_0xf9ed('0x2e')},'vidaooNote':{'type':Sequelize[_0xf9ed('0x3')],'defaultValue':function(){return _0xf9ed('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xf9ed('0x27')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf9ed('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf9ed('0x27')]}};
\ No newline at end of file
+var _0x4e0a=['textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','address','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0x4e0a,0x1bb));var _0xa4e0=function(_0x3d1996,_0x1f08f0){_0x3d1996=_0x3d1996-0x0;var _0x550afd=_0x4e0a[_0x3d1996];return _0x550afd;};'use strict';var Sequelize=require(_0xa4e0('0x0'));var rs=require('randomstring');module[_0xa4e0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa4e0('0x2')},'description':{'type':Sequelize[_0xa4e0('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xa4e0('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xa4e0('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa4e0('0x3')],'allowNull':![],'defaultValue':_0xa4e0('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa4e0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa4e0('0x3')],'allowNull':![],'defaultValue':_0xa4e0('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa4e0('0x3')],'allowNull':![],'defaultValue':_0xa4e0('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa4e0('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa4e0('0x8')]('rounded',_0xa4e0('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xa4e0('0xa')},'start_chat_button':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0xb')},'offline_chat_button':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0xc')},'header_offline':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0xd')},'download_transcript':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa4e0('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xa4e0('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa4e0('0x10')]},'closingQuestion':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x13')},'noteTitle':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa4e0('0x15')},'closingMessage':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x16')},'closingMessageButton':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa4e0('0x17')},'conditionAgreement':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0xa4e0('0x19'),_0xa4e0('0x1a')),'defaultValue':_0xa4e0('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xa4e0('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa4e0('0x1b')]({'items':[{'type':_0xa4e0('0x1c'),'variable':null,'config':{'placeholder':_0xa4e0('0x1d'),'type':_0xa4e0('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xa4e0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa4e0('0x4'),'type':_0xa4e0('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa4e0('0x1f')](_0xa4e0('0x20'))?JSON[_0xa4e0('0x21')](this[_0xa4e0('0x1f')](_0xa4e0('0x20'))):{};},'set':function(_0x175767){return this['setDataValue'](_0xa4e0('0x20'),JSON[_0xa4e0('0x1b')](_0x175767));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa4e0('0x1b')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa4e0('0x4'),'type':'email'},'variable':null},{'type':_0xa4e0('0x22'),'config':{'placeholder':_0xa4e0('0x23')},'props':{'title':'Comments','helpText':_0xa4e0('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xa4e0('0x1f')](_0xa4e0('0x25'))?JSON[_0xa4e0('0x21')](this[_0xa4e0('0x1f')](_0xa4e0('0x25'))):{};},'set':function(_0x30eb88){return this['setDataValue'](_0xa4e0('0x25'),JSON[_0xa4e0('0x1b')](_0x30eb88));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa4e0('0x26')]();}},'autoclose':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa4e0('0x3')]},'forwardOffline':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa4e0('0x3')]},'waitingTitle':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x29')},'skipUnmanaged':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa4e0('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa4e0('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa4e0('0x10')],'defaultValue':function(){return _0xa4e0('0x2a');}},'notificationSound':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xa4e0('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa4e0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x2d')},'messagesAlignment':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':_0xa4e0('0x2e')},'defaultTitle':{'type':Sequelize[_0xa4e0('0x3')]},'customerAvatar':{'type':Sequelize[_0xa4e0('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa4e0('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa4e0('0x3')],'allowNull':![],'defaultValue':_0xa4e0('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa4e0('0x30')},'systemAvatar':{'type':Sequelize[_0xa4e0('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa4e0('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![],'comment':_0xa4e0('0x31'),'set':function(_0x4acd2d){if(!_0x4acd2d)this[_0xa4e0('0x32')](_0xa4e0('0x33'),null);this[_0xa4e0('0x32')](_0xa4e0('0x34'),_0x4acd2d);}},'vidaooEscalation':{'type':Sequelize[_0xa4e0('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa4e0('0x3')]},'vidaooTopic':{'type':Sequelize[_0xa4e0('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xa4e0('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa4e0('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa4e0('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index ac98aae..b02c613 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 _0x847c=['hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','length','include','find','testWildcardValidity','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','ChatWebsiteId','Disposition','getDispositions','findOne','intersection','removeDispositions','ids','CannedAnswer','getAnswers','nolimit','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','existsSync','join','server/files/images/logos/','sitepic','download','getAvatar','server/files/images/avatars/default_avatar.png','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','Interval','resolve','timezone','ifTime','notify','from','From\x20is\x20mandatory','mapKey','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','CmList','List','Contacts','ChatApplication','Applications','Intervals','interval','applications','asc','account','list','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','Writing\x20on\x20closed\x20interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','email','MailAccount','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','User','Owner','fullname','internal','Tags','color','tag','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','origin','replace','testWebsiteWithWildcard','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','addApplications','Transaction','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','Contact','Attachments','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','URL','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','client','http','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','update','then','destroy','stack','name','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','type','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','query','keys','filters','fields','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x847c,0xdd));var _0xc847=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x847c[_0x1b2ff7];return _0x31656a;};'use strict';var Mustache=require(_0xc847('0x0'));var util=require(_0xc847('0x1'));var path=require('path');var ejs=require(_0xc847('0x2'));var fs=require('fs');var fs_extra=require(_0xc847('0x3'));var _=require('lodash');var querystring=require('querystring');var htmlToText=require('html-to-text');var Redis=require('ioredis');var jayson=require(_0xc847('0x4'));var qs=require(_0xc847('0x5'));var logger=require('../../config/logger')(_0xc847('0x6'));var config=require(_0xc847('0x7'));var APIBadRequestError=require(_0xc847('0x8'))['APIBadRequestError'];var APINotFoundError=require(_0xc847('0x8'))[_0xc847('0x9')];var APIOutOfIntervalError=require(_0xc847('0x8'))[_0xc847('0xa')];var APIHandleError=require(_0xc847('0x8'))[_0xc847('0xb')];var APIConflictError=require(_0xc847('0x8'))[_0xc847('0xc')];var wildcardUtils=require(_0xc847('0xd'));var URL=require('url')[_0xc847('0xe')];var db=require(_0xc847('0xf'))['db'];config[_0xc847('0x10')]=_[_0xc847('0x11')](config[_0xc847('0x10')],{'host':_0xc847('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc847('0x13'))[_0xc847('0x14')](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xc847('0x15')][_0xc847('0x16')]({'port':0x232b});var client9001=jayson[_0xc847('0x15')][_0xc847('0x16')]({'port':0x2329});function respondWithRpcPromise(_0xdc4f11,_0xa2474e,_0x1460cd,_0x560702){return new Promise(function(_0x56647c,_0x63fdab){var _0x253f61=_0x560702||client;return _0x253f61['request'](_0xdc4f11,_0x1460cd)['then'](function(_0x18efc5){logger[_0xc847('0x17')]('ChatWebsite,\x20%s,\x20%s',_0xa2474e,_0xc847('0x18'));logger[_0xc847('0x19')](_0xc847('0x1a'),_0xa2474e,_0xc847('0x18'),JSON[_0xc847('0x1b')](_0x18efc5));if(_0x18efc5['error']){if(_0x18efc5['error'][_0xc847('0x1c')]===0x1f4){logger[_0xc847('0x1d')](_0xc847('0x1e'),_0xa2474e,_0x18efc5[_0xc847('0x1d')][_0xc847('0x1f')]);return _0x63fdab(_0x18efc5[_0xc847('0x1d')][_0xc847('0x1f')]);}logger[_0xc847('0x1d')](_0xc847('0x1e'),_0xa2474e,_0x18efc5[_0xc847('0x1d')][_0xc847('0x1f')]);return _0x56647c(_0x18efc5[_0xc847('0x1d')][_0xc847('0x1f')]);}else{logger[_0xc847('0x17')](_0xc847('0x1e'),_0xa2474e,_0xc847('0x18'));_0x56647c(_0x18efc5['result'][_0xc847('0x1f')]);}})[_0xc847('0x20')](function(_0x106daa){logger[_0xc847('0x1d')](_0xc847('0x1e'),_0xa2474e,_0x106daa);_0x63fdab(_0x106daa);});});}function respondWithStatusCode(_0x525372,_0x67850d){_0x67850d=_0x67850d||0xcc;return function(_0x314c7f){if(_0x314c7f){return _0x525372[_0xc847('0x21')](_0x67850d);}return _0x525372['status'](_0x67850d)[_0xc847('0x22')]();};}function respondWithResult(_0x36f93a,_0x48dc43){_0x48dc43=_0x48dc43||0xc8;return function(_0x486619){if(_0x486619){return _0x36f93a[_0xc847('0x23')](_0x48dc43)[_0xc847('0x24')](_0x486619);}};}function respondWithFilteredResult(_0x272da5,_0x222cd9){return function(_0x52f812){if(_0x52f812){var _0x520d3a=typeof _0x222cd9['offset']===_0xc847('0x25')&&typeof _0x222cd9['limit']==='undefined';var _0x1110fa=_0x52f812[_0xc847('0x26')];var _0x4212fe=_0x520d3a?0x0:_0x222cd9[_0xc847('0x27')];var _0x130273=_0x520d3a?_0x52f812['count']:_0x222cd9[_0xc847('0x27')]+_0x222cd9[_0xc847('0x28')];var _0x2f61a5;if(_0x130273>=_0x1110fa){_0x130273=_0x1110fa;_0x2f61a5=0xc8;}else{_0x2f61a5=0xce;}_0x272da5['status'](_0x2f61a5);return _0x272da5['set'](_0xc847('0x29'),_0x4212fe+'-'+_0x130273+'/'+_0x1110fa)[_0xc847('0x24')](_0x52f812);}return null;};}function saveUpdates(_0x123625){return function(_0x21f2d0){if(_0x21f2d0){return _0x21f2d0[_0xc847('0x2a')](_0x123625)[_0xc847('0x2b')](function(_0x4e81ee){return _0x4e81ee;});}return null;};}function removeEntity(_0x523c4e){return function(_0x4109c7){if(_0x4109c7){return _0x4109c7['destroy']()[_0xc847('0x2b')](function(){var _0x44debe=_0x4109c7['get']({'plain':!![]});var _0x299501='ChatWebsites';return db['UserProfileResource'][_0xc847('0x2c')]({'where':{'type':_0x299501,'resourceId':_0x44debe['id']}})['then'](function(){return _0x4109c7;});})[_0xc847('0x2b')](function(){_0x523c4e[_0xc847('0x23')](0xcc)[_0xc847('0x22')]();});}};}function handleEntityNotFound(_0x3b7dbd){return function(_0x449ac1){if(!_0x449ac1){_0x3b7dbd[_0xc847('0x21')](0x194);}return _0x449ac1;};}function handleError(_0x13a310,_0x44cfa0){_0x44cfa0=_0x44cfa0||0x1f4;return function(_0x2b7194){logger[_0xc847('0x1d')](_0x2b7194[_0xc847('0x2d')]);if(_0x2b7194['name']){delete _0x2b7194[_0xc847('0x2e')];}_0x13a310['status'](_0x44cfa0)['send'](_0x2b7194);};}function createInteractionObject(_0x57e297,_0x1b0f9d,_0x36c5c6,_0xe279f7){var _0x4d04c4=require('user-agent-parser');var _0x2787f8=new _0x4d04c4();var _0xf8cb59=_0x2787f8[_0xc847('0x2f')](_0x36c5c6[_0xc847('0x30')])[_0xc847('0x31')]();var _0xcfe003=_0x1b0f9d[_0xc847('0x32')];if(_0x36c5c6[_0xc847('0x33')]){_0xcfe003=_0x36c5c6['cf-connecting-ip'];}else if(_0x36c5c6[_0xc847('0x34')]){_0xcfe003=_['first'](_0x36c5c6[_0xc847('0x34')][_0xc847('0x35')](','));}return{'ContactId':_0xe279f7['id'],'ChatWebsiteId':_0x57e297,'from':(_0xe279f7[_0xc847('0x36')]||'')+'\x20'+(_0xe279f7[_0xc847('0x37')]||''),'customerIp':_0xcfe003,'customerPort':_0x36c5c6[_0xc847('0x38')]?_0x36c5c6['x-real-port']:null,'referer':_0x1b0f9d[_0xc847('0x39')],'browserName':_0xf8cb59['browser'][_0xc847('0x2e')]&&_0xf8cb59[_0xc847('0x3a')][_0xc847('0x3b')]?util[_0xc847('0x3c')](_0xc847('0x3d'),_0xf8cb59[_0xc847('0x3a')]['name'],_0xf8cb59['browser']['version']):_0xc847('0x3e'),'browserVersion':_0xf8cb59['browser'][_0xc847('0x3b')]||_0xc847('0x3e'),'osName':util[_0xc847('0x3c')](_0xc847('0x3d'),_0xf8cb59['os'][_0xc847('0x2e')],_0xf8cb59['os'][_0xc847('0x3b')]),'osVersion':_0xf8cb59['os'][_0xc847('0x3b')],'deviceModel':_0xf8cb59[_0xc847('0x3f')]['model']&&_0xf8cb59[_0xc847('0x3f')][_0xc847('0x40')]?util[_0xc847('0x3c')](_0xc847('0x41'),_0xf8cb59[_0xc847('0x3f')][_0xc847('0x42')],_0xf8cb59[_0xc847('0x3f')][_0xc847('0x40')],_0xf8cb59[_0xc847('0x3f')][_0xc847('0x43')]):null,'deviceVendor':_0xf8cb59[_0xc847('0x3f')][_0xc847('0x40')],'deviceType':_0xf8cb59[_0xc847('0x3f')]['type'],'formData':JSON[_0xc847('0x1b')](_0x1b0f9d)};}exports['index']=function(_0x4be50a,_0x111aa4){var _0x1e5fb5={'include':[{'model':db[_0xc847('0x44')],'as':_0xc847('0x45')}]},_0x234d94={},_0x300d72={'count':0x0,'rows':[]};var _0x1414b9=_[_0xc847('0x46')](db[_0xc847('0x47')][_0xc847('0x48')],function(_0x3f01be){return{'name':_0x3f01be['fieldName'],'type':_0x3f01be[_0xc847('0x43')]['key']};});_0x234d94[_0xc847('0x42')]=_[_0xc847('0x46')](_0x1414b9,'name');_0x234d94[_0xc847('0x49')]=_[_0xc847('0x4a')](_0x4be50a['query']);_0x234d94[_0xc847('0x4b')]=_['intersection'](_0x234d94[_0xc847('0x42')],_0x234d94[_0xc847('0x49')]);_0x1e5fb5['attributes']=_['intersection'](_0x234d94[_0xc847('0x42')],qs[_0xc847('0x4c')](_0x4be50a['query'][_0xc847('0x4c')]));_0x1e5fb5[_0xc847('0x4d')]=_0x1e5fb5[_0xc847('0x4d')]['length']?_0x1e5fb5[_0xc847('0x4d')]:_0x234d94['model'];if(!_0x4be50a['query'][_0xc847('0x4e')]('nolimit')){_0x1e5fb5[_0xc847('0x28')]=qs[_0xc847('0x28')](_0x4be50a[_0xc847('0x49')][_0xc847('0x28')]);_0x1e5fb5[_0xc847('0x27')]=qs[_0xc847('0x27')](_0x4be50a[_0xc847('0x49')][_0xc847('0x27')]);}_0x1e5fb5[_0xc847('0x4f')]=qs[_0xc847('0x50')](_0x4be50a[_0xc847('0x49')][_0xc847('0x50')]);_0x1e5fb5['where']=qs[_0xc847('0x4b')](_[_0xc847('0x51')](_0x4be50a[_0xc847('0x49')],_0x234d94['filters']),_0x1414b9);if(_0x4be50a['query'][_0xc847('0x52')]){_0x1e5fb5['where']=_['merge'](_0x1e5fb5[_0xc847('0x53')],{'$or':_['map'](_0x1414b9,function(_0x476891){if(_0x476891[_0xc847('0x43')]!==_0xc847('0x54')){var _0x1df134={};_0x1df134[_0x476891['name']]={'$like':'%'+_0x4be50a[_0xc847('0x49')][_0xc847('0x52')]+'%'};return _0x1df134;}})});}_0x1e5fb5=_[_0xc847('0x55')]({},_0x1e5fb5,_0x4be50a[_0xc847('0x56')]);var _0x2205e3={'where':_0x1e5fb5[_0xc847('0x53')]};return db[_0xc847('0x47')][_0xc847('0x26')](_0x2205e3)['then'](function(_0x4a03cd){_0x300d72[_0xc847('0x26')]=_0x4a03cd;if(_0x4be50a[_0xc847('0x49')][_0xc847('0x57')]){_0x1e5fb5['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xc847('0x58')](_0x1e5fb5);})['then'](function(_0x54aa3e){_0x300d72[_0xc847('0x59')]=_0x54aa3e;return _0x300d72;})[_0xc847('0x2b')](respondWithFilteredResult(_0x111aa4,_0x1e5fb5))[_0xc847('0x20')](handleError(_0x111aa4,null));};exports[_0xc847('0x5a')]=function(_0x3e6bdf,_0x2aeaa4){var _0x533186={'raw':![],'where':{'id':_0x3e6bdf[_0xc847('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4c48d2={};_0x4c48d2[_0xc847('0x42')]=_[_0xc847('0x4a')](db[_0xc847('0x47')]['rawAttributes']);_0x4c48d2[_0xc847('0x49')]=_[_0xc847('0x4a')](_0x3e6bdf[_0xc847('0x49')]);_0x4c48d2[_0xc847('0x4b')]=_['intersection'](_0x4c48d2[_0xc847('0x42')],_0x4c48d2[_0xc847('0x49')]);_0x533186[_0xc847('0x4d')]=_['intersection'](_0x4c48d2[_0xc847('0x42')],qs['fields'](_0x3e6bdf['query'][_0xc847('0x4c')]));_0x533186[_0xc847('0x4d')]=_0x533186['attributes'][_0xc847('0x5c')]?_0x533186[_0xc847('0x4d')]:_0x4c48d2[_0xc847('0x42')];if(_0x3e6bdf['query'][_0xc847('0x57')]){_0x533186[_0xc847('0x5d')]=[{'all':!![]}];}_0x533186=_['merge']({},_0x533186,_0x3e6bdf[_0xc847('0x56')]);return db[_0xc847('0x47')][_0xc847('0x5e')](_0x533186)[_0xc847('0x2b')](handleEntityNotFound(_0x2aeaa4,null))[_0xc847('0x2b')](respondWithResult(_0x2aeaa4,null))[_0xc847('0x20')](handleError(_0x2aeaa4,null));};exports['create']=function(_0xbc7c1f,_0x11ea70){if(!wildcardUtils[_0xc847('0x5f')](_0xbc7c1f[_0xc847('0x60')][_0xc847('0x61')])){return handleError(_0x11ea70,null)(new APIBadRequestError('\x22'+_0xbc7c1f[_0xc847('0x60')]['address']+_0xc847('0x62')));}return db[_0xc847('0x47')][_0xc847('0x63')](_0xbc7c1f['body'],{})[_0xc847('0x2b')](function(_0x3d63c4){var _0x27cbb5=_0xbc7c1f[_0xc847('0x64')]['get']({'plain':!![]});if(!_0x27cbb5)throw new Error(_0xc847('0x65'));if(_0x27cbb5[_0xc847('0x66')]===_0xc847('0x64')){var _0x4eaac2=_0x3d63c4[_0xc847('0x67')]({'plain':!![]});var _0x56add4=_0xc847('0x68');return db[_0xc847('0x69')][_0xc847('0x5e')]({'where':{'name':_0x56add4,'userProfileId':_0x27cbb5[_0xc847('0x6a')]},'raw':!![]})[_0xc847('0x2b')](function(_0x253849){if(_0x253849&&_0x253849[_0xc847('0x6b')]===0x0){return db[_0xc847('0x6c')]['create']({'name':_0x4eaac2[_0xc847('0x2e')],'resourceId':_0x4eaac2['id'],'type':_0x253849[_0xc847('0x2e')],'sectionId':_0x253849['id']},{})['then'](function(){return _0x3d63c4;});}else{return _0x3d63c4;}})[_0xc847('0x20')](function(_0x318e84){logger[_0xc847('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x318e84);throw _0x318e84;});}return _0x3d63c4;})[_0xc847('0x2b')](respondWithResult(_0x11ea70,0xc9))[_0xc847('0x20')](handleError(_0x11ea70,null));};exports['update']=function(_0x282dd0,_0x1a6477){if(!wildcardUtils[_0xc847('0x5f')](_0x282dd0['body']['address'])){return handleError(_0x1a6477,null)(new APIBadRequestError('\x22'+_0x282dd0[_0xc847('0x60')]['address']+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}if(_0x282dd0[_0xc847('0x60')]['id']){delete _0x282dd0['body']['id'];}return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0x282dd0[_0xc847('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0xc847('0x45')}]})[_0xc847('0x2b')](handleEntityNotFound(_0x1a6477,null))[_0xc847('0x2b')](saveUpdates(_0x282dd0[_0xc847('0x60')],null))[_0xc847('0x2b')](respondWithResult(_0x1a6477,null))[_0xc847('0x20')](handleError(_0x1a6477,null));};exports[_0xc847('0x2c')]=function(_0x5aa906,_0x11b859){return db[_0xc847('0x47')]['find']({'where':{'id':_0x5aa906['params']['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x11b859,null))[_0xc847('0x2b')](removeEntity(_0x11b859,null))[_0xc847('0x20')](handleError(_0x11b859,null));};exports[_0xc847('0x6d')]=function(_0x1cbc54,_0x4887a8){return db[_0xc847('0x47')][_0xc847('0x6d')]()['then'](respondWithResult(_0x4887a8,null))[_0xc847('0x20')](handleError(_0x4887a8,null));};exports['addDisposition']=function(_0x592b96,_0x42993c){if(_0x592b96[_0xc847('0x60')]['id']){delete _0x592b96[_0xc847('0x60')]['id'];}return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0x592b96[_0xc847('0x5b')]['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x42993c,null))[_0xc847('0x2b')](function(_0x523814){if(_0x523814){_0x592b96[_0xc847('0x60')][_0xc847('0x6e')]=_0x523814['id'];return db[_0xc847('0x6f')][_0xc847('0x63')](_0x592b96[_0xc847('0x60')]);}})['then'](respondWithResult(_0x42993c,null))[_0xc847('0x20')](handleError(_0x42993c,null));};exports[_0xc847('0x70')]=function(_0x44bdc2,_0x24a3ba){var _0x4148b7={'raw':![],'where':{}};var _0x297a70={};var _0xeef1bb={'count':0x0,'rows':[]};return db[_0xc847('0x47')][_0xc847('0x71')]({'where':{'id':_0x44bdc2[_0xc847('0x5b')]['id']}})['then'](handleEntityNotFound(_0x24a3ba,null))[_0xc847('0x2b')](function(_0x3e2b0a){if(_0x3e2b0a){_0x297a70[_0xc847('0x42')]=_[_0xc847('0x4a')](db[_0xc847('0x6f')][_0xc847('0x48')]);_0x297a70[_0xc847('0x49')]=_[_0xc847('0x4a')](_0x44bdc2[_0xc847('0x49')]);_0x297a70[_0xc847('0x4b')]=_[_0xc847('0x72')](_0x297a70['model'],_0x297a70['query']);_0x4148b7[_0xc847('0x4d')]=_[_0xc847('0x72')](_0x297a70['model'],qs[_0xc847('0x4c')](_0x44bdc2[_0xc847('0x49')][_0xc847('0x4c')]));_0x4148b7[_0xc847('0x4d')]=_0x4148b7[_0xc847('0x4d')][_0xc847('0x5c')]?_0x4148b7['attributes']:_0x297a70[_0xc847('0x42')];if(!_0x44bdc2[_0xc847('0x49')][_0xc847('0x4e')]('nolimit')){_0x4148b7[_0xc847('0x28')]=qs[_0xc847('0x28')](_0x44bdc2['query']['limit']);_0x4148b7[_0xc847('0x27')]=qs[_0xc847('0x27')](_0x44bdc2[_0xc847('0x49')]['offset']);}_0x4148b7[_0xc847('0x4f')]=qs[_0xc847('0x50')](_0x44bdc2[_0xc847('0x49')][_0xc847('0x50')]);_0x4148b7[_0xc847('0x53')]=qs[_0xc847('0x4b')](_[_0xc847('0x51')](_0x44bdc2[_0xc847('0x49')],_0x297a70[_0xc847('0x4b')]));_0x4148b7['where'][_0xc847('0x6e')]=_0x3e2b0a['id'];if(_0x44bdc2['query'][_0xc847('0x52')]){_0x4148b7['where']=_[_0xc847('0x55')](_0x4148b7['where'],{'$or':_['map'](_0x4148b7[_0xc847('0x4d')],function(_0x292e7e){var _0x4f675b={};_0x4f675b[_0x292e7e]={'$like':'%'+_0x44bdc2[_0xc847('0x49')][_0xc847('0x52')]+'%'};return _0x4f675b;})});}_0x4148b7=_[_0xc847('0x55')]({},_0x4148b7,_0x44bdc2[_0xc847('0x56')]);return db[_0xc847('0x6f')][_0xc847('0x26')]({'where':_0x4148b7[_0xc847('0x53')]})['then'](function(_0x31c9d8){_0xeef1bb[_0xc847('0x26')]=_0x31c9d8;if(_0x44bdc2[_0xc847('0x49')][_0xc847('0x57')]){_0x4148b7[_0xc847('0x5d')]=[{'all':!![]}];}return db[_0xc847('0x6f')][_0xc847('0x58')](_0x4148b7);})[_0xc847('0x2b')](function(_0x4728d4){_0xeef1bb['rows']=_0x4728d4;return _0xeef1bb;});}})[_0xc847('0x2b')](respondWithFilteredResult(_0x24a3ba,_0x4148b7))[_0xc847('0x20')](handleError(_0x24a3ba,null));};exports[_0xc847('0x73')]=function(_0x4e51d8,_0x3f4beb){return db['ChatWebsite']['find']({'where':{'id':_0x4e51d8[_0xc847('0x5b')]['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x3f4beb,null))['then'](function(_0x3342dc){if(_0x3342dc){return _0x3342dc[_0xc847('0x73')](_0x4e51d8['query'][_0xc847('0x74')]);}})[_0xc847('0x2b')](respondWithStatusCode(_0x3f4beb,null))[_0xc847('0x20')](handleError(_0x3f4beb,null));};exports['addAnswer']=function(_0x5ef70c,_0x161d5c){if(_0x5ef70c[_0xc847('0x60')]['id']){delete _0x5ef70c['body']['id'];}return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0x5ef70c[_0xc847('0x5b')]['id']}})['then'](handleEntityNotFound(_0x161d5c,null))['then'](function(_0x4a3561){if(_0x4a3561){_0x5ef70c[_0xc847('0x60')][_0xc847('0x6e')]=_0x4a3561['id'];return db[_0xc847('0x75')][_0xc847('0x63')](_0x5ef70c[_0xc847('0x60')]);}})['then'](respondWithResult(_0x161d5c,null))[_0xc847('0x20')](handleError(_0x161d5c,null));};exports[_0xc847('0x76')]=function(_0x3e5c2a,_0x151e6f){var _0x17270a={'raw':![],'where':{}};var _0x5609fa={};var _0x2525eb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc847('0x71')]({'where':{'id':_0x3e5c2a['params']['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x151e6f,null))[_0xc847('0x2b')](function(_0x2a86e4){if(_0x2a86e4){_0x5609fa['model']=_[_0xc847('0x4a')](db[_0xc847('0x75')][_0xc847('0x48')]);_0x5609fa['query']=_[_0xc847('0x4a')](_0x3e5c2a[_0xc847('0x49')]);_0x5609fa[_0xc847('0x4b')]=_[_0xc847('0x72')](_0x5609fa[_0xc847('0x42')],_0x5609fa['query']);_0x17270a[_0xc847('0x4d')]=_[_0xc847('0x72')](_0x5609fa[_0xc847('0x42')],qs['fields'](_0x3e5c2a[_0xc847('0x49')][_0xc847('0x4c')]));_0x17270a[_0xc847('0x4d')]=_0x17270a[_0xc847('0x4d')]['length']?_0x17270a['attributes']:_0x5609fa['model'];if(!_0x3e5c2a[_0xc847('0x49')]['hasOwnProperty'](_0xc847('0x77'))){_0x17270a['limit']=qs[_0xc847('0x28')](_0x3e5c2a['query']['limit']);_0x17270a['offset']=qs[_0xc847('0x27')](_0x3e5c2a['query'][_0xc847('0x27')]);}_0x17270a[_0xc847('0x4f')]=qs['sort'](_0x3e5c2a[_0xc847('0x49')][_0xc847('0x50')]);_0x17270a['where']=qs[_0xc847('0x4b')](_[_0xc847('0x51')](_0x3e5c2a[_0xc847('0x49')],_0x5609fa[_0xc847('0x4b')]));_0x17270a[_0xc847('0x53')]['ChatWebsiteId']=_0x2a86e4['id'];if(_0x3e5c2a['query'][_0xc847('0x52')]){_0x17270a['where']=_['merge'](_0x17270a[_0xc847('0x53')],{'$or':_[_0xc847('0x46')](_0x17270a[_0xc847('0x4d')],function(_0x17ef3e){var _0x4fda31={};_0x4fda31[_0x17ef3e]={'$like':'%'+_0x3e5c2a[_0xc847('0x49')]['filter']+'%'};return _0x4fda31;})});}_0x17270a=_[_0xc847('0x55')]({},_0x17270a,_0x3e5c2a[_0xc847('0x56')]);return db[_0xc847('0x75')][_0xc847('0x26')]({'where':_0x17270a[_0xc847('0x53')]})[_0xc847('0x2b')](function(_0x3f74ae){_0x2525eb['count']=_0x3f74ae;if(_0x3e5c2a[_0xc847('0x49')]['includeAll']){_0x17270a['include']=[{'all':!![]}];}return db[_0xc847('0x75')]['findAll'](_0x17270a);})[_0xc847('0x2b')](function(_0xd1decb){_0x2525eb[_0xc847('0x59')]=_0xd1decb;return _0x2525eb;});}})[_0xc847('0x2b')](respondWithFilteredResult(_0x151e6f,_0x17270a))[_0xc847('0x20')](handleError(_0x151e6f,null));};exports[_0xc847('0x78')]=function(_0x25cb24,_0x883b3d){return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0x25cb24[_0xc847('0x5b')]['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x883b3d,null))[_0xc847('0x2b')](function(_0xddb3ad){if(_0xddb3ad){return _0xddb3ad[_0xc847('0x78')](_0x25cb24[_0xc847('0x49')][_0xc847('0x74')]);}})['then'](respondWithStatusCode(_0x883b3d,null))[_0xc847('0x20')](handleError(_0x883b3d,null));};exports[_0xc847('0x79')]=function(_0x32b268,_0x255f31){_0x32b268[_0xc847('0x60')]['sitepic']=_0x32b268[_0xc847('0x7a')][_0xc847('0x7b')];return db['ChatWebsite']['find']({'where':{'id':_0x32b268[_0xc847('0x5b')]['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x255f31,null))['then'](saveUpdates(_0x32b268[_0xc847('0x60')],null))[_0xc847('0x2b')](respondWithResult(_0x255f31,null))[_0xc847('0x20')](handleError(_0x255f31,null));};exports[_0xc847('0x7c')]=function(_0x23e38e,_0x47f60c){_0x23e38e[_0xc847('0x60')][_0xc847('0x7d')]=_0x23e38e[_0xc847('0x7a')][_0xc847('0x7b')];return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0x23e38e[_0xc847('0x5b')]['id']}})['then'](handleEntityNotFound(_0x47f60c,null))[_0xc847('0x2b')](saveUpdates(_0x23e38e[_0xc847('0x60')],null))[_0xc847('0x2b')](respondWithResult(_0x47f60c,null))[_0xc847('0x20')](handleError(_0x47f60c,null));};exports[_0xc847('0x7e')]=function(_0x476a29,_0x5a16bc){_0x476a29[_0xc847('0x60')][_0xc847('0x7f')]=_0x476a29[_0xc847('0x7a')]['filename'];return db['ChatWebsite'][_0xc847('0x5e')]({'where':{'id':_0x476a29[_0xc847('0x5b')]['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x5a16bc,null))[_0xc847('0x2b')](saveUpdates(_0x476a29[_0xc847('0x60')],null))['then'](respondWithResult(_0x5a16bc,null))[_0xc847('0x20')](handleError(_0x5a16bc,null));};exports[_0xc847('0x80')]=function(_0xf18b3a,_0x31f9e0){_0xf18b3a['body'][_0xc847('0x81')]=_0xf18b3a['file'][_0xc847('0x7b')];return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0xf18b3a[_0xc847('0x5b')]['id']}})['then'](handleEntityNotFound(_0x31f9e0,null))['then'](saveUpdates(_0xf18b3a['body'],null))[_0xc847('0x2b')](respondWithResult(_0x31f9e0,null))[_0xc847('0x20')](handleError(_0x31f9e0,null));};exports[_0xc847('0x82')]=function(_0x20de1f,_0x564195){var _0x23bde5=path['join'](config[_0xc847('0x83')],_0xc847('0x84'));var _0x3ff402={'where':{'id':_0x20de1f[_0xc847('0x5b')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1da92c=![];return require(_0xc847('0x85'))[_0xc847('0x86')]()['then'](function(_0x1878c1){if(_0x1878c1){_0x1da92c=_0x1878c1['custom'];}})['then'](function(){return db['ChatWebsite'][_0xc847('0x5e')](_0x3ff402);})[_0xc847('0x2b')](handleEntityNotFound(_0x564195,null))['then'](function(_0x4af202){if(_0x4af202){if(!_[_0xc847('0x87')](_0x4af202['sitepic'])){if(fs[_0xc847('0x88')](path[_0xc847('0x89')](config[_0xc847('0x83')],_0xc847('0x8a'),_0x4af202[_0xc847('0x8b')]))&&_0x1da92c){_0x23bde5=path[_0xc847('0x89')](config['root'],_0xc847('0x8a'),_0x4af202['sitepic']);}}return _0x564195[_0xc847('0x8c')](_0x23bde5);}})['catch'](handleError(_0x564195,null));};exports[_0xc847('0x8d')]=function(_0x108395,_0x5f4f3b){var _0x36feaf=path[_0xc847('0x89')](config[_0xc847('0x83')],_0xc847('0x8e'));var _0x3dd7bb={'where':{'id':_0x108395[_0xc847('0x5b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0xc847('0x5e')](_0x3dd7bb)[_0xc847('0x2b')](handleEntityNotFound(_0x5f4f3b,null))[_0xc847('0x2b')](function(_0x17fe66){if(_0x17fe66){if(!_['isNil'](_0x17fe66['agentAvatar'])){if(fs[_0xc847('0x88')](path['join'](config[_0xc847('0x83')],'server/files/images/avatars/',_0x17fe66['agentAvatar']))){_0x36feaf=path[_0xc847('0x89')](config[_0xc847('0x83')],'server/files/images/avatars/',_0x17fe66[_0xc847('0x7d')]);}}return _0x5f4f3b[_0xc847('0x8c')](_0x36feaf);}})[_0xc847('0x20')](handleError(_0x5f4f3b,null));};exports[_0xc847('0x8f')]=function(_0x26fe91,_0x35f5ab){var _0x19f2a1=path[_0xc847('0x89')](config[_0xc847('0x83')],_0xc847('0x90'));var _0x250b1c={'where':{'id':_0x26fe91[_0xc847('0x5b')]['id']},'attributes':['id',_0xc847('0x7f'),_0xc847('0x91')],'raw':!![]};return db['ChatWebsite'][_0xc847('0x5e')](_0x250b1c)[_0xc847('0x2b')](handleEntityNotFound(_0x35f5ab,null))[_0xc847('0x2b')](function(_0x1abd14){if(_0x1abd14){if(!_['isNil'](_0x1abd14[_0xc847('0x7f')])){if(fs[_0xc847('0x88')](path['join'](config[_0xc847('0x83')],_0xc847('0x92'),_0x1abd14[_0xc847('0x7f')]))&&_0x1abd14[_0xc847('0x91')]){_0x19f2a1=path[_0xc847('0x89')](config[_0xc847('0x83')],_0xc847('0x92'),_0x1abd14[_0xc847('0x7f')]);}}return _0x35f5ab['download'](_0x19f2a1);}})[_0xc847('0x20')](handleError(_0x35f5ab,null));};exports['getSystemAvatar']=function(_0x4c82e7,_0x4c8770){var _0x2b7f5=path[_0xc847('0x89')](config[_0xc847('0x83')],'server/files/images/avatars/system_avatar.png');var _0x1d4976={'where':{'id':_0x4c82e7[_0xc847('0x5b')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xc847('0x5e')](_0x1d4976)[_0xc847('0x2b')](handleEntityNotFound(_0x4c8770,null))[_0xc847('0x2b')](function(_0x29d61a){if(_0x29d61a){if(!_['isNil'](_0x29d61a[_0xc847('0x81')])){if(fs[_0xc847('0x88')](path[_0xc847('0x89')](config[_0xc847('0x83')],_0xc847('0x92'),_0x29d61a[_0xc847('0x81')]))){_0x2b7f5=path[_0xc847('0x89')](config[_0xc847('0x83')],_0xc847('0x92'),_0x29d61a['systemAvatar']);}}return _0x4c8770[_0xc847('0x8c')](_0x2b7f5);}})['catch'](handleError(_0x4c8770,null));};function checkWebsiteInterval(_0x27e854){var _0xbf18c5=_0x27e854[_0xc847('0x93')];if(!_0xbf18c5){return Promise[_0xc847('0x94')](_0x27e854);}var _0x556e53=_0x27e854[_0xc847('0x95')]||undefined;return _0xbf18c5[_0xc847('0x96')](_0x556e53)[_0xc847('0x2b')](function(_0x1ea923){if(!_0x1ea923){throw new APIOutOfIntervalError();}return _0x27e854;});}exports[_0xc847('0x97')]=function(_0x2665b1,_0x4c198f){var _0x567171={'body':_0x2665b1['body'],'channel':'chat'};var _0x4469f5=[];var _0x4cfac0=[];var _0x393204={};var _0xba6183=![];if(_0x2665b1[_0xc847('0x60')]['id']){delete _0x2665b1['body']['id'];}if(_['isNil'](_0x2665b1['body'][_0xc847('0x98')])){throw new APIBadRequestError(_0xc847('0x99'));}if(_[_0xc847('0x87')](_0x2665b1[_0xc847('0x60')][_0xc847('0x9a')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_['isEmpty'](_0x2665b1[_0xc847('0x60')]['body'])){throw new APIBadRequestError(_0xc847('0x9b'));}var _0x43e2f9=_0x2665b1['body'][_0xc847('0x32')]&&_0x2665b1[_0xc847('0x60')]['referer'];return db[_0xc847('0x9c')][_0xc847('0x6d')]()[_0xc847('0x2b')](function(_0x29d83b){if(!_0x29d83b){throw new Error(_0xc847('0x9d'));}_0x4469f5=Object[_0xc847('0x4a')](_0x29d83b)[_0xc847('0x52')](function(_0x13a521){return![_0xc847('0x9e'),_0xc847('0x9f')][_0xc847('0xa0')](_0x13a521);});_0x4cfac0=Object['keys'](_0x29d83b)[_0xc847('0x52')](function(_0x57e994){return![_0xc847('0x9e'),'updatedAt',_0xc847('0xa1'),_0xc847('0xa2')]['includes'](_0x57e994);});if(!_[_0xc847('0xa0')](_0x4cfac0,_0x2665b1['body'][_0xc847('0x9a')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x4cfac0[_0xc847('0x89')](',\x20'));}_0x393204[_0x2665b1['body'][_0xc847('0x9a')]]=_0x2665b1[_0xc847('0x60')][_0xc847('0x98')];})['then'](function(){return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0x2665b1[_0xc847('0x5b')]['id']},'include':[{'model':db[_0xc847('0xa3')],'as':_0xc847('0xa4'),'include':[{'model':db['CmContact'],'as':_0xc847('0xa5'),'where':_0x393204,'limit':0x1,'order':[[_0xc847('0x9f'),'DESC']]}]},{'model':db[_0xc847('0xa6')],'as':_0xc847('0xa7')},{'model':db['Interval'],'as':_0xc847('0x93'),'include':[{'model':db['Interval'],'as':_0xc847('0xa8'),'attributes':['id',_0xc847('0xa9')],'raw':!![]}]}]});})['then'](function(_0x5a2e52){if(!_0x5a2e52){throw new APINotFoundError(util[_0xc847('0x3c')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x2665b1[_0xc847('0x5b')]['id']));}if(_0x43e2f9){return checkWebsiteInterval(_0x5a2e52);}return _0x5a2e52;})[_0xc847('0x2b')](function(_0x15d9c8){_0x567171['account']=_0x15d9c8;_0x567171[_0xc847('0xaa')]=_['orderBy'](_0x15d9c8['Applications'],['priority'],[_0xc847('0xab')]);if(_0x567171[_0xc847('0xac')][_0xc847('0xa7')]){delete _0x567171[_0xc847('0xac')]['Applications'];}_0x567171[_0xc847('0xad')]=_0x15d9c8['List']||{'id':_0x15d9c8[_0xc847('0xa2')]};if(_0x567171[_0xc847('0xad')]&&_0x567171[_0xc847('0xad')][_0xc847('0xa5')]['length']){return _0x567171[_0xc847('0xad')][_0xc847('0xa5')][0x0];}var _0x46acec=_[_0xc847('0x11')](_0x2665b1[_0xc847('0x60')],{'firstName':_0x2665b1['body'][_0xc847('0x98')],'ListId':_0x15d9c8[_0xc847('0xa2')]});_0x46acec[_0x2665b1[_0xc847('0x60')][_0xc847('0x9a')]]=_0x2665b1[_0xc847('0x60')]['from'];return db[_0xc847('0x9c')][_0xc847('0x63')](_0x46acec,{'fields':_0x4469f5,'raw':!![]});})[_0xc847('0x2b')](function(_0x2a981e){_0x567171[_0xc847('0xae')]=_0x2a981e;var _0x48ad90=createInteractionObject(_0x2665b1[_0xc847('0x5b')]['id'],_0x2665b1[_0xc847('0x60')],_0x2665b1[_0xc847('0xaf')],_0x2a981e);var _0x2e2d2e={'ChatWebsiteId':_0x2665b1[_0xc847('0x5b')]['id']};if(_0x2665b1[_0xc847('0x60')][_0xc847('0xb0')]){_0x2e2d2e[_0xc847('0xb0')]=_0x2665b1['body'][_0xc847('0xb0')];_0x2e2d2e['closed']=![];return db[_0xc847('0xb1')][_0xc847('0x5e')]({'where':_0x2e2d2e})[_0xc847('0x2b')](function(_0x9baef6){var _0x3f22d7=_0x2665b1['body']['customerIp']&&_0x2665b1[_0xc847('0x60')]['referer'];if(_0x9baef6){_0xba6183=!![];return _0x9baef6;}else if(!_0x3f22d7&&_0x9baef6&&_0x9baef6['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x48ad90[_0xc847('0xb0')]=_0x2665b1[_0xc847('0x60')]['threadId'];_0x48ad90['externalUrl']=_0x2665b1['body'][_0xc847('0xb2')];return db[_0xc847('0xb1')][_0xc847('0x63')](_0x48ad90);});}_0x2e2d2e[_0xc847('0xb3')]=_0x2a981e['id'];if(_0x2665b1[_0xc847('0x60')][_0xc847('0xb4')]&&_0x2665b1[_0xc847('0x60')]['interaction']['id']){_0x2e2d2e['id']=_0x2665b1['body'][_0xc847('0xb4')]['id'];return db[_0xc847('0xb1')][_0xc847('0x5e')]({'where':_0x2e2d2e})[_0xc847('0x2b')](function(_0x219c1d){var _0x4086da=_0x2665b1['body'][_0xc847('0x32')]&&_0x2665b1[_0xc847('0x60')]['referer'];if(!_0x4086da&&_0x219c1d&&_0x219c1d['closed']){throw new APIConflictError(_0xc847('0xb5'));}else if(_0x219c1d){_0xba6183=!![];return _0x219c1d;}else{return db[_0xc847('0xb1')][_0xc847('0x63')](_0x48ad90);}});}return db[_0xc847('0xb1')]['create'](_0x48ad90);})[_0xc847('0x2b')](function(_0xb1f3f2){if(!_0xba6183){return _0xb1f3f2;}var _0x362b40={'from':(_0x567171[_0xc847('0xae')]['firstName']||'')+'\x20'+(_0x567171[_0xc847('0xae')][_0xc847('0x37')]||'')};if(_0x2665b1['body']['threadId']&&_0x2665b1[_0xc847('0x60')][_0xc847('0xb6')]&&_0x2665b1['body'][_0xc847('0xb0')]!=_0x2665b1[_0xc847('0x60')][_0xc847('0xb6')]){_0x362b40[_0xc847('0xb0')]=_0x2665b1[_0xc847('0x60')][_0xc847('0xb6')];}return _0xb1f3f2[_0xc847('0x2a')](_0x362b40);})['then'](function(_0x33932a){_0x567171[_0xc847('0xb4')]=_0x33932a[_0xc847('0x67')]({'plain':!![]});_0x567171[_0xc847('0xb4')]['created']=!_0xba6183;if(_0x567171[_0xc847('0xb4')][_0xc847('0xb7')]){if(_0x567171[_0xc847('0xac')][_0xc847('0xb8')]){_0x567171[_0xc847('0xaa')][_0xc847('0xb9')]({'id':0x0,'priority':_0x567171[_0xc847('0xaa')][_0xc847('0x5c')]+0x1,'app':_0xc847('0xba'),'appdata':_0xc847('0xbb'),'interval':_0xc847('0xbc')});}}return db['ChatMessage'][_0xc847('0x63')]({'body':_0x2665b1['body'][_0xc847('0x60')],'ChatWebsiteId':_0x2665b1['params']['id'],'ChatInteractionId':_0x33932a['id'],'direction':'in','ContactId':_0x567171[_0xc847('0xae')]['id'],'AttachmentId':_0x2665b1[_0xc847('0x60')][_0xc847('0xbd')]});})[_0xc847('0x2b')](function(_0x2da930){_0x567171[_0xc847('0x1f')]=_0x2da930;if(!_0x567171['interaction'][_0xc847('0xbe')]){return;}return db['User'][_0xc847('0x5e')]({'attributes':['id',_0xc847('0x2e')],'where':{'id':_0x567171[_0xc847('0xb4')][_0xc847('0xbe')]}});})[_0xc847('0x2b')](function(_0x3232dc){if(_0x3232dc){_0x567171[_0xc847('0xaa')][_0xc847('0xbf')]({'id':0x0,'priority':0x0,'app':_0xc847('0xc0'),'appdata':_0x3232dc['name']+','+(_0x567171[_0xc847('0xac')][_0xc847('0xc1')]||0xa),'interval':_0xc847('0xbc')});_0x567171['forcedOwnership']=!![];}if(!_0x567171[_0xc847('0xb4')][_0xc847('0xc2')]){return;}return db[_0xc847('0xc3')][_0xc847('0x5e')]({'attributes':['id',_0xc847('0x2e')],'where':{'id':_0x567171['interaction'][_0xc847('0xc2')]}});})[_0xc847('0x2b')](function(_0x4027d0){if(_0x4027d0){_0x567171['applications'][_0xc847('0xbf')]({'id':0x0,'priority':0x1,'app':_0xc847('0xc4'),'appdata':_0x4027d0['name']+','+(_0x567171[_0xc847('0xac')][_0xc847('0xc5')]||0x12c),'interval':_0xc847('0xbc')});}return respondWithRpcPromise(_0xc847('0xc6'),_0xc847('0xc7'),_0x567171);})['then'](function(_0x1515c6){respondWithRpcPromise('EventManager','EventManager',{'event':_0xc847('0x97'),'message':_0x1515c6},client9002);return _0x1515c6;})['then'](respondWithResult(_0x4c198f,null))[_0xc847('0x20')](APIHandleError(_0x4c198f));};exports[_0xc847('0xc8')]=function(_0x2a59dd,_0x4c7f4a){var _0x471372,_0x951697,_0x79a2aa;var _0x1e6fcb=[];var _0x309efd={};var _0x432835=_0x2a59dd[_0xc847('0xc9')]||[];var _0x1a4653=[];var _0x602504;return db[_0xc847('0x9c')][_0xc847('0x6d')]()[_0xc847('0x2b')](function(_0x55d339){if(!_0x55d339){throw new db[(_0xc847('0xca'))][(_0xc847('0xcb'))](_0xc847('0xcc'));}_0x1e6fcb=_['difference'](_[_0xc847('0x4a')](_0x55d339),[_0xc847('0x9e'),_0xc847('0x9f'),_0xc847('0xa1'),_0xc847('0xa2')]);if(_0x2a59dd[_0xc847('0x60')]['id']){delete _0x2a59dd[_0xc847('0x60')]['id'];}if(_[_0xc847('0x87')](_0x2a59dd[_0xc847('0x60')][_0xc847('0x98')])){throw _0x4c7f4a[_0xc847('0x23')](0x1f4)[_0xc847('0xcd')](new db[(_0xc847('0xca'))][(_0xc847('0xcb'))](_0xc847('0xce')));}if(_[_0xc847('0x87')](_0x2a59dd[_0xc847('0x60')][_0xc847('0x60')])||_0x2a59dd[_0xc847('0x60')]['body']===''){throw _0x4c7f4a[_0xc847('0x23')](0x1f4)[_0xc847('0xcd')](new db[(_0xc847('0xca'))][(_0xc847('0xcb'))](_0xc847('0xcf')));}if(_[_0xc847('0x87')](_0x2a59dd['body'][_0xc847('0xd0')])){throw _0x4c7f4a['status'](0x1f4)[_0xc847('0xcd')](new db['Sequelize']['ValidationError'](_0xc847('0xd1')+_0x1e6fcb));}if(!_[_0xc847('0xa0')](_0x1e6fcb,_0x2a59dd[_0xc847('0x60')][_0xc847('0xd0')])){throw _0x4c7f4a[_0xc847('0x23')](0x1f4)[_0xc847('0xcd')](new db['Sequelize']['ValidationError'](_0xc847('0xd2')+_0x1e6fcb));}_0x309efd[_0x2a59dd[_0xc847('0x60')][_0xc847('0xd0')]]=_0x2a59dd[_0xc847('0x60')]['from'];})[_0xc847('0x2b')](function(){return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0x2a59dd[_0xc847('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0xc847('0x2b')](handleEntityNotFound(_0x4c7f4a,null))[_0xc847('0x2b')](function(_0x347451){if(_0x347451&&_0x347451['List']){_0x951697=_0x347451;var _0x5b1af2=_[_0xc847('0x11')](_0x2a59dd['body'],{'firstName':_0x2a59dd['body']['from'],'phone':_0x2a59dd[_0xc847('0x60')][_0xc847('0x98')],'ListId':_0x347451[_0xc847('0xa2')]});_0x5b1af2[_0x2a59dd[_0xc847('0x60')][_0xc847('0xd0')]]=_0x2a59dd[_0xc847('0x60')][_0xc847('0x98')];return db[_0xc847('0x9c')][_0xc847('0xd3')]({'where':_0x309efd,'defaults':_0x5b1af2});}})[_0xc847('0xd4')](function(_0x5cb089){if(_0x5cb089){_0x79a2aa=_0x5cb089;var _0x5590be=fs['readFileSync'](path[_0xc847('0x89')](config[_0xc847('0x83')],_0xc847('0xd5')),_0xc847('0xd6'));var _0x2a7578=ejs[_0xc847('0xd7')](_0x5590be,{'body':_[_0xc847('0xd8')](_0x2a59dd['body']['body']),'bodyTitle':_0x951697['offlineMessageBody']});return db[_0xc847('0xd9')]['create']({'body':_0x2a7578,'plainBody':htmlToText[_0xc847('0xda')](_0x2a7578),'ContactId':_0x5cb089['id'],'ChatWebsiteId':_0x951697['id']});}})['then'](function(_0xf4fb59){_0x602504=_0xf4fb59;if(_0x432835[_0xc847('0x5c')]){var _0x45c4f7=_0x432835['map'](function(_0x1548c4){return{'name':_0x1548c4[_0xc847('0xdb')],'basename':_0x1548c4[_0xc847('0x7b')],'type':_0x1548c4[_0xc847('0xdc')],'ChatOfflineMessageId':_0xf4fb59['id']};});_0x1a4653=_0x45c4f7['map'](_0x2855d9=>{var _0x5926f3={'filename':_0x2855d9['name'],'path':path[_0xc847('0x89')](config[_0xc847('0x83')],_0xc847('0xdd'),_0xc847('0xc9'),_0xc847('0xde'),_0xc847('0xdf'),_0x2855d9[_0xc847('0xe0')])};return _0x5926f3;});if(!_0x951697[_0xc847('0xe1')]){return db[_0xc847('0xe2')][_0xc847('0xe3')](function(_0x2da126){return db[_0xc847('0xe4')][_0xc847('0xe5')](_0x45c4f7,{'transaction':_0x2da126});});}}})[_0xc847('0x2b')](function(){if(_0x602504){_0x471372=_0x602504;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc847('0xe6')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc847('0xe7'),'raw':!![]}]}]});}})[_0xc847('0x2b')](function(_0x5b4ba2){if(_0x5b4ba2&&_0x5b4ba2[_0xc847('0xe8')]&&_0x951697['forwardOffline']&&_0x951697[_0xc847('0xe9')]){var _0x2c8e41=_0x5b4ba2[_0xc847('0xea')]();return respondWithRpcPromise(_0xc847('0xeb'),'sendMail',{'account':_0x2c8e41,'message':{'from':util['format'](_0xc847('0xec'),_0x5b4ba2['name'],_0x5b4ba2['email']||_0x5b4ba2[_0xc847('0xe8')][_0xc847('0x64')]),'to':_0x951697['forwardOfflineAddress'],'subject':_0x951697[_0xc847('0xed')],'html':_0x471372['body'],'attachments':_0x1a4653}},client9003)[_0xc847('0x2b')](function(){return _0x471372;})[_0xc847('0x20')](function(_0x6c54de){logger[_0xc847('0x1d')](_0x6c54de);});}})[_0xc847('0x2b')](function(){if(_0x951697&&_0x951697[_0xc847('0xe1')]&&_0x951697[_0xc847('0xee')]){var _0x34afcc=[];if(_0x432835[_0xc847('0x5c')]){_0x34afcc=_0x432835[_0xc847('0x46')](function(_0x4027c4){return{'name':_0x4027c4['originalname'],'basename':_0x4027c4[_0xc847('0x7b')],'type':_0x4027c4['mimetype'],'ChatOfflineMessageId':_0x602504['id']};});}var _0x1ff90b;if(!_['isNil'](_0x951697['subjectOffline'])){var _0x3292be=_[_0xc847('0x46')](_0x2a59dd[_0xc847('0x60')],function(_0x39d09a){return _0x39d09a;});var _0xa99c9f=_['toPairsIn'](_0x3292be)[0x0];var _0x4f32ce=_[_0xc847('0xef')](_0xa99c9f,function(_0x4daeed){return _0x4daeed;});_0x1ff90b=_0x4f32ce[0x1][_0x951697[_0xc847('0xf0')]];}var _0x2f4c7b={'from':_0x79a2aa[_0xc847('0xf1')],'firstName':_0x79a2aa[_0xc847('0x36')],'lastName':_0x79a2aa['lastName'],'mapKey':_0xc847('0xf1'),'message':{'from':_0x79a2aa['email'],'to':_0x951697[_0xc847('0xf2')][_0xc847('0xf1')],'cc':'','subject':_[_0xc847('0x87')](_0x1ff90b)?_0x951697[_0xc847('0xed')]:_0x1ff90b,'messageId':'','sentAt':new Date(),'attach':_0x34afcc[_0xc847('0x5c')],'attachments':_0x34afcc,'originChannel':'Chat','ChatWebsiteId':_0x951697['id'],'ChatOfflineMessageId':_0x471372['id'],'originTo':_0x951697['MailAccount']['email']},'body':_0x471372[_0xc847('0x60')]};var _0x1f9d71={'account':{'id':_0x951697['MailAccountId']},'body':_0x2f4c7b,'log':_0xc847('0xf3')};return respondWithRpcPromise('NotifyMailAccount',_0xc847('0xf4'),_0x1f9d71,client9001)[_0xc847('0x2b')](function(){return _0x471372;})[_0xc847('0x20')](function(_0x2ba0d8){logger['error'](_0x2ba0d8);});}return;})[_0xc847('0x2b')](function(){if(_0x471372){return _0x471372;}})[_0xc847('0x2b')](respondWithResult(_0x4c7f4a,null))[_0xc847('0x20')](function(){for(var _0x5a11aa of _0x432835){var _0x51b74d=path[_0xc847('0x89')](config['root'],_0xc847('0xdd'),_0xc847('0xc9'),_0xc847('0xde'),_0xc847('0xdf'),_0x5a11aa[_0xc847('0x7b')]);fs_extra[_0xc847('0xf5')](_0x51b74d)['catch'](function(_0x3d9585){logger[_0xc847('0x1d')](_0xc847('0xf6'),_0x51b74d,_0x3d9585);});}});};exports[_0xc847('0xf7')]=function(_0x3e3b26,_0x5d381b){return db['ChatInteraction'][_0xc847('0x5e')]({'where':{'id':_0x3e3b26[_0xc847('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5d381b,null))[_0xc847('0x2b')](function(_0x532556){if(_0x532556){return _0x532556['addInteraction'](_0x3e3b26[_0xc847('0x60')][_0xc847('0x74')],_[_0xc847('0xf8')](_0x3e3b26[_0xc847('0x60')],[_0xc847('0x74'),'id'])||{});}})['then'](respondWithResult(_0x5d381b,null))[_0xc847('0x20')](handleError(_0x5d381b,null));};exports[_0xc847('0xf9')]=function(_0x7b5fce,_0x49316a){var _0x51792b={'raw':![],'where':{}};var _0x142e7b={};var _0x318684={'count':0x0,'rows':[]};return db[_0xc847('0x47')][_0xc847('0x71')]({'where':{'id':_0x7b5fce[_0xc847('0x5b')]['id']}})['then'](handleEntityNotFound(_0x49316a,null))[_0xc847('0x2b')](function(_0xdb9dc3){if(_0xdb9dc3){_0x142e7b[_0xc847('0x42')]=_[_0xc847('0x4a')](db[_0xc847('0xb1')]['rawAttributes']);_0x142e7b[_0xc847('0x49')]=_[_0xc847('0x4a')](_0x7b5fce[_0xc847('0x49')]);_0x142e7b[_0xc847('0x4b')]=_[_0xc847('0x72')](_0x142e7b[_0xc847('0x42')],_0x142e7b[_0xc847('0x49')]);_0x51792b['attributes']=_['intersection'](_0x142e7b['model'],qs[_0xc847('0x4c')](_0x7b5fce['query'][_0xc847('0x4c')]));_0x51792b[_0xc847('0x4d')]=_0x51792b[_0xc847('0x4d')][_0xc847('0x5c')]?_0x51792b[_0xc847('0x4d')]:_0x142e7b['model'];if(!_0x7b5fce[_0xc847('0x49')]['hasOwnProperty'](_0xc847('0x77'))){_0x51792b['limit']=qs['limit'](_0x7b5fce[_0xc847('0x49')][_0xc847('0x28')]);_0x51792b[_0xc847('0x27')]=qs[_0xc847('0x27')](_0x7b5fce[_0xc847('0x49')]['offset']);}_0x51792b['order']=qs[_0xc847('0x50')](_0x7b5fce[_0xc847('0x49')]['sort']);_0x51792b[_0xc847('0x53')]=qs[_0xc847('0x4b')](_[_0xc847('0x51')](_0x7b5fce[_0xc847('0x49')],_0x142e7b[_0xc847('0x4b')]));_0x51792b[_0xc847('0x53')]['ChatWebsiteId']=_0xdb9dc3['id'];if(_0x7b5fce[_0xc847('0x49')][_0xc847('0x52')]){_0x51792b['where']=_[_0xc847('0x55')](_0x51792b['where'],{'$or':_['map'](_0x51792b['attributes'],function(_0x16d9f0){var _0x4a97a4={};_0x4a97a4[_0x16d9f0]={'$like':'%'+_0x7b5fce[_0xc847('0x49')][_0xc847('0x52')]+'%'};return _0x4a97a4;})});}_0x51792b=_[_0xc847('0x55')]({},_0x51792b,_0x7b5fce[_0xc847('0x56')]);return db['ChatInteraction'][_0xc847('0x26')]({'where':_0x51792b['where']})['then'](function(_0x54c6d9){_0x318684[_0xc847('0x26')]=_0x54c6d9;if(_0x7b5fce[_0xc847('0x49')][_0xc847('0x57')]){_0x51792b['include']=[{'model':db[_0xc847('0x9c')],'as':'Contact','required':![]},{'model':db[_0xc847('0xfa')],'as':_0xc847('0xfb'),'attributes':[_0xc847('0x2e'),_0xc847('0xfc'),_0xc847('0xfd')],'required':![]},{'model':db['Tag'],'as':_0xc847('0xfe'),'attributes':['id',_0xc847('0x2e'),_0xc847('0xff')],'where':_0x7b5fce[_0xc847('0x49')][_0xc847('0x100')]?{'id':_0x7b5fce[_0xc847('0x49')][_0xc847('0x100')]}:undefined,'required':_0x7b5fce['query'][_0xc847('0x100')]?!![]:![]}];}return db[_0xc847('0xb1')][_0xc847('0x58')](_0x51792b);})['then'](function(_0x318d27){_0x318684[_0xc847('0x59')]=_0x318d27;return _0x318684;});}})[_0xc847('0x2b')](respondWithFilteredResult(_0x49316a,_0x51792b))[_0xc847('0x20')](handleError(_0x49316a,null));};exports['getSnippet']=function(_0x1c8979,_0x53cf8d){var _0x1d7e06=0x0;var _0x30f855=0x0;var _0x53149d=![];var _0x1de783;var _0x55c902;return db[_0xc847('0x47')]['find']({'where':{'id':_0x1c8979['params']['id']},'include':[{'model':db[_0xc847('0x93')],'as':_0xc847('0x93'),'include':[{'model':db[_0xc847('0x93')],'as':_0xc847('0xa8'),'attributes':['id','interval']}]}]})[_0xc847('0x2b')](handleEntityNotFound(_0x53cf8d,null))[_0xc847('0x2b')](function(_0x13b8f3){if(_0x13b8f3){_0x1de783=_0x13b8f3;return _0x13b8f3[_0xc847('0x101')]({'raw':!![]});}})[_0xc847('0x2b')](function(_0x5ee3cb){if(_0x1de783){if(_0x5ee3cb){_0x55c902=_0x5ee3cb;}}return require('../../config/license/util')[_0xc847('0x86')]();})['then'](function(_0x1fbe3d){if(_0x1fbe3d){_0x30f855=_0x1fbe3d[_0xc847('0x102')];_0x53149d=_0x1fbe3d[_0xc847('0x103')];}})['then'](function(){return db[_0xc847('0xb1')][_0xc847('0x26')]({'where':{'closed':![]}});})[_0xc847('0x2b')](function(_0x4474f3){_0x1d7e06=_0x4474f3;if(_0x30f855&&_0x4474f3>_0x30f855){return db[_0xc847('0x104')][_0xc847('0x71')]({'where':{'id':0x1}})[_0xc847('0x2b')](function(_0x3712fe){if(_0x3712fe){_0x3712fe[_0xc847('0x105')](_0xc847('0x106'));}});}})[_0xc847('0x2b')](function(){var _0x3ca1be=_0x1de783[_0xc847('0x93')];var _0x475316=_0x1de783[_0xc847('0x95')]||undefined;return _0x3ca1be?_0x3ca1be[_0xc847('0x96')](_0x475316):!![];})['then'](function(_0x177b1f){var _0x582b73=fs['readFileSync'](path[_0xc847('0x89')](config[_0xc847('0x83')],_0xc847('0x107')),_0xc847('0xd6'));var _0x292548=_0xc847('0x108');var _0x17aa00=![];try{const _0x2a8a51=new URL(_0x1de783[_0xc847('0x61')]);_0x1de783[_0xc847('0x61')]=_0x2a8a51[_0xc847('0x109')];}catch(_0x12cfaf){}var _0x2ada4f;if(_0x1c8979['headers'][_0xc847('0x39')]){_0x1c8979[_0xc847('0xaf')][_0xc847('0x39')]=_0x1c8979['headers']['referer'][_0xc847('0x10a')](/\/$/,'');_0x2ada4f=wildcardUtils[_0xc847('0x10b')](_0x1de783[_0xc847('0x61')],_0x1c8979[_0xc847('0xaf')][_0xc847('0x39')]);}else{_0x1c8979[_0xc847('0xaf')][_0xc847('0x39')]=_0x1de783[_0xc847('0x61')];_0x2ada4f=!![];}var _0x16ecd1={'chatVersion':_0x292548,'chatWebsiteAddressOrigin':_0x2ada4f?_0x1c8979[_0xc847('0xaf')][_0xc847('0x39')]:_0x1de783[_0xc847('0x61')],'remote':_0x1de783['remote'],'query':querystring[_0xc847('0x1b')](_[_0xc847('0x55')](_0x1de783[_0xc847('0x67')]({'plain':!![]}),{'customerIp':_0x1c8979[_0xc847('0xaf')][_0xc847('0x34')]||_0x1c8979[_0xc847('0xaf')][_0xc847('0x10c')]||_0x1c8979[_0xc847('0x10d')][_0xc847('0x10e')]||_0x1c8979['ip'],'referer':_0x1c8979['headers'][_0xc847('0x39')],'openedInteractions':_0x1d7e06,'maxInteractions':_0x30f855,'virtual':_0x53149d[_0xc847('0x102')],'online':_0x177b1f,'custom':_0x53149d,'address':_0x2ada4f?_0x1c8979[_0xc847('0xaf')]['referer']:null}))[_0xc847('0x10a')](/'/g,'\x5c\x27')};_0x53cf8d[_0xc847('0xcd')](ejs['render'](Mustache[_0xc847('0xd7')](_0x582b73,_0x16ecd1),{'proactiveActions':_0x55c902,'alignment':_0x1de783[_0xc847('0x10f')],'verticalAlignment':_0x1de783[_0xc847('0x110')],'div_color':_0x1de783[_0xc847('0xff')],'labelText':_0x1de783[_0xc847('0x111')],'text_color':_0x1de783[_0xc847('0x112')],'text_button_color':_0x1de783[_0xc847('0x113')],'button_color':_0x1de783[_0xc847('0x114')],'background_color':_0x1de783[_0xc847('0x115')],'hideWhenOffline':_0x1de783['hideWhenOffline'],'intervalId':_0x1de783['IntervalId'],'isDevelopment':_0x17aa00,'chatVersion':_0x292548}));})[_0xc847('0x20')](handleError(_0x53cf8d,null));};exports[_0xc847('0x116')]=function(_0x46f156,_0x14f8a9){var _0x212780=_0x46f156[_0xc847('0x5b')]['id'];var _0x2c17df=_0x46f156[_0xc847('0x60')];var _0x109a34=0xc8;var _0x5d1d89=null;return db[_0xc847('0xe2')][_0xc847('0xe3')]({'isolationLevel':db[_0xc847('0xe2')][_0xc847('0x117')]['ISOLATION_LEVELS'][_0xc847('0x118')]},function(_0x452c23){return db[_0xc847('0x47')][_0xc847('0x71')]({'where':{'id':_0x212780},'transaction':_0x452c23})[_0xc847('0x2b')](function(_0x3dcda8){if(_0x3dcda8){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x212780},'transaction':_0x452c23})['then'](function(){var _0x509ca1=_[_0xc847('0x46')](_0x2c17df,function(_0x2f478e){_0x2f478e[_0xc847('0x6e')]=_0x212780;return _0x2f478e;});return db['ChatApplication']['bulkCreate'](_0x509ca1,{'transaction':_0x452c23});});}else{_0x109a34=0x194;_0x5d1d89=[];}});})[_0xc847('0x2b')](function(){if(_0x109a34!==0x194){return db[_0xc847('0xa6')][_0xc847('0x119')]({'where':{'ChatWebsiteId':_0x212780},'order':_0xc847('0x11a')})[_0xc847('0x2b')](function(_0x26b96e){_0x5d1d89=_0x26b96e;});}})[_0xc847('0x20')](function(_0x13a6d5){_0x109a34=0x1f4;logger[_0xc847('0x1d')](_0x13a6d5[_0xc847('0x2d')]);if(_0x13a6d5[_0xc847('0x2e')]){delete _0x13a6d5['name'];}_0x5d1d89=_0x13a6d5;})[_0xc847('0x11b')](function(){if(_0x5d1d89===null){_0x14f8a9[_0xc847('0x21')](_0x109a34);}else{if(_0x109a34===0x1f4){_0x14f8a9[_0xc847('0x23')](_0x109a34)[_0xc847('0xcd')](_0x5d1d89);}else{_0x14f8a9[_0xc847('0x23')](_0x109a34)['json'](_0x5d1d89);}}});};exports[_0xc847('0x11c')]=function(_0xce5a3e,_0x176603){var _0x21beba={};var _0x3745d5={};var _0x1abb6b;var _0x7720a7;return db['ChatWebsite'][_0xc847('0x71')]({'where':{'id':_0xce5a3e[_0xc847('0x5b')]['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x176603,null))['then'](function(_0x44a82c){if(_0x44a82c){_0x1abb6b=_0x44a82c;_0x3745d5[_0xc847('0x42')]=_[_0xc847('0x4a')](db[_0xc847('0xa6')][_0xc847('0x48')]);_0x3745d5[_0xc847('0x49')]=_[_0xc847('0x4a')](_0xce5a3e['query']);_0x3745d5[_0xc847('0x4b')]=_['intersection'](_0x3745d5[_0xc847('0x42')],_0x3745d5[_0xc847('0x49')]);_0x21beba[_0xc847('0x4d')]=_['intersection'](_0x3745d5[_0xc847('0x42')],qs[_0xc847('0x4c')](_0xce5a3e['query'][_0xc847('0x4c')]));_0x21beba[_0xc847('0x4d')]=_0x21beba[_0xc847('0x4d')]['length']?_0x21beba[_0xc847('0x4d')]:_0x3745d5[_0xc847('0x42')];_0x21beba[_0xc847('0x4f')]=qs[_0xc847('0x50')](_0xce5a3e[_0xc847('0x49')][_0xc847('0x50')]);_0x21beba[_0xc847('0x53')]=qs['filters'](_[_0xc847('0x51')](_0xce5a3e['query'],_0x3745d5[_0xc847('0x4b')]));if(_0xce5a3e[_0xc847('0x49')]['filter']){_0x21beba[_0xc847('0x53')]=_['merge'](_0x21beba[_0xc847('0x53')],{'$or':_[_0xc847('0x46')](_0x21beba['attributes'],function(_0x1446a3){var _0x26d02c={};_0x26d02c[_0x1446a3]={'$like':'%'+_0xce5a3e[_0xc847('0x49')][_0xc847('0x52')]+'%'};return _0x26d02c;})});}_0x21beba=_[_0xc847('0x55')]({},_0x21beba,_0xce5a3e[_0xc847('0x56')]);return _0x1abb6b[_0xc847('0x11c')](_0x21beba);}})[_0xc847('0x2b')](function(_0x375490){if(_0x375490){_0x7720a7=_0x375490[_0xc847('0x5c')];if(!_0xce5a3e[_0xc847('0x49')][_0xc847('0x4e')](_0xc847('0x77'))){_0x21beba['limit']=qs[_0xc847('0x28')](_0xce5a3e[_0xc847('0x49')][_0xc847('0x28')]);_0x21beba[_0xc847('0x27')]=qs[_0xc847('0x27')](_0xce5a3e[_0xc847('0x49')][_0xc847('0x27')]);}return _0x1abb6b[_0xc847('0x11c')](_0x21beba);}})[_0xc847('0x2b')](function(_0x40bd43){if(_0x40bd43){return _0x40bd43?{'count':_0x7720a7,'rows':_0x40bd43}:null;}})['then'](respondWithResult(_0x176603,null))[_0xc847('0x20')](handleError(_0x176603,null));};exports['addProactiveActions']=function(_0x25d78f,_0x3c630c){return db['chatProactiveAction'][_0xc847('0x5e')]({'where':{'id':_0x25d78f[_0xc847('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3c630c,null))[_0xc847('0x2b')](function(_0x7bef2a){if(_0x7bef2a){return _0x7bef2a['addProactiveActions'](_0x25d78f[_0xc847('0x60')][_0xc847('0x74')],_[_0xc847('0xf8')](_0x25d78f[_0xc847('0x60')],['ids','id'])||{});}})[_0xc847('0x2b')](respondWithResult(_0x3c630c,null))[_0xc847('0x20')](handleError(_0x3c630c,null));};exports[_0xc847('0x101')]=function(_0x46fed7,_0x2d5153){var _0x48002b={};var _0x496342={};var _0x4ad949;var _0x2d83ff;return db['ChatWebsite'][_0xc847('0x71')]({'where':{'id':_0x46fed7['params']['id']}})['then'](handleEntityNotFound(_0x2d5153,null))['then'](function(_0x193287){if(_0x193287){_0x4ad949=_0x193287;_0x496342[_0xc847('0x42')]=_[_0xc847('0x4a')](db[_0xc847('0x11d')]['rawAttributes']);_0x496342[_0xc847('0x49')]=_['keys'](_0x46fed7['query']);_0x496342[_0xc847('0x4b')]=_[_0xc847('0x72')](_0x496342[_0xc847('0x42')],_0x496342[_0xc847('0x49')]);_0x48002b['attributes']=_['intersection'](_0x496342[_0xc847('0x42')],qs[_0xc847('0x4c')](_0x46fed7['query'][_0xc847('0x4c')]));_0x48002b[_0xc847('0x4d')]=_0x48002b['attributes'][_0xc847('0x5c')]?_0x48002b[_0xc847('0x4d')]:_0x496342[_0xc847('0x42')];_0x48002b[_0xc847('0x4f')]=qs[_0xc847('0x50')](_0x46fed7[_0xc847('0x49')][_0xc847('0x50')]);_0x48002b['where']=qs[_0xc847('0x4b')](_['pick'](_0x46fed7['query'],_0x496342[_0xc847('0x4b')]));if(_0x46fed7['query'][_0xc847('0x52')]){_0x48002b['where']=_['merge'](_0x48002b[_0xc847('0x53')],{'$or':_[_0xc847('0x46')](_0x48002b[_0xc847('0x4d')],function(_0x2c42ba){var _0x39799f={};_0x39799f[_0x2c42ba]={'$like':'%'+_0x46fed7['query'][_0xc847('0x52')]+'%'};return _0x39799f;})});}_0x48002b=_[_0xc847('0x55')]({},_0x48002b,_0x46fed7[_0xc847('0x56')]);return _0x4ad949['getProactiveActions'](_0x48002b);}})[_0xc847('0x2b')](function(_0x8109b8){if(_0x8109b8){_0x2d83ff=_0x8109b8[_0xc847('0x5c')];if(!_0x46fed7[_0xc847('0x49')][_0xc847('0x4e')](_0xc847('0x77'))){_0x48002b[_0xc847('0x28')]=qs['limit'](_0x46fed7[_0xc847('0x49')][_0xc847('0x28')]);_0x48002b[_0xc847('0x27')]=qs[_0xc847('0x27')](_0x46fed7[_0xc847('0x49')][_0xc847('0x27')]);}return _0x4ad949[_0xc847('0x101')](_0x48002b);}})[_0xc847('0x2b')](function(_0x402d6e){if(_0x402d6e){return _0x402d6e?{'count':_0x2d83ff,'rows':_0x402d6e}:null;}})['then'](respondWithResult(_0x2d5153,null))[_0xc847('0x20')](handleError(_0x2d5153,null));};exports['getFields']=function(_0x53a54b,_0x207da7){var _0x2c6712=_0x53a54b[_0xc847('0x49')][_0xc847('0x11e')]==='false'?_0xc847('0x11f'):_0xc847('0x120');return db[_0xc847('0x47')]['find']({'attributes':['id',_0x2c6712],'where':{'id':_0x53a54b[_0xc847('0x5b')]['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x207da7,null))[_0xc847('0x2b')](function(_0x52a35f){if(_0x52a35f){var _0x4aadd4=_0x52a35f[_0x2c6712];var _0x5d3266=_0x4aadd4&&_0x4aadd4[_0xc847('0x121')]?_0x4aadd4['items']:[];_0x207da7[_0xc847('0xcd')]({'fromKey':_['isNil'](_0x4aadd4['fromKey'])?undefined:_0x4aadd4[_0xc847('0x122')],'count':_0x5d3266['length'],'rows':_0x5d3266});}})[_0xc847('0x20')](handleError(_0x207da7,null));};exports['getOfflineMessages']=function(_0x2b4d72,_0x20116f){var _0x31974b={'raw':![],'where':{}};var _0x1f005f={};var _0x357f4f={'count':0x0,'rows':[]};return db[_0xc847('0x47')][_0xc847('0x71')]({'where':{'id':_0x2b4d72[_0xc847('0x5b')]['id']}})['then'](handleEntityNotFound(_0x20116f,null))['then'](function(_0x403222){if(_0x403222){_0x1f005f['model']=_[_0xc847('0x4a')](db[_0xc847('0xd9')][_0xc847('0x48')]);_0x1f005f[_0xc847('0x49')]=_[_0xc847('0x4a')](_0x2b4d72[_0xc847('0x49')]);_0x1f005f[_0xc847('0x4b')]=_[_0xc847('0x72')](_0x1f005f[_0xc847('0x42')],_0x1f005f[_0xc847('0x49')]);_0x31974b[_0xc847('0x4d')]=_[_0xc847('0x72')](_0x1f005f[_0xc847('0x42')],qs[_0xc847('0x4c')](_0x2b4d72[_0xc847('0x49')][_0xc847('0x4c')]));_0x31974b[_0xc847('0x4d')]=_0x31974b[_0xc847('0x4d')]['length']?_0x31974b[_0xc847('0x4d')]:_0x1f005f['model'];if(!_0x2b4d72[_0xc847('0x49')][_0xc847('0x4e')]('nolimit')){_0x31974b[_0xc847('0x28')]=qs[_0xc847('0x28')](_0x2b4d72[_0xc847('0x49')][_0xc847('0x28')]);_0x31974b[_0xc847('0x27')]=qs[_0xc847('0x27')](_0x2b4d72[_0xc847('0x49')][_0xc847('0x27')]);}_0x31974b['order']=qs[_0xc847('0x50')](_0x2b4d72[_0xc847('0x49')][_0xc847('0x50')]);_0x31974b[_0xc847('0x53')]=qs[_0xc847('0x4b')](_[_0xc847('0x51')](_0x2b4d72[_0xc847('0x49')],_0x1f005f['filters']));_0x31974b[_0xc847('0x53')][_0xc847('0x6e')]=_0x403222['id'];if(_0x2b4d72['query'][_0xc847('0x52')]){_0x31974b[_0xc847('0x53')]=_[_0xc847('0x55')](_0x31974b['where'],{'$or':_[_0xc847('0x46')](_0x31974b[_0xc847('0x4d')],function(_0x2800c7){var _0x494f6c={};_0x494f6c[_0x2800c7]={'$like':'%'+_0x2b4d72[_0xc847('0x49')]['filter']+'%'};return _0x494f6c;})});}_0x31974b=_['merge']({},_0x31974b,_0x2b4d72[_0xc847('0x56')]);return db['ChatOfflineMessage']['count']({'where':_0x31974b[_0xc847('0x53')]})[_0xc847('0x2b')](function(_0x2e3451){_0x357f4f['count']=_0x2e3451;if(_0x2b4d72[_0xc847('0x49')][_0xc847('0x57')]){_0x31974b['include']=[{'all':!![]}];}else{_0x31974b[_0xc847('0x5d')]=[{'model':db[_0xc847('0x9c')],'as':_0xc847('0x123'),'required':![]},{'model':db['Attachment'],'as':_0xc847('0x124'),'required':![]}];}return db[_0xc847('0xd9')][_0xc847('0x58')](_0x31974b);})[_0xc847('0x2b')](function(_0x519fc6){_0x357f4f[_0xc847('0x59')]=_0x519fc6;return _0x357f4f;});}})[_0xc847('0x2b')](respondWithFilteredResult(_0x20116f,_0x31974b))[_0xc847('0x20')](handleError(_0x20116f,null));};exports[_0xc847('0x125')]=function(_0x58c6c5,_0x264e00){return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0x58c6c5[_0xc847('0x5b')]['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x264e00,null))[_0xc847('0x2b')](function(_0x19ba24){if(_0x19ba24){return _0x19ba24[_0xc847('0x125')](_0x58c6c5[_0xc847('0x60')]['ids'],_[_0xc847('0xf8')](_0x58c6c5[_0xc847('0x60')],[_0xc847('0x74'),'id'])||{})[_0xc847('0xd4')](function(_0x54c994){for(var _0x3c15da=0x0;_0x3c15da<_0x58c6c5[_0xc847('0x60')][_0xc847('0x74')][_0xc847('0x5c')];_0x3c15da+=0x1){socket['emit'](_0xc847('0x126'),{'UserId':Number(_0x58c6c5[_0xc847('0x60')]['ids'][_0x3c15da]),'ChatWebsiteId':Number(_0x58c6c5['params']['id'])});}return _0x54c994;});}})[_0xc847('0x2b')](respondWithResult(_0x264e00,null))[_0xc847('0x20')](handleError(_0x264e00,null));};exports[_0xc847('0x127')]=function(_0x1acb41,_0x22b8d8){return db[_0xc847('0x47')][_0xc847('0x5e')]({'where':{'id':_0x1acb41[_0xc847('0x5b')]['id']}})[_0xc847('0x2b')](handleEntityNotFound(_0x22b8d8,null))[_0xc847('0x2b')](function(_0x439e1a){if(_0x439e1a){return _0x439e1a[_0xc847('0x127')](_0x1acb41[_0xc847('0x49')][_0xc847('0x74')])[_0xc847('0x2b')](function(){if(_['isArray'](_0x1acb41[_0xc847('0x49')][_0xc847('0x74')])){for(var _0x366b57=0x0;_0x366b57<_0x1acb41[_0xc847('0x49')]['ids'][_0xc847('0x5c')];_0x366b57+=0x1){socket[_0xc847('0x128')]('userChatWebsite:remove',{'UserId':Number(_0x1acb41[_0xc847('0x49')][_0xc847('0x74')][_0x366b57]),'ChatWebsiteId':Number(_0x1acb41[_0xc847('0x5b')]['id'])});}}else{socket[_0xc847('0x128')](_0xc847('0x129'),{'UserId':Number(_0x1acb41[_0xc847('0x49')][_0xc847('0x74')]),'ChatWebsiteId':Number(_0x1acb41[_0xc847('0x5b')]['id'])});}});}})[_0xc847('0x2b')](respondWithStatusCode(_0x22b8d8,null))[_0xc847('0x20')](handleError(_0x22b8d8,null));};exports[_0xc847('0x12a')]=function(_0x95031d,_0x5dd6f8){var _0x396fcf={};var _0x298bb6={};var _0x1ec3f6;var _0x435d02;return db[_0xc847('0x47')][_0xc847('0x71')]({'where':{'id':_0x95031d[_0xc847('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5dd6f8,null))[_0xc847('0x2b')](function(_0x34a101){if(_0x34a101){_0x1ec3f6=_0x34a101;_0x298bb6[_0xc847('0x42')]=_[_0xc847('0x4a')](db[_0xc847('0xfa')]['rawAttributes']);_0x298bb6[_0xc847('0x49')]=_[_0xc847('0x4a')](_0x95031d[_0xc847('0x49')]);_0x298bb6['filters']=_[_0xc847('0x72')](_0x298bb6[_0xc847('0x42')],_0x298bb6[_0xc847('0x49')]);_0x396fcf[_0xc847('0x4d')]=_[_0xc847('0x72')](_0x298bb6['model'],qs[_0xc847('0x4c')](_0x95031d[_0xc847('0x49')][_0xc847('0x4c')]));_0x396fcf[_0xc847('0x4d')]=_0x396fcf['attributes']['length']?_0x396fcf[_0xc847('0x4d')]:_0x298bb6[_0xc847('0x42')];_0x396fcf['order']=qs[_0xc847('0x50')](_0x95031d[_0xc847('0x49')][_0xc847('0x50')]);_0x396fcf[_0xc847('0x53')]=qs[_0xc847('0x4b')](_[_0xc847('0x51')](_0x95031d['query'],_0x298bb6[_0xc847('0x4b')]));if(_0x95031d[_0xc847('0x49')]['filter']){_0x396fcf[_0xc847('0x53')]=_[_0xc847('0x55')](_0x396fcf[_0xc847('0x53')],{'$or':_[_0xc847('0x46')](_0x396fcf['attributes'],function(_0x123603){var _0x18ba59={};_0x18ba59[_0x123603]={'$like':'%'+_0x95031d[_0xc847('0x49')]['filter']+'%'};return _0x18ba59;})});}_0x396fcf=_[_0xc847('0x55')]({},_0x396fcf,_0x95031d[_0xc847('0x56')]);return _0x1ec3f6[_0xc847('0x12a')](_0x396fcf);}})['then'](function(_0x23e308){if(_0x23e308){_0x435d02=_0x23e308[_0xc847('0x5c')];if(!_0x95031d[_0xc847('0x49')][_0xc847('0x4e')](_0xc847('0x77'))){_0x396fcf[_0xc847('0x28')]=qs[_0xc847('0x28')](_0x95031d[_0xc847('0x49')][_0xc847('0x28')]);_0x396fcf[_0xc847('0x27')]=qs[_0xc847('0x27')](_0x95031d[_0xc847('0x49')][_0xc847('0x27')]);}return _0x1ec3f6[_0xc847('0x12a')](_0x396fcf);}})[_0xc847('0x2b')](function(_0x5db331){if(_0x5db331){return _0x5db331?{'count':_0x435d02,'rows':_0x5db331}:null;}})['then'](respondWithResult(_0x5dd6f8,null))['catch'](handleError(_0x5dd6f8,null));};
\ No newline at end of file
+var _0xb429=['attachments','offline-chat','basename','openNewInteraction','bulkCreate','MailAccount','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','SendMail','sendMail','email','MailAccountId','toPairsIn','subjectOffline','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','fullname','internal','Tags','color','tag','getSnippet','interval','getProactiveActions','../../config/license/util','virtual','custom','License','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','3.9.0','replace','testWebsiteWithWildcard','remote','stringify','connection','remoteAddress','render','alignment','verticalAlignment','labelText','textColor','color_button','hideWhenOffline','IntervalId','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachment','Attachments','addAgents','omit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','mustache','util','lodash','querystring','html-to-text','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','ChatWebsites','name','user-agent-parser','setUA','user-agent','getResult','customerIp','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','include','find','create','testWildcardValidity','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','isNil','existsSync','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','timezone','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','orderBy','priority','asc','account','list','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','contact','firstName','messageId','created','push','close','unmanaged','ChatMessage','User','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','unshift','queue','Start','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server'];(function(_0x288c80,_0x19f8b2){var _0x4faaf4=function(_0x68de74){while(--_0x68de74){_0x288c80['push'](_0x288c80['shift']());}};_0x4faaf4(++_0x19f8b2);}(_0xb429,0x189));var _0x9b42=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xb429[_0x1e3c16];return _0x47a0c9;};'use strict';var Mustache=require(_0x9b42('0x0'));var util=require(_0x9b42('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b42('0x2'));var querystring=require(_0x9b42('0x3'));var htmlToText=require(_0x9b42('0x4'));var Redis=require(_0x9b42('0x5'));var jayson=require('jayson/promise');var qs=require(_0x9b42('0x6'));var logger=require(_0x9b42('0x7'))(_0x9b42('0x8'));var config=require(_0x9b42('0x9'));var APIBadRequestError=require(_0x9b42('0xa'))[_0x9b42('0xb')];var APINotFoundError=require('../../errors/api')[_0x9b42('0xc')];var APIOutOfIntervalError=require(_0x9b42('0xa'))[_0x9b42('0xd')];var APIHandleError=require('../../errors/api')[_0x9b42('0xe')];var APIConflictError=require(_0x9b42('0xa'))[_0x9b42('0xf')];var wildcardUtils=require(_0x9b42('0x10'));var URL=require('url')[_0x9b42('0x11')];var db=require(_0x9b42('0x12'))['db'];config[_0x9b42('0x13')]=_[_0x9b42('0x14')](config[_0x9b42('0x13')],{'host':_0x9b42('0x15'),'port':0x18eb});var socket=require(_0x9b42('0x16'))(new Redis(config[_0x9b42('0x13')]));require(_0x9b42('0x17'))['register'](socket);var client=jayson[_0x9b42('0x18')][_0x9b42('0x19')]({'port':0x232c});var client9002=jayson[_0x9b42('0x18')]['http']({'port':0x232a});var client9003=jayson[_0x9b42('0x18')]['http']({'port':0x232b});var client9001=jayson[_0x9b42('0x18')][_0x9b42('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x434e89,_0x25d3b6,_0x3db60a,_0x2c7ef6){return new Promise(function(_0x1c2503,_0x37c1b9){var _0x81af40=_0x2c7ef6||client;return _0x81af40[_0x9b42('0x1a')](_0x434e89,_0x3db60a)['then'](function(_0x4e7410){logger[_0x9b42('0x1b')](_0x9b42('0x1c'),_0x25d3b6,_0x9b42('0x1d'));logger[_0x9b42('0x1e')](_0x9b42('0x1f'),_0x25d3b6,'request\x20sent',JSON['stringify'](_0x4e7410));if(_0x4e7410[_0x9b42('0x20')]){if(_0x4e7410[_0x9b42('0x20')][_0x9b42('0x21')]===0x1f4){logger[_0x9b42('0x20')](_0x9b42('0x1c'),_0x25d3b6,_0x4e7410[_0x9b42('0x20')][_0x9b42('0x22')]);return _0x37c1b9(_0x4e7410[_0x9b42('0x20')][_0x9b42('0x22')]);}logger['error'](_0x9b42('0x1c'),_0x25d3b6,_0x4e7410['error']['message']);return _0x1c2503(_0x4e7410[_0x9b42('0x20')][_0x9b42('0x22')]);}else{logger['info'](_0x9b42('0x1c'),_0x25d3b6,_0x9b42('0x1d'));_0x1c2503(_0x4e7410[_0x9b42('0x23')][_0x9b42('0x22')]);}})[_0x9b42('0x24')](function(_0x56d7e0){logger[_0x9b42('0x20')](_0x9b42('0x1c'),_0x25d3b6,_0x56d7e0);_0x37c1b9(_0x56d7e0);});});}function respondWithStatusCode(_0x2a127b,_0x49663c){_0x49663c=_0x49663c||0xcc;return function(_0x5e9983){if(_0x5e9983){return _0x2a127b[_0x9b42('0x25')](_0x49663c);}return _0x2a127b[_0x9b42('0x26')](_0x49663c)[_0x9b42('0x27')]();};}function respondWithResult(_0x4b54b1,_0x5c9342){_0x5c9342=_0x5c9342||0xc8;return function(_0xdbb715){if(_0xdbb715){return _0x4b54b1['status'](_0x5c9342)['json'](_0xdbb715);}};}function respondWithFilteredResult(_0x4062a5,_0x5305cf){return function(_0x67531){if(_0x67531){var _0x3a53c7=typeof _0x5305cf[_0x9b42('0x28')]===_0x9b42('0x29')&&typeof _0x5305cf[_0x9b42('0x2a')]===_0x9b42('0x29');var _0x4137ff=_0x67531[_0x9b42('0x2b')];var _0x2c4120=_0x3a53c7?0x0:_0x5305cf[_0x9b42('0x28')];var _0x16f992=_0x3a53c7?_0x67531[_0x9b42('0x2b')]:_0x5305cf[_0x9b42('0x28')]+_0x5305cf[_0x9b42('0x2a')];var _0x4b3a4c;if(_0x16f992>=_0x4137ff){_0x16f992=_0x4137ff;_0x4b3a4c=0xc8;}else{_0x4b3a4c=0xce;}_0x4062a5['status'](_0x4b3a4c);return _0x4062a5[_0x9b42('0x2c')](_0x9b42('0x2d'),_0x2c4120+'-'+_0x16f992+'/'+_0x4137ff)[_0x9b42('0x2e')](_0x67531);}return null;};}function saveUpdates(_0x2a2ecb){return function(_0x13a313){if(_0x13a313){return _0x13a313[_0x9b42('0x2f')](_0x2a2ecb)[_0x9b42('0x30')](function(_0x3358e3){return _0x3358e3;});}return null;};}function removeEntity(_0x517d33){return function(_0x2bf45d){if(_0x2bf45d){return _0x2bf45d[_0x9b42('0x31')]()['then'](function(){var _0x17362f=_0x2bf45d[_0x9b42('0x32')]({'plain':!![]});var _0x1ed125=_0x9b42('0x33');return db['UserProfileResource'][_0x9b42('0x31')]({'where':{'type':_0x1ed125,'resourceId':_0x17362f['id']}})[_0x9b42('0x30')](function(){return _0x2bf45d;});})[_0x9b42('0x30')](function(){_0x517d33['status'](0xcc)[_0x9b42('0x27')]();});}};}function handleEntityNotFound(_0x494a2c){return function(_0x2b0750){if(!_0x2b0750){_0x494a2c['sendStatus'](0x194);}return _0x2b0750;};}function handleError(_0x2c26e6,_0x49badc){_0x49badc=_0x49badc||0x1f4;return function(_0x74e174){logger[_0x9b42('0x20')](_0x74e174['stack']);if(_0x74e174[_0x9b42('0x34')]){delete _0x74e174[_0x9b42('0x34')];}_0x2c26e6[_0x9b42('0x26')](_0x49badc)['send'](_0x74e174);};}function createInteractionObject(_0x1992d6,_0x1083a1,_0xc6fd48,_0x1e22f4){var _0x56a844=require(_0x9b42('0x35'));var _0x42c05d=new _0x56a844();var _0x35cb2e=_0x42c05d[_0x9b42('0x36')](_0xc6fd48[_0x9b42('0x37')])[_0x9b42('0x38')]();var _0x3ea973=_0x1083a1[_0x9b42('0x39')];if(_0xc6fd48['cf-connecting-ip']){_0x3ea973=_0xc6fd48['cf-connecting-ip'];}else if(_0xc6fd48[_0x9b42('0x3a')]){_0x3ea973=_[_0x9b42('0x3b')](_0xc6fd48[_0x9b42('0x3a')][_0x9b42('0x3c')](','));}return{'ContactId':_0x1e22f4['id'],'ChatWebsiteId':_0x1992d6,'from':(_0x1e22f4['firstName']||'')+'\x20'+(_0x1e22f4[_0x9b42('0x3d')]||''),'customerIp':_0x3ea973,'customerPort':_0xc6fd48[_0x9b42('0x3e')]?_0xc6fd48[_0x9b42('0x3e')]:null,'referer':_0x1083a1[_0x9b42('0x3f')],'browserName':_0x35cb2e[_0x9b42('0x40')][_0x9b42('0x34')]&&_0x35cb2e[_0x9b42('0x40')][_0x9b42('0x41')]?util[_0x9b42('0x42')](_0x9b42('0x43'),_0x35cb2e[_0x9b42('0x40')][_0x9b42('0x34')],_0x35cb2e[_0x9b42('0x40')][_0x9b42('0x41')]):_0x9b42('0x44'),'browserVersion':_0x35cb2e[_0x9b42('0x40')][_0x9b42('0x41')]||_0x9b42('0x44'),'osName':util[_0x9b42('0x42')](_0x9b42('0x43'),_0x35cb2e['os'][_0x9b42('0x34')],_0x35cb2e['os']['version']),'osVersion':_0x35cb2e['os'][_0x9b42('0x41')],'deviceModel':_0x35cb2e[_0x9b42('0x45')][_0x9b42('0x46')]&&_0x35cb2e[_0x9b42('0x45')][_0x9b42('0x47')]?util['format'](_0x9b42('0x48'),_0x35cb2e[_0x9b42('0x45')][_0x9b42('0x46')],_0x35cb2e[_0x9b42('0x45')][_0x9b42('0x47')],_0x35cb2e[_0x9b42('0x45')][_0x9b42('0x49')]):null,'deviceVendor':_0x35cb2e[_0x9b42('0x45')][_0x9b42('0x47')],'deviceType':_0x35cb2e['device']['type'],'formData':JSON['stringify'](_0x1083a1)};}exports[_0x9b42('0x4a')]=function(_0x36dc7b,_0x40246b){var _0x488f3f={'include':[{'model':db[_0x9b42('0x4b')],'as':_0x9b42('0x4c')}]},_0x5e8dcd={},_0x13207c={'count':0x0,'rows':[]};var _0x54eee5=_[_0x9b42('0x4d')](db[_0x9b42('0x4e')][_0x9b42('0x4f')],function(_0x83dc11){return{'name':_0x83dc11[_0x9b42('0x50')],'type':_0x83dc11[_0x9b42('0x49')][_0x9b42('0x51')]};});_0x5e8dcd['model']=_[_0x9b42('0x4d')](_0x54eee5,'name');_0x5e8dcd[_0x9b42('0x52')]=_[_0x9b42('0x53')](_0x36dc7b['query']);_0x5e8dcd[_0x9b42('0x54')]=_[_0x9b42('0x55')](_0x5e8dcd['model'],_0x5e8dcd['query']);_0x488f3f[_0x9b42('0x56')]=_[_0x9b42('0x55')](_0x5e8dcd[_0x9b42('0x46')],qs['fields'](_0x36dc7b[_0x9b42('0x52')][_0x9b42('0x57')]));_0x488f3f[_0x9b42('0x56')]=_0x488f3f[_0x9b42('0x56')][_0x9b42('0x58')]?_0x488f3f[_0x9b42('0x56')]:_0x5e8dcd[_0x9b42('0x46')];if(!_0x36dc7b[_0x9b42('0x52')][_0x9b42('0x59')](_0x9b42('0x5a'))){_0x488f3f['limit']=qs[_0x9b42('0x2a')](_0x36dc7b['query'][_0x9b42('0x2a')]);_0x488f3f[_0x9b42('0x28')]=qs['offset'](_0x36dc7b[_0x9b42('0x52')][_0x9b42('0x28')]);}_0x488f3f[_0x9b42('0x5b')]=qs[_0x9b42('0x5c')](_0x36dc7b['query'][_0x9b42('0x5c')]);_0x488f3f[_0x9b42('0x5d')]=qs[_0x9b42('0x54')](_[_0x9b42('0x5e')](_0x36dc7b[_0x9b42('0x52')],_0x5e8dcd[_0x9b42('0x54')]),_0x54eee5);if(_0x36dc7b[_0x9b42('0x52')][_0x9b42('0x5f')]){_0x488f3f[_0x9b42('0x5d')]=_['merge'](_0x488f3f[_0x9b42('0x5d')],{'$or':_[_0x9b42('0x4d')](_0x54eee5,function(_0xbd33df){if(_0xbd33df[_0x9b42('0x49')]!=='VIRTUAL'){var _0x2739ce={};_0x2739ce[_0xbd33df[_0x9b42('0x34')]]={'$like':'%'+_0x36dc7b[_0x9b42('0x52')]['filter']+'%'};return _0x2739ce;}})});}_0x488f3f=_[_0x9b42('0x60')]({},_0x488f3f,_0x36dc7b[_0x9b42('0x61')]);var _0x462e01={'where':_0x488f3f[_0x9b42('0x5d')]};return db['ChatWebsite'][_0x9b42('0x2b')](_0x462e01)[_0x9b42('0x30')](function(_0x59f211){_0x13207c['count']=_0x59f211;if(_0x36dc7b[_0x9b42('0x52')][_0x9b42('0x62')]){_0x488f3f['include']=[{'all':!![]}];}return db[_0x9b42('0x4e')][_0x9b42('0x63')](_0x488f3f);})['then'](function(_0x51016e){_0x13207c['rows']=_0x51016e;return _0x13207c;})[_0x9b42('0x30')](respondWithFilteredResult(_0x40246b,_0x488f3f))[_0x9b42('0x24')](handleError(_0x40246b,null));};exports[_0x9b42('0x64')]=function(_0x2efdbc,_0x23c02f){var _0x4e61b0={'raw':![],'where':{'id':_0x2efdbc[_0x9b42('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0x9b42('0x4c')}]},_0x37c063={};_0x37c063[_0x9b42('0x46')]=_['keys'](db[_0x9b42('0x4e')]['rawAttributes']);_0x37c063[_0x9b42('0x52')]=_[_0x9b42('0x53')](_0x2efdbc['query']);_0x37c063[_0x9b42('0x54')]=_['intersection'](_0x37c063[_0x9b42('0x46')],_0x37c063[_0x9b42('0x52')]);_0x4e61b0[_0x9b42('0x56')]=_[_0x9b42('0x55')](_0x37c063[_0x9b42('0x46')],qs['fields'](_0x2efdbc[_0x9b42('0x52')][_0x9b42('0x57')]));_0x4e61b0['attributes']=_0x4e61b0['attributes'][_0x9b42('0x58')]?_0x4e61b0[_0x9b42('0x56')]:_0x37c063[_0x9b42('0x46')];if(_0x2efdbc[_0x9b42('0x52')][_0x9b42('0x62')]){_0x4e61b0[_0x9b42('0x66')]=[{'all':!![]}];}_0x4e61b0=_[_0x9b42('0x60')]({},_0x4e61b0,_0x2efdbc[_0x9b42('0x61')]);return db[_0x9b42('0x4e')][_0x9b42('0x67')](_0x4e61b0)[_0x9b42('0x30')](handleEntityNotFound(_0x23c02f,null))[_0x9b42('0x30')](respondWithResult(_0x23c02f,null))[_0x9b42('0x24')](handleError(_0x23c02f,null));};exports[_0x9b42('0x68')]=function(_0x518439,_0x53b214){if(!wildcardUtils[_0x9b42('0x69')](_0x518439[_0x9b42('0x6a')][_0x9b42('0x6b')])){return handleError(_0x53b214,null)(new APIBadRequestError('\x22'+_0x518439['body'][_0x9b42('0x6b')]+_0x9b42('0x6c')));}return db['ChatWebsite'][_0x9b42('0x68')](_0x518439[_0x9b42('0x6a')],{})['then'](function(_0x397137){var _0x220708=_0x518439[_0x9b42('0x6d')][_0x9b42('0x32')]({'plain':!![]});if(!_0x220708)throw new Error(_0x9b42('0x6e'));if(_0x220708[_0x9b42('0x6f')]===_0x9b42('0x6d')){var _0x1993db=_0x397137[_0x9b42('0x32')]({'plain':!![]});var _0x148644=_0x9b42('0x33');return db[_0x9b42('0x70')][_0x9b42('0x67')]({'where':{'name':_0x148644,'userProfileId':_0x220708[_0x9b42('0x71')]},'raw':!![]})[_0x9b42('0x30')](function(_0x25df6f){if(_0x25df6f&&_0x25df6f[_0x9b42('0x72')]===0x0){return db[_0x9b42('0x73')]['create']({'name':_0x1993db[_0x9b42('0x34')],'resourceId':_0x1993db['id'],'type':_0x25df6f[_0x9b42('0x34')],'sectionId':_0x25df6f['id']},{})[_0x9b42('0x30')](function(){return _0x397137;});}else{return _0x397137;}})[_0x9b42('0x24')](function(_0x58fadd){logger[_0x9b42('0x20')](_0x9b42('0x74'),_0x58fadd);throw _0x58fadd;});}return _0x397137;})[_0x9b42('0x30')](respondWithResult(_0x53b214,0xc9))['catch'](handleError(_0x53b214,null));};exports[_0x9b42('0x2f')]=function(_0x192eec,_0x200a3c){if(!wildcardUtils['testWildcardValidity'](_0x192eec[_0x9b42('0x6a')]['address'])){return handleError(_0x200a3c,null)(new APIBadRequestError('\x22'+_0x192eec[_0x9b42('0x6a')][_0x9b42('0x6b')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}if(_0x192eec[_0x9b42('0x6a')]['id']){delete _0x192eec[_0x9b42('0x6a')]['id'];}return db[_0x9b42('0x4e')][_0x9b42('0x67')]({'where':{'id':_0x192eec['params']['id']},'include':[{'model':db[_0x9b42('0x4b')],'as':_0x9b42('0x4c')}]})[_0x9b42('0x30')](handleEntityNotFound(_0x200a3c,null))[_0x9b42('0x30')](saveUpdates(_0x192eec[_0x9b42('0x6a')],null))[_0x9b42('0x30')](respondWithResult(_0x200a3c,null))[_0x9b42('0x24')](handleError(_0x200a3c,null));};exports[_0x9b42('0x31')]=function(_0x1b805d,_0x4cce34){return db['ChatWebsite'][_0x9b42('0x67')]({'where':{'id':_0x1b805d[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x4cce34,null))[_0x9b42('0x30')](removeEntity(_0x4cce34,null))[_0x9b42('0x24')](handleError(_0x4cce34,null));};exports['describe']=function(_0x93d2b5,_0x12cffe){return db[_0x9b42('0x4e')][_0x9b42('0x75')]()['then'](respondWithResult(_0x12cffe,null))[_0x9b42('0x24')](handleError(_0x12cffe,null));};exports[_0x9b42('0x76')]=function(_0x303197,_0x150451){if(_0x303197[_0x9b42('0x6a')]['id']){delete _0x303197[_0x9b42('0x6a')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x303197[_0x9b42('0x65')]['id']}})['then'](handleEntityNotFound(_0x150451,null))[_0x9b42('0x30')](function(_0x2e3f6a){if(_0x2e3f6a){_0x303197['body'][_0x9b42('0x77')]=_0x2e3f6a['id'];return db[_0x9b42('0x78')][_0x9b42('0x68')](_0x303197['body']);}})[_0x9b42('0x30')](respondWithResult(_0x150451,null))[_0x9b42('0x24')](handleError(_0x150451,null));};exports['getDispositions']=function(_0x5a1a77,_0x3fa862){var _0x2b0b73={'raw':![],'where':{}};var _0x550247={};var _0x4322a9={'count':0x0,'rows':[]};return db[_0x9b42('0x4e')][_0x9b42('0x79')]({'where':{'id':_0x5a1a77['params']['id']}})['then'](handleEntityNotFound(_0x3fa862,null))[_0x9b42('0x30')](function(_0x545e4b){if(_0x545e4b){_0x550247['model']=_[_0x9b42('0x53')](db['Disposition'][_0x9b42('0x4f')]);_0x550247[_0x9b42('0x52')]=_['keys'](_0x5a1a77[_0x9b42('0x52')]);_0x550247['filters']=_[_0x9b42('0x55')](_0x550247[_0x9b42('0x46')],_0x550247['query']);_0x2b0b73[_0x9b42('0x56')]=_[_0x9b42('0x55')](_0x550247['model'],qs[_0x9b42('0x57')](_0x5a1a77[_0x9b42('0x52')][_0x9b42('0x57')]));_0x2b0b73[_0x9b42('0x56')]=_0x2b0b73[_0x9b42('0x56')]['length']?_0x2b0b73[_0x9b42('0x56')]:_0x550247[_0x9b42('0x46')];if(!_0x5a1a77[_0x9b42('0x52')][_0x9b42('0x59')](_0x9b42('0x5a'))){_0x2b0b73['limit']=qs[_0x9b42('0x2a')](_0x5a1a77[_0x9b42('0x52')]['limit']);_0x2b0b73[_0x9b42('0x28')]=qs[_0x9b42('0x28')](_0x5a1a77['query'][_0x9b42('0x28')]);}_0x2b0b73[_0x9b42('0x5b')]=qs[_0x9b42('0x5c')](_0x5a1a77['query']['sort']);_0x2b0b73[_0x9b42('0x5d')]=qs[_0x9b42('0x54')](_['pick'](_0x5a1a77[_0x9b42('0x52')],_0x550247[_0x9b42('0x54')]));_0x2b0b73['where']['ChatWebsiteId']=_0x545e4b['id'];if(_0x5a1a77[_0x9b42('0x52')]['filter']){_0x2b0b73[_0x9b42('0x5d')]=_[_0x9b42('0x60')](_0x2b0b73[_0x9b42('0x5d')],{'$or':_['map'](_0x2b0b73[_0x9b42('0x56')],function(_0x4c0121){var _0x4933e8={};_0x4933e8[_0x4c0121]={'$like':'%'+_0x5a1a77[_0x9b42('0x52')][_0x9b42('0x5f')]+'%'};return _0x4933e8;})});}_0x2b0b73=_['merge']({},_0x2b0b73,_0x5a1a77[_0x9b42('0x61')]);return db[_0x9b42('0x78')][_0x9b42('0x2b')]({'where':_0x2b0b73[_0x9b42('0x5d')]})[_0x9b42('0x30')](function(_0x58afa7){_0x4322a9[_0x9b42('0x2b')]=_0x58afa7;if(_0x5a1a77[_0x9b42('0x52')][_0x9b42('0x62')]){_0x2b0b73['include']=[{'all':!![]}];}return db[_0x9b42('0x78')][_0x9b42('0x63')](_0x2b0b73);})[_0x9b42('0x30')](function(_0x24a215){_0x4322a9[_0x9b42('0x7a')]=_0x24a215;return _0x4322a9;});}})[_0x9b42('0x30')](respondWithFilteredResult(_0x3fa862,_0x2b0b73))[_0x9b42('0x24')](handleError(_0x3fa862,null));};exports['removeDispositions']=function(_0x2c3704,_0x527bc6){return db[_0x9b42('0x4e')][_0x9b42('0x67')]({'where':{'id':_0x2c3704[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x527bc6,null))['then'](function(_0x5b438e){if(_0x5b438e){return _0x5b438e[_0x9b42('0x7b')](_0x2c3704[_0x9b42('0x52')][_0x9b42('0x7c')]);}})[_0x9b42('0x30')](respondWithStatusCode(_0x527bc6,null))[_0x9b42('0x24')](handleError(_0x527bc6,null));};exports['addAnswer']=function(_0x2789b0,_0x198809){if(_0x2789b0[_0x9b42('0x6a')]['id']){delete _0x2789b0[_0x9b42('0x6a')]['id'];}return db['ChatWebsite'][_0x9b42('0x67')]({'where':{'id':_0x2789b0[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x198809,null))[_0x9b42('0x30')](function(_0x3e296f){if(_0x3e296f){_0x2789b0[_0x9b42('0x6a')][_0x9b42('0x77')]=_0x3e296f['id'];return db[_0x9b42('0x7d')][_0x9b42('0x68')](_0x2789b0[_0x9b42('0x6a')]);}})['then'](respondWithResult(_0x198809,null))[_0x9b42('0x24')](handleError(_0x198809,null));};exports[_0x9b42('0x7e')]=function(_0x233b09,_0x57c854){var _0x4484c9={'raw':![],'where':{}};var _0x598bc4={};var _0x207357={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9b42('0x79')]({'where':{'id':_0x233b09[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x57c854,null))[_0x9b42('0x30')](function(_0x4803f8){if(_0x4803f8){_0x598bc4[_0x9b42('0x46')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x598bc4[_0x9b42('0x52')]=_[_0x9b42('0x53')](_0x233b09[_0x9b42('0x52')]);_0x598bc4[_0x9b42('0x54')]=_['intersection'](_0x598bc4[_0x9b42('0x46')],_0x598bc4['query']);_0x4484c9[_0x9b42('0x56')]=_['intersection'](_0x598bc4[_0x9b42('0x46')],qs['fields'](_0x233b09[_0x9b42('0x52')][_0x9b42('0x57')]));_0x4484c9['attributes']=_0x4484c9[_0x9b42('0x56')][_0x9b42('0x58')]?_0x4484c9['attributes']:_0x598bc4[_0x9b42('0x46')];if(!_0x233b09[_0x9b42('0x52')][_0x9b42('0x59')](_0x9b42('0x5a'))){_0x4484c9[_0x9b42('0x2a')]=qs[_0x9b42('0x2a')](_0x233b09['query'][_0x9b42('0x2a')]);_0x4484c9[_0x9b42('0x28')]=qs['offset'](_0x233b09[_0x9b42('0x52')][_0x9b42('0x28')]);}_0x4484c9[_0x9b42('0x5b')]=qs['sort'](_0x233b09['query'][_0x9b42('0x5c')]);_0x4484c9[_0x9b42('0x5d')]=qs[_0x9b42('0x54')](_['pick'](_0x233b09[_0x9b42('0x52')],_0x598bc4[_0x9b42('0x54')]));_0x4484c9[_0x9b42('0x5d')][_0x9b42('0x77')]=_0x4803f8['id'];if(_0x233b09[_0x9b42('0x52')][_0x9b42('0x5f')]){_0x4484c9[_0x9b42('0x5d')]=_[_0x9b42('0x60')](_0x4484c9[_0x9b42('0x5d')],{'$or':_[_0x9b42('0x4d')](_0x4484c9[_0x9b42('0x56')],function(_0x51adf2){var _0x566455={};_0x566455[_0x51adf2]={'$like':'%'+_0x233b09['query'][_0x9b42('0x5f')]+'%'};return _0x566455;})});}_0x4484c9=_[_0x9b42('0x60')]({},_0x4484c9,_0x233b09[_0x9b42('0x61')]);return db[_0x9b42('0x7d')][_0x9b42('0x2b')]({'where':_0x4484c9[_0x9b42('0x5d')]})[_0x9b42('0x30')](function(_0x598759){_0x207357['count']=_0x598759;if(_0x233b09[_0x9b42('0x52')]['includeAll']){_0x4484c9['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x9b42('0x63')](_0x4484c9);})[_0x9b42('0x30')](function(_0x201508){_0x207357['rows']=_0x201508;return _0x207357;});}})[_0x9b42('0x30')](respondWithFilteredResult(_0x57c854,_0x4484c9))[_0x9b42('0x24')](handleError(_0x57c854,null));};exports['removeAnswers']=function(_0x716a1d,_0x2b6a69){return db['ChatWebsite'][_0x9b42('0x67')]({'where':{'id':_0x716a1d[_0x9b42('0x65')]['id']}})['then'](handleEntityNotFound(_0x2b6a69,null))['then'](function(_0x2159b0){if(_0x2159b0){return _0x2159b0[_0x9b42('0x7f')](_0x716a1d[_0x9b42('0x52')]['ids']);}})[_0x9b42('0x30')](respondWithStatusCode(_0x2b6a69,null))['catch'](handleError(_0x2b6a69,null));};exports['addLogo']=function(_0xd8eca8,_0x1a9e68){_0xd8eca8[_0x9b42('0x6a')][_0x9b42('0x80')]=_0xd8eca8[_0x9b42('0x81')][_0x9b42('0x82')];return db[_0x9b42('0x4e')][_0x9b42('0x67')]({'where':{'id':_0xd8eca8[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x1a9e68,null))[_0x9b42('0x30')](saveUpdates(_0xd8eca8[_0x9b42('0x6a')],null))[_0x9b42('0x30')](respondWithResult(_0x1a9e68,null))['catch'](handleError(_0x1a9e68,null));};exports['addAvatar']=function(_0x121552,_0x28e7ff){_0x121552[_0x9b42('0x6a')][_0x9b42('0x83')]=_0x121552[_0x9b42('0x81')][_0x9b42('0x82')];return db['ChatWebsite'][_0x9b42('0x67')]({'where':{'id':_0x121552[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x28e7ff,null))[_0x9b42('0x30')](saveUpdates(_0x121552[_0x9b42('0x6a')],null))[_0x9b42('0x30')](respondWithResult(_0x28e7ff,null))['catch'](handleError(_0x28e7ff,null));};exports[_0x9b42('0x84')]=function(_0x510f65,_0x1c286d){_0x510f65['body'][_0x9b42('0x85')]=_0x510f65[_0x9b42('0x81')][_0x9b42('0x82')];return db['ChatWebsite'][_0x9b42('0x67')]({'where':{'id':_0x510f65[_0x9b42('0x65')]['id']}})['then'](handleEntityNotFound(_0x1c286d,null))[_0x9b42('0x30')](saveUpdates(_0x510f65['body'],null))['then'](respondWithResult(_0x1c286d,null))[_0x9b42('0x24')](handleError(_0x1c286d,null));};exports['addSystemAvatar']=function(_0x5b34f3,_0x375f50){_0x5b34f3[_0x9b42('0x6a')][_0x9b42('0x86')]=_0x5b34f3[_0x9b42('0x81')][_0x9b42('0x82')];return db['ChatWebsite'][_0x9b42('0x67')]({'where':{'id':_0x5b34f3[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x375f50,null))['then'](saveUpdates(_0x5b34f3['body'],null))[_0x9b42('0x30')](respondWithResult(_0x375f50,null))[_0x9b42('0x24')](handleError(_0x375f50,null));};exports[_0x9b42('0x87')]=function(_0x524e33,_0x5be5eb){var _0xd0c7ea=path[_0x9b42('0x88')](config[_0x9b42('0x89')],'server/files/images/logos/default_logo.svg');var _0x380550={'where':{'id':_0x524e33[_0x9b42('0x65')]['id']},'attributes':['id',_0x9b42('0x80')],'raw':!![]};var _0x29ed60=![];return require('../../config/license/util')['getLicense']()[_0x9b42('0x30')](function(_0xffaac9){if(_0xffaac9){_0x29ed60=_0xffaac9['custom'];}})['then'](function(){return db[_0x9b42('0x4e')][_0x9b42('0x67')](_0x380550);})[_0x9b42('0x30')](handleEntityNotFound(_0x5be5eb,null))[_0x9b42('0x30')](function(_0x294dfe){if(_0x294dfe){if(!_[_0x9b42('0x8a')](_0x294dfe['sitepic'])){if(fs[_0x9b42('0x8b')](path[_0x9b42('0x88')](config[_0x9b42('0x89')],'server/files/images/logos/',_0x294dfe[_0x9b42('0x80')]))&&_0x29ed60){_0xd0c7ea=path['join'](config[_0x9b42('0x89')],'server/files/images/logos/',_0x294dfe[_0x9b42('0x80')]);}}return _0x5be5eb[_0x9b42('0x8c')](_0xd0c7ea);}})['catch'](handleError(_0x5be5eb,null));};exports['getAvatar']=function(_0x24a740,_0x48cf6b){var _0x9509e1=path['join'](config[_0x9b42('0x89')],_0x9b42('0x8d'));var _0x3833b6={'where':{'id':_0x24a740[_0x9b42('0x65')]['id']},'attributes':['id',_0x9b42('0x83')],'raw':!![]};return db[_0x9b42('0x4e')][_0x9b42('0x67')](_0x3833b6)[_0x9b42('0x30')](handleEntityNotFound(_0x48cf6b,null))[_0x9b42('0x30')](function(_0x2c9842){if(_0x2c9842){if(!_[_0x9b42('0x8a')](_0x2c9842['agentAvatar'])){if(fs[_0x9b42('0x8b')](path[_0x9b42('0x88')](config[_0x9b42('0x89')],_0x9b42('0x8e'),_0x2c9842[_0x9b42('0x83')]))){_0x9509e1=path['join'](config[_0x9b42('0x89')],_0x9b42('0x8e'),_0x2c9842[_0x9b42('0x83')]);}}return _0x48cf6b['download'](_0x9509e1);}})['catch'](handleError(_0x48cf6b,null));};exports['getCustomerAvatar']=function(_0x3c0d5b,_0x218802){var _0x12bd5a=path[_0x9b42('0x88')](config[_0x9b42('0x89')],'server/files/images/avatars/customer_avatar.png');var _0x109099={'where':{'id':_0x3c0d5b['params']['id']},'attributes':['id',_0x9b42('0x85'),_0x9b42('0x8f')],'raw':!![]};return db[_0x9b42('0x4e')][_0x9b42('0x67')](_0x109099)['then'](handleEntityNotFound(_0x218802,null))[_0x9b42('0x30')](function(_0x436537){if(_0x436537){if(!_[_0x9b42('0x8a')](_0x436537[_0x9b42('0x85')])){if(fs[_0x9b42('0x8b')](path[_0x9b42('0x88')](config['root'],_0x9b42('0x8e'),_0x436537[_0x9b42('0x85')]))&&_0x436537[_0x9b42('0x8f')]){_0x12bd5a=path[_0x9b42('0x88')](config[_0x9b42('0x89')],_0x9b42('0x8e'),_0x436537['customerAvatar']);}}return _0x218802[_0x9b42('0x8c')](_0x12bd5a);}})['catch'](handleError(_0x218802,null));};exports[_0x9b42('0x90')]=function(_0x2b0005,_0x149067){var _0x300f5f=path[_0x9b42('0x88')](config[_0x9b42('0x89')],_0x9b42('0x91'));var _0x187f98={'where':{'id':_0x2b0005[_0x9b42('0x65')]['id']},'attributes':['id',_0x9b42('0x86')],'raw':!![]};return db[_0x9b42('0x4e')][_0x9b42('0x67')](_0x187f98)['then'](handleEntityNotFound(_0x149067,null))[_0x9b42('0x30')](function(_0xe6095b){if(_0xe6095b){if(!_[_0x9b42('0x8a')](_0xe6095b[_0x9b42('0x86')])){if(fs[_0x9b42('0x8b')](path[_0x9b42('0x88')](config[_0x9b42('0x89')],_0x9b42('0x8e'),_0xe6095b['systemAvatar']))){_0x300f5f=path[_0x9b42('0x88')](config[_0x9b42('0x89')],'server/files/images/avatars/',_0xe6095b['systemAvatar']);}}return _0x149067[_0x9b42('0x8c')](_0x300f5f);}})[_0x9b42('0x24')](handleError(_0x149067,null));};function checkWebsiteInterval(_0x387ba2){var _0x2f93ba=_0x387ba2[_0x9b42('0x92')];if(!_0x2f93ba){return Promise['resolve'](_0x387ba2);}var _0x3df6fe=_0x387ba2[_0x9b42('0x93')]||undefined;return _0x2f93ba['ifTime'](_0x3df6fe)['then'](function(_0x97f2df){if(!_0x97f2df){throw new APIOutOfIntervalError();}return _0x387ba2;});}exports[_0x9b42('0x94')]=function(_0x4725cc,_0x45013f){var _0x126a8b={'body':_0x4725cc['body'],'channel':_0x9b42('0x95')};var _0x503727=[];var _0x5d8b5c=[];var _0x3c2539={};var _0x29b182=![];if(_0x4725cc['body']['id']){delete _0x4725cc['body']['id'];}if(_[_0x9b42('0x8a')](_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x96')])){throw new APIBadRequestError(_0x9b42('0x97'));}if(_[_0x9b42('0x8a')](_0x4725cc['body'][_0x9b42('0x98')])){throw new APIBadRequestError(_0x9b42('0x99'));}if(_['isEmpty'](_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x6a')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x1a1417=_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x39')]&&_0x4725cc['body']['referer'];return db[_0x9b42('0x9a')][_0x9b42('0x75')]()[_0x9b42('0x30')](function(_0x292ac9){if(!_0x292ac9){throw new Error(_0x9b42('0x9b'));}_0x503727=Object[_0x9b42('0x53')](_0x292ac9)['filter'](function(_0x2eb276){return![_0x9b42('0x9c'),_0x9b42('0x9d')]['includes'](_0x2eb276);});_0x5d8b5c=Object[_0x9b42('0x53')](_0x292ac9)[_0x9b42('0x5f')](function(_0x1ee390){return![_0x9b42('0x9c'),_0x9b42('0x9d'),_0x9b42('0x9e'),_0x9b42('0x9f')]['includes'](_0x1ee390);});if(!_['includes'](_0x5d8b5c,_0x4725cc['body']['mapKey'])){throw new APIBadRequestError(_0x9b42('0xa0')+_0x5d8b5c[_0x9b42('0x88')](',\x20'));}_0x3c2539[_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x98')]]=_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x96')];})[_0x9b42('0x30')](function(){return db[_0x9b42('0x4e')][_0x9b42('0x67')]({'where':{'id':_0x4725cc[_0x9b42('0x65')]['id']},'include':[{'model':db[_0x9b42('0xa1')],'as':_0x9b42('0xa2'),'include':[{'model':db[_0x9b42('0x9a')],'as':_0x9b42('0xa3'),'where':_0x3c2539,'limit':0x1,'order':[[_0x9b42('0x9d'),_0x9b42('0xa4')]]}]},{'model':db[_0x9b42('0xa5')],'as':_0x9b42('0xa6')},{'model':db[_0x9b42('0x92')],'as':'Interval','include':[{'model':db[_0x9b42('0x92')],'as':_0x9b42('0xa7'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x9b42('0x30')](function(_0x14e2e0){if(!_0x14e2e0){throw new APINotFoundError(util[_0x9b42('0x42')](_0x9b42('0xa8'),_0x4725cc[_0x9b42('0x65')]['id']));}if(_0x1a1417){return checkWebsiteInterval(_0x14e2e0);}return _0x14e2e0;})[_0x9b42('0x30')](function(_0x17af03){_0x126a8b['account']=_0x17af03;_0x126a8b[_0x9b42('0xa9')]=_[_0x9b42('0xaa')](_0x17af03[_0x9b42('0xa6')],[_0x9b42('0xab')],[_0x9b42('0xac')]);if(_0x126a8b['account'][_0x9b42('0xa6')]){delete _0x126a8b[_0x9b42('0xad')]['Applications'];}_0x126a8b['list']=_0x17af03[_0x9b42('0xa2')]||{'id':_0x17af03[_0x9b42('0x9f')]};if(_0x126a8b['list']&&_0x126a8b[_0x9b42('0xae')]['Contacts'][_0x9b42('0x58')]){return _0x126a8b[_0x9b42('0xae')][_0x9b42('0xa3')][0x0];}var _0x26ee51=_['defaults'](_0x4725cc['body'],{'firstName':_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x96')],'ListId':_0x17af03['ListId']});_0x26ee51[_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x98')]]=_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x96')];return db[_0x9b42('0x9a')][_0x9b42('0x68')](_0x26ee51,{'fields':_0x503727,'raw':!![]});})[_0x9b42('0x30')](function(_0x118300){_0x126a8b['contact']=_0x118300;var _0x33c1ea=createInteractionObject(_0x4725cc[_0x9b42('0x65')]['id'],_0x4725cc[_0x9b42('0x6a')],_0x4725cc[_0x9b42('0xaf')],_0x118300);var _0x45df6c={'ChatWebsiteId':_0x4725cc['params']['id']};if(_0x4725cc[_0x9b42('0x6a')][_0x9b42('0xb0')]){_0x45df6c[_0x9b42('0xb0')]=_0x4725cc[_0x9b42('0x6a')][_0x9b42('0xb0')];_0x45df6c[_0x9b42('0xb1')]=![];return db[_0x9b42('0xb2')]['find']({'where':_0x45df6c})[_0x9b42('0x30')](function(_0x2e3df0){var _0x5e6bcb=_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x39')]&&_0x4725cc['body'][_0x9b42('0x3f')];if(_0x2e3df0){_0x29b182=!![];return _0x2e3df0;}else if(!_0x5e6bcb&&_0x2e3df0&&_0x2e3df0[_0x9b42('0xb1')]){throw new APIConflictError(_0x9b42('0xb3'));}_0x33c1ea['threadId']=_0x4725cc[_0x9b42('0x6a')]['threadId'];_0x33c1ea[_0x9b42('0xb4')]=_0x4725cc[_0x9b42('0x6a')][_0x9b42('0xb4')];return db['ChatInteraction'][_0x9b42('0x68')](_0x33c1ea);});}_0x45df6c[_0x9b42('0xb5')]=_0x118300['id'];if(_0x4725cc['body'][_0x9b42('0xb6')]&&_0x4725cc['body'][_0x9b42('0xb6')]['id']){_0x45df6c['id']=_0x4725cc['body'][_0x9b42('0xb6')]['id'];return db[_0x9b42('0xb2')][_0x9b42('0x67')]({'where':_0x45df6c})[_0x9b42('0x30')](function(_0x55f92d){var _0x25974e=_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x39')]&&_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x3f')];if(!_0x25974e&&_0x55f92d&&_0x55f92d[_0x9b42('0xb1')]){throw new APIConflictError(_0x9b42('0xb3'));}else if(_0x55f92d){_0x29b182=!![];return _0x55f92d;}else{return db['ChatInteraction']['create'](_0x33c1ea);}});}return db['ChatInteraction']['create'](_0x33c1ea);})[_0x9b42('0x30')](function(_0x25f6d3){if(!_0x29b182){return _0x25f6d3;}var _0x57ff3a={'from':(_0x126a8b[_0x9b42('0xb7')][_0x9b42('0xb8')]||'')+'\x20'+(_0x126a8b[_0x9b42('0xb7')][_0x9b42('0x3d')]||'')};if(_0x4725cc['body']['threadId']&&_0x4725cc[_0x9b42('0x6a')][_0x9b42('0xb9')]&&_0x4725cc['body'][_0x9b42('0xb0')]!=_0x4725cc['body'][_0x9b42('0xb9')]){_0x57ff3a[_0x9b42('0xb0')]=_0x4725cc[_0x9b42('0x6a')][_0x9b42('0xb9')];}return _0x25f6d3[_0x9b42('0x2f')](_0x57ff3a);})[_0x9b42('0x30')](function(_0x4cf76b){_0x126a8b['interaction']=_0x4cf76b[_0x9b42('0x32')]({'plain':!![]});_0x126a8b[_0x9b42('0xb6')][_0x9b42('0xba')]=!_0x29b182;if(_0x126a8b[_0x9b42('0xb6')][_0x9b42('0xba')]){if(_0x126a8b['account']['autoclose']){_0x126a8b[_0x9b42('0xa9')][_0x9b42('0xbb')]({'id':0x0,'priority':_0x126a8b[_0x9b42('0xa9')][_0x9b42('0x58')]+0x1,'app':_0x9b42('0xbc'),'appdata':_0x9b42('0xbd'),'interval':'*,*,*,*'});}}return db[_0x9b42('0xbe')][_0x9b42('0x68')]({'body':_0x4725cc[_0x9b42('0x6a')][_0x9b42('0x6a')],'ChatWebsiteId':_0x4725cc[_0x9b42('0x65')]['id'],'ChatInteractionId':_0x4cf76b['id'],'direction':'in','ContactId':_0x126a8b[_0x9b42('0xb7')]['id'],'AttachmentId':_0x4725cc[_0x9b42('0x6a')]['AttachmentId']});})[_0x9b42('0x30')](function(_0x43fdf1){_0x126a8b[_0x9b42('0x22')]=_0x43fdf1;if(!_0x126a8b[_0x9b42('0xb6')]['UserId']){return;}return db[_0x9b42('0xbf')][_0x9b42('0x67')]({'attributes':['id','name'],'where':{'id':_0x126a8b['interaction'][_0x9b42('0xc0')]}});})[_0x9b42('0x30')](function(_0x26e106){if(_0x26e106){_0x126a8b[_0x9b42('0xa9')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9b42('0xc1'),'appdata':_0x26e106['name']+','+(_0x126a8b[_0x9b42('0xad')][_0x9b42('0xc2')]||0xa),'interval':_0x9b42('0xc3')});_0x126a8b[_0x9b42('0xc4')]=!![];}if(!_0x126a8b[_0x9b42('0xb6')]['queueId']){return;}return db['ChatQueue'][_0x9b42('0x67')]({'attributes':['id',_0x9b42('0x34')],'where':{'id':_0x126a8b[_0x9b42('0xb6')][_0x9b42('0xc5')]}});})[_0x9b42('0x30')](function(_0x56b9ab){if(_0x56b9ab){_0x126a8b[_0x9b42('0xa9')][_0x9b42('0xc6')]({'id':0x0,'priority':0x1,'app':_0x9b42('0xc7'),'appdata':_0x56b9ab[_0x9b42('0x34')]+','+(_0x126a8b[_0x9b42('0xad')]['waitForTheAssignedQueue']||0x12c),'interval':_0x9b42('0xc3')});}return respondWithRpcPromise(_0x9b42('0xc8'),_0x9b42('0xc9'),_0x126a8b);})[_0x9b42('0x30')](function(_0x3a8e6d){respondWithRpcPromise(_0x9b42('0xca'),_0x9b42('0xca'),{'event':_0x9b42('0x94'),'message':_0x3a8e6d},client9002);return _0x3a8e6d;})[_0x9b42('0x30')](respondWithResult(_0x45013f,null))['catch'](APIHandleError(_0x45013f));};exports[_0x9b42('0xcb')]=function(_0x321215,_0x18dad2){var _0x1a17f9,_0x586872,_0x7e5d00;var _0x47c0cd=[];var _0x3fa57a={};var _0x4c3e16=_0x321215[_0x9b42('0xcc')]||[];var _0x2cbaac=[];var _0x4b1be3;return db[_0x9b42('0x9a')][_0x9b42('0x75')]()[_0x9b42('0x30')](function(_0x6bf389){if(!_0x6bf389){throw new db[(_0x9b42('0xcd'))][(_0x9b42('0xce'))](_0x9b42('0xcf'));}_0x47c0cd=_[_0x9b42('0xd0')](_[_0x9b42('0x53')](_0x6bf389),[_0x9b42('0x9c'),'updatedAt',_0x9b42('0x9e'),_0x9b42('0x9f')]);if(_0x321215[_0x9b42('0x6a')]['id']){delete _0x321215['body']['id'];}if(_['isNil'](_0x321215[_0x9b42('0x6a')][_0x9b42('0x96')])){throw _0x18dad2[_0x9b42('0x26')](0x1f4)[_0x9b42('0xd1')](new db[(_0x9b42('0xcd'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x9b42('0x8a')](_0x321215[_0x9b42('0x6a')][_0x9b42('0x6a')])||_0x321215[_0x9b42('0x6a')]['body']===''){throw _0x18dad2[_0x9b42('0x26')](0x1f4)[_0x9b42('0xd1')](new db[(_0x9b42('0xcd'))][(_0x9b42('0xce'))](_0x9b42('0xd2')));}if(_[_0x9b42('0x8a')](_0x321215['body']['mapKeyOffline'])){throw _0x18dad2[_0x9b42('0x26')](0x1f4)['send'](new db[(_0x9b42('0xcd'))][(_0x9b42('0xce'))](_0x9b42('0xd3')+_0x47c0cd));}if(!_['includes'](_0x47c0cd,_0x321215[_0x9b42('0x6a')][_0x9b42('0xd4')])){throw _0x18dad2['status'](0x1f4)[_0x9b42('0xd1')](new db[(_0x9b42('0xcd'))][(_0x9b42('0xce'))](_0x9b42('0xd5')+_0x47c0cd));}_0x3fa57a[_0x321215['body'][_0x9b42('0xd4')]]=_0x321215[_0x9b42('0x6a')][_0x9b42('0x96')];})[_0x9b42('0x30')](function(){return db[_0x9b42('0x4e')][_0x9b42('0x67')]({'where':{'id':_0x321215[_0x9b42('0x65')]['id']},'include':[{'model':db[_0x9b42('0xa1')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x9b42('0x30')](handleEntityNotFound(_0x18dad2,null))['then'](function(_0x19a0b3){if(_0x19a0b3&&_0x19a0b3[_0x9b42('0xa2')]){_0x586872=_0x19a0b3;var _0x195e6e=_[_0x9b42('0x14')](_0x321215[_0x9b42('0x6a')],{'firstName':_0x321215['body'][_0x9b42('0x96')],'phone':_0x321215[_0x9b42('0x6a')][_0x9b42('0x96')],'ListId':_0x19a0b3[_0x9b42('0x9f')]});_0x195e6e[_0x321215['body'][_0x9b42('0xd4')]]=_0x321215['body']['from'];return db[_0x9b42('0x9a')]['findOrCreate']({'where':_0x3fa57a,'defaults':_0x195e6e});}})[_0x9b42('0xd6')](function(_0xc33731){if(_0xc33731){_0x7e5d00=_0xc33731;var _0x3daee8=fs['readFileSync'](path['join'](config['root'],_0x9b42('0xd7')),_0x9b42('0xd8'));var _0x4a9c0d=ejs['render'](_0x3daee8,{'body':_['toPairs'](_0x321215[_0x9b42('0x6a')][_0x9b42('0x6a')]),'bodyTitle':_0x586872[_0x9b42('0xd9')]});return db[_0x9b42('0xda')][_0x9b42('0x68')]({'body':_0x4a9c0d,'plainBody':htmlToText[_0x9b42('0xdb')](_0x4a9c0d),'ContactId':_0xc33731['id'],'ChatWebsiteId':_0x586872['id']});}})[_0x9b42('0x30')](function(_0x843f49){_0x4b1be3=_0x843f49;if(_0x4c3e16[_0x9b42('0x58')]){var _0x814cac=_0x4c3e16[_0x9b42('0x4d')](function(_0x3c040e){return{'name':_0x3c040e[_0x9b42('0xdc')],'basename':_0x3c040e[_0x9b42('0x82')],'type':_0x3c040e[_0x9b42('0xdd')],'ChatOfflineMessageId':_0x843f49['id']};});_0x2cbaac=_0x814cac['map'](_0x5aee82=>{var _0x1115c6={'filename':_0x5aee82[_0x9b42('0x34')],'path':path['join'](config['root'],_0x9b42('0xde'),'files',_0x9b42('0xdf'),_0x9b42('0xe0'),_0x5aee82[_0x9b42('0xe1')])};return _0x1115c6;});if(!_0x586872[_0x9b42('0xe2')]){return db['sequelize']['transaction'](function(_0x1b1359){return db['Attachment'][_0x9b42('0xe3')](_0x814cac,{'transaction':_0x1b1359});});}}})[_0x9b42('0x30')](function(){if(_0x4b1be3){_0x1a17f9=_0x4b1be3;return db[_0x9b42('0xe4')][_0x9b42('0x79')]({'where':{'service':!![]},'include':[{'model':db[_0x9b42('0xe5')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x9b42('0xe6')],'as':_0x9b42('0xe6'),'raw':!![]}]}]});}})[_0x9b42('0x30')](function(_0x4bab32){if(_0x4bab32&&_0x4bab32[_0x9b42('0xe7')]&&_0x586872[_0x9b42('0xe8')]&&_0x586872[_0x9b42('0xe9')]){var _0x243892=_0x4bab32['getSmtpOptions']();return respondWithRpcPromise(_0x9b42('0xea'),_0x9b42('0xeb'),{'account':_0x243892,'message':{'from':util[_0x9b42('0x42')]('\x22%s\x22\x20<%s>',_0x4bab32[_0x9b42('0x34')],_0x4bab32[_0x9b42('0xec')]||_0x4bab32[_0x9b42('0xe7')][_0x9b42('0x6d')]),'to':_0x586872[_0x9b42('0xe9')],'subject':_0x586872['offlineMessageSubject'],'html':_0x1a17f9[_0x9b42('0x6a')],'attachments':_0x2cbaac}},client9003)[_0x9b42('0x30')](function(){return _0x1a17f9;})[_0x9b42('0x24')](function(_0x5e2aa9){logger[_0x9b42('0x20')](_0x5e2aa9);});}})[_0x9b42('0x30')](function(){if(_0x586872&&_0x586872[_0x9b42('0xe2')]&&_0x586872[_0x9b42('0xed')]){var _0x43768b=[];if(_0x4c3e16[_0x9b42('0x58')]){_0x43768b=_0x4c3e16[_0x9b42('0x4d')](function(_0x20b09e){return{'name':_0x20b09e[_0x9b42('0xdc')],'basename':_0x20b09e[_0x9b42('0x82')],'type':_0x20b09e['mimetype'],'ChatOfflineMessageId':_0x4b1be3['id']};});}var _0xa040a;if(!_['isNil'](_0x586872['subjectOffline'])){var _0x485248=_[_0x9b42('0x4d')](_0x321215[_0x9b42('0x6a')],function(_0x19a529){return _0x19a529;});var _0x1b898a=_[_0x9b42('0xee')](_0x485248)[0x0];var _0xc8a08c=_['mapValues'](_0x1b898a,function(_0xaa8704){return _0xaa8704;});_0xa040a=_0xc8a08c[0x1][_0x586872[_0x9b42('0xef')]];}var _0x313055={'from':_0x7e5d00['email'],'firstName':_0x7e5d00[_0x9b42('0xb8')],'lastName':_0x7e5d00[_0x9b42('0x3d')],'mapKey':'email','message':{'from':_0x7e5d00[_0x9b42('0xec')],'to':_0x586872[_0x9b42('0xe4')][_0x9b42('0xec')],'cc':'','subject':_[_0x9b42('0x8a')](_0xa040a)?_0x586872['offlineMessageSubject']:_0xa040a,'messageId':'','sentAt':new Date(),'attach':_0x43768b[_0x9b42('0x58')],'attachments':_0x43768b,'originChannel':_0x9b42('0xf0'),'ChatWebsiteId':_0x586872['id'],'ChatOfflineMessageId':_0x1a17f9['id'],'originTo':_0x586872[_0x9b42('0xe4')]['email']},'body':_0x1a17f9['body']};var _0x1dfd18={'account':{'id':_0x586872[_0x9b42('0xed')]},'body':_0x313055,'log':_0x9b42('0xf1')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x1dfd18,client9001)[_0x9b42('0x30')](function(){return _0x1a17f9;})[_0x9b42('0x24')](function(_0x42b05e){logger[_0x9b42('0x20')](_0x42b05e);});}return;})[_0x9b42('0x30')](function(){if(_0x1a17f9){return _0x1a17f9;}})[_0x9b42('0x30')](respondWithResult(_0x18dad2,null))[_0x9b42('0x24')](function(){for(var _0x1b77f3 of _0x4c3e16){var _0x5c8765=path[_0x9b42('0x88')](config['root'],_0x9b42('0xde'),_0x9b42('0xcc'),'attachments','offline-chat',_0x1b77f3[_0x9b42('0x82')]);fs_extra[_0x9b42('0xf2')](_0x5c8765)[_0x9b42('0x24')](function(_0xa6bd72){logger[_0x9b42('0x20')](_0x9b42('0xf3'),_0x5c8765,_0xa6bd72);});}});};exports['addInteraction']=function(_0x13ebf2,_0x53d109){return db[_0x9b42('0xb2')][_0x9b42('0x67')]({'where':{'id':_0x13ebf2[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x53d109,null))[_0x9b42('0x30')](function(_0x4952c9){if(_0x4952c9){return _0x4952c9[_0x9b42('0xf4')](_0x13ebf2['body']['ids'],_['omit'](_0x13ebf2[_0x9b42('0x6a')],[_0x9b42('0x7c'),'id'])||{});}})['then'](respondWithResult(_0x53d109,null))['catch'](handleError(_0x53d109,null));};exports[_0x9b42('0xf5')]=function(_0x5e135c,_0x1e5015){var _0xe4c986={'raw':![],'where':{}};var _0x2f0ca0={};var _0x17ebdf={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5e135c['params']['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x1e5015,null))[_0x9b42('0x30')](function(_0x2ba174){if(_0x2ba174){_0x2f0ca0[_0x9b42('0x46')]=_[_0x9b42('0x53')](db[_0x9b42('0xb2')]['rawAttributes']);_0x2f0ca0[_0x9b42('0x52')]=_[_0x9b42('0x53')](_0x5e135c[_0x9b42('0x52')]);_0x2f0ca0[_0x9b42('0x54')]=_[_0x9b42('0x55')](_0x2f0ca0['model'],_0x2f0ca0[_0x9b42('0x52')]);_0xe4c986[_0x9b42('0x56')]=_[_0x9b42('0x55')](_0x2f0ca0['model'],qs[_0x9b42('0x57')](_0x5e135c[_0x9b42('0x52')][_0x9b42('0x57')]));_0xe4c986['attributes']=_0xe4c986[_0x9b42('0x56')]['length']?_0xe4c986['attributes']:_0x2f0ca0[_0x9b42('0x46')];if(!_0x5e135c['query'][_0x9b42('0x59')](_0x9b42('0x5a'))){_0xe4c986[_0x9b42('0x2a')]=qs[_0x9b42('0x2a')](_0x5e135c['query'][_0x9b42('0x2a')]);_0xe4c986[_0x9b42('0x28')]=qs['offset'](_0x5e135c[_0x9b42('0x52')]['offset']);}_0xe4c986['order']=qs[_0x9b42('0x5c')](_0x5e135c[_0x9b42('0x52')][_0x9b42('0x5c')]);_0xe4c986[_0x9b42('0x5d')]=qs[_0x9b42('0x54')](_[_0x9b42('0x5e')](_0x5e135c['query'],_0x2f0ca0[_0x9b42('0x54')]));_0xe4c986[_0x9b42('0x5d')]['ChatWebsiteId']=_0x2ba174['id'];if(_0x5e135c['query'][_0x9b42('0x5f')]){_0xe4c986[_0x9b42('0x5d')]=_[_0x9b42('0x60')](_0xe4c986[_0x9b42('0x5d')],{'$or':_[_0x9b42('0x4d')](_0xe4c986[_0x9b42('0x56')],function(_0x7c3ba8){var _0x190307={};_0x190307[_0x7c3ba8]={'$like':'%'+_0x5e135c['query'][_0x9b42('0x5f')]+'%'};return _0x190307;})});}_0xe4c986=_[_0x9b42('0x60')]({},_0xe4c986,_0x5e135c[_0x9b42('0x61')]);return db[_0x9b42('0xb2')][_0x9b42('0x2b')]({'where':_0xe4c986[_0x9b42('0x5d')]})['then'](function(_0x1691e1){_0x17ebdf[_0x9b42('0x2b')]=_0x1691e1;if(_0x5e135c['query'][_0x9b42('0x62')]){_0xe4c986[_0x9b42('0x66')]=[{'model':db[_0x9b42('0x9a')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9b42('0x34'),_0x9b42('0xf6'),_0x9b42('0xf7')],'required':![]},{'model':db['Tag'],'as':_0x9b42('0xf8'),'attributes':['id','name',_0x9b42('0xf9')],'where':_0x5e135c[_0x9b42('0x52')][_0x9b42('0xfa')]?{'id':_0x5e135c[_0x9b42('0x52')]['tag']}:undefined,'required':_0x5e135c[_0x9b42('0x52')][_0x9b42('0xfa')]?!![]:![]}];}return db[_0x9b42('0xb2')][_0x9b42('0x63')](_0xe4c986);})[_0x9b42('0x30')](function(_0x754524){_0x17ebdf['rows']=_0x754524;return _0x17ebdf;});}})['then'](respondWithFilteredResult(_0x1e5015,_0xe4c986))['catch'](handleError(_0x1e5015,null));};exports[_0x9b42('0xfb')]=function(_0x484ffe,_0x423cad){var _0x324ba5=0x0;var _0x40726f=0x0;var _0x30dd2d=![];var _0x1a442a;var _0x5b4636;return db[_0x9b42('0x4e')]['find']({'where':{'id':_0x484ffe[_0x9b42('0x65')]['id']},'include':[{'model':db[_0x9b42('0x92')],'as':_0x9b42('0x92'),'include':[{'model':db[_0x9b42('0x92')],'as':'Intervals','attributes':['id',_0x9b42('0xfc')]}]}]})[_0x9b42('0x30')](handleEntityNotFound(_0x423cad,null))[_0x9b42('0x30')](function(_0x227f39){if(_0x227f39){_0x1a442a=_0x227f39;return _0x227f39[_0x9b42('0xfd')]({'raw':!![]});}})[_0x9b42('0x30')](function(_0x142494){if(_0x1a442a){if(_0x142494){_0x5b4636=_0x142494;}}return require(_0x9b42('0xfe'))['getLicense']();})[_0x9b42('0x30')](function(_0x49c044){if(_0x49c044){_0x40726f=_0x49c044[_0x9b42('0xff')];_0x30dd2d=_0x49c044[_0x9b42('0x100')];}})[_0x9b42('0x30')](function(){return db[_0x9b42('0xb2')][_0x9b42('0x2b')]({'where':{'closed':![]}});})[_0x9b42('0x30')](function(_0x13faff){_0x324ba5=_0x13faff;if(_0x40726f&&_0x13faff>_0x40726f){return db[_0x9b42('0x101')][_0x9b42('0x79')]({'where':{'id':0x1}})[_0x9b42('0x30')](function(_0x41a00f){if(_0x41a00f){_0x41a00f[_0x9b42('0x102')](_0x9b42('0x103'));}});}})[_0x9b42('0x30')](function(){var _0x2c33e9=_0x1a442a[_0x9b42('0x92')];var _0x1bc1f9=_0x1a442a[_0x9b42('0x93')]||undefined;return _0x2c33e9?_0x2c33e9['ifTime'](_0x1bc1f9):!![];})[_0x9b42('0x30')](function(_0x5030ff){var _0x295807=fs[_0x9b42('0x104')](path[_0x9b42('0x88')](config[_0x9b42('0x89')],_0x9b42('0x105')),_0x9b42('0xd8'));var _0x4eaff1=_0x9b42('0x106');var _0x3b108f=![];try{const _0x19b224=new URL(_0x1a442a[_0x9b42('0x6b')]);_0x1a442a['address']=_0x19b224['origin'];}catch(_0x497cff){}var _0x39e3a9;if(_0x484ffe[_0x9b42('0xaf')][_0x9b42('0x3f')]){_0x484ffe[_0x9b42('0xaf')]['referer']=_0x484ffe[_0x9b42('0xaf')][_0x9b42('0x3f')][_0x9b42('0x107')](/\/$/,'');_0x39e3a9=wildcardUtils[_0x9b42('0x108')](_0x1a442a['address'],_0x484ffe[_0x9b42('0xaf')]['referer']);}else{_0x484ffe['headers'][_0x9b42('0x3f')]=_0x1a442a['address'];_0x39e3a9=!![];}var _0x2f033f={'chatVersion':_0x4eaff1,'chatWebsiteAddressOrigin':_0x39e3a9?_0x484ffe[_0x9b42('0xaf')][_0x9b42('0x3f')]:_0x1a442a[_0x9b42('0x6b')],'remote':_0x1a442a[_0x9b42('0x109')],'query':querystring[_0x9b42('0x10a')](_['merge'](_0x1a442a[_0x9b42('0x32')]({'plain':!![]}),{'customerIp':_0x484ffe[_0x9b42('0xaf')][_0x9b42('0x3a')]||_0x484ffe[_0x9b42('0xaf')]['x-real-ip']||_0x484ffe[_0x9b42('0x10b')][_0x9b42('0x10c')]||_0x484ffe['ip'],'referer':_0x484ffe[_0x9b42('0xaf')]['referer'],'openedInteractions':_0x324ba5,'maxInteractions':_0x40726f,'virtual':_0x30dd2d['virtual'],'online':_0x5030ff,'custom':_0x30dd2d,'address':_0x39e3a9?_0x484ffe['headers']['referer']:null}))[_0x9b42('0x107')](/'/g,'\x5c\x27')};_0x423cad['send'](ejs[_0x9b42('0x10d')](Mustache['render'](_0x295807,_0x2f033f),{'proactiveActions':_0x5b4636,'alignment':_0x1a442a[_0x9b42('0x10e')],'verticalAlignment':_0x1a442a[_0x9b42('0x10f')],'div_color':_0x1a442a[_0x9b42('0xf9')],'labelText':_0x1a442a[_0x9b42('0x110')],'text_color':_0x1a442a[_0x9b42('0x111')],'text_button_color':_0x1a442a['textButtonColor'],'button_color':_0x1a442a[_0x9b42('0x112')],'background_color':_0x1a442a['backgroundColor'],'hideWhenOffline':_0x1a442a[_0x9b42('0x113')],'intervalId':_0x1a442a[_0x9b42('0x114')],'isDevelopment':_0x3b108f,'chatVersion':_0x4eaff1}));})[_0x9b42('0x24')](handleError(_0x423cad,null));};exports['addApplications']=function(_0x5b5e58,_0x45c955){var _0x3bc2c5=_0x5b5e58['params']['id'];var _0x6e629d=_0x5b5e58[_0x9b42('0x6a')];var _0x49c1c2=0xc8;var _0x5eaad8=null;return db[_0x9b42('0x115')][_0x9b42('0x116')]({'isolationLevel':db[_0x9b42('0x115')][_0x9b42('0x117')][_0x9b42('0x118')][_0x9b42('0x119')]},function(_0x169289){return db[_0x9b42('0x4e')][_0x9b42('0x79')]({'where':{'id':_0x3bc2c5},'transaction':_0x169289})[_0x9b42('0x30')](function(_0x871f37){if(_0x871f37){return db['ChatApplication'][_0x9b42('0x31')]({'where':{'ChatWebsiteId':_0x3bc2c5},'transaction':_0x169289})[_0x9b42('0x30')](function(){var _0x1c1dfb=_[_0x9b42('0x4d')](_0x6e629d,function(_0x24d6e2){_0x24d6e2[_0x9b42('0x77')]=_0x3bc2c5;return _0x24d6e2;});return db[_0x9b42('0xa5')][_0x9b42('0xe3')](_0x1c1dfb,{'transaction':_0x169289});});}else{_0x49c1c2=0x194;_0x5eaad8=[];}});})['then'](function(){if(_0x49c1c2!==0x194){return db[_0x9b42('0xa5')][_0x9b42('0x11a')]({'where':{'ChatWebsiteId':_0x3bc2c5},'order':_0x9b42('0xab')})[_0x9b42('0x30')](function(_0x59325a){_0x5eaad8=_0x59325a;});}})['catch'](function(_0x10630d){_0x49c1c2=0x1f4;logger[_0x9b42('0x20')](_0x10630d[_0x9b42('0x11b')]);if(_0x10630d[_0x9b42('0x34')]){delete _0x10630d[_0x9b42('0x34')];}_0x5eaad8=_0x10630d;})[_0x9b42('0x11c')](function(){if(_0x5eaad8===null){_0x45c955[_0x9b42('0x25')](_0x49c1c2);}else{if(_0x49c1c2===0x1f4){_0x45c955[_0x9b42('0x26')](_0x49c1c2)[_0x9b42('0xd1')](_0x5eaad8);}else{_0x45c955['status'](_0x49c1c2)[_0x9b42('0x2e')](_0x5eaad8);}}});};exports[_0x9b42('0x11d')]=function(_0x323ccb,_0x5c1496){var _0x21f8e6={};var _0x1e101d={};var _0x365f38;var _0x513435;return db['ChatWebsite']['findOne']({'where':{'id':_0x323ccb[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x5c1496,null))[_0x9b42('0x30')](function(_0x311e86){if(_0x311e86){_0x365f38=_0x311e86;_0x1e101d[_0x9b42('0x46')]=_['keys'](db[_0x9b42('0xa5')][_0x9b42('0x4f')]);_0x1e101d[_0x9b42('0x52')]=_[_0x9b42('0x53')](_0x323ccb[_0x9b42('0x52')]);_0x1e101d[_0x9b42('0x54')]=_[_0x9b42('0x55')](_0x1e101d[_0x9b42('0x46')],_0x1e101d[_0x9b42('0x52')]);_0x21f8e6[_0x9b42('0x56')]=_[_0x9b42('0x55')](_0x1e101d[_0x9b42('0x46')],qs[_0x9b42('0x57')](_0x323ccb[_0x9b42('0x52')][_0x9b42('0x57')]));_0x21f8e6[_0x9b42('0x56')]=_0x21f8e6[_0x9b42('0x56')][_0x9b42('0x58')]?_0x21f8e6['attributes']:_0x1e101d[_0x9b42('0x46')];_0x21f8e6[_0x9b42('0x5b')]=qs[_0x9b42('0x5c')](_0x323ccb['query'][_0x9b42('0x5c')]);_0x21f8e6['where']=qs[_0x9b42('0x54')](_['pick'](_0x323ccb[_0x9b42('0x52')],_0x1e101d['filters']));if(_0x323ccb[_0x9b42('0x52')][_0x9b42('0x5f')]){_0x21f8e6[_0x9b42('0x5d')]=_[_0x9b42('0x60')](_0x21f8e6['where'],{'$or':_[_0x9b42('0x4d')](_0x21f8e6[_0x9b42('0x56')],function(_0x2e0f53){var _0x40cf89={};_0x40cf89[_0x2e0f53]={'$like':'%'+_0x323ccb['query'][_0x9b42('0x5f')]+'%'};return _0x40cf89;})});}_0x21f8e6=_[_0x9b42('0x60')]({},_0x21f8e6,_0x323ccb[_0x9b42('0x61')]);return _0x365f38[_0x9b42('0x11d')](_0x21f8e6);}})['then'](function(_0x48eedb){if(_0x48eedb){_0x513435=_0x48eedb['length'];if(!_0x323ccb[_0x9b42('0x52')][_0x9b42('0x59')](_0x9b42('0x5a'))){_0x21f8e6[_0x9b42('0x2a')]=qs[_0x9b42('0x2a')](_0x323ccb[_0x9b42('0x52')][_0x9b42('0x2a')]);_0x21f8e6[_0x9b42('0x28')]=qs[_0x9b42('0x28')](_0x323ccb[_0x9b42('0x52')][_0x9b42('0x28')]);}return _0x365f38[_0x9b42('0x11d')](_0x21f8e6);}})['then'](function(_0x2d43b7){if(_0x2d43b7){return _0x2d43b7?{'count':_0x513435,'rows':_0x2d43b7}:null;}})[_0x9b42('0x30')](respondWithResult(_0x5c1496,null))[_0x9b42('0x24')](handleError(_0x5c1496,null));};exports['addProactiveActions']=function(_0x3fc59e,_0xe2c033){return db[_0x9b42('0x11e')][_0x9b42('0x67')]({'where':{'id':_0x3fc59e[_0x9b42('0x65')]['id']}})['then'](handleEntityNotFound(_0xe2c033,null))['then'](function(_0x427942){if(_0x427942){return _0x427942[_0x9b42('0x11f')](_0x3fc59e[_0x9b42('0x6a')][_0x9b42('0x7c')],_['omit'](_0x3fc59e[_0x9b42('0x6a')],[_0x9b42('0x7c'),'id'])||{});}})[_0x9b42('0x30')](respondWithResult(_0xe2c033,null))[_0x9b42('0x24')](handleError(_0xe2c033,null));};exports[_0x9b42('0xfd')]=function(_0x259b4f,_0x1f931f){var _0x5b0e7e={};var _0x28d965={};var _0x2220e3;var _0x2758ca;return db['ChatWebsite']['findOne']({'where':{'id':_0x259b4f[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x1f931f,null))[_0x9b42('0x30')](function(_0x2b1e63){if(_0x2b1e63){_0x2220e3=_0x2b1e63;_0x28d965[_0x9b42('0x46')]=_['keys'](db[_0x9b42('0x120')][_0x9b42('0x4f')]);_0x28d965['query']=_[_0x9b42('0x53')](_0x259b4f[_0x9b42('0x52')]);_0x28d965[_0x9b42('0x54')]=_['intersection'](_0x28d965[_0x9b42('0x46')],_0x28d965[_0x9b42('0x52')]);_0x5b0e7e['attributes']=_[_0x9b42('0x55')](_0x28d965[_0x9b42('0x46')],qs[_0x9b42('0x57')](_0x259b4f[_0x9b42('0x52')][_0x9b42('0x57')]));_0x5b0e7e[_0x9b42('0x56')]=_0x5b0e7e[_0x9b42('0x56')][_0x9b42('0x58')]?_0x5b0e7e['attributes']:_0x28d965[_0x9b42('0x46')];_0x5b0e7e['order']=qs['sort'](_0x259b4f[_0x9b42('0x52')][_0x9b42('0x5c')]);_0x5b0e7e[_0x9b42('0x5d')]=qs['filters'](_[_0x9b42('0x5e')](_0x259b4f[_0x9b42('0x52')],_0x28d965[_0x9b42('0x54')]));if(_0x259b4f[_0x9b42('0x52')]['filter']){_0x5b0e7e[_0x9b42('0x5d')]=_[_0x9b42('0x60')](_0x5b0e7e['where'],{'$or':_[_0x9b42('0x4d')](_0x5b0e7e[_0x9b42('0x56')],function(_0x9f2b28){var _0x23862d={};_0x23862d[_0x9f2b28]={'$like':'%'+_0x259b4f[_0x9b42('0x52')]['filter']+'%'};return _0x23862d;})});}_0x5b0e7e=_[_0x9b42('0x60')]({},_0x5b0e7e,_0x259b4f[_0x9b42('0x61')]);return _0x2220e3['getProactiveActions'](_0x5b0e7e);}})['then'](function(_0x2888ab){if(_0x2888ab){_0x2758ca=_0x2888ab[_0x9b42('0x58')];if(!_0x259b4f['query'][_0x9b42('0x59')]('nolimit')){_0x5b0e7e[_0x9b42('0x2a')]=qs[_0x9b42('0x2a')](_0x259b4f[_0x9b42('0x52')]['limit']);_0x5b0e7e[_0x9b42('0x28')]=qs[_0x9b42('0x28')](_0x259b4f['query'][_0x9b42('0x28')]);}return _0x2220e3[_0x9b42('0xfd')](_0x5b0e7e);}})[_0x9b42('0x30')](function(_0x5c0b27){if(_0x5c0b27){return _0x5c0b27?{'count':_0x2758ca,'rows':_0x5c0b27}:null;}})[_0x9b42('0x30')](respondWithResult(_0x1f931f,null))[_0x9b42('0x24')](handleError(_0x1f931f,null));};exports[_0x9b42('0x121')]=function(_0x59b0b7,_0x251c36){var _0x1deeed=_0x59b0b7[_0x9b42('0x52')][_0x9b42('0x122')]===_0x9b42('0x123')?_0x9b42('0x124'):_0x9b42('0x125');return db[_0x9b42('0x4e')]['find']({'attributes':['id',_0x1deeed],'where':{'id':_0x59b0b7[_0x9b42('0x65')]['id']}})['then'](handleEntityNotFound(_0x251c36,null))[_0x9b42('0x30')](function(_0x32a512){if(_0x32a512){var _0x5d820b=_0x32a512[_0x1deeed];var _0x1a3999=_0x5d820b&&_0x5d820b[_0x9b42('0x126')]?_0x5d820b['items']:[];_0x251c36[_0x9b42('0xd1')]({'fromKey':_[_0x9b42('0x8a')](_0x5d820b['fromKey'])?undefined:_0x5d820b[_0x9b42('0x127')],'count':_0x1a3999['length'],'rows':_0x1a3999});}})[_0x9b42('0x24')](handleError(_0x251c36,null));};exports[_0x9b42('0x128')]=function(_0x1f9bae,_0x490346){var _0x1f9d24={'raw':![],'where':{}};var _0x2d9f71={};var _0x59d52c={'count':0x0,'rows':[]};return db[_0x9b42('0x4e')]['findOne']({'where':{'id':_0x1f9bae[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x490346,null))[_0x9b42('0x30')](function(_0x54dcf4){if(_0x54dcf4){_0x2d9f71['model']=_[_0x9b42('0x53')](db['ChatOfflineMessage']['rawAttributes']);_0x2d9f71[_0x9b42('0x52')]=_[_0x9b42('0x53')](_0x1f9bae[_0x9b42('0x52')]);_0x2d9f71['filters']=_[_0x9b42('0x55')](_0x2d9f71[_0x9b42('0x46')],_0x2d9f71[_0x9b42('0x52')]);_0x1f9d24['attributes']=_[_0x9b42('0x55')](_0x2d9f71[_0x9b42('0x46')],qs[_0x9b42('0x57')](_0x1f9bae['query'][_0x9b42('0x57')]));_0x1f9d24['attributes']=_0x1f9d24[_0x9b42('0x56')][_0x9b42('0x58')]?_0x1f9d24[_0x9b42('0x56')]:_0x2d9f71[_0x9b42('0x46')];if(!_0x1f9bae[_0x9b42('0x52')][_0x9b42('0x59')](_0x9b42('0x5a'))){_0x1f9d24['limit']=qs['limit'](_0x1f9bae[_0x9b42('0x52')][_0x9b42('0x2a')]);_0x1f9d24['offset']=qs['offset'](_0x1f9bae[_0x9b42('0x52')][_0x9b42('0x28')]);}_0x1f9d24[_0x9b42('0x5b')]=qs[_0x9b42('0x5c')](_0x1f9bae[_0x9b42('0x52')][_0x9b42('0x5c')]);_0x1f9d24['where']=qs['filters'](_['pick'](_0x1f9bae[_0x9b42('0x52')],_0x2d9f71['filters']));_0x1f9d24[_0x9b42('0x5d')][_0x9b42('0x77')]=_0x54dcf4['id'];if(_0x1f9bae['query']['filter']){_0x1f9d24[_0x9b42('0x5d')]=_[_0x9b42('0x60')](_0x1f9d24[_0x9b42('0x5d')],{'$or':_[_0x9b42('0x4d')](_0x1f9d24[_0x9b42('0x56')],function(_0x11b787){var _0x3915be={};_0x3915be[_0x11b787]={'$like':'%'+_0x1f9bae['query'][_0x9b42('0x5f')]+'%'};return _0x3915be;})});}_0x1f9d24=_[_0x9b42('0x60')]({},_0x1f9d24,_0x1f9bae[_0x9b42('0x61')]);return db['ChatOfflineMessage'][_0x9b42('0x2b')]({'where':_0x1f9d24[_0x9b42('0x5d')]})[_0x9b42('0x30')](function(_0x3185cd){_0x59d52c[_0x9b42('0x2b')]=_0x3185cd;if(_0x1f9bae['query']['includeAll']){_0x1f9d24[_0x9b42('0x66')]=[{'all':!![]}];}else{_0x1f9d24[_0x9b42('0x66')]=[{'model':db['CmContact'],'as':_0x9b42('0x129'),'required':![]},{'model':db[_0x9b42('0x12a')],'as':_0x9b42('0x12b'),'required':![]}];}return db[_0x9b42('0xda')][_0x9b42('0x63')](_0x1f9d24);})[_0x9b42('0x30')](function(_0x5ebef1){_0x59d52c['rows']=_0x5ebef1;return _0x59d52c;});}})[_0x9b42('0x30')](respondWithFilteredResult(_0x490346,_0x1f9d24))[_0x9b42('0x24')](handleError(_0x490346,null));};exports['addAgents']=function(_0x569ecd,_0x4d9b8b){return db[_0x9b42('0x4e')]['find']({'where':{'id':_0x569ecd[_0x9b42('0x65')]['id']}})['then'](handleEntityNotFound(_0x4d9b8b,null))[_0x9b42('0x30')](function(_0x15d696){if(_0x15d696){return _0x15d696[_0x9b42('0x12c')](_0x569ecd[_0x9b42('0x6a')]['ids'],_[_0x9b42('0x12d')](_0x569ecd[_0x9b42('0x6a')],[_0x9b42('0x7c'),'id'])||{})['spread'](function(_0x4827aa){for(var _0x4ea0dc=0x0;_0x4ea0dc<_0x569ecd['body']['ids'][_0x9b42('0x58')];_0x4ea0dc+=0x1){socket['emit'](_0x9b42('0x12e'),{'UserId':Number(_0x569ecd[_0x9b42('0x6a')]['ids'][_0x4ea0dc]),'ChatWebsiteId':Number(_0x569ecd['params']['id'])});}return _0x4827aa;});}})[_0x9b42('0x30')](respondWithResult(_0x4d9b8b,null))[_0x9b42('0x24')](handleError(_0x4d9b8b,null));};exports['removeAgents']=function(_0x47bde1,_0x5d6d48){return db[_0x9b42('0x4e')][_0x9b42('0x67')]({'where':{'id':_0x47bde1[_0x9b42('0x65')]['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0x5d6d48,null))[_0x9b42('0x30')](function(_0x4c4031){if(_0x4c4031){return _0x4c4031[_0x9b42('0x12f')](_0x47bde1[_0x9b42('0x52')]['ids'])['then'](function(){if(_[_0x9b42('0x130')](_0x47bde1['query'][_0x9b42('0x7c')])){for(var _0x1def5f=0x0;_0x1def5f<_0x47bde1[_0x9b42('0x52')][_0x9b42('0x7c')]['length'];_0x1def5f+=0x1){socket['emit'](_0x9b42('0x131'),{'UserId':Number(_0x47bde1[_0x9b42('0x52')][_0x9b42('0x7c')][_0x1def5f]),'ChatWebsiteId':Number(_0x47bde1['params']['id'])});}}else{socket[_0x9b42('0x132')](_0x9b42('0x131'),{'UserId':Number(_0x47bde1[_0x9b42('0x52')][_0x9b42('0x7c')]),'ChatWebsiteId':Number(_0x47bde1['params']['id'])});}});}})[_0x9b42('0x30')](respondWithStatusCode(_0x5d6d48,null))[_0x9b42('0x24')](handleError(_0x5d6d48,null));};exports[_0x9b42('0x133')]=function(_0x167d48,_0xa4159d){var _0x1ea965={};var _0x25e394={};var _0x31ae89;var _0x1e7ca7;return db['ChatWebsite'][_0x9b42('0x79')]({'where':{'id':_0x167d48['params']['id']}})[_0x9b42('0x30')](handleEntityNotFound(_0xa4159d,null))['then'](function(_0x2a42ed){if(_0x2a42ed){_0x31ae89=_0x2a42ed;_0x25e394[_0x9b42('0x46')]=_[_0x9b42('0x53')](db[_0x9b42('0xbf')]['rawAttributes']);_0x25e394['query']=_[_0x9b42('0x53')](_0x167d48[_0x9b42('0x52')]);_0x25e394[_0x9b42('0x54')]=_[_0x9b42('0x55')](_0x25e394[_0x9b42('0x46')],_0x25e394[_0x9b42('0x52')]);_0x1ea965[_0x9b42('0x56')]=_[_0x9b42('0x55')](_0x25e394[_0x9b42('0x46')],qs[_0x9b42('0x57')](_0x167d48['query'][_0x9b42('0x57')]));_0x1ea965[_0x9b42('0x56')]=_0x1ea965[_0x9b42('0x56')]['length']?_0x1ea965[_0x9b42('0x56')]:_0x25e394[_0x9b42('0x46')];_0x1ea965[_0x9b42('0x5b')]=qs[_0x9b42('0x5c')](_0x167d48[_0x9b42('0x52')][_0x9b42('0x5c')]);_0x1ea965[_0x9b42('0x5d')]=qs[_0x9b42('0x54')](_[_0x9b42('0x5e')](_0x167d48[_0x9b42('0x52')],_0x25e394['filters']));if(_0x167d48[_0x9b42('0x52')][_0x9b42('0x5f')]){_0x1ea965[_0x9b42('0x5d')]=_[_0x9b42('0x60')](_0x1ea965[_0x9b42('0x5d')],{'$or':_[_0x9b42('0x4d')](_0x1ea965[_0x9b42('0x56')],function(_0x7c2c60){var _0x5caae6={};_0x5caae6[_0x7c2c60]={'$like':'%'+_0x167d48[_0x9b42('0x52')][_0x9b42('0x5f')]+'%'};return _0x5caae6;})});}_0x1ea965=_['merge']({},_0x1ea965,_0x167d48['options']);return _0x31ae89[_0x9b42('0x133')](_0x1ea965);}})[_0x9b42('0x30')](function(_0xbd060b){if(_0xbd060b){_0x1e7ca7=_0xbd060b[_0x9b42('0x58')];if(!_0x167d48['query'][_0x9b42('0x59')](_0x9b42('0x5a'))){_0x1ea965[_0x9b42('0x2a')]=qs[_0x9b42('0x2a')](_0x167d48['query'][_0x9b42('0x2a')]);_0x1ea965[_0x9b42('0x28')]=qs[_0x9b42('0x28')](_0x167d48[_0x9b42('0x52')][_0x9b42('0x28')]);}return _0x31ae89[_0x9b42('0x133')](_0x1ea965);}})['then'](function(_0x28bcd0){if(_0x28bcd0){return _0x28bcd0?{'count':_0x1e7ca7,'rows':_0x28bcd0}:null;}})[_0x9b42('0x30')](respondWithResult(_0xa4159d,null))['catch'](handleError(_0xa4159d,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index bc7dd65..ea91285 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 _0x85d8=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x1fc27e,_0x52402c){var _0x252a06=function(_0x53fa6f){while(--_0x53fa6f){_0x1fc27e['push'](_0x1fc27e['shift']());}};_0x252a06(++_0x52402c);}(_0x85d8,0x1b0));var _0x885d=function(_0x2471fe,_0x3f7322){_0x2471fe=_0x2471fe-0x0;var _0x43a604=_0x85d8[_0x2471fe];return _0x43a604;};'use strict';var EventEmitter=require(_0x885d('0x0'));var ChatWebsite=require(_0x885d('0x1'))['db'][_0x885d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x885d('0x3')](0x0);var events={'afterCreate':_0x885d('0x4'),'afterUpdate':'update','afterDestroy':_0x885d('0x5')};function emitEvent(_0x212c26){return function(_0x320d7d,_0x3fe8a0,_0x50cb53){ChatWebsiteEvents['emit'](_0x212c26+':'+_0x320d7d['id'],_0x320d7d);ChatWebsiteEvents[_0x885d('0x6')](_0x212c26,_0x320d7d);_0x50cb53(null);};}for(var e in events){if(events[_0x885d('0x7')](e)){var event=events[e];ChatWebsite[_0x885d('0x8')](e,emitEvent(event));}}module[_0x885d('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xff96=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x51310f,_0x5a9dcf){var _0x24b7ae=function(_0x382f74){while(--_0x382f74){_0x51310f['push'](_0x51310f['shift']());}};_0x24b7ae(++_0x5a9dcf);}(_0xff96,0x179));var _0x6ff9=function(_0x5b474c,_0x426d87){_0x5b474c=_0x5b474c-0x0;var _0x273b2c=_0xff96[_0x5b474c];return _0x273b2c;};'use strict';var EventEmitter=require(_0x6ff9('0x0'));var ChatWebsite=require(_0x6ff9('0x1'))['db'][_0x6ff9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6ff9('0x3')](0x0);var events={'afterCreate':_0x6ff9('0x4'),'afterUpdate':_0x6ff9('0x5'),'afterDestroy':_0x6ff9('0x6')};function emitEvent(_0x1a81c5){return function(_0x3561d7,_0x207c06,_0x874737){ChatWebsiteEvents[_0x6ff9('0x7')](_0x1a81c5+':'+_0x3561d7['id'],_0x3561d7);ChatWebsiteEvents['emit'](_0x1a81c5,_0x3561d7);_0x874737(null);};}for(var e in events){if(events[_0x6ff9('0x8')](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 d5190c8..4fa09d3 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 _0xa48f=['ChatWebsite','chat_websites','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x58736a,_0x5d0121){var _0x4518e2=function(_0x2d9433){while(--_0x2d9433){_0x58736a['push'](_0x58736a['shift']());}};_0x4518e2(++_0x5d0121);}(_0xa48f,0x7a));var _0xfa48=function(_0x44e892,_0x12a6db){_0x44e892=_0x44e892-0x0;var _0x5d8324=_0xa48f[_0x44e892];return _0x5d8324;};'use strict';var _=require(_0xfa48('0x0'));var util=require(_0xfa48('0x1'));var logger=require(_0xfa48('0x2'))(_0xfa48('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfa48('0x4'));var fs=require('fs');var path=require(_0xfa48('0x5'));var rimraf=require(_0xfa48('0x6'));var config=require(_0xfa48('0x7'));var attributes=require(_0xfa48('0x8'));module[_0xfa48('0x9')]=function(_0x33bf73,_0x595a82){return _0x33bf73['define'](_0xfa48('0xa'),attributes,{'tableName':_0xfa48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x92a9=['ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x50fe0f,_0x52b096){var _0x8e5d6c=function(_0xcb9ca){while(--_0xcb9ca){_0x50fe0f['push'](_0x50fe0f['shift']());}};_0x8e5d6c(++_0x52b096);}(_0x92a9,0x1f0));var _0x992a=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x92a9[_0x172747];return _0x509692;};'use strict';var _=require('lodash');var util=require(_0x992a('0x0'));var logger=require(_0x992a('0x1'))(_0x992a('0x2'));var moment=require(_0x992a('0x3'));var BPromise=require(_0x992a('0x4'));var rp=require(_0x992a('0x5'));var fs=require('fs');var path=require(_0x992a('0x6'));var rimraf=require(_0x992a('0x7'));var config=require(_0x992a('0x8'));var attributes=require('./chatWebsite.attributes');module[_0x992a('0x9')]=function(_0x5bcf05,_0x558ef2){return _0x5bcf05[_0x992a('0xa')](_0x992a('0xb'),attributes,{'tableName':_0x992a('0xc'),'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 01fb927..52820d7 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 _0x57a5=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x92a52c,_0x46a240){var _0x53491d=function(_0x197668){while(--_0x197668){_0x92a52c['push'](_0x92a52c['shift']());}};_0x53491d(++_0x46a240);}(_0x57a5,0xc1));var _0x557a=function(_0x39f28f,_0x352bf1){_0x39f28f=_0x39f28f-0x0;var _0x595e11=_0x57a5[_0x39f28f];return _0x595e11;};'use strict';var _=require(_0x557a('0x0'));var util=require(_0x557a('0x1'));var moment=require(_0x557a('0x2'));var BPromise=require(_0x557a('0x3'));var rs=require(_0x557a('0x4'));var fs=require('fs');var Redis=require(_0x557a('0x5'));var db=require(_0x557a('0x6'))['db'];var utils=require(_0x557a('0x7'));var logger=require('../../config/logger')(_0x557a('0x8'));var config=require(_0x557a('0x9'));var jayson=require(_0x557a('0xa'));var client=jayson['client'][_0x557a('0xb')]({'port':0x232a});config[_0x557a('0xc')]=_[_0x557a('0xd')](config[_0x557a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x557a('0xe'))(new Redis(config[_0x557a('0xc')]));require(_0x557a('0xf'))[_0x557a('0x10')](socket);function respondWithRpcPromise(_0x128530,_0x3da554,_0x5a4285){return new BPromise(function(_0x3300d4,_0x24021d){return client['request'](_0x128530,_0x5a4285)[_0x557a('0x11')](function(_0x403f49){logger[_0x557a('0x12')](_0x557a('0x13'),_0x3da554,_0x557a('0x14'));logger[_0x557a('0x15')](_0x557a('0x16'),_0x3da554,'request\x20sent',JSON['stringify'](_0x403f49));if(_0x403f49[_0x557a('0x17')]){if(_0x403f49['error'][_0x557a('0x18')]===0x1f4){logger[_0x557a('0x17')](_0x557a('0x13'),_0x3da554,_0x403f49[_0x557a('0x17')][_0x557a('0x19')]);return _0x24021d(_0x403f49[_0x557a('0x17')][_0x557a('0x19')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3da554,_0x403f49[_0x557a('0x17')][_0x557a('0x19')]);return _0x3300d4(_0x403f49[_0x557a('0x17')][_0x557a('0x19')]);}else{logger['info'](_0x557a('0x13'),_0x3da554,'request\x20sent');_0x3300d4(_0x403f49[_0x557a('0x1a')][_0x557a('0x19')]);}})['catch'](function(_0x59dd38){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3da554,_0x59dd38);_0x24021d(_0x59dd38);});});}
\ No newline at end of file
+var _0x28f1=['randomstring','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','request\x20sent','debug','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x182094,_0x269200){var _0x2e74ff=function(_0x41b982){while(--_0x41b982){_0x182094['push'](_0x182094['shift']());}};_0x2e74ff(++_0x269200);}(_0x28f1,0x8c));var _0x128f=function(_0x23bf0b,_0xf80021){_0x23bf0b=_0x23bf0b-0x0;var _0x1136ab=_0x28f1[_0x23bf0b];return _0x1136ab;};'use strict';var _=require(_0x128f('0x0'));var util=require(_0x128f('0x1'));var moment=require(_0x128f('0x2'));var BPromise=require(_0x128f('0x3'));var rs=require(_0x128f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x128f('0x5'));var jayson=require(_0x128f('0x6'));var client=jayson[_0x128f('0x7')]['http']({'port':0x232a});config[_0x128f('0x8')]=_[_0x128f('0x9')](config['redis'],{'host':_0x128f('0xa'),'port':0x18eb});var socket=require(_0x128f('0xb'))(new Redis(config[_0x128f('0x8')]));require(_0x128f('0xc'))[_0x128f('0xd')](socket);function respondWithRpcPromise(_0x5f0181,_0x3248e4,_0x353519){return new BPromise(function(_0x1ae6a2,_0x196fa2){return client[_0x128f('0xe')](_0x5f0181,_0x353519)['then'](function(_0x138b82){logger[_0x128f('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x3248e4,_0x128f('0x10'));logger[_0x128f('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3248e4,'request\x20sent',JSON['stringify'](_0x138b82));if(_0x138b82[_0x128f('0x12')]){if(_0x138b82[_0x128f('0x12')][_0x128f('0x13')]===0x1f4){logger['error'](_0x128f('0x14'),_0x3248e4,_0x138b82[_0x128f('0x12')]['message']);return _0x196fa2(_0x138b82[_0x128f('0x12')][_0x128f('0x15')]);}logger[_0x128f('0x12')](_0x128f('0x14'),_0x3248e4,_0x138b82['error']['message']);return _0x1ae6a2(_0x138b82[_0x128f('0x12')][_0x128f('0x15')]);}else{logger[_0x128f('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x3248e4,_0x128f('0x10'));_0x1ae6a2(_0x138b82[_0x128f('0x16')]['message']);}})[_0x128f('0x17')](function(_0x2e5f5f){logger[_0x128f('0x12')](_0x128f('0x14'),_0x3248e4,_0x2e5f5f);_0x196fa2(_0x2e5f5f);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index bd23966..efe6152 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 _0xdac9=['update','emit','removeListener','register','length','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdac9,0x1a9));var _0x9dac=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0xdac9[_0x2605dc];return _0x4568c9;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x9dac('0x0'),'remove',_0x9dac('0x1')];function createListener(_0xd31622,_0x1b3027){return function(_0x4a75d8){_0x1b3027[_0x9dac('0x2')](_0xd31622,_0x4a75d8);};}function removeListener(_0x1a0e93,_0x74b2ac){return function(){ChatWebsiteEvents[_0x9dac('0x3')](_0x1a0e93,_0x74b2ac);};}exports[_0x9dac('0x4')]=function(_0x254dac){for(var _0x13e4e1=0x0,_0x3c1c56=events[_0x9dac('0x5')];_0x13e4e1<_0x3c1c56;_0x13e4e1++){var _0x9c3a50=events[_0x13e4e1];var _0x4a6218=createListener('chatWebsite:'+_0x9c3a50,_0x254dac);ChatWebsiteEvents['on'](_0x9c3a50,_0x4a6218);}};
\ No newline at end of file
+var _0xa0ea=['update','emit','removeListener','register','save','remove'];(function(_0x213107,_0x2b3d1a){var _0x247584=function(_0x5d3fb2){while(--_0x5d3fb2){_0x213107['push'](_0x213107['shift']());}};_0x247584(++_0x2b3d1a);}(_0xa0ea,0x100));var _0xaa0e=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0xa0ea[_0x725a4c];return _0x37b2cc;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xaa0e('0x0'),_0xaa0e('0x1'),_0xaa0e('0x2')];function createListener(_0x238ba5,_0x149fab){return function(_0x4b66f2){_0x149fab[_0xaa0e('0x3')](_0x238ba5,_0x4b66f2);};}function removeListener(_0xd81fc4,_0x1b67df){return function(){ChatWebsiteEvents[_0xaa0e('0x4')](_0xd81fc4,_0x1b67df);};}exports[_0xaa0e('0x5')]=function(_0x2f4f1a){for(var _0x4be6eb=0x0,_0x476a26=events['length'];_0x4be6eb<_0x476a26;_0x4be6eb++){var _0x2ec8c2=events[_0x4be6eb];var _0x51fdf9=createListener('chatWebsite:'+_0x2ec8c2,_0x2f4f1a);ChatWebsiteEvents['on'](_0x2ec8c2,_0x51fdf9);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 8f114a4..75b2e11 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7794=['replace','localhost','test','exports','escapeRegExp','url','URL'];(function(_0x566c77,_0x305564){var _0x165ade=function(_0x20417e){while(--_0x20417e){_0x566c77['push'](_0x566c77['shift']());}};_0x165ade(++_0x305564);}(_0x7794,0x7b));var _0x4779=function(_0x411ca8,_0x319708){_0x411ca8=_0x411ca8-0x0;var _0x1ef3fc=_0x7794[_0x411ca8];return _0x1ef3fc;};var escapeRegExp=require('../../../utils/misc')[_0x4779('0x0')];var URL=require(_0x4779('0x1'))[_0x4779('0x2')];function testWildcardValidity(_0xa47992){let _0x493318=!![];try{new URL(_0xa47992[_0x4779('0x3')]('*',_0x4779('0x4')));}catch(_0x4d3b05){_0x493318=![];}return _0x493318&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x4779('0x5')](_0xa47992);}function testWebsiteWithWildcard(_0x54dc7f,_0x59d1bf){let _0x53fd58;const _0x45cd71=escapeRegExp(_0x54dc7f)[_0x4779('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x54dc7f[_0x4779('0x3')]('\x5c*',_0x4779('0x4')));_0x53fd58=new RegExp(_0x45cd71)[_0x4779('0x5')](_0x59d1bf);}catch(_0x20e2af){_0x53fd58=![];}return _0x53fd58;}module[_0x4779('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x593e=['replace','localhost','test','([\x5cw]+)','exports','../../../utils/misc','escapeRegExp','url','URL'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x593e,0xcb));var _0xe593=function(_0xfac42c,_0x193713){_0xfac42c=_0xfac42c-0x0;var _0x1e6340=_0x593e[_0xfac42c];return _0x1e6340;};var escapeRegExp=require(_0xe593('0x0'))[_0xe593('0x1')];var URL=require(_0xe593('0x2'))[_0xe593('0x3')];function testWildcardValidity(_0x43dabb){let _0x184a6b=!![];try{new URL(_0x43dabb[_0xe593('0x4')]('*',_0xe593('0x5')));}catch(_0x550574){_0x184a6b=![];}return _0x184a6b&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xe593('0x6')](_0x43dabb);}function testWebsiteWithWildcard(_0x2475f5,_0x404e3a){let _0x1e50d3;const _0x3b7082=escapeRegExp(_0x2475f5)[_0xe593('0x4')]('\x5c*',_0xe593('0x7'));try{new URL(_0x2475f5[_0xe593('0x4')]('\x5c*',_0xe593('0x5')));_0x1e50d3=new RegExp(_0x3b7082)[_0xe593('0x6')](_0x404e3a);}catch(_0x51b862){_0x1e50d3=![];}return _0x1e50d3;}module[_0xe593('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 18a7d48..bea3044 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 _0xc0c4=['ensureDir','replace','extname','any','/:id/interactions','addInteraction','/:id/proactive_actions','addProactiveActions','update','destroy','delete','removeDispositions','removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','create','post','/:id/dispositions','addDisposition','addAnswer','join','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','diskStorage','root','server/files/images/avatars/','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xc0c4,0x171));var _0x4c0c=function(_0x255c47,_0x33c250){_0x255c47=_0x255c47-0x0;var _0x21a7e9=_0xc0c4[_0x255c47];return _0x21a7e9;};'use strict';var multer=require(_0x4c0c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4c0c('0x1'));var express=require('express');var router=express[_0x4c0c('0x2')]();var fs_extra=require(_0x4c0c('0x3'));var auth=require(_0x4c0c('0x4'));var interaction=require(_0x4c0c('0x5'));var config=require('../../config/environment');var controller=require(_0x4c0c('0x6'));router[_0x4c0c('0x7')]('/',auth[_0x4c0c('0x8')](),controller[_0x4c0c('0x9')]);router[_0x4c0c('0x7')](_0x4c0c('0xa'),auth[_0x4c0c('0x8')](),controller[_0x4c0c('0xb')]);router[_0x4c0c('0x7')](_0x4c0c('0xc'),auth[_0x4c0c('0x8')](),controller[_0x4c0c('0xd')]);router[_0x4c0c('0x7')]('/:id/dispositions',auth[_0x4c0c('0x8')](),controller['getDispositions']);router[_0x4c0c('0x7')](_0x4c0c('0xe'),auth['isAuthenticated'](),controller[_0x4c0c('0xf')]);router[_0x4c0c('0x7')](_0x4c0c('0x10'),controller[_0x4c0c('0x11')]);router[_0x4c0c('0x7')](_0x4c0c('0x12'),controller['getAvatar']);router['get'](_0x4c0c('0x13'),controller[_0x4c0c('0x14')]);router[_0x4c0c('0x7')](_0x4c0c('0x15'),controller[_0x4c0c('0x16')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x4c0c('0x17')]);router['get'](_0x4c0c('0x18'),controller[_0x4c0c('0x19')]);router[_0x4c0c('0x7')](_0x4c0c('0x1a'),auth['isAuthenticated'](),controller[_0x4c0c('0x1b')]);router[_0x4c0c('0x7')]('/:id/proactive_actions',auth[_0x4c0c('0x8')](),controller[_0x4c0c('0x1c')]);router['get'](_0x4c0c('0x1d'),controller[_0x4c0c('0x1e')]);router[_0x4c0c('0x7')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x4c0c('0x1f')]);router[_0x4c0c('0x7')](_0x4c0c('0x20'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x4c0c('0x8')](),controller[_0x4c0c('0x21')]);router[_0x4c0c('0x22')](_0x4c0c('0x23'),auth[_0x4c0c('0x8')](),controller[_0x4c0c('0x24')]);router[_0x4c0c('0x22')](_0x4c0c('0xe'),auth[_0x4c0c('0x8')](),controller[_0x4c0c('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dfea5,_0x438c59,_0x8eaba8){_0x8eaba8(null,path[_0x4c0c('0x26')](config['root'],_0x4c0c('0x27')));},'filename':function(_0x4259fc,_0x44fd86,_0x5c7d6a){_0x5c7d6a(null,util[_0x4c0c('0x28')](_0x4c0c('0x29'),Date['now'](),_0x44fd86[_0x4c0c('0x2a')]));}})});router[_0x4c0c('0x22')](_0x4c0c('0x10'),upload[_0x4c0c('0x2b')](_0x4c0c('0x2c')),controller[_0x4c0c('0x2d')]);var upload=multer({'storage':multer[_0x4c0c('0x2e')]({'destination':function(_0x46e5d5,_0x5cd999,_0x258c5d){_0x258c5d(null,path[_0x4c0c('0x26')](config[_0x4c0c('0x2f')],_0x4c0c('0x30')));},'filename':function(_0x1fe6c7,_0x182dfc,_0x3e6c55){_0x3e6c55(null,util[_0x4c0c('0x28')](_0x4c0c('0x29'),Date['now'](),_0x182dfc[_0x4c0c('0x2a')]));}})});router['post']('/:id/avatar',upload[_0x4c0c('0x2b')](_0x4c0c('0x2c')),controller[_0x4c0c('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x175c40,_0x456792,_0x2aa7c3){_0x2aa7c3(null,path[_0x4c0c('0x26')](config[_0x4c0c('0x2f')],_0x4c0c('0x30')));},'filename':function(_0x152d4e,_0x37047a,_0x574d52){_0x574d52(null,util[_0x4c0c('0x28')]('%s-%s',Date[_0x4c0c('0x32')](),_0x37047a['originalname']));}})});router[_0x4c0c('0x22')](_0x4c0c('0x13'),upload[_0x4c0c('0x2b')]('file'),controller[_0x4c0c('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x494849,_0x56e52c,_0x293eca){_0x293eca(null,path[_0x4c0c('0x26')](config[_0x4c0c('0x2f')],_0x4c0c('0x30')));},'filename':function(_0x2d4254,_0x3b73e4,_0x4a2ed0){_0x4a2ed0(null,util[_0x4c0c('0x28')](_0x4c0c('0x29'),Date[_0x4c0c('0x32')](),_0x3b73e4[_0x4c0c('0x2a')]));}})});router[_0x4c0c('0x22')](_0x4c0c('0x15'),upload[_0x4c0c('0x2b')](_0x4c0c('0x2c')),controller[_0x4c0c('0x34')]);router[_0x4c0c('0x22')](_0x4c0c('0x35'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x31bd8d,_0x4b9b1c,_0x22e40e){const _0x19a8b9=path['join'](config[_0x4c0c('0x2f')],_0x4c0c('0x36'),_0x4c0c('0x37'),_0x4c0c('0x38'));fs_extra[_0x4c0c('0x39')](_0x19a8b9,function(){_0x22e40e(null,_0x19a8b9);});},'filename':function(_0x399e42,_0x27d53c,_0x110f0d){const _0x21981e=_0x27d53c[_0x4c0c('0x2a')][_0x4c0c('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x675e11=path[_0x4c0c('0x3b')](_0x21981e);const _0x545e62=Date['now']()+'-'+_0x21981e[_0x4c0c('0x3a')](_0x675e11,'')+_0x675e11;_0x110f0d(null,_0x545e62);}})});router[_0x4c0c('0x22')]('/:id/offline',offlineUploadMulter[_0x4c0c('0x3c')](),controller['offline']);router[_0x4c0c('0x22')](_0x4c0c('0x3d'),auth[_0x4c0c('0x8')](),controller[_0x4c0c('0x3e')]);router[_0x4c0c('0x22')](_0x4c0c('0x1a'),auth[_0x4c0c('0x8')](),controller['addApplications']);router[_0x4c0c('0x22')](_0x4c0c('0x3f'),auth['isAuthenticated'](),controller[_0x4c0c('0x40')]);router['post'](_0x4c0c('0x20'),auth[_0x4c0c('0x8')](),controller['addAgents']);router['put'](_0x4c0c('0xc'),auth[_0x4c0c('0x8')](),controller[_0x4c0c('0x41')]);router['delete'](_0x4c0c('0xc'),auth[_0x4c0c('0x8')](),controller[_0x4c0c('0x42')]);router[_0x4c0c('0x43')](_0x4c0c('0x23'),auth[_0x4c0c('0x8')](),controller[_0x4c0c('0x44')]);router[_0x4c0c('0x43')]('/:id/canned_answers',auth[_0x4c0c('0x8')](),controller['removeAnswers']);router[_0x4c0c('0x43')]('/:id/users',auth['isAuthenticated'](),controller[_0x4c0c('0x45')]);module[_0x4c0c('0x46')]=router;
\ No newline at end of file
+var _0x99c8=['file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','extname','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single'];(function(_0x393b9e,_0x2023b2){var _0x24540b=function(_0x103cc4){while(--_0x103cc4){_0x393b9e['push'](_0x393b9e['shift']());}};_0x24540b(++_0x2023b2);}(_0x99c8,0x179));var _0x899c=function(_0xf8ddf5,_0x5352e7){_0xf8ddf5=_0xf8ddf5-0x0;var _0x5a02d7=_0x99c8[_0xf8ddf5];return _0x5a02d7;};'use strict';var multer=require(_0x899c('0x0'));var util=require(_0x899c('0x1'));var path=require(_0x899c('0x2'));var timeout=require(_0x899c('0x3'));var express=require(_0x899c('0x4'));var router=express[_0x899c('0x5')]();var fs_extra=require(_0x899c('0x6'));var auth=require(_0x899c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x899c('0x8'));var controller=require(_0x899c('0x9'));router['get']('/',auth[_0x899c('0xa')](),controller['index']);router[_0x899c('0xb')](_0x899c('0xc'),auth[_0x899c('0xa')](),controller[_0x899c('0xd')]);router['get'](_0x899c('0xe'),auth[_0x899c('0xa')](),controller[_0x899c('0xf')]);router[_0x899c('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x899c('0x10')]);router[_0x899c('0xb')](_0x899c('0x11'),auth['isAuthenticated'](),controller[_0x899c('0x12')]);router[_0x899c('0xb')](_0x899c('0x13'),controller['getLogo']);router[_0x899c('0xb')]('/:id/avatar',controller[_0x899c('0x14')]);router[_0x899c('0xb')](_0x899c('0x15'),controller[_0x899c('0x16')]);router[_0x899c('0xb')](_0x899c('0x17'),controller['getSystemAvatar']);router[_0x899c('0xb')](_0x899c('0x18'),auth[_0x899c('0xa')](),controller[_0x899c('0x19')]);router[_0x899c('0xb')]('/:id/snippet',controller[_0x899c('0x1a')]);router[_0x899c('0xb')](_0x899c('0x1b'),auth['isAuthenticated'](),controller[_0x899c('0x1c')]);router['get'](_0x899c('0x1d'),auth[_0x899c('0xa')](),controller[_0x899c('0x1e')]);router['get'](_0x899c('0x1f'),controller[_0x899c('0x20')]);router['get'](_0x899c('0x21'),auth[_0x899c('0xa')](),controller['getOfflineMessages']);router[_0x899c('0xb')](_0x899c('0x22'),auth[_0x899c('0xa')](),controller[_0x899c('0x23')]);router['post']('/',auth[_0x899c('0xa')](),controller[_0x899c('0x24')]);router[_0x899c('0x25')]('/:id/dispositions',auth[_0x899c('0xa')](),controller[_0x899c('0x26')]);router[_0x899c('0x25')](_0x899c('0x11'),auth[_0x899c('0xa')](),controller[_0x899c('0x27')]);var upload=multer({'storage':multer[_0x899c('0x28')]({'destination':function(_0x4be7ac,_0x19d815,_0x961038){_0x961038(null,path[_0x899c('0x29')](config[_0x899c('0x2a')],_0x899c('0x2b')));},'filename':function(_0x1da85e,_0x211e5e,_0x2b9a38){_0x2b9a38(null,util[_0x899c('0x2c')](_0x899c('0x2d'),Date[_0x899c('0x2e')](),_0x211e5e[_0x899c('0x2f')]));}})});router[_0x899c('0x25')](_0x899c('0x13'),upload[_0x899c('0x30')](_0x899c('0x31')),controller[_0x899c('0x32')]);var upload=multer({'storage':multer[_0x899c('0x28')]({'destination':function(_0x20368f,_0x4ebe4e,_0x471679){_0x471679(null,path[_0x899c('0x29')](config['root'],_0x899c('0x33')));},'filename':function(_0x503a82,_0x2efa17,_0x30d7b3){_0x30d7b3(null,util['format'](_0x899c('0x2d'),Date[_0x899c('0x2e')](),_0x2efa17[_0x899c('0x2f')]));}})});router['post']('/:id/avatar',upload['single']('file'),controller[_0x899c('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52af1c,_0x3e2340,_0x2bebc3){_0x2bebc3(null,path[_0x899c('0x29')](config[_0x899c('0x2a')],_0x899c('0x33')));},'filename':function(_0x8b219f,_0x3b3e03,_0x1b9944){_0x1b9944(null,util['format'](_0x899c('0x2d'),Date[_0x899c('0x2e')](),_0x3b3e03[_0x899c('0x2f')]));}})});router['post'](_0x899c('0x15'),upload[_0x899c('0x30')](_0x899c('0x31')),controller[_0x899c('0x35')]);var upload=multer({'storage':multer[_0x899c('0x28')]({'destination':function(_0x34af6e,_0x57153c,_0x21dc25){_0x21dc25(null,path[_0x899c('0x29')](config[_0x899c('0x2a')],_0x899c('0x33')));},'filename':function(_0x3f5ba6,_0x45fa7d,_0x2cbfba){_0x2cbfba(null,util[_0x899c('0x2c')]('%s-%s',Date[_0x899c('0x2e')](),_0x45fa7d[_0x899c('0x2f')]));}})});router[_0x899c('0x25')](_0x899c('0x17'),upload['single'](_0x899c('0x31')),controller['addSystemAvatar']);router[_0x899c('0x25')](_0x899c('0x36'),controller[_0x899c('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0xfd5feb,_0x59dd6a,_0x389082){const _0x12ff0b=path[_0x899c('0x29')](config[_0x899c('0x2a')],'server/files','attachments',_0x899c('0x38'));fs_extra[_0x899c('0x39')](_0x12ff0b,function(){_0x389082(null,_0x12ff0b);});},'filename':function(_0x2a6eee,_0x3831ed,_0x4d5689){const _0x51f5cb=_0x3831ed[_0x899c('0x2f')][_0x899c('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5f2714=path[_0x899c('0x3b')](_0x51f5cb);const _0x2a6f83=Date[_0x899c('0x2e')]()+'-'+_0x51f5cb['replace'](_0x5f2714,'')+_0x5f2714;_0x4d5689(null,_0x2a6f83);}})});router['post']('/:id/offline',offlineUploadMulter[_0x899c('0x3c')](),controller['offline']);router['post'](_0x899c('0x18'),auth[_0x899c('0xa')](),controller[_0x899c('0x3d')]);router[_0x899c('0x25')](_0x899c('0x1b'),auth[_0x899c('0xa')](),controller[_0x899c('0x3e')]);router[_0x899c('0x25')]('/:id/proactive_actions',auth[_0x899c('0xa')](),controller[_0x899c('0x3f')]);router['post'](_0x899c('0x22'),auth[_0x899c('0xa')](),controller[_0x899c('0x40')]);router[_0x899c('0x41')](_0x899c('0xe'),auth['isAuthenticated'](),controller[_0x899c('0x42')]);router[_0x899c('0x43')]('/:id',auth[_0x899c('0xa')](),controller[_0x899c('0x44')]);router[_0x899c('0x43')]('/:id/dispositions',auth[_0x899c('0xa')](),controller['removeDispositions']);router[_0x899c('0x43')](_0x899c('0x11'),auth['isAuthenticated'](),controller[_0x899c('0x45')]);router[_0x899c('0x43')](_0x899c('0x22'),auth[_0x899c('0xa')](),controller[_0x899c('0x46')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 9f0f08c..6dbbf20 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 _0xc466=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production'];(function(_0xce48e5,_0x5e798b){var _0x1aa613=function(_0x5bd51a){while(--_0x5bd51a){_0xce48e5['push'](_0xce48e5['shift']());}};_0x1aa613(++_0x5e798b);}(_0xc466,0xbd));var _0x6c46=function(_0x90e312,_0x4deaf4){_0x90e312=_0x90e312-0x0;var _0xe11402=_0xc466[_0x90e312];return _0xe11402;};var beaverLogger=require(_0x6c46('0x0'));var express=require('express');var auth=require(_0x6c46('0x1'));var config=require(_0x6c46('0x2'));var router=express[_0x6c46('0x3')]();var isProduction=config[_0x6c46('0x4')]===_0x6c46('0x5')||![];function clientSideLogs(_0x17c2b6,_0x580520,_0x38d080){var _0x560b6e=_0x17c2b6[_0x6c46('0x6')][_0x6c46('0x7')](_0x6c46('0x8'));if(!_0x560b6e){throw new Error(_0x6c46('0x9'));}return beaverLogger[_0x6c46('0xa')]({'uri':_0x6c46('0xb'),'logger':_0x560b6e,'enableCors':!isProduction})(_0x17c2b6,_0x580520,_0x38d080);}router[_0x6c46('0xc')](auth[_0x6c46('0xd')](),clientSideLogs);module[_0x6c46('0xe')]=router;
\ No newline at end of file
+var _0xe315=['use','exports','beaver-logger/server','express','Router','production','app','get','Client-Side\x20logger\x20not\x20found!','/client-logs'];(function(_0x230a30,_0x386c72){var _0xc80173=function(_0x9cfa65){while(--_0x9cfa65){_0x230a30['push'](_0x230a30['shift']());}};_0xc80173(++_0x386c72);}(_0xe315,0x110));var _0x5e31=function(_0x51e011,_0x5abb6e){_0x51e011=_0x51e011-0x0;var _0x5d9aa3=_0xe315[_0x51e011];return _0x5d9aa3;};var beaverLogger=require(_0x5e31('0x0'));var express=require(_0x5e31('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x5e31('0x2')]();var isProduction=config['env']===_0x5e31('0x3')||![];function clientSideLogs(_0xa809a7,_0x3ccc0f,_0x395871){var _0x90cd50=_0xa809a7[_0x5e31('0x4')][_0x5e31('0x5')]('client-side-logger');if(!_0x90cd50){throw new Error(_0x5e31('0x6'));}return beaverLogger['expressEndpoint']({'uri':_0x5e31('0x7'),'logger':_0x90cd50,'enableCors':!isProduction})(_0xa809a7,_0x3ccc0f,_0x395871);}router[_0x5e31('0x8')](auth['isAuthenticated'](),clientSideLogs);module[_0x5e31('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index f7b2c84..232ad9e 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 _0x2567=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','ENUM','AmazonAWS','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2567,0x163));var _0x7256=function(_0x43028e,_0x33a648){_0x43028e=_0x43028e-0x0;var _0x2fed6d=_0x2567[_0x43028e];return _0x2fed6d;};'use strict';var Sequelize=require(_0x7256('0x0'));module[_0x7256('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7256('0x2')](_0x7256('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7256('0x2')](_0x7256('0x4'),_0x7256('0x5'))},'data1':{'type':Sequelize[_0x7256('0x6')],'comment':_0x7256('0x7')},'data2':{'type':Sequelize[_0x7256('0x6')],'comment':_0x7256('0x8')},'data3':{'type':Sequelize[_0x7256('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x7256('0x9')},'data5':{'type':Sequelize[_0x7256('0xa')],'comment':_0x7256('0xb')},'data6':{'type':Sequelize[_0x7256('0xa')],'comment':_0x7256('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x71ee=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','STRING'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x71ee,0x13b));var _0xe71e=function(_0x575e6d,_0x1e19ac){_0x575e6d=_0x575e6d-0x0;var _0x5d4dfd=_0x71ee[_0x575e6d];return _0x5d4dfd;};'use strict';var Sequelize=require(_0xe71e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe71e('0x1')](_0xe71e('0x2'),_0xe71e('0x3'),_0xe71e('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe71e('0x1')]('Outlook365',_0xe71e('0x5'))},'data1':{'type':Sequelize[_0xe71e('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xe71e('0x6')],'comment':_0xe71e('0x7')},'data3':{'type':Sequelize[_0xe71e('0x6')],'comment':_0xe71e('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0xe71e('0x9')},'data5':{'type':Sequelize[_0xe71e('0xa')],'comment':_0xe71e('0xb')},'data6':{'type':Sequelize[_0xe71e('0xa')],'comment':_0xe71e('0xc')},'data7':{'type':Sequelize[_0xe71e('0xa')],'comment':_0xe71e('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index a93ef5e..fc196ff 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 _0xb6f6=['localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','set','then','destroy','stack','name','send','padEnd','slice','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','CloudProvider','options','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','refresh_token','update','microsoftAuthorization:success','emit','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults'];(function(_0x415158,_0x4841d5){var _0xa677f0=function(_0x5b1a73){while(--_0x5b1a73){_0x415158['push'](_0x415158['shift']());}};_0xa677f0(++_0x4841d5);}(_0xb6f6,0x10d));var _0x6b6f=function(_0x5e4d93,_0x218315){_0x5e4d93=_0x5e4d93-0x0;var _0x1e3cac=_0xb6f6[_0x5e4d93];return _0x1e3cac;};'use strict';var _=require(_0x6b6f('0x0'));var Redis=require(_0x6b6f('0x1'));var qs=require(_0x6b6f('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x6b6f('0x3'));var logger=require(_0x6b6f('0x4'))(_0x6b6f('0x5'));var db=require(_0x6b6f('0x6'))['db'];var oauth=require(_0x6b6f('0x7'));config[_0x6b6f('0x8')]=_[_0x6b6f('0x9')](config[_0x6b6f('0x8')],{'host':_0x6b6f('0xa'),'port':0x18eb});var socket=require(_0x6b6f('0xb'))(new Redis(config['redis']));var redis=new Redis(config[_0x6b6f('0x8')]);function respondWithStatusCode(_0x35625e,_0xf2417a){_0xf2417a=_0xf2417a||0xcc;return function(_0x3c8269){if(_0x3c8269){return _0x35625e[_0x6b6f('0xc')](_0xf2417a);}return _0x35625e['status'](_0xf2417a)[_0x6b6f('0xd')]();};}function respondWithResult(_0x31e0ac,_0x3d1f37){_0x3d1f37=_0x3d1f37||0xc8;return function(_0x482b21){if(_0x482b21){return _0x31e0ac[_0x6b6f('0xe')](_0x3d1f37)[_0x6b6f('0xf')](_0x482b21);}};}function respondWithFilteredResult(_0x5b0597,_0x4a06d6){return function(_0x2414d4){if(_0x2414d4){var _0x385e5f=typeof _0x4a06d6[_0x6b6f('0x10')]===_0x6b6f('0x11')&&typeof _0x4a06d6[_0x6b6f('0x12')]===_0x6b6f('0x11');var _0x440509=_0x2414d4[_0x6b6f('0x13')];var _0x4c274a=_0x385e5f?0x0:_0x4a06d6['offset'];var _0x1a5d1c=_0x385e5f?_0x2414d4['count']:_0x4a06d6[_0x6b6f('0x10')]+_0x4a06d6[_0x6b6f('0x12')];var _0x895f65;if(_0x1a5d1c>=_0x440509){_0x1a5d1c=_0x440509;_0x895f65=0xc8;}else{_0x895f65=0xce;}_0x5b0597[_0x6b6f('0xe')](_0x895f65);return _0x5b0597[_0x6b6f('0x14')]('Content-Range',_0x4c274a+'-'+_0x1a5d1c+'/'+_0x440509)[_0x6b6f('0xf')](_0x2414d4);}return null;};}function saveUpdates(_0x689945){return function(_0x122da4){if(_0x122da4){return _0x122da4['update'](_0x689945)[_0x6b6f('0x15')](function(_0x44c125){return _0x44c125;});}return null;};}function removeEntity(_0x469779){return function(_0x1bb3c5){if(_0x1bb3c5){return _0x1bb3c5[_0x6b6f('0x16')]()[_0x6b6f('0x15')](function(){_0x469779[_0x6b6f('0xe')](0xcc)[_0x6b6f('0xd')]();});}};}function handleEntityNotFound(_0x5bf608){return function(_0x6e8359){if(!_0x6e8359){_0x5bf608['sendStatus'](0x194);}return _0x6e8359;};}function handleError(_0xb74391,_0x306f3e){_0x306f3e=_0x306f3e||0x1f4;return function(_0x1a5b74){logger['error'](_0x1a5b74[_0x6b6f('0x17')]);if(_0x1a5b74['name']){delete _0x1a5b74[_0x6b6f('0x18')];}_0xb74391['status'](_0x306f3e)[_0x6b6f('0x19')](_0x1a5b74);};}function maskClientSecret(_0x2e8703){return _[_0x6b6f('0x1a')](_0x2e8703[_0x6b6f('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x57dbf7,_0x5b2df1){var _0x535452={},_0x4ee862={},_0x18f19f={'count':0x0,'rows':[]};var _0x40e586=_[_0x6b6f('0x1c')](db['CloudProvider'][_0x6b6f('0x1d')],function(_0x313d37){return{'name':_0x313d37[_0x6b6f('0x1e')],'type':_0x313d37[_0x6b6f('0x1f')][_0x6b6f('0x20')]};});_0x4ee862[_0x6b6f('0x21')]=_[_0x6b6f('0x1c')](_0x40e586,_0x6b6f('0x18'));_0x4ee862['query']=_['keys'](_0x57dbf7[_0x6b6f('0x22')]);_0x4ee862[_0x6b6f('0x23')]=_[_0x6b6f('0x24')](_0x4ee862[_0x6b6f('0x21')],_0x4ee862[_0x6b6f('0x22')]);_0x535452[_0x6b6f('0x25')]=_[_0x6b6f('0x24')](_0x4ee862[_0x6b6f('0x21')],qs[_0x6b6f('0x26')](_0x57dbf7['query'][_0x6b6f('0x26')]));_0x535452[_0x6b6f('0x25')]=_0x535452['attributes'][_0x6b6f('0x27')]?_0x535452['attributes']:_0x4ee862[_0x6b6f('0x21')];if(!_0x57dbf7['query'][_0x6b6f('0x28')](_0x6b6f('0x29'))){_0x535452[_0x6b6f('0x12')]=qs[_0x6b6f('0x12')](_0x57dbf7[_0x6b6f('0x22')][_0x6b6f('0x12')]);_0x535452[_0x6b6f('0x10')]=qs[_0x6b6f('0x10')](_0x57dbf7[_0x6b6f('0x22')][_0x6b6f('0x10')]);}_0x535452['order']=qs[_0x6b6f('0x2a')](_0x57dbf7[_0x6b6f('0x22')][_0x6b6f('0x2a')]);_0x535452[_0x6b6f('0x2b')]=qs[_0x6b6f('0x23')](_['pick'](_0x57dbf7[_0x6b6f('0x22')],_0x4ee862[_0x6b6f('0x23')]),_0x40e586);if(_0x57dbf7[_0x6b6f('0x22')][_0x6b6f('0x2c')]){_0x535452[_0x6b6f('0x2b')]=_[_0x6b6f('0x2d')](_0x535452[_0x6b6f('0x2b')],{'$or':_[_0x6b6f('0x1c')](_0x40e586,function(_0x1bf470){if(_0x1bf470[_0x6b6f('0x1f')]!==_0x6b6f('0x2e')){var _0x10d11c={};_0x10d11c[_0x1bf470[_0x6b6f('0x18')]]={'$like':'%'+_0x57dbf7[_0x6b6f('0x22')][_0x6b6f('0x2c')]+'%'};return _0x10d11c;}})});}_0x535452=_['merge']({},_0x535452,_0x57dbf7['options']);var _0x29075e={'where':_0x535452[_0x6b6f('0x2b')]};return db['CloudProvider'][_0x6b6f('0x13')](_0x29075e)[_0x6b6f('0x15')](function(_0x44e28b){_0x18f19f[_0x6b6f('0x13')]=_0x44e28b;if(_0x57dbf7[_0x6b6f('0x22')][_0x6b6f('0x2f')]){_0x535452[_0x6b6f('0x30')]=[{'all':!![]}];}return db['CloudProvider'][_0x6b6f('0x31')](_0x535452);})[_0x6b6f('0x15')](function(_0x244016){_0x18f19f[_0x6b6f('0x32')]=_[_0x6b6f('0x1c')](_0x244016,function(_0xbc106f){if(_0xbc106f[_0x6b6f('0x33')]===_0x6b6f('0x34')){var _0x4a7a68=encryptor[_0x6b6f('0x35')](_0xbc106f[_0x6b6f('0x36')]);_0xbc106f[_0x6b6f('0x36')]=maskClientSecret(_0x4a7a68);}return _0xbc106f;});return _0x18f19f;})[_0x6b6f('0x15')](respondWithFilteredResult(_0x5b2df1,_0x535452))[_0x6b6f('0x37')](handleError(_0x5b2df1,null));};exports[_0x6b6f('0x38')]=function(_0x354813,_0x2223a1){var _0x369f9b={'raw':!![],'where':{'id':_0x354813[_0x6b6f('0x39')]['id']}},_0x4fbfcb={};_0x4fbfcb[_0x6b6f('0x21')]=_[_0x6b6f('0x3a')](db[_0x6b6f('0x3b')][_0x6b6f('0x1d')]);_0x4fbfcb[_0x6b6f('0x22')]=_['keys'](_0x354813[_0x6b6f('0x22')]);_0x4fbfcb[_0x6b6f('0x23')]=_[_0x6b6f('0x24')](_0x4fbfcb[_0x6b6f('0x21')],_0x4fbfcb[_0x6b6f('0x22')]);_0x369f9b[_0x6b6f('0x25')]=_[_0x6b6f('0x24')](_0x4fbfcb['model'],qs[_0x6b6f('0x26')](_0x354813[_0x6b6f('0x22')]['fields']));_0x369f9b[_0x6b6f('0x25')]=_0x369f9b[_0x6b6f('0x25')][_0x6b6f('0x27')]?_0x369f9b[_0x6b6f('0x25')]:_0x4fbfcb[_0x6b6f('0x21')];if(_0x354813['query']['includeAll']){_0x369f9b[_0x6b6f('0x30')]=[{'all':!![]}];}_0x369f9b=_[_0x6b6f('0x2d')]({},_0x369f9b,_0x354813[_0x6b6f('0x3c')]);return db[_0x6b6f('0x3b')][_0x6b6f('0x3d')](_0x369f9b)[_0x6b6f('0x15')](handleEntityNotFound(_0x2223a1,null))['then'](function(_0x5dec95){if(_0x5dec95['service']===_0x6b6f('0x34')){var _0x331119=encryptor[_0x6b6f('0x35')](_0x5dec95[_0x6b6f('0x36')]);_0x5dec95[_0x6b6f('0x36')]=maskClientSecret(_0x331119);}return _0x5dec95;})[_0x6b6f('0x15')](respondWithResult(_0x2223a1,null))['catch'](handleError(_0x2223a1,null));};exports[_0x6b6f('0x3e')]=function(_0x1e5859,_0x43fa3d){if(!_0x1e5859[_0x6b6f('0x3f')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1e5859[_0x6b6f('0x3f')][_0x6b6f('0x33')])throw new Error(_0x6b6f('0x40'));var _0x1ba624=db['CloudProvider'][_0x6b6f('0x1d')][_0x6b6f('0x33')][_0x6b6f('0x41')];if(!_0x1ba624[_0x6b6f('0x42')](_0x1e5859[_0x6b6f('0x3f')][_0x6b6f('0x33')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x1ba624[_0x6b6f('0x43')](',\x20'));if(_0x1e5859[_0x6b6f('0x3f')][_0x6b6f('0x33')]===_0x6b6f('0x34')&&_0x1e5859[_0x6b6f('0x3f')]['data3']){_0x1e5859['body']['data3']=encryptor[_0x6b6f('0x44')](_0x1e5859[_0x6b6f('0x3f')][_0x6b6f('0x36')]);}return db[_0x6b6f('0x3b')]['create'](_0x1e5859['body'],{})['then'](respondWithResult(_0x43fa3d,0xc9))[_0x6b6f('0x37')](handleError(_0x43fa3d,null));};exports['update']=function(_0x349ad8,_0x5cab8e){if(_0x349ad8[_0x6b6f('0x3f')]['id']){delete _0x349ad8[_0x6b6f('0x3f')]['id'];}return db[_0x6b6f('0x3b')][_0x6b6f('0x3d')]({'where':{'id':_0x349ad8[_0x6b6f('0x39')]['id']}})[_0x6b6f('0x15')](handleEntityNotFound(_0x5cab8e,null))[_0x6b6f('0x15')](function(_0x1ca870){if(_0x1ca870['service']===_0x6b6f('0x34')&&_0x349ad8[_0x6b6f('0x3f')][_0x6b6f('0x36')]){_0x349ad8[_0x6b6f('0x3f')][_0x6b6f('0x36')]=encryptor['encryptString'](_0x349ad8[_0x6b6f('0x3f')][_0x6b6f('0x36')]);}return _0x1ca870;})[_0x6b6f('0x15')](saveUpdates(_0x349ad8['body'],null))[_0x6b6f('0x15')](respondWithResult(_0x5cab8e,null))[_0x6b6f('0x37')](handleError(_0x5cab8e,null));};exports[_0x6b6f('0x16')]=function(_0x5bbccb,_0x4025c1){return db[_0x6b6f('0x3b')]['find']({'where':{'id':_0x5bbccb[_0x6b6f('0x39')]['id']}})[_0x6b6f('0x15')](handleEntityNotFound(_0x4025c1,null))[_0x6b6f('0x15')](removeEntity(_0x4025c1,null))['catch'](handleError(_0x4025c1,null));};exports[_0x6b6f('0x45')]=function(_0x2c0920,_0x41faff){return db['CloudProvider']['findOne']({'where':{'id':_0x2c0920[_0x6b6f('0x39')]['id']},'raw':!![]})[_0x6b6f('0x15')](function(_0x1383fb){if(!_0x1383fb)return _0x41faff[_0x6b6f('0xc')](0x194);return{'url':oauth[_0x6b6f('0x46')](_0x1383fb,_0x2c0920[_0x6b6f('0x47')]['id'])};})[_0x6b6f('0x15')](respondWithResult(_0x41faff,null))[_0x6b6f('0x37')](handleError(_0x41faff,null));};exports['oauth2MicrosoftCallback']=function(_0x25cf49,_0x3816e){var _0x1fac3a=_0x25cf49[_0x6b6f('0x3f')];var _0x20544b;var _0x9b055f;if(_0x1fac3a['error'])throw _0x1fac3a;redis['get'](_0x1fac3a[_0x6b6f('0x48')])[_0x6b6f('0x15')](function(_0x4e91ef){if(!_0x4e91ef)throw new Error('Invalid\x20state\x20parameter');_0x20544b=JSON['parse'](_0x4e91ef);var _0x253eba=Buffer['from'](_0x1fac3a['state'],_0x6b6f('0x49'))[_0x6b6f('0x4a')](_0x6b6f('0x4b'));_0x9b055f=JSON['parse'](_0x253eba);if(!oauth[_0x6b6f('0x4c')](_0x1fac3a[_0x6b6f('0x4d')],_0x20544b[_0x6b6f('0x4e')]))throw new Error(_0x6b6f('0x4f'));redis['del'](_0x1fac3a[_0x6b6f('0x48')]);return oauth['getOauth2MicrosoftAccessToken'](_0x1fac3a[_0x6b6f('0x50')],_0x20544b);})[_0x6b6f('0x15')](function(_0xecea44){_0x20544b[_0x6b6f('0x51')]=_0xecea44[_0x6b6f('0x52')];_0x20544b[_0x6b6f('0x53')]=_0xecea44[_0x6b6f('0x54')];return db[_0x6b6f('0x3b')][_0x6b6f('0x55')]({'data5':_0x20544b[_0x6b6f('0x51')],'data6':_0x20544b['data6']},{'where':{'id':_0x20544b['id']}});})[_0x6b6f('0x15')](function(){oauth['startRefreshInterval'](_0x20544b);socket['emit'](_0x6b6f('0x56'),{'id':_0x9b055f['id']});return;})[_0x6b6f('0x15')](respondWithStatusCode(_0x3816e,null))[_0x6b6f('0x37')](function(_0x5f5640){if(_0x9b055f){socket[_0x6b6f('0x57')](_0x6b6f('0x58'),{'id':_0x9b055f['id']});}if(!_0x20544b){logger[_0x6b6f('0x59')](_0x6b6f('0x5a'),_0x5f5640);return _0x3816e['status'](0x1f4)[_0x6b6f('0x19')](_0x5f5640[_0x6b6f('0x5b')]);}logger[_0x6b6f('0x59')](_0x6b6f('0x5c'),_0x20544b['id'],JSON['stringify'](_0x5f5640));});};
\ No newline at end of file
+var _0xa86f=['redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','offset','limit','set','update','then','error','stack','name','send','map','CloudProvider','rawAttributes','model','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','params','keys','length','find','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','join','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','get','state','parse','from','base64','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth'];(function(_0xa43518,_0x2a4c6b){var _0x5e9b94=function(_0x3d3c7f){while(--_0x3d3c7f){_0xa43518['push'](_0xa43518['shift']());}};_0x5e9b94(++_0x2a4c6b);}(_0xa86f,0xfc));var _0xfa86=function(_0x134287,_0x5a67d6){_0x134287=_0x134287-0x0;var _0x3097d0=_0xa86f[_0x134287];return _0x3097d0;};'use strict';var _=require(_0xfa86('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xfa86('0x1'));var config=require(_0xfa86('0x2'));var logger=require('../../config/logger')(_0xfa86('0x3'));var db=require(_0xfa86('0x4'))['db'];var oauth=require(_0xfa86('0x5'));config[_0xfa86('0x6')]=_[_0xfa86('0x7')](config[_0xfa86('0x6')],{'host':_0xfa86('0x8'),'port':0x18eb});var socket=require(_0xfa86('0x9'))(new Redis(config[_0xfa86('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1691b2,_0x1cbc70){_0x1cbc70=_0x1cbc70||0xcc;return function(_0x7606c3){if(_0x7606c3){return _0x1691b2[_0xfa86('0xa')](_0x1cbc70);}return _0x1691b2[_0xfa86('0xb')](_0x1cbc70)[_0xfa86('0xc')]();};}function respondWithResult(_0x29a607,_0x118936){_0x118936=_0x118936||0xc8;return function(_0x389f51){if(_0x389f51){return _0x29a607['status'](_0x118936)[_0xfa86('0xd')](_0x389f51);}};}function respondWithFilteredResult(_0x1c16f4,_0x764861){return function(_0x3bd00e){if(_0x3bd00e){var _0x104561=typeof _0x764861['offset']===_0xfa86('0xe')&&typeof _0x764861['limit']===_0xfa86('0xe');var _0xe4d1b4=_0x3bd00e['count'];var _0x27becd=_0x104561?0x0:_0x764861[_0xfa86('0xf')];var _0x5013dc=_0x104561?_0x3bd00e['count']:_0x764861[_0xfa86('0xf')]+_0x764861[_0xfa86('0x10')];var _0x5ec8ce;if(_0x5013dc>=_0xe4d1b4){_0x5013dc=_0xe4d1b4;_0x5ec8ce=0xc8;}else{_0x5ec8ce=0xce;}_0x1c16f4[_0xfa86('0xb')](_0x5ec8ce);return _0x1c16f4[_0xfa86('0x11')]('Content-Range',_0x27becd+'-'+_0x5013dc+'/'+_0xe4d1b4)[_0xfa86('0xd')](_0x3bd00e);}return null;};}function saveUpdates(_0x32d38b){return function(_0x4ced7e){if(_0x4ced7e){return _0x4ced7e[_0xfa86('0x12')](_0x32d38b)[_0xfa86('0x13')](function(_0x38e533){return _0x38e533;});}return null;};}function removeEntity(_0x2d832e){return function(_0x547350){if(_0x547350){return _0x547350['destroy']()[_0xfa86('0x13')](function(){_0x2d832e[_0xfa86('0xb')](0xcc)[_0xfa86('0xc')]();});}};}function handleEntityNotFound(_0x3e2cab){return function(_0x4e92d9){if(!_0x4e92d9){_0x3e2cab[_0xfa86('0xa')](0x194);}return _0x4e92d9;};}function handleError(_0x1c97b7,_0x132217){_0x132217=_0x132217||0x1f4;return function(_0x4550bb){logger[_0xfa86('0x14')](_0x4550bb[_0xfa86('0x15')]);if(_0x4550bb[_0xfa86('0x16')]){delete _0x4550bb['name'];}_0x1c97b7[_0xfa86('0xb')](_0x132217)[_0xfa86('0x17')](_0x4550bb);};}function maskClientSecret(_0x3ecfdf){return _['padEnd'](_0x3ecfdf['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x1869ce,_0x2bfb64){var _0x53926b={},_0x249b8e={},_0x3193b4={'count':0x0,'rows':[]};var _0x415383=_[_0xfa86('0x18')](db[_0xfa86('0x19')][_0xfa86('0x1a')],function(_0xd5495d){return{'name':_0xd5495d['fieldName'],'type':_0xd5495d['type']['key']};});_0x249b8e[_0xfa86('0x1b')]=_[_0xfa86('0x18')](_0x415383,_0xfa86('0x16'));_0x249b8e['query']=_['keys'](_0x1869ce[_0xfa86('0x1c')]);_0x249b8e['filters']=_[_0xfa86('0x1d')](_0x249b8e[_0xfa86('0x1b')],_0x249b8e['query']);_0x53926b[_0xfa86('0x1e')]=_[_0xfa86('0x1d')](_0x249b8e['model'],qs[_0xfa86('0x1f')](_0x1869ce[_0xfa86('0x1c')][_0xfa86('0x1f')]));_0x53926b[_0xfa86('0x1e')]=_0x53926b[_0xfa86('0x1e')]['length']?_0x53926b[_0xfa86('0x1e')]:_0x249b8e[_0xfa86('0x1b')];if(!_0x1869ce[_0xfa86('0x1c')][_0xfa86('0x20')]('nolimit')){_0x53926b['limit']=qs[_0xfa86('0x10')](_0x1869ce[_0xfa86('0x1c')][_0xfa86('0x10')]);_0x53926b[_0xfa86('0xf')]=qs['offset'](_0x1869ce['query'][_0xfa86('0xf')]);}_0x53926b['order']=qs[_0xfa86('0x21')](_0x1869ce[_0xfa86('0x1c')][_0xfa86('0x21')]);_0x53926b[_0xfa86('0x22')]=qs[_0xfa86('0x23')](_['pick'](_0x1869ce[_0xfa86('0x1c')],_0x249b8e[_0xfa86('0x23')]),_0x415383);if(_0x1869ce[_0xfa86('0x1c')][_0xfa86('0x24')]){_0x53926b['where']=_['merge'](_0x53926b[_0xfa86('0x22')],{'$or':_[_0xfa86('0x18')](_0x415383,function(_0x23b74f){if(_0x23b74f[_0xfa86('0x25')]!==_0xfa86('0x26')){var _0x4242fa={};_0x4242fa[_0x23b74f[_0xfa86('0x16')]]={'$like':'%'+_0x1869ce[_0xfa86('0x1c')][_0xfa86('0x24')]+'%'};return _0x4242fa;}})});}_0x53926b=_[_0xfa86('0x27')]({},_0x53926b,_0x1869ce[_0xfa86('0x28')]);var _0x1f74d1={'where':_0x53926b[_0xfa86('0x22')]};return db[_0xfa86('0x19')][_0xfa86('0x29')](_0x1f74d1)[_0xfa86('0x13')](function(_0x1189d7){_0x3193b4[_0xfa86('0x29')]=_0x1189d7;if(_0x1869ce['query'][_0xfa86('0x2a')]){_0x53926b[_0xfa86('0x2b')]=[{'all':!![]}];}return db['CloudProvider'][_0xfa86('0x2c')](_0x53926b);})[_0xfa86('0x13')](function(_0x285818){_0x3193b4[_0xfa86('0x2d')]=_[_0xfa86('0x18')](_0x285818,function(_0x36f969){if(_0x36f969[_0xfa86('0x2e')]===_0xfa86('0x2f')){var _0x33523d=encryptor[_0xfa86('0x30')](_0x36f969['data3']);_0x36f969[_0xfa86('0x31')]=maskClientSecret(_0x33523d);}return _0x36f969;});return _0x3193b4;})[_0xfa86('0x13')](respondWithFilteredResult(_0x2bfb64,_0x53926b))['catch'](handleError(_0x2bfb64,null));};exports['show']=function(_0x21f385,_0x87ce45){var _0x1eca1b={'raw':!![],'where':{'id':_0x21f385[_0xfa86('0x32')]['id']}},_0x43fe38={};_0x43fe38['model']=_[_0xfa86('0x33')](db[_0xfa86('0x19')]['rawAttributes']);_0x43fe38[_0xfa86('0x1c')]=_[_0xfa86('0x33')](_0x21f385[_0xfa86('0x1c')]);_0x43fe38['filters']=_['intersection'](_0x43fe38['model'],_0x43fe38[_0xfa86('0x1c')]);_0x1eca1b['attributes']=_[_0xfa86('0x1d')](_0x43fe38['model'],qs[_0xfa86('0x1f')](_0x21f385[_0xfa86('0x1c')]['fields']));_0x1eca1b[_0xfa86('0x1e')]=_0x1eca1b['attributes'][_0xfa86('0x34')]?_0x1eca1b['attributes']:_0x43fe38[_0xfa86('0x1b')];if(_0x21f385[_0xfa86('0x1c')]['includeAll']){_0x1eca1b[_0xfa86('0x2b')]=[{'all':!![]}];}_0x1eca1b=_['merge']({},_0x1eca1b,_0x21f385[_0xfa86('0x28')]);return db[_0xfa86('0x19')][_0xfa86('0x35')](_0x1eca1b)[_0xfa86('0x13')](handleEntityNotFound(_0x87ce45,null))[_0xfa86('0x13')](function(_0x31d986){if(_0x31d986[_0xfa86('0x2e')]===_0xfa86('0x2f')){var _0x492754=encryptor['decryptString'](_0x31d986[_0xfa86('0x31')]);_0x31d986[_0xfa86('0x31')]=maskClientSecret(_0x492754);}return _0x31d986;})[_0xfa86('0x13')](respondWithResult(_0x87ce45,null))[_0xfa86('0x36')](handleError(_0x87ce45,null));};exports[_0xfa86('0x37')]=function(_0x4c2131,_0x437a00){if(!_0x4c2131[_0xfa86('0x38')][_0xfa86('0x16')])throw new Error(_0xfa86('0x39'));if(!_0x4c2131[_0xfa86('0x38')][_0xfa86('0x2e')])throw new Error(_0xfa86('0x3a'));var _0x543018=db[_0xfa86('0x19')]['rawAttributes']['service']['values'];if(!_0x543018[_0xfa86('0x3b')](_0x4c2131[_0xfa86('0x38')][_0xfa86('0x2e')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x543018[_0xfa86('0x3c')](',\x20'));if(_0x4c2131['body']['service']===_0xfa86('0x2f')&&_0x4c2131[_0xfa86('0x38')][_0xfa86('0x31')]){_0x4c2131['body']['data3']=encryptor[_0xfa86('0x3d')](_0x4c2131['body']['data3']);}return db[_0xfa86('0x19')]['create'](_0x4c2131[_0xfa86('0x38')],{})['then'](respondWithResult(_0x437a00,0xc9))[_0xfa86('0x36')](handleError(_0x437a00,null));};exports['update']=function(_0x5ee5db,_0x370498){if(_0x5ee5db['body']['id']){delete _0x5ee5db[_0xfa86('0x38')]['id'];}return db[_0xfa86('0x19')][_0xfa86('0x35')]({'where':{'id':_0x5ee5db[_0xfa86('0x32')]['id']}})['then'](handleEntityNotFound(_0x370498,null))[_0xfa86('0x13')](function(_0x5931a6){if(_0x5931a6[_0xfa86('0x2e')]===_0xfa86('0x2f')&&_0x5ee5db[_0xfa86('0x38')][_0xfa86('0x31')]){_0x5ee5db[_0xfa86('0x38')][_0xfa86('0x31')]=encryptor[_0xfa86('0x3d')](_0x5ee5db['body'][_0xfa86('0x31')]);}return _0x5931a6;})[_0xfa86('0x13')](saveUpdates(_0x5ee5db['body'],null))[_0xfa86('0x13')](respondWithResult(_0x370498,null))['catch'](handleError(_0x370498,null));};exports[_0xfa86('0x3e')]=function(_0x4dd6ec,_0x41414e){return db['CloudProvider'][_0xfa86('0x35')]({'where':{'id':_0x4dd6ec[_0xfa86('0x32')]['id']}})[_0xfa86('0x13')](handleEntityNotFound(_0x41414e,null))[_0xfa86('0x13')](removeEntity(_0x41414e,null))[_0xfa86('0x36')](handleError(_0x41414e,null));};exports[_0xfa86('0x3f')]=function(_0xf5d888,_0xf960c9){return db['CloudProvider'][_0xfa86('0x40')]({'where':{'id':_0xf5d888['params']['id']},'raw':!![]})[_0xfa86('0x13')](function(_0x5696b7){if(!_0x5696b7)return _0xf960c9['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x5696b7,_0xf5d888['user']['id'])};})[_0xfa86('0x13')](respondWithResult(_0xf960c9,null))[_0xfa86('0x36')](handleError(_0xf960c9,null));};exports[_0xfa86('0x41')]=function(_0x5ec677,_0x500056){var _0x18a153=_0x5ec677['body'];var _0x5b784c;var _0x3b4c5a;if(_0x18a153[_0xfa86('0x14')])throw _0x18a153;redis[_0xfa86('0x42')](_0x18a153[_0xfa86('0x43')])[_0xfa86('0x13')](function(_0x7b17f3){if(!_0x7b17f3)throw new Error('Invalid\x20state\x20parameter');_0x5b784c=JSON[_0xfa86('0x44')](_0x7b17f3);var _0x49dbfe=Buffer[_0xfa86('0x45')](_0x18a153['state'],_0xfa86('0x46'))['toString'](_0xfa86('0x47'));_0x3b4c5a=JSON[_0xfa86('0x44')](_0x49dbfe);if(!oauth['isValidIdToken'](_0x18a153[_0xfa86('0x48')],_0x5b784c[_0xfa86('0x49')]))throw new Error(_0xfa86('0x4a'));redis[_0xfa86('0x4b')](_0x18a153[_0xfa86('0x43')]);return oauth[_0xfa86('0x4c')](_0x18a153[_0xfa86('0x4d')],_0x5b784c);})[_0xfa86('0x13')](function(_0x3ba5b4){_0x5b784c[_0xfa86('0x4e')]=_0x3ba5b4['access_token'];_0x5b784c[_0xfa86('0x4f')]=_0x3ba5b4[_0xfa86('0x50')];return db[_0xfa86('0x19')][_0xfa86('0x12')]({'data5':_0x5b784c[_0xfa86('0x4e')],'data6':_0x5b784c[_0xfa86('0x4f')]},{'where':{'id':_0x5b784c['id']}});})['then'](function(){oauth[_0xfa86('0x51')](_0x5b784c);socket[_0xfa86('0x52')](_0xfa86('0x53'),{'id':_0x3b4c5a['id']});return;})[_0xfa86('0x13')](respondWithStatusCode(_0x500056,null))[_0xfa86('0x36')](function(_0x4a8927){if(_0x3b4c5a){socket[_0xfa86('0x52')](_0xfa86('0x54'),{'id':_0x3b4c5a['id']});}if(!_0x5b784c){logger[_0xfa86('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0x4a8927);return _0x500056[_0xfa86('0xb')](0x1f4)[_0xfa86('0x17')](_0x4a8927['message']);}logger[_0xfa86('0x14')](_0xfa86('0x55'),_0x5b784c['id'],JSON['stringify'](_0x4a8927));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 9576449..f6f14b5 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 _0xd83f=['request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','moment','bluebird'];(function(_0x241bc4,_0x1a46ad){var _0x3d65a0=function(_0x231ef8){while(--_0x231ef8){_0x241bc4['push'](_0x241bc4['shift']());}};_0x3d65a0(++_0x1a46ad);}(_0xd83f,0x1b5));var _0xfd83=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd83f[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xfd83('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfd83('0x1'));var BPromise=require(_0xfd83('0x2'));var rp=require(_0xfd83('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd83('0x4'));var config=require(_0xfd83('0x5'));var attributes=require(_0xfd83('0x6'));module[_0xfd83('0x7')]=function(_0x2f21d7,_0x12ebf4){return _0x2f21d7[_0xfd83('0x8')](_0xfd83('0x9'),attributes,{'tableName':_0xfd83('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e20=['request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','../../config/logger','moment','bluebird'];(function(_0x572a45,_0x12b67e){var _0x5a91e4=function(_0x2350a4){while(--_0x2350a4){_0x572a45['push'](_0x572a45['shift']());}};_0x5a91e4(++_0x12b67e);}(_0x7e20,0x1ec));var _0x07e2=function(_0x265b8f,_0xa5d91b){_0x265b8f=_0x265b8f-0x0;var _0xa73272=_0x7e20[_0x265b8f];return _0xa73272;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x07e2('0x0'))('api');var moment=require(_0x07e2('0x1'));var BPromise=require(_0x07e2('0x2'));var rp=require(_0x07e2('0x3'));var fs=require('fs');var path=require(_0x07e2('0x4'));var rimraf=require(_0x07e2('0x5'));var config=require(_0x07e2('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x07e2('0x7')]=function(_0x3e3ad5,_0x159175){return _0x3e3ad5[_0x07e2('0x8')](_0x07e2('0x9'),attributes,{'tableName':_0x07e2('0xa'),'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 1be4a62..494be52 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 _0x8432=['intervals','all','inspect','lodash','crypto','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','id_token','from','toString','client_id','data1','response_type','data4','form_post','scope','prompt','login','key','oauth2Claims','set','decode','iss','issuer','audience','isAfter','unix','exp','resolve','then','data3','refresh_token','data6','{TENANT_ID}','data2','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString'];(function(_0x2e96d6,_0x3a2096){var _0x397996=function(_0x812368){while(--_0x812368){_0x2e96d6['push'](_0x2e96d6['shift']());}};_0x397996(++_0x3a2096);}(_0x8432,0x157));var _0x2843=function(_0x2f430a,_0x46d370){_0x2f430a=_0x2f430a-0x0;var _0x10def3=_0x8432[_0x2f430a];return _0x10def3;};'use strict';var _=require(_0x2843('0x0'));var crypto=require(_0x2843('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x2843('0x2'));var Redis=require(_0x2843('0x3'));var rp=require(_0x2843('0x4'));var util=require(_0x2843('0x5'));var encryptor=require('../../components/encryptor');var config=require(_0x2843('0x6'));var logger=require(_0x2843('0x7'))(_0x2843('0x8'));var schedule=require(_0x2843('0x9'));var db=require(_0x2843('0xa'))['db'];config['redis']=_[_0x2843('0xb')](config[_0x2843('0xc')],{'host':_0x2843('0xd'),'port':0x18eb});var redis=new Redis(config[_0x2843('0xc')]);var MICROSOFT_AUTH_URL=_0x2843('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2843('0xf'),'profile',_0x2843('0x10'),'offline_access',_0x2843('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0x2843('0x12')],'Dynamics365':[_0x2843('0xf'),_0x2843('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x2843('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5edc48){var _0x32e20f=_[_0x2843('0x15')](AZURE_AUTH_SCOPES[_0x5edc48[_0x2843('0x16')]]);if(_0x5edc48[_0x2843('0x16')]===_0x2843('0x17'))_0x32e20f[_0x2843('0x18')](_0x5edc48[_0x2843('0x19')]+_0x2843('0x1a'));return _0x32e20f[_0x2843('0x1b')]('\x20');}function getAccessTokenScope(_0x205922){if(_0x205922[_0x2843('0x16')]===_0x2843('0x1c'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x205922[_0x2843('0x16')]==='Dynamics365')return _0x205922[_0x2843('0x19')]+_0x2843('0x1a');}function generateMicrosoftAuthorizationUrl(_0x5b5890,_0x10c567){var _0x22a372=MICROSOFT_AUTH_URL[_0x2843('0x1d')]('{TENANT_ID}',_0x5b5890['data2']);var _0x3a7748=['code',_0x2843('0x1e')];var _0x1fe7a4=Buffer[_0x2843('0x1f')](JSON['stringify']({'id':_0x10c567}))['toString']('base64');var _0x18c416=crypto['randomBytes'](0x10)[_0x2843('0x20')]('hex');var _0x34d969=getAuthorizationScopes(_0x5b5890);var _0x2a2ea0=[{'key':_0x2843('0x21'),'value':_0x5b5890[_0x2843('0x22')]},{'key':_0x2843('0x23'),'value':encodeURIComponent(_0x3a7748[_0x2843('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x5b5890[_0x2843('0x24')]},{'key':'response_mode','value':_0x2843('0x25')},{'key':_0x2843('0x26'),'value':encodeURIComponent(_0x34d969)},{'key':'state','value':_0x1fe7a4},{'key':'nonce','value':_0x18c416},{'key':_0x2843('0x27'),'value':_0x2843('0x28')}];var _0xab9079=_0x22a372+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x2843('0x15')](_0x2a2ea0,function(_0x5e3228){return _0x5e3228[_0x2843('0x29')]+'='+_0x5e3228['value'];})[_0x2843('0x1b')]('&');_0x5b5890[_0x2843('0x2a')]={'issuer':_0x22a372[_0x2843('0x1d')]('oauth2/',''),'audience':_0x5b5890['data1'],'state':_0x1fe7a4,'nonce':_0x18c416};redis[_0x2843('0x2b')](_0x1fe7a4,JSON['stringify'](_0x5b5890));return _0xab9079;}function isValidIdToken(_0x469d51,_0x3bc9fc){try{var _0x1012ff=jwt[_0x2843('0x2c')](_0x469d51,{'complete':!![]});var _0x3a4534=_0x1012ff['payload'];if(_0x3a4534[_0x2843('0x2d')]!==_0x3bc9fc[_0x2843('0x2e')])return![];if(_0x3a4534['aud']!==_0x3bc9fc[_0x2843('0x2f')])return![];if(_0x3a4534['nonce']!==_0x3bc9fc['nonce'])return![];if(moment()[_0x2843('0x30')](moment[_0x2843('0x31')](_0x3a4534[_0x2843('0x32')])))return![];return!![];}catch(_0x4a273c){throw _0x4a273c;}}function refreshOauth2MicrosoftAccessToken(_0x1263d5){return Promise[_0x2843('0x33')]()[_0x2843('0x34')](function(){if(_0x1263d5[_0x2843('0x35')])return _0x1263d5;return db['CloudProvider']['findOne']({'where':{'id':_0x1263d5['id']},'raw':!![]});})['then'](function(_0x1e04aa){var _0x408b5f={'grant_type':_0x2843('0x36'),'refresh_token':_0x1e04aa[_0x2843('0x37')],'scope':getAccessTokenScope(_0x1e04aa),'redirect_uri':_0x1e04aa[_0x2843('0x24')],'client_id':_0x1e04aa[_0x2843('0x22')],'client_secret':encryptor['decryptString'](_0x1e04aa[_0x2843('0x35')])};var _0x2b501a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x2843('0x1d')](_0x2843('0x38'),_0x1e04aa[_0x2843('0x39')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x408b5f,'json':!![]};return rp(_0x2b501a);})[_0x2843('0x34')](function(_0x1d6584){_0x1263d5[_0x2843('0x3a')]=_0x1d6584[_0x2843('0x3b')];_0x1263d5[_0x2843('0x37')]=_0x1d6584[_0x2843('0x36')];return db['CloudProvider']['update']({'data5':_0x1263d5[_0x2843('0x3a')],'data6':_0x1263d5[_0x2843('0x37')]},{'where':{'id':_0x1263d5['id']}});})[_0x2843('0x34')](function(){return _0x1263d5;})[_0x2843('0x3c')](function(_0x170ba4){logger[_0x2843('0x3d')](_0x2843('0x3e'),_0x1263d5['id'],_0x170ba4);});}function getOauth2MicrosoftAccessToken(_0x333f23,_0x8c81cd){var _0x5267ad={'grant_type':_0x2843('0x3f'),'code':_0x333f23,'scope':getAccessTokenScope(_0x8c81cd),'redirect_uri':_0x8c81cd[_0x2843('0x24')],'client_id':_0x8c81cd[_0x2843('0x22')],'client_secret':encryptor[_0x2843('0x40')](_0x8c81cd[_0x2843('0x35')])};var _0x205bae={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x2843('0x1d')](_0x2843('0x38'),_0x8c81cd[_0x2843('0x39')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5267ad,'json':!![]};return rp(_0x205bae);}function startRefreshInterval(_0x28277c){var _0x570550=schedule['intervals'];if(_0x570550[_0x28277c['id']])clearInterval(_0x570550[_0x28277c['id']]);_0x570550[_0x28277c['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x28277c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x2843('0x41')]=_0x570550;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x3e8750){var _0x134fcb=_0x3e8750[_0x2843('0x15')](function(_0x386e14){return refreshOauth2MicrosoftAccessToken(_0x386e14)['then'](function(_0x483b6e){startRefreshInterval(_0x483b6e);});});return Promise[_0x2843('0x42')](_0x134fcb);})['catch'](function(_0x306921){var _0x3058cd=_0x306921?util[_0x2843('0x43')](_0x306921,{'showHidden':![],'depth':null}):'';logger[_0x2843('0x3d')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3058cd);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xee9d=['hex','client_id','data1','response_type','redirect_uri','data4','scope','state','nonce','prompt','map','key','oauth2Claims','set','stringify','decode','payload','issuer','aud','isAfter','unix','resolve','data3','CloudProvider','then','refresh_token','data6','POST','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64'];(function(_0x5868e8,_0x52e7c3){var _0x24ac5=function(_0x55e12c){while(--_0x55e12c){_0x5868e8['push'](_0x5868e8['shift']());}};_0x24ac5(++_0x52e7c3);}(_0xee9d,0x1e5));var _0xdee9=function(_0x2832cb,_0x35cd83){_0x2832cb=_0x2832cb-0x0;var _0x1d868f=_0xee9d[_0x2832cb];return _0x1d868f;};'use strict';var _=require(_0xdee9('0x0'));var crypto=require(_0xdee9('0x1'));var jwt=require(_0xdee9('0x2'));var moment=require('moment');var Redis=require(_0xdee9('0x3'));var rp=require(_0xdee9('0x4'));var util=require(_0xdee9('0x5'));var encryptor=require(_0xdee9('0x6'));var config=require(_0xdee9('0x7'));var logger=require(_0xdee9('0x8'))('api');var schedule=require(_0xdee9('0x9'));var db=require(_0xdee9('0xa'))['db'];config['redis']=_['defaults'](config[_0xdee9('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xdee9('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xdee9('0xc'),'profile',_0xdee9('0xd'),'offline_access',_0xdee9('0xe'),'https://outlook.office.com/POP.AccessAsUser.All',_0xdee9('0xf')],'Dynamics365':[_0xdee9('0xc'),_0xdee9('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xdee9('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xdee9('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x27030e){var _0x12cbaa=_['map'](AZURE_AUTH_SCOPES[_0x27030e[_0xdee9('0x13')]]);if(_0x27030e[_0xdee9('0x13')]===_0xdee9('0x14'))_0x12cbaa['push'](_0x27030e[_0xdee9('0x15')]+_0xdee9('0x16'));return _0x12cbaa[_0xdee9('0x17')]('\x20');}function getAccessTokenScope(_0x3abe3a){if(_0x3abe3a[_0xdee9('0x13')]===_0xdee9('0x18'))return _0xdee9('0xe');if(_0x3abe3a[_0xdee9('0x13')]===_0xdee9('0x14'))return _0x3abe3a[_0xdee9('0x15')]+_0xdee9('0x16');}function generateMicrosoftAuthorizationUrl(_0x20fc25,_0x3dbca8){var _0x448682=MICROSOFT_AUTH_URL[_0xdee9('0x19')](_0xdee9('0x1a'),_0x20fc25[_0xdee9('0x1b')]);var _0xc4a46e=[_0xdee9('0x1c'),_0xdee9('0x1d')];var _0x422240=Buffer[_0xdee9('0x1e')](JSON['stringify']({'id':_0x3dbca8}))[_0xdee9('0x1f')](_0xdee9('0x20'));var _0x12e8c4=crypto['randomBytes'](0x10)[_0xdee9('0x1f')](_0xdee9('0x21'));var _0x177150=getAuthorizationScopes(_0x20fc25);var _0x4d83e0=[{'key':_0xdee9('0x22'),'value':_0x20fc25[_0xdee9('0x23')]},{'key':_0xdee9('0x24'),'value':encodeURIComponent(_0xc4a46e[_0xdee9('0x17')]('\x20'))},{'key':_0xdee9('0x25'),'value':_0x20fc25[_0xdee9('0x26')]},{'key':'response_mode','value':'form_post'},{'key':_0xdee9('0x27'),'value':encodeURIComponent(_0x177150)},{'key':_0xdee9('0x28'),'value':_0x422240},{'key':_0xdee9('0x29'),'value':_0x12e8c4},{'key':_0xdee9('0x2a'),'value':'login'}];var _0x36ff5d=_0x448682+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xdee9('0x2b')](_0x4d83e0,function(_0xeb9b4c){return _0xeb9b4c[_0xdee9('0x2c')]+'='+_0xeb9b4c['value'];})[_0xdee9('0x17')]('&');_0x20fc25[_0xdee9('0x2d')]={'issuer':_0x448682[_0xdee9('0x19')]('oauth2/',''),'audience':_0x20fc25[_0xdee9('0x23')],'state':_0x422240,'nonce':_0x12e8c4};redis[_0xdee9('0x2e')](_0x422240,JSON[_0xdee9('0x2f')](_0x20fc25));return _0x36ff5d;}function isValidIdToken(_0x215dc5,_0x17f7c9){try{var _0x2e0459=jwt[_0xdee9('0x30')](_0x215dc5,{'complete':!![]});var _0x2e7423=_0x2e0459[_0xdee9('0x31')];if(_0x2e7423['iss']!==_0x17f7c9[_0xdee9('0x32')])return![];if(_0x2e7423[_0xdee9('0x33')]!==_0x17f7c9['audience'])return![];if(_0x2e7423[_0xdee9('0x29')]!==_0x17f7c9[_0xdee9('0x29')])return![];if(moment()[_0xdee9('0x34')](moment[_0xdee9('0x35')](_0x2e7423['exp'])))return![];return!![];}catch(_0x35d019){throw _0x35d019;}}function refreshOauth2MicrosoftAccessToken(_0x219fee){return Promise[_0xdee9('0x36')]()['then'](function(){if(_0x219fee[_0xdee9('0x37')])return _0x219fee;return db[_0xdee9('0x38')]['findOne']({'where':{'id':_0x219fee['id']},'raw':!![]});})[_0xdee9('0x39')](function(_0x19fe99){var _0x1975af={'grant_type':_0xdee9('0x3a'),'refresh_token':_0x19fe99[_0xdee9('0x3b')],'scope':getAccessTokenScope(_0x19fe99),'redirect_uri':_0x19fe99[_0xdee9('0x26')],'client_id':_0x19fe99['data1'],'client_secret':encryptor['decryptString'](_0x19fe99[_0xdee9('0x37')])};var _0x1e72a9={'method':_0xdee9('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0xdee9('0x1a'),_0x19fe99[_0xdee9('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1975af,'json':!![]};return rp(_0x1e72a9);})[_0xdee9('0x39')](function(_0x8439cb){_0x219fee['data5']=_0x8439cb[_0xdee9('0x3d')];_0x219fee[_0xdee9('0x3b')]=_0x8439cb[_0xdee9('0x3a')];return db[_0xdee9('0x38')][_0xdee9('0x3e')]({'data5':_0x219fee['data5'],'data6':_0x219fee[_0xdee9('0x3b')]},{'where':{'id':_0x219fee['id']}});})[_0xdee9('0x39')](function(){return _0x219fee;})[_0xdee9('0x3f')](function(_0x4d6cc2){logger[_0xdee9('0x40')](_0xdee9('0x41'),_0x219fee['id'],_0x4d6cc2);});}function getOauth2MicrosoftAccessToken(_0x2882bb,_0x2732ca){var _0x4752e9={'grant_type':_0xdee9('0x42'),'code':_0x2882bb,'scope':getAccessTokenScope(_0x2732ca),'redirect_uri':_0x2732ca[_0xdee9('0x26')],'client_id':_0x2732ca[_0xdee9('0x23')],'client_secret':encryptor[_0xdee9('0x43')](_0x2732ca['data3'])};var _0x263509={'method':_0xdee9('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0xdee9('0x1a'),_0x2732ca[_0xdee9('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4752e9,'json':!![]};return rp(_0x263509);}function startRefreshInterval(_0x220620){var _0x9cbc55=schedule[_0xdee9('0x44')];if(_0x9cbc55[_0x220620['id']])clearInterval(_0x9cbc55[_0x220620['id']]);_0x9cbc55[_0x220620['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xdee9('0x45')](this,{'id':_0x220620['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xdee9('0x44')]=_0x9cbc55;}function startAllRefreshIntervals(){return db[_0xdee9('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x264470){var _0x16bc6b=_0x264470['map'](function(_0x214cb6){return refreshOauth2MicrosoftAccessToken(_0x214cb6)[_0xdee9('0x39')](function(_0x230b63){startRefreshInterval(_0x230b63);});});return Promise[_0xdee9('0x46')](_0x16bc6b);})[_0xdee9('0x3f')](function(_0x131539){var _0x306592=_0x131539?util[_0xdee9('0x47')](_0x131539,{'showHidden':![],'depth':null}):'';logger['error'](_0xdee9('0x48'),_0x306592);});}module[_0xdee9('0x49')]={'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 10b8679..adeb689 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 _0x29b1=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','info','message','catch','lodash','util','moment'];(function(_0x13bc21,_0x5627ce){var _0x51823e=function(_0x285f5c){while(--_0x285f5c){_0x13bc21['push'](_0x13bc21['shift']());}};_0x51823e(++_0x5627ce);}(_0x29b1,0x16d));var _0x129b=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x29b1[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x129b('0x0'));var util=require(_0x129b('0x1'));var moment=require(_0x129b('0x2'));var BPromise=require(_0x129b('0x3'));var rs=require(_0x129b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x129b('0x5'))['db'];var utils=require(_0x129b('0x6'));var logger=require(_0x129b('0x7'))(_0x129b('0x8'));var config=require(_0x129b('0x9'));var jayson=require(_0x129b('0xa'));var client=jayson[_0x129b('0xb')][_0x129b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ce8f9,_0x3ef769,_0x5ac368){return new BPromise(function(_0x2c99a1,_0x1e29d6){return client['request'](_0x5ce8f9,_0x5ac368)[_0x129b('0xd')](function(_0x1abf45){logger['info'](_0x129b('0xe'),_0x3ef769,'request\x20sent');logger[_0x129b('0xf')](_0x129b('0x10'),_0x3ef769,_0x129b('0x11'),JSON['stringify'](_0x1abf45));if(_0x1abf45[_0x129b('0x12')]){if(_0x1abf45[_0x129b('0x12')][_0x129b('0x13')]===0x1f4){logger[_0x129b('0x12')]('CloudProvider,\x20%s,\x20%s',_0x3ef769,_0x1abf45['error']['message']);return _0x1e29d6(_0x1abf45[_0x129b('0x12')]['message']);}logger[_0x129b('0x12')](_0x129b('0xe'),_0x3ef769,_0x1abf45[_0x129b('0x12')]['message']);return _0x2c99a1(_0x1abf45[_0x129b('0x12')]['message']);}else{logger[_0x129b('0x14')](_0x129b('0xe'),_0x3ef769,_0x129b('0x11'));_0x2c99a1(_0x1abf45['result'][_0x129b('0x15')]);}})[_0x129b('0x16')](function(_0x1364f8){logger[_0x129b('0x12')](_0x129b('0xe'),_0x3ef769,_0x1364f8);_0x1e29d6(_0x1364f8);});});}
\ No newline at end of file
+var _0x1aab=['CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1aab,0x122));var _0xb1aa=function(_0x336a3b,_0x1d422c){_0x336a3b=_0x336a3b-0x0;var _0x1f505a=_0x1aab[_0x336a3b];return _0x1f505a;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var moment=require(_0xb1aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1aa('0x4'))['db'];var utils=require(_0xb1aa('0x5'));var logger=require(_0xb1aa('0x6'))(_0xb1aa('0x7'));var config=require(_0xb1aa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb1aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x277448,_0x13a350,_0x283ad6){return new BPromise(function(_0x3415f7,_0x405387){return client[_0xb1aa('0xa')](_0x277448,_0x283ad6)['then'](function(_0x12067d){logger[_0xb1aa('0xb')]('CloudProvider,\x20%s,\x20%s',_0x13a350,_0xb1aa('0xc'));logger[_0xb1aa('0xd')](_0xb1aa('0xe'),_0x13a350,_0xb1aa('0xc'),JSON[_0xb1aa('0xf')](_0x12067d));if(_0x12067d[_0xb1aa('0x10')]){if(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x11')]===0x1f4){logger[_0xb1aa('0x10')](_0xb1aa('0x12'),_0x13a350,_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);return _0x405387(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);}logger[_0xb1aa('0x10')]('CloudProvider,\x20%s,\x20%s',_0x13a350,_0x12067d['error'][_0xb1aa('0x13')]);return _0x3415f7(_0x12067d['error'][_0xb1aa('0x13')]);}else{logger['info'](_0xb1aa('0x12'),_0x13a350,'request\x20sent');_0x3415f7(_0x12067d[_0xb1aa('0x14')]['message']);}})[_0xb1aa('0x15')](function(_0x408bf8){logger['error'](_0xb1aa('0x12'),_0x13a350,_0x408bf8);_0x405387(_0x408bf8);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 65126e4..02997c6 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x52e4ed,_0x26fb97){var _0x2920bc=function(_0x3752f0){while(--_0x3752f0){_0x52e4ed['push'](_0x52e4ed['shift']());}};_0x2920bc(++_0x26fb97);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x139172,_0x3745e4){var _0x5ee33f=function(_0x4caee9){while(--_0x4caee9){_0x139172['push'](_0x139172['shift']());}};_0x5ee33f(++_0x3745e4);}(_0xadb5,0xad));var _0x5adb=function(_0x4973c5,_0x5694de){_0x4973c5=_0x4973c5-0x0;var _0x5c0ed1=_0xadb5[_0x4973c5];return _0x5c0ed1;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('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 80e16f8..3f93a21 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 _0xf57a=['sequelize','STRING'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xf57a,0x108));var _0xaf57=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf57a[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xaf57('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf57('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xaf57('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaf57('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xaf57('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xaf57('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xaf57('0x1')]},'sCity':{'type':Sequelize[_0xaf57('0x1')]},'sCountry':{'type':Sequelize[_0xaf57('0x1')]},'description':{'type':Sequelize[_0xaf57('0x1')]}};
\ No newline at end of file
+var _0xef8b=['exports','STRING','name'];(function(_0x5dc4fb,_0xf9b034){var _0x3b2a3e=function(_0x2ea71b){while(--_0x2ea71b){_0x5dc4fb['push'](_0x5dc4fb['shift']());}};_0x3b2a3e(++_0xf9b034);}(_0xef8b,0x192));var _0xbef8=function(_0xdb01a,_0x54a83a){_0xdb01a=_0xdb01a-0x0;var _0x107ede=_0xef8b[_0xdb01a];return _0x107ede;};'use strict';var Sequelize=require('sequelize');module[_0xbef8('0x0')]={'name':{'type':Sequelize[_0xbef8('0x1')],'unique':_0xbef8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbef8('0x1')]},'companyId':{'type':Sequelize[_0xbef8('0x1')]},'website':{'type':Sequelize[_0xbef8('0x1')]},'phone':{'type':Sequelize[_0xbef8('0x1')]},'fax':{'type':Sequelize[_0xbef8('0x1')]},'type':{'type':Sequelize[_0xbef8('0x1')]},'street':{'type':Sequelize[_0xbef8('0x1')]},'postalCode':{'type':Sequelize[_0xbef8('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbef8('0x1')]},'email':{'type':Sequelize[_0xbef8('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbef8('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xbef8('0x1')]},'sCity':{'type':Sequelize[_0xbef8('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 6d47881..4842556 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 _0xa935=['show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','addContacts','CmContact','params','ids','omit','findOne','filter','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','end','error','stack','send','index','describe','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','options','CmCompany','count','includeAll','include','findAll','rows','catch'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xa935,0x120));var _0x5a93=function(_0xbaf094,_0x2f86ad){_0xbaf094=_0xbaf094-0x0;var _0x3974fd=_0xa935[_0xbaf094];return _0x3974fd;};'use strict';var emlformat=require(_0x5a93('0x0'));var rimraf=require(_0x5a93('0x1'));var zipdir=require(_0x5a93('0x2'));var jsonpatch=require(_0x5a93('0x3'));var rp=require(_0x5a93('0x4'));var moment=require(_0x5a93('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5a93('0x6'));var util=require('util');var path=require(_0x5a93('0x7'));var sox=require(_0x5a93('0x8'));var csv=require(_0x5a93('0x9'));var ejs=require(_0x5a93('0xa'));var fs=require('fs');var fs_extra=require(_0x5a93('0xb'));var _=require(_0x5a93('0xc'));var squel=require(_0x5a93('0xd'));var crypto=require('crypto');var jsforce=require(_0x5a93('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5a93('0x9'));var querystring=require(_0x5a93('0xf'));var Papa=require('papaparse');var Redis=require(_0x5a93('0x10'));var authService=require(_0x5a93('0x11'));var qs=require(_0x5a93('0x12'));var as=require(_0x5a93('0x13'));var hardwareService=require(_0x5a93('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5a93('0x15'));var config=require(_0x5a93('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a93('0x17'))['db'];function respondWithStatusCode(_0xc32fb,_0x3baca4){_0x3baca4=_0x3baca4||0xcc;return function(_0x36241d){if(_0x36241d){return _0xc32fb[_0x5a93('0x18')](_0x3baca4);}return _0xc32fb['status'](_0x3baca4)['end']();};}function respondWithResult(_0xb61717,_0x5290e0){_0x5290e0=_0x5290e0||0xc8;return function(_0x3f3251){if(_0x3f3251){return _0xb61717[_0x5a93('0x19')](_0x5290e0)[_0x5a93('0x1a')](_0x3f3251);}};}function respondWithFilteredResult(_0x615998,_0x21fd64){return function(_0x1ecbb7){if(_0x1ecbb7){var _0x296650=typeof _0x21fd64['offset']===_0x5a93('0x1b')&&typeof _0x21fd64['limit']===_0x5a93('0x1b');var _0xb0c114=_0x1ecbb7['count'];var _0x510241=_0x296650?0x0:_0x21fd64['offset'];var _0xd6fced=_0x296650?_0x1ecbb7['count']:_0x21fd64[_0x5a93('0x1c')]+_0x21fd64[_0x5a93('0x1d')];var _0x282ece;if(_0xd6fced>=_0xb0c114){_0xd6fced=_0xb0c114;_0x282ece=0xc8;}else{_0x282ece=0xce;}_0x615998['status'](_0x282ece);return _0x615998[_0x5a93('0x1e')](_0x5a93('0x1f'),_0x510241+'-'+_0xd6fced+'/'+_0xb0c114)[_0x5a93('0x1a')](_0x1ecbb7);}return null;};}function patchUpdates(_0xc43576){return function(_0x24ee83){try{jsonpatch[_0x5a93('0x20')](_0x24ee83,_0xc43576,!![]);}catch(_0x586242){return BPromise[_0x5a93('0x21')](_0x586242);}return _0x24ee83[_0x5a93('0x22')]();};}function saveUpdates(_0x389a48,_0x30139f){return function(_0xa6b6ff){if(_0xa6b6ff){return _0xa6b6ff['update'](_0x389a48)[_0x5a93('0x23')](function(_0x1ce08e){return _0x1ce08e;});}return null;};}function removeEntity(_0x468131,_0x190219){return function(_0x30f526){if(_0x30f526){return _0x30f526[_0x5a93('0x24')]()[_0x5a93('0x23')](function(){var _0x5b988c=_0x30f526[_0x5a93('0x25')]({'plain':!![]});var _0x4dbd36='Companies';return db['UserProfileResource'][_0x5a93('0x24')]({'where':{'type':_0x4dbd36,'resourceId':_0x5b988c['id']}})[_0x5a93('0x23')](function(){return _0x30f526;});})[_0x5a93('0x23')](function(){_0x468131[_0x5a93('0x19')](0xcc)[_0x5a93('0x26')]();});}};}function handleEntityNotFound(_0x54c58a,_0x41d4fd){return function(_0x6de4f0){if(!_0x6de4f0){_0x54c58a[_0x5a93('0x18')](0x194);}return _0x6de4f0;};}function handleError(_0x462d87,_0x498644){_0x498644=_0x498644||0x1f4;return function(_0x1d5b4e){logger[_0x5a93('0x27')](_0x1d5b4e[_0x5a93('0x28')]);if(_0x1d5b4e['name']){delete _0x1d5b4e['name'];}_0x462d87[_0x5a93('0x19')](_0x498644)[_0x5a93('0x29')](_0x1d5b4e);};}exports[_0x5a93('0x2a')]=function(_0x485e20,_0x472087){var _0x445078={},_0x1d34b1={},_0x17e7b6={'count':0x0,'rows':[]};return db['CmCompany'][_0x5a93('0x2b')]()[_0x5a93('0x23')](function(_0x2d1cf1){_0x1d34b1[_0x5a93('0x2c')]=_['keys'](_0x2d1cf1);_0x1d34b1['query']=_[_0x5a93('0x2d')](_0x485e20[_0x5a93('0x2e')]);_0x1d34b1[_0x5a93('0x2f')]=_['intersection'](_0x1d34b1[_0x5a93('0x2c')],_0x1d34b1[_0x5a93('0x2e')]);_0x445078[_0x5a93('0x30')]=_[_0x5a93('0x31')](_0x1d34b1['model'],qs[_0x5a93('0x32')](_0x485e20[_0x5a93('0x2e')][_0x5a93('0x32')]));_0x445078[_0x5a93('0x30')]=_0x445078[_0x5a93('0x30')][_0x5a93('0x33')]?_0x445078['attributes']:_0x1d34b1[_0x5a93('0x2c')];if(!_0x485e20['query'][_0x5a93('0x34')](_0x5a93('0x35'))){_0x445078['limit']=qs[_0x5a93('0x1d')](_0x485e20[_0x5a93('0x2e')][_0x5a93('0x1d')]);_0x445078[_0x5a93('0x1c')]=qs['offset'](_0x485e20[_0x5a93('0x2e')][_0x5a93('0x1c')]);}_0x445078[_0x5a93('0x36')]=qs[_0x5a93('0x37')](_0x485e20['query'][_0x5a93('0x37')]);_0x445078[_0x5a93('0x38')]=qs[_0x5a93('0x2f')](_[_0x5a93('0x39')](_0x485e20[_0x5a93('0x2e')],_0x1d34b1[_0x5a93('0x2f')]),_0x2d1cf1);if(_0x485e20[_0x5a93('0x2e')]['filter']){_0x445078['where']=_[_0x5a93('0x3a')](_0x445078['where'],{'$or':_[_0x5a93('0x3b')](_0x445078['attributes'],function(_0x1c016e){var _0x4dcb87={};_0x4dcb87[_0x1c016e]={'$like':'%'+_0x485e20['query']['filter']+'%'};return _0x4dcb87;})});}_0x445078=_['merge']({},_0x445078,_0x485e20[_0x5a93('0x3c')]);var _0x23974a={'where':_0x445078[_0x5a93('0x38')]};return db[_0x5a93('0x3d')][_0x5a93('0x3e')](_0x23974a)[_0x5a93('0x23')](function(_0x8da53a){_0x17e7b6[_0x5a93('0x3e')]=_0x8da53a;if(_0x485e20[_0x5a93('0x2e')][_0x5a93('0x3f')]){_0x445078[_0x5a93('0x40')]=[{'all':!![]}];}return db[_0x5a93('0x3d')][_0x5a93('0x41')](_0x445078);})['then'](function(_0xb6abd4){_0x17e7b6[_0x5a93('0x42')]=_0xb6abd4;return _0x17e7b6;})[_0x5a93('0x23')](respondWithFilteredResult(_0x472087,_0x445078))[_0x5a93('0x43')](handleError(_0x472087,null));})[_0x5a93('0x43')](handleError(_0x472087,null));};exports[_0x5a93('0x44')]=function(_0xbe22f2,_0x41495e){var _0x4c0e36={'raw':![],'where':{'id':_0xbe22f2['params']['id']}},_0x4b4e14={};_0x4b4e14['model']=_['keys'](db[_0x5a93('0x3d')][_0x5a93('0x45')]);_0x4b4e14[_0x5a93('0x2e')]=_['keys'](_0xbe22f2[_0x5a93('0x2e')]);_0x4b4e14[_0x5a93('0x2f')]=_[_0x5a93('0x31')](_0x4b4e14[_0x5a93('0x2c')],_0x4b4e14[_0x5a93('0x2e')]);_0x4c0e36[_0x5a93('0x30')]=_[_0x5a93('0x31')](_0x4b4e14[_0x5a93('0x2c')],qs[_0x5a93('0x32')](_0xbe22f2[_0x5a93('0x2e')]['fields']));_0x4c0e36[_0x5a93('0x30')]=_0x4c0e36['attributes'][_0x5a93('0x33')]?_0x4c0e36[_0x5a93('0x30')]:_0x4b4e14['model'];if(_0xbe22f2[_0x5a93('0x2e')][_0x5a93('0x3f')]){_0x4c0e36[_0x5a93('0x40')]=[{'all':!![]}];}_0x4c0e36=_[_0x5a93('0x3a')]({},_0x4c0e36,_0xbe22f2[_0x5a93('0x3c')]);return db['CmCompany'][_0x5a93('0x46')](_0x4c0e36)['then'](handleEntityNotFound(_0x41495e,null))[_0x5a93('0x23')](respondWithResult(_0x41495e,null))['catch'](handleError(_0x41495e,null));};exports['create']=function(_0x33a641,_0x186d2e){return db[_0x5a93('0x3d')][_0x5a93('0x47')](_0x33a641[_0x5a93('0x48')],{})[_0x5a93('0x23')](function(_0x28de0e){var _0x10a411=_0x33a641[_0x5a93('0x49')][_0x5a93('0x25')]({'plain':!![]});if(!_0x10a411)throw new Error(_0x5a93('0x4a'));if(_0x10a411[_0x5a93('0x4b')]===_0x5a93('0x49')){var _0x3c4f06=_0x28de0e[_0x5a93('0x25')]({'plain':!![]});var _0x4ee28f='Companies';return db[_0x5a93('0x4c')][_0x5a93('0x46')]({'where':{'name':_0x4ee28f,'userProfileId':_0x10a411[_0x5a93('0x4d')]},'raw':!![]})[_0x5a93('0x23')](function(_0x567417){if(_0x567417&&_0x567417[_0x5a93('0x4e')]===0x0){return db[_0x5a93('0x4f')][_0x5a93('0x47')]({'name':_0x3c4f06['name'],'resourceId':_0x3c4f06['id'],'type':_0x567417['name'],'sectionId':_0x567417['id']},{})[_0x5a93('0x23')](function(){return _0x28de0e;});}else{return _0x28de0e;}})[_0x5a93('0x43')](function(_0x29cc14){logger[_0x5a93('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29cc14);throw _0x29cc14;});}return _0x28de0e;})[_0x5a93('0x23')](respondWithResult(_0x186d2e,0xc9))[_0x5a93('0x43')](handleError(_0x186d2e,null));};exports[_0x5a93('0x50')]=function(_0x22a08e,_0x349b94){if(_0x22a08e[_0x5a93('0x48')]['id']){delete _0x22a08e[_0x5a93('0x48')]['id'];}return db[_0x5a93('0x3d')][_0x5a93('0x46')]({'where':{'id':_0x22a08e['params']['id']}})[_0x5a93('0x23')](handleEntityNotFound(_0x349b94,null))[_0x5a93('0x23')](saveUpdates(_0x22a08e[_0x5a93('0x48')],null))[_0x5a93('0x23')](respondWithResult(_0x349b94,null))[_0x5a93('0x43')](handleError(_0x349b94,null));};exports[_0x5a93('0x24')]=function(_0x395eab,_0x51631f){return db[_0x5a93('0x3d')]['find']({'where':{'id':_0x395eab['params']['id']}})[_0x5a93('0x23')](handleEntityNotFound(_0x51631f,null))[_0x5a93('0x23')](removeEntity(_0x51631f,null))['catch'](handleError(_0x51631f,null));};exports[_0x5a93('0x2b')]=function(_0x161b43,_0x18aeac){return db[_0x5a93('0x3d')][_0x5a93('0x2b')]()[_0x5a93('0x23')](respondWithResult(_0x18aeac,null))[_0x5a93('0x43')](handleError(_0x18aeac,null));};exports[_0x5a93('0x51')]=function(_0x5129b3,_0x4519e2,_0x48bedd){return db[_0x5a93('0x52')][_0x5a93('0x46')]({'where':{'id':_0x5129b3[_0x5a93('0x53')]['id']}})[_0x5a93('0x23')](handleEntityNotFound(_0x4519e2,null))['then'](function(_0x587a5e){if(_0x587a5e){return _0x587a5e['addContacts'](_0x5129b3[_0x5a93('0x48')][_0x5a93('0x54')],_[_0x5a93('0x55')](_0x5129b3[_0x5a93('0x48')],[_0x5a93('0x54'),'id'])||{});}})['then'](respondWithResult(_0x4519e2,null))['catch'](handleError(_0x4519e2,null));};exports['getContacts']=function(_0x4438dc,_0x51b10f,_0x25fadd){var _0x2efbd1={};var _0x250092={};var _0xeafa5d;var _0x151955;return db[_0x5a93('0x3d')][_0x5a93('0x56')]({'where':{'id':_0x4438dc['params']['id']}})[_0x5a93('0x23')](handleEntityNotFound(_0x51b10f,null))[_0x5a93('0x23')](function(_0x2f0609){if(_0x2f0609){_0xeafa5d=_0x2f0609;_0x250092['model']=_['keys'](db[_0x5a93('0x52')][_0x5a93('0x45')]);_0x250092[_0x5a93('0x2e')]=_[_0x5a93('0x2d')](_0x4438dc['query']);_0x250092[_0x5a93('0x2f')]=_['intersection'](_0x250092[_0x5a93('0x2c')],_0x250092[_0x5a93('0x2e')]);_0x2efbd1[_0x5a93('0x30')]=_[_0x5a93('0x31')](_0x250092[_0x5a93('0x2c')],qs[_0x5a93('0x32')](_0x4438dc['query'][_0x5a93('0x32')]));_0x2efbd1[_0x5a93('0x30')]=_0x2efbd1['attributes'][_0x5a93('0x33')]?_0x2efbd1['attributes']:_0x250092['model'];_0x2efbd1[_0x5a93('0x36')]=qs[_0x5a93('0x37')](_0x4438dc['query'][_0x5a93('0x37')]);_0x2efbd1[_0x5a93('0x38')]=qs[_0x5a93('0x2f')](_[_0x5a93('0x39')](_0x4438dc['query'],_0x250092['filters']));if(_0x4438dc['query'][_0x5a93('0x57')]){_0x2efbd1[_0x5a93('0x38')]=_[_0x5a93('0x3a')](_0x2efbd1[_0x5a93('0x38')],{'$or':_[_0x5a93('0x3b')](_0x2efbd1['attributes'],function(_0xda95c9){var _0x4e65a3={};_0x4e65a3[_0xda95c9]={'$like':'%'+_0x4438dc['query'][_0x5a93('0x57')]+'%'};return _0x4e65a3;})});}_0x2efbd1=_[_0x5a93('0x3a')]({},_0x2efbd1,_0x4438dc[_0x5a93('0x3c')]);return _0xeafa5d[_0x5a93('0x58')](_0x2efbd1);}})[_0x5a93('0x23')](function(_0x3a5d02){if(_0x3a5d02){_0x151955=_0x3a5d02[_0x5a93('0x33')];if(!_0x4438dc[_0x5a93('0x2e')][_0x5a93('0x34')]('nolimit')){_0x2efbd1['limit']=qs['limit'](_0x4438dc[_0x5a93('0x2e')]['limit']);_0x2efbd1['offset']=qs['offset'](_0x4438dc[_0x5a93('0x2e')][_0x5a93('0x1c')]);}return _0xeafa5d[_0x5a93('0x58')](_0x2efbd1);}})[_0x5a93('0x23')](function(_0x22d980){if(_0x22d980){return _0x22d980?{'count':_0x151955,'rows':_0x22d980}:null;}})[_0x5a93('0x23')](respondWithResult(_0x51b10f,null))['catch'](handleError(_0x51b10f,null));};
\ No newline at end of file
+var _0x7736=['error','stack','name','CmCompany','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','describe','addContacts','ids','getContacts','findOne','CmContact','nolimit','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','sendStatus'];(function(_0x22c6cd,_0x5eb90e){var _0x2da0e9=function(_0x32a2ed){while(--_0x32a2ed){_0x22c6cd['push'](_0x22c6cd['shift']());}};_0x2da0e9(++_0x5eb90e);}(_0x7736,0x13b));var _0x6773=function(_0x99a726,_0x1f9436){_0x99a726=_0x99a726-0x0;var _0x41f6dc=_0x7736[_0x99a726];return _0x41f6dc;};'use strict';var emlformat=require(_0x6773('0x0'));var rimraf=require(_0x6773('0x1'));var zipdir=require(_0x6773('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6773('0x3'));var moment=require('moment');var BPromise=require(_0x6773('0x4'));var Mustache=require('mustache');var util=require(_0x6773('0x5'));var path=require(_0x6773('0x6'));var sox=require(_0x6773('0x7'));var csv=require(_0x6773('0x8'));var ejs=require(_0x6773('0x9'));var fs=require('fs');var fs_extra=require(_0x6773('0xa'));var _=require(_0x6773('0xb'));var squel=require(_0x6773('0xc'));var crypto=require(_0x6773('0xd'));var jsforce=require(_0x6773('0xe'));var deskjs=require(_0x6773('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6773('0x10'));var Papa=require(_0x6773('0x11'));var Redis=require(_0x6773('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6773('0x13'));var logger=require(_0x6773('0x14'))(_0x6773('0x15'));var utils=require('../../config/utils');var config=require(_0x6773('0x16'));var licenseUtil=require(_0x6773('0x17'));var db=require(_0x6773('0x18'))['db'];function respondWithStatusCode(_0x1e68ae,_0x1b47e2){_0x1b47e2=_0x1b47e2||0xcc;return function(_0x4aabea){if(_0x4aabea){return _0x1e68ae['sendStatus'](_0x1b47e2);}return _0x1e68ae['status'](_0x1b47e2)[_0x6773('0x19')]();};}function respondWithResult(_0x98dfbe,_0x4c2b9c){_0x4c2b9c=_0x4c2b9c||0xc8;return function(_0x4afa77){if(_0x4afa77){return _0x98dfbe[_0x6773('0x1a')](_0x4c2b9c)[_0x6773('0x1b')](_0x4afa77);}};}function respondWithFilteredResult(_0x241de9,_0x9c1850){return function(_0x2b9f8a){if(_0x2b9f8a){var _0x5883f3=typeof _0x9c1850[_0x6773('0x1c')]===_0x6773('0x1d')&&typeof _0x9c1850['limit']==='undefined';var _0x2ca55f=_0x2b9f8a['count'];var _0x3bba78=_0x5883f3?0x0:_0x9c1850[_0x6773('0x1c')];var _0x444e46=_0x5883f3?_0x2b9f8a[_0x6773('0x1e')]:_0x9c1850[_0x6773('0x1c')]+_0x9c1850['limit'];var _0x324f90;if(_0x444e46>=_0x2ca55f){_0x444e46=_0x2ca55f;_0x324f90=0xc8;}else{_0x324f90=0xce;}_0x241de9[_0x6773('0x1a')](_0x324f90);return _0x241de9[_0x6773('0x1f')](_0x6773('0x20'),_0x3bba78+'-'+_0x444e46+'/'+_0x2ca55f)[_0x6773('0x1b')](_0x2b9f8a);}return null;};}function patchUpdates(_0x4a55ef){return function(_0x376f69){try{jsonpatch[_0x6773('0x21')](_0x376f69,_0x4a55ef,!![]);}catch(_0x5131ec){return BPromise[_0x6773('0x22')](_0x5131ec);}return _0x376f69[_0x6773('0x23')]();};}function saveUpdates(_0x16d264,_0x3bcd13){return function(_0x890e55){if(_0x890e55){return _0x890e55['update'](_0x16d264)[_0x6773('0x24')](function(_0x5bc81a){return _0x5bc81a;});}return null;};}function removeEntity(_0x435498,_0x25d99c){return function(_0x212e4c){if(_0x212e4c){return _0x212e4c['destroy']()[_0x6773('0x24')](function(){var _0x21a612=_0x212e4c[_0x6773('0x25')]({'plain':!![]});var _0x2e6d06=_0x6773('0x26');return db[_0x6773('0x27')]['destroy']({'where':{'type':_0x2e6d06,'resourceId':_0x21a612['id']}})[_0x6773('0x24')](function(){return _0x212e4c;});})[_0x6773('0x24')](function(){_0x435498[_0x6773('0x1a')](0xcc)[_0x6773('0x19')]();});}};}function handleEntityNotFound(_0x56f8b5,_0x547d66){return function(_0x41a3a8){if(!_0x41a3a8){_0x56f8b5[_0x6773('0x28')](0x194);}return _0x41a3a8;};}function handleError(_0xfccda1,_0x51735a){_0x51735a=_0x51735a||0x1f4;return function(_0x2113c3){logger[_0x6773('0x29')](_0x2113c3[_0x6773('0x2a')]);if(_0x2113c3[_0x6773('0x2b')]){delete _0x2113c3['name'];}_0xfccda1[_0x6773('0x1a')](_0x51735a)['send'](_0x2113c3);};}exports['index']=function(_0x2406b9,_0x174a38){var _0x44f446={},_0x355349={},_0x5ebab3={'count':0x0,'rows':[]};return db[_0x6773('0x2c')]['describe']()['then'](function(_0x178e6d){_0x355349[_0x6773('0x2d')]=_[_0x6773('0x2e')](_0x178e6d);_0x355349[_0x6773('0x2f')]=_[_0x6773('0x2e')](_0x2406b9[_0x6773('0x2f')]);_0x355349['filters']=_['intersection'](_0x355349['model'],_0x355349[_0x6773('0x2f')]);_0x44f446[_0x6773('0x30')]=_[_0x6773('0x31')](_0x355349[_0x6773('0x2d')],qs[_0x6773('0x32')](_0x2406b9[_0x6773('0x2f')]['fields']));_0x44f446[_0x6773('0x30')]=_0x44f446['attributes'][_0x6773('0x33')]?_0x44f446['attributes']:_0x355349[_0x6773('0x2d')];if(!_0x2406b9[_0x6773('0x2f')][_0x6773('0x34')]('nolimit')){_0x44f446['limit']=qs[_0x6773('0x35')](_0x2406b9[_0x6773('0x2f')][_0x6773('0x35')]);_0x44f446[_0x6773('0x1c')]=qs[_0x6773('0x1c')](_0x2406b9[_0x6773('0x2f')][_0x6773('0x1c')]);}_0x44f446[_0x6773('0x36')]=qs[_0x6773('0x37')](_0x2406b9[_0x6773('0x2f')][_0x6773('0x37')]);_0x44f446['where']=qs[_0x6773('0x38')](_[_0x6773('0x39')](_0x2406b9[_0x6773('0x2f')],_0x355349[_0x6773('0x38')]),_0x178e6d);if(_0x2406b9['query'][_0x6773('0x3a')]){_0x44f446[_0x6773('0x3b')]=_[_0x6773('0x3c')](_0x44f446[_0x6773('0x3b')],{'$or':_[_0x6773('0x3d')](_0x44f446[_0x6773('0x30')],function(_0xac8364){var _0x4e476b={};_0x4e476b[_0xac8364]={'$like':'%'+_0x2406b9['query'][_0x6773('0x3a')]+'%'};return _0x4e476b;})});}_0x44f446=_[_0x6773('0x3c')]({},_0x44f446,_0x2406b9[_0x6773('0x3e')]);var _0xbce8d3={'where':_0x44f446['where']};return db['CmCompany'][_0x6773('0x1e')](_0xbce8d3)[_0x6773('0x24')](function(_0x18c1f5){_0x5ebab3[_0x6773('0x1e')]=_0x18c1f5;if(_0x2406b9['query'][_0x6773('0x3f')]){_0x44f446[_0x6773('0x40')]=[{'all':!![]}];}return db[_0x6773('0x2c')][_0x6773('0x41')](_0x44f446);})[_0x6773('0x24')](function(_0x200f4a){_0x5ebab3[_0x6773('0x42')]=_0x200f4a;return _0x5ebab3;})[_0x6773('0x24')](respondWithFilteredResult(_0x174a38,_0x44f446))['catch'](handleError(_0x174a38,null));})[_0x6773('0x43')](handleError(_0x174a38,null));};exports[_0x6773('0x44')]=function(_0x108f43,_0x3625a7){var _0x4e3a42={'raw':![],'where':{'id':_0x108f43[_0x6773('0x45')]['id']}},_0x5a17a6={};_0x5a17a6[_0x6773('0x2d')]=_[_0x6773('0x2e')](db['CmCompany'][_0x6773('0x46')]);_0x5a17a6[_0x6773('0x2f')]=_['keys'](_0x108f43[_0x6773('0x2f')]);_0x5a17a6[_0x6773('0x38')]=_[_0x6773('0x31')](_0x5a17a6[_0x6773('0x2d')],_0x5a17a6[_0x6773('0x2f')]);_0x4e3a42[_0x6773('0x30')]=_[_0x6773('0x31')](_0x5a17a6[_0x6773('0x2d')],qs[_0x6773('0x32')](_0x108f43[_0x6773('0x2f')][_0x6773('0x32')]));_0x4e3a42['attributes']=_0x4e3a42['attributes'][_0x6773('0x33')]?_0x4e3a42['attributes']:_0x5a17a6['model'];if(_0x108f43[_0x6773('0x2f')][_0x6773('0x3f')]){_0x4e3a42['include']=[{'all':!![]}];}_0x4e3a42=_[_0x6773('0x3c')]({},_0x4e3a42,_0x108f43[_0x6773('0x3e')]);return db['CmCompany'][_0x6773('0x47')](_0x4e3a42)[_0x6773('0x24')](handleEntityNotFound(_0x3625a7,null))['then'](respondWithResult(_0x3625a7,null))['catch'](handleError(_0x3625a7,null));};exports[_0x6773('0x48')]=function(_0x477b22,_0x118950){return db[_0x6773('0x2c')]['create'](_0x477b22['body'],{})['then'](function(_0x47d768){var _0x2549ef=_0x477b22[_0x6773('0x49')]['get']({'plain':!![]});if(!_0x2549ef)throw new Error(_0x6773('0x4a'));if(_0x2549ef[_0x6773('0x4b')]===_0x6773('0x49')){var _0x5aecf0=_0x47d768[_0x6773('0x25')]({'plain':!![]});var _0x5764fc=_0x6773('0x26');return db['UserProfileSection'][_0x6773('0x47')]({'where':{'name':_0x5764fc,'userProfileId':_0x2549ef[_0x6773('0x4c')]},'raw':!![]})[_0x6773('0x24')](function(_0x2dd27f){if(_0x2dd27f&&_0x2dd27f[_0x6773('0x4d')]===0x0){return db['UserProfileResource'][_0x6773('0x48')]({'name':_0x5aecf0['name'],'resourceId':_0x5aecf0['id'],'type':_0x2dd27f['name'],'sectionId':_0x2dd27f['id']},{})['then'](function(){return _0x47d768;});}else{return _0x47d768;}})['catch'](function(_0x229e27){logger[_0x6773('0x29')](_0x6773('0x4e'),_0x229e27);throw _0x229e27;});}return _0x47d768;})['then'](respondWithResult(_0x118950,0xc9))[_0x6773('0x43')](handleError(_0x118950,null));};exports[_0x6773('0x4f')]=function(_0x549227,_0x1abfeb){if(_0x549227[_0x6773('0x50')]['id']){delete _0x549227['body']['id'];}return db['CmCompany']['find']({'where':{'id':_0x549227[_0x6773('0x45')]['id']}})[_0x6773('0x24')](handleEntityNotFound(_0x1abfeb,null))[_0x6773('0x24')](saveUpdates(_0x549227[_0x6773('0x50')],null))[_0x6773('0x24')](respondWithResult(_0x1abfeb,null))['catch'](handleError(_0x1abfeb,null));};exports[_0x6773('0x51')]=function(_0x499e8c,_0x1fe567){return db[_0x6773('0x2c')][_0x6773('0x47')]({'where':{'id':_0x499e8c[_0x6773('0x45')]['id']}})[_0x6773('0x24')](handleEntityNotFound(_0x1fe567,null))[_0x6773('0x24')](removeEntity(_0x1fe567,null))[_0x6773('0x43')](handleError(_0x1fe567,null));};exports[_0x6773('0x52')]=function(_0x4d82f2,_0x505c2f){return db[_0x6773('0x2c')][_0x6773('0x52')]()['then'](respondWithResult(_0x505c2f,null))[_0x6773('0x43')](handleError(_0x505c2f,null));};exports[_0x6773('0x53')]=function(_0x38ff6d,_0x5d67df,_0xba08f4){return db['CmContact']['find']({'where':{'id':_0x38ff6d[_0x6773('0x45')]['id']}})[_0x6773('0x24')](handleEntityNotFound(_0x5d67df,null))[_0x6773('0x24')](function(_0xf71307){if(_0xf71307){return _0xf71307[_0x6773('0x53')](_0x38ff6d[_0x6773('0x50')][_0x6773('0x54')],_['omit'](_0x38ff6d[_0x6773('0x50')],[_0x6773('0x54'),'id'])||{});}})['then'](respondWithResult(_0x5d67df,null))['catch'](handleError(_0x5d67df,null));};exports[_0x6773('0x55')]=function(_0x248aac,_0xa06cb5,_0xfa9ea0){var _0x4d6a8d={};var _0x3c7e7e={};var _0x29aec1;var _0x4297bb;return db['CmCompany'][_0x6773('0x56')]({'where':{'id':_0x248aac[_0x6773('0x45')]['id']}})['then'](handleEntityNotFound(_0xa06cb5,null))[_0x6773('0x24')](function(_0x179617){if(_0x179617){_0x29aec1=_0x179617;_0x3c7e7e[_0x6773('0x2d')]=_['keys'](db[_0x6773('0x57')][_0x6773('0x46')]);_0x3c7e7e[_0x6773('0x2f')]=_['keys'](_0x248aac['query']);_0x3c7e7e[_0x6773('0x38')]=_[_0x6773('0x31')](_0x3c7e7e[_0x6773('0x2d')],_0x3c7e7e[_0x6773('0x2f')]);_0x4d6a8d[_0x6773('0x30')]=_[_0x6773('0x31')](_0x3c7e7e['model'],qs[_0x6773('0x32')](_0x248aac[_0x6773('0x2f')][_0x6773('0x32')]));_0x4d6a8d['attributes']=_0x4d6a8d[_0x6773('0x30')]['length']?_0x4d6a8d[_0x6773('0x30')]:_0x3c7e7e[_0x6773('0x2d')];_0x4d6a8d[_0x6773('0x36')]=qs[_0x6773('0x37')](_0x248aac[_0x6773('0x2f')]['sort']);_0x4d6a8d['where']=qs[_0x6773('0x38')](_[_0x6773('0x39')](_0x248aac[_0x6773('0x2f')],_0x3c7e7e[_0x6773('0x38')]));if(_0x248aac[_0x6773('0x2f')][_0x6773('0x3a')]){_0x4d6a8d[_0x6773('0x3b')]=_[_0x6773('0x3c')](_0x4d6a8d[_0x6773('0x3b')],{'$or':_[_0x6773('0x3d')](_0x4d6a8d['attributes'],function(_0x385acc){var _0x195119={};_0x195119[_0x385acc]={'$like':'%'+_0x248aac[_0x6773('0x2f')][_0x6773('0x3a')]+'%'};return _0x195119;})});}_0x4d6a8d=_['merge']({},_0x4d6a8d,_0x248aac[_0x6773('0x3e')]);return _0x29aec1['getContacts'](_0x4d6a8d);}})[_0x6773('0x24')](function(_0x3a3e24){if(_0x3a3e24){_0x4297bb=_0x3a3e24['length'];if(!_0x248aac[_0x6773('0x2f')][_0x6773('0x34')](_0x6773('0x58'))){_0x4d6a8d[_0x6773('0x35')]=qs[_0x6773('0x35')](_0x248aac[_0x6773('0x2f')][_0x6773('0x35')]);_0x4d6a8d[_0x6773('0x1c')]=qs[_0x6773('0x1c')](_0x248aac[_0x6773('0x2f')][_0x6773('0x1c')]);}return _0x29aec1[_0x6773('0x55')](_0x4d6a8d);}})[_0x6773('0x24')](function(_0x526d46){if(_0x526d46){return _0x526d46?{'count':_0x4297bb,'rows':_0x526d46}:null;}})['then'](respondWithResult(_0xa06cb5,null))['catch'](handleError(_0xa06cb5,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 9c4cd7a..0ab58c0 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 _0x236b=['rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x236b,0x158));var _0xb236=function(_0x574607,_0x3cfc23){_0x574607=_0x574607-0x0;var _0x3398c9=_0x236b[_0x574607];return _0x3398c9;};'use strict';var _=require(_0xb236('0x0'));var util=require(_0xb236('0x1'));var logger=require(_0xb236('0x2'))(_0xb236('0x3'));var moment=require(_0xb236('0x4'));var BPromise=require('bluebird');var rp=require(_0xb236('0x5'));var fs=require('fs');var path=require(_0xb236('0x6'));var rimraf=require(_0xb236('0x7'));var config=require(_0xb236('0x8'));var attributes=require(_0xb236('0x9'));module[_0xb236('0xa')]=function(_0x148661,_0x361ae0){return _0x148661['define'](_0xb236('0xb'),attributes,{'tableName':_0xb236('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x13b9=['api','bluebird','request-promise','path','rimraf','./cmCompany.attributes','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x572255,_0x486db9){var _0x5196e9=function(_0x439c28){while(--_0x439c28){_0x572255['push'](_0x572255['shift']());}};_0x5196e9(++_0x486db9);}(_0x13b9,0xad));var _0x913b=function(_0x30188e,_0x3c4f44){_0x30188e=_0x30188e-0x0;var _0xac7d52=_0x13b9[_0x30188e];return _0xac7d52;};'use strict';var _=require(_0x913b('0x0'));var util=require(_0x913b('0x1'));var logger=require(_0x913b('0x2'))(_0x913b('0x3'));var moment=require('moment');var BPromise=require(_0x913b('0x4'));var rp=require(_0x913b('0x5'));var fs=require('fs');var path=require(_0x913b('0x6'));var rimraf=require(_0x913b('0x7'));var config=require('../../config/environment');var attributes=require(_0x913b('0x8'));module['exports']=function(_0x44b30c,_0x31a4a2){return _0x44b30c['define'](_0x913b('0x9'),attributes,{'tableName':_0x913b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index a60f7b0..ff721b6 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 _0x6502=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x4b39cf,_0x2b4885){var _0x297208=function(_0x2dcbc9){while(--_0x2dcbc9){_0x4b39cf['push'](_0x4b39cf['shift']());}};_0x297208(++_0x2b4885);}(_0x6502,0x135));var _0x2650=function(_0x342fca,_0x572bdf){_0x342fca=_0x342fca-0x0;var _0x59c1a2=_0x6502[_0x342fca];return _0x59c1a2;};'use strict';var _=require(_0x2650('0x0'));var util=require(_0x2650('0x1'));var moment=require(_0x2650('0x2'));var BPromise=require(_0x2650('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2650('0x4'));var db=require(_0x2650('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2650('0x6'))(_0x2650('0x7'));var config=require(_0x2650('0x8'));var jayson=require(_0x2650('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c05be,_0x1efab2,_0x537132){return new BPromise(function(_0x4155ce,_0x155c6b){return client['request'](_0x3c05be,_0x537132)[_0x2650('0xa')](function(_0x23f51e){logger[_0x2650('0xb')](_0x2650('0xc'),_0x1efab2,_0x2650('0xd'));logger[_0x2650('0xe')](_0x2650('0xf'),_0x1efab2,'request\x20sent',JSON['stringify'](_0x23f51e));if(_0x23f51e[_0x2650('0x10')]){if(_0x23f51e[_0x2650('0x10')][_0x2650('0x11')]===0x1f4){logger[_0x2650('0x10')](_0x2650('0xc'),_0x1efab2,_0x23f51e['error']['message']);return _0x155c6b(_0x23f51e[_0x2650('0x10')][_0x2650('0x12')]);}logger[_0x2650('0x10')](_0x2650('0xc'),_0x1efab2,_0x23f51e[_0x2650('0x10')]['message']);return _0x4155ce(_0x23f51e['error'][_0x2650('0x12')]);}else{logger['info'](_0x2650('0xc'),_0x1efab2,_0x2650('0xd'));_0x4155ce(_0x23f51e['result'][_0x2650('0x12')]);}})[_0x2650('0x13')](function(_0x4dc7fd){logger[_0x2650('0x10')](_0x2650('0xc'),_0x1efab2,_0x4dc7fd);_0x155c6b(_0x4dc7fd);});});}
\ No newline at end of file
+var _0xe58f=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1be448,_0x1fb778){var _0x39a54d=function(_0x335cf9){while(--_0x335cf9){_0x1be448['push'](_0x1be448['shift']());}};_0x39a54d(++_0x1fb778);}(_0xe58f,0x113));var _0xfe58=function(_0x23fdaa,_0x15302b){_0x23fdaa=_0x23fdaa-0x0;var _0x540a39=_0xe58f[_0x23fdaa];return _0x540a39;};'use strict';var _=require(_0xfe58('0x0'));var util=require('util');var moment=require(_0xfe58('0x1'));var BPromise=require(_0xfe58('0x2'));var rs=require(_0xfe58('0x3'));var fs=require('fs');var Redis=require(_0xfe58('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe58('0x5'));var logger=require('../../config/logger')(_0xfe58('0x6'));var config=require(_0xfe58('0x7'));var jayson=require(_0xfe58('0x8'));var client=jayson[_0xfe58('0x9')][_0xfe58('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dcef2,_0x1270b0,_0x482d7a){return new BPromise(function(_0x159510,_0x26aaab){return client['request'](_0x2dcef2,_0x482d7a)['then'](function(_0x6805b9){logger[_0xfe58('0xb')](_0xfe58('0xc'),_0x1270b0,_0xfe58('0xd'));logger[_0xfe58('0xe')](_0xfe58('0xf'),_0x1270b0,_0xfe58('0xd'),JSON[_0xfe58('0x10')](_0x6805b9));if(_0x6805b9[_0xfe58('0x11')]){if(_0x6805b9[_0xfe58('0x11')][_0xfe58('0x12')]===0x1f4){logger[_0xfe58('0x11')]('CmCompany,\x20%s,\x20%s',_0x1270b0,_0x6805b9['error']['message']);return _0x26aaab(_0x6805b9[_0xfe58('0x11')][_0xfe58('0x13')]);}logger[_0xfe58('0x11')](_0xfe58('0xc'),_0x1270b0,_0x6805b9[_0xfe58('0x11')][_0xfe58('0x13')]);return _0x159510(_0x6805b9[_0xfe58('0x11')][_0xfe58('0x13')]);}else{logger[_0xfe58('0xb')]('CmCompany,\x20%s,\x20%s',_0x1270b0,_0xfe58('0xd'));_0x159510(_0x6805b9[_0xfe58('0x14')][_0xfe58('0x13')]);}})['catch'](function(_0x58ef91){logger['error'](_0xfe58('0xc'),_0x1270b0,_0x58ef91);_0x26aaab(_0x58ef91);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index db41fd0..b35e74a 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 _0x8344=['describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','get','/describe'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x8344,0x1c2));var _0x4834=function(_0x2d540e,_0x507489){_0x2d540e=_0x2d540e-0x0;var _0x3b1161=_0x8344[_0x2d540e];return _0x3b1161;};'use strict';var multer=require(_0x4834('0x0'));var util=require(_0x4834('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4834('0x2'));var router=express[_0x4834('0x3')]();var fs_extra=require(_0x4834('0x4'));var auth=require(_0x4834('0x5'));var interaction=require(_0x4834('0x6'));var config=require(_0x4834('0x7'));var controller=require(_0x4834('0x8'));router['get']('/',auth[_0x4834('0x9')](),controller['index']);router[_0x4834('0xa')](_0x4834('0xb'),auth[_0x4834('0x9')](),controller[_0x4834('0xc')]);router[_0x4834('0xa')](_0x4834('0xd'),auth[_0x4834('0x9')](),controller[_0x4834('0xe')]);router[_0x4834('0xa')](_0x4834('0xf'),auth[_0x4834('0x9')](),controller[_0x4834('0x10')]);router[_0x4834('0x11')]('/',auth[_0x4834('0x9')](),controller[_0x4834('0x12')]);router['post'](_0x4834('0xf'),auth[_0x4834('0x9')](),controller[_0x4834('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4834('0x14')]);router['delete'](_0x4834('0xd'),auth[_0x4834('0x9')](),controller['destroy']);module[_0x4834('0x15')]=router;
\ No newline at end of file
+var _0x0068=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','post','addContacts','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x484646,_0xa7feed){var _0x296c03=function(_0x178910){while(--_0x178910){_0x484646['push'](_0x484646['shift']());}};_0x296c03(++_0xa7feed);}(_0x0068,0x15a));var _0x8006=function(_0x5d4a21,_0x3c715d){_0x5d4a21=_0x5d4a21-0x0;var _0x4336a4=_0x0068[_0x5d4a21];return _0x4336a4;};'use strict';var multer=require(_0x8006('0x0'));var util=require(_0x8006('0x1'));var path=require(_0x8006('0x2'));var timeout=require('connect-timeout');var express=require(_0x8006('0x3'));var router=express[_0x8006('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8006('0x5'));var config=require(_0x8006('0x6'));var controller=require(_0x8006('0x7'));router[_0x8006('0x8')]('/',auth[_0x8006('0x9')](),controller[_0x8006('0xa')]);router[_0x8006('0x8')](_0x8006('0xb'),auth[_0x8006('0x9')](),controller[_0x8006('0xc')]);router[_0x8006('0x8')]('/:id',auth[_0x8006('0x9')](),controller[_0x8006('0xd')]);router[_0x8006('0x8')]('/:id/contacts',auth[_0x8006('0x9')](),controller['getContacts']);router[_0x8006('0xe')]('/',auth[_0x8006('0x9')](),controller['create']);router[_0x8006('0xe')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x8006('0xf')]);router[_0x8006('0x10')](_0x8006('0x11'),auth[_0x8006('0x9')](),controller[_0x8006('0x12')]);router[_0x8006('0x13')]('/:id',auth[_0x8006('0x9')](),controller[_0x8006('0x14')]);module[_0x8006('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 3d66ed6..96ad41e 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 _0x973c=['lodash','exports','STRING','INTEGER','DATE','NOW'];(function(_0x386220,_0x35e9e1){var _0x5a0da1=function(_0x3b8c8e){while(--_0x3b8c8e){_0x386220['push'](_0x386220['shift']());}};_0x5a0da1(++_0x35e9e1);}(_0x973c,0x1d4));var _0xc973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x973c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc973('0x0'));var Sequelize=require('sequelize');module[_0xc973('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc973('0x2')]},'postalCode':{'type':Sequelize[_0xc973('0x2')]},'city':{'type':Sequelize[_0xc973('0x2')]},'country':{'type':Sequelize[_0xc973('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xc973('0x2')]},'mobile':{'type':Sequelize[_0xc973('0x2')]},'fax':{'type':Sequelize[_0xc973('0x2')]},'email':{'type':Sequelize[_0xc973('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xc973('0x2')]},'fb_data':{'type':Sequelize[_0xc973('0x2')]},'twitter':{'type':Sequelize[_0xc973('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xc973('0x2')]},'wechat':{'type':Sequelize[_0xc973('0x2')]},'telegram':{'type':Sequelize[_0xc973('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xc973('0x2')]},'priority':{'type':Sequelize[_0xc973('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc973('0x4')],'defaultValue':Sequelize[_0xc973('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xc973('0x3')]}};
\ No newline at end of file
+var _0x24f1=['lodash','sequelize','exports','STRING','TEXT','INTEGER','DATE'];(function(_0x5bd18f,_0x1bd227){var _0x41944c=function(_0x7b5e15){while(--_0x7b5e15){_0x5bd18f['push'](_0x5bd18f['shift']());}};_0x41944c(++_0x1bd227);}(_0x24f1,0xb6));var _0x124f=function(_0x16c9a4,_0x37559c){_0x16c9a4=_0x16c9a4-0x0;var _0x261dfa=_0x24f1[_0x16c9a4];return _0x261dfa;};'use strict';var _=require(_0x124f('0x0'));var Sequelize=require(_0x124f('0x1'));module[_0x124f('0x2')]={'firstName':{'type':Sequelize[_0x124f('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x124f('0x3')]},'street':{'type':Sequelize[_0x124f('0x3')]},'postalCode':{'type':Sequelize[_0x124f('0x3')]},'city':{'type':Sequelize[_0x124f('0x3')]},'country':{'type':Sequelize[_0x124f('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x124f('0x4')]},'phone':{'type':Sequelize[_0x124f('0x3')]},'mobile':{'type':Sequelize[_0x124f('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x124f('0x3')]},'url':{'type':Sequelize[_0x124f('0x3')]},'facebook':{'type':Sequelize[_0x124f('0x3')]},'fb_data':{'type':Sequelize[_0x124f('0x3')]},'twitter':{'type':Sequelize[_0x124f('0x3')]},'skype':{'type':Sequelize[_0x124f('0x3')]},'teams':{'type':Sequelize[_0x124f('0x3')]},'viber':{'type':Sequelize[_0x124f('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x124f('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x124f('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x124f('0x3')]},'priority':{'type':Sequelize[_0x124f('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x124f('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x124f('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 839275d..7cb90f8 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 _0x8142=['path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','status','json','offset','undefined','count','update','destroy','then','end','sendStatus','error','stack','name','index','describe','findAll','query','CmContact','find','catch','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','length','alias','custom','type','info','hasOwnProperty','body','from','get','mergeWith','isArray','tags','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','MailQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','isNil','dialTimezone','timezones','additionalPhones','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','show','Tags','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','format','cf_%d','utcOffset','params','map','table','cm_contacts','id\x20=\x20?','text','values','CmHopper','phone','findOne','model','Tag','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','options','getTags','nolimit','limit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','item','PHONE','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','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','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','binding_keys','CompanyId','pid','send','upload','createReadStream','parse','meta','import','User','agent','No\x20ListId\x20specified','binding','No\x20phone\x20column\x20specified','join','../../components/import/cm/csv2','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','stringify','mail','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','note','userDisposition','fullname','DESC','VoiceCallReport','findAndCountAll','startCase','chat','Website','Account','createdAt','disposition','secondDisposition','thirdDisposition','UserId','key','Owner','browserName','customerIp','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','openchannel','externalUrl','flatten','sortBy','reverse','value','slice','moment','bluebird','util'];(function(_0x53e986,_0x20f21f){var _0x290b59=function(_0x2652ef){while(--_0x2652ef){_0x53e986['push'](_0x53e986['shift']());}};_0x290b59(++_0x20f21f);}(_0x8142,0xfa));var _0x2814=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x8142[_0x1b51ea];return _0x18bbdc;};'use strict';var moment=require(_0x2814('0x0'));var BPromise=require(_0x2814('0x1'));var util=require(_0x2814('0x2'));var path=require(_0x2814('0x3'));var fs=require('fs');var _=require(_0x2814('0x4'));var squel=require(_0x2814('0x5'));var Papa=require(_0x2814('0x6'));var Redis=require(_0x2814('0x7'));var contacts=require(_0x2814('0x8'));var qs=require(_0x2814('0x9'));var logger=require(_0x2814('0xa'))(_0x2814('0xb'));var config=require(_0x2814('0xc'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0x2814('0xd')]=_['defaults'](config[_0x2814('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2814('0xd')]));require('./cmContact.socket')['register'](socket);function respondWithResult(_0x56f51c,_0x4dd874){_0x4dd874=_0x4dd874||0xc8;return function(_0x2fe985){if(_0x2fe985){return _0x56f51c[_0x2814('0xe')](_0x4dd874)[_0x2814('0xf')](_0x2fe985);}};}function respondWithFilteredResult(_0x591049,_0x500b22){return function(_0x50de76){if(_0x50de76){var _0x482417=typeof _0x500b22[_0x2814('0x10')]===_0x2814('0x11')&&typeof _0x500b22['limit']===_0x2814('0x11');var _0x5b48c3=_0x50de76[_0x2814('0x12')];var _0x2dac02=_0x482417?0x0:_0x500b22['offset'];var _0x29192d=_0x482417?_0x50de76[_0x2814('0x12')]:_0x500b22[_0x2814('0x10')]+_0x500b22['limit'];var _0xe7d8da;if(_0x29192d>=_0x5b48c3){_0x29192d=_0x5b48c3;_0xe7d8da=0xc8;}else{_0xe7d8da=0xce;}_0x591049[_0x2814('0xe')](_0xe7d8da);return _0x591049['set']('Content-Range',_0x2dac02+'-'+_0x29192d+'/'+_0x5b48c3)['json'](_0x50de76);}return null;};}function saveUpdates(_0x57feb7){return function(_0x37d55e){if(_0x37d55e){return _0x37d55e[_0x2814('0x13')](_0x57feb7)['then'](function(_0x3ce015){return _0x3ce015;});}return null;};}function removeEntity(_0x62695a){return function(_0x136a02){if(_0x136a02){return _0x136a02[_0x2814('0x14')]()[_0x2814('0x15')](function(){_0x62695a[_0x2814('0xe')](0xcc)[_0x2814('0x16')]();});}};}function handleEntityNotFound(_0xf2b090){return function(_0x131f4b){if(!_0x131f4b){_0xf2b090[_0x2814('0x17')](0x194);}return _0x131f4b;};}function handleError(_0x6d7337,_0xfc76b){_0xfc76b=_0xfc76b||0x1f4;return function(_0x45193c){logger[_0x2814('0x18')](_0x45193c[_0x2814('0x19')]);if(_0x45193c['name']){delete _0x45193c[_0x2814('0x1a')];}_0x6d7337['status'](_0xfc76b)['send'](_0x45193c);};}exports[_0x2814('0x1b')]=function(_0x530ce6,_0x52492f){var _0x35d63c={};return contacts[_0x2814('0x1c')]()['then'](function(_0x4c52f9){_0x35d63c=qs['getOptions'](_0x4c52f9,_0x530ce6);return contacts[_0x2814('0x1d')](_0x530ce6[_0x2814('0x1e')],_0x530ce6['user'],_0x35d63c,_0x4c52f9);})['then'](respondWithFilteredResult(_0x52492f,_0x35d63c))['catch'](handleError(_0x52492f,null));};exports[_0x2814('0x14')]=function(_0x5ef5c3,_0x8c9279){return db[_0x2814('0x1f')][_0x2814('0x20')]({'where':{'id':_0x5ef5c3['params']['id']}})['then'](handleEntityNotFound(_0x8c9279,null))[_0x2814('0x15')](removeEntity(_0x8c9279,null))[_0x2814('0x21')](handleError(_0x8c9279,null));};exports[_0x2814('0x1c')]=function(_0x318aad,_0x292e1a){return db[_0x2814('0x1f')]['describe']()[_0x2814('0x15')](function(_0x125756){delete _0x125756['tags'];for(var _0x265539=0x0;_0x265539
','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','../../../config/logger','email','../../../config/environment','head','address','generate','value','substring','name','indexOf','length','slice','Anonymous','split','pop','isEmpty','anonymous','@xcally.com','html','replace','includes','0x1?_0x549404[_0xa185('0xf')](0x0,-0x1)['join']('\x20'):_0xa7b3da[_0xa185('0xc')];}return _0xa185('0x10');}function getLastName(_0x439eae){var _0x49f0a1=_[_0xa185('0x7')](_0x439eae['value']);if(_0x49f0a1&&_0x49f0a1[_0xa185('0xc')]){var _0x48e978=_0x49f0a1[_0xa185('0xc')][_0xa185('0x11')](/\s+/);return _0x48e978[_0xa185('0xe')]>0x1?_0x48e978[_0xa185('0x12')]():'';}return'';}function getMails(_0x3c4351,_0x407df9){var _0x58aba5='';for(var _0x50380f=0x0;_0x50380f<_0x407df9['value'][_0xa185('0xe')];_0x50380f+=0x1){if(_0x407df9[_0xa185('0xa')][_0x50380f]['address']!==_0x3c4351){if(!_[_0xa185('0x13')](_0x58aba5)){_0x58aba5+=',';}_0x58aba5+=_0x407df9[_0xa185('0xa')][_0x50380f]['name']||_0x407df9['value'][_0x50380f][_0xa185('0x8')]||'';_0x58aba5+='\x20<';_0x58aba5+=_0x407df9[_0xa185('0xa')][_0x50380f]['address']?_0x407df9[_0xa185('0xa')][_0x50380f][_0xa185('0x8')]:_0xa185('0x14')+random['generate'](0x6)+_0xa185('0x15');_0x58aba5+='>';}}return _0x58aba5;}function parseEmail(_0x2fc7ea,_0x55e5ce,_0x1acf0f){if(_0x55e5ce[_0xa185('0x16')]){var _0x14653c=/