From: Andrea Bianco
Date: Sat, 1 Jan 2022 21:31:49 +0000 (+0100)
Subject: Built motion from commit c102fb6e.|2.5.44
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22avatar.png//%27?a=commitdiff_plain;h=665329b17872071551c8f9507d77c46ae42635ba;p=motion2.git
Built motion from commit c102fb6e.|2.5.44
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 447374e..726b257 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-12-31T14:37:19.750Z",
+ "time": "2022-01-01T21:08:49.331Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 00887be..5bcd773 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-12-31T14:37:19.750Z",
+ "time": "2022-01-01T21:08:49.331Z",
"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 220a67b..e9a7afd 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 _0x1376=['VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','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[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports'];(function(_0x58345f,_0x4631db){var _0x27d9ef=function(_0x3ac80a){while(--_0x3ac80a){_0x58345f['push'](_0x58345f['shift']());}};_0x27d9ef(++_0x4631db);}(_0x1376,0x6f));var _0x6137=function(_0x1d2992,_0x598caa){_0x1d2992=_0x1d2992-0x0;var _0x30f362=_0x1376[_0x1d2992];return _0x30f362;};'use strict';var Sequelize=require('sequelize');module[_0x6137('0x0')]={'name':{'type':Sequelize[_0x6137('0x1')],'get':function(_0x97fa5){return this[_0x6137('0x2')](_0x6137('0x3'));}},'action':{'type':Sequelize[_0x6137('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6137('0x5'),'integration',_0x6137('0x6'),_0x6137('0x7'),'urlForward','browser','bot',_0x6137('0x8')]],'msg':_0x6137('0x9')}},'comment':_0x6137('0x9')},'data1':{'type':Sequelize[_0x6137('0x4')](0x1000),'comment':_0x6137('0xa')},'data2':{'type':Sequelize[_0x6137('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[_0x6137('0x4')](0x1000),'comment':_0x6137('0xb')},'data4':{'type':Sequelize[_0x6137('0x4')](0x1000),'comments':_0x6137('0xc')},'data5':{'type':Sequelize[_0x6137('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x6137('0xd')},'data7':{'type':Sequelize[_0x6137('0xe')],'comments':_0x6137('0xf')}};
\ No newline at end of file
+var _0x4f05=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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','VIRTUAL','getDataValue','STRING','integration','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x15535b,_0x3274f1){var _0xb3b7b1=function(_0x54393f){while(--_0x54393f){_0x15535b['push'](_0x15535b['shift']());}};_0xb3b7b1(++_0x3274f1);}(_0x4f05,0x138));var _0x54f0=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x4f05[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require(_0x54f0('0x0'));module[_0x54f0('0x1')]={'name':{'type':Sequelize[_0x54f0('0x2')],'get':function(_0x1cce02){return this[_0x54f0('0x3')]('action');}},'action':{'type':Sequelize[_0x54f0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x54f0('0x5'),'motionbar',_0x54f0('0x6'),'urlForward',_0x54f0('0x7'),_0x54f0('0x8'),_0x54f0('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x54f0('0xa')},'data1':{'type':Sequelize[_0x54f0('0x4')](0x1000),'comment':_0x54f0('0xb')},'data2':{'type':Sequelize[_0x54f0('0x4')](0x1000),'comment':_0x54f0('0xc')},'data3':{'type':Sequelize[_0x54f0('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x54f0('0x4')](0x1000),'comments':_0x54f0('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x54f0('0xe')},'data6':{'type':Sequelize[_0x54f0('0x4')],'comments':_0x54f0('0xf')},'data7':{'type':Sequelize[_0x54f0('0x10')],'comments':_0x54f0('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 7ea1277..0566bb8 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 _0x9e76=['send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','bluebird','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name'];(function(_0x3b826d,_0x1d0b68){var _0x38e1b3=function(_0x314620){while(--_0x314620){_0x3b826d['push'](_0x3b826d['shift']());}};_0x38e1b3(++_0x1d0b68);}(_0x9e76,0x114));var _0x69e7=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x9e76[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x69e7('0x0'));var rimraf=require(_0x69e7('0x1'));var zipdir=require(_0x69e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x69e7('0x3'));var Mustache=require('mustache');var util=require(_0x69e7('0x4'));var path=require(_0x69e7('0x5'));var sox=require('sox');var csv=require(_0x69e7('0x6'));var ejs=require(_0x69e7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69e7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x69e7('0x9'));var toCsv=require(_0x69e7('0x6'));var querystring=require(_0x69e7('0xa'));var Papa=require(_0x69e7('0xb'));var Redis=require(_0x69e7('0xc'));var authService=require(_0x69e7('0xd'));var qs=require(_0x69e7('0xe'));var as=require(_0x69e7('0xf'));var hardwareService=require(_0x69e7('0x10'));var logger=require(_0x69e7('0x11'))('api');var utils=require(_0x69e7('0x12'));var config=require(_0x69e7('0x13'));var licenseUtil=require(_0x69e7('0x14'));var db=require(_0x69e7('0x15'))['db'];function respondWithStatusCode(_0x344ee2,_0xc0478d){_0xc0478d=_0xc0478d||0xcc;return function(_0x4a0e23){if(_0x4a0e23){return _0x344ee2[_0x69e7('0x16')](_0xc0478d);}return _0x344ee2[_0x69e7('0x17')](_0xc0478d)[_0x69e7('0x18')]();};}function respondWithResult(_0xff9b77,_0x35eef4){_0x35eef4=_0x35eef4||0xc8;return function(_0x5650ea){if(_0x5650ea){return _0xff9b77[_0x69e7('0x17')](_0x35eef4)[_0x69e7('0x19')](_0x5650ea);}};}function respondWithFilteredResult(_0x233318,_0x533dca){return function(_0x165cca){if(_0x165cca){var _0x33c195=typeof _0x533dca[_0x69e7('0x1a')]===_0x69e7('0x1b')&&typeof _0x533dca[_0x69e7('0x1c')]==='undefined';var _0x41a5ac=_0x165cca[_0x69e7('0x1d')];var _0x1fc4d5=_0x33c195?0x0:_0x533dca[_0x69e7('0x1a')];var _0x50d52f=_0x33c195?_0x165cca[_0x69e7('0x1d')]:_0x533dca['offset']+_0x533dca[_0x69e7('0x1c')];var _0x19be00;if(_0x50d52f>=_0x41a5ac){_0x50d52f=_0x41a5ac;_0x19be00=0xc8;}else{_0x19be00=0xce;}_0x233318[_0x69e7('0x17')](_0x19be00);return _0x233318[_0x69e7('0x1e')]('Content-Range',_0x1fc4d5+'-'+_0x50d52f+'/'+_0x41a5ac)[_0x69e7('0x19')](_0x165cca);}return null;};}function patchUpdates(_0x4519dc){return function(_0x2b9024){try{jsonpatch[_0x69e7('0x1f')](_0x2b9024,_0x4519dc,!![]);}catch(_0x363774){return BPromise['reject'](_0x363774);}return _0x2b9024[_0x69e7('0x20')]();};}function saveUpdates(_0x5371ef,_0x4e9038){return function(_0x16f3f5){if(_0x16f3f5){return _0x16f3f5[_0x69e7('0x21')](_0x5371ef)[_0x69e7('0x22')](function(_0x547b06){return _0x547b06;});}return null;};}function removeEntity(_0xac79a9,_0x86a808){return function(_0x45ab24){if(_0x45ab24){return _0x45ab24[_0x69e7('0x23')]()['then'](function(){_0xac79a9[_0x69e7('0x17')](0xcc)[_0x69e7('0x18')]();});}};}function handleEntityNotFound(_0x2709fc,_0x48d0e9){return function(_0x48adfa){if(!_0x48adfa){_0x2709fc[_0x69e7('0x16')](0x194);}return _0x48adfa;};}function handleError(_0x117efc,_0x1fa0af){_0x1fa0af=_0x1fa0af||0x1f4;return function(_0x188ece){logger[_0x69e7('0x24')](_0x188ece[_0x69e7('0x25')]);if(_0x188ece[_0x69e7('0x26')]){delete _0x188ece[_0x69e7('0x26')];}_0x117efc[_0x69e7('0x17')](_0x1fa0af)[_0x69e7('0x27')](_0x188ece);};}exports[_0x69e7('0x21')]=function(_0x519a47,_0x54af35){if(_0x519a47[_0x69e7('0x28')]['id']){delete _0x519a47[_0x69e7('0x28')]['id'];}return db[_0x69e7('0x29')][_0x69e7('0x2a')]({'where':{'id':_0x519a47[_0x69e7('0x2b')]['id']}})[_0x69e7('0x22')](handleEntityNotFound(_0x54af35,null))[_0x69e7('0x22')](saveUpdates(_0x519a47['body'],null))[_0x69e7('0x22')](respondWithResult(_0x54af35,null))['catch'](handleError(_0x54af35,null));};exports[_0x69e7('0x23')]=function(_0x3f2261,_0x9dcc3e){return db['Action'][_0x69e7('0x2a')]({'where':{'id':_0x3f2261[_0x69e7('0x2b')]['id']}})['then'](handleEntityNotFound(_0x9dcc3e,null))[_0x69e7('0x22')](removeEntity(_0x9dcc3e,null))[_0x69e7('0x2c')](handleError(_0x9dcc3e,null));};
\ No newline at end of file
+var _0xaff1=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','send','body','Action','params','then','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x323bb3,_0x1d1484){var _0x3f9474=function(_0x3bef05){while(--_0x3bef05){_0x323bb3['push'](_0x323bb3['shift']());}};_0x3f9474(++_0x1d1484);}(_0xaff1,0x1b6));var _0x1aff=function(_0x27d33c,_0x5795a6){_0x27d33c=_0x27d33c-0x0;var _0x4ea439=_0xaff1[_0x27d33c];return _0x4ea439;};'use strict';var emlformat=require(_0x1aff('0x0'));var rimraf=require(_0x1aff('0x1'));var zipdir=require(_0x1aff('0x2'));var jsonpatch=require(_0x1aff('0x3'));var rp=require(_0x1aff('0x4'));var moment=require('moment');var BPromise=require(_0x1aff('0x5'));var Mustache=require(_0x1aff('0x6'));var util=require(_0x1aff('0x7'));var path=require(_0x1aff('0x8'));var sox=require('sox');var csv=require(_0x1aff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1aff('0xa'));var _=require(_0x1aff('0xb'));var squel=require(_0x1aff('0xc'));var crypto=require(_0x1aff('0xd'));var jsforce=require(_0x1aff('0xe'));var deskjs=require(_0x1aff('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1aff('0x10'));var Papa=require(_0x1aff('0x11'));var Redis=require(_0x1aff('0x12'));var authService=require(_0x1aff('0x13'));var qs=require(_0x1aff('0x14'));var as=require(_0x1aff('0x15'));var hardwareService=require(_0x1aff('0x16'));var logger=require('../../config/logger')(_0x1aff('0x17'));var utils=require(_0x1aff('0x18'));var config=require(_0x1aff('0x19'));var licenseUtil=require(_0x1aff('0x1a'));var db=require(_0x1aff('0x1b'))['db'];function respondWithStatusCode(_0x521825,_0xdb1a5a){_0xdb1a5a=_0xdb1a5a||0xcc;return function(_0x19d4f8){if(_0x19d4f8){return _0x521825[_0x1aff('0x1c')](_0xdb1a5a);}return _0x521825[_0x1aff('0x1d')](_0xdb1a5a)['end']();};}function respondWithResult(_0x174db6,_0x2af981){_0x2af981=_0x2af981||0xc8;return function(_0x20ba0d){if(_0x20ba0d){return _0x174db6[_0x1aff('0x1d')](_0x2af981)[_0x1aff('0x1e')](_0x20ba0d);}};}function respondWithFilteredResult(_0x2ebbc5,_0xa5c018){return function(_0x27c33f){if(_0x27c33f){var _0x54bed6=typeof _0xa5c018[_0x1aff('0x1f')]===_0x1aff('0x20')&&typeof _0xa5c018[_0x1aff('0x21')]==='undefined';var _0x211f17=_0x27c33f['count'];var _0x1f6974=_0x54bed6?0x0:_0xa5c018[_0x1aff('0x1f')];var _0x148603=_0x54bed6?_0x27c33f[_0x1aff('0x22')]:_0xa5c018['offset']+_0xa5c018['limit'];var _0x3e5144;if(_0x148603>=_0x211f17){_0x148603=_0x211f17;_0x3e5144=0xc8;}else{_0x3e5144=0xce;}_0x2ebbc5[_0x1aff('0x1d')](_0x3e5144);return _0x2ebbc5[_0x1aff('0x23')](_0x1aff('0x24'),_0x1f6974+'-'+_0x148603+'/'+_0x211f17)[_0x1aff('0x1e')](_0x27c33f);}return null;};}function patchUpdates(_0xed7919){return function(_0xe81c8f){try{jsonpatch[_0x1aff('0x25')](_0xe81c8f,_0xed7919,!![]);}catch(_0x5d1d60){return BPromise[_0x1aff('0x26')](_0x5d1d60);}return _0xe81c8f[_0x1aff('0x27')]();};}function saveUpdates(_0x217bfb,_0x129a69){return function(_0x5bb637){if(_0x5bb637){return _0x5bb637[_0x1aff('0x28')](_0x217bfb)['then'](function(_0x507b8f){return _0x507b8f;});}return null;};}function removeEntity(_0x42b6ac,_0x1af55e){return function(_0x4015b9){if(_0x4015b9){return _0x4015b9[_0x1aff('0x29')]()['then'](function(){_0x42b6ac[_0x1aff('0x1d')](0xcc)[_0x1aff('0x2a')]();});}};}function handleEntityNotFound(_0x1de111,_0x2d313c){return function(_0x20bcf3){if(!_0x20bcf3){_0x1de111[_0x1aff('0x1c')](0x194);}return _0x20bcf3;};}function handleError(_0x4e930a,_0x49c8a6){_0x49c8a6=_0x49c8a6||0x1f4;return function(_0x8c30a5){logger[_0x1aff('0x2b')](_0x8c30a5[_0x1aff('0x2c')]);if(_0x8c30a5['name']){delete _0x8c30a5['name'];}_0x4e930a[_0x1aff('0x1d')](_0x49c8a6)[_0x1aff('0x2d')](_0x8c30a5);};}exports[_0x1aff('0x28')]=function(_0x4f375e,_0x165a44){if(_0x4f375e[_0x1aff('0x2e')]['id']){delete _0x4f375e[_0x1aff('0x2e')]['id'];}return db[_0x1aff('0x2f')]['find']({'where':{'id':_0x4f375e[_0x1aff('0x30')]['id']}})['then'](handleEntityNotFound(_0x165a44,null))[_0x1aff('0x31')](saveUpdates(_0x4f375e['body'],null))[_0x1aff('0x31')](respondWithResult(_0x165a44,null))[_0x1aff('0x32')](handleError(_0x165a44,null));};exports[_0x1aff('0x29')]=function(_0x14bf81,_0x5e5138){return db['Action'][_0x1aff('0x33')]({'where':{'id':_0x14bf81['params']['id']}})['then'](handleEntityNotFound(_0x5e5138,null))[_0x1aff('0x31')](removeEntity(_0x5e5138,null))['catch'](handleError(_0x5e5138,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 6144453..ae34861 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 _0x5a41=['tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x5a41,0x1b1));var _0x15a4=function(_0x3d09e2,_0x58e784){_0x3d09e2=_0x3d09e2-0x0;var _0x5d03cd=_0x5a41[_0x3d09e2];return _0x5d03cd;};'use strict';var _=require(_0x15a4('0x0'));var util=require(_0x15a4('0x1'));var logger=require(_0x15a4('0x2'))(_0x15a4('0x3'));var moment=require(_0x15a4('0x4'));var BPromise=require('bluebird');var rp=require(_0x15a4('0x5'));var fs=require('fs');var path=require(_0x15a4('0x6'));var rimraf=require(_0x15a4('0x7'));var config=require(_0x15a4('0x8'));var attributes=require(_0x15a4('0x9'));module['exports']=function(_0x28841f,_0x209552){return _0x28841f[_0x15a4('0xa')]('Action',attributes,{'tableName':_0x15a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6a1=['moment','bluebird','request-promise','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger'];(function(_0x273dc9,_0x5924f4){var _0x1eaa00=function(_0x252db4){while(--_0x252db4){_0x273dc9['push'](_0x273dc9['shift']());}};_0x1eaa00(++_0x5924f4);}(_0xe6a1,0x111));var _0x1e6a=function(_0x35de88,_0x4e5b00){_0x35de88=_0x35de88-0x0;var _0x525419=_0xe6a1[_0x35de88];return _0x525419;};'use strict';var _=require('lodash');var util=require(_0x1e6a('0x0'));var logger=require(_0x1e6a('0x1'))('api');var moment=require(_0x1e6a('0x2'));var BPromise=require(_0x1e6a('0x3'));var rp=require(_0x1e6a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1e6a('0x5'));var attributes=require(_0x1e6a('0x6'));module[_0x1e6a('0x7')]=function(_0x4dbbdb,_0x485a2f){return _0x4dbbdb[_0x1e6a('0x8')](_0x1e6a('0x9'),attributes,{'tableName':_0x1e6a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index d2d7a83..d3da28c 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 _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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x814b,0x1a2));var _0xb814=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0x814b[_0x27a3cb];return _0x54ff38;};'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
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1c3796,_0x2f0fd1){var _0x344725=function(_0x597835){while(--_0x597835){_0x1c3796['push'](_0x1c3796['shift']());}};_0x344725(++_0x2f0fd1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0x5fc3[_0x2eb3db];return _0x358f33;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index c948935..eee75b2 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 _0xabbf=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated','delete'];(function(_0x2855b9,_0x53188f){var _0x70ea14=function(_0x191616){while(--_0x191616){_0x2855b9['push'](_0x2855b9['shift']());}};_0x70ea14(++_0x53188f);}(_0xabbf,0x1c4));var _0xfabb=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0xabbf[_0x25c988];return _0x45fcc2;};'use strict';var multer=require('multer');var util=require(_0xfabb('0x0'));var path=require(_0xfabb('0x1'));var timeout=require('connect-timeout');var express=require(_0xfabb('0x2'));var router=express['Router']();var fs_extra=require(_0xfabb('0x3'));var auth=require(_0xfabb('0x4'));var interaction=require(_0xfabb('0x5'));var config=require('../../config/environment');var controller=require(_0xfabb('0x6'));router['put'](_0xfabb('0x7'),auth[_0xfabb('0x8')](),controller['update']);router[_0xfabb('0x9')]('/:id',auth[_0xfabb('0x8')](),controller['destroy']);module[_0xfabb('0xa')]=router;
\ No newline at end of file
+var _0xb5db=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3802a0,_0x278238){var _0x3fb7b6=function(_0x4958e5){while(--_0x4958e5){_0x3802a0['push'](_0x3802a0['shift']());}};_0x3fb7b6(++_0x278238);}(_0xb5db,0x80));var _0xbb5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb5db[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbb5d('0x0'));var util=require(_0xbb5d('0x1'));var path=require(_0xbb5d('0x2'));var timeout=require(_0xbb5d('0x3'));var express=require(_0xbb5d('0x4'));var router=express[_0xbb5d('0x5')]();var fs_extra=require(_0xbb5d('0x6'));var auth=require(_0xbb5d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbb5d('0x8'));var controller=require(_0xbb5d('0x9'));router[_0xbb5d('0xa')](_0xbb5d('0xb'),auth[_0xbb5d('0xc')](),controller[_0xbb5d('0xd')]);router[_0xbb5d('0xe')](_0xbb5d('0xb'),auth['isAuthenticated'](),controller[_0xbb5d('0xf')]);module[_0xbb5d('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 1e56c61..9539546 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xafc4,0x69));var _0x4afc=function(_0x3469b4,_0x3cc80d){_0x3469b4=_0x3469b4-0x0;var _0x263397=_0xafc4[_0x3469b4];return _0x263397;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
+var _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x5d39bb,_0x4e860d){var _0xad03d=function(_0x18af10){while(--_0x18af10){_0x5d39bb['push'](_0x5d39bb['shift']());}};_0xad03d(++_0x4e860d);}(_0x5d17,0x114));var _0x75d1=function(_0x3875b1,_0x47cf1a){_0x3875b1=_0x3875b1-0x0;var _0x1e9c55=_0x5d17[_0x3875b1];return _0x1e9c55;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('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 a7a8547..9eba5fd 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 _0xd4a3=['name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','ROUND(%s)','IS\x20NOT\x20NULL','value','Sequelize','from','alias','%s.%s\x20=\x20%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','countTable','COUNT(*)','run','runReport','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','eml-format','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','CustomReports','error'];(function(_0x29ebf,_0x5d73f0){var _0x3261f2=function(_0x26b9d5){while(--_0x26b9d5){_0x29ebf['push'](_0x29ebf['shift']());}};_0x3261f2(++_0x5d73f0);}(_0xd4a3,0x7a));var _0x3d4a=function(_0x1cfd2d,_0xc2bfae){_0x1cfd2d=_0x1cfd2d-0x0;var _0x227ed0=_0xd4a3[_0x1cfd2d];return _0x227ed0;};'use strict';var emlformat=require(_0x3d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3d4a('0x1'));var moment=require(_0x3d4a('0x2'));var BPromise=require(_0x3d4a('0x3'));var Mustache=require(_0x3d4a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3d4a('0x5'));var csv=require(_0x3d4a('0x6'));var ejs=require(_0x3d4a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3d4a('0x8'));var toCsv=require('to-csv');var querystring=require(_0x3d4a('0x9'));var Papa=require(_0x3d4a('0xa'));var Redis=require(_0x3d4a('0xb'));var authService=require(_0x3d4a('0xc'));var qs=require(_0x3d4a('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d4a('0xe'));var logger=require(_0x3d4a('0xf'))(_0x3d4a('0x10'));var utils=require(_0x3d4a('0x11'));var config=require(_0x3d4a('0x12'));var licenseUtil=require(_0x3d4a('0x13'));var db=require(_0x3d4a('0x14'))['db'];var dbH=require('../../mysqldb')[_0x3d4a('0x15')];function respondWithStatusCode(_0x428024,_0x46367d){_0x46367d=_0x46367d||0xcc;return function(_0xfa35b9){if(_0xfa35b9){return _0x428024[_0x3d4a('0x16')](_0x46367d);}return _0x428024[_0x3d4a('0x17')](_0x46367d)[_0x3d4a('0x18')]();};}function respondWithResult(_0x3b5658,_0x4fda68){_0x4fda68=_0x4fda68||0xc8;return function(_0x5f2282){if(_0x5f2282){return _0x3b5658['status'](_0x4fda68)[_0x3d4a('0x19')](_0x5f2282);}};}function respondWithFilteredResult(_0x149f55,_0x4cf75d){return function(_0x2e29ed){if(_0x2e29ed){var _0x850685=typeof _0x4cf75d[_0x3d4a('0x1a')]===_0x3d4a('0x1b')&&typeof _0x4cf75d[_0x3d4a('0x1c')]===_0x3d4a('0x1b');var _0x3d8944=_0x2e29ed[_0x3d4a('0x1d')];var _0x1274b0=_0x850685?0x0:_0x4cf75d[_0x3d4a('0x1a')];var _0x3aa044=_0x850685?_0x2e29ed[_0x3d4a('0x1d')]:_0x4cf75d[_0x3d4a('0x1a')]+_0x4cf75d[_0x3d4a('0x1c')];var _0x43bb14;if(_0x3aa044>=_0x3d8944){_0x3aa044=_0x3d8944;_0x43bb14=0xc8;}else{_0x43bb14=0xce;}_0x149f55['status'](_0x43bb14);return _0x149f55['set'](_0x3d4a('0x1e'),_0x1274b0+'-'+_0x3aa044+'/'+_0x3d8944)['json'](_0x2e29ed);}return null;};}function patchUpdates(_0x261690){return function(_0x21aa17){try{jsonpatch[_0x3d4a('0x1f')](_0x21aa17,_0x261690,!![]);}catch(_0x3df475){return BPromise[_0x3d4a('0x20')](_0x3df475);}return _0x21aa17[_0x3d4a('0x21')]();};}function saveUpdates(_0x1d4e79,_0x5b1741){return function(_0x19d663){if(_0x19d663){return _0x19d663['update'](_0x1d4e79)[_0x3d4a('0x22')](function(_0x1a10c9){return _0x1a10c9;});}return null;};}function removeEntity(_0x1bd0f6,_0x36038e){return function(_0x544fcc){if(_0x544fcc){return _0x544fcc[_0x3d4a('0x23')]()[_0x3d4a('0x22')](function(){var _0x83880=_0x544fcc[_0x3d4a('0x24')]({'plain':!![]});var _0xfd631f=_0x3d4a('0x25');return db['UserProfileResource'][_0x3d4a('0x23')]({'where':{'type':_0xfd631f,'resourceId':_0x83880['id']}})[_0x3d4a('0x22')](function(){return _0x544fcc;});})['then'](function(){_0x1bd0f6[_0x3d4a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de273,_0x323e19){return function(_0x46a717){if(!_0x46a717){_0x3de273[_0x3d4a('0x16')](0x194);}return _0x46a717;};}function handleError(_0x1a6570,_0x441d58){_0x441d58=_0x441d58||0x1f4;return function(_0x5eaa4c){logger[_0x3d4a('0x26')](_0x5eaa4c['stack']);if(_0x5eaa4c['name']){delete _0x5eaa4c[_0x3d4a('0x27')];}_0x1a6570[_0x3d4a('0x17')](_0x441d58)[_0x3d4a('0x28')](_0x5eaa4c);};}exports[_0x3d4a('0x29')]=function(_0x496fc5,_0x2a947c){var _0x9047ef={},_0x487a9d={},_0x51111a={'count':0x0,'rows':[]};var _0x3e0661=_['map'](db[_0x3d4a('0x2a')][_0x3d4a('0x2b')],function(_0x755c7b){return{'name':_0x755c7b[_0x3d4a('0x2c')],'type':_0x755c7b[_0x3d4a('0x2d')]['key']};});_0x487a9d[_0x3d4a('0x2e')]=_[_0x3d4a('0x2f')](_0x3e0661,'name');_0x487a9d[_0x3d4a('0x30')]=_[_0x3d4a('0x31')](_0x496fc5[_0x3d4a('0x30')]);_0x487a9d[_0x3d4a('0x32')]=_[_0x3d4a('0x33')](_0x487a9d[_0x3d4a('0x2e')],_0x487a9d[_0x3d4a('0x30')]);_0x9047ef[_0x3d4a('0x34')]=_[_0x3d4a('0x33')](_0x487a9d[_0x3d4a('0x2e')],qs[_0x3d4a('0x35')](_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x35')]));_0x9047ef[_0x3d4a('0x34')]=_0x9047ef[_0x3d4a('0x34')]['length']?_0x9047ef[_0x3d4a('0x34')]:_0x487a9d[_0x3d4a('0x2e')];if(!_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x36')](_0x3d4a('0x37'))){_0x9047ef[_0x3d4a('0x1c')]=qs[_0x3d4a('0x1c')](_0x496fc5[_0x3d4a('0x30')]['limit']);_0x9047ef[_0x3d4a('0x1a')]=qs[_0x3d4a('0x1a')](_0x496fc5[_0x3d4a('0x30')]['offset']);}_0x9047ef[_0x3d4a('0x38')]=qs[_0x3d4a('0x39')](_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x39')]);_0x9047ef[_0x3d4a('0x3a')]=qs[_0x3d4a('0x32')](_[_0x3d4a('0x3b')](_0x496fc5['query'],_0x487a9d[_0x3d4a('0x32')]),_0x3e0661);if(_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x3c')]){_0x9047ef[_0x3d4a('0x3a')]=_[_0x3d4a('0x3d')](_0x9047ef[_0x3d4a('0x3a')],{'$or':_[_0x3d4a('0x2f')](_0x3e0661,function(_0x4d17fb){if(_0x4d17fb[_0x3d4a('0x2d')]!==_0x3d4a('0x3e')){var _0x3b9a6a={};_0x3b9a6a[_0x4d17fb[_0x3d4a('0x27')]]={'$like':'%'+_0x496fc5['query'][_0x3d4a('0x3c')]+'%'};return _0x3b9a6a;}})});}_0x9047ef=_[_0x3d4a('0x3d')]({},_0x9047ef,_0x496fc5[_0x3d4a('0x3f')]);var _0x481225={'where':_0x9047ef[_0x3d4a('0x3a')]};return db[_0x3d4a('0x2a')][_0x3d4a('0x1d')](_0x481225)[_0x3d4a('0x22')](function(_0x3103fa){_0x51111a['count']=_0x3103fa;if(_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x40')]){_0x9047ef[_0x3d4a('0x41')]=[{'all':!![]}];}return db[_0x3d4a('0x2a')][_0x3d4a('0x42')](_0x9047ef);})[_0x3d4a('0x22')](function(_0x355aaf){_0x51111a[_0x3d4a('0x43')]=_0x355aaf;return _0x51111a;})[_0x3d4a('0x22')](respondWithFilteredResult(_0x2a947c,_0x9047ef))['catch'](handleError(_0x2a947c,null));};exports['show']=function(_0x27abc2,_0x48c257){var _0x4b5ce1={'raw':![],'where':{'id':_0x27abc2[_0x3d4a('0x44')]['id']}},_0x529a65={};_0x529a65[_0x3d4a('0x2e')]=_[_0x3d4a('0x31')](db['AnalyticCustomReport'][_0x3d4a('0x2b')]);_0x529a65[_0x3d4a('0x30')]=_[_0x3d4a('0x31')](_0x27abc2['query']);_0x529a65[_0x3d4a('0x32')]=_[_0x3d4a('0x33')](_0x529a65['model'],_0x529a65[_0x3d4a('0x30')]);_0x4b5ce1[_0x3d4a('0x34')]=_[_0x3d4a('0x33')](_0x529a65[_0x3d4a('0x2e')],qs[_0x3d4a('0x35')](_0x27abc2['query'][_0x3d4a('0x35')]));_0x4b5ce1[_0x3d4a('0x34')]=_0x4b5ce1[_0x3d4a('0x34')][_0x3d4a('0x45')]?_0x4b5ce1['attributes']:_0x529a65[_0x3d4a('0x2e')];if(_0x27abc2['query'][_0x3d4a('0x40')]){_0x4b5ce1['include']=[{'all':!![]}];}_0x4b5ce1=_[_0x3d4a('0x3d')]({},_0x4b5ce1,_0x27abc2[_0x3d4a('0x3f')]);return db[_0x3d4a('0x2a')]['find'](_0x4b5ce1)[_0x3d4a('0x22')](handleEntityNotFound(_0x48c257,null))[_0x3d4a('0x22')](respondWithResult(_0x48c257,null))['catch'](handleError(_0x48c257,null));};exports[_0x3d4a('0x46')]=function(_0x364651,_0xaab3b3){return db[_0x3d4a('0x2a')][_0x3d4a('0x46')](_0x364651['body'],{})[_0x3d4a('0x22')](function(_0x4de6a0){var _0x1f3b91=_0x364651[_0x3d4a('0x47')]['get']({'plain':!![]});if(!_0x1f3b91)throw new Error(_0x3d4a('0x48'));if(_0x1f3b91[_0x3d4a('0x49')]===_0x3d4a('0x47')){var _0x1d8a01=_0x4de6a0[_0x3d4a('0x24')]({'plain':!![]});var _0x1c301f=_0x3d4a('0x4a');return db[_0x3d4a('0x4b')][_0x3d4a('0x4c')]({'where':{'name':_0x1c301f,'userProfileId':_0x1f3b91[_0x3d4a('0x4d')]},'raw':!![]})[_0x3d4a('0x22')](function(_0x4a56c9){if(_0x4a56c9&&_0x4a56c9[_0x3d4a('0x4e')]===0x0){return db[_0x3d4a('0x4f')][_0x3d4a('0x46')]({'name':_0x1d8a01['name'],'resourceId':_0x1d8a01['id'],'type':_0x3d4a('0x25'),'sectionId':_0x4a56c9['id']},{})[_0x3d4a('0x22')](function(){return _0x4de6a0;});}else{return _0x4de6a0;}})[_0x3d4a('0x50')](function(_0x1bec5d){logger['error'](_0x3d4a('0x51'),_0x1bec5d);throw _0x1bec5d;});}return _0x4de6a0;})[_0x3d4a('0x22')](respondWithResult(_0xaab3b3,0xc9))[_0x3d4a('0x50')](handleError(_0xaab3b3,null));};exports[_0x3d4a('0x52')]=function(_0x1d7d4d,_0x3e4c05){if(_0x1d7d4d['body']['id']){delete _0x1d7d4d['body']['id'];}return db[_0x3d4a('0x2a')][_0x3d4a('0x4c')]({'where':{'id':_0x1d7d4d[_0x3d4a('0x44')]['id']}})[_0x3d4a('0x22')](handleEntityNotFound(_0x3e4c05,null))[_0x3d4a('0x22')](saveUpdates(_0x1d7d4d['body'],null))[_0x3d4a('0x22')](respondWithResult(_0x3e4c05,null))[_0x3d4a('0x50')](handleError(_0x3e4c05,null));};exports[_0x3d4a('0x23')]=function(_0x19a237,_0x56009f){return db[_0x3d4a('0x2a')][_0x3d4a('0x4c')]({'where':{'id':_0x19a237[_0x3d4a('0x44')]['id']}})[_0x3d4a('0x22')](handleEntityNotFound(_0x56009f,null))['then'](removeEntity(_0x56009f,null))[_0x3d4a('0x50')](handleError(_0x56009f,null));};exports[_0x3d4a('0x53')]=function(_0x21b55d,_0x13e592){var _0x2bcf50=0xa;var _0x188e28=[_0x3d4a('0x54'),_0x3d4a('0x55'),'right_join','cross_join'];var _0x3e33a9={'SUM':_0x3d4a('0x56'),'COUNT':_0x3d4a('0x57'),'COUNT DISTINCT':_0x3d4a('0x58'),'MAX':_0x3d4a('0x59'),'MIN':_0x3d4a('0x5a'),'AVG':_0x3d4a('0x5b'),'GROUP_CONCAT':_0x3d4a('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3d4a('0x5d')};var _0x3547a9={'SEC_TO_TIME':_0x3d4a('0x5e'),'DATE':_0x3d4a('0x5f'),'HOUR':_0x3d4a('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3d4a('0x61')};var _0x1b5b7d=function(_0xc7d9ca){return!_[_0x3d4a('0x62')]([_0x3d4a('0x63'),'IS\x20NOT\x20NULL',_0x3d4a('0x64'),_0x3d4a('0x65')],_0xc7d9ca);};var _0x22fe52=function(_0x2bb5ec){if(!_0x2bb5ec||!_0x2bb5ec[_0x3d4a('0x66')][_0x3d4a('0x45')]){return'';}for(var _0x2d1d46='(',_0xed2a93=0x0;_0xed2a93<_0x2bb5ec[_0x3d4a('0x66')]['length'];_0xed2a93+=0x1){_0xed2a93>0x0&&(_0x2d1d46+='\x20'+_0x2bb5ec[_0x3d4a('0x67')]+'\x20');_0x2d1d46+=_0x2bb5ec['rules'][_0xed2a93][_0x3d4a('0x68')]?_0x22fe52(_0x2bb5ec['rules'][_0xed2a93][_0x3d4a('0x68')]):_0x2bb5ec['rules'][_0xed2a93][_0x3d4a('0x69')]+'\x20'+_0x2bb5ec[_0x3d4a('0x66')][_0xed2a93][_0x3d4a('0x6a')]+(_0x1b5b7d(_0x2bb5ec[_0x3d4a('0x66')][_0xed2a93][_0x3d4a('0x6a')])?'\x20'+_0x2bb5ec[_0x3d4a('0x66')][_0xed2a93]['value']:'');}return _0x2d1d46+')';};var _0x40cf1e={'where':{'id':_0x21b55d[_0x3d4a('0x44')]['id']}},_0x3c1b87,_0x154feb,_0x2a0744,_0x141ee0,_0x398a47;_0x40cf1e=_['merge']({},_0x40cf1e,_0x21b55d[_0x3d4a('0x3f')]);return db[_0x3d4a('0x2a')][_0x3d4a('0x4c')](_0x40cf1e)[_0x3d4a('0x22')](function(_0x951038){if(_0x951038){_0x3c1b87=_0x951038;return _0x951038[_0x3d4a('0x6b')]();}return null;})[_0x3d4a('0x22')](function(_0xa5bdb1){if(_0xa5bdb1){if(!_0xa5bdb1['length']){throw new db['Sequelize'][(_0x3d4a('0x6c'))](_0x3d4a('0x6d'),0x193);}_0x154feb=_0xa5bdb1;return db[_0x3d4a('0x6e')][_0x3d4a('0x42')]({'raw':!![]});}return null;})['then'](function(_0x58e1c8){if(_0x58e1c8){_0x2a0744=_[_0x3d4a('0x6f')](_0x58e1c8,'id');var _0x50cb32;var _0x26ddca=squel[_0x3d4a('0x70')]();_0x26ddca['from'](_0x3c1b87[_0x3d4a('0x71')]);for(var _0x2e65cc=0x0;_0x2e65cc<_0x154feb['length'];_0x2e65cc+=0x1){_0x50cb32=_0x154feb[_0x2e65cc][_0x3d4a('0x72')]?_0x2a0744[_0x154feb[_0x2e65cc][_0x3d4a('0x72')]][_0x3d4a('0x73')]:_0x154feb[_0x2e65cc][_0x3d4a('0x69')];_0x50cb32=_0x154feb[_0x2e65cc][_0x3d4a('0x74')]?_['replace'](_0x3e33a9[_0x154feb[_0x2e65cc]['function']],'%s',_0x50cb32):_0x50cb32;_0x50cb32=_0x154feb[_0x2e65cc][_0x3d4a('0x75')]?_[_0x3d4a('0x76')](_0x3547a9[_0x154feb[_0x2e65cc][_0x3d4a('0x75')]],'%s',_0x50cb32):_0x50cb32;if(_0x154feb[_0x2e65cc][_0x3d4a('0x77')]){_0x26ddca[_0x3d4a('0x68')](_0x50cb32);}_0x154feb[_0x2e65cc][_0x3d4a('0x78')]&&_0x26ddca[_0x3d4a('0x38')](_0x50cb32,_0x154feb[_0x2e65cc]['orderBy']===_0x3d4a('0x79')?![]:!![]);_0x26ddca[_0x3d4a('0x69')](_0x50cb32,_0x154feb[_0x2e65cc]['alias']||_0x50cb32);}if(_0x3c1b87[_0x3d4a('0x7a')]){_0x3c1b87['joins']=JSON[_0x3d4a('0x7b')](_0x3c1b87[_0x3d4a('0x7a')]);for(var _0x640afb=0x0;_0x640afb<_0x3c1b87[_0x3d4a('0x7a')][_0x3d4a('0x45')];_0x640afb+=0x1){if(_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x2d')]&&_[_0x3d4a('0x62')](_0x188e28,_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x2d')])&&_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7c')]&&_0x3c1b87['joins'][_0x640afb][_0x3d4a('0x7d')]&&_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7e')]){_0x26ddca[_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x2d')]](_0x3c1b87['joins'][_0x640afb][_0x3d4a('0x7d')],null,util[_0x3d4a('0x75')]('%s.%s\x20=\x20%s.%s',_0x3c1b87[_0x3d4a('0x71')],_0x3c1b87['joins'][_0x640afb][_0x3d4a('0x7c')],_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7d')],_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7e')]));}}}if(_0x3c1b87['conditions']){_0x3c1b87[_0x3d4a('0x7f')]=JSON['parse'](_0x3c1b87[_0x3d4a('0x7f')]);_0x26ddca[_0x3d4a('0x3a')](_0x22fe52(_0x3c1b87[_0x3d4a('0x7f')][_0x3d4a('0x68')]));}_0x398a47=_0x26ddca[_0x3d4a('0x80')]();_0x26ddca['limit'](_0x2bcf50);_0x26ddca[_0x3d4a('0x1a')](0x0);logger[_0x3d4a('0x81')](_0x3d4a('0x82'),_0x26ddca[_0x3d4a('0x83')]());return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0x26ddca['toString'](),{'type':dbH[_0x3d4a('0x84')][_0x3d4a('0x85')][_0x3d4a('0x86')]});}})['then'](respondWithResult(_0x13e592,null))[_0x3d4a('0x50')](handleError(_0x13e592,null));};function runReport(_0x5a78b8,_0xfc1912,_0x5efeb1){var _0x270d0a=_0xfc1912['name'];var _0x3002ff=0xa;var _0x102bb2=[_0x3d4a('0x54'),_0x3d4a('0x55'),'right_join',_0x3d4a('0x87')];var _0x3d7553={'SUM':_0x3d4a('0x56'),'COUNT':_0x3d4a('0x57'),'COUNT DISTINCT':_0x3d4a('0x58'),'MAX':_0x3d4a('0x59'),'MIN':_0x3d4a('0x5a'),'AVG':_0x3d4a('0x5b'),'GROUP_CONCAT':_0x3d4a('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x18217f={'SEC_TO_TIME':_0x3d4a('0x5e'),'DATE':_0x3d4a('0x5f'),'HOUR':_0x3d4a('0x60'),'ROUND':_0x3d4a('0x88'),'UNIX_TIMESTAMP':_0x3d4a('0x61')};var _0xec11ce=function(_0x27010a){return!_[_0x3d4a('0x62')](['IS\x20NULL',_0x3d4a('0x89'),_0x3d4a('0x64'),_0x3d4a('0x65')],_0x27010a);};var _0x4ad5db=function(_0x10335d){if(!_0x10335d||!_0x10335d[_0x3d4a('0x66')][_0x3d4a('0x45')]){return'';}for(var _0x3160e1='(',_0x505c88=0x0;_0x505c88<_0x10335d[_0x3d4a('0x66')][_0x3d4a('0x45')];_0x505c88+=0x1){_0x505c88>0x0&&(_0x3160e1+='\x20'+_0x10335d[_0x3d4a('0x67')]+'\x20');_0x3160e1+=_0x10335d[_0x3d4a('0x66')][_0x505c88][_0x3d4a('0x68')]?_0x4ad5db(_0x10335d['rules'][_0x505c88]['group']):_0x10335d['rules'][_0x505c88][_0x3d4a('0x69')]+'\x20'+_0x10335d[_0x3d4a('0x66')][_0x505c88][_0x3d4a('0x6a')]+(_0xec11ce(_0x10335d[_0x3d4a('0x66')][_0x505c88][_0x3d4a('0x6a')])?'\x20'+_0x10335d['rules'][_0x505c88][_0x3d4a('0x8a')]:'');}return _0x3160e1+')';};var _0x499708={'where':{'id':_0x5a78b8['id']}},_0x16d3e5,_0x3caa95,_0x9f73b6,_0x332a1d,_0x242c7c;_0x499708=_[_0x3d4a('0x3d')]({},_0x499708,_0x5efeb1);return db['AnalyticCustomReport'][_0x3d4a('0x4c')](_0x499708)[_0x3d4a('0x22')](function(_0x3f7d86){if(_0x3f7d86){_0x16d3e5=_0x3f7d86;return _0x3f7d86[_0x3d4a('0x6b')]();}return null;})[_0x3d4a('0x22')](function(_0x5cc8f2){if(_0x5cc8f2){if(!_0x5cc8f2[_0x3d4a('0x45')]){throw new db[(_0x3d4a('0x8b'))][(_0x3d4a('0x6c'))](_0x3d4a('0x6d'),0x193);}_0x3caa95=_0x5cc8f2;return db[_0x3d4a('0x6e')][_0x3d4a('0x42')]({'raw':!![]});}return null;})[_0x3d4a('0x22')](function(_0x39e42a){if(_0x39e42a){_0x9f73b6=_[_0x3d4a('0x6f')](_0x39e42a,'id');var _0x11d38c;var _0x30cb71=squel[_0x3d4a('0x70')]();_0x30cb71[_0x3d4a('0x8c')](_0x16d3e5['table']);for(var _0x2f10b0=0x0;_0x2f10b0<_0x3caa95[_0x3d4a('0x45')];_0x2f10b0+=0x1){_0x11d38c=_0x3caa95[_0x2f10b0][_0x3d4a('0x72')]?_0x9f73b6[_0x3caa95[_0x2f10b0][_0x3d4a('0x72')]]['metric']:_0x3caa95[_0x2f10b0]['field'];_0x11d38c=_0x3caa95[_0x2f10b0][_0x3d4a('0x74')]?_['replace'](_0x3d7553[_0x3caa95[_0x2f10b0][_0x3d4a('0x74')]],'%s',_0x11d38c):_0x11d38c;_0x11d38c=_0x3caa95[_0x2f10b0]['format']?_[_0x3d4a('0x76')](_0x18217f[_0x3caa95[_0x2f10b0][_0x3d4a('0x75')]],'%s',_0x11d38c):_0x11d38c;if(_0x3caa95[_0x2f10b0]['groupBy']){_0x30cb71[_0x3d4a('0x68')](_0x11d38c);}_0x3caa95[_0x2f10b0][_0x3d4a('0x78')]&&_0x30cb71[_0x3d4a('0x38')](_0x11d38c,_0x3caa95[_0x2f10b0][_0x3d4a('0x78')]===_0x3d4a('0x79')?![]:!![]);_0x30cb71['field'](_0x11d38c,_0x3caa95[_0x2f10b0][_0x3d4a('0x8d')]||_0x11d38c);}if(_0x16d3e5[_0x3d4a('0x7a')]){_0x16d3e5[_0x3d4a('0x7a')]=JSON[_0x3d4a('0x7b')](_0x16d3e5[_0x3d4a('0x7a')]);for(var _0x59ca45=0x0;_0x59ca45<_0x16d3e5[_0x3d4a('0x7a')][_0x3d4a('0x45')];_0x59ca45+=0x1){if(_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45][_0x3d4a('0x2d')]&&_[_0x3d4a('0x62')](_0x102bb2,_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x2d')])&&_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7c')]&&_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7d')]&&_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45][_0x3d4a('0x7e')]){_0x30cb71[_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45]['type']](_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7d')],null,util['format'](_0x3d4a('0x8e'),_0x16d3e5[_0x3d4a('0x71')],_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7c')],_0x16d3e5['joins'][_0x59ca45]['foreignTable'],_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45][_0x3d4a('0x7e')]));}}}if(_0x16d3e5[_0x3d4a('0x7f')]){_0x16d3e5[_0x3d4a('0x7f')]=JSON[_0x3d4a('0x7b')](_0x16d3e5[_0x3d4a('0x7f')]);_0x30cb71[_0x3d4a('0x3a')](_0x4ad5db(_0x16d3e5[_0x3d4a('0x7f')][_0x3d4a('0x68')]));}_0x242c7c=_0x30cb71['clone']();_0x30cb71[_0x3d4a('0x1c')](_0x3002ff);_0x30cb71[_0x3d4a('0x1a')](0x0);return;}})[_0x3d4a('0x22')](function(){if(_0xfc1912['output']==='web'){return null;}var _0x2fb169=_['merge'](_0xfc1912,{'name':_0xfc1912['fullPath']||_0xfc1912[_0x3d4a('0x27')]||_0x16d3e5['name'],'basename':_0x270d0a,'savename':util[_0x3d4a('0x75')]('%s-%s.%s',_0xfc1912['name']||_0x16d3e5['name'],require('randomstring')[_0x3d4a('0x8f')](0x4),_0xfc1912[_0x3d4a('0x90')]||_0x3d4a('0x91')),'reportId':_0x16d3e5['id'],'reportType':_0x3d4a('0x92')});return db[_0x3d4a('0x93')][_0x3d4a('0x46')](_0x2fb169,{'raw':!![]});})[_0x3d4a('0x22')](function(_0x2420bb){if(_0x16d3e5[_0x3d4a('0x71')]===_0x3d4a('0x94')){_0x242c7c[_0x3d4a('0x3a')](_0x16d3e5['table']+_0x3d4a('0x95'),_0xfc1912[_0x3d4a('0x96')],_0xfc1912['endDate']);}else{_0x242c7c[_0x3d4a('0x3a')](_0x16d3e5[_0x3d4a('0x71')]+_0x3d4a('0x97'),_0xfc1912[_0x3d4a('0x96')],_0xfc1912['endDate']);}if(_0x2420bb){logger[_0x3d4a('0x98')]('Run\x20Query:',_0x242c7c[_0x3d4a('0x83')]());require(_0x3d4a('0x99'))[_0x3d4a('0x9a')](path[_0x3d4a('0x54')](__dirname,'../../components/export/',_0x2420bb[_0x3d4a('0x90')]),[_0x2420bb['id'],_0x242c7c[_0x3d4a('0x83')](),path[_0x3d4a('0x54')](__dirname,'../../files/reports',_0x2420bb['savename']),_0x270d0a]);return _0x2420bb;}else{var _0x317125=squel[_0x3d4a('0x70')]();_0x317125[_0x3d4a('0x8c')]('('+_0x242c7c['toString']()+')',_0x3d4a('0x9b'));_0x317125[_0x3d4a('0x69')](_0x3d4a('0x9c'),_0x3d4a('0x1d'));_0x242c7c[_0x3d4a('0x1c')](_0xfc1912[_0x3d4a('0x1c')]||_0x3002ff);_0x242c7c[_0x3d4a('0x1a')](_0xfc1912['offset']||0x0);return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0x317125[_0x3d4a('0x83')](),{'type':dbH[_0x3d4a('0x84')][_0x3d4a('0x85')][_0x3d4a('0x86')]})[_0x3d4a('0x22')](function(_0x5a0719){if(!_0x5a0719[_0x3d4a('0x45')]){_0x332a1d=0x0;}else{_0x332a1d=_0x5a0719[0x0][_0x3d4a('0x1d')]||0x0;}return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0x242c7c[_0x3d4a('0x83')](),{'type':dbH[_0x3d4a('0x84')][_0x3d4a('0x85')]['SELECT']});})[_0x3d4a('0x22')](function(_0x21fb14){return{'rows':_0x21fb14||[],'count':_0x332a1d};});}});}exports[_0x3d4a('0x9d')]=function(_0x3696b5,_0x1a52d2){return runReport(_0x3696b5[_0x3d4a('0x44')],_0x3696b5[_0x3d4a('0x30')],_0x3696b5[_0x3d4a('0x3f')])['then'](respondWithResult(_0x1a52d2,null))[_0x3d4a('0x50')](handleError(_0x1a52d2,null));};exports[_0x3d4a('0x9e')]=runReport;exports[_0x3d4a('0x30')]=function(_0x5efdc5,_0x1e5240){var _0x2a6c7e=0xa;var _0x508f2e=['join',_0x3d4a('0x55'),_0x3d4a('0x9f'),_0x3d4a('0x87')];var _0x3583ae={'SUM':'SUM(%s)','COUNT':_0x3d4a('0x57'),'COUNT DISTINCT':_0x3d4a('0x58'),'MAX':_0x3d4a('0x59'),'MIN':_0x3d4a('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3d4a('0x5c'),'GROUP_CONCAT ASC':_0x3d4a('0xa0'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5b1118={'SEC_TO_TIME':_0x3d4a('0x5e'),'DATE':_0x3d4a('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3d4a('0x61')};var _0x1c0697=function(_0x5e11a6){return!_[_0x3d4a('0x62')]([_0x3d4a('0x63'),_0x3d4a('0x89'),_0x3d4a('0x64'),_0x3d4a('0x65')],_0x5e11a6);};var _0x31540a=function(_0x3a2988){if(!_0x3a2988||!_0x3a2988[_0x3d4a('0x66')]['length']){return'';}for(var _0x10a8d0='(',_0x2d94f5=0x0;_0x2d94f5<_0x3a2988[_0x3d4a('0x66')][_0x3d4a('0x45')];_0x2d94f5+=0x1){_0x2d94f5>0x0&&(_0x10a8d0+='\x20'+_0x3a2988[_0x3d4a('0x67')]+'\x20');_0x10a8d0+=_0x3a2988[_0x3d4a('0x66')][_0x2d94f5][_0x3d4a('0x68')]?_0x31540a(_0x3a2988[_0x3d4a('0x66')][_0x2d94f5][_0x3d4a('0x68')]):_0x3a2988['rules'][_0x2d94f5]['field']+'\x20'+_0x3a2988[_0x3d4a('0x66')][_0x2d94f5][_0x3d4a('0x6a')]+(_0x1c0697(_0x3a2988['rules'][_0x2d94f5][_0x3d4a('0x6a')])?'\x20'+_0x3a2988[_0x3d4a('0x66')][_0x2d94f5]['value']:'');}return _0x10a8d0+')';};var _0x176618={'where':{'id':_0x5efdc5[_0x3d4a('0x44')]['id']}},_0x182208,_0x1a0f7e,_0x306d45,_0x5ee4f5,_0x54ff53;_0x176618=_[_0x3d4a('0x3d')]({},_0x176618,_0x5efdc5[_0x3d4a('0x3f')]);return db['AnalyticCustomReport']['find'](_0x176618)[_0x3d4a('0x22')](function(_0x41efbb){if(_0x41efbb){_0x182208=_0x41efbb;return _0x41efbb[_0x3d4a('0x6b')]();}return null;})[_0x3d4a('0x22')](function(_0x163f91){if(_0x163f91){if(!_0x163f91[_0x3d4a('0x45')]){throw new db[(_0x3d4a('0x8b'))][(_0x3d4a('0x6c'))](_0x3d4a('0x6d'),0x193);}_0x1a0f7e=_0x163f91;return db[_0x3d4a('0x6e')][_0x3d4a('0x42')]({'raw':!![]});}return null;})[_0x3d4a('0x22')](function(_0x2eb139){if(_0x2eb139){_0x306d45=_[_0x3d4a('0x6f')](_0x2eb139,'id');var _0x3d3478;var _0xf58c86=squel[_0x3d4a('0x70')]();_0xf58c86[_0x3d4a('0x8c')](_0x182208[_0x3d4a('0x71')]);for(var _0x454c3f=0x0;_0x454c3f<_0x1a0f7e['length'];_0x454c3f+=0x1){_0x3d3478=_0x1a0f7e[_0x454c3f][_0x3d4a('0x72')]?_0x306d45[_0x1a0f7e[_0x454c3f][_0x3d4a('0x72')]][_0x3d4a('0x73')]:_0x1a0f7e[_0x454c3f][_0x3d4a('0x69')];_0x3d3478=_0x1a0f7e[_0x454c3f][_0x3d4a('0x74')]?_[_0x3d4a('0x76')](_0x3583ae[_0x1a0f7e[_0x454c3f][_0x3d4a('0x74')]],'%s',_0x3d3478):_0x3d3478;_0x3d3478=_0x1a0f7e[_0x454c3f][_0x3d4a('0x75')]?_[_0x3d4a('0x76')](_0x5b1118[_0x1a0f7e[_0x454c3f][_0x3d4a('0x75')]],'%s',_0x3d3478):_0x3d3478;if(_0x1a0f7e[_0x454c3f]['groupBy']){_0xf58c86[_0x3d4a('0x68')](_0x3d3478);}_0x1a0f7e[_0x454c3f][_0x3d4a('0x78')]&&_0xf58c86[_0x3d4a('0x38')](_0x3d3478,_0x1a0f7e[_0x454c3f][_0x3d4a('0x78')]===_0x3d4a('0x79')?![]:!![]);_0xf58c86[_0x3d4a('0x69')](_0x3d3478,_0x1a0f7e[_0x454c3f][_0x3d4a('0x8d')]||_0x3d3478);}if(_0x182208[_0x3d4a('0x7a')]){_0x182208['joins']=JSON[_0x3d4a('0x7b')](_0x182208[_0x3d4a('0x7a')]);for(var _0x3e049c=0x0;_0x3e049c<_0x182208[_0x3d4a('0x7a')][_0x3d4a('0x45')];_0x3e049c+=0x1){if(_0x182208['joins'][_0x3e049c][_0x3d4a('0x2d')]&&_[_0x3d4a('0x62')](_0x508f2e,_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x2d')])&&_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7c')]&&_0x182208['joins'][_0x3e049c][_0x3d4a('0x7d')]&&_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7e')]){_0xf58c86[_0x182208['joins'][_0x3e049c]['type']](_0x182208[_0x3d4a('0x7a')][_0x3e049c]['foreignTable'],null,util[_0x3d4a('0x75')](_0x3d4a('0x8e'),_0x182208['table'],_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7c')],_0x182208[_0x3d4a('0x7a')][_0x3e049c]['foreignTable'],_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7e')]));}}}if(_0x182208[_0x3d4a('0x7f')]){_0x182208[_0x3d4a('0x7f')]=JSON[_0x3d4a('0x7b')](_0x182208[_0x3d4a('0x7f')]);_0xf58c86['where'](_0x31540a(_0x182208['conditions'][_0x3d4a('0x68')]));}_0x54ff53=_0xf58c86[_0x3d4a('0x80')]();_0xf58c86['limit'](_0x2a6c7e);_0xf58c86[_0x3d4a('0x1a')](0x0);logger[_0x3d4a('0x81')](_0x3d4a('0x82'),_0xf58c86['toString']());return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0xf58c86['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x3d4a('0x86')]});}})['then'](function(){return{'sql':_0x54ff53[_0x3d4a('0x83')]()};})[_0x3d4a('0x22')](respondWithResult(_0x1e5240,null))[_0x3d4a('0x50')](handleError(_0x1e5240,null));};
\ No newline at end of file
+var _0x8907=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','parse','joins','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','run','COUNT(DISTINCT\x20%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','AnalyticCustomReport','fieldName','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x7a112,_0x2eb4a0){var _0x136dc5=function(_0x437650){while(--_0x437650){_0x7a112['push'](_0x7a112['shift']());}};_0x136dc5(++_0x2eb4a0);}(_0x8907,0x19d));var _0x7890=function(_0x3e72da,_0x7909e3){_0x3e72da=_0x3e72da-0x0;var _0x20a27d=_0x8907[_0x3e72da];return _0x20a27d;};'use strict';var emlformat=require(_0x7890('0x0'));var rimraf=require(_0x7890('0x1'));var zipdir=require(_0x7890('0x2'));var jsonpatch=require(_0x7890('0x3'));var rp=require(_0x7890('0x4'));var moment=require(_0x7890('0x5'));var BPromise=require(_0x7890('0x6'));var Mustache=require(_0x7890('0x7'));var util=require('util');var path=require(_0x7890('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7890('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7890('0xa'));var squel=require(_0x7890('0xb'));var crypto=require(_0x7890('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7890('0xd'));var toCsv=require(_0x7890('0xe'));var querystring=require(_0x7890('0xf'));var Papa=require('papaparse');var Redis=require(_0x7890('0x10'));var authService=require(_0x7890('0x11'));var qs=require(_0x7890('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7890('0x13'))(_0x7890('0x14'));var utils=require('../../config/utils');var config=require(_0x7890('0x15'));var licenseUtil=require(_0x7890('0x16'));var db=require(_0x7890('0x17'))['db'];var dbH=require(_0x7890('0x17'))['dbH'];function respondWithStatusCode(_0x55c27a,_0xbed44){_0xbed44=_0xbed44||0xcc;return function(_0x12bca5){if(_0x12bca5){return _0x55c27a[_0x7890('0x18')](_0xbed44);}return _0x55c27a['status'](_0xbed44)[_0x7890('0x19')]();};}function respondWithResult(_0x8b7e54,_0x34c527){_0x34c527=_0x34c527||0xc8;return function(_0x50c41a){if(_0x50c41a){return _0x8b7e54[_0x7890('0x1a')](_0x34c527)['json'](_0x50c41a);}};}function respondWithFilteredResult(_0x123657,_0x12344f){return function(_0x5cbb56){if(_0x5cbb56){var _0x3fe3ae=typeof _0x12344f[_0x7890('0x1b')]===_0x7890('0x1c')&&typeof _0x12344f['limit']===_0x7890('0x1c');var _0x215633=_0x5cbb56[_0x7890('0x1d')];var _0x55ca07=_0x3fe3ae?0x0:_0x12344f[_0x7890('0x1b')];var _0x212e1e=_0x3fe3ae?_0x5cbb56['count']:_0x12344f[_0x7890('0x1b')]+_0x12344f[_0x7890('0x1e')];var _0x355ee6;if(_0x212e1e>=_0x215633){_0x212e1e=_0x215633;_0x355ee6=0xc8;}else{_0x355ee6=0xce;}_0x123657['status'](_0x355ee6);return _0x123657[_0x7890('0x1f')](_0x7890('0x20'),_0x55ca07+'-'+_0x212e1e+'/'+_0x215633)[_0x7890('0x21')](_0x5cbb56);}return null;};}function patchUpdates(_0x43e30b){return function(_0xc6839e){try{jsonpatch[_0x7890('0x22')](_0xc6839e,_0x43e30b,!![]);}catch(_0x21df4f){return BPromise['reject'](_0x21df4f);}return _0xc6839e[_0x7890('0x23')]();};}function saveUpdates(_0x38937a,_0x5e7450){return function(_0x27136b){if(_0x27136b){return _0x27136b[_0x7890('0x24')](_0x38937a)[_0x7890('0x25')](function(_0x4c845f){return _0x4c845f;});}return null;};}function removeEntity(_0xbb3208,_0xbe0621){return function(_0x15cc9c){if(_0x15cc9c){return _0x15cc9c[_0x7890('0x26')]()[_0x7890('0x25')](function(){var _0x52c0db=_0x15cc9c[_0x7890('0x27')]({'plain':!![]});var _0x103952=_0x7890('0x28');return db[_0x7890('0x29')][_0x7890('0x26')]({'where':{'type':_0x103952,'resourceId':_0x52c0db['id']}})[_0x7890('0x25')](function(){return _0x15cc9c;});})['then'](function(){_0xbb3208[_0x7890('0x1a')](0xcc)[_0x7890('0x19')]();});}};}function handleEntityNotFound(_0x471b84,_0x4a7f91){return function(_0xb27eba){if(!_0xb27eba){_0x471b84[_0x7890('0x18')](0x194);}return _0xb27eba;};}function handleError(_0x363f32,_0x5ea102){_0x5ea102=_0x5ea102||0x1f4;return function(_0x5ca96b){logger['error'](_0x5ca96b[_0x7890('0x2a')]);if(_0x5ca96b[_0x7890('0x2b')]){delete _0x5ca96b[_0x7890('0x2b')];}_0x363f32[_0x7890('0x1a')](_0x5ea102)['send'](_0x5ca96b);};}exports['index']=function(_0x564ca8,_0x502c75){var _0x4fd915={},_0x1f74d5={},_0x3095d1={'count':0x0,'rows':[]};var _0x176714=_['map'](db[_0x7890('0x2c')]['rawAttributes'],function(_0x2a95d6){return{'name':_0x2a95d6[_0x7890('0x2d')],'type':_0x2a95d6['type'][_0x7890('0x2e')]};});_0x1f74d5['model']=_[_0x7890('0x2f')](_0x176714,_0x7890('0x2b'));_0x1f74d5[_0x7890('0x30')]=_[_0x7890('0x31')](_0x564ca8[_0x7890('0x30')]);_0x1f74d5[_0x7890('0x32')]=_[_0x7890('0x33')](_0x1f74d5['model'],_0x1f74d5[_0x7890('0x30')]);_0x4fd915[_0x7890('0x34')]=_[_0x7890('0x33')](_0x1f74d5['model'],qs[_0x7890('0x35')](_0x564ca8[_0x7890('0x30')][_0x7890('0x35')]));_0x4fd915[_0x7890('0x34')]=_0x4fd915[_0x7890('0x34')][_0x7890('0x36')]?_0x4fd915['attributes']:_0x1f74d5[_0x7890('0x37')];if(!_0x564ca8[_0x7890('0x30')][_0x7890('0x38')](_0x7890('0x39'))){_0x4fd915[_0x7890('0x1e')]=qs[_0x7890('0x1e')](_0x564ca8[_0x7890('0x30')][_0x7890('0x1e')]);_0x4fd915[_0x7890('0x1b')]=qs[_0x7890('0x1b')](_0x564ca8[_0x7890('0x30')][_0x7890('0x1b')]);}_0x4fd915['order']=qs[_0x7890('0x3a')](_0x564ca8['query'][_0x7890('0x3a')]);_0x4fd915['where']=qs[_0x7890('0x32')](_[_0x7890('0x3b')](_0x564ca8['query'],_0x1f74d5[_0x7890('0x32')]),_0x176714);if(_0x564ca8[_0x7890('0x30')][_0x7890('0x3c')]){_0x4fd915[_0x7890('0x3d')]=_[_0x7890('0x3e')](_0x4fd915[_0x7890('0x3d')],{'$or':_[_0x7890('0x2f')](_0x176714,function(_0x27ca63){if(_0x27ca63[_0x7890('0x3f')]!==_0x7890('0x40')){var _0x1b728a={};_0x1b728a[_0x27ca63[_0x7890('0x2b')]]={'$like':'%'+_0x564ca8[_0x7890('0x30')][_0x7890('0x3c')]+'%'};return _0x1b728a;}})});}_0x4fd915=_['merge']({},_0x4fd915,_0x564ca8[_0x7890('0x41')]);var _0x44ea76={'where':_0x4fd915[_0x7890('0x3d')]};return db[_0x7890('0x2c')]['count'](_0x44ea76)[_0x7890('0x25')](function(_0x8f3129){_0x3095d1[_0x7890('0x1d')]=_0x8f3129;if(_0x564ca8[_0x7890('0x30')][_0x7890('0x42')]){_0x4fd915[_0x7890('0x43')]=[{'all':!![]}];}return db[_0x7890('0x2c')][_0x7890('0x44')](_0x4fd915);})['then'](function(_0x23df5d){_0x3095d1[_0x7890('0x45')]=_0x23df5d;return _0x3095d1;})[_0x7890('0x25')](respondWithFilteredResult(_0x502c75,_0x4fd915))[_0x7890('0x46')](handleError(_0x502c75,null));};exports[_0x7890('0x47')]=function(_0x42c553,_0x516503){var _0x42d48e={'raw':![],'where':{'id':_0x42c553[_0x7890('0x48')]['id']}},_0x1c419c={};_0x1c419c[_0x7890('0x37')]=_['keys'](db[_0x7890('0x2c')][_0x7890('0x49')]);_0x1c419c[_0x7890('0x30')]=_[_0x7890('0x31')](_0x42c553[_0x7890('0x30')]);_0x1c419c['filters']=_[_0x7890('0x33')](_0x1c419c['model'],_0x1c419c[_0x7890('0x30')]);_0x42d48e[_0x7890('0x34')]=_[_0x7890('0x33')](_0x1c419c[_0x7890('0x37')],qs['fields'](_0x42c553[_0x7890('0x30')]['fields']));_0x42d48e[_0x7890('0x34')]=_0x42d48e[_0x7890('0x34')]['length']?_0x42d48e['attributes']:_0x1c419c[_0x7890('0x37')];if(_0x42c553[_0x7890('0x30')][_0x7890('0x42')]){_0x42d48e[_0x7890('0x43')]=[{'all':!![]}];}_0x42d48e=_[_0x7890('0x3e')]({},_0x42d48e,_0x42c553['options']);return db[_0x7890('0x2c')][_0x7890('0x4a')](_0x42d48e)[_0x7890('0x25')](handleEntityNotFound(_0x516503,null))['then'](respondWithResult(_0x516503,null))[_0x7890('0x46')](handleError(_0x516503,null));};exports['create']=function(_0x467880,_0x515f5f){return db[_0x7890('0x2c')][_0x7890('0x4b')](_0x467880[_0x7890('0x4c')],{})[_0x7890('0x25')](function(_0x2585d7){var _0xe04cb8=_0x467880[_0x7890('0x4d')][_0x7890('0x27')]({'plain':!![]});if(!_0xe04cb8)throw new Error(_0x7890('0x4e'));if(_0xe04cb8[_0x7890('0x4f')]===_0x7890('0x4d')){var _0x44922a=_0x2585d7[_0x7890('0x27')]({'plain':!![]});var _0xb5bcbb='Reports';return db[_0x7890('0x50')][_0x7890('0x4a')]({'where':{'name':_0xb5bcbb,'userProfileId':_0xe04cb8[_0x7890('0x51')]},'raw':!![]})[_0x7890('0x25')](function(_0x5e972c){if(_0x5e972c&&_0x5e972c[_0x7890('0x52')]===0x0){return db[_0x7890('0x29')][_0x7890('0x4b')]({'name':_0x44922a['name'],'resourceId':_0x44922a['id'],'type':_0x7890('0x28'),'sectionId':_0x5e972c['id']},{})[_0x7890('0x25')](function(){return _0x2585d7;});}else{return _0x2585d7;}})[_0x7890('0x46')](function(_0xfafc2e){logger[_0x7890('0x53')](_0x7890('0x54'),_0xfafc2e);throw _0xfafc2e;});}return _0x2585d7;})['then'](respondWithResult(_0x515f5f,0xc9))[_0x7890('0x46')](handleError(_0x515f5f,null));};exports[_0x7890('0x24')]=function(_0xd5338e,_0x27c5e9){if(_0xd5338e[_0x7890('0x4c')]['id']){delete _0xd5338e[_0x7890('0x4c')]['id'];}return db[_0x7890('0x2c')][_0x7890('0x4a')]({'where':{'id':_0xd5338e[_0x7890('0x48')]['id']}})['then'](handleEntityNotFound(_0x27c5e9,null))[_0x7890('0x25')](saveUpdates(_0xd5338e[_0x7890('0x4c')],null))[_0x7890('0x25')](respondWithResult(_0x27c5e9,null))['catch'](handleError(_0x27c5e9,null));};exports[_0x7890('0x26')]=function(_0x4115b9,_0x2732d1){return db[_0x7890('0x2c')][_0x7890('0x4a')]({'where':{'id':_0x4115b9[_0x7890('0x48')]['id']}})[_0x7890('0x25')](handleEntityNotFound(_0x2732d1,null))[_0x7890('0x25')](removeEntity(_0x2732d1,null))[_0x7890('0x46')](handleError(_0x2732d1,null));};exports[_0x7890('0x55')]=function(_0x5d8f1b,_0x3665ed){var _0x1195c7=0xa;var _0x46db1a=['join','left_join',_0x7890('0x56'),_0x7890('0x57')];var _0x11438d={'SUM':_0x7890('0x58'),'COUNT':_0x7890('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7890('0x5a'),'MIN':_0x7890('0x5b'),'AVG':_0x7890('0x5c'),'GROUP_CONCAT':_0x7890('0x5d'),'GROUP_CONCAT ASC':_0x7890('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3c04f4={'SEC_TO_TIME':_0x7890('0x5f'),'DATE':_0x7890('0x60'),'HOUR':_0x7890('0x61'),'ROUND':_0x7890('0x62'),'UNIX_TIMESTAMP':_0x7890('0x63')};var _0x5f5698=function(_0x56ca3f){return!_[_0x7890('0x64')]([_0x7890('0x65'),_0x7890('0x66'),'IS\x20EMPTY',_0x7890('0x67')],_0x56ca3f);};var _0x127e7a=function(_0x4518c6){if(!_0x4518c6||!_0x4518c6['rules'][_0x7890('0x36')]){return'';}for(var _0x5e4fbc='(',_0x5abc08=0x0;_0x5abc08<_0x4518c6[_0x7890('0x68')][_0x7890('0x36')];_0x5abc08+=0x1){_0x5abc08>0x0&&(_0x5e4fbc+='\x20'+_0x4518c6['operator']+'\x20');_0x5e4fbc+=_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x69')]?_0x127e7a(_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x69')]):_0x4518c6['rules'][_0x5abc08][_0x7890('0x6a')]+'\x20'+_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x6b')]+(_0x5f5698(_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x6b')])?'\x20'+_0x4518c6[_0x7890('0x68')][_0x5abc08][_0x7890('0x6c')]:'');}return _0x5e4fbc+')';};var _0x5eea8b={'where':{'id':_0x5d8f1b[_0x7890('0x48')]['id']}},_0x1212fa,_0x173203,_0x27440e,_0x687a54,_0x2f3011;_0x5eea8b=_[_0x7890('0x3e')]({},_0x5eea8b,_0x5d8f1b['options']);return db['AnalyticCustomReport'][_0x7890('0x4a')](_0x5eea8b)[_0x7890('0x25')](function(_0x58ecf5){if(_0x58ecf5){_0x1212fa=_0x58ecf5;return _0x58ecf5[_0x7890('0x6d')]();}return null;})[_0x7890('0x25')](function(_0x4d82e2){if(_0x4d82e2){if(!_0x4d82e2['length']){throw new db[(_0x7890('0x6e'))][(_0x7890('0x6f'))](_0x7890('0x70'),0x193);}_0x173203=_0x4d82e2;return db[_0x7890('0x71')][_0x7890('0x44')]({'raw':!![]});}return null;})[_0x7890('0x25')](function(_0x518417){if(_0x518417){_0x27440e=_[_0x7890('0x72')](_0x518417,'id');var _0x17b275;var _0x32f26e=squel[_0x7890('0x73')]();_0x32f26e[_0x7890('0x74')](_0x1212fa[_0x7890('0x75')]);for(var _0x2856da=0x0;_0x2856da<_0x173203[_0x7890('0x36')];_0x2856da+=0x1){_0x17b275=_0x173203[_0x2856da][_0x7890('0x76')]?_0x27440e[_0x173203[_0x2856da]['MetricId']][_0x7890('0x77')]:_0x173203[_0x2856da]['field'];_0x17b275=_0x173203[_0x2856da][_0x7890('0x78')]?_[_0x7890('0x79')](_0x11438d[_0x173203[_0x2856da][_0x7890('0x78')]],'%s',_0x17b275):_0x17b275;_0x17b275=_0x173203[_0x2856da][_0x7890('0x7a')]?_[_0x7890('0x79')](_0x3c04f4[_0x173203[_0x2856da][_0x7890('0x7a')]],'%s',_0x17b275):_0x17b275;if(_0x173203[_0x2856da][_0x7890('0x7b')]){_0x32f26e[_0x7890('0x69')](_0x17b275);}_0x173203[_0x2856da][_0x7890('0x7c')]&&_0x32f26e[_0x7890('0x7d')](_0x17b275,_0x173203[_0x2856da]['orderBy']==='DESC'?![]:!![]);_0x32f26e[_0x7890('0x6a')](_0x17b275,_0x173203[_0x2856da][_0x7890('0x7e')]||_0x17b275);}if(_0x1212fa['joins']){_0x1212fa['joins']=JSON[_0x7890('0x7f')](_0x1212fa[_0x7890('0x80')]);for(var _0x1e74c1=0x0;_0x1e74c1<_0x1212fa[_0x7890('0x80')][_0x7890('0x36')];_0x1e74c1+=0x1){if(_0x1212fa['joins'][_0x1e74c1][_0x7890('0x3f')]&&_[_0x7890('0x64')](_0x46db1a,_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x3f')])&&_0x1212fa['joins'][_0x1e74c1][_0x7890('0x81')]&&_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x82')]&&_0x1212fa['joins'][_0x1e74c1]['foreignKey']){_0x32f26e[_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x3f')]](_0x1212fa['joins'][_0x1e74c1][_0x7890('0x82')],null,util[_0x7890('0x7a')]('%s.%s\x20=\x20%s.%s',_0x1212fa[_0x7890('0x75')],_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x81')],_0x1212fa[_0x7890('0x80')][_0x1e74c1]['foreignTable'],_0x1212fa[_0x7890('0x80')][_0x1e74c1][_0x7890('0x83')]));}}}if(_0x1212fa['conditions']){_0x1212fa[_0x7890('0x84')]=JSON[_0x7890('0x7f')](_0x1212fa['conditions']);_0x32f26e[_0x7890('0x3d')](_0x127e7a(_0x1212fa[_0x7890('0x84')]['group']));}_0x2f3011=_0x32f26e[_0x7890('0x85')]();_0x32f26e[_0x7890('0x1e')](_0x1195c7);_0x32f26e['offset'](0x0);logger[_0x7890('0x86')](_0x7890('0x87'),_0x32f26e[_0x7890('0x88')]());return dbH[_0x7890('0x89')]['query'](_0x32f26e[_0x7890('0x88')](),{'type':dbH[_0x7890('0x89')][_0x7890('0x8a')][_0x7890('0x8b')]});}})[_0x7890('0x25')](respondWithResult(_0x3665ed,null))['catch'](handleError(_0x3665ed,null));};function runReport(_0x668294,_0x3613db,_0x1d3f7e){var _0x1aa3c2=_0x3613db[_0x7890('0x2b')];var _0xe57492=0xa;var _0x68bfbb=[_0x7890('0x8c'),_0x7890('0x8d'),_0x7890('0x56'),_0x7890('0x57')];var _0x31ea80={'SUM':_0x7890('0x58'),'COUNT':_0x7890('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7890('0x5a'),'MIN':_0x7890('0x5b'),'AVG':_0x7890('0x5c'),'GROUP_CONCAT':_0x7890('0x5d'),'GROUP_CONCAT ASC':_0x7890('0x5e'),'GROUP_CONCAT DESC':_0x7890('0x8e')};var _0x44597b={'SEC_TO_TIME':_0x7890('0x5f'),'DATE':_0x7890('0x60'),'HOUR':_0x7890('0x61'),'ROUND':_0x7890('0x62'),'UNIX_TIMESTAMP':_0x7890('0x63')};var _0x18cd5f=function(_0x1b9e0c){return!_['includes']([_0x7890('0x65'),_0x7890('0x66'),_0x7890('0x8f'),_0x7890('0x67')],_0x1b9e0c);};var _0x3f407e=function(_0x497bb7){if(!_0x497bb7||!_0x497bb7[_0x7890('0x68')][_0x7890('0x36')]){return'';}for(var _0x5270f1='(',_0xb2ac2=0x0;_0xb2ac2<_0x497bb7['rules']['length'];_0xb2ac2+=0x1){_0xb2ac2>0x0&&(_0x5270f1+='\x20'+_0x497bb7[_0x7890('0x90')]+'\x20');_0x5270f1+=_0x497bb7[_0x7890('0x68')][_0xb2ac2][_0x7890('0x69')]?_0x3f407e(_0x497bb7[_0x7890('0x68')][_0xb2ac2]['group']):_0x497bb7[_0x7890('0x68')][_0xb2ac2][_0x7890('0x6a')]+'\x20'+_0x497bb7['rules'][_0xb2ac2][_0x7890('0x6b')]+(_0x18cd5f(_0x497bb7['rules'][_0xb2ac2][_0x7890('0x6b')])?'\x20'+_0x497bb7['rules'][_0xb2ac2][_0x7890('0x6c')]:'');}return _0x5270f1+')';};var _0x48b6c2={'where':{'id':_0x668294['id']}},_0x46bd12,_0x36de95,_0x13875c,_0xe4b81a,_0x5d38df;_0x48b6c2=_[_0x7890('0x3e')]({},_0x48b6c2,_0x1d3f7e);return db['AnalyticCustomReport']['find'](_0x48b6c2)[_0x7890('0x25')](function(_0x45270b){if(_0x45270b){_0x46bd12=_0x45270b;return _0x45270b[_0x7890('0x6d')]();}return null;})['then'](function(_0x39ca0b){if(_0x39ca0b){if(!_0x39ca0b[_0x7890('0x36')]){throw new db[(_0x7890('0x6e'))][(_0x7890('0x6f'))](_0x7890('0x70'),0x193);}_0x36de95=_0x39ca0b;return db[_0x7890('0x71')]['findAll']({'raw':!![]});}return null;})[_0x7890('0x25')](function(_0x13c4b2){if(_0x13c4b2){_0x13875c=_[_0x7890('0x72')](_0x13c4b2,'id');var _0xfc4a33;var _0x1cf91a=squel[_0x7890('0x73')]();_0x1cf91a[_0x7890('0x74')](_0x46bd12['table']);for(var _0x25fd81=0x0;_0x25fd81<_0x36de95[_0x7890('0x36')];_0x25fd81+=0x1){_0xfc4a33=_0x36de95[_0x25fd81][_0x7890('0x76')]?_0x13875c[_0x36de95[_0x25fd81][_0x7890('0x76')]][_0x7890('0x77')]:_0x36de95[_0x25fd81][_0x7890('0x6a')];_0xfc4a33=_0x36de95[_0x25fd81][_0x7890('0x78')]?_[_0x7890('0x79')](_0x31ea80[_0x36de95[_0x25fd81][_0x7890('0x78')]],'%s',_0xfc4a33):_0xfc4a33;_0xfc4a33=_0x36de95[_0x25fd81][_0x7890('0x7a')]?_[_0x7890('0x79')](_0x44597b[_0x36de95[_0x25fd81][_0x7890('0x7a')]],'%s',_0xfc4a33):_0xfc4a33;if(_0x36de95[_0x25fd81][_0x7890('0x7b')]){_0x1cf91a['group'](_0xfc4a33);}_0x36de95[_0x25fd81]['orderBy']&&_0x1cf91a[_0x7890('0x7d')](_0xfc4a33,_0x36de95[_0x25fd81][_0x7890('0x7c')]==='DESC'?![]:!![]);_0x1cf91a['field'](_0xfc4a33,_0x36de95[_0x25fd81][_0x7890('0x7e')]||_0xfc4a33);}if(_0x46bd12[_0x7890('0x80')]){_0x46bd12['joins']=JSON['parse'](_0x46bd12['joins']);for(var _0x32ef74=0x0;_0x32ef74<_0x46bd12[_0x7890('0x80')][_0x7890('0x36')];_0x32ef74+=0x1){if(_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x3f')]&&_['includes'](_0x68bfbb,_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x3f')])&&_0x46bd12['joins'][_0x32ef74][_0x7890('0x81')]&&_0x46bd12['joins'][_0x32ef74]['foreignTable']&&_0x46bd12[_0x7890('0x80')][_0x32ef74]['foreignKey']){_0x1cf91a[_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x3f')]](_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x82')],null,util[_0x7890('0x7a')](_0x7890('0x91'),_0x46bd12[_0x7890('0x75')],_0x46bd12[_0x7890('0x80')][_0x32ef74]['parentKey'],_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x82')],_0x46bd12[_0x7890('0x80')][_0x32ef74][_0x7890('0x83')]));}}}if(_0x46bd12[_0x7890('0x84')]){_0x46bd12[_0x7890('0x84')]=JSON[_0x7890('0x7f')](_0x46bd12['conditions']);_0x1cf91a[_0x7890('0x3d')](_0x3f407e(_0x46bd12[_0x7890('0x84')][_0x7890('0x69')]));}_0x5d38df=_0x1cf91a[_0x7890('0x85')]();_0x1cf91a[_0x7890('0x1e')](_0xe57492);_0x1cf91a[_0x7890('0x1b')](0x0);return;}})[_0x7890('0x25')](function(){if(_0x3613db[_0x7890('0x92')]===_0x7890('0x93')){return null;}var _0x2c2623=_[_0x7890('0x3e')](_0x3613db,{'name':_0x3613db['fullPath']||_0x3613db[_0x7890('0x2b')]||_0x46bd12[_0x7890('0x2b')],'basename':_0x1aa3c2,'savename':util[_0x7890('0x7a')](_0x7890('0x94'),_0x3613db['name']||_0x46bd12[_0x7890('0x2b')],require(_0x7890('0x95'))[_0x7890('0x96')](0x4),_0x3613db[_0x7890('0x92')]||'csv'),'reportId':_0x46bd12['id'],'reportType':_0x7890('0x97')});return db[_0x7890('0x98')][_0x7890('0x4b')](_0x2c2623,{'raw':!![]});})[_0x7890('0x25')](function(_0x5d0af5){if(_0x46bd12['table']===_0x7890('0x99')){_0x5d38df[_0x7890('0x3d')](_0x46bd12[_0x7890('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3613db[_0x7890('0x9a')],_0x3613db[_0x7890('0x9b')]);}else{_0x5d38df[_0x7890('0x3d')](_0x46bd12[_0x7890('0x75')]+_0x7890('0x9c'),_0x3613db[_0x7890('0x9a')],_0x3613db[_0x7890('0x9b')]);}if(_0x5d0af5){logger['info'](_0x7890('0x9d'),_0x5d38df[_0x7890('0x88')]());require(_0x7890('0x9e'))[_0x7890('0x9f')](path[_0x7890('0x8c')](__dirname,_0x7890('0xa0'),_0x5d0af5[_0x7890('0x92')]),[_0x5d0af5['id'],_0x5d38df[_0x7890('0x88')](),path['join'](__dirname,_0x7890('0xa1'),_0x5d0af5[_0x7890('0xa2')]),_0x1aa3c2]);return _0x5d0af5;}else{var _0x3e5b3f=squel[_0x7890('0x73')]();_0x3e5b3f[_0x7890('0x74')]('('+_0x5d38df[_0x7890('0x88')]()+')','countTable');_0x3e5b3f[_0x7890('0x6a')]('COUNT(*)','count');_0x5d38df['limit'](_0x3613db[_0x7890('0x1e')]||_0xe57492);_0x5d38df[_0x7890('0x1b')](_0x3613db['offset']||0x0);return dbH[_0x7890('0x89')][_0x7890('0x30')](_0x3e5b3f[_0x7890('0x88')](),{'type':dbH[_0x7890('0x89')][_0x7890('0x8a')][_0x7890('0x8b')]})[_0x7890('0x25')](function(_0x3ca53b){if(!_0x3ca53b[_0x7890('0x36')]){_0xe4b81a=0x0;}else{_0xe4b81a=_0x3ca53b[0x0]['count']||0x0;}return dbH[_0x7890('0x89')]['query'](_0x5d38df['toString'](),{'type':dbH[_0x7890('0x89')]['QueryTypes'][_0x7890('0x8b')]});})[_0x7890('0x25')](function(_0x4e294b){return{'rows':_0x4e294b||[],'count':_0xe4b81a};});}});}exports[_0x7890('0xa3')]=function(_0x514916,_0x5f1c8e){return runReport(_0x514916[_0x7890('0x48')],_0x514916[_0x7890('0x30')],_0x514916['options'])[_0x7890('0x25')](respondWithResult(_0x5f1c8e,null))['catch'](handleError(_0x5f1c8e,null));};exports['runReport']=runReport;exports[_0x7890('0x30')]=function(_0x3df855,_0x32a1f5){var _0x39e56b=0xa;var _0x396b80=[_0x7890('0x8c'),_0x7890('0x8d'),_0x7890('0x56'),_0x7890('0x57')];var _0x4aac42={'SUM':'SUM(%s)','COUNT':_0x7890('0x59'),'COUNT DISTINCT':_0x7890('0xa4'),'MAX':_0x7890('0x5a'),'MIN':'MIN(%s)','AVG':_0x7890('0x5c'),'GROUP_CONCAT':_0x7890('0x5d'),'GROUP_CONCAT ASC':_0x7890('0x5e'),'GROUP_CONCAT DESC':_0x7890('0x8e')};var _0x5cd5b1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7890('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x7890('0x62'),'UNIX_TIMESTAMP':_0x7890('0x63')};var _0x209f5a=function(_0x11d2ee){return!_['includes']([_0x7890('0x65'),_0x7890('0x66'),_0x7890('0x8f'),_0x7890('0x67')],_0x11d2ee);};var _0x3fab8b=function(_0x39aa40){if(!_0x39aa40||!_0x39aa40[_0x7890('0x68')]['length']){return'';}for(var _0x2de1cb='(',_0x6d1947=0x0;_0x6d1947<_0x39aa40['rules'][_0x7890('0x36')];_0x6d1947+=0x1){_0x6d1947>0x0&&(_0x2de1cb+='\x20'+_0x39aa40[_0x7890('0x90')]+'\x20');_0x2de1cb+=_0x39aa40[_0x7890('0x68')][_0x6d1947]['group']?_0x3fab8b(_0x39aa40['rules'][_0x6d1947]['group']):_0x39aa40['rules'][_0x6d1947][_0x7890('0x6a')]+'\x20'+_0x39aa40[_0x7890('0x68')][_0x6d1947][_0x7890('0x6b')]+(_0x209f5a(_0x39aa40[_0x7890('0x68')][_0x6d1947][_0x7890('0x6b')])?'\x20'+_0x39aa40[_0x7890('0x68')][_0x6d1947][_0x7890('0x6c')]:'');}return _0x2de1cb+')';};var _0x4f294c={'where':{'id':_0x3df855[_0x7890('0x48')]['id']}},_0x2e9247,_0x2158ae,_0x252552,_0x4efa93,_0x496273;_0x4f294c=_[_0x7890('0x3e')]({},_0x4f294c,_0x3df855[_0x7890('0x41')]);return db[_0x7890('0x2c')][_0x7890('0x4a')](_0x4f294c)[_0x7890('0x25')](function(_0xe4c598){if(_0xe4c598){_0x2e9247=_0xe4c598;return _0xe4c598[_0x7890('0x6d')]();}return null;})['then'](function(_0x3c829d){if(_0x3c829d){if(!_0x3c829d[_0x7890('0x36')]){throw new db[(_0x7890('0x6e'))][(_0x7890('0x6f'))](_0x7890('0x70'),0x193);}_0x2158ae=_0x3c829d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x427e9d){if(_0x427e9d){_0x252552=_['keyBy'](_0x427e9d,'id');var _0x5833d3;var _0x3fb2bd=squel[_0x7890('0x73')]();_0x3fb2bd['from'](_0x2e9247[_0x7890('0x75')]);for(var _0x1c3376=0x0;_0x1c3376<_0x2158ae[_0x7890('0x36')];_0x1c3376+=0x1){_0x5833d3=_0x2158ae[_0x1c3376][_0x7890('0x76')]?_0x252552[_0x2158ae[_0x1c3376][_0x7890('0x76')]][_0x7890('0x77')]:_0x2158ae[_0x1c3376]['field'];_0x5833d3=_0x2158ae[_0x1c3376][_0x7890('0x78')]?_[_0x7890('0x79')](_0x4aac42[_0x2158ae[_0x1c3376][_0x7890('0x78')]],'%s',_0x5833d3):_0x5833d3;_0x5833d3=_0x2158ae[_0x1c3376]['format']?_[_0x7890('0x79')](_0x5cd5b1[_0x2158ae[_0x1c3376][_0x7890('0x7a')]],'%s',_0x5833d3):_0x5833d3;if(_0x2158ae[_0x1c3376]['groupBy']){_0x3fb2bd[_0x7890('0x69')](_0x5833d3);}_0x2158ae[_0x1c3376][_0x7890('0x7c')]&&_0x3fb2bd[_0x7890('0x7d')](_0x5833d3,_0x2158ae[_0x1c3376][_0x7890('0x7c')]==='DESC'?![]:!![]);_0x3fb2bd['field'](_0x5833d3,_0x2158ae[_0x1c3376][_0x7890('0x7e')]||_0x5833d3);}if(_0x2e9247[_0x7890('0x80')]){_0x2e9247['joins']=JSON[_0x7890('0x7f')](_0x2e9247[_0x7890('0x80')]);for(var _0x463ecd=0x0;_0x463ecd<_0x2e9247[_0x7890('0x80')][_0x7890('0x36')];_0x463ecd+=0x1){if(_0x2e9247[_0x7890('0x80')][_0x463ecd]['type']&&_[_0x7890('0x64')](_0x396b80,_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x3f')])&&_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x81')]&&_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x82')]&&_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x83')]){_0x3fb2bd[_0x2e9247[_0x7890('0x80')][_0x463ecd]['type']](_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x82')],null,util['format'](_0x7890('0x91'),_0x2e9247[_0x7890('0x75')],_0x2e9247['joins'][_0x463ecd][_0x7890('0x81')],_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x82')],_0x2e9247[_0x7890('0x80')][_0x463ecd][_0x7890('0x83')]));}}}if(_0x2e9247['conditions']){_0x2e9247[_0x7890('0x84')]=JSON[_0x7890('0x7f')](_0x2e9247['conditions']);_0x3fb2bd[_0x7890('0x3d')](_0x3fab8b(_0x2e9247[_0x7890('0x84')][_0x7890('0x69')]));}_0x496273=_0x3fb2bd[_0x7890('0x85')]();_0x3fb2bd[_0x7890('0x1e')](_0x39e56b);_0x3fb2bd[_0x7890('0x1b')](0x0);logger[_0x7890('0x86')](_0x7890('0x87'),_0x3fb2bd['toString']());return dbH['sequelize'][_0x7890('0x30')](_0x3fb2bd['toString'](),{'type':dbH['sequelize'][_0x7890('0x8a')][_0x7890('0x8b')]});}})['then'](function(){return{'sql':_0x496273['toString']()};})['then'](respondWithResult(_0x32a1f5,null))[_0x7890('0x46')](handleError(_0x32a1f5,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 04ec93f..2968e5d 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 _0x2d72=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports'];(function(_0xbdc2be,_0x1b9b1e){var _0x3702cc=function(_0x2fde47){while(--_0x2fde47){_0xbdc2be['push'](_0xbdc2be['shift']());}};_0x3702cc(++_0x1b9b1e);}(_0x2d72,0xa8));var _0x22d7=function(_0x391cdd,_0x3c4065){_0x391cdd=_0x391cdd-0x0;var _0x111c4c=_0x2d72[_0x391cdd];return _0x111c4c;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa117=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x437aed,_0x2faa84){var _0x26575b=function(_0x1af1a1){while(--_0x1af1a1){_0x437aed['push'](_0x437aed['shift']());}};_0x26575b(++_0x2faa84);}(_0xa117,0x104));var _0x7a11=function(_0x35f69e,_0x57d7e2){_0x35f69e=_0x35f69e-0x0;var _0x25c8ac=_0xa117[_0x35f69e];return _0x25c8ac;};'use strict';var _=require(_0x7a11('0x0'));var util=require(_0x7a11('0x1'));var logger=require(_0x7a11('0x2'))(_0x7a11('0x3'));var moment=require(_0x7a11('0x4'));var BPromise=require(_0x7a11('0x5'));var rp=require(_0x7a11('0x6'));var fs=require('fs');var path=require(_0x7a11('0x7'));var rimraf=require(_0x7a11('0x8'));var config=require(_0x7a11('0x9'));var attributes=require(_0x7a11('0xa'));module[_0x7a11('0xb')]=function(_0x27738a,_0x26ab39){return _0x27738a[_0x7a11('0xc')]('AnalyticCustomReport',attributes,{'tableName':_0x7a11('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index a261e49..2f5fdce 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 _0xc090=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0xb6b229,_0x3637b6){var _0x4aa2cf=function(_0x1a7d7f){while(--_0x1a7d7f){_0xb6b229['push'](_0xb6b229['shift']());}};_0x4aa2cf(++_0x3637b6);}(_0xc090,0x10c));var _0x0c09=function(_0x435470,_0x519a29){_0x435470=_0x435470-0x0;var _0x35ac9a=_0xc090[_0x435470];return _0x35ac9a;};'use strict';var _=require(_0x0c09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0c09('0x1'));var rs=require(_0x0c09('0x2'));var fs=require('fs');var Redis=require(_0x0c09('0x3'));var db=require(_0x0c09('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c09('0x5'))('rpc');var config=require(_0x0c09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0c09('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb58d,_0x12a03d,_0x746b9d){return new BPromise(function(_0xb3636f,_0x59eff2){return client[_0x0c09('0x8')](_0x4bb58d,_0x746b9d)[_0x0c09('0x9')](function(_0x2da373){logger[_0x0c09('0xa')](_0x0c09('0xb'),_0x12a03d,_0x0c09('0xc'));logger[_0x0c09('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x12a03d,_0x0c09('0xc'),JSON[_0x0c09('0xe')](_0x2da373));if(_0x2da373[_0x0c09('0xf')]){if(_0x2da373[_0x0c09('0xf')][_0x0c09('0x10')]===0x1f4){logger[_0x0c09('0xf')](_0x0c09('0xb'),_0x12a03d,_0x2da373['error'][_0x0c09('0x11')]);return _0x59eff2(_0x2da373[_0x0c09('0xf')][_0x0c09('0x11')]);}logger[_0x0c09('0xf')](_0x0c09('0xb'),_0x12a03d,_0x2da373['error']['message']);return _0xb3636f(_0x2da373[_0x0c09('0xf')][_0x0c09('0x11')]);}else{logger[_0x0c09('0xa')](_0x0c09('0xb'),_0x12a03d,_0x0c09('0xc'));_0xb3636f(_0x2da373[_0x0c09('0x12')][_0x0c09('0x11')]);}})[_0x0c09('0x13')](function(_0x28ce2c){logger['error'](_0x0c09('0xb'),_0x12a03d,_0x28ce2c);_0x59eff2(_0x28ce2c);});});}
\ No newline at end of file
+var _0x7035=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7035,0x1c1));var _0x5703=function(_0x2b9919,_0x3270a8){_0x2b9919=_0x2b9919-0x0;var _0x278951=_0x7035[_0x2b9919];return _0x278951;};'use strict';var _=require(_0x5703('0x0'));var util=require(_0x5703('0x1'));var moment=require(_0x5703('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5703('0x3'));var logger=require(_0x5703('0x4'))(_0x5703('0x5'));var config=require(_0x5703('0x6'));var jayson=require(_0x5703('0x7'));var client=jayson['client'][_0x5703('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x258ece,_0x1b6986,_0xdb7f8d){return new BPromise(function(_0x46fc13,_0x48d2e2){return client[_0x5703('0x9')](_0x258ece,_0xdb7f8d)[_0x5703('0xa')](function(_0x5745f1){logger['info'](_0x5703('0xb'),_0x1b6986,_0x5703('0xc'));logger[_0x5703('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1b6986,_0x5703('0xc'),JSON[_0x5703('0xe')](_0x5745f1));if(_0x5745f1['error']){if(_0x5745f1['error']['code']===0x1f4){logger[_0x5703('0xf')](_0x5703('0xb'),_0x1b6986,_0x5745f1['error'][_0x5703('0x10')]);return _0x48d2e2(_0x5745f1[_0x5703('0xf')][_0x5703('0x10')]);}logger[_0x5703('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1b6986,_0x5745f1[_0x5703('0xf')][_0x5703('0x10')]);return _0x46fc13(_0x5745f1['error']['message']);}else{logger[_0x5703('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1b6986,_0x5703('0xc'));_0x46fc13(_0x5745f1[_0x5703('0x12')]['message']);}})[_0x5703('0x13')](function(_0x155c0b){logger[_0x5703('0xf')](_0x5703('0xb'),_0x1b6986,_0x155c0b);_0x48d2e2(_0x155c0b);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a205dd7..1e87fce 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 _0x83a6=['/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run'];(function(_0x173060,_0xf5ad1){var _0x122cad=function(_0x10a570){while(--_0x10a570){_0x173060['push'](_0x173060['shift']());}};_0x122cad(++_0xf5ad1);}(_0x83a6,0x190));var _0x683a=function(_0x5703f6,_0x4910f9){_0x5703f6=_0x5703f6-0x0;var _0x5cf623=_0x83a6[_0x5703f6];return _0x5cf623;};'use strict';var multer=require(_0x683a('0x0'));var util=require('util');var path=require(_0x683a('0x1'));var timeout=require('connect-timeout');var express=require(_0x683a('0x2'));var router=express[_0x683a('0x3')]();var fs_extra=require(_0x683a('0x4'));var auth=require(_0x683a('0x5'));var interaction=require(_0x683a('0x6'));var config=require(_0x683a('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x683a('0x8')]('/',auth[_0x683a('0x9')](),controller[_0x683a('0xa')]);router['get']('/:id',auth[_0x683a('0x9')](),controller[_0x683a('0xb')]);router['get'](_0x683a('0xc'),auth[_0x683a('0x9')](),controller[_0x683a('0xd')]);router[_0x683a('0x8')](_0x683a('0xe'),auth[_0x683a('0x9')](),controller[_0x683a('0xf')]);router[_0x683a('0x8')](_0x683a('0x10'),auth[_0x683a('0x9')](),controller[_0x683a('0x11')]);router[_0x683a('0x12')]('/',auth[_0x683a('0x9')](),controller[_0x683a('0x13')]);router[_0x683a('0x14')](_0x683a('0x15'),auth['isAuthenticated'](),controller[_0x683a('0x16')]);router[_0x683a('0x17')]('/:id',auth[_0x683a('0x9')](),controller[_0x683a('0x18')]);module[_0x683a('0x19')]=router;
\ No newline at end of file
+var _0x03e7=['/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview'];(function(_0x38f1d3,_0x21c5b1){var _0x16b463=function(_0x27cee5){while(--_0x27cee5){_0x38f1d3['push'](_0x38f1d3['shift']());}};_0x16b463(++_0x21c5b1);}(_0x03e7,0x1d3));var _0x703e=function(_0x3037f7,_0x478d56){_0x3037f7=_0x3037f7-0x0;var _0x1a2765=_0x03e7[_0x3037f7];return _0x1a2765;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x703e('0x0'));var timeout=require(_0x703e('0x1'));var express=require(_0x703e('0x2'));var router=express['Router']();var fs_extra=require(_0x703e('0x3'));var auth=require(_0x703e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x703e('0x5'));router[_0x703e('0x6')]('/',auth[_0x703e('0x7')](),controller[_0x703e('0x8')]);router[_0x703e('0x6')](_0x703e('0x9'),auth[_0x703e('0x7')](),controller[_0x703e('0xa')]);router[_0x703e('0x6')](_0x703e('0xb'),auth['isAuthenticated'](),controller[_0x703e('0xc')]);router[_0x703e('0x6')](_0x703e('0xd'),auth[_0x703e('0x7')](),controller[_0x703e('0xe')]);router[_0x703e('0x6')](_0x703e('0xf'),auth[_0x703e('0x7')](),controller[_0x703e('0x10')]);router[_0x703e('0x11')]('/',auth['isAuthenticated'](),controller[_0x703e('0x12')]);router[_0x703e('0x13')](_0x703e('0x9'),auth[_0x703e('0x7')](),controller[_0x703e('0x14')]);router[_0x703e('0x15')](_0x703e('0x9'),auth[_0x703e('0x7')](),controller[_0x703e('0x16')]);module[_0x703e('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 1f7c0b2..ef34fd5 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 _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x53f6fb,_0x289c49){var _0x74a568=function(_0x197cba){while(--_0x197cba){_0x53f6fb['push'](_0x53f6fb['shift']());}};_0x74a568(++_0x289c49);}(_0xe14b,0x93));var _0xbe14=function(_0x5b16fa,_0x157f60){_0x5b16fa=_0x5b16fa-0x0;var _0x35dd49=_0xe14b[_0x5b16fa];return _0x35dd49;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
+var _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x1ca741,_0x5c758c){var _0x54a577=function(_0x574b9f){while(--_0x574b9f){_0x1ca741['push'](_0x1ca741['shift']());}};_0x54a577(++_0x5c758c);}(_0x2bd8,0x130));var _0x82bd=function(_0xe38fcb,_0x41a08c){_0xe38fcb=_0xe38fcb-0x0;var _0x515d67=_0x2bd8[_0xe38fcb];return _0x515d67;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 0eb4a72..afa0073 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1a73f7,_0x274c12){var _0x3570fa=function(_0xdb9fc0){while(--_0xdb9fc0){_0x1a73f7['push'](_0x1a73f7['shift']());}};_0x3570fa(++_0x274c12);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
+var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x389318,_0x13a53d){var _0x7919e3=function(_0x2985d1){while(--_0x2985d1){_0x389318['push'](_0x389318['shift']());}};_0x7919e3(++_0x13a53d);}(_0x7a54,0x106));var _0x47a5=function(_0x2434a1,_0x15d24c){_0x2434a1=_0x2434a1-0x0;var _0xc29e01=_0x7a54[_0x2434a1];return _0xc29e01;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index efea234..1bdf6c8 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 _0x21b0=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x1ab5b5,_0x582f1b){var _0x53fafa=function(_0x44e1ff){while(--_0x44e1ff){_0x1ab5b5['push'](_0x1ab5b5['shift']());}};_0x53fafa(++_0x582f1b);}(_0x21b0,0x183));var _0x021b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x21b0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x021b('0x0'));var util=require(_0x021b('0x1'));var logger=require(_0x021b('0x2'))(_0x021b('0x3'));var moment=require(_0x021b('0x4'));var BPromise=require(_0x021b('0x5'));var rp=require(_0x021b('0x6'));var fs=require('fs');var path=require(_0x021b('0x7'));var rimraf=require(_0x021b('0x8'));var config=require(_0x021b('0x9'));var attributes=require(_0x021b('0xa'));module['exports']=function(_0x216e92,_0x4cb36c){return _0x216e92[_0x021b('0xb')](_0x021b('0xc'),attributes,{'tableName':_0x021b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5711=['rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3107e7,_0x259bc1){var _0x1f97bc=function(_0x495e40){while(--_0x495e40){_0x3107e7['push'](_0x3107e7['shift']());}};_0x1f97bc(++_0x259bc1);}(_0x5711,0x158));var _0x1571=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x5711[_0xc77819];return _0x1c9434;};'use strict';var _=require(_0x1571('0x0'));var util=require(_0x1571('0x1'));var logger=require(_0x1571('0x2'))('api');var moment=require(_0x1571('0x3'));var BPromise=require(_0x1571('0x4'));var rp=require(_0x1571('0x5'));var fs=require('fs');var path=require(_0x1571('0x6'));var rimraf=require(_0x1571('0x7'));var config=require('../../config/environment');var attributes=require(_0x1571('0x8'));module[_0x1571('0x9')]=function(_0x5be704,_0x3d754f){return _0x5be704[_0x1571('0xa')](_0x1571('0xb'),attributes,{'tableName':_0x1571('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 94abff7..c1194b9 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 _0x44ba=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x44ba,0x1b6));var _0xa44b=function(_0x2e2eab,_0x2e609a){_0x2e2eab=_0x2e2eab-0x0;var _0x2357bc=_0x44ba[_0x2e2eab];return _0x2357bc;};'use strict';var _=require(_0xa44b('0x0'));var util=require(_0xa44b('0x1'));var moment=require(_0xa44b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa44b('0x3'));var fs=require('fs');var Redis=require(_0xa44b('0x4'));var db=require(_0xa44b('0x5'))['db'];var utils=require(_0xa44b('0x6'));var logger=require(_0xa44b('0x7'))(_0xa44b('0x8'));var config=require(_0xa44b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa44b('0xa')][_0xa44b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x218a5d,_0x1c7589,_0x2244b0){return new BPromise(function(_0x594017,_0x3d048a){return client[_0xa44b('0xc')](_0x218a5d,_0x2244b0)[_0xa44b('0xd')](function(_0x28cc8e){logger[_0xa44b('0xe')](_0xa44b('0xf'),_0x1c7589,'request\x20sent');logger[_0xa44b('0x10')](_0xa44b('0x11'),_0x1c7589,_0xa44b('0x12'),JSON[_0xa44b('0x13')](_0x28cc8e));if(_0x28cc8e[_0xa44b('0x14')]){if(_0x28cc8e['error'][_0xa44b('0x15')]===0x1f4){logger[_0xa44b('0x14')](_0xa44b('0xf'),_0x1c7589,_0x28cc8e[_0xa44b('0x14')]['message']);return _0x3d048a(_0x28cc8e['error'][_0xa44b('0x16')]);}logger[_0xa44b('0x14')](_0xa44b('0xf'),_0x1c7589,_0x28cc8e[_0xa44b('0x14')][_0xa44b('0x16')]);return _0x594017(_0x28cc8e[_0xa44b('0x14')][_0xa44b('0x16')]);}else{logger[_0xa44b('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c7589,_0xa44b('0x12'));_0x594017(_0x28cc8e[_0xa44b('0x17')][_0xa44b('0x16')]);}})[_0xa44b('0x18')](function(_0x41897c){logger['error'](_0xa44b('0xf'),_0x1c7589,_0x41897c);_0x3d048a(_0x41897c);});});}
\ No newline at end of file
+var _0x75e8=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x269ff5,_0x3b4514){var _0x16b4b4=function(_0x2c6dd7){while(--_0x2c6dd7){_0x269ff5['push'](_0x269ff5['shift']());}};_0x16b4b4(++_0x3b4514);}(_0x75e8,0xf2));var _0x875e=function(_0x884c3c,_0x3941ff){_0x884c3c=_0x884c3c-0x0;var _0x269116=_0x75e8[_0x884c3c];return _0x269116;};'use strict';var _=require(_0x875e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x875e('0x1'));var rs=require(_0x875e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x875e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x875e('0x4'))(_0x875e('0x5'));var config=require('../../config/environment');var jayson=require(_0x875e('0x6'));var client=jayson[_0x875e('0x7')][_0x875e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x231ce6,_0x20c875,_0x33640c){return new BPromise(function(_0x37ae9a,_0x8d8db1){return client[_0x875e('0x9')](_0x231ce6,_0x33640c)[_0x875e('0xa')](function(_0x4b9f0a){logger['info'](_0x875e('0xb'),_0x20c875,_0x875e('0xc'));logger[_0x875e('0xd')](_0x875e('0xe'),_0x20c875,_0x875e('0xc'),JSON[_0x875e('0xf')](_0x4b9f0a));if(_0x4b9f0a[_0x875e('0x10')]){if(_0x4b9f0a[_0x875e('0x10')][_0x875e('0x11')]===0x1f4){logger[_0x875e('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x20c875,_0x4b9f0a[_0x875e('0x10')][_0x875e('0x12')]);return _0x8d8db1(_0x4b9f0a[_0x875e('0x10')][_0x875e('0x12')]);}logger[_0x875e('0x10')](_0x875e('0xb'),_0x20c875,_0x4b9f0a['error'][_0x875e('0x12')]);return _0x37ae9a(_0x4b9f0a[_0x875e('0x10')][_0x875e('0x12')]);}else{logger[_0x875e('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x20c875,_0x875e('0xc'));_0x37ae9a(_0x4b9f0a['result'][_0x875e('0x12')]);}})[_0x875e('0x14')](function(_0x2c4ffb){logger[_0x875e('0x10')](_0x875e('0xb'),_0x20c875,_0x2c4ffb);_0x8d8db1(_0x2c4ffb);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 6923dcf..f617e6c 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 _0xcc8d=['get','isAuthenticated','/:id','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcc8d,0xfc));var _0xdcc8=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0xcc8d[_0x8abd64];return _0xd2511e;};'use strict';var multer=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var path=require('path');var timeout=require(_0xdcc8('0x2'));var express=require('express');var router=express[_0xdcc8('0x3')]();var fs_extra=require(_0xdcc8('0x4'));var auth=require(_0xdcc8('0x5'));var interaction=require(_0xdcc8('0x6'));var config=require(_0xdcc8('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xdcc8('0x8')]('/',auth[_0xdcc8('0x9')](),controller['index']);router[_0xdcc8('0x8')](_0xdcc8('0xa'),auth[_0xdcc8('0x9')](),controller['show']);router[_0xdcc8('0x8')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router['get']('/:id/run',auth[_0xdcc8('0x9')](),controller[_0xdcc8('0xb')]);router[_0xdcc8('0x8')](_0xdcc8('0xc'),auth[_0xdcc8('0x9')](),controller[_0xdcc8('0xd')]);router[_0xdcc8('0xe')]('/',auth[_0xdcc8('0x9')](),controller[_0xdcc8('0xf')]);router[_0xdcc8('0x10')](_0xdcc8('0xa'),auth[_0xdcc8('0x9')](),controller[_0xdcc8('0x11')]);router['delete'](_0xdcc8('0xa'),auth[_0xdcc8('0x9')](),controller[_0xdcc8('0x12')]);module[_0xdcc8('0x13')]=router;
\ No newline at end of file
+var _0xc90c=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0xaf785f,_0x35cfcd){var _0xda140e=function(_0x93da81){while(--_0x93da81){_0xaf785f['push'](_0xaf785f['shift']());}};_0xda140e(++_0x35cfcd);}(_0xc90c,0x1ab));var _0xcc90=function(_0x43d62e,_0x4dc83f){_0x43d62e=_0x43d62e-0x0;var _0x41c270=_0xc90c[_0x43d62e];return _0x41c270;};'use strict';var multer=require(_0xcc90('0x0'));var util=require(_0xcc90('0x1'));var path=require(_0xcc90('0x2'));var timeout=require(_0xcc90('0x3'));var express=require(_0xcc90('0x4'));var router=express[_0xcc90('0x5')]();var fs_extra=require(_0xcc90('0x6'));var auth=require(_0xcc90('0x7'));var interaction=require(_0xcc90('0x8'));var config=require(_0xcc90('0x9'));var controller=require(_0xcc90('0xa'));router[_0xcc90('0xb')]('/',auth[_0xcc90('0xc')](),controller[_0xcc90('0xd')]);router['get'](_0xcc90('0xe'),auth[_0xcc90('0xc')](),controller[_0xcc90('0xf')]);router[_0xcc90('0xb')](_0xcc90('0x10'),auth[_0xcc90('0xc')](),controller[_0xcc90('0x11')]);router[_0xcc90('0xb')](_0xcc90('0x12'),auth[_0xcc90('0xc')](),controller[_0xcc90('0x13')]);router[_0xcc90('0xb')](_0xcc90('0x14'),auth[_0xcc90('0xc')](),controller[_0xcc90('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcc90('0x16')]);router[_0xcc90('0x17')](_0xcc90('0xe'),auth[_0xcc90('0xc')](),controller[_0xcc90('0x18')]);router['delete']('/:id',auth[_0xcc90('0xc')](),controller[_0xcc90('0x19')]);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 a05fb1d..9dd4e46 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 _0xc785=['manual','sequelize','exports','STRING','csv','pdf','Loading','ENUM'];(function(_0x59397f,_0x297dd5){var _0x3b6829=function(_0x4d8d42){while(--_0x4d8d42){_0x59397f['push'](_0x59397f['shift']());}};_0x3b6829(++_0x297dd5);}(_0xc785,0x161));var _0x5c78=function(_0x4e4e4f,_0x54d91b){_0x4e4e4f=_0x4e4e4f-0x0;var _0xb4f281=_0xc785[_0x4e4e4f];return _0xb4f281;};'use strict';var Sequelize=require(_0x5c78('0x0'));var moment=require('moment');module[_0x5c78('0x1')]={'name':{'type':Sequelize[_0x5c78('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x5c78('0x3'),_0x5c78('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x5c78('0x3')},'savename':{'type':Sequelize[_0x5c78('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x5c78('0x2')],'defaultValue':_0x5c78('0x5')},'type':{'type':Sequelize[_0x5c78('0x6')](_0x5c78('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1004=['STRING','csv','DATE','ENUM','manual','scheduled','INTEGER','moment'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0x1004,0x9f));var _0x4100=function(_0x3e3a9d,_0x39b404){_0x3e3a9d=_0x3e3a9d-0x0;var _0x514381=_0x1004[_0x3e3a9d];return _0x514381;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4100('0x0'));module['exports']={'name':{'type':Sequelize[_0x4100('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x4100('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x4100('0x2'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x4100('0x2')},'savename':{'type':Sequelize[_0x4100('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4100('0x3')]},'endDate':{'type':Sequelize[_0x4100('0x3')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x4100('0x4')](_0x4100('0x5'),_0x4100('0x6')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x4100('0x7')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index e084797..6bddb30 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 _0x09df=['existsSync','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','root','server/files/reports','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','index','AnalyticExtractedReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','create','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','basename','savename'];(function(_0x198070,_0x8b89a4){var _0x3e3aac=function(_0x1b89eb){while(--_0x1b89eb){_0x198070['push'](_0x198070['shift']());}};_0x3e3aac(++_0x8b89a4);}(_0x09df,0x123));var _0xf09d=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x09df[_0x2aa0e7];return _0x1472c0;};'use strict';var emlformat=require(_0xf09d('0x0'));var rimraf=require(_0xf09d('0x1'));var zipdir=require(_0xf09d('0x2'));var jsonpatch=require(_0xf09d('0x3'));var rp=require(_0xf09d('0x4'));var moment=require(_0xf09d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf09d('0x6'));var util=require(_0xf09d('0x7'));var path=require(_0xf09d('0x8'));var sox=require(_0xf09d('0x9'));var csv=require(_0xf09d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf09d('0xb'));var _=require(_0xf09d('0xc'));var squel=require(_0xf09d('0xd'));var crypto=require('crypto');var jsforce=require(_0xf09d('0xe'));var deskjs=require(_0xf09d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf09d('0x10'));var Redis=require('ioredis');var authService=require(_0xf09d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf09d('0x12'));var logger=require(_0xf09d('0x13'))(_0xf09d('0x14'));var utils=require(_0xf09d('0x15'));var config=require(_0xf09d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf09d('0x17'))['db'];function respondWithStatusCode(_0x2d8814,_0x3cf76f){_0x3cf76f=_0x3cf76f||0xcc;return function(_0x27f885){if(_0x27f885){return _0x2d8814[_0xf09d('0x18')](_0x3cf76f);}return _0x2d8814[_0xf09d('0x19')](_0x3cf76f)[_0xf09d('0x1a')]();};}function respondWithResult(_0x386e2a,_0x4bff69){_0x4bff69=_0x4bff69||0xc8;return function(_0x46798e){if(_0x46798e){return _0x386e2a[_0xf09d('0x19')](_0x4bff69)[_0xf09d('0x1b')](_0x46798e);}};}function respondWithFilteredResult(_0x4a5eef,_0x2570ed){return function(_0x37e245){if(_0x37e245){var _0x532efc=typeof _0x2570ed[_0xf09d('0x1c')]===_0xf09d('0x1d')&&typeof _0x2570ed['limit']===_0xf09d('0x1d');var _0x2c4934=_0x37e245[_0xf09d('0x1e')];var _0x5a7dab=_0x532efc?0x0:_0x2570ed[_0xf09d('0x1c')];var _0x170d79=_0x532efc?_0x37e245[_0xf09d('0x1e')]:_0x2570ed['offset']+_0x2570ed[_0xf09d('0x1f')];var _0x3c7a85;if(_0x170d79>=_0x2c4934){_0x170d79=_0x2c4934;_0x3c7a85=0xc8;}else{_0x3c7a85=0xce;}_0x4a5eef[_0xf09d('0x19')](_0x3c7a85);return _0x4a5eef[_0xf09d('0x20')]('Content-Range',_0x5a7dab+'-'+_0x170d79+'/'+_0x2c4934)[_0xf09d('0x1b')](_0x37e245);}return null;};}function patchUpdates(_0x3e4a5b){return function(_0x2e3ba5){try{jsonpatch['apply'](_0x2e3ba5,_0x3e4a5b,!![]);}catch(_0x397ec9){return BPromise[_0xf09d('0x21')](_0x397ec9);}return _0x2e3ba5[_0xf09d('0x22')]();};}function saveUpdates(_0xc9778e,_0x2777b1){return function(_0x5b4ebb){if(_0x5b4ebb){return _0x5b4ebb[_0xf09d('0x23')](_0xc9778e)[_0xf09d('0x24')](function(_0x443cf2){return _0x443cf2;});}return null;};}function removeEntity(_0x71f53e,_0x42d47e){return function(_0x328bf5){if(_0x328bf5){return _0x328bf5[_0xf09d('0x25')]()['then'](function(){var _0x5313f2=_0x328bf5[_0xf09d('0x26')]({'plain':!![]});var _0x40262e=_0xf09d('0x27');return db[_0xf09d('0x28')][_0xf09d('0x25')]({'where':{'type':_0x40262e,'resourceId':_0x5313f2['id']}})[_0xf09d('0x24')](function(){return _0x328bf5;});})[_0xf09d('0x24')](function(){_0x71f53e[_0xf09d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d554b,_0x38d0ea){return function(_0x585e9a){if(!_0x585e9a){_0x3d554b['sendStatus'](0x194);}return _0x585e9a;};}function handleError(_0x211c40,_0x15927e){_0x15927e=_0x15927e||0x1f4;return function(_0x27bbbc){logger['error'](_0x27bbbc[_0xf09d('0x29')]);if(_0x27bbbc[_0xf09d('0x2a')]){delete _0x27bbbc[_0xf09d('0x2a')];}_0x211c40[_0xf09d('0x19')](_0x15927e)['send'](_0x27bbbc);};}exports[_0xf09d('0x2b')]=function(_0x19af85,_0x45c080){var _0x2a5fa7={},_0x57c7d1={},_0x59a54f={'count':0x0,'rows':[]};var _0x20cd68=_['map'](db[_0xf09d('0x2c')]['rawAttributes'],function(_0x2d3745){return{'name':_0x2d3745[_0xf09d('0x2d')],'type':_0x2d3745['type'][_0xf09d('0x2e')]};});_0x57c7d1[_0xf09d('0x2f')]=_[_0xf09d('0x30')](_0x20cd68,_0xf09d('0x2a'));_0x57c7d1[_0xf09d('0x31')]=_[_0xf09d('0x32')](_0x19af85['query']);_0x57c7d1[_0xf09d('0x33')]=_[_0xf09d('0x34')](_0x57c7d1[_0xf09d('0x2f')],_0x57c7d1[_0xf09d('0x31')]);_0x2a5fa7[_0xf09d('0x35')]=_[_0xf09d('0x34')](_0x57c7d1[_0xf09d('0x2f')],qs[_0xf09d('0x36')](_0x19af85['query'][_0xf09d('0x36')]));_0x2a5fa7[_0xf09d('0x35')]=_0x2a5fa7[_0xf09d('0x35')][_0xf09d('0x37')]?_0x2a5fa7['attributes']:_0x57c7d1[_0xf09d('0x2f')];if(!_0x19af85[_0xf09d('0x31')][_0xf09d('0x38')](_0xf09d('0x39'))){_0x2a5fa7['limit']=qs[_0xf09d('0x1f')](_0x19af85[_0xf09d('0x31')][_0xf09d('0x1f')]);_0x2a5fa7[_0xf09d('0x1c')]=qs[_0xf09d('0x1c')](_0x19af85['query']['offset']);}_0x2a5fa7['order']=qs['sort'](_0x19af85[_0xf09d('0x31')]['sort']);_0x2a5fa7[_0xf09d('0x3a')]=qs[_0xf09d('0x33')](_[_0xf09d('0x3b')](_0x19af85[_0xf09d('0x31')],_0x57c7d1[_0xf09d('0x33')]),_0x20cd68);if(_0x19af85[_0xf09d('0x31')][_0xf09d('0x3c')]){_0x2a5fa7[_0xf09d('0x3a')]=_[_0xf09d('0x3d')](_0x2a5fa7['where'],{'$or':_['map'](_0x20cd68,function(_0x46f5dd){if(_0x46f5dd[_0xf09d('0x3e')]!==_0xf09d('0x3f')){var _0x4a8bcd={};_0x4a8bcd[_0x46f5dd[_0xf09d('0x2a')]]={'$like':'%'+_0x19af85['query'][_0xf09d('0x3c')]+'%'};return _0x4a8bcd;}})});}_0x2a5fa7=_['merge']({},_0x2a5fa7,_0x19af85[_0xf09d('0x40')]);var _0x92fb14={'where':_0x2a5fa7['where']};return db[_0xf09d('0x2c')]['count'](_0x92fb14)[_0xf09d('0x24')](function(_0x52e046){_0x59a54f['count']=_0x52e046;if(_0x19af85[_0xf09d('0x31')][_0xf09d('0x41')]){_0x2a5fa7[_0xf09d('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x2a5fa7);})[_0xf09d('0x24')](function(_0x41ebcb){_0x59a54f[_0xf09d('0x43')]=_0x41ebcb;return _0x59a54f;})['then'](respondWithFilteredResult(_0x45c080,_0x2a5fa7))[_0xf09d('0x44')](handleError(_0x45c080,null));};exports['show']=function(_0x3c82a0,_0x25923d){var _0x38de1e={'raw':!![],'where':{'id':_0x3c82a0['params']['id']}},_0x5c3565={};_0x5c3565[_0xf09d('0x2f')]=_[_0xf09d('0x32')](db[_0xf09d('0x2c')][_0xf09d('0x45')]);_0x5c3565[_0xf09d('0x31')]=_[_0xf09d('0x32')](_0x3c82a0[_0xf09d('0x31')]);_0x5c3565[_0xf09d('0x33')]=_[_0xf09d('0x34')](_0x5c3565[_0xf09d('0x2f')],_0x5c3565['query']);_0x38de1e[_0xf09d('0x35')]=_['intersection'](_0x5c3565[_0xf09d('0x2f')],qs[_0xf09d('0x36')](_0x3c82a0[_0xf09d('0x31')][_0xf09d('0x36')]));_0x38de1e['attributes']=_0x38de1e['attributes'][_0xf09d('0x37')]?_0x38de1e[_0xf09d('0x35')]:_0x5c3565[_0xf09d('0x2f')];if(_0x3c82a0[_0xf09d('0x31')][_0xf09d('0x41')]){_0x38de1e['include']=[{'all':!![]}];}_0x38de1e=_[_0xf09d('0x3d')]({},_0x38de1e,_0x3c82a0[_0xf09d('0x40')]);return db['AnalyticExtractedReport']['find'](_0x38de1e)[_0xf09d('0x24')](handleEntityNotFound(_0x25923d,null))[_0xf09d('0x24')](respondWithResult(_0x25923d,null))['catch'](handleError(_0x25923d,null));};exports[_0xf09d('0x46')]=function(_0x519450,_0xddedc0){return db[_0xf09d('0x2c')][_0xf09d('0x46')](_0x519450['body'],{})['then'](function(_0x46cfd3){var _0x164229=_0x519450[_0xf09d('0x47')]['get']({'plain':!![]});if(!_0x164229)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x164229[_0xf09d('0x48')]===_0xf09d('0x47')){var _0x514884=_0x46cfd3[_0xf09d('0x26')]({'plain':!![]});var _0x1b88ac=_0xf09d('0x27');return db['UserProfileSection'][_0xf09d('0x49')]({'where':{'name':_0x1b88ac,'userProfileId':_0x164229[_0xf09d('0x4a')]},'raw':!![]})['then'](function(_0x1e4332){if(_0x1e4332&&_0x1e4332[_0xf09d('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x514884[_0xf09d('0x2a')],'resourceId':_0x514884['id'],'type':_0x1e4332['name'],'sectionId':_0x1e4332['id']},{})[_0xf09d('0x24')](function(){return _0x46cfd3;});}else{return _0x46cfd3;}})[_0xf09d('0x44')](function(_0x2ef3af){logger['error'](_0xf09d('0x4c'),_0x2ef3af);throw _0x2ef3af;});}return _0x46cfd3;})['then'](respondWithResult(_0xddedc0,0xc9))['catch'](handleError(_0xddedc0,null));};exports[_0xf09d('0x23')]=function(_0x446ccc,_0x30244a){if(_0x446ccc[_0xf09d('0x4d')]['id']){delete _0x446ccc['body']['id'];}return db[_0xf09d('0x2c')][_0xf09d('0x49')]({'where':{'id':_0x446ccc[_0xf09d('0x4e')]['id']}})[_0xf09d('0x24')](handleEntityNotFound(_0x30244a,null))[_0xf09d('0x24')](saveUpdates(_0x446ccc[_0xf09d('0x4d')],null))[_0xf09d('0x24')](respondWithResult(_0x30244a,null))[_0xf09d('0x44')](handleError(_0x30244a,null));};exports[_0xf09d('0x25')]=function(_0x504b8f,_0x17759a){return db[_0xf09d('0x2c')]['find']({'where':{'id':_0x504b8f[_0xf09d('0x4e')]['id']}})[_0xf09d('0x24')](handleEntityNotFound(_0x17759a,null))[_0xf09d('0x24')](removeEntity(_0x17759a,null))[_0xf09d('0x44')](handleError(_0x17759a,null));};exports['download']=function(_0xf10987,_0x29101b,_0x42c16e){return db[_0xf09d('0x2c')][_0xf09d('0x49')]({'where':{'id':_0xf10987['params']['id']},'attributes':[_0xf09d('0x2a'),_0xf09d('0x4f'),_0xf09d('0x50'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x29101b,null))[_0xf09d('0x24')](function(_0x38a956){if(_0x38a956){if(!fs[_0xf09d('0x51')](path[_0xf09d('0x52')](config['root'],'server/files/reports',_0x38a956[_0xf09d('0x50')]))){throw new db[(_0xf09d('0x53'))][(_0xf09d('0x54'))](_0xf09d('0x55'));}if(_0xf10987['query']['exists']){return _0x29101b[_0xf09d('0x18')](0xc8);}return _0x29101b[_0xf09d('0x56')](path[_0xf09d('0x52')](config[_0xf09d('0x57')],_0xf09d('0x58'),_0x38a956[_0xf09d('0x50')]),util[_0xf09d('0x59')](_0xf09d('0x5a'),_0x38a956[_0xf09d('0x4f')]||_0x38a956[_0xf09d('0x2a')],_0x38a956[_0xf09d('0x5b')][_0xf09d('0x5c')]()));}})[_0xf09d('0x44')](handleError(_0x29101b,null));};
\ No newline at end of file
+var _0xbc34=['ExtractedReports','UserProfileResource','end','error','stack','name','index','map','AnalyticExtractedReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','root','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','server/files/reports','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get'];(function(_0x542efb,_0x5424e9){var _0x4bc7f5=function(_0x2b9953){while(--_0x2b9953){_0x542efb['push'](_0x542efb['shift']());}};_0x4bc7f5(++_0x5424e9);}(_0xbc34,0x9e));var _0x4bc3=function(_0x2da371,_0x3d8847){_0x2da371=_0x2da371-0x0;var _0x448712=_0xbc34[_0x2da371];return _0x448712;};'use strict';var emlformat=require(_0x4bc3('0x0'));var rimraf=require(_0x4bc3('0x1'));var zipdir=require(_0x4bc3('0x2'));var jsonpatch=require(_0x4bc3('0x3'));var rp=require(_0x4bc3('0x4'));var moment=require(_0x4bc3('0x5'));var BPromise=require(_0x4bc3('0x6'));var Mustache=require(_0x4bc3('0x7'));var util=require(_0x4bc3('0x8'));var path=require(_0x4bc3('0x9'));var sox=require(_0x4bc3('0xa'));var csv=require(_0x4bc3('0xb'));var ejs=require(_0x4bc3('0xc'));var fs=require('fs');var fs_extra=require(_0x4bc3('0xd'));var _=require(_0x4bc3('0xe'));var squel=require('squel');var crypto=require(_0x4bc3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4bc3('0x10'));var toCsv=require(_0x4bc3('0xb'));var querystring=require(_0x4bc3('0x11'));var Papa=require('papaparse');var Redis=require(_0x4bc3('0x12'));var authService=require(_0x4bc3('0x13'));var qs=require(_0x4bc3('0x14'));var as=require(_0x4bc3('0x15'));var hardwareService=require(_0x4bc3('0x16'));var logger=require(_0x4bc3('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4bc3('0x18'));var licenseUtil=require(_0x4bc3('0x19'));var db=require(_0x4bc3('0x1a'))['db'];function respondWithStatusCode(_0x2c5e8e,_0x5d364a){_0x5d364a=_0x5d364a||0xcc;return function(_0x5c63b3){if(_0x5c63b3){return _0x2c5e8e[_0x4bc3('0x1b')](_0x5d364a);}return _0x2c5e8e['status'](_0x5d364a)['end']();};}function respondWithResult(_0x37fd30,_0x50ff53){_0x50ff53=_0x50ff53||0xc8;return function(_0x4f0ebd){if(_0x4f0ebd){return _0x37fd30[_0x4bc3('0x1c')](_0x50ff53)['json'](_0x4f0ebd);}};}function respondWithFilteredResult(_0x1e941e,_0x5e8db2){return function(_0x23b860){if(_0x23b860){var _0x2ff50d=typeof _0x5e8db2[_0x4bc3('0x1d')]===_0x4bc3('0x1e')&&typeof _0x5e8db2[_0x4bc3('0x1f')]===_0x4bc3('0x1e');var _0x3e4f7e=_0x23b860[_0x4bc3('0x20')];var _0x5e5083=_0x2ff50d?0x0:_0x5e8db2[_0x4bc3('0x1d')];var _0x277222=_0x2ff50d?_0x23b860[_0x4bc3('0x20')]:_0x5e8db2[_0x4bc3('0x1d')]+_0x5e8db2[_0x4bc3('0x1f')];var _0x5b8b93;if(_0x277222>=_0x3e4f7e){_0x277222=_0x3e4f7e;_0x5b8b93=0xc8;}else{_0x5b8b93=0xce;}_0x1e941e[_0x4bc3('0x1c')](_0x5b8b93);return _0x1e941e[_0x4bc3('0x21')](_0x4bc3('0x22'),_0x5e5083+'-'+_0x277222+'/'+_0x3e4f7e)[_0x4bc3('0x23')](_0x23b860);}return null;};}function patchUpdates(_0x58aea0){return function(_0x2964aa){try{jsonpatch[_0x4bc3('0x24')](_0x2964aa,_0x58aea0,!![]);}catch(_0x17d7ca){return BPromise[_0x4bc3('0x25')](_0x17d7ca);}return _0x2964aa['save']();};}function saveUpdates(_0x45f28e,_0x5a7810){return function(_0x228ef2){if(_0x228ef2){return _0x228ef2[_0x4bc3('0x26')](_0x45f28e)[_0x4bc3('0x27')](function(_0x816b9d){return _0x816b9d;});}return null;};}function removeEntity(_0x1d3c73,_0x4dc03a){return function(_0x4e5f81){if(_0x4e5f81){return _0x4e5f81[_0x4bc3('0x28')]()['then'](function(){var _0x28b6b1=_0x4e5f81[_0x4bc3('0x29')]({'plain':!![]});var _0x2cede3=_0x4bc3('0x2a');return db[_0x4bc3('0x2b')][_0x4bc3('0x28')]({'where':{'type':_0x2cede3,'resourceId':_0x28b6b1['id']}})['then'](function(){return _0x4e5f81;});})['then'](function(){_0x1d3c73[_0x4bc3('0x1c')](0xcc)[_0x4bc3('0x2c')]();});}};}function handleEntityNotFound(_0x5ba536,_0x1162e5){return function(_0x4de5b5){if(!_0x4de5b5){_0x5ba536[_0x4bc3('0x1b')](0x194);}return _0x4de5b5;};}function handleError(_0x4cf6f9,_0x1cdbbd){_0x1cdbbd=_0x1cdbbd||0x1f4;return function(_0x16b59d){logger[_0x4bc3('0x2d')](_0x16b59d[_0x4bc3('0x2e')]);if(_0x16b59d[_0x4bc3('0x2f')]){delete _0x16b59d[_0x4bc3('0x2f')];}_0x4cf6f9[_0x4bc3('0x1c')](_0x1cdbbd)['send'](_0x16b59d);};}exports[_0x4bc3('0x30')]=function(_0xff77aa,_0x26e11f){var _0x4f22d8={},_0x1e47f6={},_0x29628a={'count':0x0,'rows':[]};var _0x2310fa=_[_0x4bc3('0x31')](db[_0x4bc3('0x32')]['rawAttributes'],function(_0xd58263){return{'name':_0xd58263[_0x4bc3('0x33')],'type':_0xd58263[_0x4bc3('0x34')]['key']};});_0x1e47f6[_0x4bc3('0x35')]=_[_0x4bc3('0x31')](_0x2310fa,'name');_0x1e47f6[_0x4bc3('0x36')]=_[_0x4bc3('0x37')](_0xff77aa[_0x4bc3('0x36')]);_0x1e47f6[_0x4bc3('0x38')]=_[_0x4bc3('0x39')](_0x1e47f6['model'],_0x1e47f6['query']);_0x4f22d8[_0x4bc3('0x3a')]=_[_0x4bc3('0x39')](_0x1e47f6['model'],qs['fields'](_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x3b')]));_0x4f22d8['attributes']=_0x4f22d8['attributes'][_0x4bc3('0x3c')]?_0x4f22d8[_0x4bc3('0x3a')]:_0x1e47f6['model'];if(!_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x3d')]('nolimit')){_0x4f22d8[_0x4bc3('0x1f')]=qs[_0x4bc3('0x1f')](_0xff77aa['query'][_0x4bc3('0x1f')]);_0x4f22d8[_0x4bc3('0x1d')]=qs[_0x4bc3('0x1d')](_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x1d')]);}_0x4f22d8[_0x4bc3('0x3e')]=qs['sort'](_0xff77aa['query'][_0x4bc3('0x3f')]);_0x4f22d8[_0x4bc3('0x40')]=qs[_0x4bc3('0x38')](_['pick'](_0xff77aa['query'],_0x1e47f6[_0x4bc3('0x38')]),_0x2310fa);if(_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x41')]){_0x4f22d8[_0x4bc3('0x40')]=_['merge'](_0x4f22d8['where'],{'$or':_[_0x4bc3('0x31')](_0x2310fa,function(_0x2d53e8){if(_0x2d53e8[_0x4bc3('0x34')]!==_0x4bc3('0x42')){var _0x5ecdf6={};_0x5ecdf6[_0x2d53e8['name']]={'$like':'%'+_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x41')]+'%'};return _0x5ecdf6;}})});}_0x4f22d8=_[_0x4bc3('0x43')]({},_0x4f22d8,_0xff77aa[_0x4bc3('0x44')]);var _0x3f538b={'where':_0x4f22d8[_0x4bc3('0x40')]};return db['AnalyticExtractedReport']['count'](_0x3f538b)[_0x4bc3('0x27')](function(_0x2df1dc){_0x29628a[_0x4bc3('0x20')]=_0x2df1dc;if(_0xff77aa[_0x4bc3('0x36')][_0x4bc3('0x45')]){_0x4f22d8[_0x4bc3('0x46')]=[{'all':!![]}];}return db[_0x4bc3('0x32')][_0x4bc3('0x47')](_0x4f22d8);})['then'](function(_0x6a8650){_0x29628a[_0x4bc3('0x48')]=_0x6a8650;return _0x29628a;})['then'](respondWithFilteredResult(_0x26e11f,_0x4f22d8))[_0x4bc3('0x49')](handleError(_0x26e11f,null));};exports['show']=function(_0x3aa9e2,_0x198dc9){var _0x2b3f54={'raw':!![],'where':{'id':_0x3aa9e2['params']['id']}},_0x341552={};_0x341552['model']=_[_0x4bc3('0x37')](db[_0x4bc3('0x32')][_0x4bc3('0x4a')]);_0x341552[_0x4bc3('0x36')]=_['keys'](_0x3aa9e2[_0x4bc3('0x36')]);_0x341552['filters']=_['intersection'](_0x341552[_0x4bc3('0x35')],_0x341552[_0x4bc3('0x36')]);_0x2b3f54[_0x4bc3('0x3a')]=_[_0x4bc3('0x39')](_0x341552[_0x4bc3('0x35')],qs[_0x4bc3('0x3b')](_0x3aa9e2[_0x4bc3('0x36')][_0x4bc3('0x3b')]));_0x2b3f54[_0x4bc3('0x3a')]=_0x2b3f54['attributes'][_0x4bc3('0x3c')]?_0x2b3f54[_0x4bc3('0x3a')]:_0x341552['model'];if(_0x3aa9e2[_0x4bc3('0x36')]['includeAll']){_0x2b3f54['include']=[{'all':!![]}];}_0x2b3f54=_['merge']({},_0x2b3f54,_0x3aa9e2['options']);return db[_0x4bc3('0x32')][_0x4bc3('0x4b')](_0x2b3f54)['then'](handleEntityNotFound(_0x198dc9,null))[_0x4bc3('0x27')](respondWithResult(_0x198dc9,null))[_0x4bc3('0x49')](handleError(_0x198dc9,null));};exports['create']=function(_0x3ed4fa,_0x14d32a){return db[_0x4bc3('0x32')][_0x4bc3('0x4c')](_0x3ed4fa[_0x4bc3('0x4d')],{})[_0x4bc3('0x27')](function(_0x1308d1){var _0x2d9850=_0x3ed4fa[_0x4bc3('0x4e')][_0x4bc3('0x29')]({'plain':!![]});if(!_0x2d9850)throw new Error(_0x4bc3('0x4f'));if(_0x2d9850[_0x4bc3('0x50')]===_0x4bc3('0x4e')){var _0x2e0f22=_0x1308d1[_0x4bc3('0x29')]({'plain':!![]});var _0x316551=_0x4bc3('0x2a');return db[_0x4bc3('0x51')]['find']({'where':{'name':_0x316551,'userProfileId':_0x2d9850[_0x4bc3('0x52')]},'raw':!![]})[_0x4bc3('0x27')](function(_0x2faf96){if(_0x2faf96&&_0x2faf96[_0x4bc3('0x53')]===0x0){return db[_0x4bc3('0x2b')][_0x4bc3('0x4c')]({'name':_0x2e0f22[_0x4bc3('0x2f')],'resourceId':_0x2e0f22['id'],'type':_0x2faf96[_0x4bc3('0x2f')],'sectionId':_0x2faf96['id']},{})[_0x4bc3('0x27')](function(){return _0x1308d1;});}else{return _0x1308d1;}})[_0x4bc3('0x49')](function(_0x4802c0){logger['error'](_0x4bc3('0x54'),_0x4802c0);throw _0x4802c0;});}return _0x1308d1;})[_0x4bc3('0x27')](respondWithResult(_0x14d32a,0xc9))[_0x4bc3('0x49')](handleError(_0x14d32a,null));};exports[_0x4bc3('0x26')]=function(_0x3b2425,_0x22c5cc){if(_0x3b2425['body']['id']){delete _0x3b2425['body']['id'];}return db['AnalyticExtractedReport'][_0x4bc3('0x4b')]({'where':{'id':_0x3b2425[_0x4bc3('0x55')]['id']}})[_0x4bc3('0x27')](handleEntityNotFound(_0x22c5cc,null))[_0x4bc3('0x27')](saveUpdates(_0x3b2425[_0x4bc3('0x4d')],null))[_0x4bc3('0x27')](respondWithResult(_0x22c5cc,null))[_0x4bc3('0x49')](handleError(_0x22c5cc,null));};exports['destroy']=function(_0x65b4d6,_0x5ac22c){return db[_0x4bc3('0x32')][_0x4bc3('0x4b')]({'where':{'id':_0x65b4d6[_0x4bc3('0x55')]['id']}})[_0x4bc3('0x27')](handleEntityNotFound(_0x5ac22c,null))[_0x4bc3('0x27')](removeEntity(_0x5ac22c,null))[_0x4bc3('0x49')](handleError(_0x5ac22c,null));};exports[_0x4bc3('0x56')]=function(_0x2853d3,_0x173dd3,_0x5dba9e){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x2853d3[_0x4bc3('0x55')]['id']},'attributes':['name','basename',_0x4bc3('0x57'),_0x4bc3('0x58')],'raw':!![]})[_0x4bc3('0x27')](handleEntityNotFound(_0x173dd3,null))[_0x4bc3('0x27')](function(_0x263f71){if(_0x263f71){if(!fs[_0x4bc3('0x59')](path['join'](config[_0x4bc3('0x5a')],'server/files/reports',_0x263f71[_0x4bc3('0x57')]))){throw new db['Sequelize'][(_0x4bc3('0x5b'))](_0x4bc3('0x5c'));}if(_0x2853d3[_0x4bc3('0x36')][_0x4bc3('0x5d')]){return _0x173dd3[_0x4bc3('0x1b')](0xc8);}return _0x173dd3[_0x4bc3('0x56')](path[_0x4bc3('0x5e')](config[_0x4bc3('0x5a')],_0x4bc3('0x5f'),_0x263f71[_0x4bc3('0x57')]),util[_0x4bc3('0x60')](_0x4bc3('0x61'),_0x263f71[_0x4bc3('0x62')]||_0x263f71[_0x4bc3('0x2f')],_0x263f71[_0x4bc3('0x58')][_0x4bc3('0x63')]()));}})[_0x4bc3('0x49')](handleError(_0x173dd3,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 2db5538..15f86f3 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 _0xcb8b=['AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','path','rimraf','../../config/environment','define'];(function(_0x15feaf,_0x53ff1c){var _0x4dbbec=function(_0x44ffbb){while(--_0x44ffbb){_0x15feaf['push'](_0x15feaf['shift']());}};_0x4dbbec(++_0x53ff1c);}(_0xcb8b,0x1b0));var _0xbcb8=function(_0x498a7a,_0x95fce){_0x498a7a=_0x498a7a-0x0;var _0x4ff437=_0xcb8b[_0x498a7a];return _0x4ff437;};'use strict';var _=require('lodash');var util=require(_0xbcb8('0x0'));var logger=require(_0xbcb8('0x1'))(_0xbcb8('0x2'));var moment=require(_0xbcb8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcb8('0x4'));var rimraf=require(_0xbcb8('0x5'));var config=require(_0xbcb8('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x574b9f,_0x5ea062){return _0x574b9f[_0xbcb8('0x7')](_0xbcb8('0x8'),attributes,{'tableName':_0xbcb8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e15=['request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','util','../../config/logger','api','bluebird'];(function(_0x21eb63,_0xf3eeac){var _0x217c84=function(_0x5ebf8d){while(--_0x5ebf8d){_0x21eb63['push'](_0x21eb63['shift']());}};_0x217c84(++_0xf3eeac);}(_0x3e15,0xd8));var _0x53e1=function(_0x2176a4,_0x4ae96f){_0x2176a4=_0x2176a4-0x0;var _0x3c3b21=_0x3e15[_0x2176a4];return _0x3c3b21;};'use strict';var _=require('lodash');var util=require(_0x53e1('0x0'));var logger=require(_0x53e1('0x1'))(_0x53e1('0x2'));var moment=require('moment');var BPromise=require(_0x53e1('0x3'));var rp=require(_0x53e1('0x4'));var fs=require('fs');var path=require(_0x53e1('0x5'));var rimraf=require(_0x53e1('0x6'));var config=require(_0x53e1('0x7'));var attributes=require(_0x53e1('0x8'));module[_0x53e1('0x9')]=function(_0x4b640f,_0x28b5df){return _0x4b640f['define']('AnalyticExtractedReport',attributes,{'tableName':_0x53e1('0xa'),'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 ef4b097..fe1ee99 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 _0x1458=['jayson/promise','client','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x35a5e3,_0xb14268){var _0x5653bb=function(_0x3048f0){while(--_0x3048f0){_0x35a5e3['push'](_0x35a5e3['shift']());}};_0x5653bb(++_0xb14268);}(_0x1458,0x16c));var _0x8145=function(_0x431186,_0x592739){_0x431186=_0x431186-0x0;var _0x401ce8=_0x1458[_0x431186];return _0x401ce8;};'use strict';var _=require(_0x8145('0x0'));var util=require(_0x8145('0x1'));var moment=require(_0x8145('0x2'));var BPromise=require(_0x8145('0x3'));var rs=require(_0x8145('0x4'));var fs=require('fs');var Redis=require(_0x8145('0x5'));var db=require(_0x8145('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8145('0x7'))(_0x8145('0x8'));var config=require(_0x8145('0x9'));var jayson=require(_0x8145('0xa'));var client=jayson[_0x8145('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe25a1b,_0x5f3a02,_0x5b7b04){return new BPromise(function(_0x5d2f25,_0x22468d){return client['request'](_0xe25a1b,_0x5b7b04)[_0x8145('0xc')](function(_0x1bb760){logger['info'](_0x8145('0xd'),_0x5f3a02,_0x8145('0xe'));logger[_0x8145('0xf')](_0x8145('0x10'),_0x5f3a02,_0x8145('0xe'),JSON['stringify'](_0x1bb760));if(_0x1bb760[_0x8145('0x11')]){if(_0x1bb760[_0x8145('0x11')][_0x8145('0x12')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5f3a02,_0x1bb760[_0x8145('0x11')][_0x8145('0x13')]);return _0x22468d(_0x1bb760[_0x8145('0x11')][_0x8145('0x13')]);}logger[_0x8145('0x11')](_0x8145('0xd'),_0x5f3a02,_0x1bb760[_0x8145('0x11')]['message']);return _0x5d2f25(_0x1bb760[_0x8145('0x11')][_0x8145('0x13')]);}else{logger[_0x8145('0x14')](_0x8145('0xd'),_0x5f3a02,'request\x20sent');_0x5d2f25(_0x1bb760['result'][_0x8145('0x13')]);}})[_0x8145('0x15')](function(_0x19b151){logger[_0x8145('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5f3a02,_0x19b151);_0x22468d(_0x19b151);});});}
\ No newline at end of file
+var _0x3bd1=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x30cbb3,_0x30a8ea){var _0x146d30=function(_0x4df660){while(--_0x4df660){_0x30cbb3['push'](_0x30cbb3['shift']());}};_0x146d30(++_0x30a8ea);}(_0x3bd1,0x111));var _0x13bd=function(_0x163085,_0x48a6ca){_0x163085=_0x163085-0x0;var _0x2b5abe=_0x3bd1[_0x163085];return _0x2b5abe;};'use strict';var _=require(_0x13bd('0x0'));var util=require('util');var moment=require(_0x13bd('0x1'));var BPromise=require(_0x13bd('0x2'));var rs=require(_0x13bd('0x3'));var fs=require('fs');var Redis=require(_0x13bd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x13bd('0x5'));var logger=require(_0x13bd('0x6'))(_0x13bd('0x7'));var config=require(_0x13bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x13bd('0x9')][_0x13bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f6a83,_0x2aa817,_0x1024b5){return new BPromise(function(_0x19b63c,_0x183108){return client['request'](_0x3f6a83,_0x1024b5)[_0x13bd('0xb')](function(_0x58ef27){logger[_0x13bd('0xc')](_0x13bd('0xd'),_0x2aa817,_0x13bd('0xe'));logger[_0x13bd('0xf')](_0x13bd('0x10'),_0x2aa817,'request\x20sent',JSON['stringify'](_0x58ef27));if(_0x58ef27['error']){if(_0x58ef27[_0x13bd('0x11')][_0x13bd('0x12')]===0x1f4){logger[_0x13bd('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2aa817,_0x58ef27[_0x13bd('0x11')]['message']);return _0x183108(_0x58ef27['error'][_0x13bd('0x13')]);}logger[_0x13bd('0x11')](_0x13bd('0xd'),_0x2aa817,_0x58ef27['error']['message']);return _0x19b63c(_0x58ef27[_0x13bd('0x11')][_0x13bd('0x13')]);}else{logger['info'](_0x13bd('0xd'),_0x2aa817,'request\x20sent');_0x19b63c(_0x58ef27[_0x13bd('0x14')]['message']);}})['catch'](function(_0x160b79){logger[_0x13bd('0x11')](_0x13bd('0xd'),_0x2aa817,_0x160b79);_0x183108(_0x160b79);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 7a7cde9..4f720b4 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 _0x5a4e=['index','get','show','download','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x4b9652,_0x43b335){var _0x35f6e8=function(_0x5efc1c){while(--_0x5efc1c){_0x4b9652['push'](_0x4b9652['shift']());}};_0x35f6e8(++_0x43b335);}(_0x5a4e,0x155));var _0xe5a4=function(_0x35ba71,_0xa2fbbd){_0x35ba71=_0x35ba71-0x0;var _0x5f04f4=_0x5a4e[_0x35ba71];return _0x5f04f4;};'use strict';var multer=require(_0xe5a4('0x0'));var util=require(_0xe5a4('0x1'));var path=require(_0xe5a4('0x2'));var timeout=require(_0xe5a4('0x3'));var express=require('express');var router=express[_0xe5a4('0x4')]();var fs_extra=require(_0xe5a4('0x5'));var auth=require(_0xe5a4('0x6'));var interaction=require(_0xe5a4('0x7'));var config=require(_0xe5a4('0x8'));var controller=require(_0xe5a4('0x9'));router['get']('/',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0xb')]);router[_0xe5a4('0xc')]('/:id',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0xd')]);router[_0xe5a4('0xc')]('/:id/download',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0xe')]);router[_0xe5a4('0xf')]('/',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0x10')]);router[_0xe5a4('0x11')](_0xe5a4('0x12'),auth[_0xe5a4('0xa')](),controller[_0xe5a4('0x13')]);router['delete'](_0xe5a4('0x12'),auth[_0xe5a4('0xa')](),controller[_0xe5a4('0x14')]);module[_0xe5a4('0x15')]=router;
\ No newline at end of file
+var _0xcbfd=['index','/:id','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xcbfd,0x196));var _0xdcbf=function(_0x5e009c,_0x1c221a){_0x5e009c=_0x5e009c-0x0;var _0x520017=_0xcbfd[_0x5e009c];return _0x520017;};'use strict';var multer=require(_0xdcbf('0x0'));var util=require(_0xdcbf('0x1'));var path=require(_0xdcbf('0x2'));var timeout=require(_0xdcbf('0x3'));var express=require(_0xdcbf('0x4'));var router=express[_0xdcbf('0x5')]();var fs_extra=require(_0xdcbf('0x6'));var auth=require(_0xdcbf('0x7'));var interaction=require(_0xdcbf('0x8'));var config=require('../../config/environment');var controller=require(_0xdcbf('0x9'));router[_0xdcbf('0xa')]('/',auth[_0xdcbf('0xb')](),controller[_0xdcbf('0xc')]);router[_0xdcbf('0xa')](_0xdcbf('0xd'),auth[_0xdcbf('0xb')](),controller['show']);router[_0xdcbf('0xa')](_0xdcbf('0xe'),auth['isAuthenticated'](),controller[_0xdcbf('0xf')]);router[_0xdcbf('0x10')]('/',auth[_0xdcbf('0xb')](),controller['create']);router[_0xdcbf('0x11')](_0xdcbf('0xd'),auth[_0xdcbf('0xb')](),controller[_0xdcbf('0x12')]);router[_0xdcbf('0x13')]('/:id',auth[_0xdcbf('0xb')](),controller[_0xdcbf('0x14')]);module[_0xdcbf('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 02d2e20..e6fd8e9 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 _0xa04e=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x5c590f,_0x4b5aa4){var _0x52ef41=function(_0x2ef2d7){while(--_0x2ef2d7){_0x5c590f['push'](_0x5c590f['shift']());}};_0x52ef41(++_0x4b5aa4);}(_0xa04e,0x6a));var _0xea04=function(_0x57f590,_0x31e929){_0x57f590=_0x57f590-0x0;var _0x3181dd=_0xa04e[_0x57f590];return _0x3181dd;};'use strict';var Sequelize=require(_0xea04('0x0'));module[_0xea04('0x1')]={'field':{'type':Sequelize[_0xea04('0x2')]},'alias':{'type':Sequelize[_0xea04('0x3')]},'function':{'type':Sequelize[_0xea04('0x3')]},'format':{'type':Sequelize[_0xea04('0x3')]},'groupBy':{'type':Sequelize[_0xea04('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xea04('0x3')]},'custom':{'type':Sequelize[_0xea04('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1cb4=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x1cb4,0x14d));var _0x41cb=function(_0x130ce8,_0x536d2d){_0x130ce8=_0x130ce8-0x0;var _0x3fe325=_0x1cb4[_0x130ce8];return _0x3fe325;};'use strict';var Sequelize=require(_0x41cb('0x0'));module[_0x41cb('0x1')]={'field':{'type':Sequelize[_0x41cb('0x2')]},'alias':{'type':Sequelize[_0x41cb('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x41cb('0x3')]},'groupBy':{'type':Sequelize[_0x41cb('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x41cb('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index da28dbc..5e69d0c 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 _0xb6a7=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x52b0b2,_0xf6dbf9){var _0x322769=function(_0x3ad9da){while(--_0x3ad9da){_0x52b0b2['push'](_0x52b0b2['shift']());}};_0x322769(++_0xf6dbf9);}(_0xb6a7,0xf6));var _0x7b6a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb6a7[_0x565ed7];return _0x183ad7;};'use strict';var emlformat=require(_0x7b6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b6a('0x1'));var jsonpatch=require(_0x7b6a('0x2'));var rp=require(_0x7b6a('0x3'));var moment=require(_0x7b6a('0x4'));var BPromise=require(_0x7b6a('0x5'));var Mustache=require(_0x7b6a('0x6'));var util=require(_0x7b6a('0x7'));var path=require(_0x7b6a('0x8'));var sox=require(_0x7b6a('0x9'));var csv=require(_0x7b6a('0xa'));var ejs=require(_0x7b6a('0xb'));var fs=require('fs');var fs_extra=require(_0x7b6a('0xc'));var _=require(_0x7b6a('0xd'));var squel=require(_0x7b6a('0xe'));var crypto=require(_0x7b6a('0xf'));var jsforce=require(_0x7b6a('0x10'));var deskjs=require(_0x7b6a('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b6a('0x12'));var Redis=require(_0x7b6a('0x13'));var authService=require(_0x7b6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7b6a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b6a('0x16'))('api');var utils=require(_0x7b6a('0x17'));var config=require(_0x7b6a('0x18'));var licenseUtil=require(_0x7b6a('0x19'));var db=require(_0x7b6a('0x1a'))['db'];function respondWithStatusCode(_0x2dd736,_0x1396c0){_0x1396c0=_0x1396c0||0xcc;return function(_0x513ac6){if(_0x513ac6){return _0x2dd736[_0x7b6a('0x1b')](_0x1396c0);}return _0x2dd736[_0x7b6a('0x1c')](_0x1396c0)[_0x7b6a('0x1d')]();};}function respondWithResult(_0x96e7e4,_0x577410){_0x577410=_0x577410||0xc8;return function(_0xb2f03d){if(_0xb2f03d){return _0x96e7e4[_0x7b6a('0x1c')](_0x577410)[_0x7b6a('0x1e')](_0xb2f03d);}};}function respondWithFilteredResult(_0x55f7bd,_0x2eb663){return function(_0x9a6cae){if(_0x9a6cae){var _0x6543b4=typeof _0x2eb663[_0x7b6a('0x1f')]==='undefined'&&typeof _0x2eb663[_0x7b6a('0x20')]===_0x7b6a('0x21');var _0x20f0ad=_0x9a6cae['count'];var _0x9bbeef=_0x6543b4?0x0:_0x2eb663[_0x7b6a('0x1f')];var _0x5b12ec=_0x6543b4?_0x9a6cae[_0x7b6a('0x22')]:_0x2eb663['offset']+_0x2eb663[_0x7b6a('0x20')];var _0x2cb364;if(_0x5b12ec>=_0x20f0ad){_0x5b12ec=_0x20f0ad;_0x2cb364=0xc8;}else{_0x2cb364=0xce;}_0x55f7bd[_0x7b6a('0x1c')](_0x2cb364);return _0x55f7bd[_0x7b6a('0x23')](_0x7b6a('0x24'),_0x9bbeef+'-'+_0x5b12ec+'/'+_0x20f0ad)[_0x7b6a('0x1e')](_0x9a6cae);}return null;};}function patchUpdates(_0x2bff4a){return function(_0x5d45b1){try{jsonpatch['apply'](_0x5d45b1,_0x2bff4a,!![]);}catch(_0x17eb6a){return BPromise[_0x7b6a('0x25')](_0x17eb6a);}return _0x5d45b1[_0x7b6a('0x26')]();};}function saveUpdates(_0x4f9392,_0x72c364){return function(_0x2b092f){if(_0x2b092f){return _0x2b092f[_0x7b6a('0x27')](_0x4f9392)[_0x7b6a('0x28')](function(_0x584ae0){return _0x584ae0;});}return null;};}function removeEntity(_0x2ddab4,_0xc5e36f){return function(_0x5ec37f){if(_0x5ec37f){return _0x5ec37f[_0x7b6a('0x29')]()['then'](function(){_0x2ddab4[_0x7b6a('0x1c')](0xcc)[_0x7b6a('0x1d')]();});}};}function handleEntityNotFound(_0x52de06,_0x218952){return function(_0xbf66a1){if(!_0xbf66a1){_0x52de06['sendStatus'](0x194);}return _0xbf66a1;};}function handleError(_0x3a59a0,_0x41fe1b){_0x41fe1b=_0x41fe1b||0x1f4;return function(_0x3afda3){logger[_0x7b6a('0x2a')](_0x3afda3[_0x7b6a('0x2b')]);if(_0x3afda3[_0x7b6a('0x2c')]){delete _0x3afda3[_0x7b6a('0x2c')];}_0x3a59a0[_0x7b6a('0x1c')](_0x41fe1b)[_0x7b6a('0x2d')](_0x3afda3);};}exports['index']=function(_0x5731aa,_0x300803){var _0x59d689={},_0x3c9e91={},_0x19e449={'count':0x0,'rows':[]};var _0x588598=_[_0x7b6a('0x2e')](db[_0x7b6a('0x2f')][_0x7b6a('0x30')],function(_0x58f045){return{'name':_0x58f045[_0x7b6a('0x31')],'type':_0x58f045[_0x7b6a('0x32')][_0x7b6a('0x33')]};});_0x3c9e91[_0x7b6a('0x34')]=_[_0x7b6a('0x2e')](_0x588598,_0x7b6a('0x2c'));_0x3c9e91[_0x7b6a('0x35')]=_['keys'](_0x5731aa[_0x7b6a('0x35')]);_0x3c9e91[_0x7b6a('0x36')]=_[_0x7b6a('0x37')](_0x3c9e91['model'],_0x3c9e91[_0x7b6a('0x35')]);_0x59d689[_0x7b6a('0x38')]=_[_0x7b6a('0x37')](_0x3c9e91[_0x7b6a('0x34')],qs[_0x7b6a('0x39')](_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x39')]));_0x59d689[_0x7b6a('0x38')]=_0x59d689[_0x7b6a('0x38')]['length']?_0x59d689['attributes']:_0x3c9e91[_0x7b6a('0x34')];if(!_0x5731aa['query']['hasOwnProperty']('nolimit')){_0x59d689['limit']=qs['limit'](_0x5731aa['query'][_0x7b6a('0x20')]);_0x59d689[_0x7b6a('0x1f')]=qs['offset'](_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x1f')]);}_0x59d689[_0x7b6a('0x3a')]=qs[_0x7b6a('0x3b')](_0x5731aa['query'][_0x7b6a('0x3b')]);_0x59d689[_0x7b6a('0x3c')]=qs[_0x7b6a('0x36')](_[_0x7b6a('0x3d')](_0x5731aa[_0x7b6a('0x35')],_0x3c9e91[_0x7b6a('0x36')]),_0x588598);if(_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x3e')]){_0x59d689['where']=_[_0x7b6a('0x3f')](_0x59d689[_0x7b6a('0x3c')],{'$or':_[_0x7b6a('0x2e')](_0x588598,function(_0x42b366){if(_0x42b366[_0x7b6a('0x32')]!==_0x7b6a('0x40')){var _0xf75a11={};_0xf75a11[_0x42b366[_0x7b6a('0x2c')]]={'$like':'%'+_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x3e')]+'%'};return _0xf75a11;}})});}_0x59d689=_[_0x7b6a('0x3f')]({},_0x59d689,_0x5731aa[_0x7b6a('0x41')]);var _0x184c13={'where':_0x59d689[_0x7b6a('0x3c')]};return db['AnalyticFieldReport'][_0x7b6a('0x22')](_0x184c13)[_0x7b6a('0x28')](function(_0x3abdaa){_0x19e449[_0x7b6a('0x22')]=_0x3abdaa;if(_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x42')]){_0x59d689[_0x7b6a('0x43')]=[{'all':!![]}];}return db[_0x7b6a('0x2f')][_0x7b6a('0x44')](_0x59d689);})['then'](function(_0x2be885){_0x19e449[_0x7b6a('0x45')]=_0x2be885;return _0x19e449;})[_0x7b6a('0x28')](respondWithFilteredResult(_0x300803,_0x59d689))[_0x7b6a('0x46')](handleError(_0x300803,null));};exports[_0x7b6a('0x47')]=function(_0x54fe12,_0x11ac65){var _0x5e2331={'raw':![],'where':{'id':_0x54fe12[_0x7b6a('0x48')]['id']}},_0x566434={};_0x566434[_0x7b6a('0x34')]=_[_0x7b6a('0x49')](db[_0x7b6a('0x2f')][_0x7b6a('0x30')]);_0x566434[_0x7b6a('0x35')]=_['keys'](_0x54fe12[_0x7b6a('0x35')]);_0x566434[_0x7b6a('0x36')]=_[_0x7b6a('0x37')](_0x566434['model'],_0x566434[_0x7b6a('0x35')]);_0x5e2331[_0x7b6a('0x38')]=_['intersection'](_0x566434['model'],qs[_0x7b6a('0x39')](_0x54fe12['query'][_0x7b6a('0x39')]));_0x5e2331[_0x7b6a('0x38')]=_0x5e2331[_0x7b6a('0x38')][_0x7b6a('0x4a')]?_0x5e2331[_0x7b6a('0x38')]:_0x566434[_0x7b6a('0x34')];if(_0x54fe12[_0x7b6a('0x35')][_0x7b6a('0x42')]){_0x5e2331[_0x7b6a('0x43')]=[{'all':!![]}];}_0x5e2331=_['merge']({},_0x5e2331,_0x54fe12['options']);return db[_0x7b6a('0x2f')][_0x7b6a('0x4b')](_0x5e2331)[_0x7b6a('0x28')](handleEntityNotFound(_0x11ac65,null))[_0x7b6a('0x28')](respondWithResult(_0x11ac65,null))['catch'](handleError(_0x11ac65,null));};exports[_0x7b6a('0x4c')]=function(_0xcaec43,_0x423e92){return db[_0x7b6a('0x2f')][_0x7b6a('0x4c')](_0xcaec43['body'],{})[_0x7b6a('0x28')](respondWithResult(_0x423e92,0xc9))[_0x7b6a('0x46')](handleError(_0x423e92,null));};exports[_0x7b6a('0x4d')]=function(_0x3ac714,_0x47531b){return db[_0x7b6a('0x2f')][_0x7b6a('0x4d')](_0x3ac714['body'],{'raw':![],'individualHooks':!![]})[_0x7b6a('0x28')](respondWithResult(_0x47531b,0xc9))[_0x7b6a('0x46')](handleError(_0x47531b,null));};exports[_0x7b6a('0x27')]=function(_0x189e87,_0xa21ed3){if(_0x189e87[_0x7b6a('0x4e')]['id']){delete _0x189e87[_0x7b6a('0x4e')]['id'];}return db[_0x7b6a('0x2f')][_0x7b6a('0x4b')]({'where':{'id':_0x189e87[_0x7b6a('0x48')]['id']}})[_0x7b6a('0x28')](handleEntityNotFound(_0xa21ed3,null))['then'](saveUpdates(_0x189e87[_0x7b6a('0x4e')],null))['then'](respondWithResult(_0xa21ed3,null))[_0x7b6a('0x46')](handleError(_0xa21ed3,null));};exports[_0x7b6a('0x29')]=function(_0xa8d595,_0x548408){return db[_0x7b6a('0x2f')][_0x7b6a('0x4b')]({'where':{'id':_0xa8d595[_0x7b6a('0x48')]['id']}})[_0x7b6a('0x28')](handleEntityNotFound(_0x548408,null))['then'](removeEntity(_0x548408,null))['catch'](handleError(_0x548408,null));};exports[_0x7b6a('0x4f')]=function(_0x3d7ede,_0xc93eff){return db[_0x7b6a('0x2f')][_0x7b6a('0x29')]({'where':{'id':_0x3d7ede[_0x7b6a('0x35')][_0x7b6a('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0x7b6a('0x28')](respondWithResult(_0xc93eff,0xcc))[_0x7b6a('0x46')](handleError(_0xc93eff,null));};exports['addFields']=function(_0x2d13f3,_0x2fb96a,_0x936728){return db[_0x7b6a('0x51')][_0x7b6a('0x52')]({'where':{'id':_0x2d13f3[_0x7b6a('0x48')]['id']}})[_0x7b6a('0x28')](handleEntityNotFound(_0x2fb96a,null))[_0x7b6a('0x28')](function(_0x2b4312){if(_0x2b4312){return db[_0x7b6a('0x53')][_0x7b6a('0x54')](function(_0x2f900f){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x2d13f3['params']['id']},'transaction':_0x2f900f})[_0x7b6a('0x28')](function(_0x2a7bd2){var _0x1f40bb=_['map'](_0x2d13f3[_0x7b6a('0x4e')],function(_0x18532e){delete _0x18532e['id'];_0x18532e[_0x7b6a('0x55')]=_0x2d13f3[_0x7b6a('0x48')]['id'];return _0x18532e;});return db[_0x7b6a('0x2f')][_0x7b6a('0x4d')](_0x1f40bb,{'transaction':_0x2f900f});});})['then'](function(){return db[_0x7b6a('0x2f')][_0x7b6a('0x44')]({'where':{'CustomReportId':_0x2d13f3['params']['id']}});});}})['then'](respondWithResult(_0x2fb96a,null))['catch'](handleError(_0x2fb96a,null));};
\ No newline at end of file
+var _0xa65b=['findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','query','filters','attributes','intersection','model','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','fields','merge','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa65b,0x100));var _0xba65=function(_0x1f1856,_0x15aafb){_0x1f1856=_0x1f1856-0x0;var _0x4fd8e9=_0xa65b[_0x1f1856];return _0x4fd8e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba65('0x0'));var zipdir=require(_0xba65('0x1'));var jsonpatch=require(_0xba65('0x2'));var rp=require('request-promise');var moment=require(_0xba65('0x3'));var BPromise=require(_0xba65('0x4'));var Mustache=require(_0xba65('0x5'));var util=require(_0xba65('0x6'));var path=require(_0xba65('0x7'));var sox=require(_0xba65('0x8'));var csv=require(_0xba65('0x9'));var ejs=require(_0xba65('0xa'));var fs=require('fs');var fs_extra=require(_0xba65('0xb'));var _=require(_0xba65('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xba65('0xd'));var deskjs=require(_0xba65('0xe'));var toCsv=require(_0xba65('0x9'));var querystring=require(_0xba65('0xf'));var Papa=require(_0xba65('0x10'));var Redis=require(_0xba65('0x11'));var authService=require(_0xba65('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xba65('0x13'));var hardwareService=require(_0xba65('0x14'));var logger=require(_0xba65('0x15'))('api');var utils=require(_0xba65('0x16'));var config=require(_0xba65('0x17'));var licenseUtil=require(_0xba65('0x18'));var db=require(_0xba65('0x19'))['db'];function respondWithStatusCode(_0x389e43,_0x26a240){_0x26a240=_0x26a240||0xcc;return function(_0x339853){if(_0x339853){return _0x389e43[_0xba65('0x1a')](_0x26a240);}return _0x389e43['status'](_0x26a240)[_0xba65('0x1b')]();};}function respondWithResult(_0x1a68a8,_0x377c72){_0x377c72=_0x377c72||0xc8;return function(_0x1b2bdf){if(_0x1b2bdf){return _0x1a68a8[_0xba65('0x1c')](_0x377c72)[_0xba65('0x1d')](_0x1b2bdf);}};}function respondWithFilteredResult(_0x16cd46,_0x51f949){return function(_0x94f768){if(_0x94f768){var _0x125083=typeof _0x51f949[_0xba65('0x1e')]==='undefined'&&typeof _0x51f949[_0xba65('0x1f')]==='undefined';var _0x10dfc4=_0x94f768[_0xba65('0x20')];var _0x477a42=_0x125083?0x0:_0x51f949[_0xba65('0x1e')];var _0x52fc02=_0x125083?_0x94f768['count']:_0x51f949['offset']+_0x51f949[_0xba65('0x1f')];var _0x5d937e;if(_0x52fc02>=_0x10dfc4){_0x52fc02=_0x10dfc4;_0x5d937e=0xc8;}else{_0x5d937e=0xce;}_0x16cd46[_0xba65('0x1c')](_0x5d937e);return _0x16cd46[_0xba65('0x21')](_0xba65('0x22'),_0x477a42+'-'+_0x52fc02+'/'+_0x10dfc4)[_0xba65('0x1d')](_0x94f768);}return null;};}function patchUpdates(_0x54f9bf){return function(_0x31374e){try{jsonpatch[_0xba65('0x23')](_0x31374e,_0x54f9bf,!![]);}catch(_0xb02352){return BPromise[_0xba65('0x24')](_0xb02352);}return _0x31374e['save']();};}function saveUpdates(_0x4900dc,_0x2ebf8a){return function(_0x34173d){if(_0x34173d){return _0x34173d[_0xba65('0x25')](_0x4900dc)[_0xba65('0x26')](function(_0x215e99){return _0x215e99;});}return null;};}function removeEntity(_0x1ea2bb,_0x516f86){return function(_0xe427ad){if(_0xe427ad){return _0xe427ad['destroy']()[_0xba65('0x26')](function(){_0x1ea2bb['status'](0xcc)[_0xba65('0x1b')]();});}};}function handleEntityNotFound(_0x3dbd7d,_0x4d2a63){return function(_0x5eaa88){if(!_0x5eaa88){_0x3dbd7d[_0xba65('0x1a')](0x194);}return _0x5eaa88;};}function handleError(_0x58fc2f,_0x1b26f1){_0x1b26f1=_0x1b26f1||0x1f4;return function(_0x4452bf){logger[_0xba65('0x27')](_0x4452bf[_0xba65('0x28')]);if(_0x4452bf[_0xba65('0x29')]){delete _0x4452bf[_0xba65('0x29')];}_0x58fc2f[_0xba65('0x1c')](_0x1b26f1)[_0xba65('0x2a')](_0x4452bf);};}exports[_0xba65('0x2b')]=function(_0x1d5be0,_0x4a6604){var _0x2925f6={},_0x5d4e08={},_0x4f7bc9={'count':0x0,'rows':[]};var _0x1efc84=_[_0xba65('0x2c')](db[_0xba65('0x2d')][_0xba65('0x2e')],function(_0xf6618c){return{'name':_0xf6618c['fieldName'],'type':_0xf6618c[_0xba65('0x2f')][_0xba65('0x30')]};});_0x5d4e08['model']=_[_0xba65('0x2c')](_0x1efc84,_0xba65('0x29'));_0x5d4e08['query']=_['keys'](_0x1d5be0[_0xba65('0x31')]);_0x5d4e08[_0xba65('0x32')]=_['intersection'](_0x5d4e08['model'],_0x5d4e08[_0xba65('0x31')]);_0x2925f6[_0xba65('0x33')]=_[_0xba65('0x34')](_0x5d4e08[_0xba65('0x35')],qs['fields'](_0x1d5be0[_0xba65('0x31')]['fields']));_0x2925f6[_0xba65('0x33')]=_0x2925f6[_0xba65('0x33')][_0xba65('0x36')]?_0x2925f6[_0xba65('0x33')]:_0x5d4e08[_0xba65('0x35')];if(!_0x1d5be0[_0xba65('0x31')][_0xba65('0x37')]('nolimit')){_0x2925f6['limit']=qs[_0xba65('0x1f')](_0x1d5be0[_0xba65('0x31')][_0xba65('0x1f')]);_0x2925f6['offset']=qs['offset'](_0x1d5be0[_0xba65('0x31')]['offset']);}_0x2925f6[_0xba65('0x38')]=qs['sort'](_0x1d5be0[_0xba65('0x31')][_0xba65('0x39')]);_0x2925f6['where']=qs[_0xba65('0x32')](_[_0xba65('0x3a')](_0x1d5be0['query'],_0x5d4e08[_0xba65('0x32')]),_0x1efc84);if(_0x1d5be0[_0xba65('0x31')][_0xba65('0x3b')]){_0x2925f6[_0xba65('0x3c')]=_['merge'](_0x2925f6['where'],{'$or':_['map'](_0x1efc84,function(_0x42b5f4){if(_0x42b5f4[_0xba65('0x2f')]!==_0xba65('0x3d')){var _0x38ef4d={};_0x38ef4d[_0x42b5f4[_0xba65('0x29')]]={'$like':'%'+_0x1d5be0[_0xba65('0x31')][_0xba65('0x3b')]+'%'};return _0x38ef4d;}})});}_0x2925f6=_['merge']({},_0x2925f6,_0x1d5be0[_0xba65('0x3e')]);var _0x565692={'where':_0x2925f6['where']};return db[_0xba65('0x2d')][_0xba65('0x20')](_0x565692)['then'](function(_0x162aca){_0x4f7bc9[_0xba65('0x20')]=_0x162aca;if(_0x1d5be0[_0xba65('0x31')][_0xba65('0x3f')]){_0x2925f6[_0xba65('0x40')]=[{'all':!![]}];}return db[_0xba65('0x2d')][_0xba65('0x41')](_0x2925f6);})['then'](function(_0x481c35){_0x4f7bc9[_0xba65('0x42')]=_0x481c35;return _0x4f7bc9;})['then'](respondWithFilteredResult(_0x4a6604,_0x2925f6))[_0xba65('0x43')](handleError(_0x4a6604,null));};exports['show']=function(_0x47bf4a,_0x4c0154){var _0x34ac80={'raw':![],'where':{'id':_0x47bf4a[_0xba65('0x44')]['id']}},_0x27e6a5={};_0x27e6a5[_0xba65('0x35')]=_[_0xba65('0x45')](db['AnalyticFieldReport'][_0xba65('0x2e')]);_0x27e6a5[_0xba65('0x31')]=_[_0xba65('0x45')](_0x47bf4a['query']);_0x27e6a5['filters']=_[_0xba65('0x34')](_0x27e6a5[_0xba65('0x35')],_0x27e6a5[_0xba65('0x31')]);_0x34ac80[_0xba65('0x33')]=_[_0xba65('0x34')](_0x27e6a5[_0xba65('0x35')],qs[_0xba65('0x46')](_0x47bf4a[_0xba65('0x31')][_0xba65('0x46')]));_0x34ac80['attributes']=_0x34ac80[_0xba65('0x33')][_0xba65('0x36')]?_0x34ac80[_0xba65('0x33')]:_0x27e6a5[_0xba65('0x35')];if(_0x47bf4a[_0xba65('0x31')][_0xba65('0x3f')]){_0x34ac80[_0xba65('0x40')]=[{'all':!![]}];}_0x34ac80=_[_0xba65('0x47')]({},_0x34ac80,_0x47bf4a[_0xba65('0x3e')]);return db['AnalyticFieldReport'][_0xba65('0x48')](_0x34ac80)[_0xba65('0x26')](handleEntityNotFound(_0x4c0154,null))[_0xba65('0x26')](respondWithResult(_0x4c0154,null))[_0xba65('0x43')](handleError(_0x4c0154,null));};exports['create']=function(_0x34faa6,_0x3ce225){return db[_0xba65('0x2d')][_0xba65('0x49')](_0x34faa6[_0xba65('0x4a')],{})[_0xba65('0x26')](respondWithResult(_0x3ce225,0xc9))[_0xba65('0x43')](handleError(_0x3ce225,null));};exports[_0xba65('0x4b')]=function(_0x4a2358,_0x5d2bb0){return db[_0xba65('0x2d')][_0xba65('0x4b')](_0x4a2358['body'],{'raw':![],'individualHooks':!![]})[_0xba65('0x26')](respondWithResult(_0x5d2bb0,0xc9))[_0xba65('0x43')](handleError(_0x5d2bb0,null));};exports[_0xba65('0x25')]=function(_0x4ae21d,_0x3fba91){if(_0x4ae21d[_0xba65('0x4a')]['id']){delete _0x4ae21d[_0xba65('0x4a')]['id'];}return db[_0xba65('0x2d')][_0xba65('0x48')]({'where':{'id':_0x4ae21d[_0xba65('0x44')]['id']}})[_0xba65('0x26')](handleEntityNotFound(_0x3fba91,null))[_0xba65('0x26')](saveUpdates(_0x4ae21d[_0xba65('0x4a')],null))['then'](respondWithResult(_0x3fba91,null))[_0xba65('0x43')](handleError(_0x3fba91,null));};exports[_0xba65('0x4c')]=function(_0x423444,_0x27b198){return db['AnalyticFieldReport'][_0xba65('0x48')]({'where':{'id':_0x423444[_0xba65('0x44')]['id']}})['then'](handleEntityNotFound(_0x27b198,null))[_0xba65('0x26')](removeEntity(_0x27b198,null))['catch'](handleError(_0x27b198,null));};exports[_0xba65('0x4d')]=function(_0x1854e3,_0x1572fd){return db[_0xba65('0x2d')]['destroy']({'where':{'id':_0x1854e3['query'][_0xba65('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xba65('0x26')](respondWithResult(_0x1572fd,0xcc))[_0xba65('0x43')](handleError(_0x1572fd,null));};exports[_0xba65('0x4f')]=function(_0x2c85f3,_0x40ccd9,_0x526fcf){return db['AnalyticCustomReport'][_0xba65('0x50')]({'where':{'id':_0x2c85f3[_0xba65('0x44')]['id']}})[_0xba65('0x26')](handleEntityNotFound(_0x40ccd9,null))[_0xba65('0x26')](function(_0x33dfe6){if(_0x33dfe6){return db[_0xba65('0x51')][_0xba65('0x52')](function(_0x547231){return db[_0xba65('0x2d')][_0xba65('0x4c')]({'where':{'CustomReportId':_0x2c85f3[_0xba65('0x44')]['id']},'transaction':_0x547231})[_0xba65('0x26')](function(_0x33bd98){var _0x350129=_[_0xba65('0x2c')](_0x2c85f3[_0xba65('0x4a')],function(_0x2021ac){delete _0x2021ac['id'];_0x2021ac[_0xba65('0x53')]=_0x2c85f3[_0xba65('0x44')]['id'];return _0x2021ac;});return db['AnalyticFieldReport'][_0xba65('0x4b')](_0x350129,{'transaction':_0x547231});});})[_0xba65('0x26')](function(){return db[_0xba65('0x2d')][_0xba65('0x41')]({'where':{'CustomReportId':_0x2c85f3[_0xba65('0x44')]['id']}});});}})[_0xba65('0x26')](respondWithResult(_0x40ccd9,null))[_0xba65('0x43')](handleError(_0x40ccd9,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 8bfb1f4..5136022 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 _0x1346=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x36a7cf,_0x2dfa31){var _0x4862ec=function(_0x4b8fd1){while(--_0x4b8fd1){_0x36a7cf['push'](_0x36a7cf['shift']());}};_0x4862ec(++_0x2dfa31);}(_0x1346,0xf6));var _0x6134=function(_0xf44ff2,_0x5e9e66){_0xf44ff2=_0xf44ff2-0x0;var _0x241096=_0x1346[_0xf44ff2];return _0x241096;};'use strict';var _=require(_0x6134('0x0'));var util=require(_0x6134('0x1'));var logger=require(_0x6134('0x2'))('api');var moment=require(_0x6134('0x3'));var BPromise=require(_0x6134('0x4'));var rp=require(_0x6134('0x5'));var fs=require('fs');var path=require(_0x6134('0x6'));var rimraf=require(_0x6134('0x7'));var config=require(_0x6134('0x8'));var attributes=require(_0x6134('0x9'));module[_0x6134('0xa')]=function(_0x50e981,_0x4b8d61){return _0x50e981[_0x6134('0xb')](_0x6134('0xc'),attributes,{'tableName':_0x6134('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x736e=['moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','../../config/logger','api'];(function(_0x198615,_0x45040a){var _0x435f7a=function(_0x49461d){while(--_0x49461d){_0x198615['push'](_0x198615['shift']());}};_0x435f7a(++_0x45040a);}(_0x736e,0xb1));var _0xe736=function(_0x54f474,_0x5e0d7c){_0x54f474=_0x54f474-0x0;var _0x513689=_0x736e[_0x54f474];return _0x513689;};'use strict';var _=require(_0xe736('0x0'));var util=require('util');var logger=require(_0xe736('0x1'))(_0xe736('0x2'));var moment=require(_0xe736('0x3'));var BPromise=require(_0xe736('0x4'));var rp=require(_0xe736('0x5'));var fs=require('fs');var path=require(_0xe736('0x6'));var rimraf=require('rimraf');var config=require(_0xe736('0x7'));var attributes=require(_0xe736('0x8'));module[_0xe736('0x9')]=function(_0x5b1093,_0x4b592f){return _0x5b1093[_0xe736('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0xe736('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 931db44..88fce38 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 _0x7a1f=['client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2034d2,_0x59d479){var _0x2b99af=function(_0x322771){while(--_0x322771){_0x2034d2['push'](_0x2034d2['shift']());}};_0x2b99af(++_0x59d479);}(_0x7a1f,0x134));var _0xf7a1=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x7a1f[_0x11946c];return _0x383935;};'use strict';var _=require(_0xf7a1('0x0'));var util=require(_0xf7a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf7a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7a1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7a1('0x4'))('rpc');var config=require(_0xf7a1('0x5'));var jayson=require(_0xf7a1('0x6'));var client=jayson[_0xf7a1('0x7')][_0xf7a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe76d88,_0x169f3c,_0x4ae197){return new BPromise(function(_0x9ed9c2,_0x104700){return client[_0xf7a1('0x9')](_0xe76d88,_0x4ae197)[_0xf7a1('0xa')](function(_0x234691){logger[_0xf7a1('0xb')](_0xf7a1('0xc'),_0x169f3c,_0xf7a1('0xd'));logger['debug'](_0xf7a1('0xe'),_0x169f3c,'request\x20sent',JSON[_0xf7a1('0xf')](_0x234691));if(_0x234691['error']){if(_0x234691[_0xf7a1('0x10')][_0xf7a1('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x169f3c,_0x234691[_0xf7a1('0x10')][_0xf7a1('0x12')]);return _0x104700(_0x234691['error']['message']);}logger[_0xf7a1('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x169f3c,_0x234691[_0xf7a1('0x10')][_0xf7a1('0x12')]);return _0x9ed9c2(_0x234691['error'][_0xf7a1('0x12')]);}else{logger[_0xf7a1('0xb')](_0xf7a1('0xc'),_0x169f3c,_0xf7a1('0xd'));_0x9ed9c2(_0x234691[_0xf7a1('0x13')][_0xf7a1('0x12')]);}})[_0xf7a1('0x14')](function(_0x28a43e){logger[_0xf7a1('0x10')](_0xf7a1('0xc'),_0x169f3c,_0x28a43e);_0x104700(_0x28a43e);});});}
\ No newline at end of file
+var _0xf456=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xf456,0x1ac));var _0x6f45=function(_0x34a83d,_0x31945f){_0x34a83d=_0x34a83d-0x0;var _0x3887b3=_0xf456[_0x34a83d];return _0x3887b3;};'use strict';var _=require(_0x6f45('0x0'));var util=require(_0x6f45('0x1'));var moment=require(_0x6f45('0x2'));var BPromise=require(_0x6f45('0x3'));var rs=require(_0x6f45('0x4'));var fs=require('fs');var Redis=require(_0x6f45('0x5'));var db=require(_0x6f45('0x6'))['db'];var utils=require(_0x6f45('0x7'));var logger=require('../../config/logger')(_0x6f45('0x8'));var config=require('../../config/environment');var jayson=require(_0x6f45('0x9'));var client=jayson[_0x6f45('0xa')][_0x6f45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59611f,_0x4ada66,_0x4b0790){return new BPromise(function(_0x3b72d8,_0x118480){return client[_0x6f45('0xc')](_0x59611f,_0x4b0790)['then'](function(_0x1d541c){logger['info'](_0x6f45('0xd'),_0x4ada66,_0x6f45('0xe'));logger[_0x6f45('0xf')](_0x6f45('0x10'),_0x4ada66,'request\x20sent',JSON[_0x6f45('0x11')](_0x1d541c));if(_0x1d541c[_0x6f45('0x12')]){if(_0x1d541c['error'][_0x6f45('0x13')]===0x1f4){logger[_0x6f45('0x12')](_0x6f45('0xd'),_0x4ada66,_0x1d541c[_0x6f45('0x12')][_0x6f45('0x14')]);return _0x118480(_0x1d541c[_0x6f45('0x12')][_0x6f45('0x14')]);}logger[_0x6f45('0x12')](_0x6f45('0xd'),_0x4ada66,_0x1d541c['error']['message']);return _0x3b72d8(_0x1d541c[_0x6f45('0x12')]['message']);}else{logger[_0x6f45('0x15')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ada66,_0x6f45('0xe'));_0x3b72d8(_0x1d541c[_0x6f45('0x16')][_0x6f45('0x14')]);}})[_0x6f45('0x17')](function(_0x471606){logger[_0x6f45('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ada66,_0x471606);_0x118480(_0x471606);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index cb74356..3199693 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(_0x276999,_0x786d6f){var _0x4ac783=function(_0x38ecc2){while(--_0x38ecc2){_0x276999['push'](_0x276999['shift']());}};_0x4ac783(++_0x786d6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x3d6445,_0x5cf50c){var _0xc0b055=function(_0x52bb57){while(--_0x52bb57){_0x3d6445['push'](_0x3d6445['shift']());}};_0xc0b055(++_0x5cf50c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 021e770..871d90c 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 _0xd8b0=['STRING','sequelize','exports','TEXT'];(function(_0x2c341e,_0x414d11){var _0x43c1e8=function(_0xe783f3){while(--_0xe783f3){_0x2c341e['push'](_0x2c341e['shift']());}};_0x43c1e8(++_0x414d11);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x0d8b('0x2')]},'description':{'type':Sequelize[_0x0d8b('0x3')]}};
\ No newline at end of file
+var _0x9bb4=['STRING','name','TEXT','sequelize','exports'];(function(_0x3d2b19,_0x349a5b){var _0x29769b=function(_0x5048ad){while(--_0x5048ad){_0x3d2b19['push'](_0x3d2b19['shift']());}};_0x29769b(++_0x349a5b);}(_0x9bb4,0xd5));var _0x49bb=function(_0x3f47f0,_0x176e20){_0x3f47f0=_0x3f47f0-0x0;var _0x9aab84=_0x9bb4[_0x3f47f0];return _0x9aab84;};'use strict';var Sequelize=require(_0x49bb('0x0'));module[_0x49bb('0x1')]={'name':{'type':Sequelize[_0x49bb('0x2')],'allowNull':![],'unique':_0x49bb('0x3')},'table':{'type':Sequelize[_0x49bb('0x2')]},'metric':{'type':Sequelize[_0x49bb('0x4')]},'description':{'type':Sequelize[_0x49bb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 7d082a8..56a7ec8 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 _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x1f88d4,_0x3f2a9c){var _0x31970d=function(_0x439a8a){while(--_0x439a8a){_0x1f88d4['push'](_0x1f88d4['shift']());}};_0x31970d(++_0x3f2a9c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1fa400,_0x850a42){_0x1fa400=_0x1fa400-0x0;var _0x65cddc=_0x8d0e[_0x1fa400];return _0x65cddc;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
+var _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x2234d6,_0x46c0da){var _0x71b944=function(_0x2807cf){while(--_0x2807cf){_0x2234d6['push'](_0x2234d6['shift']());}};_0x71b944(++_0x46c0da);}(_0x3e74,0x175));var _0x43e7=function(_0x27c6a6,_0x357076){_0x27c6a6=_0x27c6a6-0x0;var _0x540e85=_0x3e74[_0x27c6a6];return _0x540e85;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 9d1caeb..1906d12 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 _0xe4d9=['moment','path','rimraf','./analyticMetric.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1e43f3,_0x842e34){var _0x56f416=function(_0x221a26){while(--_0x221a26){_0x1e43f3['push'](_0x1e43f3['shift']());}};_0x56f416(++_0x842e34);}(_0xe4d9,0x141));var _0x9e4d=function(_0x2c62a1,_0x320c52){_0x2c62a1=_0x2c62a1-0x0;var _0xd6e286=_0xe4d9[_0x2c62a1];return _0xd6e286;};'use strict';var _=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var logger=require(_0x9e4d('0x2'))('api');var moment=require(_0x9e4d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e4d('0x4'));var rimraf=require(_0x9e4d('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e4d('0x6'));module[_0x9e4d('0x7')]=function(_0x5a4881,_0x493fb5){return _0x5a4881[_0x9e4d('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x644f=['define','AnalyticMetric','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x15ad47,_0x4cd079){var _0x2f0495=function(_0x11af30){while(--_0x11af30){_0x15ad47['push'](_0x15ad47['shift']());}};_0x2f0495(++_0x4cd079);}(_0x644f,0xc2));var _0xf644=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x644f[_0x597484];return _0x218e64;};'use strict';var _=require(_0xf644('0x0'));var util=require(_0xf644('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf644('0x2'));var BPromise=require(_0xf644('0x3'));var rp=require(_0xf644('0x4'));var fs=require('fs');var path=require(_0xf644('0x5'));var rimraf=require(_0xf644('0x6'));var config=require(_0xf644('0x7'));var attributes=require(_0xf644('0x8'));module[_0xf644('0x9')]=function(_0x9938ed,_0x1a6cbb){return _0x9938ed[_0xf644('0xa')](_0xf644('0xb'),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 c9cb516..62054c7 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 _0x876a=['rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x559757,_0x3be899){var _0x160474=function(_0x4f5a2b){while(--_0x4f5a2b){_0x559757['push'](_0x559757['shift']());}};_0x160474(++_0x3be899);}(_0x876a,0x1f2));var _0xa876=function(_0x2c8574,_0x2c6cde){_0x2c8574=_0x2c8574-0x0;var _0x4c8129=_0x876a[_0x2c8574];return _0x4c8129;};'use strict';var _=require(_0xa876('0x0'));var util=require(_0xa876('0x1'));var moment=require('moment');var BPromise=require(_0xa876('0x2'));var rs=require(_0xa876('0x3'));var fs=require('fs');var Redis=require(_0xa876('0x4'));var db=require(_0xa876('0x5'))['db'];var utils=require(_0xa876('0x6'));var logger=require(_0xa876('0x7'))(_0xa876('0x8'));var config=require(_0xa876('0x9'));var jayson=require(_0xa876('0xa'));var client=jayson[_0xa876('0xb')][_0xa876('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e49e4,_0x2e8c80,_0x4b8a85){return new BPromise(function(_0x138be1,_0x519ea6){return client['request'](_0x1e49e4,_0x4b8a85)[_0xa876('0xd')](function(_0x4578c9){logger[_0xa876('0xe')](_0xa876('0xf'),_0x2e8c80,_0xa876('0x10'));logger[_0xa876('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2e8c80,_0xa876('0x10'),JSON[_0xa876('0x12')](_0x4578c9));if(_0x4578c9['error']){if(_0x4578c9[_0xa876('0x13')]['code']===0x1f4){logger[_0xa876('0x13')](_0xa876('0xf'),_0x2e8c80,_0x4578c9['error'][_0xa876('0x14')]);return _0x519ea6(_0x4578c9[_0xa876('0x13')][_0xa876('0x14')]);}logger[_0xa876('0x13')](_0xa876('0xf'),_0x2e8c80,_0x4578c9[_0xa876('0x13')]['message']);return _0x138be1(_0x4578c9[_0xa876('0x13')][_0xa876('0x14')]);}else{logger[_0xa876('0xe')](_0xa876('0xf'),_0x2e8c80,'request\x20sent');_0x138be1(_0x4578c9[_0xa876('0x15')][_0xa876('0x14')]);}})[_0xa876('0x16')](function(_0x21243d){logger[_0xa876('0x13')](_0xa876('0xf'),_0x2e8c80,_0x21243d);_0x519ea6(_0x21243d);});});}
\ No newline at end of file
+var _0xd90b=['request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x23e09b,_0x57658e){var _0x57d532=function(_0x59a749){while(--_0x59a749){_0x23e09b['push'](_0x23e09b['shift']());}};_0x57d532(++_0x57658e);}(_0xd90b,0xa5));var _0xbd90=function(_0xb7a88,_0x41dfe0){_0xb7a88=_0xb7a88-0x0;var _0x215c60=_0xd90b[_0xb7a88];return _0x215c60;};'use strict';var _=require('lodash');var util=require(_0xbd90('0x0'));var moment=require(_0xbd90('0x1'));var BPromise=require(_0xbd90('0x2'));var rs=require(_0xbd90('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd90('0x4'))['db'];var utils=require(_0xbd90('0x5'));var logger=require(_0xbd90('0x6'))('rpc');var config=require(_0xbd90('0x7'));var jayson=require(_0xbd90('0x8'));var client=jayson[_0xbd90('0x9')][_0xbd90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55917b,_0x57e3ad,_0x5f5941){return new BPromise(function(_0x3c525f,_0x9f4543){return client[_0xbd90('0xb')](_0x55917b,_0x5f5941)['then'](function(_0x21d7e4){logger[_0xbd90('0xc')](_0xbd90('0xd'),_0x57e3ad,_0xbd90('0xe'));logger[_0xbd90('0xf')](_0xbd90('0x10'),_0x57e3ad,_0xbd90('0xe'),JSON['stringify'](_0x21d7e4));if(_0x21d7e4[_0xbd90('0x11')]){if(_0x21d7e4[_0xbd90('0x11')][_0xbd90('0x12')]===0x1f4){logger[_0xbd90('0x11')](_0xbd90('0xd'),_0x57e3ad,_0x21d7e4['error']['message']);return _0x9f4543(_0x21d7e4[_0xbd90('0x11')][_0xbd90('0x13')]);}logger[_0xbd90('0x11')](_0xbd90('0xd'),_0x57e3ad,_0x21d7e4[_0xbd90('0x11')][_0xbd90('0x13')]);return _0x3c525f(_0x21d7e4[_0xbd90('0x11')][_0xbd90('0x13')]);}else{logger[_0xbd90('0xc')](_0xbd90('0xd'),_0x57e3ad,_0xbd90('0xe'));_0x3c525f(_0x21d7e4[_0xbd90('0x14')][_0xbd90('0x13')]);}})[_0xbd90('0x15')](function(_0x319d75){logger['error'](_0xbd90('0xd'),_0x57e3ad,_0x319d75);_0x9f4543(_0x319d75);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index d9c5e53..0fbe5c6 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 _0x3561=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','update','exports','multer','path','connect-timeout','express'];(function(_0x367eca,_0x20ebf4){var _0x53888a=function(_0x1eea02){while(--_0x1eea02){_0x367eca['push'](_0x367eca['shift']());}};_0x53888a(++_0x20ebf4);}(_0x3561,0x94));var _0x1356=function(_0x5350f4,_0x48a111){_0x5350f4=_0x5350f4-0x0;var _0xf76cfc=_0x3561[_0x5350f4];return _0xf76cfc;};'use strict';var multer=require(_0x1356('0x0'));var util=require('util');var path=require(_0x1356('0x1'));var timeout=require(_0x1356('0x2'));var express=require(_0x1356('0x3'));var router=express[_0x1356('0x4')]();var fs_extra=require(_0x1356('0x5'));var auth=require(_0x1356('0x6'));var interaction=require(_0x1356('0x7'));var config=require(_0x1356('0x8'));var controller=require(_0x1356('0x9'));router[_0x1356('0xa')]('/',auth[_0x1356('0xb')](),controller[_0x1356('0xc')]);router[_0x1356('0xa')]('/:id',auth[_0x1356('0xb')](),controller[_0x1356('0xd')]);router[_0x1356('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1356('0xf')](_0x1356('0x10'),auth['isAuthenticated'](),controller[_0x1356('0x11')]);router['delete'](_0x1356('0x10'),auth[_0x1356('0xb')](),controller['destroy']);module[_0x1356('0x12')]=router;
\ No newline at end of file
+var _0x692c=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show'];(function(_0x25b606,_0x36f556){var _0x2568c7=function(_0x215e5c){while(--_0x215e5c){_0x25b606['push'](_0x25b606['shift']());}};_0x2568c7(++_0x36f556);}(_0x692c,0x6a));var _0xc692=function(_0x3aab1d,_0x1b1c54){_0x3aab1d=_0x3aab1d-0x0;var _0x3d99d3=_0x692c[_0x3aab1d];return _0x3d99d3;};'use strict';var multer=require(_0xc692('0x0'));var util=require(_0xc692('0x1'));var path=require(_0xc692('0x2'));var timeout=require(_0xc692('0x3'));var express=require(_0xc692('0x4'));var router=express[_0xc692('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc692('0x6'));var interaction=require(_0xc692('0x7'));var config=require(_0xc692('0x8'));var controller=require(_0xc692('0x9'));router[_0xc692('0xa')]('/',auth[_0xc692('0xb')](),controller['index']);router['get'](_0xc692('0xc'),auth[_0xc692('0xb')](),controller[_0xc692('0xd')]);router[_0xc692('0xe')]('/',auth[_0xc692('0xb')](),controller[_0xc692('0xf')]);router[_0xc692('0x10')]('/:id',auth[_0xc692('0xb')](),controller[_0xc692('0x11')]);router[_0xc692('0x12')](_0xc692('0xc'),auth[_0xc692('0xb')](),controller['destroy']);module[_0xc692('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index b6f3ad8..4a808dc 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 _0x70e2=['sequelize','exports','TEXT'];(function(_0x39665a,_0xc729df){var _0x173185=function(_0x2263f4){while(--_0x2263f4){_0x39665a['push'](_0x39665a['shift']());}};_0x173185(++_0xc729df);}(_0x70e2,0xc3));var _0x270e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x70e2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x270e('0x0'));module[_0x270e('0x1')]={'tree':{'type':Sequelize[_0x270e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x228e=['exports','TEXT'];(function(_0x4f9cd8,_0x4168f6){var _0x99912f=function(_0x5d17f3){while(--_0x5d17f3){_0x4f9cd8['push'](_0x4f9cd8['shift']());}};_0x99912f(++_0x4168f6);}(_0x228e,0x158));var _0xe228=function(_0x264e06,_0x12336e){_0x264e06=_0x264e06-0x0;var _0x580fe0=_0x228e[_0x264e06];return _0x580fe0;};'use strict';var Sequelize=require('sequelize');module[_0xe228('0x0')]={'tree':{'type':Sequelize[_0xe228('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 8726bf0..cbae332 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 _0xe70b=['params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','AnalyticTreeReport','catch','show','rawAttributes','length','includeAll','include','find','create','body'];(function(_0x7293b,_0x5a478e){var _0x54e309=function(_0x211dda){while(--_0x211dda){_0x7293b['push'](_0x7293b['shift']());}};_0x54e309(++_0x5a478e);}(_0xe70b,0xd6));var _0xbe70=function(_0x56c8a8,_0x834642){_0x56c8a8=_0x56c8a8-0x0;var _0x3a4430=_0xe70b[_0x56c8a8];return _0x3a4430;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe70('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe70('0x1'));var rp=require('request-promise');var moment=require(_0xbe70('0x2'));var BPromise=require(_0xbe70('0x3'));var Mustache=require(_0xbe70('0x4'));var util=require(_0xbe70('0x5'));var path=require(_0xbe70('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbe70('0x7'));var fs=require('fs');var fs_extra=require(_0xbe70('0x8'));var _=require(_0xbe70('0x9'));var squel=require(_0xbe70('0xa'));var crypto=require(_0xbe70('0xb'));var jsforce=require(_0xbe70('0xc'));var deskjs=require(_0xbe70('0xd'));var toCsv=require(_0xbe70('0xe'));var querystring=require('querystring');var Papa=require(_0xbe70('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbe70('0x10'));var as=require(_0xbe70('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe70('0x12'))(_0xbe70('0x13'));var utils=require(_0xbe70('0x14'));var config=require(_0xbe70('0x15'));var licenseUtil=require(_0xbe70('0x16'));var db=require(_0xbe70('0x17'))['db'];function respondWithStatusCode(_0x3ed655,_0x2ab0c2){_0x2ab0c2=_0x2ab0c2||0xcc;return function(_0x1eb5de){if(_0x1eb5de){return _0x3ed655[_0xbe70('0x18')](_0x2ab0c2);}return _0x3ed655[_0xbe70('0x19')](_0x2ab0c2)['end']();};}function respondWithResult(_0x5628c4,_0x47adfa){_0x47adfa=_0x47adfa||0xc8;return function(_0xe04dc0){if(_0xe04dc0){return _0x5628c4[_0xbe70('0x19')](_0x47adfa)[_0xbe70('0x1a')](_0xe04dc0);}};}function respondWithFilteredResult(_0x1b9f34,_0x5782d4){return function(_0x3c0871){if(_0x3c0871){var _0x5c82a7=typeof _0x5782d4['offset']===_0xbe70('0x1b')&&typeof _0x5782d4['limit']==='undefined';var _0x150689=_0x3c0871[_0xbe70('0x1c')];var _0x2bdc18=_0x5c82a7?0x0:_0x5782d4['offset'];var _0x15b6a5=_0x5c82a7?_0x3c0871['count']:_0x5782d4[_0xbe70('0x1d')]+_0x5782d4[_0xbe70('0x1e')];var _0x47b131;if(_0x15b6a5>=_0x150689){_0x15b6a5=_0x150689;_0x47b131=0xc8;}else{_0x47b131=0xce;}_0x1b9f34[_0xbe70('0x19')](_0x47b131);return _0x1b9f34[_0xbe70('0x1f')](_0xbe70('0x20'),_0x2bdc18+'-'+_0x15b6a5+'/'+_0x150689)[_0xbe70('0x1a')](_0x3c0871);}return null;};}function patchUpdates(_0x276682){return function(_0x1f11e9){try{jsonpatch[_0xbe70('0x21')](_0x1f11e9,_0x276682,!![]);}catch(_0x43b4fb){return BPromise[_0xbe70('0x22')](_0x43b4fb);}return _0x1f11e9[_0xbe70('0x23')]();};}function saveUpdates(_0x1646e2,_0x194925){return function(_0xdbb4b6){if(_0xdbb4b6){return _0xdbb4b6[_0xbe70('0x24')](_0x1646e2)[_0xbe70('0x25')](function(_0x76afeb){return _0x76afeb;});}return null;};}function removeEntity(_0x1a69ec,_0x33714c){return function(_0x36a176){if(_0x36a176){return _0x36a176[_0xbe70('0x26')]()['then'](function(){_0x1a69ec[_0xbe70('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xafaf24,_0x4cc937){return function(_0x6f56f4){if(!_0x6f56f4){_0xafaf24[_0xbe70('0x18')](0x194);}return _0x6f56f4;};}function handleError(_0x565f11,_0x164859){_0x164859=_0x164859||0x1f4;return function(_0x57b7a8){logger['error'](_0x57b7a8['stack']);if(_0x57b7a8[_0xbe70('0x27')]){delete _0x57b7a8[_0xbe70('0x27')];}_0x565f11[_0xbe70('0x19')](_0x164859)[_0xbe70('0x28')](_0x57b7a8);};}exports[_0xbe70('0x29')]=function(_0x136b1b,_0x312b02){var _0x59f602={},_0x3d7fa3={},_0x1b0937={'count':0x0,'rows':[]};var _0x22acd6=_[_0xbe70('0x2a')](db['AnalyticTreeReport']['rawAttributes'],function(_0x1d2b23){return{'name':_0x1d2b23[_0xbe70('0x2b')],'type':_0x1d2b23[_0xbe70('0x2c')]['key']};});_0x3d7fa3[_0xbe70('0x2d')]=_[_0xbe70('0x2a')](_0x22acd6,'name');_0x3d7fa3[_0xbe70('0x2e')]=_[_0xbe70('0x2f')](_0x136b1b['query']);_0x3d7fa3[_0xbe70('0x30')]=_[_0xbe70('0x31')](_0x3d7fa3[_0xbe70('0x2d')],_0x3d7fa3[_0xbe70('0x2e')]);_0x59f602[_0xbe70('0x32')]=_[_0xbe70('0x31')](_0x3d7fa3[_0xbe70('0x2d')],qs[_0xbe70('0x33')](_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x33')]));_0x59f602[_0xbe70('0x32')]=_0x59f602[_0xbe70('0x32')]['length']?_0x59f602[_0xbe70('0x32')]:_0x3d7fa3[_0xbe70('0x2d')];if(!_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x34')]('nolimit')){_0x59f602[_0xbe70('0x1e')]=qs[_0xbe70('0x1e')](_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x1e')]);_0x59f602[_0xbe70('0x1d')]=qs['offset'](_0x136b1b['query'][_0xbe70('0x1d')]);}_0x59f602[_0xbe70('0x35')]=qs[_0xbe70('0x36')](_0x136b1b['query']['sort']);_0x59f602[_0xbe70('0x37')]=qs['filters'](_[_0xbe70('0x38')](_0x136b1b['query'],_0x3d7fa3['filters']),_0x22acd6);if(_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x39')]){_0x59f602['where']=_[_0xbe70('0x3a')](_0x59f602[_0xbe70('0x37')],{'$or':_['map'](_0x22acd6,function(_0x368148){if(_0x368148[_0xbe70('0x2c')]!=='VIRTUAL'){var _0x250c39={};_0x250c39[_0x368148[_0xbe70('0x27')]]={'$like':'%'+_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x39')]+'%'};return _0x250c39;}})});}_0x59f602=_[_0xbe70('0x3a')]({},_0x59f602,_0x136b1b[_0xbe70('0x3b')]);var _0x3a704c={'where':_0x59f602['where']};return db['AnalyticTreeReport']['count'](_0x3a704c)[_0xbe70('0x25')](function(_0xac99e0){_0x1b0937[_0xbe70('0x1c')]=_0xac99e0;if(_0x136b1b[_0xbe70('0x2e')]['includeAll']){_0x59f602['include']=[{'all':!![]}];}return db[_0xbe70('0x3c')]['findAll'](_0x59f602);})[_0xbe70('0x25')](function(_0x25f5f8){_0x1b0937['rows']=_0x25f5f8;return _0x1b0937;})['then'](respondWithFilteredResult(_0x312b02,_0x59f602))[_0xbe70('0x3d')](handleError(_0x312b02,null));};exports[_0xbe70('0x3e')]=function(_0x453010,_0x4e272e){var _0xe62f79={'raw':!![],'where':{'id':_0x453010['params']['id']}},_0x510764={};_0x510764['model']=_[_0xbe70('0x2f')](db[_0xbe70('0x3c')][_0xbe70('0x3f')]);_0x510764[_0xbe70('0x2e')]=_[_0xbe70('0x2f')](_0x453010[_0xbe70('0x2e')]);_0x510764[_0xbe70('0x30')]=_[_0xbe70('0x31')](_0x510764[_0xbe70('0x2d')],_0x510764[_0xbe70('0x2e')]);_0xe62f79[_0xbe70('0x32')]=_['intersection'](_0x510764[_0xbe70('0x2d')],qs[_0xbe70('0x33')](_0x453010['query'][_0xbe70('0x33')]));_0xe62f79['attributes']=_0xe62f79[_0xbe70('0x32')][_0xbe70('0x40')]?_0xe62f79[_0xbe70('0x32')]:_0x510764['model'];if(_0x453010['query'][_0xbe70('0x41')]){_0xe62f79[_0xbe70('0x42')]=[{'all':!![]}];}_0xe62f79=_['merge']({},_0xe62f79,_0x453010[_0xbe70('0x3b')]);return db['AnalyticTreeReport'][_0xbe70('0x43')](_0xe62f79)[_0xbe70('0x25')](handleEntityNotFound(_0x4e272e,null))[_0xbe70('0x25')](respondWithResult(_0x4e272e,null))[_0xbe70('0x3d')](handleError(_0x4e272e,null));};exports[_0xbe70('0x44')]=function(_0x47b43d,_0x1ebcc8){return db['AnalyticTreeReport'][_0xbe70('0x44')](_0x47b43d['body'],{})['then'](respondWithResult(_0x1ebcc8,0xc9))[_0xbe70('0x3d')](handleError(_0x1ebcc8,null));};exports['update']=function(_0x286819,_0x441c78){if(_0x286819[_0xbe70('0x45')]['id']){delete _0x286819[_0xbe70('0x45')]['id'];}return db[_0xbe70('0x3c')][_0xbe70('0x43')]({'where':{'id':_0x286819[_0xbe70('0x46')]['id']}})[_0xbe70('0x25')](handleEntityNotFound(_0x441c78,null))[_0xbe70('0x25')](saveUpdates(_0x286819[_0xbe70('0x45')],null))[_0xbe70('0x25')](respondWithResult(_0x441c78,null))[_0xbe70('0x3d')](handleError(_0x441c78,null));};exports[_0xbe70('0x26')]=function(_0x3390e5,_0x547b89){return db['AnalyticTreeReport'][_0xbe70('0x43')]({'where':{'id':_0x3390e5[_0xbe70('0x46')]['id']}})[_0xbe70('0x25')](handleEntityNotFound(_0x547b89,null))['then'](removeEntity(_0x547b89,null))[_0xbe70('0x3d')](handleError(_0x547b89,null));};
\ No newline at end of file
+var _0xe76e=['catch','show','params','keys','length','include','find','create','body','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe76e,0x194));var _0xee76=function(_0x4cf54d,_0x1d544b){_0x4cf54d=_0x4cf54d-0x0;var _0x1dd27e=_0xe76e[_0x4cf54d];return _0x1dd27e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee76('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee76('0x1'));var rp=require(_0xee76('0x2'));var moment=require(_0xee76('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xee76('0x4'));var path=require(_0xee76('0x5'));var sox=require(_0xee76('0x6'));var csv=require(_0xee76('0x7'));var ejs=require(_0xee76('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee76('0x9'));var squel=require(_0xee76('0xa'));var crypto=require(_0xee76('0xb'));var jsforce=require(_0xee76('0xc'));var deskjs=require(_0xee76('0xd'));var toCsv=require('to-csv');var querystring=require(_0xee76('0xe'));var Papa=require(_0xee76('0xf'));var Redis=require('ioredis');var authService=require(_0xee76('0x10'));var qs=require(_0xee76('0x11'));var as=require(_0xee76('0x12'));var hardwareService=require(_0xee76('0x13'));var logger=require(_0xee76('0x14'))(_0xee76('0x15'));var utils=require(_0xee76('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xee76('0x17'));var db=require(_0xee76('0x18'))['db'];function respondWithStatusCode(_0x1c8672,_0x2e861f){_0x2e861f=_0x2e861f||0xcc;return function(_0x4eee9e){if(_0x4eee9e){return _0x1c8672[_0xee76('0x19')](_0x2e861f);}return _0x1c8672[_0xee76('0x1a')](_0x2e861f)['end']();};}function respondWithResult(_0x4d5181,_0xb506bf){_0xb506bf=_0xb506bf||0xc8;return function(_0x5e2913){if(_0x5e2913){return _0x4d5181['status'](_0xb506bf)[_0xee76('0x1b')](_0x5e2913);}};}function respondWithFilteredResult(_0x562d25,_0x346de2){return function(_0x4fa110){if(_0x4fa110){var _0x280019=typeof _0x346de2[_0xee76('0x1c')]===_0xee76('0x1d')&&typeof _0x346de2[_0xee76('0x1e')]===_0xee76('0x1d');var _0x4fd10a=_0x4fa110[_0xee76('0x1f')];var _0x3eebdc=_0x280019?0x0:_0x346de2[_0xee76('0x1c')];var _0x362682=_0x280019?_0x4fa110['count']:_0x346de2[_0xee76('0x1c')]+_0x346de2[_0xee76('0x1e')];var _0xf9da93;if(_0x362682>=_0x4fd10a){_0x362682=_0x4fd10a;_0xf9da93=0xc8;}else{_0xf9da93=0xce;}_0x562d25['status'](_0xf9da93);return _0x562d25[_0xee76('0x20')](_0xee76('0x21'),_0x3eebdc+'-'+_0x362682+'/'+_0x4fd10a)[_0xee76('0x1b')](_0x4fa110);}return null;};}function patchUpdates(_0x36bb6c){return function(_0xded4a2){try{jsonpatch[_0xee76('0x22')](_0xded4a2,_0x36bb6c,!![]);}catch(_0x5448d2){return BPromise[_0xee76('0x23')](_0x5448d2);}return _0xded4a2[_0xee76('0x24')]();};}function saveUpdates(_0x41d0a5,_0x5e3560){return function(_0x680181){if(_0x680181){return _0x680181[_0xee76('0x25')](_0x41d0a5)[_0xee76('0x26')](function(_0x21a5ad){return _0x21a5ad;});}return null;};}function removeEntity(_0x251612,_0x2d6f6a){return function(_0x24a0fb){if(_0x24a0fb){return _0x24a0fb[_0xee76('0x27')]()[_0xee76('0x26')](function(){_0x251612[_0xee76('0x1a')](0xcc)[_0xee76('0x28')]();});}};}function handleEntityNotFound(_0x17b82d,_0x160be9){return function(_0x550653){if(!_0x550653){_0x17b82d[_0xee76('0x19')](0x194);}return _0x550653;};}function handleError(_0x29a7ea,_0x3a569e){_0x3a569e=_0x3a569e||0x1f4;return function(_0x475021){logger[_0xee76('0x29')](_0x475021[_0xee76('0x2a')]);if(_0x475021[_0xee76('0x2b')]){delete _0x475021['name'];}_0x29a7ea['status'](_0x3a569e)[_0xee76('0x2c')](_0x475021);};}exports[_0xee76('0x2d')]=function(_0x5c35cc,_0x241e7e){var _0x2af5c3={},_0x2171cb={},_0x20f286={'count':0x0,'rows':[]};var _0x1773ad=_[_0xee76('0x2e')](db[_0xee76('0x2f')][_0xee76('0x30')],function(_0x187df8){return{'name':_0x187df8[_0xee76('0x31')],'type':_0x187df8['type'][_0xee76('0x32')]};});_0x2171cb['model']=_[_0xee76('0x2e')](_0x1773ad,_0xee76('0x2b'));_0x2171cb[_0xee76('0x33')]=_['keys'](_0x5c35cc['query']);_0x2171cb[_0xee76('0x34')]=_['intersection'](_0x2171cb[_0xee76('0x35')],_0x2171cb[_0xee76('0x33')]);_0x2af5c3['attributes']=_[_0xee76('0x36')](_0x2171cb[_0xee76('0x35')],qs[_0xee76('0x37')](_0x5c35cc['query'][_0xee76('0x37')]));_0x2af5c3[_0xee76('0x38')]=_0x2af5c3[_0xee76('0x38')]['length']?_0x2af5c3[_0xee76('0x38')]:_0x2171cb[_0xee76('0x35')];if(!_0x5c35cc[_0xee76('0x33')][_0xee76('0x39')](_0xee76('0x3a'))){_0x2af5c3[_0xee76('0x1e')]=qs[_0xee76('0x1e')](_0x5c35cc[_0xee76('0x33')][_0xee76('0x1e')]);_0x2af5c3[_0xee76('0x1c')]=qs[_0xee76('0x1c')](_0x5c35cc[_0xee76('0x33')][_0xee76('0x1c')]);}_0x2af5c3[_0xee76('0x3b')]=qs[_0xee76('0x3c')](_0x5c35cc[_0xee76('0x33')]['sort']);_0x2af5c3[_0xee76('0x3d')]=qs['filters'](_['pick'](_0x5c35cc[_0xee76('0x33')],_0x2171cb[_0xee76('0x34')]),_0x1773ad);if(_0x5c35cc['query'][_0xee76('0x3e')]){_0x2af5c3[_0xee76('0x3d')]=_['merge'](_0x2af5c3['where'],{'$or':_[_0xee76('0x2e')](_0x1773ad,function(_0x1cea68){if(_0x1cea68[_0xee76('0x3f')]!==_0xee76('0x40')){var _0xfa05e3={};_0xfa05e3[_0x1cea68[_0xee76('0x2b')]]={'$like':'%'+_0x5c35cc['query'][_0xee76('0x3e')]+'%'};return _0xfa05e3;}})});}_0x2af5c3=_[_0xee76('0x41')]({},_0x2af5c3,_0x5c35cc[_0xee76('0x42')]);var _0xb621c8={'where':_0x2af5c3['where']};return db[_0xee76('0x2f')]['count'](_0xb621c8)['then'](function(_0x16e42d){_0x20f286[_0xee76('0x1f')]=_0x16e42d;if(_0x5c35cc[_0xee76('0x33')][_0xee76('0x43')]){_0x2af5c3['include']=[{'all':!![]}];}return db[_0xee76('0x2f')][_0xee76('0x44')](_0x2af5c3);})[_0xee76('0x26')](function(_0x7410f5){_0x20f286[_0xee76('0x45')]=_0x7410f5;return _0x20f286;})[_0xee76('0x26')](respondWithFilteredResult(_0x241e7e,_0x2af5c3))[_0xee76('0x46')](handleError(_0x241e7e,null));};exports[_0xee76('0x47')]=function(_0x1934b9,_0x54bd0c){var _0x32c7f7={'raw':!![],'where':{'id':_0x1934b9[_0xee76('0x48')]['id']}},_0x966a1d={};_0x966a1d[_0xee76('0x35')]=_[_0xee76('0x49')](db[_0xee76('0x2f')][_0xee76('0x30')]);_0x966a1d['query']=_['keys'](_0x1934b9['query']);_0x966a1d[_0xee76('0x34')]=_[_0xee76('0x36')](_0x966a1d['model'],_0x966a1d[_0xee76('0x33')]);_0x32c7f7[_0xee76('0x38')]=_[_0xee76('0x36')](_0x966a1d[_0xee76('0x35')],qs[_0xee76('0x37')](_0x1934b9[_0xee76('0x33')][_0xee76('0x37')]));_0x32c7f7[_0xee76('0x38')]=_0x32c7f7[_0xee76('0x38')][_0xee76('0x4a')]?_0x32c7f7[_0xee76('0x38')]:_0x966a1d[_0xee76('0x35')];if(_0x1934b9[_0xee76('0x33')][_0xee76('0x43')]){_0x32c7f7[_0xee76('0x4b')]=[{'all':!![]}];}_0x32c7f7=_[_0xee76('0x41')]({},_0x32c7f7,_0x1934b9[_0xee76('0x42')]);return db[_0xee76('0x2f')][_0xee76('0x4c')](_0x32c7f7)[_0xee76('0x26')](handleEntityNotFound(_0x54bd0c,null))[_0xee76('0x26')](respondWithResult(_0x54bd0c,null))['catch'](handleError(_0x54bd0c,null));};exports[_0xee76('0x4d')]=function(_0x27fbcd,_0x28f010){return db['AnalyticTreeReport'][_0xee76('0x4d')](_0x27fbcd[_0xee76('0x4e')],{})[_0xee76('0x26')](respondWithResult(_0x28f010,0xc9))[_0xee76('0x46')](handleError(_0x28f010,null));};exports[_0xee76('0x25')]=function(_0x53a50b,_0x402076){if(_0x53a50b[_0xee76('0x4e')]['id']){delete _0x53a50b['body']['id'];}return db[_0xee76('0x2f')]['find']({'where':{'id':_0x53a50b[_0xee76('0x48')]['id']}})[_0xee76('0x26')](handleEntityNotFound(_0x402076,null))[_0xee76('0x26')](saveUpdates(_0x53a50b['body'],null))['then'](respondWithResult(_0x402076,null))['catch'](handleError(_0x402076,null));};exports[_0xee76('0x27')]=function(_0x28fe68,_0x1539ac){return db[_0xee76('0x2f')]['find']({'where':{'id':_0x28fe68[_0xee76('0x48')]['id']}})['then'](handleEntityNotFound(_0x1539ac,null))[_0xee76('0x26')](removeEntity(_0x1539ac,null))['catch'](handleError(_0x1539ac,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 5aebac7..f14c675 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 _0xd15f=['../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xd15f,0xf6));var _0xfd15=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0xd15f[_0x1e8b1e];return _0x4a0fde;};'use strict';var _=require(_0xfd15('0x0'));var util=require(_0xfd15('0x1'));var logger=require(_0xfd15('0x2'))(_0xfd15('0x3'));var moment=require(_0xfd15('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd15('0x5'));var fs=require('fs');var path=require(_0xfd15('0x6'));var rimraf=require('rimraf');var config=require(_0xfd15('0x7'));var attributes=require(_0xfd15('0x8'));module[_0xfd15('0x9')]=function(_0x2c6dc9,_0x2e7f87){return _0x2c6dc9[_0xfd15('0xa')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8212=['define','lodash','util','api','moment','bluebird','request-promise','path','exports'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0x8212,0xd9));var _0x2821=function(_0x2e0748,_0x55284){_0x2e0748=_0x2e0748-0x0;var _0x15d429=_0x8212[_0x2e0748];return _0x15d429;};'use strict';var _=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var logger=require('../../config/logger')(_0x2821('0x2'));var moment=require(_0x2821('0x3'));var BPromise=require(_0x2821('0x4'));var rp=require(_0x2821('0x5'));var fs=require('fs');var path=require(_0x2821('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x2821('0x7')]=function(_0x3d49c9,_0x3c90dc){return _0x3d49c9[_0x2821('0x8')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','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 2c14b1b..58f6e22 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(_0x2de1da,_0x49b428){var _0x10ca5f=function(_0x4276cb){while(--_0x4276cb){_0x2de1da['push'](_0x2de1da['shift']());}};_0x10ca5f(++_0x49b428);}(_0x5f2f,0x73));var _0xf5f2=function(_0x707aaa,_0x25752e){_0x707aaa=_0x707aaa-0x0;var _0x1931d3=_0x5f2f[_0x707aaa];return _0x1931d3;};'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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x24ffff,_0x35af2d){var _0x38b03e=function(_0x2302ed){while(--_0x2302ed){_0x24ffff['push'](_0x24ffff['shift']());}};_0x38b03e(++_0x35af2d);}(_0xdb28,0x106));var _0x8db2=function(_0x189f28,_0x4dfc71){_0x189f28=_0x189f28-0x0;var _0x1430b7=_0xdb28[_0x189f28];return _0x1430b7;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index bcdb64b..226bea6 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 _0xd848=['get','isAuthenticated','index','show','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x430a79,_0x17b2af){var _0xda6181=function(_0x488aca){while(--_0x488aca){_0x430a79['push'](_0x430a79['shift']());}};_0xda6181(++_0x17b2af);}(_0xd848,0x1ad));var _0x8d84=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xd848[_0x4dcc2d];return _0x1bbd79;};'use strict';var multer=require(_0x8d84('0x0'));var util=require(_0x8d84('0x1'));var path=require(_0x8d84('0x2'));var timeout=require(_0x8d84('0x3'));var express=require(_0x8d84('0x4'));var router=express[_0x8d84('0x5')]();var fs_extra=require(_0x8d84('0x6'));var auth=require(_0x8d84('0x7'));var interaction=require(_0x8d84('0x8'));var config=require(_0x8d84('0x9'));var controller=require(_0x8d84('0xa'));router[_0x8d84('0xb')]('/',auth[_0x8d84('0xc')](),controller[_0x8d84('0xd')]);router[_0x8d84('0xb')]('/:id',auth[_0x8d84('0xc')](),controller[_0x8d84('0xe')]);router[_0x8d84('0xf')]('/',auth['isAuthenticated'](),controller[_0x8d84('0x10')]);router[_0x8d84('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8d84('0x12')](_0x8d84('0x13'),auth[_0x8d84('0xc')](),controller[_0x8d84('0x14')]);module[_0x8d84('0x15')]=router;
\ No newline at end of file
+var _0x4b81=['index','/:id','show','isAuthenticated','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x16713c,_0x19d624){var _0x28634a=function(_0xa77094){while(--_0xa77094){_0x16713c['push'](_0x16713c['shift']());}};_0x28634a(++_0x19d624);}(_0x4b81,0xc8));var _0x14b8=function(_0x1f1a63,_0x3b5924){_0x1f1a63=_0x1f1a63-0x0;var _0x21492a=_0x4b81[_0x1f1a63];return _0x21492a;};'use strict';var multer=require('multer');var util=require(_0x14b8('0x0'));var path=require(_0x14b8('0x1'));var timeout=require(_0x14b8('0x2'));var express=require(_0x14b8('0x3'));var router=express['Router']();var fs_extra=require(_0x14b8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x14b8('0x5'));var config=require(_0x14b8('0x6'));var controller=require(_0x14b8('0x7'));router[_0x14b8('0x8')]('/',auth['isAuthenticated'](),controller[_0x14b8('0x9')]);router['get'](_0x14b8('0xa'),auth['isAuthenticated'](),controller[_0x14b8('0xb')]);router['post']('/',auth[_0x14b8('0xc')](),controller[_0x14b8('0xd')]);router[_0x14b8('0xe')](_0x14b8('0xa'),auth[_0x14b8('0xc')](),controller[_0x14b8('0xf')]);router[_0x14b8('0x10')]('/:id',auth[_0x14b8('0xc')](),controller[_0x14b8('0x11')]);module[_0x14b8('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 1c5509e..1ce02a7 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 _0x3cd1=['exports','STRING'];(function(_0x34baf0,_0x44d55c){var _0x30e3a0=function(_0x36445d){while(--_0x36445d){_0x34baf0['push'](_0x34baf0['shift']());}};_0x30e3a0(++_0x44d55c);}(_0x3cd1,0x112));var _0x13cd=function(_0x46cef6,_0x1d434c){_0x46cef6=_0x46cef6-0x0;var _0x239be7=_0x3cd1[_0x46cef6];return _0x239be7;};'use strict';var Sequelize=require('sequelize');module[_0x13cd('0x0')]={'name':{'type':Sequelize[_0x13cd('0x1')]},'basename':{'type':Sequelize[_0x13cd('0x1')]},'type':{'type':Sequelize[_0x13cd('0x1')]}};
\ No newline at end of file
+var _0xe1f0=['exports','STRING'];(function(_0x1aaa15,_0x4b6c71){var _0x2712cc=function(_0x37f0ae){while(--_0x37f0ae){_0x1aaa15['push'](_0x1aaa15['shift']());}};_0x2712cc(++_0x4b6c71);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x8f22d,_0x57f430){_0x8f22d=_0x8f22d-0x0;var _0x282eb4=_0xe1f0[_0x8f22d];return _0x282eb4;};'use strict';var Sequelize=require('sequelize');module[_0x0e1f('0x0')]={'name':{'type':Sequelize[_0x0e1f('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0e1f('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index e5901db..3c81993 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 _0xe7de=['find','catch','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','ChatOfflineMessageId','join','root','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','fields','model','nolimit','order','sort','where','filter','VIRTUAL','merge','Attachment','includeAll','findAll','rows','show','params','include','options'];(function(_0x3340fa,_0x54eae8){var _0x309e22=function(_0x1095ff){while(--_0x1095ff){_0x3340fa['push'](_0x3340fa['shift']());}};_0x309e22(++_0x54eae8);}(_0xe7de,0x109));var _0xee7d=function(_0x53fd72,_0x29776b){_0x53fd72=_0x53fd72-0x0;var _0x52a03a=_0xe7de[_0x53fd72];return _0x52a03a;};'use strict';var emlformat=require(_0xee7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee7d('0x1'));var jsonpatch=require(_0xee7d('0x2'));var rp=require(_0xee7d('0x3'));var moment=require('moment');var BPromise=require(_0xee7d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xee7d('0x5'));var sox=require(_0xee7d('0x6'));var csv=require(_0xee7d('0x7'));var ejs=require(_0xee7d('0x8'));var fs=require('fs');var fs_extra=require(_0xee7d('0x9'));var _=require(_0xee7d('0xa'));var squel=require(_0xee7d('0xb'));var crypto=require(_0xee7d('0xc'));var jsforce=require(_0xee7d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee7d('0xe'));var Redis=require(_0xee7d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xee7d('0x10'));var as=require(_0xee7d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee7d('0x12'))(_0xee7d('0x13'));var utils=require('../../config/utils');var config=require(_0xee7d('0x14'));var licenseUtil=require(_0xee7d('0x15'));var db=require(_0xee7d('0x16'))['db'];function respondWithStatusCode(_0x59ecbd,_0x4cc96b){_0x4cc96b=_0x4cc96b||0xcc;return function(_0x44552d){if(_0x44552d){return _0x59ecbd[_0xee7d('0x17')](_0x4cc96b);}return _0x59ecbd[_0xee7d('0x18')](_0x4cc96b)[_0xee7d('0x19')]();};}function respondWithResult(_0x4d0a37,_0x40593b){_0x40593b=_0x40593b||0xc8;return function(_0x7428fd){if(_0x7428fd){return _0x4d0a37[_0xee7d('0x18')](_0x40593b)['json'](_0x7428fd);}};}function respondWithFilteredResult(_0x5ee6ea,_0x245027){return function(_0x1f30ae){if(_0x1f30ae){var _0x266469=typeof _0x245027[_0xee7d('0x1a')]===_0xee7d('0x1b')&&typeof _0x245027[_0xee7d('0x1c')]===_0xee7d('0x1b');var _0x3bc737=_0x1f30ae[_0xee7d('0x1d')];var _0x54853d=_0x266469?0x0:_0x245027[_0xee7d('0x1a')];var _0x1231d2=_0x266469?_0x1f30ae[_0xee7d('0x1d')]:_0x245027[_0xee7d('0x1a')]+_0x245027[_0xee7d('0x1c')];var _0x3fe539;if(_0x1231d2>=_0x3bc737){_0x1231d2=_0x3bc737;_0x3fe539=0xc8;}else{_0x3fe539=0xce;}_0x5ee6ea[_0xee7d('0x18')](_0x3fe539);return _0x5ee6ea['set']('Content-Range',_0x54853d+'-'+_0x1231d2+'/'+_0x3bc737)['json'](_0x1f30ae);}return null;};}function patchUpdates(_0xc163f4){return function(_0x512e45){try{jsonpatch[_0xee7d('0x1e')](_0x512e45,_0xc163f4,!![]);}catch(_0x140188){return BPromise[_0xee7d('0x1f')](_0x140188);}return _0x512e45[_0xee7d('0x20')]();};}function saveUpdates(_0x452c88,_0x15a746){return function(_0x215bfe){if(_0x215bfe){return _0x215bfe[_0xee7d('0x21')](_0x452c88)[_0xee7d('0x22')](function(_0x19fd60){return _0x19fd60;});}return null;};}function removeEntity(_0x3d578c,_0xcfeb7e){return function(_0x1e8179){if(_0x1e8179){return _0x1e8179[_0xee7d('0x23')]()[_0xee7d('0x22')](function(){_0x3d578c['status'](0xcc)[_0xee7d('0x19')]();});}};}function handleEntityNotFound(_0x4dc643,_0x48c279){return function(_0x2c14e8){if(!_0x2c14e8){_0x4dc643['sendStatus'](0x194);}return _0x2c14e8;};}function handleError(_0x2bd9f5,_0x541fbc){_0x541fbc=_0x541fbc||0x1f4;return function(_0x1b24d2){logger[_0xee7d('0x24')](_0x1b24d2[_0xee7d('0x25')]);if(_0x1b24d2[_0xee7d('0x26')]){delete _0x1b24d2[_0xee7d('0x26')];}_0x2bd9f5[_0xee7d('0x18')](_0x541fbc)['send'](_0x1b24d2);};}exports[_0xee7d('0x27')]=function(_0x239368,_0x2b7e0d){var _0x5ad5f4={},_0x521e9f={},_0x37466e={'count':0x0,'rows':[]};var _0x182174=_[_0xee7d('0x28')](db['Attachment'][_0xee7d('0x29')],function(_0x48e0e9){return{'name':_0x48e0e9[_0xee7d('0x2a')],'type':_0x48e0e9[_0xee7d('0x2b')][_0xee7d('0x2c')]};});_0x521e9f['model']=_[_0xee7d('0x28')](_0x182174,'name');_0x521e9f['query']=_[_0xee7d('0x2d')](_0x239368[_0xee7d('0x2e')]);_0x521e9f[_0xee7d('0x2f')]=_['intersection'](_0x521e9f['model'],_0x521e9f['query']);_0x5ad5f4[_0xee7d('0x30')]=_[_0xee7d('0x31')](_0x521e9f['model'],qs[_0xee7d('0x32')](_0x239368['query'][_0xee7d('0x32')]));_0x5ad5f4[_0xee7d('0x30')]=_0x5ad5f4[_0xee7d('0x30')]['length']?_0x5ad5f4['attributes']:_0x521e9f[_0xee7d('0x33')];if(!_0x239368[_0xee7d('0x2e')]['hasOwnProperty'](_0xee7d('0x34'))){_0x5ad5f4[_0xee7d('0x1c')]=qs[_0xee7d('0x1c')](_0x239368[_0xee7d('0x2e')]['limit']);_0x5ad5f4[_0xee7d('0x1a')]=qs[_0xee7d('0x1a')](_0x239368['query'][_0xee7d('0x1a')]);}_0x5ad5f4[_0xee7d('0x35')]=qs[_0xee7d('0x36')](_0x239368[_0xee7d('0x2e')]['sort']);_0x5ad5f4[_0xee7d('0x37')]=qs['filters'](_['pick'](_0x239368[_0xee7d('0x2e')],_0x521e9f[_0xee7d('0x2f')]),_0x182174);if(_0x239368[_0xee7d('0x2e')][_0xee7d('0x38')]){_0x5ad5f4[_0xee7d('0x37')]=_['merge'](_0x5ad5f4[_0xee7d('0x37')],{'$or':_[_0xee7d('0x28')](_0x182174,function(_0x4ef8ac){if(_0x4ef8ac[_0xee7d('0x2b')]!==_0xee7d('0x39')){var _0x33a04f={};_0x33a04f[_0x4ef8ac[_0xee7d('0x26')]]={'$like':'%'+_0x239368[_0xee7d('0x2e')][_0xee7d('0x38')]+'%'};return _0x33a04f;}})});}_0x5ad5f4=_[_0xee7d('0x3a')]({},_0x5ad5f4,_0x239368['options']);var _0x895c3f={'where':_0x5ad5f4[_0xee7d('0x37')]};return db[_0xee7d('0x3b')][_0xee7d('0x1d')](_0x895c3f)[_0xee7d('0x22')](function(_0x10e97a){_0x37466e[_0xee7d('0x1d')]=_0x10e97a;if(_0x239368[_0xee7d('0x2e')][_0xee7d('0x3c')]){_0x5ad5f4['include']=[{'all':!![]}];}return db[_0xee7d('0x3b')][_0xee7d('0x3d')](_0x5ad5f4);})[_0xee7d('0x22')](function(_0x2ead51){_0x37466e[_0xee7d('0x3e')]=_0x2ead51;return _0x37466e;})[_0xee7d('0x22')](respondWithFilteredResult(_0x2b7e0d,_0x5ad5f4))['catch'](handleError(_0x2b7e0d,null));};exports[_0xee7d('0x3f')]=function(_0xfcf96b,_0x18fbbf){var _0x9f0627={'raw':!![],'where':{'id':_0xfcf96b[_0xee7d('0x40')]['id']}},_0x4e4e06={};_0x4e4e06[_0xee7d('0x33')]=_[_0xee7d('0x2d')](db[_0xee7d('0x3b')][_0xee7d('0x29')]);_0x4e4e06[_0xee7d('0x2e')]=_[_0xee7d('0x2d')](_0xfcf96b[_0xee7d('0x2e')]);_0x4e4e06[_0xee7d('0x2f')]=_['intersection'](_0x4e4e06['model'],_0x4e4e06[_0xee7d('0x2e')]);_0x9f0627[_0xee7d('0x30')]=_[_0xee7d('0x31')](_0x4e4e06[_0xee7d('0x33')],qs[_0xee7d('0x32')](_0xfcf96b[_0xee7d('0x2e')]['fields']));_0x9f0627['attributes']=_0x9f0627['attributes']['length']?_0x9f0627['attributes']:_0x4e4e06[_0xee7d('0x33')];if(_0xfcf96b['query'][_0xee7d('0x3c')]){_0x9f0627[_0xee7d('0x41')]=[{'all':!![]}];}_0x9f0627=_[_0xee7d('0x3a')]({},_0x9f0627,_0xfcf96b[_0xee7d('0x42')]);return db[_0xee7d('0x3b')][_0xee7d('0x43')](_0x9f0627)[_0xee7d('0x22')](handleEntityNotFound(_0x18fbbf,null))['then'](respondWithResult(_0x18fbbf,null))[_0xee7d('0x44')](handleError(_0x18fbbf,null));};exports['clone']=function(_0x2f4dcd,_0x11e781){var _0x5637d8={'where':{'id':_0x2f4dcd['params']['id']}},_0x8ac70c={};_0x8ac70c[_0xee7d('0x33')]=_[_0xee7d('0x2d')](db[_0xee7d('0x3b')][_0xee7d('0x29')]);_0x5637d8[_0xee7d('0x30')]=_[_0xee7d('0x31')](_0x8ac70c['model'],qs[_0xee7d('0x32')](_0x2f4dcd[_0xee7d('0x2e')][_0xee7d('0x32')]));_0x5637d8[_0xee7d('0x30')]=_0x5637d8[_0xee7d('0x30')]['length']?_0x5637d8['attributes']:_0x8ac70c[_0xee7d('0x33')];if(_0x2f4dcd[_0xee7d('0x2e')][_0xee7d('0x3c')]){_0x5637d8['include']=[{'all':!![]}];}_0x5637d8=_[_0xee7d('0x3a')]({},_0x5637d8,_0x2f4dcd[_0xee7d('0x42')]);return db[_0xee7d('0x3b')]['find'](_0x5637d8)[_0xee7d('0x22')](handleEntityNotFound(_0x11e781,null))[_0xee7d('0x22')](function(_0xeeec01){if(_0xeeec01){var _0x8ed839=_0xeeec01[_0xee7d('0x45')]({'plain':!![]});_0x8ed839=qs[_0xee7d('0x46')](_0x8ed839,['id',_0xee7d('0x47'),_0xee7d('0x48')]);_0x2f4dcd[_0xee7d('0x49')]=_[_0xee7d('0x46')](_0x2f4dcd[_0xee7d('0x49')],['id','createdAt',_0xee7d('0x48')]);return db[_0xee7d('0x3b')][_0xee7d('0x4a')](_[_0xee7d('0x3a')](_0x8ed839,_0x2f4dcd['body']),{'include':_0x2f4dcd[_0xee7d('0x2e')][_0xee7d('0x3c')]?[{'all':!![]}]:undefined});}})[_0xee7d('0x22')](respondWithResult(_0x11e781,0xc9))[_0xee7d('0x44')](handleError(_0x11e781,null));};exports[_0xee7d('0x21')]=function(_0x5be6a0,_0x197cb7){if(_0x5be6a0['body']['id']){delete _0x5be6a0[_0xee7d('0x49')]['id'];}return db[_0xee7d('0x3b')]['find']({'where':{'id':_0x5be6a0['params']['id']}})[_0xee7d('0x22')](handleEntityNotFound(_0x197cb7,null))[_0xee7d('0x22')](saveUpdates(_0x5be6a0[_0xee7d('0x49')],null))[_0xee7d('0x22')](respondWithResult(_0x197cb7,null))['catch'](handleError(_0x197cb7,null));};exports[_0xee7d('0x23')]=function(_0x3cc7a3,_0x1ab3a9){return db[_0xee7d('0x3b')][_0xee7d('0x43')]({'where':{'id':_0x3cc7a3[_0xee7d('0x40')]['id']}})[_0xee7d('0x22')](handleEntityNotFound(_0x1ab3a9,null))['then'](removeEntity(_0x1ab3a9,null))['catch'](handleError(_0x1ab3a9,null));};exports['create']=function(_0x5c1457,_0x492f81,_0xa45a09){_0x5c1457[_0xee7d('0x49')]['name']=_0x5c1457[_0xee7d('0x4b')][_0xee7d('0x4c')];_0x5c1457[_0xee7d('0x49')][_0xee7d('0x4d')]=_0x5c1457[_0xee7d('0x4b')]['filename'];_0x5c1457['body'][_0xee7d('0x2b')]=_0x5c1457[_0xee7d('0x4b')][_0xee7d('0x4e')];return db['Attachment']['create'](_0x5c1457[_0xee7d('0x49')])['then'](respondWithResult(_0x492f81,0xc9))[_0xee7d('0x44')](handleError(_0x492f81,null));};exports['download']=function(_0x58b348,_0x3b2153,_0x246994){return db['Attachment']['findOne']({'where':{'id':_0x58b348['params']['id']},'raw':!![]})[_0xee7d('0x22')](handleEntityNotFound(_0x3b2153,null))['then'](function(_0x34888e){if(_0x34888e){var _0x15d4f0=_0x34888e[_0xee7d('0x4f')]!==null;var _0x3398a1=path[_0xee7d('0x50')](config[_0xee7d('0x51')],'server/files/attachments/');if(_0x15d4f0){_0x3398a1=path['join'](_0x3398a1,'offline-chat/');}var _0x38039b=path[_0xee7d('0x50')](_0x3398a1,_0x34888e[_0xee7d('0x4d')]);return _0x3b2153[_0xee7d('0x52')](_0x38039b);}})[_0xee7d('0x44')](handleError(_0x3b2153,null));};
\ No newline at end of file
+var _0xcef2=['Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','show','params','length','includeAll','find','catch','clone','options','createdAt','body','omit','destroy','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','offset','undefined','count','status','set'];(function(_0x35c8f5,_0x399f44){var _0xb5c718=function(_0x50450c){while(--_0x50450c){_0x35c8f5['push'](_0x35c8f5['shift']());}};_0xb5c718(++_0x399f44);}(_0xcef2,0x150));var _0x2cef=function(_0x297856,_0xd3d540){_0x297856=_0x297856-0x0;var _0x413d73=_0xcef2[_0x297856];return _0x413d73;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2cef('0x0'));var zipdir=require(_0x2cef('0x1'));var jsonpatch=require(_0x2cef('0x2'));var rp=require('request-promise');var moment=require(_0x2cef('0x3'));var BPromise=require(_0x2cef('0x4'));var Mustache=require(_0x2cef('0x5'));var util=require(_0x2cef('0x6'));var path=require(_0x2cef('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2cef('0x8'));var fs=require('fs');var fs_extra=require(_0x2cef('0x9'));var _=require(_0x2cef('0xa'));var squel=require(_0x2cef('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2cef('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2cef('0xd'));var Papa=require('papaparse');var Redis=require(_0x2cef('0xe'));var authService=require(_0x2cef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2cef('0x10'));var hardwareService=require(_0x2cef('0x11'));var logger=require('../../config/logger')(_0x2cef('0x12'));var utils=require(_0x2cef('0x13'));var config=require(_0x2cef('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2cef('0x15'))['db'];function respondWithStatusCode(_0x42397c,_0x57b279){_0x57b279=_0x57b279||0xcc;return function(_0xab00b0){if(_0xab00b0){return _0x42397c['sendStatus'](_0x57b279);}return _0x42397c['status'](_0x57b279)[_0x2cef('0x16')]();};}function respondWithResult(_0x5075e0,_0x1af370){_0x1af370=_0x1af370||0xc8;return function(_0x5b593d){if(_0x5b593d){return _0x5075e0['status'](_0x1af370)['json'](_0x5b593d);}};}function respondWithFilteredResult(_0xe82169,_0x4a87fc){return function(_0x59f942){if(_0x59f942){var _0x10ddc2=typeof _0x4a87fc[_0x2cef('0x17')]==='undefined'&&typeof _0x4a87fc['limit']===_0x2cef('0x18');var _0x171d01=_0x59f942['count'];var _0x12cc4a=_0x10ddc2?0x0:_0x4a87fc[_0x2cef('0x17')];var _0x1dedb4=_0x10ddc2?_0x59f942[_0x2cef('0x19')]:_0x4a87fc['offset']+_0x4a87fc['limit'];var _0x5e4265;if(_0x1dedb4>=_0x171d01){_0x1dedb4=_0x171d01;_0x5e4265=0xc8;}else{_0x5e4265=0xce;}_0xe82169[_0x2cef('0x1a')](_0x5e4265);return _0xe82169[_0x2cef('0x1b')](_0x2cef('0x1c'),_0x12cc4a+'-'+_0x1dedb4+'/'+_0x171d01)[_0x2cef('0x1d')](_0x59f942);}return null;};}function patchUpdates(_0x560eb3){return function(_0x2e41e8){try{jsonpatch[_0x2cef('0x1e')](_0x2e41e8,_0x560eb3,!![]);}catch(_0x97f6b){return BPromise[_0x2cef('0x1f')](_0x97f6b);}return _0x2e41e8[_0x2cef('0x20')]();};}function saveUpdates(_0x15cd23,_0x14f312){return function(_0xad3e5d){if(_0xad3e5d){return _0xad3e5d[_0x2cef('0x21')](_0x15cd23)[_0x2cef('0x22')](function(_0x150700){return _0x150700;});}return null;};}function removeEntity(_0x521512,_0x45e8a8){return function(_0x3c4694){if(_0x3c4694){return _0x3c4694['destroy']()[_0x2cef('0x22')](function(){_0x521512[_0x2cef('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20d2d4,_0x45ee04){return function(_0x416ce4){if(!_0x416ce4){_0x20d2d4[_0x2cef('0x23')](0x194);}return _0x416ce4;};}function handleError(_0x367741,_0x9631c0){_0x9631c0=_0x9631c0||0x1f4;return function(_0x1243d6){logger[_0x2cef('0x24')](_0x1243d6[_0x2cef('0x25')]);if(_0x1243d6[_0x2cef('0x26')]){delete _0x1243d6[_0x2cef('0x26')];}_0x367741[_0x2cef('0x1a')](_0x9631c0)[_0x2cef('0x27')](_0x1243d6);};}exports[_0x2cef('0x28')]=function(_0x3d7b48,_0xd3fa46){var _0x10b65a={},_0x2f2c70={},_0x1872b0={'count':0x0,'rows':[]};var _0x4ca85a=_['map'](db[_0x2cef('0x29')][_0x2cef('0x2a')],function(_0x3ee72c){return{'name':_0x3ee72c[_0x2cef('0x2b')],'type':_0x3ee72c[_0x2cef('0x2c')][_0x2cef('0x2d')]};});_0x2f2c70[_0x2cef('0x2e')]=_[_0x2cef('0x2f')](_0x4ca85a,_0x2cef('0x26'));_0x2f2c70[_0x2cef('0x30')]=_[_0x2cef('0x31')](_0x3d7b48[_0x2cef('0x30')]);_0x2f2c70[_0x2cef('0x32')]=_[_0x2cef('0x33')](_0x2f2c70['model'],_0x2f2c70[_0x2cef('0x30')]);_0x10b65a['attributes']=_[_0x2cef('0x33')](_0x2f2c70[_0x2cef('0x2e')],qs[_0x2cef('0x34')](_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x34')]));_0x10b65a[_0x2cef('0x35')]=_0x10b65a[_0x2cef('0x35')]['length']?_0x10b65a['attributes']:_0x2f2c70['model'];if(!_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x36')]('nolimit')){_0x10b65a['limit']=qs[_0x2cef('0x37')](_0x3d7b48['query']['limit']);_0x10b65a[_0x2cef('0x17')]=qs['offset'](_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x17')]);}_0x10b65a[_0x2cef('0x38')]=qs[_0x2cef('0x39')](_0x3d7b48[_0x2cef('0x30')]['sort']);_0x10b65a['where']=qs['filters'](_[_0x2cef('0x3a')](_0x3d7b48[_0x2cef('0x30')],_0x2f2c70[_0x2cef('0x32')]),_0x4ca85a);if(_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x3b')]){_0x10b65a[_0x2cef('0x3c')]=_['merge'](_0x10b65a['where'],{'$or':_['map'](_0x4ca85a,function(_0x1b000a){if(_0x1b000a['type']!==_0x2cef('0x3d')){var _0x431080={};_0x431080[_0x1b000a[_0x2cef('0x26')]]={'$like':'%'+_0x3d7b48[_0x2cef('0x30')][_0x2cef('0x3b')]+'%'};return _0x431080;}})});}_0x10b65a=_[_0x2cef('0x3e')]({},_0x10b65a,_0x3d7b48['options']);var _0x332937={'where':_0x10b65a[_0x2cef('0x3c')]};return db[_0x2cef('0x29')]['count'](_0x332937)['then'](function(_0xfec542){_0x1872b0['count']=_0xfec542;if(_0x3d7b48[_0x2cef('0x30')]['includeAll']){_0x10b65a[_0x2cef('0x3f')]=[{'all':!![]}];}return db[_0x2cef('0x29')][_0x2cef('0x40')](_0x10b65a);})['then'](function(_0x3ab048){_0x1872b0[_0x2cef('0x41')]=_0x3ab048;return _0x1872b0;})[_0x2cef('0x22')](respondWithFilteredResult(_0xd3fa46,_0x10b65a))['catch'](handleError(_0xd3fa46,null));};exports[_0x2cef('0x42')]=function(_0x2b2149,_0x28335b){var _0x5209e6={'raw':!![],'where':{'id':_0x2b2149[_0x2cef('0x43')]['id']}},_0x1967c4={};_0x1967c4[_0x2cef('0x2e')]=_[_0x2cef('0x31')](db[_0x2cef('0x29')][_0x2cef('0x2a')]);_0x1967c4['query']=_[_0x2cef('0x31')](_0x2b2149[_0x2cef('0x30')]);_0x1967c4[_0x2cef('0x32')]=_['intersection'](_0x1967c4[_0x2cef('0x2e')],_0x1967c4[_0x2cef('0x30')]);_0x5209e6['attributes']=_['intersection'](_0x1967c4['model'],qs[_0x2cef('0x34')](_0x2b2149[_0x2cef('0x30')]['fields']));_0x5209e6[_0x2cef('0x35')]=_0x5209e6['attributes'][_0x2cef('0x44')]?_0x5209e6[_0x2cef('0x35')]:_0x1967c4[_0x2cef('0x2e')];if(_0x2b2149[_0x2cef('0x30')][_0x2cef('0x45')]){_0x5209e6[_0x2cef('0x3f')]=[{'all':!![]}];}_0x5209e6=_[_0x2cef('0x3e')]({},_0x5209e6,_0x2b2149['options']);return db[_0x2cef('0x29')][_0x2cef('0x46')](_0x5209e6)[_0x2cef('0x22')](handleEntityNotFound(_0x28335b,null))['then'](respondWithResult(_0x28335b,null))[_0x2cef('0x47')](handleError(_0x28335b,null));};exports[_0x2cef('0x48')]=function(_0x5c02a3,_0x5e440f){var _0x54aaa4={'where':{'id':_0x5c02a3[_0x2cef('0x43')]['id']}},_0x49b4ef={};_0x49b4ef[_0x2cef('0x2e')]=_['keys'](db[_0x2cef('0x29')]['rawAttributes']);_0x54aaa4[_0x2cef('0x35')]=_[_0x2cef('0x33')](_0x49b4ef['model'],qs['fields'](_0x5c02a3[_0x2cef('0x30')][_0x2cef('0x34')]));_0x54aaa4[_0x2cef('0x35')]=_0x54aaa4[_0x2cef('0x35')][_0x2cef('0x44')]?_0x54aaa4[_0x2cef('0x35')]:_0x49b4ef['model'];if(_0x5c02a3[_0x2cef('0x30')][_0x2cef('0x45')]){_0x54aaa4[_0x2cef('0x3f')]=[{'all':!![]}];}_0x54aaa4=_[_0x2cef('0x3e')]({},_0x54aaa4,_0x5c02a3[_0x2cef('0x49')]);return db[_0x2cef('0x29')][_0x2cef('0x46')](_0x54aaa4)['then'](handleEntityNotFound(_0x5e440f,null))['then'](function(_0x40febf){if(_0x40febf){var _0x5e6255=_0x40febf['get']({'plain':!![]});_0x5e6255=qs['omit'](_0x5e6255,['id',_0x2cef('0x4a'),'updatedAt']);_0x5c02a3[_0x2cef('0x4b')]=_[_0x2cef('0x4c')](_0x5c02a3[_0x2cef('0x4b')],['id',_0x2cef('0x4a'),'updatedAt']);return db[_0x2cef('0x29')]['create'](_[_0x2cef('0x3e')](_0x5e6255,_0x5c02a3[_0x2cef('0x4b')]),{'include':_0x5c02a3[_0x2cef('0x30')][_0x2cef('0x45')]?[{'all':!![]}]:undefined});}})[_0x2cef('0x22')](respondWithResult(_0x5e440f,0xc9))[_0x2cef('0x47')](handleError(_0x5e440f,null));};exports['update']=function(_0x162191,_0x58aa30){if(_0x162191[_0x2cef('0x4b')]['id']){delete _0x162191['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x162191[_0x2cef('0x43')]['id']}})['then'](handleEntityNotFound(_0x58aa30,null))[_0x2cef('0x22')](saveUpdates(_0x162191[_0x2cef('0x4b')],null))['then'](respondWithResult(_0x58aa30,null))[_0x2cef('0x47')](handleError(_0x58aa30,null));};exports[_0x2cef('0x4d')]=function(_0x227951,_0x25b05e){return db['Attachment']['find']({'where':{'id':_0x227951[_0x2cef('0x43')]['id']}})[_0x2cef('0x22')](handleEntityNotFound(_0x25b05e,null))[_0x2cef('0x22')](removeEntity(_0x25b05e,null))[_0x2cef('0x47')](handleError(_0x25b05e,null));};exports[_0x2cef('0x4e')]=function(_0x568c62,_0x3a7798,_0x544cca){_0x568c62[_0x2cef('0x4b')]['name']=_0x568c62[_0x2cef('0x4f')][_0x2cef('0x50')];_0x568c62['body'][_0x2cef('0x51')]=_0x568c62['file'][_0x2cef('0x52')];_0x568c62['body'][_0x2cef('0x2c')]=_0x568c62['file'][_0x2cef('0x53')];return db[_0x2cef('0x29')][_0x2cef('0x4e')](_0x568c62['body'])[_0x2cef('0x22')](respondWithResult(_0x3a7798,0xc9))[_0x2cef('0x47')](handleError(_0x3a7798,null));};exports[_0x2cef('0x54')]=function(_0x121b8a,_0x3903cd,_0x19d6b7){return db[_0x2cef('0x29')][_0x2cef('0x55')]({'where':{'id':_0x121b8a[_0x2cef('0x43')]['id']},'raw':!![]})[_0x2cef('0x22')](handleEntityNotFound(_0x3903cd,null))[_0x2cef('0x22')](function(_0x24729c){if(_0x24729c){var _0x49cb9b=_0x24729c[_0x2cef('0x56')]!==null;var _0x2869f2=path[_0x2cef('0x57')](config[_0x2cef('0x58')],_0x2cef('0x59'));if(_0x49cb9b){_0x2869f2=path[_0x2cef('0x57')](_0x2869f2,_0x2cef('0x5a'));}var _0x35527d=path['join'](_0x2869f2,_0x24729c[_0x2cef('0x51')]);return _0x3903cd[_0x2cef('0x54')](_0x35527d);}})[_0x2cef('0x47')](handleError(_0x3903cd,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 4e03c27..e9f87df 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 _0x05a9=['attachments','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./attachment.attributes','exports','define','Attachment'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x05a9,0x9b));var _0x905a=function(_0x2c3869,_0x514109){_0x2c3869=_0x2c3869-0x0;var _0x3af880=_0x05a9[_0x2c3869];return _0x3af880;};'use strict';var _=require(_0x905a('0x0'));var util=require('util');var logger=require(_0x905a('0x1'))('api');var moment=require(_0x905a('0x2'));var BPromise=require(_0x905a('0x3'));var rp=require(_0x905a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x905a('0x5'));var config=require('../../config/environment');var attributes=require(_0x905a('0x6'));module[_0x905a('0x7')]=function(_0x1933e6,_0x224201){return _0x1933e6[_0x905a('0x8')](_0x905a('0x9'),attributes,{'tableName':_0x905a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1f9=['api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','util'];(function(_0x5580b2,_0x1b008e){var _0x24be0d=function(_0x3bb607){while(--_0x3bb607){_0x5580b2['push'](_0x5580b2['shift']());}};_0x24be0d(++_0x1b008e);}(_0xb1f9,0x82));var _0x9b1f=function(_0x89418d,_0x1345c8){_0x89418d=_0x89418d-0x0;var _0x33577b=_0xb1f9[_0x89418d];return _0x33577b;};'use strict';var _=require(_0x9b1f('0x0'));var util=require(_0x9b1f('0x1'));var logger=require('../../config/logger')(_0x9b1f('0x2'));var moment=require(_0x9b1f('0x3'));var BPromise=require(_0x9b1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b1f('0x5'));var rimraf=require(_0x9b1f('0x6'));var config=require(_0x9b1f('0x7'));var attributes=require(_0x9b1f('0x8'));module['exports']=function(_0x56648c,_0x28f207){return _0x56648c[_0x9b1f('0x9')](_0x9b1f('0xa'),attributes,{'tableName':_0x9b1f('0xb'),'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 27d6220..00f55b1 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 _0xfa2b=['Attachment','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','result','CreateAttachment'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x14ff16,_0x18a9ab){_0x14ff16=_0x14ff16-0x0;var _0x16c67a=_0xfa2b[_0x14ff16];return _0x16c67a;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('Attachment,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('Attachment,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});}exports[_0xbfa2('0x19')]=function(_0x12627a){var _0x28fe6f=this;return new Promise(function(_0x4088c5,_0x37aed6){return db[_0xbfa2('0x1a')][_0xbfa2('0x1b')](_0x12627a['body'],{'raw':_0x12627a[_0xbfa2('0x1c')]?_0x12627a[_0xbfa2('0x1c')][_0xbfa2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2ac6c3){logger[_0xbfa2('0x10')]('CreateAttachment',_0x12627a);logger[_0xbfa2('0x13')]('CreateAttachment',_0x12627a,JSON['stringify'](_0x2ac6c3));_0x4088c5(_0x2ac6c3);})[_0xbfa2('0x1e')](function(_0xdb059b){logger[_0xbfa2('0x16')](_0xbfa2('0x19'),_0xdb059b['message'],_0x12627a);_0x37aed6(_0x28fe6f['error'](0x1f4,_0xdb059b[_0xbfa2('0x17')]));});});};
\ No newline at end of file
+var _0xb6b1=['raw','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','info','result','catch','CreateAttachment','Attachment','create','body','options'];(function(_0x16af15,_0x55bc76){var _0xfeda8a=function(_0x13ad56){while(--_0x13ad56){_0x16af15['push'](_0x16af15['shift']());}};_0xfeda8a(++_0x55bc76);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xb6b1[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d09e,_0x51cfed,_0xae4115){return new BPromise(function(_0x5042f7,_0x21f403){return client[_0x1b6b('0x9')](_0x41d09e,_0xae4115)[_0x1b6b('0xa')](function(_0x29258a){logger['info']('Attachment,\x20%s,\x20%s',_0x51cfed,_0x1b6b('0xb'));logger[_0x1b6b('0xc')](_0x1b6b('0xd'),_0x51cfed,_0x1b6b('0xb'),JSON[_0x1b6b('0xe')](_0x29258a));if(_0x29258a[_0x1b6b('0xf')]){if(_0x29258a[_0x1b6b('0xf')]['code']===0x1f4){logger[_0x1b6b('0xf')](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')]['message']);return _0x21f403(_0x29258a[_0x1b6b('0xf')]['message']);}logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);return _0x5042f7(_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);}else{logger[_0x1b6b('0x12')](_0x1b6b('0x10'),_0x51cfed,'request\x20sent');_0x5042f7(_0x29258a[_0x1b6b('0x13')][_0x1b6b('0x11')]);}})[_0x1b6b('0x14')](function(_0x33dc7e){logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x33dc7e);_0x21f403(_0x33dc7e);});});}exports[_0x1b6b('0x15')]=function(_0x2e608b){var _0x59e671=this;return new Promise(function(_0x923711,_0x15d44b){return db[_0x1b6b('0x16')][_0x1b6b('0x17')](_0x2e608b[_0x1b6b('0x18')],{'raw':_0x2e608b[_0x1b6b('0x19')]?_0x2e608b[_0x1b6b('0x19')][_0x1b6b('0x1a')]===undefined?!![]:![]:!![]})[_0x1b6b('0xa')](function(_0x20a5a3){logger['info'](_0x1b6b('0x15'),_0x2e608b);logger[_0x1b6b('0xc')](_0x1b6b('0x15'),_0x2e608b,JSON[_0x1b6b('0xe')](_0x20a5a3));_0x923711(_0x20a5a3);})[_0x1b6b('0x14')](function(_0x276713){logger[_0x1b6b('0xf')](_0x1b6b('0x15'),_0x276713[_0x1b6b('0x11')],_0x2e608b);_0x15d44b(_0x59e671['error'](0x1f4,_0x276713[_0x1b6b('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 83de210..a4aa339 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2ef8d9,_0x2fb8d0){var _0x18d1db=function(_0x4165bb){while(--_0x4165bb){_0x2ef8d9['push'](_0x2ef8d9['shift']());}};_0x18d1db(++_0x2fb8d0);}(_0x2032,0xd9));var _0x2203=function(_0xb6a7a6,_0x36f65f){_0xb6a7a6=_0xb6a7a6-0x0;var _0x4fdfb2=_0x2032[_0xb6a7a6];return _0x4fdfb2;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x407f8b,_0x139a19){var _0x692e66=function(_0x3cb0df){while(--_0x3cb0df){_0x407f8b['push'](_0x407f8b['shift']());}};_0x692e66(++_0x139a19);}(_0x2032,0xd9));var _0x2203=function(_0x9b6c7c,_0x27ee2c){_0x9b6c7c=_0x9b6c7c-0x0;var _0x26aa2f=_0x2032[_0x9b6c7c];return _0x26aa2f;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 0812d9d..9354cc3 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 _0x6a99=['undefined','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','name','password','role','blocked','blockedAt','online','admin','user','agent','domain','clearBlockUser','getLicense','catch','status','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/logger','activedirectory'];(function(_0xc26c95,_0xed8018){var _0x5626f6=function(_0x4dbc04){while(--_0x4dbc04){_0xc26c95['push'](_0xc26c95['shift']());}};_0x5626f6(++_0xed8018);}(_0x6a99,0x148));var _0x96a9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6a99[_0x20a584];return _0x4b41a8;};'use strict';var passport=require(_0x96a9('0x0'));var LocalStrategy=require(_0x96a9('0x1'))['Strategy'];var moment=require(_0x96a9('0x2'));var ActiveDirectory=require(_0x96a9('0x3'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x96a9('0x4'))['db'];var authService=require(_0x96a9('0x5'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x96a9('0x6'))('api');function isActiveDirectoryConfigured(_0xa8aa2){var _0x4b7fbf=![];if(typeof _0xa8aa2[_0x96a9('0x7')]!==_0x96a9('0x8')){_0x4b7fbf=_0xa8aa2[_0x96a9('0x7')]['baseDN']&&_0xa8aa2[_0x96a9('0x7')]['url']&&_0xa8aa2['activedirectory']['domain'];}return _0x4b7fbf;}function adAuthenticate(_0x4fb216,_0x1d856f,_0xf0fbc1){return new BPromise(function(_0x16f995,_0x4e7ba9){try{var _0x26c207=new ActiveDirectory(_0x4fb216);_0x26c207['authenticate'](_0x1d856f,_0xf0fbc1,function(_0x5a8ab6,_0x16000f){if(_0x5a8ab6){logger[_0x96a9('0x9')](_0x96a9('0xa'),_0x1d856f,util[_0x96a9('0xb')](_0x5a8ab6,{'showHidden':![],'depth':null}));_0x4e7ba9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x16000f){logger[_0x96a9('0x9')](_0x96a9('0xc'),_0x1d856f);_0x4e7ba9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x16f995(_0x16000f);}});}catch(_0x201b2d){_0x4e7ba9(_0x201b2d);}});}function ActiveDirectoryAuthenticate(_0x4417df,_0x24be2f,_0x57041e,_0x4db3d3){var _0x31843a,_0x4a5208;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x96a9('0xd'),_0x24be2f);return _0x4db3d3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x96a9('0xe')][_0x96a9('0xf')]({'where':{'id':0x1},'attributes':[_0x96a9('0x10'),_0x96a9('0x11')],'raw':!![]})[_0x96a9('0x12')](function(_0x1a7ac6){_0x31843a=_0x1a7ac6;if(!_0x31843a[_0x96a9('0x10')]){logger[_0x96a9('0x9')](_0x96a9('0x13'),_0x24be2f);throw new Error(_0x96a9('0x14'));}return _0x4417df['findOne']({'logging':!![],'attributes':['id',_0x96a9('0x15'),_0x96a9('0x16'),'salt',_0x96a9('0x17'),'disabled',_0x96a9('0x18'),_0x96a9('0x19'),_0x96a9('0x1a')],'where':{'name':_0x24be2f,'role':{'$or':[_0x96a9('0x1b'),_0x96a9('0x1c'),_0x96a9('0x1d')]},'adSsoEnabled':!![]}});})[_0x96a9('0x12')](function(_0x2b0d91){if(!_0x2b0d91||_0x2b0d91&&_0x2b0d91['name']!==_0x24be2f){throw new Error(_0x96a9('0x14'));}_0x4a5208=_0x2b0d91;var _0x51aa4b=_0x4a5208[_0x96a9('0x15')]+'@'+config[_0x96a9('0x7')][_0x96a9('0x1e')];return adAuthenticate(config[_0x96a9('0x7')],_0x51aa4b,_0x57041e);})[_0x96a9('0x12')](function(_0x191074){if(_0x4a5208['disabled']){throw new Error(_0x96a9('0x14'));}if(_0x31843a[_0x96a9('0x11')]>0x0){if(_0x4a5208[_0x96a9('0x18')]){if(moment(_0x4a5208[_0x96a9('0x19')])['add'](_0x31843a[_0x96a9('0x11')],'minutes')>moment()){throw new Error(_0x96a9('0x14'));}return utils[_0x96a9('0x1f')](_0x4a5208,0x0,![],null)[_0x96a9('0x12')](function(){return utils[_0x96a9('0x20')](_0x4a5208);})[_0x96a9('0x12')](function(){return _0x4db3d3(null,_0x4a5208);});}else{return utils['getLicense'](_0x4a5208)[_0x96a9('0x12')](function(){return _0x4db3d3(null,_0x4a5208);});}}else{return utils[_0x96a9('0x20')](_0x4a5208)[_0x96a9('0x12')](function(){return _0x4db3d3(null,_0x4a5208);});}})[_0x96a9('0x21')](function(_0x51d99d){return _0x4db3d3(null,![],_0x51d99d);});}function handleError(_0x120b79,_0x452cde,_0x16e0ec){return _0x120b79[_0x96a9('0x22')](_0x452cde||0x1f4)['send']({'message':_0x16e0ec?_0x16e0ec['message']||_0x16e0ec:''});}exports[_0x96a9('0x23')]=function(_0x210c82,_0x3b977f,_0x2b8ac3){passport[_0x96a9('0x24')](_0x96a9('0x25'),function(_0x387c99,_0x3d232f,_0x5b2dbc){var _0x39ad3f=_0x387c99||_0x5b2dbc;if(_0x39ad3f){return handleError(_0x3b977f,0x191,_0x39ad3f);}if(!_0x3d232f){return handleError(_0x3b977f,0x194,{'message':_0x96a9('0x26')});}else{var _0x66c693={'payload':{'id':_0x3d232f['id'],'role':_0x3d232f[_0x96a9('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0x96a9('0x27')](_0x66c693)[_0x96a9('0x12')](function(_0x14c13b){_0x3b977f['json']({'id':_0x3d232f['id'],'token':_0x14c13b,'statusCall':'','isAlreadyLogged':_0x3d232f['online']});});}})(_0x210c82,_0x3b977f,_0x2b8ac3);};passport[_0x96a9('0x28')](_0x96a9('0x25'),new LocalStrategy({'usernameField':_0x96a9('0x15'),'passwordField':'password'},function(_0x1c0319,_0x177dc,_0x6a98c0){return ActiveDirectoryAuthenticate(db[_0x96a9('0x29')],_0x1c0319,_0x177dc,_0x6a98c0);}));
\ No newline at end of file
+var _0x0e00=['Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','password','disabled','blocked','blockedAt','online','user','agent','name','domain','add','minutes','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','authenticate'];(function(_0x2f99ee,_0x31cf40){var _0x1e5c1a=function(_0xdde07b){while(--_0xdde07b){_0x2f99ee['push'](_0x2f99ee['shift']());}};_0x1e5c1a(++_0x31cf40);}(_0x0e00,0x1ca));var _0x00e0=function(_0x5bd20f,_0x51e22c){_0x5bd20f=_0x5bd20f-0x0;var _0x24c6b0=_0x0e00[_0x5bd20f];return _0x24c6b0;};'use strict';var passport=require(_0x00e0('0x0'));var LocalStrategy=require(_0x00e0('0x1'))[_0x00e0('0x2')];var moment=require(_0x00e0('0x3'));var ActiveDirectory=require(_0x00e0('0x4'));var BPromise=require(_0x00e0('0x5'));var util=require('util');var db=require(_0x00e0('0x6'))['db'];var authService=require(_0x00e0('0x7'));var utils=require('../../config/utils');var config=require(_0x00e0('0x8'));var logger=require(_0x00e0('0x9'))(_0x00e0('0xa'));function isActiveDirectoryConfigured(_0x44127a){var _0x487946=![];if(typeof _0x44127a[_0x00e0('0xb')]!=='undefined'){_0x487946=_0x44127a['activedirectory'][_0x00e0('0xc')]&&_0x44127a['activedirectory'][_0x00e0('0xd')]&&_0x44127a[_0x00e0('0xb')]['domain'];}return _0x487946;}function adAuthenticate(_0x4595ad,_0x24cc0d,_0x369b68){return new BPromise(function(_0x40b581,_0x5d94ae){try{var _0x1588ae=new ActiveDirectory(_0x4595ad);_0x1588ae[_0x00e0('0xe')](_0x24cc0d,_0x369b68,function(_0x1e20c6,_0x293581){if(_0x1e20c6){logger['error'](_0x00e0('0xf'),_0x24cc0d,util['inspect'](_0x1e20c6,{'showHidden':![],'depth':null}));_0x5d94ae(_0x00e0('0x10'));}else if(!_0x293581){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x24cc0d);_0x5d94ae(_0x00e0('0x10'));}else{_0x40b581(_0x293581);}});}catch(_0x453d35){_0x5d94ae(_0x453d35);}});}function ActiveDirectoryAuthenticate(_0x28df2d,_0x48222b,_0x3c6a61,_0x3d5325){var _0x44503d,_0x4bf6c5;if(!isActiveDirectoryConfigured(config)){logger[_0x00e0('0x11')](_0x00e0('0x12'),_0x48222b);return _0x3d5325(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x00e0('0x13')][_0x00e0('0x14')]({'where':{'id':0x1},'attributes':[_0x00e0('0x15'),_0x00e0('0x16')],'raw':!![]})[_0x00e0('0x17')](function(_0x5610cb){_0x44503d=_0x5610cb;if(!_0x44503d[_0x00e0('0x15')]){logger[_0x00e0('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x48222b);throw new Error(_0x00e0('0x10'));}return _0x28df2d['findOne']({'logging':!![],'attributes':['id','name',_0x00e0('0x18'),'salt','role',_0x00e0('0x19'),_0x00e0('0x1a'),_0x00e0('0x1b'),_0x00e0('0x1c')],'where':{'name':_0x48222b,'role':{'$or':['admin',_0x00e0('0x1d'),_0x00e0('0x1e')]},'adSsoEnabled':!![]}});})[_0x00e0('0x17')](function(_0x3653ca){if(!_0x3653ca||_0x3653ca&&_0x3653ca['name']!==_0x48222b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x4bf6c5=_0x3653ca;var _0x34def2=_0x4bf6c5[_0x00e0('0x1f')]+'@'+config[_0x00e0('0xb')][_0x00e0('0x20')];return adAuthenticate(config[_0x00e0('0xb')],_0x34def2,_0x3c6a61);})[_0x00e0('0x17')](function(_0x14b3a5){if(_0x4bf6c5[_0x00e0('0x19')]){throw new Error(_0x00e0('0x10'));}if(_0x44503d['blockDuration']>0x0){if(_0x4bf6c5[_0x00e0('0x1a')]){if(moment(_0x4bf6c5['blockedAt'])[_0x00e0('0x21')](_0x44503d['blockDuration'],_0x00e0('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x4bf6c5,0x0,![],null)[_0x00e0('0x17')](function(){return utils[_0x00e0('0x23')](_0x4bf6c5);})['then'](function(){return _0x3d5325(null,_0x4bf6c5);});}else{return utils[_0x00e0('0x23')](_0x4bf6c5)[_0x00e0('0x17')](function(){return _0x3d5325(null,_0x4bf6c5);});}}else{return utils[_0x00e0('0x23')](_0x4bf6c5)[_0x00e0('0x17')](function(){return _0x3d5325(null,_0x4bf6c5);});}})[_0x00e0('0x24')](function(_0x273c20){return _0x3d5325(null,![],_0x273c20);});}function handleError(_0x5825e6,_0xed78f2,_0x5b6ce9){return _0x5825e6[_0x00e0('0x25')](_0xed78f2||0x1f4)[_0x00e0('0x26')]({'message':_0x5b6ce9?_0x5b6ce9['message']||_0x5b6ce9:''});}exports[_0x00e0('0x27')]=function(_0x3063a7,_0x5cb968,_0x381d9f){passport['authenticate'](_0x00e0('0x28'),function(_0x3158f6,_0x290332,_0x61707a){var _0x424cce=_0x3158f6||_0x61707a;if(_0x424cce){return handleError(_0x5cb968,0x191,_0x424cce);}if(!_0x290332){return handleError(_0x5cb968,0x194,{'message':_0x00e0('0x29')});}else{var _0x1bdde2={'payload':{'id':_0x290332['id'],'role':_0x290332['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1bdde2)['then'](function(_0x3301c9){_0x5cb968['json']({'id':_0x290332['id'],'token':_0x3301c9,'statusCall':'','isAlreadyLogged':_0x290332['online']});});}})(_0x3063a7,_0x5cb968,_0x381d9f);};passport['use'](_0x00e0('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0x00e0('0x18')},function(_0x4fff50,_0x255c2e,_0x3aff47){return ActiveDirectoryAuthenticate(db[_0x00e0('0x2a')],_0x4fff50,_0x255c2e,_0x3aff47);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 5eca1dc..ab1b7a0 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 _0xcd5e=['login','exports','express','./authActiveDirectory.controller','post'];(function(_0x40df65,_0x317cec){var _0x3c0717=function(_0x128475){while(--_0x128475){_0x40df65['push'](_0x40df65['shift']());}};_0x3c0717(++_0x317cec);}(_0xcd5e,0xe8));var _0xecd5=function(_0xc33e1c,_0x52abd6){_0xc33e1c=_0xc33e1c-0x0;var _0x48a39d=_0xcd5e[_0xc33e1c];return _0x48a39d;};'use strict';var express=require(_0xecd5('0x0'));var router=express['Router']();var controller=require(_0xecd5('0x1'));router[_0xecd5('0x2')]('/',controller[_0xecd5('0x3')]);module[_0xecd5('0x4')]=router;
\ No newline at end of file
+var _0x1f7a=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x1f7a,0x114));var _0xa1f7=function(_0x34728b,_0x19fd7a){_0x34728b=_0x34728b-0x0;var _0x45ad5f=_0x1f7a[_0x34728b];return _0x45ad5f;};'use strict';var express=require(_0xa1f7('0x0'));var router=express[_0xa1f7('0x1')]();var controller=require(_0xa1f7('0x2'));router[_0xa1f7('0x3')]('/',controller[_0xa1f7('0x4')]);module[_0xa1f7('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index e42ea44..222efc0 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(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7a54,0x106));var _0x47a5=function(_0xbfb1ac,_0x5352e9){_0xbfb1ac=_0xbfb1ac-0x0;var _0x79e76d=_0x7a54[_0xbfb1ac];return _0x79e76d;};'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(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x7a54,0x106));var _0x47a5=function(_0x53ebc4,_0x1ea9a1){_0x53ebc4=_0x53ebc4-0x0;var _0x1886b3=_0x7a54[_0x53ebc4];return _0x1886b3;};'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 3627148..bcb7f38 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 _0xb7fb=['Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x319aee,_0x344705){var _0x596984=function(_0x277dad){while(--_0x277dad){_0x319aee['push'](_0x319aee['shift']());}};_0x596984(++_0x344705);}(_0xb7fb,0x76));var _0xbb7f=function(_0x485fc,_0x170c23){_0x485fc=_0x485fc-0x0;var _0x5ee62c=_0xb7fb[_0x485fc];return _0x5ee62c;};'use strict';var express=require(_0xbb7f('0x0'));var passport=require(_0xbb7f('0x1'));var router=express[_0xbb7f('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xbb7f('0x3'));var authService=require(_0xbb7f('0x4'));router[_0xbb7f('0x5')]('/',controller[_0xbb7f('0x6')]);router[_0xbb7f('0x5')](_0xbb7f('0x7'),controller[_0xbb7f('0x8')],authService[_0xbb7f('0x9')],userController[_0xbb7f('0x6')],authService[_0xbb7f('0xa')]);module[_0xbb7f('0xb')]=router;
\ No newline at end of file
+var _0xab8f=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express'];(function(_0x504dc3,_0x547139){var _0x2d352c=function(_0x3cb526){while(--_0x3cb526){_0x504dc3['push'](_0x504dc3['shift']());}};_0x2d352c(++_0x547139);}(_0xab8f,0x12b));var _0xfab8=function(_0x68363c,_0x2b20ff){_0x68363c=_0x68363c-0x0;var _0x4b9418=_0xab8f[_0x68363c];return _0x4b9418;};'use strict';var express=require(_0xfab8('0x0'));var passport=require(_0xfab8('0x1'));var router=express[_0xfab8('0x2')]();var controller=require(_0xfab8('0x3'));var userController=require(_0xfab8('0x4'));var authService=require(_0xfab8('0x5'));router[_0xfab8('0x6')]('/',controller[_0xfab8('0x7')]);router[_0xfab8('0x6')](_0xfab8('0x8'),controller[_0xfab8('0x9')],authService['isMiddleware'],userController[_0xfab8('0x7')],authService[_0xfab8('0xa')]);module[_0xfab8('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index b70e0a5..9bb85c6 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 _0x6403=['login','authenticate','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','send','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','password','status','Password\x20reset!','use','local-login','passport','passport-local','Strategy','lodash','randomstring','moment','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','salt','role','disabled','blockedAt','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blocked','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','format','SendMail','error','stringify','message'];(function(_0x2a8e5f,_0x317747){var _0x425b4a=function(_0x16b158){while(--_0x16b158){_0x2a8e5f['push'](_0x2a8e5f['shift']());}};_0x425b4a(++_0x317747);}(_0x6403,0x71));var _0x3640=function(_0x5c29ef,_0x4c73dd){_0x5c29ef=_0x5c29ef-0x0;var _0x2dad94=_0x6403[_0x5c29ef];return _0x2dad94;};'use strict';var util=require('util');var passport=require(_0x3640('0x0'));var LocalStrategy=require(_0x3640('0x1'))[_0x3640('0x2')];var jayson=require('jayson/promise');var _=require(_0x3640('0x3'));var rs=require(_0x3640('0x4'));var moment=require(_0x3640('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x3640('0x6'));var client=jayson[_0x3640('0x7')][_0x3640('0x8')]({'port':0x232b});function localAuthenticate(_0x466de0,_0x227068,_0x1c5509,_0x1d5726){var _0x2db085,_0x2042ae;return db[_0x3640('0x9')][_0x3640('0xa')]({'where':{'id':0x1},'attributes':[_0x3640('0xb'),_0x3640('0xc')],'raw':!![]})[_0x3640('0xd')](function(_0x2604db){_0x2db085=_0x2604db;return _0x466de0[_0x3640('0xa')]({'attributes':['id','name','password',_0x3640('0xe'),_0x3640('0xf'),_0x3640('0x10'),'blocked',_0x3640('0x11'),'loginAttempts'],'where':{'name':_0x227068,'role':{'$or':['admin',_0x3640('0x12'),_0x3640('0x13')]}}});})['then'](function(_0xa2a20d){if(!_0xa2a20d||_0xa2a20d&&_0xa2a20d[_0x3640('0x14')]!==_0x227068){throw new Error(_0x3640('0x15'));}else{_0x2042ae=_0xa2a20d;return _0x2042ae;}})[_0x3640('0xd')](function(){_0x2042ae['authenticate'](_0x1c5509,function(_0x3f03ba,_0x538f1b){var _0x57ce78=_0x2042ae[_0x3640('0x16')]+0x1;if(_0x3f03ba){return _0x1d5726(_0x3f03ba);}else if(!_0x538f1b){if(_0x2042ae['disabled']){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else if(_0x2db085['allowedLoginAttempts']>0x0){if(_0x2042ae[_0x3640('0x17')]){if(_0x2db085[_0x3640('0xc')]>0x0){if(moment(_0x2042ae[_0x3640('0x11')])[_0x3640('0x18')](_0x2db085[_0x3640('0xc')],'minutes')>moment()){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else{return utils[_0x3640('0x19')](_0x2042ae,_0x57ce78,![],null)[_0x3640('0xd')](function(){return _0x1d5726(null,![],{'message':_0x3640('0x15')});});}}else{return _0x1d5726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x57ce78>=_0x2db085[_0x3640('0xb')]){return utils[_0x3640('0x19')](_0x2042ae,0x0,!![],moment())[_0x3640('0xd')](function(){return _0x1d5726(null,![],{'message':_0x3640('0x15')});});}else{return utils[_0x3640('0x19')](_0x2042ae,_0x57ce78,![],null)['then'](function(){return _0x1d5726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1d5726(null,![],{'message':_0x3640('0x15')});}}else{if(_0x2042ae[_0x3640('0x10')]){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else if(_0x2db085[_0x3640('0xb')]>0x0){if(_0x2042ae['blocked']){if(_0x2db085[_0x3640('0xc')]>0x0){if(moment(_0x2042ae[_0x3640('0x11')])[_0x3640('0x18')](_0x2db085[_0x3640('0xc')],_0x3640('0x1a'))>moment()){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else{return utils[_0x3640('0x19')](_0x2042ae,0x0,![],null)[_0x3640('0xd')](function(){return utils[_0x3640('0x1b')](_0x2042ae);})['then'](function(){return _0x1d5726(null,_0x2042ae);});}}else{return _0x1d5726(null,![],{'message':_0x3640('0x15')});}}else{return utils[_0x3640('0x19')](_0x2042ae,0x0,![],null)[_0x3640('0xd')](function(){return utils[_0x3640('0x1b')](_0x2042ae);})[_0x3640('0xd')](function(){return _0x1d5726(null,_0x2042ae);})[_0x3640('0x1c')](function(_0x520c87){return _0x1d5726(null,![],_0x520c87);});}}else{if(_0x2042ae['blocked']){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else{return utils['getLicense'](_0x2042ae)[_0x3640('0xd')](function(){return _0x1d5726(null,_0x2042ae);});}}}});})[_0x3640('0x1c')](function(_0x1f307f){return _0x1d5726(null,![],_0x1f307f);});}function sendServiceMail(_0xfec7b9){return db[_0x3640('0x1d')][_0x3640('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x3640('0x14'),_0x3640('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x3640('0x20')}]})[_0x3640('0xd')](function(_0xa2de9a){if(!_0xa2de9a){throw new Error(_0x3640('0x21'));}var _0x476a46={'tls':{'rejectUnauthorized':![]}};if(_0xa2de9a[_0x3640('0x20')][_0x3640('0x22')]){_0x476a46[_0x3640('0x22')]=_0xa2de9a[_0x3640('0x20')]['service'];}else{_0x476a46['host']=_0xa2de9a[_0x3640('0x20')][_0x3640('0x23')];_0x476a46[_0x3640('0x24')]=_0xa2de9a[_0x3640('0x20')][_0x3640('0x24')];_0x476a46['secure']=_0xa2de9a[_0x3640('0x20')][_0x3640('0x25')];}if(_0xa2de9a['Smtp'][_0x3640('0x26')]){_0x476a46['auth']={'user':_0xa2de9a[_0x3640('0x20')][_0x3640('0x12')],'pass':_0xa2de9a['Smtp'][_0x3640('0x27')]};}var _0x355d68={'account':_0x476a46,'message':_['merge']({'from':util[_0x3640('0x28')]('\x22%s\x22\x20<%s>',_0xa2de9a[_0x3640('0x14')],_0xa2de9a[_0x3640('0x1f')]||_0xa2de9a[_0x3640('0x20')][_0x3640('0x12')])},_0xfec7b9)};return client['request'](_0x3640('0x29'),_0x355d68);})[_0x3640('0xd')](function(_0x90cf36){if(_0x90cf36[_0x3640('0x2a')]){throw new Error(util[_0x3640('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x90cf36[_0x3640('0x2a')]['message']||JSON[_0x3640('0x2b')](_0x90cf36['error'])));}return!![];});}function handleError(_0x4fdf56,_0x1ba96d,_0x2b975f){return _0x4fdf56['status'](_0x1ba96d||0x1f4)['send']({'message':_0x2b975f?_0x2b975f[_0x3640('0x2c')]||_0x2b975f:''});}exports[_0x3640('0x2d')]=function(_0x19bf95,_0x52ede4,_0x47c897){passport[_0x3640('0x2e')]('local-login',function(_0x5bc006,_0x479705,_0x42e1a2){var _0x2d6418=_0x5bc006||_0x42e1a2;if(_0x2d6418){return handleError(_0x52ede4,0x191,_0x2d6418);}if(!_0x479705){return handleError(_0x52ede4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4a2368={'payload':{'id':_0x479705['id'],'role':_0x479705[_0x3640('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4a2368)['then'](function(_0x489f3d){_0x52ede4['json']({'id':_0x479705['id'],'token':_0x489f3d,'statusCall':'','isAlreadyLogged':_0x479705['online']});});}})(_0x19bf95,_0x52ede4,_0x47c897);};exports['forgot']=function(_0x292fdf,_0x275652,_0x5a76f9){if(!_0x292fdf[_0x3640('0x2f')]['email']){return handleError(_0x275652,0x1f4,{'message':_0x3640('0x30')});}var _0x19bb22=rs['generate']();_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')]=_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')][_0x3640('0x31')]()[_0x3640('0x32')]();var _0x494e99;return db[_0x3640('0x9')][_0x3640('0xa')]({'where':{'id':0x1},'attributes':[_0x3640('0xb'),_0x3640('0xc')],'raw':!![]})[_0x3640('0xd')](function(_0xdace8e){_0x494e99=_0xdace8e;return db[_0x3640('0x33')][_0x3640('0x1e')]({'where':{'email':_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')]}});})[_0x3640('0xd')](function(_0xb26788){if(!_0xb26788){throw new Error(_0x3640('0x34'));}if(_0xb26788[_0x3640('0x10')]){throw new Error(_0x3640('0x35'));}if(_0xb26788[_0x3640('0x17')]){if(moment(_0xb26788[_0x3640('0x11')])['add'](_0x494e99['blockDuration'],_0x3640('0x1a'))>moment()){throw new Error(_0x3640('0x36'));}else{_0xb26788[_0x3640('0x17')]=![];_0xb26788['blockedAt']=null;}}_0xb26788[_0x3640('0x37')]=_0x19bb22;_0xb26788[_0x3640('0x38')]=Date[_0x3640('0x39')]()+0x36ee80;return _0xb26788[_0x3640('0x3a')]();})['then'](function(){return sendServiceMail({'to':_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')],'subject':_0x3640('0x3b'),'text':_0x3640('0x3c')+_0x3640('0x3d')+_0x3640('0x3e')+_0x292fdf['headers']['host']+_0x3640('0x3f')+_0x19bb22+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x275652['status'](0xc8)[_0x3640('0x40')]({'message':_0x3640('0x41')});})['catch'](function(_0x539acd){return handleError(_0x275652,0x1f4,_0x539acd);});};exports[_0x3640('0x42')]=function(_0x48be2e,_0x43ff2d,_0xd708e0){return db[_0x3640('0x33')][_0x3640('0x1e')]({'where':{'resetPasswordToken':_0x48be2e[_0x3640('0x43')][_0x3640('0x44')],'resetPasswordExpires':{'$gt':Date[_0x3640('0x39')]()}}})[_0x3640('0xd')](function(_0x3e1a71){if(!_0x3e1a71){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3640('0x9')][_0x3640('0xa')]({'attributes':['id',_0x3640('0x45'),_0x3640('0x46'),_0x3640('0x47')]})[_0x3640('0xd')](function(_0x157b9f){if(_0x157b9f[_0x3640('0x45')])authService[_0x3640('0x48')](_0x48be2e[_0x3640('0x2f')]['password']);if(!_0x157b9f[_0x3640('0x46')]||!_0x3e1a71[_0x3640('0x49')])return _0x3e1a71;authService['validatePasswordHistory'](_0x48be2e[_0x3640('0x2f')][_0x3640('0x4a')],_0x3e1a71[_0x3640('0x49')],_0x157b9f['passwordHistoryLimit']);return _0x3e1a71;})['then'](function(){_0x3e1a71[_0x3640('0x4a')]=_0x48be2e[_0x3640('0x2f')][_0x3640('0x4a')];_0x3e1a71[_0x3640('0x37')]=null;_0x3e1a71[_0x3640('0x38')]=null;return _0x3e1a71[_0x3640('0x3a')]();});})['then'](function(){_0x43ff2d[_0x3640('0x4b')](0xc8)[_0x3640('0x40')]({'message':_0x3640('0x4c')});})[_0x3640('0x1c')](function(_0x109c31){return handleError(_0x43ff2d,0x1f4,_0x109c31);});};passport[_0x3640('0x4d')](_0x3640('0x4e'),new LocalStrategy({'usernameField':_0x3640('0x14'),'passwordField':'password'},function(_0x5e3418,_0x3f7ef0,_0x2ac1bc){return localAuthenticate(db[_0x3640('0x33')],_0x5e3418,_0x3f7ef0,_0x2ac1bc);}));
\ No newline at end of file
+var _0x1bac=['http','Setting','findOne','blockDuration','name','salt','blocked','blockedAt','loginAttempts','admin','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','allowedLoginAttempts','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','authentication','auth','pass','merge','format','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','body','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordToken','use','util','passport','passport-local','Strategy','randomstring','../../mysqldb','../../components/auth/service','client'];(function(_0x5e0ce6,_0x2fa775){var _0x1393e1=function(_0x54ae0a){while(--_0x54ae0a){_0x5e0ce6['push'](_0x5e0ce6['shift']());}};_0x1393e1(++_0x2fa775);}(_0x1bac,0xfa));var _0xc1ba=function(_0x1f28e4,_0x2b41ae){_0x1f28e4=_0x1f28e4-0x0;var _0x3e5acd=_0x1bac[_0x1f28e4];return _0x3e5acd;};'use strict';var util=require(_0xc1ba('0x0'));var passport=require(_0xc1ba('0x1'));var LocalStrategy=require(_0xc1ba('0x2'))[_0xc1ba('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xc1ba('0x4'));var moment=require('moment');var db=require(_0xc1ba('0x5'))['db'];var authService=require(_0xc1ba('0x6'));var utils=require('../../config/utils');var client=jayson[_0xc1ba('0x7')][_0xc1ba('0x8')]({'port':0x232b});function localAuthenticate(_0x3327b2,_0x1a2b8d,_0x5aaa96,_0x1cd076){var _0x16f361,_0x330ceb;return db[_0xc1ba('0x9')][_0xc1ba('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc1ba('0xb')],'raw':!![]})['then'](function(_0x198d84){_0x16f361=_0x198d84;return _0x3327b2[_0xc1ba('0xa')]({'attributes':['id',_0xc1ba('0xc'),'password',_0xc1ba('0xd'),'role','disabled',_0xc1ba('0xe'),_0xc1ba('0xf'),_0xc1ba('0x10')],'where':{'name':_0x1a2b8d,'role':{'$or':[_0xc1ba('0x11'),'user','agent']}}});})[_0xc1ba('0x12')](function(_0x538d77){if(!_0x538d77||_0x538d77&&_0x538d77[_0xc1ba('0xc')]!==_0x1a2b8d){throw new Error(_0xc1ba('0x13'));}else{_0x330ceb=_0x538d77;return _0x330ceb;}})['then'](function(){_0x330ceb['authenticate'](_0x5aaa96,function(_0x82eaa5,_0x3c382b){var _0x58a014=_0x330ceb[_0xc1ba('0x10')]+0x1;if(_0x82eaa5){return _0x1cd076(_0x82eaa5);}else if(!_0x3c382b){if(_0x330ceb[_0xc1ba('0x14')]){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}else if(_0x16f361[_0xc1ba('0x15')]>0x0){if(_0x330ceb['blocked']){if(_0x16f361['blockDuration']>0x0){if(moment(_0x330ceb[_0xc1ba('0xf')])['add'](_0x16f361['blockDuration'],_0xc1ba('0x16'))>moment()){return _0x1cd076(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x330ceb,_0x58a014,![],null)[_0xc1ba('0x12')](function(){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});});}}else{return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}}else{if(_0x58a014>=_0x16f361[_0xc1ba('0x15')]){return utils[_0xc1ba('0x17')](_0x330ceb,0x0,!![],moment())[_0xc1ba('0x12')](function(){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});});}else{return utils['clearBlockUser'](_0x330ceb,_0x58a014,![],null)[_0xc1ba('0x12')](function(){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});});}}}else{return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}}else{if(_0x330ceb[_0xc1ba('0x14')]){return _0x1cd076(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x16f361[_0xc1ba('0x15')]>0x0){if(_0x330ceb[_0xc1ba('0xe')]){if(_0x16f361[_0xc1ba('0xb')]>0x0){if(moment(_0x330ceb[_0xc1ba('0xf')])['add'](_0x16f361['blockDuration'],_0xc1ba('0x16'))>moment()){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}else{return utils[_0xc1ba('0x17')](_0x330ceb,0x0,![],null)[_0xc1ba('0x12')](function(){return utils[_0xc1ba('0x18')](_0x330ceb);})[_0xc1ba('0x12')](function(){return _0x1cd076(null,_0x330ceb);});}}else{return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}}else{return utils[_0xc1ba('0x17')](_0x330ceb,0x0,![],null)[_0xc1ba('0x12')](function(){return utils[_0xc1ba('0x18')](_0x330ceb);})[_0xc1ba('0x12')](function(){return _0x1cd076(null,_0x330ceb);})[_0xc1ba('0x19')](function(_0xbc27b9){return _0x1cd076(null,![],_0xbc27b9);});}}else{if(_0x330ceb[_0xc1ba('0xe')]){return _0x1cd076(null,![],{'message':_0xc1ba('0x13')});}else{return utils[_0xc1ba('0x18')](_0x330ceb)['then'](function(){return _0x1cd076(null,_0x330ceb);});}}}});})['catch'](function(_0x1b7044){return _0x1cd076(null,![],_0x1b7044);});}function sendServiceMail(_0x109b32){return db[_0xc1ba('0x1a')][_0xc1ba('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xc1ba('0xc'),_0xc1ba('0x1c')],'include':[{'model':db[_0xc1ba('0x1d')],'as':_0xc1ba('0x1e')}]})[_0xc1ba('0x12')](function(_0x4b2c6c){if(!_0x4b2c6c){throw new Error(_0xc1ba('0x1f'));}var _0xf9e497={'tls':{'rejectUnauthorized':![]}};if(_0x4b2c6c[_0xc1ba('0x1e')][_0xc1ba('0x20')]){_0xf9e497['service']=_0x4b2c6c[_0xc1ba('0x1e')]['service'];}else{_0xf9e497['host']=_0x4b2c6c['Smtp'][_0xc1ba('0x21')];_0xf9e497[_0xc1ba('0x22')]=_0x4b2c6c[_0xc1ba('0x1e')][_0xc1ba('0x22')];_0xf9e497['secure']=_0x4b2c6c['Smtp']['secure'];}if(_0x4b2c6c[_0xc1ba('0x1e')][_0xc1ba('0x23')]){_0xf9e497[_0xc1ba('0x24')]={'user':_0x4b2c6c[_0xc1ba('0x1e')]['user'],'pass':_0x4b2c6c['Smtp'][_0xc1ba('0x25')]};}var _0x219276={'account':_0xf9e497,'message':_[_0xc1ba('0x26')]({'from':util[_0xc1ba('0x27')]('\x22%s\x22\x20<%s>',_0x4b2c6c['name'],_0x4b2c6c['email']||_0x4b2c6c['Smtp'][_0xc1ba('0x28')])},_0x109b32)};return client[_0xc1ba('0x29')](_0xc1ba('0x2a'),_0x219276);})[_0xc1ba('0x12')](function(_0x1ad3d5){if(_0x1ad3d5[_0xc1ba('0x2b')]){throw new Error(util[_0xc1ba('0x27')](_0xc1ba('0x2c'),_0x1ad3d5[_0xc1ba('0x2b')]['message']||JSON[_0xc1ba('0x2d')](_0x1ad3d5[_0xc1ba('0x2b')])));}return!![];});}function handleError(_0x4f459b,_0x3e6945,_0x2897d1){return _0x4f459b[_0xc1ba('0x2e')](_0x3e6945||0x1f4)[_0xc1ba('0x2f')]({'message':_0x2897d1?_0x2897d1[_0xc1ba('0x30')]||_0x2897d1:''});}exports[_0xc1ba('0x31')]=function(_0x270122,_0x591bec,_0x2d0bbe){passport[_0xc1ba('0x32')](_0xc1ba('0x33'),function(_0x496a40,_0x4bdee9,_0x3ea7d0){var _0x2195b2=_0x496a40||_0x3ea7d0;if(_0x2195b2){return handleError(_0x591bec,0x191,_0x2195b2);}if(!_0x4bdee9){return handleError(_0x591bec,0x194,{'message':_0xc1ba('0x34')});}else{var _0x29ea78={'payload':{'id':_0x4bdee9['id'],'role':_0x4bdee9[_0xc1ba('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0xc1ba('0x36')](_0x29ea78)[_0xc1ba('0x12')](function(_0x46bc75){_0x591bec[_0xc1ba('0x37')]({'id':_0x4bdee9['id'],'token':_0x46bc75,'statusCall':'','isAlreadyLogged':_0x4bdee9[_0xc1ba('0x38')]});});}})(_0x270122,_0x591bec,_0x2d0bbe);};exports[_0xc1ba('0x39')]=function(_0x589704,_0x4c5e58,_0x59745d){if(!_0x589704['body'][_0xc1ba('0x1c')]){return handleError(_0x4c5e58,0x1f4,{'message':_0xc1ba('0x3a')});}var _0x18ae38=rs['generate']();_0x589704[_0xc1ba('0x3b')][_0xc1ba('0x1c')]=_0x589704['body'][_0xc1ba('0x1c')]['trim']()[_0xc1ba('0x3c')]();var _0x4be9f8;return db[_0xc1ba('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc1ba('0xb')],'raw':!![]})[_0xc1ba('0x12')](function(_0x3d408c){_0x4be9f8=_0x3d408c;return db[_0xc1ba('0x3d')]['find']({'where':{'email':_0x589704[_0xc1ba('0x3b')][_0xc1ba('0x1c')]}});})[_0xc1ba('0x12')](function(_0x170e34){if(!_0x170e34){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x170e34[_0xc1ba('0x14')]){throw new Error(_0xc1ba('0x3e'));}if(_0x170e34[_0xc1ba('0xe')]){if(moment(_0x170e34[_0xc1ba('0xf')])[_0xc1ba('0x3f')](_0x4be9f8[_0xc1ba('0xb')],_0xc1ba('0x16'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x170e34[_0xc1ba('0xe')]=![];_0x170e34[_0xc1ba('0xf')]=null;}}_0x170e34['resetPasswordToken']=_0x18ae38;_0x170e34[_0xc1ba('0x40')]=Date[_0xc1ba('0x41')]()+0x36ee80;return _0x170e34['save']();})[_0xc1ba('0x12')](function(){return sendServiceMail({'to':_0x589704[_0xc1ba('0x3b')][_0xc1ba('0x1c')],'subject':_0xc1ba('0x42'),'text':_0xc1ba('0x43')+_0xc1ba('0x44')+_0xc1ba('0x45')+_0x589704[_0xc1ba('0x46')][_0xc1ba('0x21')]+'/reset/'+_0x18ae38+'\x0a\x0a'+_0xc1ba('0x47')});})[_0xc1ba('0x12')](function(){_0x4c5e58[_0xc1ba('0x2e')](0xc8)[_0xc1ba('0x2f')]({'message':_0xc1ba('0x48')});})['catch'](function(_0x198984){return handleError(_0x4c5e58,0x1f4,_0x198984);});};exports[_0xc1ba('0x49')]=function(_0x671f,_0x402c64,_0x2b6008){return db[_0xc1ba('0x3d')][_0xc1ba('0x1b')]({'where':{'resetPasswordToken':_0x671f[_0xc1ba('0x4a')][_0xc1ba('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xc1ba('0x41')]()}}})[_0xc1ba('0x12')](function(_0x24f9e5){if(!_0x24f9e5){throw new Error(_0xc1ba('0x4c'));}return db[_0xc1ba('0x9')][_0xc1ba('0xa')]({'attributes':['id',_0xc1ba('0x4d'),'enforcePasswordHistory',_0xc1ba('0x4e')]})[_0xc1ba('0x12')](function(_0x252265){if(_0x252265['securePassword'])authService[_0xc1ba('0x4f')](_0x671f[_0xc1ba('0x3b')][_0xc1ba('0x50')]);if(!_0x252265[_0xc1ba('0x51')]||!_0x24f9e5[_0xc1ba('0x52')])return _0x24f9e5;authService[_0xc1ba('0x53')](_0x671f[_0xc1ba('0x3b')][_0xc1ba('0x50')],_0x24f9e5[_0xc1ba('0x52')],_0x252265['passwordHistoryLimit']);return _0x24f9e5;})['then'](function(){_0x24f9e5[_0xc1ba('0x50')]=_0x671f[_0xc1ba('0x3b')]['password'];_0x24f9e5[_0xc1ba('0x54')]=null;_0x24f9e5[_0xc1ba('0x40')]=null;return _0x24f9e5['save']();});})[_0xc1ba('0x12')](function(){_0x402c64[_0xc1ba('0x2e')](0xc8)[_0xc1ba('0x2f')]({'message':'Password\x20reset!'});})[_0xc1ba('0x19')](function(_0x1a1ada){return handleError(_0x402c64,0x1f4,_0x1a1ada);});};passport[_0xc1ba('0x55')](_0xc1ba('0x33'),new LocalStrategy({'usernameField':_0xc1ba('0xc'),'passwordField':_0xc1ba('0x50')},function(_0x55cf55,_0x56abaf,_0x271d4a){return localAuthenticate(db[_0xc1ba('0x3d')],_0x55cf55,_0x56abaf,_0x271d4a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 9d0e615..a328f9c 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 _0xeba4=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x30f73d,_0x5387af){var _0x20b23d=function(_0x387c1b){while(--_0x387c1b){_0x30f73d['push'](_0x30f73d['shift']());}};_0x20b23d(++_0x5387af);}(_0xeba4,0xc0));var _0x4eba=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xeba4[_0x3fba9f];return _0x192cf1;};'use strict';var express=require(_0x4eba('0x0'));var router=express[_0x4eba('0x1')]();var controller=require(_0x4eba('0x2'));router[_0x4eba('0x3')]('/',controller[_0x4eba('0x4')]);router['post']('/forgot',controller[_0x4eba('0x5')]);router[_0x4eba('0x3')](_0x4eba('0x6'),controller[_0x4eba('0x7')]);module[_0x4eba('0x8')]=router;
\ No newline at end of file
+var _0x4312=['./authLocal.controller','post','login','/forgot','/reset/:token','exports','express','Router'];(function(_0x230aed,_0x35cddd){var _0x2a98a6=function(_0x5e0f07){while(--_0x5e0f07){_0x230aed['push'](_0x230aed['shift']());}};_0x2a98a6(++_0x35cddd);}(_0x4312,0x9e));var _0x2431=function(_0x178f3e,_0x567056){_0x178f3e=_0x178f3e-0x0;var _0x2c73ab=_0x4312[_0x178f3e];return _0x2c73ab;};'use strict';var express=require(_0x2431('0x0'));var router=express[_0x2431('0x1')]();var controller=require(_0x2431('0x2'));router[_0x2431('0x3')]('/',controller[_0x2431('0x4')]);router[_0x2431('0x3')](_0x2431('0x5'),controller['forgot']);router[_0x2431('0x3')](_0x2431('0x6'),controller['reset']);module[_0x2431('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 0621020..7a77bce 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 _0xa9c0=['INTEGER','sequelize','exports','STRING'];(function(_0x5ca79e,_0x185d0e){var _0x8d5177=function(_0x19f16c){while(--_0x19f16c){_0x5ca79e['push'](_0x5ca79e['shift']());}};_0x8d5177(++_0x185d0e);}(_0xa9c0,0x1a9));var _0x0a9c=function(_0x9e1f67,_0x1d30c1){_0x9e1f67=_0x9e1f67-0x0;var _0x8a177d=_0xa9c0[_0x9e1f67];return _0x8a177d;};'use strict';var Sequelize=require(_0x0a9c('0x0'));module[_0x0a9c('0x1')]={'name':{'type':Sequelize[_0x0a9c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0a9c('0x2')]},'description':{'type':Sequelize[_0x0a9c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0a9c('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa550=['sequelize','exports','STRING','INTEGER'];(function(_0x21a1a6,_0x1474bf){var _0x5cec0e=function(_0x13abb9){while(--_0x13abb9){_0x21a1a6['push'](_0x21a1a6['shift']());}};_0x5cec0e(++_0x1474bf);}(_0xa550,0x1a4));var _0x0a55=function(_0x2d31b8,_0x242597){_0x2d31b8=_0x2d31b8-0x0;var _0x547be0=_0xa550[_0x2d31b8];return _0x547be0;};'use strict';var Sequelize=require(_0x0a55('0x0'));module[_0x0a55('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x0a55('0x2')]},'description':{'type':Sequelize[_0x0a55('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0a55('0x3')],'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 d7acc8a..9ed7428 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 _0xcd70=['end','error','name','send','index','map','Automation','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','then','rows','catch','params','find','create','body','omit','ids','getConditions','findOne','Condition','rawAttributes','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy'];(function(_0x57104f,_0x15879c){var _0x234152=function(_0x4b0a79){while(--_0x4b0a79){_0x57104f['push'](_0x57104f['shift']());}};_0x234152(++_0x15879c);}(_0xcd70,0x1c2));var _0x0cd7=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xcd70[_0x817d9b];return _0x2752e1;};'use strict';var emlformat=require(_0x0cd7('0x0'));var rimraf=require(_0x0cd7('0x1'));var zipdir=require(_0x0cd7('0x2'));var jsonpatch=require(_0x0cd7('0x3'));var rp=require(_0x0cd7('0x4'));var moment=require(_0x0cd7('0x5'));var BPromise=require(_0x0cd7('0x6'));var Mustache=require(_0x0cd7('0x7'));var util=require(_0x0cd7('0x8'));var path=require(_0x0cd7('0x9'));var sox=require(_0x0cd7('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cd7('0xb'));var _=require(_0x0cd7('0xc'));var squel=require(_0x0cd7('0xd'));var crypto=require(_0x0cd7('0xe'));var jsforce=require(_0x0cd7('0xf'));var deskjs=require(_0x0cd7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0cd7('0x11'));var Redis=require(_0x0cd7('0x12'));var authService=require(_0x0cd7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0cd7('0x14'));var hardwareService=require(_0x0cd7('0x15'));var logger=require(_0x0cd7('0x16'))('api');var utils=require(_0x0cd7('0x17'));var config=require(_0x0cd7('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e4019,_0x440a9e){_0x440a9e=_0x440a9e||0xcc;return function(_0x73d96b){if(_0x73d96b){return _0x1e4019[_0x0cd7('0x19')](_0x440a9e);}return _0x1e4019[_0x0cd7('0x1a')](_0x440a9e)['end']();};}function respondWithResult(_0x5319e9,_0x5d7ee0){_0x5d7ee0=_0x5d7ee0||0xc8;return function(_0x1a63b8){if(_0x1a63b8){return _0x5319e9[_0x0cd7('0x1a')](_0x5d7ee0)[_0x0cd7('0x1b')](_0x1a63b8);}};}function respondWithFilteredResult(_0x22c3fe,_0x2207c5){return function(_0x19834f){if(_0x19834f){var _0x2c0698=typeof _0x2207c5[_0x0cd7('0x1c')]===_0x0cd7('0x1d')&&typeof _0x2207c5[_0x0cd7('0x1e')]==='undefined';var _0xacb65e=_0x19834f['count'];var _0x526141=_0x2c0698?0x0:_0x2207c5['offset'];var _0x3c69e0=_0x2c0698?_0x19834f[_0x0cd7('0x1f')]:_0x2207c5[_0x0cd7('0x1c')]+_0x2207c5['limit'];var _0x3e1e06;if(_0x3c69e0>=_0xacb65e){_0x3c69e0=_0xacb65e;_0x3e1e06=0xc8;}else{_0x3e1e06=0xce;}_0x22c3fe[_0x0cd7('0x1a')](_0x3e1e06);return _0x22c3fe[_0x0cd7('0x20')](_0x0cd7('0x21'),_0x526141+'-'+_0x3c69e0+'/'+_0xacb65e)['json'](_0x19834f);}return null;};}function patchUpdates(_0x23a2d0){return function(_0x4c5db4){try{jsonpatch['apply'](_0x4c5db4,_0x23a2d0,!![]);}catch(_0x4e91c0){return BPromise['reject'](_0x4e91c0);}return _0x4c5db4['save']();};}function saveUpdates(_0x2b0e11,_0x4138eb){return function(_0x30942a){if(_0x30942a){return _0x30942a[_0x0cd7('0x22')](_0x2b0e11)['then'](function(_0x3c3d6a){return _0x3c3d6a;});}return null;};}function removeEntity(_0x59de24,_0x16881d){return function(_0x2fc374){if(_0x2fc374){return _0x2fc374[_0x0cd7('0x23')]()['then'](function(){_0x59de24[_0x0cd7('0x1a')](0xcc)[_0x0cd7('0x24')]();});}};}function handleEntityNotFound(_0x4728c7,_0x235eee){return function(_0x1d6f8c){if(!_0x1d6f8c){_0x4728c7['sendStatus'](0x194);}return _0x1d6f8c;};}function handleError(_0x39f79e,_0x285f79){_0x285f79=_0x285f79||0x1f4;return function(_0x350f23){logger[_0x0cd7('0x25')](_0x350f23['stack']);if(_0x350f23['name']){delete _0x350f23[_0x0cd7('0x26')];}_0x39f79e[_0x0cd7('0x1a')](_0x285f79)[_0x0cd7('0x27')](_0x350f23);};}exports[_0x0cd7('0x28')]=function(_0x325717,_0x1d81ca){var _0x65fea0={},_0x2da9e2={},_0x3219aa={'count':0x0,'rows':[]};var _0x57d59a=_[_0x0cd7('0x29')](db[_0x0cd7('0x2a')]['rawAttributes'],function(_0x4e61dc){return{'name':_0x4e61dc[_0x0cd7('0x2b')],'type':_0x4e61dc[_0x0cd7('0x2c')]['key']};});_0x2da9e2[_0x0cd7('0x2d')]=_[_0x0cd7('0x29')](_0x57d59a,_0x0cd7('0x26'));_0x2da9e2[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x325717[_0x0cd7('0x2e')]);_0x2da9e2[_0x0cd7('0x30')]=_['intersection'](_0x2da9e2[_0x0cd7('0x2d')],_0x2da9e2[_0x0cd7('0x2e')]);_0x65fea0[_0x0cd7('0x31')]=_[_0x0cd7('0x32')](_0x2da9e2[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x325717[_0x0cd7('0x2e')]['fields']));_0x65fea0[_0x0cd7('0x31')]=_0x65fea0[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x65fea0['attributes']:_0x2da9e2[_0x0cd7('0x2d')];if(!_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x35')](_0x0cd7('0x36'))){_0x65fea0['limit']=qs['limit'](_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x1e')]);_0x65fea0[_0x0cd7('0x1c')]=qs[_0x0cd7('0x1c')](_0x325717['query']['offset']);}_0x65fea0[_0x0cd7('0x37')]=qs[_0x0cd7('0x38')](_0x325717['query']['sort']);_0x65fea0[_0x0cd7('0x39')]=qs[_0x0cd7('0x30')](_[_0x0cd7('0x3a')](_0x325717['query'],_0x2da9e2['filters']),_0x57d59a);if(_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x3b')]){_0x65fea0['where']=_[_0x0cd7('0x3c')](_0x65fea0[_0x0cd7('0x39')],{'$or':_['map'](_0x57d59a,function(_0x2a43df){if(_0x2a43df['type']!==_0x0cd7('0x3d')){var _0x133b9d={};_0x133b9d[_0x2a43df[_0x0cd7('0x26')]]={'$like':'%'+_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x3b')]+'%'};return _0x133b9d;}})});}_0x65fea0=_['merge']({},_0x65fea0,_0x325717[_0x0cd7('0x3e')]);var _0x2a355f={'where':_0x65fea0[_0x0cd7('0x39')]};return db['Automation']['count'](_0x2a355f)['then'](function(_0x3b61be){_0x3219aa[_0x0cd7('0x1f')]=_0x3b61be;if(_0x325717['query'][_0x0cd7('0x3f')]){_0x65fea0[_0x0cd7('0x40')]=[{'all':!![]}];}return db[_0x0cd7('0x2a')]['findAll'](_0x65fea0);})[_0x0cd7('0x41')](function(_0x41b826){_0x3219aa[_0x0cd7('0x42')]=_0x41b826;return _0x3219aa;})['then'](respondWithFilteredResult(_0x1d81ca,_0x65fea0))[_0x0cd7('0x43')](handleError(_0x1d81ca,null));};exports['show']=function(_0x4b6334,_0x58c6f3){var _0x3f4a86={'raw':![],'where':{'id':_0x4b6334[_0x0cd7('0x44')]['id']}},_0x3dc960={};_0x3dc960[_0x0cd7('0x2d')]=_[_0x0cd7('0x2f')](db[_0x0cd7('0x2a')]['rawAttributes']);_0x3dc960[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x4b6334[_0x0cd7('0x2e')]);_0x3dc960[_0x0cd7('0x30')]=_['intersection'](_0x3dc960[_0x0cd7('0x2d')],_0x3dc960[_0x0cd7('0x2e')]);_0x3f4a86[_0x0cd7('0x31')]=_['intersection'](_0x3dc960[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x4b6334[_0x0cd7('0x2e')]['fields']));_0x3f4a86['attributes']=_0x3f4a86[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x3f4a86['attributes']:_0x3dc960[_0x0cd7('0x2d')];if(_0x4b6334[_0x0cd7('0x2e')][_0x0cd7('0x3f')]){_0x3f4a86[_0x0cd7('0x40')]=[{'all':!![]}];}_0x3f4a86=_[_0x0cd7('0x3c')]({},_0x3f4a86,_0x4b6334['options']);return db[_0x0cd7('0x2a')][_0x0cd7('0x45')](_0x3f4a86)[_0x0cd7('0x41')](handleEntityNotFound(_0x58c6f3,null))[_0x0cd7('0x41')](respondWithResult(_0x58c6f3,null))[_0x0cd7('0x43')](handleError(_0x58c6f3,null));};exports[_0x0cd7('0x46')]=function(_0x13b9a6,_0x5a337a){return db[_0x0cd7('0x2a')][_0x0cd7('0x46')](_0x13b9a6[_0x0cd7('0x47')],{})['then'](respondWithResult(_0x5a337a,0xc9))[_0x0cd7('0x43')](handleError(_0x5a337a,null));};exports[_0x0cd7('0x22')]=function(_0x8e81cc,_0x5b6b63){if(_0x8e81cc['body']['id']){delete _0x8e81cc['body']['id'];}return db[_0x0cd7('0x2a')][_0x0cd7('0x45')]({'where':{'id':_0x8e81cc['params']['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x5b6b63,null))[_0x0cd7('0x41')](saveUpdates(_0x8e81cc[_0x0cd7('0x47')],null))[_0x0cd7('0x41')](respondWithResult(_0x5b6b63,null))['catch'](handleError(_0x5b6b63,null));};exports['destroy']=function(_0x35eaa9,_0x26e05e){return db[_0x0cd7('0x2a')][_0x0cd7('0x45')]({'where':{'id':_0x35eaa9[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x26e05e,null))[_0x0cd7('0x41')](removeEntity(_0x26e05e,null))['catch'](handleError(_0x26e05e,null));};exports['addConditions']=function(_0x2646d4,_0xea5dec,_0x303c94){return db['Condition'][_0x0cd7('0x45')]({'where':{'id':_0x2646d4[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0xea5dec,null))[_0x0cd7('0x41')](function(_0x13902d){if(_0x13902d){return _0x13902d['addConditions'](_0x2646d4['body']['ids'],_[_0x0cd7('0x48')](_0x2646d4[_0x0cd7('0x47')],[_0x0cd7('0x49'),'id'])||{});}})[_0x0cd7('0x41')](respondWithResult(_0xea5dec,null))['catch'](handleError(_0xea5dec,null));};exports[_0x0cd7('0x4a')]=function(_0x3683a7,_0x47d2bb,_0x407dcb){var _0x402c7c={};var _0x3b8665={};var _0x1bcec6;var _0x2823da;return db['Automation'][_0x0cd7('0x4b')]({'where':{'id':_0x3683a7[_0x0cd7('0x44')]['id']}})['then'](handleEntityNotFound(_0x47d2bb,null))[_0x0cd7('0x41')](function(_0x26138a){if(_0x26138a){_0x1bcec6=_0x26138a;_0x3b8665[_0x0cd7('0x2d')]=_[_0x0cd7('0x2f')](db[_0x0cd7('0x4c')][_0x0cd7('0x4d')]);_0x3b8665[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x3683a7[_0x0cd7('0x2e')]);_0x3b8665[_0x0cd7('0x30')]=_[_0x0cd7('0x32')](_0x3b8665[_0x0cd7('0x2d')],_0x3b8665[_0x0cd7('0x2e')]);_0x402c7c['attributes']=_['intersection'](_0x3b8665[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x33')]));_0x402c7c[_0x0cd7('0x31')]=_0x402c7c[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x402c7c[_0x0cd7('0x31')]:_0x3b8665[_0x0cd7('0x2d')];_0x402c7c['order']=qs['sort'](_0x3683a7['query'][_0x0cd7('0x38')]);_0x402c7c['where']=qs['filters'](_[_0x0cd7('0x3a')](_0x3683a7[_0x0cd7('0x2e')],_0x3b8665[_0x0cd7('0x30')]));if(_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x3b')]){_0x402c7c[_0x0cd7('0x39')]=_[_0x0cd7('0x3c')](_0x402c7c[_0x0cd7('0x39')],{'$or':_[_0x0cd7('0x29')](_0x402c7c['attributes'],function(_0x4dc7b1){var _0x50f8e6={};_0x50f8e6[_0x4dc7b1]={'$like':'%'+_0x3683a7[_0x0cd7('0x2e')]['filter']+'%'};return _0x50f8e6;})});}_0x402c7c=_[_0x0cd7('0x3c')]({},_0x402c7c,_0x3683a7[_0x0cd7('0x3e')]);return _0x1bcec6[_0x0cd7('0x4a')](_0x402c7c);}})[_0x0cd7('0x41')](function(_0x2816b0){if(_0x2816b0){_0x2823da=_0x2816b0['length'];if(!_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x35')](_0x0cd7('0x36'))){_0x402c7c[_0x0cd7('0x1e')]=qs['limit'](_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x1e')]);_0x402c7c['offset']=qs[_0x0cd7('0x1c')](_0x3683a7[_0x0cd7('0x2e')]['offset']);}return _0x1bcec6[_0x0cd7('0x4a')](_0x402c7c);}})[_0x0cd7('0x41')](function(_0x112417){if(_0x112417){return _0x112417?{'count':_0x2823da,'rows':_0x112417}:null;}})[_0x0cd7('0x41')](respondWithResult(_0x47d2bb,null))[_0x0cd7('0x43')](handleError(_0x47d2bb,null));};exports[_0x0cd7('0x4e')]=function(_0x5e643f,_0x413a20,_0xb1fe20){return db['Action']['find']({'where':{'id':_0x5e643f[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x413a20,null))[_0x0cd7('0x41')](function(_0x14da63){if(_0x14da63){return _0x14da63[_0x0cd7('0x4e')](_0x5e643f[_0x0cd7('0x47')][_0x0cd7('0x49')],_['omit'](_0x5e643f[_0x0cd7('0x47')],[_0x0cd7('0x49'),'id'])||{});}})[_0x0cd7('0x41')](respondWithResult(_0x413a20,null))['catch'](handleError(_0x413a20,null));};exports[_0x0cd7('0x4f')]=function(_0x391248,_0x33d7d4,_0x5be048){var _0x58162b={};var _0xf374b={};var _0x2cfb68;var _0xd1c99d;return db[_0x0cd7('0x2a')][_0x0cd7('0x4b')]({'where':{'id':_0x391248[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x33d7d4,null))[_0x0cd7('0x41')](function(_0x541fff){if(_0x541fff){_0x2cfb68=_0x541fff;_0xf374b[_0x0cd7('0x2d')]=_[_0x0cd7('0x2f')](db[_0x0cd7('0x50')][_0x0cd7('0x4d')]);_0xf374b[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x391248[_0x0cd7('0x2e')]);_0xf374b[_0x0cd7('0x30')]=_[_0x0cd7('0x32')](_0xf374b[_0x0cd7('0x2d')],_0xf374b['query']);_0x58162b[_0x0cd7('0x31')]=_['intersection'](_0xf374b[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x391248[_0x0cd7('0x2e')]['fields']));_0x58162b['attributes']=_0x58162b[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x58162b[_0x0cd7('0x31')]:_0xf374b[_0x0cd7('0x2d')];_0x58162b['order']=qs['sort'](_0x391248['query'][_0x0cd7('0x38')]);_0x58162b[_0x0cd7('0x39')]=qs[_0x0cd7('0x30')](_['pick'](_0x391248[_0x0cd7('0x2e')],_0xf374b[_0x0cd7('0x30')]));if(_0x391248['query']['filter']){_0x58162b[_0x0cd7('0x39')]=_[_0x0cd7('0x3c')](_0x58162b[_0x0cd7('0x39')],{'$or':_[_0x0cd7('0x29')](_0x58162b[_0x0cd7('0x31')],function(_0x348768){var _0x1211d3={};_0x1211d3[_0x348768]={'$like':'%'+_0x391248[_0x0cd7('0x2e')]['filter']+'%'};return _0x1211d3;})});}_0x58162b=_[_0x0cd7('0x3c')]({},_0x58162b,_0x391248[_0x0cd7('0x3e')]);return _0x2cfb68['getActions'](_0x58162b);}})['then'](function(_0x97fea6){if(_0x97fea6){_0xd1c99d=_0x97fea6['length'];if(!_0x391248['query'][_0x0cd7('0x35')](_0x0cd7('0x36'))){_0x58162b[_0x0cd7('0x1e')]=qs[_0x0cd7('0x1e')](_0x391248['query']['limit']);_0x58162b[_0x0cd7('0x1c')]=qs[_0x0cd7('0x1c')](_0x391248[_0x0cd7('0x2e')][_0x0cd7('0x1c')]);}return _0x2cfb68[_0x0cd7('0x4f')](_0x58162b);}})['then'](function(_0x121ac7){if(_0x121ac7){return _0x121ac7?{'count':_0xd1c99d,'rows':_0x121ac7}:null;}})[_0x0cd7('0x41')](respondWithResult(_0x33d7d4,null))['catch'](handleError(_0x33d7d4,null));};
\ No newline at end of file
+var _0x9bec=['sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','name','index','map','Automation','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','length','includeAll','find','body','params','addConditions','Condition','ids','findOne','getConditions','nolimit','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9bec,0xd2));var _0xc9be=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x9bec[_0x50aa2e];return _0x5e07f0;};'use strict';var emlformat=require(_0xc9be('0x0'));var rimraf=require(_0xc9be('0x1'));var zipdir=require(_0xc9be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9be('0x3'));var moment=require('moment');var BPromise=require(_0xc9be('0x4'));var Mustache=require(_0xc9be('0x5'));var util=require(_0xc9be('0x6'));var path=require(_0xc9be('0x7'));var sox=require(_0xc9be('0x8'));var csv=require(_0xc9be('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9be('0xa'));var _=require('lodash');var squel=require(_0xc9be('0xb'));var crypto=require(_0xc9be('0xc'));var jsforce=require(_0xc9be('0xd'));var deskjs=require(_0xc9be('0xe'));var toCsv=require(_0xc9be('0x9'));var querystring=require(_0xc9be('0xf'));var Papa=require('papaparse');var Redis=require(_0xc9be('0x10'));var authService=require(_0xc9be('0x11'));var qs=require(_0xc9be('0x12'));var as=require(_0xc9be('0x13'));var hardwareService=require(_0xc9be('0x14'));var logger=require(_0xc9be('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc9be('0x16'));var licenseUtil=require(_0xc9be('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf3448a,_0x3e2c1f){_0x3e2c1f=_0x3e2c1f||0xcc;return function(_0x1798d2){if(_0x1798d2){return _0xf3448a[_0xc9be('0x18')](_0x3e2c1f);}return _0xf3448a[_0xc9be('0x19')](_0x3e2c1f)[_0xc9be('0x1a')]();};}function respondWithResult(_0x252f22,_0x2fc944){_0x2fc944=_0x2fc944||0xc8;return function(_0x2d3cd7){if(_0x2d3cd7){return _0x252f22[_0xc9be('0x19')](_0x2fc944)[_0xc9be('0x1b')](_0x2d3cd7);}};}function respondWithFilteredResult(_0x4896cd,_0x576013){return function(_0x4b0f02){if(_0x4b0f02){var _0x378eec=typeof _0x576013[_0xc9be('0x1c')]===_0xc9be('0x1d')&&typeof _0x576013[_0xc9be('0x1e')]===_0xc9be('0x1d');var _0x5e3087=_0x4b0f02[_0xc9be('0x1f')];var _0x1616b6=_0x378eec?0x0:_0x576013['offset'];var _0x2419ea=_0x378eec?_0x4b0f02[_0xc9be('0x1f')]:_0x576013[_0xc9be('0x1c')]+_0x576013[_0xc9be('0x1e')];var _0x1f397a;if(_0x2419ea>=_0x5e3087){_0x2419ea=_0x5e3087;_0x1f397a=0xc8;}else{_0x1f397a=0xce;}_0x4896cd[_0xc9be('0x19')](_0x1f397a);return _0x4896cd['set']('Content-Range',_0x1616b6+'-'+_0x2419ea+'/'+_0x5e3087)[_0xc9be('0x1b')](_0x4b0f02);}return null;};}function patchUpdates(_0x57e883){return function(_0x1df3cd){try{jsonpatch[_0xc9be('0x20')](_0x1df3cd,_0x57e883,!![]);}catch(_0x16c00b){return BPromise['reject'](_0x16c00b);}return _0x1df3cd['save']();};}function saveUpdates(_0x10b93a,_0x5459fd){return function(_0x436a83){if(_0x436a83){return _0x436a83[_0xc9be('0x21')](_0x10b93a)[_0xc9be('0x22')](function(_0x39c2f9){return _0x39c2f9;});}return null;};}function removeEntity(_0x5ca2f8,_0x48514e){return function(_0x429fa9){if(_0x429fa9){return _0x429fa9[_0xc9be('0x23')]()[_0xc9be('0x22')](function(){_0x5ca2f8[_0xc9be('0x19')](0xcc)[_0xc9be('0x1a')]();});}};}function handleEntityNotFound(_0x3ef1df,_0x153265){return function(_0x3f6aaa){if(!_0x3f6aaa){_0x3ef1df[_0xc9be('0x18')](0x194);}return _0x3f6aaa;};}function handleError(_0x3bacc7,_0x19a0fd){_0x19a0fd=_0x19a0fd||0x1f4;return function(_0x231b05){logger['error'](_0x231b05['stack']);if(_0x231b05[_0xc9be('0x24')]){delete _0x231b05[_0xc9be('0x24')];}_0x3bacc7[_0xc9be('0x19')](_0x19a0fd)['send'](_0x231b05);};}exports[_0xc9be('0x25')]=function(_0x4b8c7c,_0x56afcf){var _0x1c60ea={},_0x1c79d7={},_0x57a90b={'count':0x0,'rows':[]};var _0x2ed48c=_[_0xc9be('0x26')](db[_0xc9be('0x27')][_0xc9be('0x28')],function(_0x121e98){return{'name':_0x121e98[_0xc9be('0x29')],'type':_0x121e98[_0xc9be('0x2a')]['key']};});_0x1c79d7[_0xc9be('0x2b')]=_[_0xc9be('0x26')](_0x2ed48c,_0xc9be('0x24'));_0x1c79d7['query']=_[_0xc9be('0x2c')](_0x4b8c7c[_0xc9be('0x2d')]);_0x1c79d7[_0xc9be('0x2e')]=_[_0xc9be('0x2f')](_0x1c79d7[_0xc9be('0x2b')],_0x1c79d7[_0xc9be('0x2d')]);_0x1c60ea[_0xc9be('0x30')]=_['intersection'](_0x1c79d7[_0xc9be('0x2b')],qs[_0xc9be('0x31')](_0x4b8c7c[_0xc9be('0x2d')]['fields']));_0x1c60ea[_0xc9be('0x30')]=_0x1c60ea[_0xc9be('0x30')]['length']?_0x1c60ea[_0xc9be('0x30')]:_0x1c79d7[_0xc9be('0x2b')];if(!_0x4b8c7c[_0xc9be('0x2d')][_0xc9be('0x32')]('nolimit')){_0x1c60ea[_0xc9be('0x1e')]=qs['limit'](_0x4b8c7c[_0xc9be('0x2d')]['limit']);_0x1c60ea[_0xc9be('0x1c')]=qs['offset'](_0x4b8c7c[_0xc9be('0x2d')]['offset']);}_0x1c60ea[_0xc9be('0x33')]=qs[_0xc9be('0x34')](_0x4b8c7c[_0xc9be('0x2d')][_0xc9be('0x34')]);_0x1c60ea[_0xc9be('0x35')]=qs[_0xc9be('0x2e')](_[_0xc9be('0x36')](_0x4b8c7c[_0xc9be('0x2d')],_0x1c79d7[_0xc9be('0x2e')]),_0x2ed48c);if(_0x4b8c7c['query'][_0xc9be('0x37')]){_0x1c60ea[_0xc9be('0x35')]=_['merge'](_0x1c60ea[_0xc9be('0x35')],{'$or':_[_0xc9be('0x26')](_0x2ed48c,function(_0x332430){if(_0x332430[_0xc9be('0x2a')]!=='VIRTUAL'){var _0x1f8dcc={};_0x1f8dcc[_0x332430[_0xc9be('0x24')]]={'$like':'%'+_0x4b8c7c[_0xc9be('0x2d')][_0xc9be('0x37')]+'%'};return _0x1f8dcc;}})});}_0x1c60ea=_[_0xc9be('0x38')]({},_0x1c60ea,_0x4b8c7c[_0xc9be('0x39')]);var _0x5682b3={'where':_0x1c60ea[_0xc9be('0x35')]};return db['Automation'][_0xc9be('0x1f')](_0x5682b3)['then'](function(_0x4cc57a){_0x57a90b[_0xc9be('0x1f')]=_0x4cc57a;if(_0x4b8c7c[_0xc9be('0x2d')]['includeAll']){_0x1c60ea[_0xc9be('0x3a')]=[{'all':!![]}];}return db[_0xc9be('0x27')][_0xc9be('0x3b')](_0x1c60ea);})[_0xc9be('0x22')](function(_0x5a4d08){_0x57a90b[_0xc9be('0x3c')]=_0x5a4d08;return _0x57a90b;})[_0xc9be('0x22')](respondWithFilteredResult(_0x56afcf,_0x1c60ea))[_0xc9be('0x3d')](handleError(_0x56afcf,null));};exports[_0xc9be('0x3e')]=function(_0x595cfd,_0x56da03){var _0x4c1af4={'raw':![],'where':{'id':_0x595cfd['params']['id']}},_0x503231={};_0x503231['model']=_[_0xc9be('0x2c')](db[_0xc9be('0x27')][_0xc9be('0x28')]);_0x503231[_0xc9be('0x2d')]=_[_0xc9be('0x2c')](_0x595cfd[_0xc9be('0x2d')]);_0x503231[_0xc9be('0x2e')]=_[_0xc9be('0x2f')](_0x503231[_0xc9be('0x2b')],_0x503231['query']);_0x4c1af4[_0xc9be('0x30')]=_[_0xc9be('0x2f')](_0x503231[_0xc9be('0x2b')],qs[_0xc9be('0x31')](_0x595cfd['query'][_0xc9be('0x31')]));_0x4c1af4[_0xc9be('0x30')]=_0x4c1af4[_0xc9be('0x30')][_0xc9be('0x3f')]?_0x4c1af4[_0xc9be('0x30')]:_0x503231[_0xc9be('0x2b')];if(_0x595cfd[_0xc9be('0x2d')][_0xc9be('0x40')]){_0x4c1af4[_0xc9be('0x3a')]=[{'all':!![]}];}_0x4c1af4=_[_0xc9be('0x38')]({},_0x4c1af4,_0x595cfd[_0xc9be('0x39')]);return db['Automation'][_0xc9be('0x41')](_0x4c1af4)[_0xc9be('0x22')](handleEntityNotFound(_0x56da03,null))[_0xc9be('0x22')](respondWithResult(_0x56da03,null))[_0xc9be('0x3d')](handleError(_0x56da03,null));};exports['create']=function(_0x5271d7,_0x2297b4){return db[_0xc9be('0x27')]['create'](_0x5271d7[_0xc9be('0x42')],{})[_0xc9be('0x22')](respondWithResult(_0x2297b4,0xc9))[_0xc9be('0x3d')](handleError(_0x2297b4,null));};exports[_0xc9be('0x21')]=function(_0x3353ab,_0x3c1d19){if(_0x3353ab[_0xc9be('0x42')]['id']){delete _0x3353ab[_0xc9be('0x42')]['id'];}return db[_0xc9be('0x27')]['find']({'where':{'id':_0x3353ab[_0xc9be('0x43')]['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x3c1d19,null))['then'](saveUpdates(_0x3353ab[_0xc9be('0x42')],null))[_0xc9be('0x22')](respondWithResult(_0x3c1d19,null))[_0xc9be('0x3d')](handleError(_0x3c1d19,null));};exports[_0xc9be('0x23')]=function(_0x4f9603,_0x5e65d1){return db['Automation']['find']({'where':{'id':_0x4f9603['params']['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x5e65d1,null))['then'](removeEntity(_0x5e65d1,null))[_0xc9be('0x3d')](handleError(_0x5e65d1,null));};exports[_0xc9be('0x44')]=function(_0x29f3f9,_0x54fd69,_0x2a2aed){return db[_0xc9be('0x45')][_0xc9be('0x41')]({'where':{'id':_0x29f3f9[_0xc9be('0x43')]['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x54fd69,null))['then'](function(_0x24cd36){if(_0x24cd36){return _0x24cd36[_0xc9be('0x44')](_0x29f3f9['body']['ids'],_['omit'](_0x29f3f9[_0xc9be('0x42')],[_0xc9be('0x46'),'id'])||{});}})[_0xc9be('0x22')](respondWithResult(_0x54fd69,null))[_0xc9be('0x3d')](handleError(_0x54fd69,null));};exports['getConditions']=function(_0xc5083,_0x1ecdd5,_0x42cada){var _0x3eee1a={};var _0xac06e8={};var _0x49ad64;var _0x374e54;return db[_0xc9be('0x27')][_0xc9be('0x47')]({'where':{'id':_0xc5083['params']['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x1ecdd5,null))['then'](function(_0x22684d){if(_0x22684d){_0x49ad64=_0x22684d;_0xac06e8[_0xc9be('0x2b')]=_[_0xc9be('0x2c')](db[_0xc9be('0x45')][_0xc9be('0x28')]);_0xac06e8[_0xc9be('0x2d')]=_[_0xc9be('0x2c')](_0xc5083[_0xc9be('0x2d')]);_0xac06e8[_0xc9be('0x2e')]=_[_0xc9be('0x2f')](_0xac06e8['model'],_0xac06e8[_0xc9be('0x2d')]);_0x3eee1a[_0xc9be('0x30')]=_[_0xc9be('0x2f')](_0xac06e8[_0xc9be('0x2b')],qs['fields'](_0xc5083[_0xc9be('0x2d')][_0xc9be('0x31')]));_0x3eee1a[_0xc9be('0x30')]=_0x3eee1a[_0xc9be('0x30')]['length']?_0x3eee1a['attributes']:_0xac06e8['model'];_0x3eee1a[_0xc9be('0x33')]=qs[_0xc9be('0x34')](_0xc5083['query'][_0xc9be('0x34')]);_0x3eee1a[_0xc9be('0x35')]=qs[_0xc9be('0x2e')](_[_0xc9be('0x36')](_0xc5083[_0xc9be('0x2d')],_0xac06e8[_0xc9be('0x2e')]));if(_0xc5083['query'][_0xc9be('0x37')]){_0x3eee1a[_0xc9be('0x35')]=_[_0xc9be('0x38')](_0x3eee1a[_0xc9be('0x35')],{'$or':_[_0xc9be('0x26')](_0x3eee1a[_0xc9be('0x30')],function(_0x3341ed){var _0x3a916d={};_0x3a916d[_0x3341ed]={'$like':'%'+_0xc5083[_0xc9be('0x2d')][_0xc9be('0x37')]+'%'};return _0x3a916d;})});}_0x3eee1a=_[_0xc9be('0x38')]({},_0x3eee1a,_0xc5083[_0xc9be('0x39')]);return _0x49ad64[_0xc9be('0x48')](_0x3eee1a);}})[_0xc9be('0x22')](function(_0x1c36df){if(_0x1c36df){_0x374e54=_0x1c36df['length'];if(!_0xc5083[_0xc9be('0x2d')][_0xc9be('0x32')](_0xc9be('0x49'))){_0x3eee1a['limit']=qs[_0xc9be('0x1e')](_0xc5083[_0xc9be('0x2d')][_0xc9be('0x1e')]);_0x3eee1a[_0xc9be('0x1c')]=qs['offset'](_0xc5083['query']['offset']);}return _0x49ad64[_0xc9be('0x48')](_0x3eee1a);}})['then'](function(_0x27feb2){if(_0x27feb2){return _0x27feb2?{'count':_0x374e54,'rows':_0x27feb2}:null;}})['then'](respondWithResult(_0x1ecdd5,null))[_0xc9be('0x3d')](handleError(_0x1ecdd5,null));};exports[_0xc9be('0x4a')]=function(_0x19c141,_0xcc67bb,_0x5f5b05){return db[_0xc9be('0x4b')][_0xc9be('0x41')]({'where':{'id':_0x19c141[_0xc9be('0x43')]['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0xcc67bb,null))['then'](function(_0x36f140){if(_0x36f140){return _0x36f140[_0xc9be('0x4a')](_0x19c141[_0xc9be('0x42')][_0xc9be('0x46')],_[_0xc9be('0x4c')](_0x19c141['body'],['ids','id'])||{});}})[_0xc9be('0x22')](respondWithResult(_0xcc67bb,null))[_0xc9be('0x3d')](handleError(_0xcc67bb,null));};exports[_0xc9be('0x4d')]=function(_0x2c9977,_0x4a1439,_0x5ab0ba){var _0x4eea01={};var _0x523225={};var _0xf84435;var _0x40415d;return db['Automation']['findOne']({'where':{'id':_0x2c9977[_0xc9be('0x43')]['id']}})[_0xc9be('0x22')](handleEntityNotFound(_0x4a1439,null))[_0xc9be('0x22')](function(_0x56b064){if(_0x56b064){_0xf84435=_0x56b064;_0x523225[_0xc9be('0x2b')]=_[_0xc9be('0x2c')](db[_0xc9be('0x4b')][_0xc9be('0x28')]);_0x523225[_0xc9be('0x2d')]=_[_0xc9be('0x2c')](_0x2c9977[_0xc9be('0x2d')]);_0x523225[_0xc9be('0x2e')]=_[_0xc9be('0x2f')](_0x523225['model'],_0x523225[_0xc9be('0x2d')]);_0x4eea01[_0xc9be('0x30')]=_[_0xc9be('0x2f')](_0x523225['model'],qs[_0xc9be('0x31')](_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x31')]));_0x4eea01[_0xc9be('0x30')]=_0x4eea01['attributes'][_0xc9be('0x3f')]?_0x4eea01[_0xc9be('0x30')]:_0x523225[_0xc9be('0x2b')];_0x4eea01[_0xc9be('0x33')]=qs['sort'](_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x34')]);_0x4eea01[_0xc9be('0x35')]=qs[_0xc9be('0x2e')](_[_0xc9be('0x36')](_0x2c9977[_0xc9be('0x2d')],_0x523225['filters']));if(_0x2c9977['query'][_0xc9be('0x37')]){_0x4eea01[_0xc9be('0x35')]=_[_0xc9be('0x38')](_0x4eea01['where'],{'$or':_[_0xc9be('0x26')](_0x4eea01[_0xc9be('0x30')],function(_0x289897){var _0x2e827b={};_0x2e827b[_0x289897]={'$like':'%'+_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x37')]+'%'};return _0x2e827b;})});}_0x4eea01=_[_0xc9be('0x38')]({},_0x4eea01,_0x2c9977[_0xc9be('0x39')]);return _0xf84435['getActions'](_0x4eea01);}})[_0xc9be('0x22')](function(_0x2186a8){if(_0x2186a8){_0x40415d=_0x2186a8[_0xc9be('0x3f')];if(!_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x32')](_0xc9be('0x49'))){_0x4eea01['limit']=qs[_0xc9be('0x1e')](_0x2c9977[_0xc9be('0x2d')][_0xc9be('0x1e')]);_0x4eea01[_0xc9be('0x1c')]=qs[_0xc9be('0x1c')](_0x2c9977['query'][_0xc9be('0x1c')]);}return _0xf84435['getActions'](_0x4eea01);}})['then'](function(_0x2b9457){if(_0x2b9457){return _0x2b9457?{'count':_0x40415d,'rows':_0x2b9457}:null;}})[_0xc9be('0x22')](respondWithResult(_0x4a1439,null))[_0xc9be('0x3d')](handleError(_0x4a1439,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index a47d8e0..7b6ae2a 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 _0x16dd=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','util','../../config/logger'];(function(_0x942780,_0x865231){var _0x2fbdd5=function(_0x32ae9b){while(--_0x32ae9b){_0x942780['push'](_0x942780['shift']());}};_0x2fbdd5(++_0x865231);}(_0x16dd,0x17e));var _0xd16d=function(_0x2ea66e,_0xafd23a){_0x2ea66e=_0x2ea66e-0x0;var _0x1d5cf6=_0x16dd[_0x2ea66e];return _0x1d5cf6;};'use strict';var _=require('lodash');var util=require(_0xd16d('0x0'));var logger=require(_0xd16d('0x1'))(_0xd16d('0x2'));var moment=require(_0xd16d('0x3'));var BPromise=require(_0xd16d('0x4'));var rp=require(_0xd16d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd16d('0x6'));var config=require(_0xd16d('0x7'));var attributes=require(_0xd16d('0x8'));module[_0xd16d('0x9')]=function(_0x5d9f39,_0x3da107){return _0x5d9f39['define'](_0xd16d('0xa'),attributes,{'tableName':_0xd16d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4be6=['tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports','define','Automation'];(function(_0x5c3be4,_0x442ebf){var _0x1e9e1d=function(_0x6cef7e){while(--_0x6cef7e){_0x5c3be4['push'](_0x5c3be4['shift']());}};_0x1e9e1d(++_0x442ebf);}(_0x4be6,0x199));var _0x64be=function(_0x204ce5,_0x46fb75){_0x204ce5=_0x204ce5-0x0;var _0x4f5a44=_0x4be6[_0x204ce5];return _0x4f5a44;};'use strict';var _=require(_0x64be('0x0'));var util=require('util');var logger=require(_0x64be('0x1'))(_0x64be('0x2'));var moment=require(_0x64be('0x3'));var BPromise=require(_0x64be('0x4'));var rp=require(_0x64be('0x5'));var fs=require('fs');var path=require(_0x64be('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x64be('0x7'));module[_0x64be('0x8')]=function(_0x4c1829,_0x426960){return _0x4c1829[_0x64be('0x9')](_0x64be('0xa'),attributes,{'tableName':_0x64be('0xb'),'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 974ba55..4d8c7b0 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 _0xe2ab=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','request\x20sent','debug'];(function(_0x584d37,_0x13fb20){var _0x1a1dbf=function(_0x23cd11){while(--_0x23cd11){_0x584d37['push'](_0x584d37['shift']());}};_0x1a1dbf(++_0x13fb20);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x5cfcaa,_0x70377e){_0x5cfcaa=_0x5cfcaa-0x0;var _0x5e1e7b=_0xe2ab[_0x5cfcaa];return _0x5e1e7b;};'use strict';var _=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var moment=require(_0xbe2a('0x2'));var BPromise=require(_0xbe2a('0x3'));var rs=require(_0xbe2a('0x4'));var fs=require('fs');var Redis=require(_0xbe2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe2a('0x6'));var logger=require(_0xbe2a('0x7'))(_0xbe2a('0x8'));var config=require(_0xbe2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbe2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f504b,_0x58b8f1,_0x5a8a5d){return new BPromise(function(_0xfccbff,_0x232194){return client['request'](_0x2f504b,_0x5a8a5d)['then'](function(_0x83d775){logger[_0xbe2a('0xb')]('Automation,\x20%s,\x20%s',_0x58b8f1,_0xbe2a('0xc'));logger[_0xbe2a('0xd')](_0xbe2a('0xe'),_0x58b8f1,_0xbe2a('0xc'),JSON[_0xbe2a('0xf')](_0x83d775));if(_0x83d775['error']){if(_0x83d775['error']['code']===0x1f4){logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);return _0x232194(_0x83d775[_0xbe2a('0x10')]['message']);}logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')]['message']);return _0xfccbff(_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);}else{logger[_0xbe2a('0xb')](_0xbe2a('0x11'),_0x58b8f1,_0xbe2a('0xc'));_0xfccbff(_0x83d775[_0xbe2a('0x13')][_0xbe2a('0x12')]);}})[_0xbe2a('0x14')](function(_0x4395fe){logger['error'](_0xbe2a('0x11'),_0x58b8f1,_0x4395fe);_0x232194(_0x4395fe);});});}
\ No newline at end of file
+var _0x3c8e=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring'];(function(_0x242b33,_0x4a124d){var _0xb19caf=function(_0x59b655){while(--_0x59b655){_0x242b33['push'](_0x242b33['shift']());}};_0xb19caf(++_0x4a124d);}(_0x3c8e,0x89));var _0xe3c8=function(_0x2bb154,_0x5f31cc){_0x2bb154=_0x2bb154-0x0;var _0x5869e3=_0x3c8e[_0x2bb154];return _0x5869e3;};'use strict';var _=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe3c8('0x2'));var fs=require('fs');var Redis=require(_0xe3c8('0x3'));var db=require(_0xe3c8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3c8('0x5'))(_0xe3c8('0x6'));var config=require(_0xe3c8('0x7'));var jayson=require(_0xe3c8('0x8'));var client=jayson['client'][_0xe3c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16acf1,_0x2fe9e5,_0x222f26){return new BPromise(function(_0xf4387f,_0x5f3375){return client[_0xe3c8('0xa')](_0x16acf1,_0x222f26)['then'](function(_0x1b6e5e){logger[_0xe3c8('0xb')](_0xe3c8('0xc'),_0x2fe9e5,_0xe3c8('0xd'));logger['debug'](_0xe3c8('0xe'),_0x2fe9e5,_0xe3c8('0xd'),JSON[_0xe3c8('0xf')](_0x1b6e5e));if(_0x1b6e5e['error']){if(_0x1b6e5e[_0xe3c8('0x10')]['code']===0x1f4){logger[_0xe3c8('0x10')]('Automation,\x20%s,\x20%s',_0x2fe9e5,_0x1b6e5e['error'][_0xe3c8('0x11')]);return _0x5f3375(_0x1b6e5e[_0xe3c8('0x10')][_0xe3c8('0x11')]);}logger['error'](_0xe3c8('0xc'),_0x2fe9e5,_0x1b6e5e[_0xe3c8('0x10')][_0xe3c8('0x11')]);return _0xf4387f(_0x1b6e5e[_0xe3c8('0x10')][_0xe3c8('0x11')]);}else{logger[_0xe3c8('0xb')]('Automation,\x20%s,\x20%s',_0x2fe9e5,_0xe3c8('0xd'));_0xf4387f(_0x1b6e5e[_0xe3c8('0x12')]['message']);}})[_0xe3c8('0x13')](function(_0x10d57b){logger[_0xe3c8('0x10')]('Automation,\x20%s,\x20%s',_0x2fe9e5,_0x10d57b);_0x5f3375(_0x10d57b);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 080f2f2..68e6e0d 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 _0x1798=['getConditions','/:id/actions','getActions','post','addConditions','put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','show','/:id/conditions','isAuthenticated'];(function(_0x123623,_0x9694e2){var _0x3b00d1=function(_0x7e48e0){while(--_0x7e48e0){_0x123623['push'](_0x123623['shift']());}};_0x3b00d1(++_0x9694e2);}(_0x1798,0x1d6));var _0x8179=function(_0x8f3ae9,_0x119634){_0x8f3ae9=_0x8f3ae9-0x0;var _0x53d8a4=_0x1798[_0x8f3ae9];return _0x53d8a4;};'use strict';var multer=require(_0x8179('0x0'));var util=require('util');var path=require(_0x8179('0x1'));var timeout=require(_0x8179('0x2'));var express=require('express');var router=express[_0x8179('0x3')]();var fs_extra=require(_0x8179('0x4'));var auth=require(_0x8179('0x5'));var interaction=require(_0x8179('0x6'));var config=require('../../config/environment');var controller=require(_0x8179('0x7'));router[_0x8179('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8179('0x8')](_0x8179('0x9'),auth['isAuthenticated'](),controller[_0x8179('0xa')]);router[_0x8179('0x8')](_0x8179('0xb'),auth[_0x8179('0xc')](),controller[_0x8179('0xd')]);router['get'](_0x8179('0xe'),auth[_0x8179('0xc')](),controller[_0x8179('0xf')]);router[_0x8179('0x10')]('/',auth[_0x8179('0xc')](),controller['create']);router[_0x8179('0x10')](_0x8179('0xb'),auth[_0x8179('0xc')](),controller[_0x8179('0x11')]);router[_0x8179('0x10')]('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router[_0x8179('0x12')](_0x8179('0x9'),auth['isAuthenticated'](),controller[_0x8179('0x13')]);router[_0x8179('0x14')](_0x8179('0x9'),auth[_0x8179('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x046b=['create','addActions','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x5e5c64,_0x19b9fb){var _0x1bf287=function(_0x19fb98){while(--_0x19fb98){_0x5e5c64['push'](_0x5e5c64['shift']());}};_0x1bf287(++_0x19b9fb);}(_0x046b,0x147));var _0xb046=function(_0x441f16,_0x1849ae){_0x441f16=_0x441f16-0x0;var _0x1efcf0=_0x046b[_0x441f16];return _0x1efcf0;};'use strict';var multer=require('multer');var util=require(_0xb046('0x0'));var path=require(_0xb046('0x1'));var timeout=require(_0xb046('0x2'));var express=require(_0xb046('0x3'));var router=express[_0xb046('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb046('0x5'));var interaction=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var controller=require(_0xb046('0x8'));router[_0xb046('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb046('0x9')](_0xb046('0xa'),auth[_0xb046('0xb')](),controller[_0xb046('0xc')]);router[_0xb046('0x9')](_0xb046('0xd'),auth[_0xb046('0xb')](),controller[_0xb046('0xe')]);router['get'](_0xb046('0xf'),auth['isAuthenticated'](),controller[_0xb046('0x10')]);router[_0xb046('0x11')]('/',auth[_0xb046('0xb')](),controller[_0xb046('0x12')]);router[_0xb046('0x11')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0xb046('0x11')](_0xb046('0xf'),auth['isAuthenticated'](),controller[_0xb046('0x13')]);router['put'](_0xb046('0xa'),auth[_0xb046('0xb')](),controller['update']);router[_0xb046('0x14')](_0xb046('0xa'),auth[_0xb046('0xb')](),controller[_0xb046('0x15')]);module[_0xb046('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index bf92b90..7a6d01a 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 _0xb52a=['#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x1fb6be,_0x2fd9a3){var _0x1eebff=function(_0x427c9b){while(--_0x427c9b){_0x1fb6be['push'](_0x1fb6be['shift']());}};_0x1eebff(++_0x2fd9a3);}(_0xb52a,0x76));var _0xab52=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xb52a[_0x246148];return _0x453d94;};'use strict';var Sequelize=require('sequelize');module[_0xab52('0x0')]={'name':{'type':Sequelize[_0xab52('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xab52('0x2')),'allowNull':![],'defaultValue':_0xab52('0x2')},'description':{'type':Sequelize[_0xab52('0x1')]},'active':{'type':Sequelize[_0xab52('0x3')],'defaultValue':0x0,'comment':_0xab52('0x4')},'limitCalls':{'type':Sequelize[_0xab52('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xab52('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xab52('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xab52('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'comment':_0xab52('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xab52('0xd')},'dialTimezone':{'type':Sequelize[_0xab52('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xab52('0x1')],'defaultValue':_0xab52('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xab52('0xf')](_0xab52('0x10'),_0xab52('0x11'),_0xab52('0x12')),'defaultValue':_0xab52('0x10')},'dialAMDActive':{'type':Sequelize[_0xab52('0x3')],'defaultValue':0x0,'comment':_0xab52('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xab52('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xab52('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xab52('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab52('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xab52('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xab52('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xab52('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xab52('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab52('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xab52('0xf')](_0xab52('0x1b'),_0xab52('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xab52('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xab52('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0x23')}};
\ No newline at end of file
+var _0xec81=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x4a0de5,_0x14bf0d){var _0x3fafff=function(_0x53d009){while(--_0x53d009){_0x4a0de5['push'](_0x4a0de5['shift']());}};_0x3fafff(++_0x14bf0d);}(_0xec81,0xf6));var _0x1ec8=function(_0x1aafbe,_0x3441c9){_0x1aafbe=_0x1aafbe-0x0;var _0x7de560=_0xec81[_0x1aafbe];return _0x7de560;};'use strict';var Sequelize=require(_0x1ec8('0x0'));module[_0x1ec8('0x1')]={'name':{'type':Sequelize[_0x1ec8('0x2')],'unique':_0x1ec8('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1ec8('0x4')),'allowNull':![],'defaultValue':_0x1ec8('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1ec8('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1ec8('0x6')](0x4)[_0x1ec8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1ec8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1ec8('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'comment':_0x1ec8('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1ec8('0xf')},'dialTimezone':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x1ec8('0x11')](_0x1ec8('0x12'),_0x1ec8('0x13'),_0x1ec8('0x14')),'defaultValue':_0x1ec8('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1ec8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1ec8('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1ec8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1ec8('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1ec8('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1ec8('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1ec8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1ec8('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1ec8('0x6')](0x9)[_0x1ec8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1ec8('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1ec8('0x11')](_0x1ec8('0x1b'),_0x1ec8('0x1c')),'defaultValue':_0x1ec8('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1ec8('0x1d')},'dialCutDigit':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x1ec8('0x6')](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1ec8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ec8('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1ec8('0x6')](0x5)[_0x1ec8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ec8('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4de4fc7..a2482a4 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 _0x9990=['into','cm_hopper','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','toString','updatedAt','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','phone','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','omit','createdAt','IvrCampaigns','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert'];(function(_0x18f713,_0x379588){var _0x4d524a=function(_0x405ef4){while(--_0x405ef4){_0x18f713['push'](_0x18f713['shift']());}};_0x4d524a(++_0x379588);}(_0x9990,0xa8));var _0x0999=function(_0x8033a9,_0x23db75){_0x8033a9=_0x8033a9-0x0;var _0x4af01f=_0x9990[_0x8033a9];return _0x4af01f;};'use strict';var emlformat=require(_0x0999('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0999('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0999('0x2'));var moment=require(_0x0999('0x3'));var BPromise=require(_0x0999('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0999('0x5'));var sox=require(_0x0999('0x6'));var csv=require('to-csv');var ejs=require(_0x0999('0x7'));var fs=require('fs');var fs_extra=require(_0x0999('0x8'));var _=require(_0x0999('0x9'));var squel=require(_0x0999('0xa'));var crypto=require(_0x0999('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0999('0xc'));var toCsv=require(_0x0999('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0999('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0999('0xf'));var as=require(_0x0999('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0999('0x11'))(_0x0999('0x12'));var utils=require(_0x0999('0x13'));var config=require(_0x0999('0x14'));var licenseUtil=require(_0x0999('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50af2c,_0x508f94){_0x508f94=_0x508f94||0xcc;return function(_0x70c45c){if(_0x70c45c){return _0x50af2c[_0x0999('0x16')](_0x508f94);}return _0x50af2c[_0x0999('0x17')](_0x508f94)[_0x0999('0x18')]();};}function respondWithResult(_0x45fb10,_0xe74d67){_0xe74d67=_0xe74d67||0xc8;return function(_0x6181eb){if(_0x6181eb){return _0x45fb10[_0x0999('0x17')](_0xe74d67)['json'](_0x6181eb);}};}function respondWithFilteredResult(_0x1066f3,_0x97bdaa){return function(_0x1e1d51){if(_0x1e1d51){var _0x11ec09=typeof _0x97bdaa['offset']===_0x0999('0x19')&&typeof _0x97bdaa['limit']==='undefined';var _0x495588=_0x1e1d51[_0x0999('0x1a')];var _0x3f86d8=_0x11ec09?0x0:_0x97bdaa['offset'];var _0x4354d8=_0x11ec09?_0x1e1d51[_0x0999('0x1a')]:_0x97bdaa[_0x0999('0x1b')]+_0x97bdaa[_0x0999('0x1c')];var _0x128933;if(_0x4354d8>=_0x495588){_0x4354d8=_0x495588;_0x128933=0xc8;}else{_0x128933=0xce;}_0x1066f3[_0x0999('0x17')](_0x128933);return _0x1066f3[_0x0999('0x1d')](_0x0999('0x1e'),_0x3f86d8+'-'+_0x4354d8+'/'+_0x495588)[_0x0999('0x1f')](_0x1e1d51);}return null;};}function patchUpdates(_0x55761f){return function(_0x430e77){try{jsonpatch[_0x0999('0x20')](_0x430e77,_0x55761f,!![]);}catch(_0x2605f5){return BPromise[_0x0999('0x21')](_0x2605f5);}return _0x430e77['save']();};}function saveUpdates(_0x45a790,_0x35da19){return function(_0x5c6f8b){if(_0x5c6f8b){return _0x5c6f8b[_0x0999('0x22')](_0x45a790)[_0x0999('0x23')](function(_0xe75920){return _0xe75920;});}return null;};}function removeEntity(_0x1b3a4a,_0x154671){return function(_0x46a931){if(_0x46a931){return _0x46a931[_0x0999('0x24')]()[_0x0999('0x23')](function(){var _0xc95bb2=_0x46a931[_0x0999('0x25')]({'plain':!![]});var _0x5dab60='IvrCampaigns';return db[_0x0999('0x26')][_0x0999('0x24')]({'where':{'type':_0x5dab60,'resourceId':_0xc95bb2['id']}})[_0x0999('0x23')](function(){return _0x46a931;});})[_0x0999('0x23')](function(){_0x1b3a4a[_0x0999('0x17')](0xcc)[_0x0999('0x18')]();});}};}function handleEntityNotFound(_0x47e22c,_0x1221d4){return function(_0x4f1ca1){if(!_0x4f1ca1){_0x47e22c['sendStatus'](0x194);}return _0x4f1ca1;};}function handleError(_0x40c277,_0x4ab939){_0x4ab939=_0x4ab939||0x1f4;return function(_0x400acf){logger[_0x0999('0x27')](_0x400acf[_0x0999('0x28')]);if(_0x400acf[_0x0999('0x29')]){delete _0x400acf[_0x0999('0x29')];}_0x40c277[_0x0999('0x17')](_0x4ab939)[_0x0999('0x2a')](_0x400acf);};}exports[_0x0999('0x2b')]=function(_0x1bde8a,_0x232c73){var _0x320851={},_0x327f86={},_0x25b238={'count':0x0,'rows':[]};var _0x2c0ca1=_[_0x0999('0x2c')](db[_0x0999('0x2d')][_0x0999('0x2e')],function(_0x463678){return{'name':_0x463678[_0x0999('0x2f')],'type':_0x463678[_0x0999('0x30')][_0x0999('0x31')]};});_0x327f86[_0x0999('0x32')]=_['map'](_0x2c0ca1,_0x0999('0x29'));_0x327f86['query']=_['keys'](_0x1bde8a['query']);_0x327f86[_0x0999('0x33')]=_['intersection'](_0x327f86[_0x0999('0x32')],_0x327f86[_0x0999('0x34')]);_0x320851[_0x0999('0x35')]=_['intersection'](_0x327f86[_0x0999('0x32')],qs[_0x0999('0x36')](_0x1bde8a[_0x0999('0x34')]['fields']));_0x320851['attributes']=_0x320851[_0x0999('0x35')][_0x0999('0x37')]?_0x320851[_0x0999('0x35')]:_0x327f86[_0x0999('0x32')];if(!_0x1bde8a[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x320851[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x1bde8a[_0x0999('0x34')][_0x0999('0x1c')]);_0x320851[_0x0999('0x1b')]=qs[_0x0999('0x1b')](_0x1bde8a[_0x0999('0x34')][_0x0999('0x1b')]);}_0x320851[_0x0999('0x3a')]=qs['sort'](_0x1bde8a[_0x0999('0x34')][_0x0999('0x3b')]);_0x320851['where']=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0x1bde8a['query'],_0x327f86[_0x0999('0x33')]),_0x2c0ca1);if(_0x1bde8a[_0x0999('0x34')][_0x0999('0x3d')]){_0x320851[_0x0999('0x3e')]=_['merge'](_0x320851[_0x0999('0x3e')],{'$or':_['map'](_0x2c0ca1,function(_0x20454){if(_0x20454[_0x0999('0x30')]!==_0x0999('0x3f')){var _0x438758={};_0x438758[_0x20454[_0x0999('0x29')]]={'$like':'%'+_0x1bde8a['query'][_0x0999('0x3d')]+'%'};return _0x438758;}})});}_0x320851=_[_0x0999('0x40')]({},_0x320851,_0x1bde8a[_0x0999('0x41')]);var _0x5e27d1={'where':_0x320851[_0x0999('0x3e')]};return db[_0x0999('0x2d')]['count'](_0x5e27d1)[_0x0999('0x23')](function(_0x4d11c3){_0x25b238[_0x0999('0x1a')]=_0x4d11c3;if(_0x1bde8a[_0x0999('0x34')]['includeAll']){_0x320851[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x2d')][_0x0999('0x43')](_0x320851);})['then'](function(_0x294a8e){_0x25b238[_0x0999('0x44')]=_0x294a8e;return _0x25b238;})['then'](respondWithFilteredResult(_0x232c73,_0x320851))[_0x0999('0x45')](handleError(_0x232c73,null));};exports['show']=function(_0x45b798,_0x464d53){var _0x24c71e={'raw':![],'where':{'id':_0x45b798[_0x0999('0x46')]['id']}},_0x2c6686={};_0x2c6686['model']=_[_0x0999('0x47')](db['Campaign']['rawAttributes']);_0x2c6686[_0x0999('0x34')]=_['keys'](_0x45b798[_0x0999('0x34')]);_0x2c6686[_0x0999('0x33')]=_[_0x0999('0x48')](_0x2c6686[_0x0999('0x32')],_0x2c6686[_0x0999('0x34')]);_0x24c71e[_0x0999('0x35')]=_[_0x0999('0x48')](_0x2c6686[_0x0999('0x32')],qs[_0x0999('0x36')](_0x45b798['query'][_0x0999('0x36')]));_0x24c71e['attributes']=_0x24c71e[_0x0999('0x35')][_0x0999('0x37')]?_0x24c71e[_0x0999('0x35')]:_0x2c6686[_0x0999('0x32')];if(_0x45b798['query'][_0x0999('0x49')]){_0x24c71e[_0x0999('0x42')]=[{'all':!![]}];}_0x24c71e=_[_0x0999('0x40')]({},_0x24c71e,_0x45b798[_0x0999('0x41')]);return db[_0x0999('0x2d')][_0x0999('0x4a')](_0x24c71e)[_0x0999('0x23')](handleEntityNotFound(_0x464d53,null))[_0x0999('0x23')](respondWithResult(_0x464d53,null))[_0x0999('0x45')](handleError(_0x464d53,null));};exports[_0x0999('0x4b')]=function(_0x15abcb,_0x2b7bcf){return db[_0x0999('0x2d')]['create'](_0x15abcb[_0x0999('0x4c')],{})[_0x0999('0x23')](function(_0x557ab5){var _0x457f7c=_0x15abcb[_0x0999('0x4d')][_0x0999('0x25')]({'plain':!![]});if(!_0x457f7c)throw new Error(_0x0999('0x4e'));if(_0x457f7c[_0x0999('0x4f')]==='user'){var _0x28841a=_0x557ab5[_0x0999('0x25')]({'plain':!![]});var _0x43fe4a='IvrCampaigns';return db[_0x0999('0x50')][_0x0999('0x4a')]({'where':{'name':_0x43fe4a,'userProfileId':_0x457f7c[_0x0999('0x51')]},'raw':!![]})[_0x0999('0x23')](function(_0x44db1d){if(_0x44db1d&&_0x44db1d['autoAssociation']===0x0){return db[_0x0999('0x26')][_0x0999('0x4b')]({'name':_0x28841a[_0x0999('0x29')],'resourceId':_0x28841a['id'],'type':_0x44db1d[_0x0999('0x29')],'sectionId':_0x44db1d['id']},{})['then'](function(){return _0x557ab5;});}else{return _0x557ab5;}})[_0x0999('0x45')](function(_0x497e2d){logger[_0x0999('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x497e2d);throw _0x497e2d;});}return _0x557ab5;})[_0x0999('0x23')](respondWithResult(_0x2b7bcf,0xc9))[_0x0999('0x45')](handleError(_0x2b7bcf,null));};exports['clone']=function(_0x265785,_0x1c7418){var _0x1ba2ee={'where':{'id':_0x265785[_0x0999('0x46')]['id']}},_0x36f561={};_0x36f561[_0x0999('0x32')]=_['keys'](db[_0x0999('0x2d')][_0x0999('0x2e')]);_0x1ba2ee[_0x0999('0x35')]=_[_0x0999('0x48')](_0x36f561[_0x0999('0x32')],qs[_0x0999('0x36')](_0x265785[_0x0999('0x34')][_0x0999('0x36')]));_0x1ba2ee['attributes']=_0x1ba2ee[_0x0999('0x35')][_0x0999('0x37')]?_0x1ba2ee[_0x0999('0x35')]:_0x36f561[_0x0999('0x32')];if(_0x265785[_0x0999('0x34')]['includeAll']){_0x1ba2ee[_0x0999('0x42')]=[{'all':!![]}];}_0x1ba2ee=_['merge']({},_0x1ba2ee,_0x265785[_0x0999('0x41')]);return db[_0x0999('0x2d')][_0x0999('0x4a')](_0x1ba2ee)[_0x0999('0x23')](handleEntityNotFound(_0x1c7418,null))[_0x0999('0x23')](function(_0x64576d){if(_0x64576d){var _0x24ef48=_0x64576d[_0x0999('0x25')]({'plain':!![]});_0x24ef48=qs[_0x0999('0x52')](_0x24ef48,['id',_0x0999('0x53'),'updatedAt']);_0x265785[_0x0999('0x4c')]=_[_0x0999('0x52')](_0x265785[_0x0999('0x4c')],['id',_0x0999('0x53'),'updatedAt']);return db[_0x0999('0x2d')][_0x0999('0x4b')](_[_0x0999('0x40')](_0x24ef48,_0x265785[_0x0999('0x4c')]),{'include':_0x265785['query']['includeAll']?[{'all':!![]}]:undefined})[_0x0999('0x23')](function(_0xa83846){var _0x4428b6=_0x265785['user']['get']({'plain':!![]});if(!_0x4428b6)throw new Error(_0x0999('0x4e'));if(_0x4428b6[_0x0999('0x4f')]==='user'){var _0x106068=_0xa83846[_0x0999('0x25')]({'plain':!![]});var _0x21a436=_0x0999('0x54');return db['UserProfileSection']['find']({'where':{'name':_0x21a436,'userProfileId':_0x4428b6['userProfileId']},'raw':!![]})['then'](function(_0x3e3a56){if(_0x3e3a56&&_0x3e3a56[_0x0999('0x55')]===0x0){return db[_0x0999('0x26')][_0x0999('0x4b')]({'name':_0x106068[_0x0999('0x29')],'resourceId':_0x106068['id'],'type':_0x3e3a56[_0x0999('0x29')],'sectionId':_0x3e3a56['id']},{})[_0x0999('0x23')](function(){return _0xa83846;});}else{return _0xa83846;}})['catch'](function(_0x3f0196){logger[_0x0999('0x27')](_0x0999('0x56'),_0x3f0196);throw _0x3f0196;});}return _0xa83846;});}})['then'](respondWithResult(_0x1c7418,0xc9))[_0x0999('0x45')](handleError(_0x1c7418,null));};exports['update']=function(_0x28b440,_0x386da0){if(_0x28b440[_0x0999('0x4c')]['id']){delete _0x28b440[_0x0999('0x4c')]['id'];}return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0x28b440[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x386da0,null))['then'](saveUpdates(_0x28b440[_0x0999('0x4c')],null))[_0x0999('0x23')](respondWithResult(_0x386da0,null))[_0x0999('0x45')](handleError(_0x386da0,null));};exports[_0x0999('0x24')]=function(_0xc7b3f4,_0x198a43){return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0xc7b3f4[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x198a43,null))['then'](removeEntity(_0x198a43,null))[_0x0999('0x45')](handleError(_0x198a43,null));};exports[_0x0999('0x57')]=function(_0x5b8770,_0x4d4607,_0x2a9edc){var _0x4ae2de={'raw':!![],'where':{}};var _0x30a0da={};var _0x3987ee={'count':0x0,'rows':[]};return db[_0x0999('0x2d')][_0x0999('0x58')]({'where':{'id':_0x5b8770[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x4d4607,null))['then'](function(_0x246e42){if(_0x246e42){_0x30a0da['model']=_['keys'](db[_0x0999('0x59')][_0x0999('0x2e')]);_0x30a0da[_0x0999('0x34')]=_[_0x0999('0x47')](_0x5b8770['query']);_0x30a0da[_0x0999('0x33')]=_[_0x0999('0x48')](_0x30a0da[_0x0999('0x32')],_0x30a0da['query']);_0x4ae2de[_0x0999('0x35')]=_['intersection'](_0x30a0da[_0x0999('0x32')],qs[_0x0999('0x36')](_0x5b8770['query'][_0x0999('0x36')]));_0x4ae2de[_0x0999('0x35')]=_0x4ae2de[_0x0999('0x35')][_0x0999('0x37')]?_0x4ae2de[_0x0999('0x35')]:_0x30a0da['model'];if(!_0x5b8770[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x4ae2de['limit']=qs['limit'](_0x5b8770[_0x0999('0x34')][_0x0999('0x1c')]);_0x4ae2de[_0x0999('0x1b')]=qs[_0x0999('0x1b')](_0x5b8770[_0x0999('0x34')][_0x0999('0x1b')]);}_0x4ae2de['order']=qs[_0x0999('0x3b')](_0x5b8770[_0x0999('0x34')][_0x0999('0x3b')]);_0x4ae2de[_0x0999('0x3e')]=qs['filters'](_[_0x0999('0x3c')](_0x5b8770[_0x0999('0x34')],_0x30a0da['filters']));_0x4ae2de[_0x0999('0x3e')]['CampaignId']=_0x246e42['id'];if(_0x5b8770[_0x0999('0x34')][_0x0999('0x3d')]){_0x4ae2de[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x4ae2de[_0x0999('0x3e')],{'$or':_['map'](_0x4ae2de[_0x0999('0x35')],function(_0x3712c2){var _0x152aaf={};_0x152aaf[_0x3712c2]={'$like':'%'+_0x5b8770[_0x0999('0x34')][_0x0999('0x3d')]+'%'};return _0x152aaf;})});}_0x4ae2de=_[_0x0999('0x40')]({},_0x4ae2de,_0x5b8770[_0x0999('0x41')]);return db[_0x0999('0x59')][_0x0999('0x1a')]({'where':_0x4ae2de[_0x0999('0x3e')]})[_0x0999('0x23')](function(_0x4452b6){_0x3987ee[_0x0999('0x1a')]=_0x4452b6;if(_0x5b8770[_0x0999('0x34')][_0x0999('0x49')]){_0x4ae2de[_0x0999('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0x0999('0x43')](_0x4ae2de);})['then'](function(_0x2dbd3a){_0x3987ee[_0x0999('0x44')]=_0x2dbd3a;return _0x3987ee;});}})[_0x0999('0x23')](respondWithFilteredResult(_0x4d4607,_0x4ae2de))['catch'](handleError(_0x4d4607,null));};exports[_0x0999('0x5a')]=function(_0x2ee7dd,_0x3526a4,_0x1224ab){var _0x28e7c1={'raw':!![],'where':{}};var _0x1495d5={};var _0x2f8a46={'count':0x0,'rows':[]};return db[_0x0999('0x2d')][_0x0999('0x58')]({'where':{'id':_0x2ee7dd[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x3526a4,null))[_0x0999('0x23')](function(_0x34c021){if(_0x34c021){_0x1495d5[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x5b')][_0x0999('0x2e')]);_0x1495d5[_0x0999('0x34')]=_[_0x0999('0x47')](_0x2ee7dd[_0x0999('0x34')]);_0x1495d5['filters']=_['intersection'](_0x1495d5[_0x0999('0x32')],_0x1495d5[_0x0999('0x34')]);_0x28e7c1[_0x0999('0x35')]=_[_0x0999('0x48')](_0x1495d5[_0x0999('0x32')],qs[_0x0999('0x36')](_0x2ee7dd[_0x0999('0x34')]['fields']));_0x28e7c1['attributes']=_0x28e7c1[_0x0999('0x35')][_0x0999('0x37')]?_0x28e7c1['attributes']:_0x1495d5[_0x0999('0x32')];if(!_0x2ee7dd[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x28e7c1[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x2ee7dd[_0x0999('0x34')][_0x0999('0x1c')]);_0x28e7c1[_0x0999('0x1b')]=qs[_0x0999('0x1b')](_0x2ee7dd[_0x0999('0x34')][_0x0999('0x1b')]);}_0x28e7c1[_0x0999('0x3a')]=qs['sort'](_0x2ee7dd['query'][_0x0999('0x3b')]);_0x28e7c1[_0x0999('0x3e')]=qs['filters'](_[_0x0999('0x3c')](_0x2ee7dd[_0x0999('0x34')],_0x1495d5[_0x0999('0x33')]));_0x28e7c1[_0x0999('0x3e')]['CampaignId']=_0x34c021['id'];if(_0x2ee7dd['query']['filter']){_0x28e7c1[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x28e7c1[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0x28e7c1[_0x0999('0x35')],function(_0x2cc80d){var _0x46847e={};_0x46847e[_0x2cc80d]={'$like':'%'+_0x2ee7dd[_0x0999('0x34')]['filter']+'%'};return _0x46847e;})});}_0x28e7c1=_['merge']({},_0x28e7c1,_0x2ee7dd[_0x0999('0x41')]);return db[_0x0999('0x5b')][_0x0999('0x1a')]({'where':_0x28e7c1[_0x0999('0x3e')]})[_0x0999('0x23')](function(_0x2009f8){_0x2f8a46[_0x0999('0x1a')]=_0x2009f8;if(_0x2ee7dd['query'][_0x0999('0x49')]){_0x28e7c1[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5b')][_0x0999('0x43')](_0x28e7c1);})['then'](function(_0x21b1d5){_0x2f8a46[_0x0999('0x44')]=_0x21b1d5;return _0x2f8a46;});}})[_0x0999('0x23')](respondWithFilteredResult(_0x3526a4,_0x28e7c1))[_0x0999('0x45')](handleError(_0x3526a4,null));};exports[_0x0999('0x5c')]=function(_0x59bd3b,_0x35c1fd,_0x37e888){var _0x219d8b={'raw':!![],'where':{}};var _0x2fea6f={};var _0x2a0265={'count':0x0,'rows':[]};return db[_0x0999('0x2d')]['findOne']({'where':{'id':_0x59bd3b['params']['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x35c1fd,null))['then'](function(_0x525bbe){if(_0x525bbe){_0x2fea6f[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x5d')][_0x0999('0x2e')]);_0x2fea6f[_0x0999('0x34')]=_[_0x0999('0x47')](_0x59bd3b[_0x0999('0x34')]);_0x2fea6f[_0x0999('0x33')]=_['intersection'](_0x2fea6f[_0x0999('0x32')],_0x2fea6f[_0x0999('0x34')]);_0x219d8b[_0x0999('0x35')]=_[_0x0999('0x48')](_0x2fea6f[_0x0999('0x32')],qs[_0x0999('0x36')](_0x59bd3b[_0x0999('0x34')][_0x0999('0x36')]));_0x219d8b[_0x0999('0x35')]=_0x219d8b[_0x0999('0x35')]['length']?_0x219d8b[_0x0999('0x35')]:_0x2fea6f[_0x0999('0x32')];if(!_0x59bd3b[_0x0999('0x34')]['hasOwnProperty'](_0x0999('0x39'))){_0x219d8b[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x59bd3b['query'][_0x0999('0x1c')]);_0x219d8b[_0x0999('0x1b')]=qs['offset'](_0x59bd3b[_0x0999('0x34')][_0x0999('0x1b')]);}_0x219d8b['order']=qs[_0x0999('0x3b')](_0x59bd3b[_0x0999('0x34')][_0x0999('0x3b')]);_0x219d8b[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0x59bd3b['query'],_0x2fea6f[_0x0999('0x33')]));_0x219d8b['where'][_0x0999('0x5e')]=_0x525bbe['id'];if(_0x59bd3b[_0x0999('0x34')]['filter']){_0x219d8b[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x219d8b[_0x0999('0x3e')],{'$or':_['map'](_0x219d8b[_0x0999('0x35')],function(_0x58ffe7){var _0x54e7d9={};_0x54e7d9[_0x58ffe7]={'$like':'%'+_0x59bd3b[_0x0999('0x34')]['filter']+'%'};return _0x54e7d9;})});}_0x219d8b=_[_0x0999('0x40')]({},_0x219d8b,_0x59bd3b[_0x0999('0x41')]);return db[_0x0999('0x5d')]['count']({'where':_0x219d8b['where']})[_0x0999('0x23')](function(_0xd6019a){_0x2a0265[_0x0999('0x1a')]=_0xd6019a;if(_0x59bd3b[_0x0999('0x34')][_0x0999('0x49')]){_0x219d8b[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5d')][_0x0999('0x43')](_0x219d8b);})[_0x0999('0x23')](function(_0x5c35cf){_0x2a0265[_0x0999('0x44')]=_0x5c35cf;return _0x2a0265;});}})['then'](respondWithFilteredResult(_0x35c1fd,_0x219d8b))['catch'](handleError(_0x35c1fd,null));};exports['getHopperBlacks']=function(_0xb51bb8,_0x3ea772,_0x4a5516){var _0xe9bd52={'raw':!![],'where':{}};var _0x156b05={};var _0x5b47f4={'count':0x0,'rows':[]};return db[_0x0999('0x2d')][_0x0999('0x58')]({'where':{'id':_0xb51bb8[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ea772,null))[_0x0999('0x23')](function(_0x4721aa){if(_0x4721aa){_0x156b05[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x5f')]['rawAttributes']);_0x156b05['query']=_[_0x0999('0x47')](_0xb51bb8[_0x0999('0x34')]);_0x156b05[_0x0999('0x33')]=_[_0x0999('0x48')](_0x156b05['model'],_0x156b05['query']);_0xe9bd52[_0x0999('0x35')]=_[_0x0999('0x48')](_0x156b05[_0x0999('0x32')],qs['fields'](_0xb51bb8[_0x0999('0x34')][_0x0999('0x36')]));_0xe9bd52[_0x0999('0x35')]=_0xe9bd52[_0x0999('0x35')][_0x0999('0x37')]?_0xe9bd52[_0x0999('0x35')]:_0x156b05[_0x0999('0x32')];if(!_0xb51bb8[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0xe9bd52[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0xb51bb8['query']['limit']);_0xe9bd52['offset']=qs['offset'](_0xb51bb8['query']['offset']);}_0xe9bd52[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0xb51bb8['query'][_0x0999('0x3b')]);_0xe9bd52[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0xb51bb8[_0x0999('0x34')],_0x156b05[_0x0999('0x33')]));_0xe9bd52['where'][_0x0999('0x5e')]=_0x4721aa['id'];if(_0xb51bb8[_0x0999('0x34')][_0x0999('0x3d')]){_0xe9bd52[_0x0999('0x3e')]=_['merge'](_0xe9bd52[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0xe9bd52[_0x0999('0x35')],function(_0x241809){var _0x15f647={};_0x15f647[_0x241809]={'$like':'%'+_0xb51bb8['query'][_0x0999('0x3d')]+'%'};return _0x15f647;})});}_0xe9bd52=_[_0x0999('0x40')]({},_0xe9bd52,_0xb51bb8['options']);return db['CmHopperBlack']['count']({'where':_0xe9bd52[_0x0999('0x3e')]})['then'](function(_0x7048b8){_0x5b47f4[_0x0999('0x1a')]=_0x7048b8;if(_0xb51bb8[_0x0999('0x34')][_0x0999('0x49')]){_0xe9bd52[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5f')][_0x0999('0x43')](_0xe9bd52);})['then'](function(_0x74efb2){_0x5b47f4[_0x0999('0x44')]=_0x74efb2;return _0x5b47f4;});}})['then'](respondWithFilteredResult(_0x3ea772,_0xe9bd52))[_0x0999('0x45')](handleError(_0x3ea772,null));};exports[_0x0999('0x60')]=function(_0x5635d6,_0x1bdd98,_0x5382e5){var _0x3fc723={};var _0x4ddf2a={};var _0x2c0d4e;var _0x4cd956;return db[_0x0999('0x2d')]['findOne']({'where':{'id':_0x5635d6[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bdd98,null))['then'](function(_0x5d6c00){if(_0x5d6c00){_0x2c0d4e=_0x5d6c00;_0x4ddf2a[_0x0999('0x32')]=_[_0x0999('0x47')](db['CmList'][_0x0999('0x2e')]);_0x4ddf2a[_0x0999('0x34')]=_[_0x0999('0x47')](_0x5635d6[_0x0999('0x34')]);_0x4ddf2a[_0x0999('0x33')]=_[_0x0999('0x48')](_0x4ddf2a[_0x0999('0x32')],_0x4ddf2a[_0x0999('0x34')]);_0x3fc723['attributes']=_['intersection'](_0x4ddf2a[_0x0999('0x32')],qs[_0x0999('0x36')](_0x5635d6[_0x0999('0x34')][_0x0999('0x36')]));_0x3fc723['attributes']=_0x3fc723[_0x0999('0x35')][_0x0999('0x37')]?_0x3fc723[_0x0999('0x35')]:_0x4ddf2a[_0x0999('0x32')];_0x3fc723[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0x5635d6[_0x0999('0x34')][_0x0999('0x3b')]);_0x3fc723[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0x5635d6[_0x0999('0x34')],_0x4ddf2a[_0x0999('0x33')]));if(_0x5635d6[_0x0999('0x34')][_0x0999('0x3d')]){_0x3fc723[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x3fc723[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0x3fc723[_0x0999('0x35')],function(_0x2187ab){var _0x5b2a13={};_0x5b2a13[_0x2187ab]={'$like':'%'+_0x5635d6[_0x0999('0x34')][_0x0999('0x3d')]+'%'};return _0x5b2a13;})});}_0x3fc723=_[_0x0999('0x40')]({},_0x3fc723,_0x5635d6[_0x0999('0x41')]);return _0x2c0d4e[_0x0999('0x60')](_0x3fc723);}})['then'](function(_0x5eb6ca){if(_0x5eb6ca){_0x4cd956=_0x5eb6ca[_0x0999('0x37')];if(!_0x5635d6[_0x0999('0x34')][_0x0999('0x38')]('nolimit')){_0x3fc723[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x5635d6[_0x0999('0x34')]['limit']);_0x3fc723['offset']=qs[_0x0999('0x1b')](_0x5635d6[_0x0999('0x34')][_0x0999('0x1b')]);}return _0x2c0d4e[_0x0999('0x60')](_0x3fc723);}})['then'](function(_0x5f41f6){if(_0x5f41f6){return _0x5f41f6?{'count':_0x4cd956,'rows':_0x5f41f6}:null;}})[_0x0999('0x23')](respondWithResult(_0x1bdd98,null))[_0x0999('0x45')](handleError(_0x1bdd98,null));};exports[_0x0999('0x61')]=function(_0xb51c01,_0x47cfe2,_0x4546c7){var _0x25c88f,_0x2e759b;return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0xb51c01[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x47cfe2,null))['then'](function(_0x809ddd){if(_0x809ddd){_0x2e759b=_0x809ddd;return _0x809ddd[_0x0999('0x61')](_0xb51c01[_0x0999('0x4c')][_0x0999('0x62')],_[_0x0999('0x52')](_0xb51c01[_0x0999('0x4c')],[_0x0999('0x62'),'id'])||{});}return null;})[_0x0999('0x63')](function(_0x8956c){var _0x59e545;_0x25c88f=_0x8956c||[];var _0x1ff849=[];if(_0x8956c){for(var _0x547249=0x0;_0x547249<_0x8956c['length'];_0x547249+=0x1){var _0x27d318=_0x8956c[_0x547249][_0x0999('0x25')]({'plain':!![]});_0x2e759b[_0x0999('0x64')]=_0xb51c01[_0x0999('0x4c')]['dialCheckDuplicateType']?_0xb51c01[_0x0999('0x4c')]['dialCheckDuplicateType']:_0x2e759b[_0x0999('0x64')];switch(_0x2e759b[_0x0999('0x64')]){case'always':_0x59e545=squel[_0x0999('0x65')]()[_0x0999('0x66')](_0x0999('0x67'))['fromQuery'](['phone','scheduledAt','ContactId',_0x0999('0x68'),_0x0999('0x5e'),_0x0999('0x53'),'updatedAt'],squel[_0x0999('0x69')]()['field']('phone','phone')[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x6c'))[_0x0999('0x6a')]('id',_0x0999('0x6d'))[_0x0999('0x6a')](_0x27d318[_0x0999('0x6e')][_0x0999('0x6f')](),_0x0999('0x68'))[_0x0999('0x6a')](_0xb51c01[_0x0999('0x46')]['id']['toString'](),_0x0999('0x5e'))[_0x0999('0x6a')](_0x0999('0x6b'),'createdAt')['field'](_0x0999('0x6b'),_0x0999('0x70'))['from'](_0x0999('0x71'))[_0x0999('0x3e')](_0x0999('0x72'))[_0x0999('0x3e')](_0x0999('0x73'),_0x27d318[_0x0999('0x6e')]['toString']())['where'](_0x0999('0x74'))[_0x0999('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x75'))[_0x0999('0x76')](_0x0999('0x77'))[_0x0999('0x3e')](_0x0999('0x78'),_0xb51c01[_0x0999('0x46')]['id']['toString']()))[_0x0999('0x3e')](_0x0999('0x79'),squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7a'))['from'](_0x0999('0x67'))[_0x0999('0x3e')](_0x0999('0x78'),_0xb51c01[_0x0999('0x46')]['id'][_0x0999('0x6f')]())))[_0x0999('0x6f')]();break;case _0x0999('0x7b'):_0x59e545=squel['insert']()[_0x0999('0x66')]('cm_hopper')[_0x0999('0x7c')]([_0x0999('0x7d'),'scheduledAt',_0x0999('0x6d'),_0x0999('0x68'),_0x0999('0x5e'),_0x0999('0x53'),_0x0999('0x70')],squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7d'),_0x0999('0x7d'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x6c'))[_0x0999('0x6a')]('id',_0x0999('0x6d'))['field'](_0x27d318['CmListId'][_0x0999('0x6f')](),_0x0999('0x68'))[_0x0999('0x6a')](_0xb51c01[_0x0999('0x46')]['id'][_0x0999('0x6f')](),_0x0999('0x5e'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x53'))[_0x0999('0x6a')](_0x0999('0x6b'),'updatedAt')[_0x0999('0x76')](_0x0999('0x71'))[_0x0999('0x3e')](_0x0999('0x72'))[_0x0999('0x3e')](_0x0999('0x73'),_0x27d318['CmListId']['toString']())['where'](_0x0999('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7a'))[_0x0999('0x76')]('cm_hopper')['where'](_0x0999('0x78'),_0xb51c01[_0x0999('0x46')]['id']['toString']())))[_0x0999('0x6f')]();break;default:_0x59e545=squel[_0x0999('0x65')]()[_0x0999('0x66')]('cm_hopper')[_0x0999('0x7c')]([_0x0999('0x7d'),_0x0999('0x6c'),'ContactId',_0x0999('0x68'),_0x0999('0x5e'),'createdAt',_0x0999('0x70')],squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7d'),_0x0999('0x7d'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x6c'))['field']('id',_0x0999('0x6d'))[_0x0999('0x6a')](_0x27d318[_0x0999('0x6e')]['toString'](),'ListId')['field'](_0xb51c01[_0x0999('0x46')]['id'][_0x0999('0x6f')](),_0x0999('0x5e'))[_0x0999('0x6a')]('NOW()','createdAt')[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x70'))[_0x0999('0x76')](_0x0999('0x71'))[_0x0999('0x3e')](_0x0999('0x72'))[_0x0999('0x3e')](_0x0999('0x73'),_0x27d318['CmListId'][_0x0999('0x6f')]())[_0x0999('0x3e')](_0x0999('0x74')))[_0x0999('0x6f')]();}_0x1ff849['push'](db[_0x0999('0x7e')][_0x0999('0x34')](_0x59e545));}return BPromise[_0x0999('0x7f')](_0x1ff849);}})[_0x0999('0x23')](function(){return _0x25c88f;})[_0x0999('0x23')](respondWithResult(_0x47cfe2,null))[_0x0999('0x45')](handleError(_0x47cfe2,null));};exports['removeLists']=function(_0x2a4d7a,_0xa13da4,_0x55e8c9){return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0x2a4d7a[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0xa13da4,null))[_0x0999('0x23')](function(_0x2fdc0b){if(_0x2fdc0b){return _0x2fdc0b[_0x0999('0x80')](_0x2a4d7a[_0x0999('0x34')]['ids']);}})['then'](function(_0x521afa){if(_0x521afa){return db[_0x0999('0x59')]['destroy']({'where':{'ListId':_0x2a4d7a[_0x0999('0x34')][_0x0999('0x62')],'CampaignId':_0x2a4d7a['params']['id']}})[_0x0999('0x23')](function(){return _0x521afa;});}})[_0x0999('0x23')](respondWithStatusCode(_0xa13da4,null))['catch'](handleError(_0xa13da4,null));};exports[_0x0999('0x81')]=function(_0xf542f9,_0x240568,_0x318b79){var _0x5afd71={};var _0x29979d={};var _0x4b4a62;var _0x242913;return db['Campaign']['findOne']({'where':{'id':_0xf542f9[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x240568,null))[_0x0999('0x23')](function(_0x134b1f){if(_0x134b1f){_0x4b4a62=_0x134b1f;_0x29979d[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x82')][_0x0999('0x2e')]);_0x29979d[_0x0999('0x34')]=_['keys'](_0xf542f9[_0x0999('0x34')]);_0x29979d['filters']=_['intersection'](_0x29979d[_0x0999('0x32')],_0x29979d['query']);_0x5afd71['attributes']=_[_0x0999('0x48')](_0x29979d[_0x0999('0x32')],qs[_0x0999('0x36')](_0xf542f9[_0x0999('0x34')][_0x0999('0x36')]));_0x5afd71[_0x0999('0x35')]=_0x5afd71[_0x0999('0x35')][_0x0999('0x37')]?_0x5afd71[_0x0999('0x35')]:_0x29979d[_0x0999('0x32')];_0x5afd71[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0xf542f9['query'][_0x0999('0x3b')]);_0x5afd71[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0xf542f9[_0x0999('0x34')],_0x29979d[_0x0999('0x33')]));if(_0xf542f9[_0x0999('0x34')][_0x0999('0x3d')]){_0x5afd71['where']=_[_0x0999('0x40')](_0x5afd71[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0x5afd71[_0x0999('0x35')],function(_0x4dada5){var _0x211877={};_0x211877[_0x4dada5]={'$like':'%'+_0xf542f9[_0x0999('0x34')][_0x0999('0x3d')]+'%'};return _0x211877;})});}_0x5afd71=_[_0x0999('0x40')]({},_0x5afd71,_0xf542f9['options']);return _0x4b4a62[_0x0999('0x81')](_0x5afd71);}})[_0x0999('0x23')](function(_0x19cfb5){if(_0x19cfb5){_0x242913=_0x19cfb5[_0x0999('0x37')];if(!_0xf542f9[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x5afd71[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0xf542f9[_0x0999('0x34')][_0x0999('0x1c')]);_0x5afd71['offset']=qs[_0x0999('0x1b')](_0xf542f9[_0x0999('0x34')][_0x0999('0x1b')]);}return _0x4b4a62['getBlackLists'](_0x5afd71);}})[_0x0999('0x23')](function(_0x2c5bee){if(_0x2c5bee){return _0x2c5bee?{'count':_0x242913,'rows':_0x2c5bee}:null;}})[_0x0999('0x23')](respondWithResult(_0x240568,null))['catch'](handleError(_0x240568,null));};exports[_0x0999('0x83')]=function(_0x50e95f,_0x43f7bb,_0x42191b){var _0xd31557,_0x704d2f;return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0x50e95f[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x43f7bb,null))[_0x0999('0x23')](function(_0x319ec8){if(_0x319ec8){_0x704d2f=_0x319ec8;return _0x319ec8['addBlackLists'](_0x50e95f[_0x0999('0x4c')]['ids'],_[_0x0999('0x52')](_0x50e95f[_0x0999('0x4c')],[_0x0999('0x62'),'id'])||{});}return null;})[_0x0999('0x63')](function(_0x5b6e10){var _0x16ae05;_0xd31557=_0x5b6e10||[];var _0x42cdeb=[];if(_0x5b6e10){for(var _0x2c36d1=0x0;_0x2c36d1<_0x5b6e10['length'];_0x2c36d1+=0x1){var _0x2cd537=_0x5b6e10[_0x2c36d1][_0x0999('0x25')]({'plain':!![]});_0x16ae05=squel[_0x0999('0x65')]()[_0x0999('0x66')](_0x0999('0x84'))['fromQuery'](['phone',_0x0999('0x6d'),'ListId','CampaignId',_0x0999('0x53'),_0x0999('0x70')],squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7d'),_0x0999('0x7d'))[_0x0999('0x6a')]('id',_0x0999('0x6d'))['field'](_0x2cd537[_0x0999('0x6e')][_0x0999('0x6f')](),_0x0999('0x68'))['field'](_0x50e95f[_0x0999('0x46')]['id'][_0x0999('0x6f')](),_0x0999('0x5e'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x53'))['field'](_0x0999('0x6b'),'updatedAt')[_0x0999('0x76')](_0x0999('0x71'))['where'](_0x0999('0x72'))['where'](_0x0999('0x73'),_0x2cd537[_0x0999('0x6e')][_0x0999('0x6f')]())['where'](_0x0999('0x74')))[_0x0999('0x6f')]();_0x42cdeb[_0x0999('0x85')](db['sequelize'][_0x0999('0x34')](_0x16ae05));}return BPromise[_0x0999('0x7f')](_0x42cdeb);}})['then'](function(){return _0xd31557;})[_0x0999('0x23')](respondWithResult(_0x43f7bb,null))[_0x0999('0x45')](handleError(_0x43f7bb,null));};exports['removeBlackLists']=function(_0x2080d4,_0x55a2a5,_0x1f2102){return db[_0x0999('0x2d')]['find']({'where':{'id':_0x2080d4[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x55a2a5,null))[_0x0999('0x23')](function(_0x18964f){if(_0x18964f){return _0x18964f[_0x0999('0x86')](_0x2080d4[_0x0999('0x34')]['ids']);}})['then'](function(_0x459baf){if(_0x459baf){return db['CmHopperBlack'][_0x0999('0x24')]({'where':{'ListId':_0x2080d4[_0x0999('0x34')][_0x0999('0x62')],'CampaignId':_0x2080d4['params']['id']}})[_0x0999('0x23')](function(){return _0x459baf;});}})['then'](respondWithStatusCode(_0x55a2a5,null))[_0x0999('0x45')](handleError(_0x55a2a5,null));};
\ No newline at end of file
+var _0x1bc8=['limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','params','find','body','user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','nolimit','CampaignId','CmHopper','CmHopperHistory','getHopperFinals','findOne','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','insert','into','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','CmHopperBlack','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end'];(function(_0x319bb7,_0x23b732){var _0x4e2ddf=function(_0x4fed00){while(--_0x4fed00){_0x319bb7['push'](_0x319bb7['shift']());}};_0x4e2ddf(++_0x23b732);}(_0x1bc8,0x17c));var _0x81bc=function(_0x3076ed,_0x23db8a){_0x3076ed=_0x3076ed-0x0;var _0x25a6a9=_0x1bc8[_0x3076ed];return _0x25a6a9;};'use strict';var emlformat=require(_0x81bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x81bc('0x1'));var jsonpatch=require(_0x81bc('0x2'));var rp=require('request-promise');var moment=require(_0x81bc('0x3'));var BPromise=require(_0x81bc('0x4'));var Mustache=require(_0x81bc('0x5'));var util=require(_0x81bc('0x6'));var path=require(_0x81bc('0x7'));var sox=require('sox');var csv=require(_0x81bc('0x8'));var ejs=require(_0x81bc('0x9'));var fs=require('fs');var fs_extra=require(_0x81bc('0xa'));var _=require(_0x81bc('0xb'));var squel=require(_0x81bc('0xc'));var crypto=require('crypto');var jsforce=require(_0x81bc('0xd'));var deskjs=require(_0x81bc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x81bc('0xf'));var Papa=require(_0x81bc('0x10'));var Redis=require(_0x81bc('0x11'));var authService=require(_0x81bc('0x12'));var qs=require(_0x81bc('0x13'));var as=require(_0x81bc('0x14'));var hardwareService=require(_0x81bc('0x15'));var logger=require(_0x81bc('0x16'))(_0x81bc('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x81bc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x188e2b,_0x5e7626){_0x5e7626=_0x5e7626||0xcc;return function(_0x59651d){if(_0x59651d){return _0x188e2b[_0x81bc('0x19')](_0x5e7626);}return _0x188e2b[_0x81bc('0x1a')](_0x5e7626)[_0x81bc('0x1b')]();};}function respondWithResult(_0x165cf1,_0x5ef171){_0x5ef171=_0x5ef171||0xc8;return function(_0x3cf9fa){if(_0x3cf9fa){return _0x165cf1['status'](_0x5ef171)['json'](_0x3cf9fa);}};}function respondWithFilteredResult(_0x4b11c1,_0x1142eb){return function(_0x556a51){if(_0x556a51){var _0x41623c=typeof _0x1142eb['offset']==='undefined'&&typeof _0x1142eb[_0x81bc('0x1c')]===_0x81bc('0x1d');var _0x4702d2=_0x556a51[_0x81bc('0x1e')];var _0xef513d=_0x41623c?0x0:_0x1142eb[_0x81bc('0x1f')];var _0x4edfe1=_0x41623c?_0x556a51[_0x81bc('0x1e')]:_0x1142eb[_0x81bc('0x1f')]+_0x1142eb[_0x81bc('0x1c')];var _0x59f29f;if(_0x4edfe1>=_0x4702d2){_0x4edfe1=_0x4702d2;_0x59f29f=0xc8;}else{_0x59f29f=0xce;}_0x4b11c1[_0x81bc('0x1a')](_0x59f29f);return _0x4b11c1[_0x81bc('0x20')](_0x81bc('0x21'),_0xef513d+'-'+_0x4edfe1+'/'+_0x4702d2)['json'](_0x556a51);}return null;};}function patchUpdates(_0x31fb8e){return function(_0x5051b9){try{jsonpatch[_0x81bc('0x22')](_0x5051b9,_0x31fb8e,!![]);}catch(_0x5a39ec){return BPromise['reject'](_0x5a39ec);}return _0x5051b9[_0x81bc('0x23')]();};}function saveUpdates(_0x8e8ed6,_0x50d0b3){return function(_0x3757c1){if(_0x3757c1){return _0x3757c1[_0x81bc('0x24')](_0x8e8ed6)[_0x81bc('0x25')](function(_0x516b97){return _0x516b97;});}return null;};}function removeEntity(_0x46882b,_0x537d56){return function(_0x510180){if(_0x510180){return _0x510180[_0x81bc('0x26')]()[_0x81bc('0x25')](function(){var _0x5d0190=_0x510180[_0x81bc('0x27')]({'plain':!![]});var _0x4a5635=_0x81bc('0x28');return db[_0x81bc('0x29')][_0x81bc('0x26')]({'where':{'type':_0x4a5635,'resourceId':_0x5d0190['id']}})[_0x81bc('0x25')](function(){return _0x510180;});})['then'](function(){_0x46882b['status'](0xcc)[_0x81bc('0x1b')]();});}};}function handleEntityNotFound(_0x248a4d,_0x310f8e){return function(_0x3468ca){if(!_0x3468ca){_0x248a4d['sendStatus'](0x194);}return _0x3468ca;};}function handleError(_0x54b40a,_0x38af59){_0x38af59=_0x38af59||0x1f4;return function(_0x1444e3){logger[_0x81bc('0x2a')](_0x1444e3[_0x81bc('0x2b')]);if(_0x1444e3[_0x81bc('0x2c')]){delete _0x1444e3['name'];}_0x54b40a[_0x81bc('0x1a')](_0x38af59)[_0x81bc('0x2d')](_0x1444e3);};}exports[_0x81bc('0x2e')]=function(_0x398fc1,_0x531ce9){var _0x16ba57={},_0x5967ed={},_0x52db27={'count':0x0,'rows':[]};var _0x101e08=_[_0x81bc('0x2f')](db['Campaign'][_0x81bc('0x30')],function(_0x39c9c1){return{'name':_0x39c9c1[_0x81bc('0x31')],'type':_0x39c9c1[_0x81bc('0x32')][_0x81bc('0x33')]};});_0x5967ed[_0x81bc('0x34')]=_['map'](_0x101e08,_0x81bc('0x2c'));_0x5967ed[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x398fc1[_0x81bc('0x35')]);_0x5967ed['filters']=_[_0x81bc('0x37')](_0x5967ed['model'],_0x5967ed[_0x81bc('0x35')]);_0x16ba57[_0x81bc('0x38')]=_[_0x81bc('0x37')](_0x5967ed[_0x81bc('0x34')],qs[_0x81bc('0x39')](_0x398fc1[_0x81bc('0x35')][_0x81bc('0x39')]));_0x16ba57[_0x81bc('0x38')]=_0x16ba57[_0x81bc('0x38')][_0x81bc('0x3a')]?_0x16ba57[_0x81bc('0x38')]:_0x5967ed[_0x81bc('0x34')];if(!_0x398fc1[_0x81bc('0x35')][_0x81bc('0x3b')]('nolimit')){_0x16ba57[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x398fc1['query'][_0x81bc('0x1c')]);_0x16ba57['offset']=qs[_0x81bc('0x1f')](_0x398fc1[_0x81bc('0x35')]['offset']);}_0x16ba57[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x398fc1[_0x81bc('0x35')][_0x81bc('0x3d')]);_0x16ba57[_0x81bc('0x3e')]=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x398fc1[_0x81bc('0x35')],_0x5967ed['filters']),_0x101e08);if(_0x398fc1[_0x81bc('0x35')][_0x81bc('0x41')]){_0x16ba57[_0x81bc('0x3e')]=_[_0x81bc('0x42')](_0x16ba57['where'],{'$or':_[_0x81bc('0x2f')](_0x101e08,function(_0x1a581e){if(_0x1a581e[_0x81bc('0x32')]!==_0x81bc('0x43')){var _0x236948={};_0x236948[_0x1a581e[_0x81bc('0x2c')]]={'$like':'%'+_0x398fc1[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x236948;}})});}_0x16ba57=_[_0x81bc('0x42')]({},_0x16ba57,_0x398fc1[_0x81bc('0x44')]);var _0x335472={'where':_0x16ba57[_0x81bc('0x3e')]};return db[_0x81bc('0x45')][_0x81bc('0x1e')](_0x335472)[_0x81bc('0x25')](function(_0xb379f7){_0x52db27[_0x81bc('0x1e')]=_0xb379f7;if(_0x398fc1['query'][_0x81bc('0x46')]){_0x16ba57[_0x81bc('0x47')]=[{'all':!![]}];}return db[_0x81bc('0x45')][_0x81bc('0x48')](_0x16ba57);})[_0x81bc('0x25')](function(_0x5a0bc9){_0x52db27[_0x81bc('0x49')]=_0x5a0bc9;return _0x52db27;})['then'](respondWithFilteredResult(_0x531ce9,_0x16ba57))[_0x81bc('0x4a')](handleError(_0x531ce9,null));};exports['show']=function(_0x33d083,_0x17a09d){var _0x4e1823={'raw':![],'where':{'id':_0x33d083[_0x81bc('0x4b')]['id']}},_0x347afa={};_0x347afa[_0x81bc('0x34')]=_[_0x81bc('0x36')](db['Campaign']['rawAttributes']);_0x347afa[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x33d083['query']);_0x347afa['filters']=_[_0x81bc('0x37')](_0x347afa[_0x81bc('0x34')],_0x347afa['query']);_0x4e1823['attributes']=_[_0x81bc('0x37')](_0x347afa['model'],qs['fields'](_0x33d083['query'][_0x81bc('0x39')]));_0x4e1823[_0x81bc('0x38')]=_0x4e1823[_0x81bc('0x38')][_0x81bc('0x3a')]?_0x4e1823['attributes']:_0x347afa[_0x81bc('0x34')];if(_0x33d083[_0x81bc('0x35')][_0x81bc('0x46')]){_0x4e1823[_0x81bc('0x47')]=[{'all':!![]}];}_0x4e1823=_['merge']({},_0x4e1823,_0x33d083[_0x81bc('0x44')]);return db[_0x81bc('0x45')][_0x81bc('0x4c')](_0x4e1823)[_0x81bc('0x25')](handleEntityNotFound(_0x17a09d,null))[_0x81bc('0x25')](respondWithResult(_0x17a09d,null))[_0x81bc('0x4a')](handleError(_0x17a09d,null));};exports['create']=function(_0x9427cd,_0x3740ca){return db[_0x81bc('0x45')]['create'](_0x9427cd[_0x81bc('0x4d')],{})[_0x81bc('0x25')](function(_0x1d0ff0){var _0x535855=_0x9427cd[_0x81bc('0x4e')][_0x81bc('0x27')]({'plain':!![]});if(!_0x535855)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x535855[_0x81bc('0x4f')]===_0x81bc('0x4e')){var _0x2f7483=_0x1d0ff0[_0x81bc('0x27')]({'plain':!![]});var _0x2e4f46=_0x81bc('0x28');return db[_0x81bc('0x50')][_0x81bc('0x4c')]({'where':{'name':_0x2e4f46,'userProfileId':_0x535855[_0x81bc('0x51')]},'raw':!![]})[_0x81bc('0x25')](function(_0x3236e7){if(_0x3236e7&&_0x3236e7['autoAssociation']===0x0){return db[_0x81bc('0x29')][_0x81bc('0x52')]({'name':_0x2f7483[_0x81bc('0x2c')],'resourceId':_0x2f7483['id'],'type':_0x3236e7[_0x81bc('0x2c')],'sectionId':_0x3236e7['id']},{})[_0x81bc('0x25')](function(){return _0x1d0ff0;});}else{return _0x1d0ff0;}})[_0x81bc('0x4a')](function(_0x442488){logger[_0x81bc('0x2a')](_0x81bc('0x53'),_0x442488);throw _0x442488;});}return _0x1d0ff0;})['then'](respondWithResult(_0x3740ca,0xc9))[_0x81bc('0x4a')](handleError(_0x3740ca,null));};exports[_0x81bc('0x54')]=function(_0x5f21af,_0x5b5646){var _0x87ecd1={'where':{'id':_0x5f21af[_0x81bc('0x4b')]['id']}},_0x5895ac={};_0x5895ac[_0x81bc('0x34')]=_[_0x81bc('0x36')](db[_0x81bc('0x45')][_0x81bc('0x30')]);_0x87ecd1[_0x81bc('0x38')]=_[_0x81bc('0x37')](_0x5895ac['model'],qs[_0x81bc('0x39')](_0x5f21af[_0x81bc('0x35')]['fields']));_0x87ecd1['attributes']=_0x87ecd1['attributes']['length']?_0x87ecd1[_0x81bc('0x38')]:_0x5895ac['model'];if(_0x5f21af[_0x81bc('0x35')][_0x81bc('0x46')]){_0x87ecd1[_0x81bc('0x47')]=[{'all':!![]}];}_0x87ecd1=_[_0x81bc('0x42')]({},_0x87ecd1,_0x5f21af[_0x81bc('0x44')]);return db[_0x81bc('0x45')]['find'](_0x87ecd1)[_0x81bc('0x25')](handleEntityNotFound(_0x5b5646,null))['then'](function(_0x50d69b){if(_0x50d69b){var _0x5d0d2a=_0x50d69b[_0x81bc('0x27')]({'plain':!![]});_0x5d0d2a=qs[_0x81bc('0x55')](_0x5d0d2a,['id',_0x81bc('0x56'),_0x81bc('0x57')]);_0x5f21af['body']=_[_0x81bc('0x55')](_0x5f21af[_0x81bc('0x4d')],['id',_0x81bc('0x56'),'updatedAt']);return db[_0x81bc('0x45')][_0x81bc('0x52')](_[_0x81bc('0x42')](_0x5d0d2a,_0x5f21af[_0x81bc('0x4d')]),{'include':_0x5f21af[_0x81bc('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x81bc('0x25')](function(_0x2524a9){var _0x115aeb=_0x5f21af[_0x81bc('0x4e')]['get']({'plain':!![]});if(!_0x115aeb)throw new Error(_0x81bc('0x58'));if(_0x115aeb[_0x81bc('0x4f')]===_0x81bc('0x4e')){var _0xb3c53b=_0x2524a9[_0x81bc('0x27')]({'plain':!![]});var _0x2bc3e0=_0x81bc('0x28');return db[_0x81bc('0x50')][_0x81bc('0x4c')]({'where':{'name':_0x2bc3e0,'userProfileId':_0x115aeb['userProfileId']},'raw':!![]})['then'](function(_0xf6c3f4){if(_0xf6c3f4&&_0xf6c3f4['autoAssociation']===0x0){return db[_0x81bc('0x29')][_0x81bc('0x52')]({'name':_0xb3c53b[_0x81bc('0x2c')],'resourceId':_0xb3c53b['id'],'type':_0xf6c3f4[_0x81bc('0x2c')],'sectionId':_0xf6c3f4['id']},{})[_0x81bc('0x25')](function(){return _0x2524a9;});}else{return _0x2524a9;}})[_0x81bc('0x4a')](function(_0x2b175d){logger[_0x81bc('0x2a')](_0x81bc('0x53'),_0x2b175d);throw _0x2b175d;});}return _0x2524a9;});}})['then'](respondWithResult(_0x5b5646,0xc9))['catch'](handleError(_0x5b5646,null));};exports['update']=function(_0x21673e,_0x41fb1f){if(_0x21673e[_0x81bc('0x4d')]['id']){delete _0x21673e['body']['id'];}return db[_0x81bc('0x45')][_0x81bc('0x4c')]({'where':{'id':_0x21673e['params']['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x41fb1f,null))[_0x81bc('0x25')](saveUpdates(_0x21673e[_0x81bc('0x4d')],null))[_0x81bc('0x25')](respondWithResult(_0x41fb1f,null))[_0x81bc('0x4a')](handleError(_0x41fb1f,null));};exports['destroy']=function(_0x1b8335,_0x146779){return db[_0x81bc('0x45')][_0x81bc('0x4c')]({'where':{'id':_0x1b8335[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x146779,null))[_0x81bc('0x25')](removeEntity(_0x146779,null))['catch'](handleError(_0x146779,null));};exports[_0x81bc('0x59')]=function(_0x5e33b7,_0x508eec,_0x53046c){var _0x5580b3={'raw':!![],'where':{}};var _0x3d0107={};var _0x4a2f45={'count':0x0,'rows':[]};return db[_0x81bc('0x45')]['findOne']({'where':{'id':_0x5e33b7[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x508eec,null))[_0x81bc('0x25')](function(_0x5dc53c){if(_0x5dc53c){_0x3d0107[_0x81bc('0x34')]=_[_0x81bc('0x36')](db['CmHopper']['rawAttributes']);_0x3d0107[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x5e33b7[_0x81bc('0x35')]);_0x3d0107['filters']=_[_0x81bc('0x37')](_0x3d0107[_0x81bc('0x34')],_0x3d0107[_0x81bc('0x35')]);_0x5580b3[_0x81bc('0x38')]=_['intersection'](_0x3d0107['model'],qs['fields'](_0x5e33b7[_0x81bc('0x35')]['fields']));_0x5580b3[_0x81bc('0x38')]=_0x5580b3[_0x81bc('0x38')][_0x81bc('0x3a')]?_0x5580b3['attributes']:_0x3d0107['model'];if(!_0x5e33b7[_0x81bc('0x35')]['hasOwnProperty'](_0x81bc('0x5a'))){_0x5580b3[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x5e33b7[_0x81bc('0x35')][_0x81bc('0x1c')]);_0x5580b3[_0x81bc('0x1f')]=qs['offset'](_0x5e33b7['query'][_0x81bc('0x1f')]);}_0x5580b3[_0x81bc('0x3c')]=qs['sort'](_0x5e33b7[_0x81bc('0x35')]['sort']);_0x5580b3['where']=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x5e33b7[_0x81bc('0x35')],_0x3d0107[_0x81bc('0x3f')]));_0x5580b3[_0x81bc('0x3e')][_0x81bc('0x5b')]=_0x5dc53c['id'];if(_0x5e33b7[_0x81bc('0x35')]['filter']){_0x5580b3['where']=_['merge'](_0x5580b3['where'],{'$or':_['map'](_0x5580b3[_0x81bc('0x38')],function(_0x37c554){var _0x6f4d62={};_0x6f4d62[_0x37c554]={'$like':'%'+_0x5e33b7[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x6f4d62;})});}_0x5580b3=_[_0x81bc('0x42')]({},_0x5580b3,_0x5e33b7[_0x81bc('0x44')]);return db[_0x81bc('0x5c')]['count']({'where':_0x5580b3[_0x81bc('0x3e')]})[_0x81bc('0x25')](function(_0x58b103){_0x4a2f45['count']=_0x58b103;if(_0x5e33b7[_0x81bc('0x35')][_0x81bc('0x46')]){_0x5580b3['include']=[{'all':!![]}];}return db[_0x81bc('0x5c')][_0x81bc('0x48')](_0x5580b3);})[_0x81bc('0x25')](function(_0x157693){_0x4a2f45['rows']=_0x157693;return _0x4a2f45;});}})[_0x81bc('0x25')](respondWithFilteredResult(_0x508eec,_0x5580b3))[_0x81bc('0x4a')](handleError(_0x508eec,null));};exports['getHopperHistories']=function(_0x299edc,_0x4d0cef,_0x24f716){var _0x31f950={'raw':!![],'where':{}};var _0x311d89={};var _0x539c02={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x299edc[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x4d0cef,null))[_0x81bc('0x25')](function(_0x115971){if(_0x115971){_0x311d89['model']=_[_0x81bc('0x36')](db[_0x81bc('0x5d')][_0x81bc('0x30')]);_0x311d89['query']=_['keys'](_0x299edc[_0x81bc('0x35')]);_0x311d89[_0x81bc('0x3f')]=_[_0x81bc('0x37')](_0x311d89[_0x81bc('0x34')],_0x311d89[_0x81bc('0x35')]);_0x31f950['attributes']=_[_0x81bc('0x37')](_0x311d89[_0x81bc('0x34')],qs[_0x81bc('0x39')](_0x299edc[_0x81bc('0x35')][_0x81bc('0x39')]));_0x31f950[_0x81bc('0x38')]=_0x31f950[_0x81bc('0x38')]['length']?_0x31f950[_0x81bc('0x38')]:_0x311d89[_0x81bc('0x34')];if(!_0x299edc[_0x81bc('0x35')][_0x81bc('0x3b')](_0x81bc('0x5a'))){_0x31f950[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x299edc[_0x81bc('0x35')][_0x81bc('0x1c')]);_0x31f950['offset']=qs[_0x81bc('0x1f')](_0x299edc[_0x81bc('0x35')][_0x81bc('0x1f')]);}_0x31f950[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x299edc['query'][_0x81bc('0x3d')]);_0x31f950[_0x81bc('0x3e')]=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x299edc['query'],_0x311d89[_0x81bc('0x3f')]));_0x31f950[_0x81bc('0x3e')][_0x81bc('0x5b')]=_0x115971['id'];if(_0x299edc[_0x81bc('0x35')]['filter']){_0x31f950[_0x81bc('0x3e')]=_[_0x81bc('0x42')](_0x31f950[_0x81bc('0x3e')],{'$or':_['map'](_0x31f950[_0x81bc('0x38')],function(_0x28796f){var _0x56f671={};_0x56f671[_0x28796f]={'$like':'%'+_0x299edc[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x56f671;})});}_0x31f950=_[_0x81bc('0x42')]({},_0x31f950,_0x299edc['options']);return db[_0x81bc('0x5d')][_0x81bc('0x1e')]({'where':_0x31f950[_0x81bc('0x3e')]})[_0x81bc('0x25')](function(_0x2e26d0){_0x539c02[_0x81bc('0x1e')]=_0x2e26d0;if(_0x299edc[_0x81bc('0x35')][_0x81bc('0x46')]){_0x31f950[_0x81bc('0x47')]=[{'all':!![]}];}return db[_0x81bc('0x5d')]['findAll'](_0x31f950);})['then'](function(_0x4ac4ae){_0x539c02[_0x81bc('0x49')]=_0x4ac4ae;return _0x539c02;});}})[_0x81bc('0x25')](respondWithFilteredResult(_0x4d0cef,_0x31f950))[_0x81bc('0x4a')](handleError(_0x4d0cef,null));};exports[_0x81bc('0x5e')]=function(_0x5f4d67,_0x5c2ac5,_0x5d3b2c){var _0x5c72f8={'raw':!![],'where':{}};var _0x5d505d={};var _0x3da3e4={'count':0x0,'rows':[]};return db[_0x81bc('0x45')]['findOne']({'where':{'id':_0x5f4d67[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x5c2ac5,null))[_0x81bc('0x25')](function(_0x20b7b8){if(_0x20b7b8){_0x5d505d[_0x81bc('0x34')]=_[_0x81bc('0x36')](db['CmHopperFinal']['rawAttributes']);_0x5d505d[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x5f4d67[_0x81bc('0x35')]);_0x5d505d[_0x81bc('0x3f')]=_[_0x81bc('0x37')](_0x5d505d[_0x81bc('0x34')],_0x5d505d[_0x81bc('0x35')]);_0x5c72f8[_0x81bc('0x38')]=_[_0x81bc('0x37')](_0x5d505d[_0x81bc('0x34')],qs[_0x81bc('0x39')](_0x5f4d67['query'][_0x81bc('0x39')]));_0x5c72f8[_0x81bc('0x38')]=_0x5c72f8['attributes'][_0x81bc('0x3a')]?_0x5c72f8[_0x81bc('0x38')]:_0x5d505d[_0x81bc('0x34')];if(!_0x5f4d67[_0x81bc('0x35')][_0x81bc('0x3b')](_0x81bc('0x5a'))){_0x5c72f8[_0x81bc('0x1c')]=qs['limit'](_0x5f4d67['query'][_0x81bc('0x1c')]);_0x5c72f8['offset']=qs[_0x81bc('0x1f')](_0x5f4d67[_0x81bc('0x35')]['offset']);}_0x5c72f8[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x5f4d67[_0x81bc('0x35')][_0x81bc('0x3d')]);_0x5c72f8['where']=qs['filters'](_[_0x81bc('0x40')](_0x5f4d67['query'],_0x5d505d[_0x81bc('0x3f')]));_0x5c72f8[_0x81bc('0x3e')][_0x81bc('0x5b')]=_0x20b7b8['id'];if(_0x5f4d67[_0x81bc('0x35')][_0x81bc('0x41')]){_0x5c72f8['where']=_[_0x81bc('0x42')](_0x5c72f8[_0x81bc('0x3e')],{'$or':_[_0x81bc('0x2f')](_0x5c72f8['attributes'],function(_0x2edff9){var _0x154d31={};_0x154d31[_0x2edff9]={'$like':'%'+_0x5f4d67[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x154d31;})});}_0x5c72f8=_[_0x81bc('0x42')]({},_0x5c72f8,_0x5f4d67[_0x81bc('0x44')]);return db['CmHopperFinal'][_0x81bc('0x1e')]({'where':_0x5c72f8[_0x81bc('0x3e')]})[_0x81bc('0x25')](function(_0x584976){_0x3da3e4['count']=_0x584976;if(_0x5f4d67['query'][_0x81bc('0x46')]){_0x5c72f8[_0x81bc('0x47')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x5c72f8);})[_0x81bc('0x25')](function(_0x5c9358){_0x3da3e4['rows']=_0x5c9358;return _0x3da3e4;});}})[_0x81bc('0x25')](respondWithFilteredResult(_0x5c2ac5,_0x5c72f8))[_0x81bc('0x4a')](handleError(_0x5c2ac5,null));};exports['getHopperBlacks']=function(_0x290415,_0x219274,_0x30ad3f){var _0x512d57={'raw':!![],'where':{}};var _0x5f517b={};var _0x3b8321={'count':0x0,'rows':[]};return db[_0x81bc('0x45')][_0x81bc('0x5f')]({'where':{'id':_0x290415[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x219274,null))[_0x81bc('0x25')](function(_0x195591){if(_0x195591){_0x5f517b[_0x81bc('0x34')]=_[_0x81bc('0x36')](db['CmHopperBlack'][_0x81bc('0x30')]);_0x5f517b[_0x81bc('0x35')]=_[_0x81bc('0x36')](_0x290415['query']);_0x5f517b['filters']=_[_0x81bc('0x37')](_0x5f517b[_0x81bc('0x34')],_0x5f517b[_0x81bc('0x35')]);_0x512d57['attributes']=_[_0x81bc('0x37')](_0x5f517b['model'],qs[_0x81bc('0x39')](_0x290415[_0x81bc('0x35')]['fields']));_0x512d57[_0x81bc('0x38')]=_0x512d57[_0x81bc('0x38')]['length']?_0x512d57[_0x81bc('0x38')]:_0x5f517b['model'];if(!_0x290415[_0x81bc('0x35')][_0x81bc('0x3b')]('nolimit')){_0x512d57[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x290415[_0x81bc('0x35')][_0x81bc('0x1c')]);_0x512d57[_0x81bc('0x1f')]=qs[_0x81bc('0x1f')](_0x290415[_0x81bc('0x35')]['offset']);}_0x512d57[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x290415['query'][_0x81bc('0x3d')]);_0x512d57['where']=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x290415[_0x81bc('0x35')],_0x5f517b[_0x81bc('0x3f')]));_0x512d57[_0x81bc('0x3e')]['CampaignId']=_0x195591['id'];if(_0x290415[_0x81bc('0x35')][_0x81bc('0x41')]){_0x512d57[_0x81bc('0x3e')]=_['merge'](_0x512d57[_0x81bc('0x3e')],{'$or':_[_0x81bc('0x2f')](_0x512d57[_0x81bc('0x38')],function(_0xd27526){var _0xbe4c2e={};_0xbe4c2e[_0xd27526]={'$like':'%'+_0x290415[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0xbe4c2e;})});}_0x512d57=_[_0x81bc('0x42')]({},_0x512d57,_0x290415[_0x81bc('0x44')]);return db['CmHopperBlack'][_0x81bc('0x1e')]({'where':_0x512d57[_0x81bc('0x3e')]})[_0x81bc('0x25')](function(_0x2c3ad7){_0x3b8321[_0x81bc('0x1e')]=_0x2c3ad7;if(_0x290415[_0x81bc('0x35')]['includeAll']){_0x512d57['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x512d57);})[_0x81bc('0x25')](function(_0x52ba7c){_0x3b8321['rows']=_0x52ba7c;return _0x3b8321;});}})[_0x81bc('0x25')](respondWithFilteredResult(_0x219274,_0x512d57))[_0x81bc('0x4a')](handleError(_0x219274,null));};exports[_0x81bc('0x60')]=function(_0x16c014,_0xeabb5e,_0x5b11ca){var _0x3d648b={};var _0x1601c5={};var _0x45b704;var _0x4774c1;return db[_0x81bc('0x45')][_0x81bc('0x5f')]({'where':{'id':_0x16c014[_0x81bc('0x4b')]['id']}})['then'](handleEntityNotFound(_0xeabb5e,null))['then'](function(_0x3da51d){if(_0x3da51d){_0x45b704=_0x3da51d;_0x1601c5[_0x81bc('0x34')]=_['keys'](db[_0x81bc('0x61')][_0x81bc('0x30')]);_0x1601c5['query']=_['keys'](_0x16c014[_0x81bc('0x35')]);_0x1601c5[_0x81bc('0x3f')]=_[_0x81bc('0x37')](_0x1601c5[_0x81bc('0x34')],_0x1601c5[_0x81bc('0x35')]);_0x3d648b['attributes']=_[_0x81bc('0x37')](_0x1601c5['model'],qs['fields'](_0x16c014[_0x81bc('0x35')][_0x81bc('0x39')]));_0x3d648b[_0x81bc('0x38')]=_0x3d648b[_0x81bc('0x38')][_0x81bc('0x3a')]?_0x3d648b['attributes']:_0x1601c5[_0x81bc('0x34')];_0x3d648b[_0x81bc('0x3c')]=qs['sort'](_0x16c014[_0x81bc('0x35')]['sort']);_0x3d648b[_0x81bc('0x3e')]=qs[_0x81bc('0x3f')](_[_0x81bc('0x40')](_0x16c014['query'],_0x1601c5[_0x81bc('0x3f')]));if(_0x16c014[_0x81bc('0x35')][_0x81bc('0x41')]){_0x3d648b['where']=_[_0x81bc('0x42')](_0x3d648b[_0x81bc('0x3e')],{'$or':_[_0x81bc('0x2f')](_0x3d648b['attributes'],function(_0x3a1864){var _0x17537f={};_0x17537f[_0x3a1864]={'$like':'%'+_0x16c014[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x17537f;})});}_0x3d648b=_['merge']({},_0x3d648b,_0x16c014[_0x81bc('0x44')]);return _0x45b704[_0x81bc('0x60')](_0x3d648b);}})['then'](function(_0x450c38){if(_0x450c38){_0x4774c1=_0x450c38['length'];if(!_0x16c014['query'][_0x81bc('0x3b')](_0x81bc('0x5a'))){_0x3d648b['limit']=qs['limit'](_0x16c014[_0x81bc('0x35')]['limit']);_0x3d648b[_0x81bc('0x1f')]=qs[_0x81bc('0x1f')](_0x16c014[_0x81bc('0x35')]['offset']);}return _0x45b704['getLists'](_0x3d648b);}})['then'](function(_0x4c9aac){if(_0x4c9aac){return _0x4c9aac?{'count':_0x4774c1,'rows':_0x4c9aac}:null;}})['then'](respondWithResult(_0xeabb5e,null))['catch'](handleError(_0xeabb5e,null));};exports[_0x81bc('0x62')]=function(_0x4c86a9,_0x303f61,_0x270711){var _0x5b95e9,_0x37f9e1;return db['Campaign'][_0x81bc('0x4c')]({'where':{'id':_0x4c86a9[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x303f61,null))[_0x81bc('0x25')](function(_0x33298b){if(_0x33298b){_0x37f9e1=_0x33298b;return _0x33298b['addLists'](_0x4c86a9[_0x81bc('0x4d')][_0x81bc('0x63')],_[_0x81bc('0x55')](_0x4c86a9[_0x81bc('0x4d')],[_0x81bc('0x63'),'id'])||{});}return null;})[_0x81bc('0x64')](function(_0x325fcd){var _0x535386;_0x5b95e9=_0x325fcd||[];var _0x266b6d=[];if(_0x325fcd){for(var _0x5c0d3e=0x0;_0x5c0d3e<_0x325fcd[_0x81bc('0x3a')];_0x5c0d3e+=0x1){var _0x2be2c3=_0x325fcd[_0x5c0d3e][_0x81bc('0x27')]({'plain':!![]});_0x37f9e1[_0x81bc('0x65')]=_0x4c86a9['body']['dialCheckDuplicateType']?_0x4c86a9[_0x81bc('0x4d')][_0x81bc('0x65')]:_0x37f9e1[_0x81bc('0x65')];switch(_0x37f9e1[_0x81bc('0x65')]){case _0x81bc('0x66'):_0x535386=squel['insert']()['into']('cm_hopper')[_0x81bc('0x67')]([_0x81bc('0x68'),_0x81bc('0x69'),'ContactId',_0x81bc('0x6a'),'CampaignId','createdAt',_0x81bc('0x57')],squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')](_0x81bc('0x68'),_0x81bc('0x68'))[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x69'))[_0x81bc('0x6c')]('id',_0x81bc('0x6e'))[_0x81bc('0x6c')](_0x2be2c3['CmListId'][_0x81bc('0x6f')](),'ListId')[_0x81bc('0x6c')](_0x4c86a9[_0x81bc('0x4b')]['id']['toString'](),'CampaignId')[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x56'))['field'](_0x81bc('0x6d'),_0x81bc('0x57'))[_0x81bc('0x70')](_0x81bc('0x71'))[_0x81bc('0x3e')](_0x81bc('0x72'))[_0x81bc('0x3e')]('ListId\x20=\x20?',_0x2be2c3['CmListId'][_0x81bc('0x6f')]())[_0x81bc('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x81bc('0x3e')](_0x81bc('0x73'),squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')](_0x81bc('0x74'))[_0x81bc('0x70')](_0x81bc('0x75'))['where']('CampaignId\x20=\x20?',_0x4c86a9[_0x81bc('0x4b')]['id'][_0x81bc('0x6f')]()))[_0x81bc('0x3e')](_0x81bc('0x73'),squel['select']()[_0x81bc('0x6c')]('COALESCE(phone,\x27\x27)')[_0x81bc('0x70')](_0x81bc('0x76'))[_0x81bc('0x3e')](_0x81bc('0x77'),_0x4c86a9[_0x81bc('0x4b')]['id'][_0x81bc('0x6f')]())))[_0x81bc('0x6f')]();break;case _0x81bc('0x78'):_0x535386=squel[_0x81bc('0x79')]()[_0x81bc('0x7a')](_0x81bc('0x76'))[_0x81bc('0x67')](['phone',_0x81bc('0x69'),'ContactId',_0x81bc('0x6a'),_0x81bc('0x5b'),_0x81bc('0x56'),_0x81bc('0x57')],squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')]('phone',_0x81bc('0x68'))[_0x81bc('0x6c')](_0x81bc('0x6d'),'scheduledAt')[_0x81bc('0x6c')]('id',_0x81bc('0x6e'))[_0x81bc('0x6c')](_0x2be2c3[_0x81bc('0x7b')][_0x81bc('0x6f')](),_0x81bc('0x6a'))[_0x81bc('0x6c')](_0x4c86a9[_0x81bc('0x4b')]['id'][_0x81bc('0x6f')](),_0x81bc('0x5b'))['field'](_0x81bc('0x6d'),_0x81bc('0x56'))[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x57'))[_0x81bc('0x70')](_0x81bc('0x71'))[_0x81bc('0x3e')](_0x81bc('0x72'))['where']('ListId\x20=\x20?',_0x2be2c3[_0x81bc('0x7b')][_0x81bc('0x6f')]())[_0x81bc('0x3e')](_0x81bc('0x7c'))[_0x81bc('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')](_0x81bc('0x7d'))['from'](_0x81bc('0x76'))[_0x81bc('0x3e')](_0x81bc('0x77'),_0x4c86a9[_0x81bc('0x4b')]['id']['toString']())))[_0x81bc('0x6f')]();break;default:_0x535386=squel[_0x81bc('0x79')]()[_0x81bc('0x7a')](_0x81bc('0x76'))[_0x81bc('0x67')](['phone','scheduledAt',_0x81bc('0x6e'),'ListId',_0x81bc('0x5b'),'createdAt',_0x81bc('0x57')],squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')]('phone','phone')[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x69'))[_0x81bc('0x6c')]('id',_0x81bc('0x6e'))[_0x81bc('0x6c')](_0x2be2c3[_0x81bc('0x7b')][_0x81bc('0x6f')](),_0x81bc('0x6a'))['field'](_0x4c86a9[_0x81bc('0x4b')]['id'][_0x81bc('0x6f')](),_0x81bc('0x5b'))['field']('NOW()',_0x81bc('0x56'))[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x57'))[_0x81bc('0x70')](_0x81bc('0x71'))[_0x81bc('0x3e')]('deletedAt\x20IS\x20NULL')['where'](_0x81bc('0x7e'),_0x2be2c3[_0x81bc('0x7b')][_0x81bc('0x6f')]())['where'](_0x81bc('0x7c')))[_0x81bc('0x6f')]();}_0x266b6d[_0x81bc('0x7f')](db['sequelize'][_0x81bc('0x35')](_0x535386));}return BPromise[_0x81bc('0x80')](_0x266b6d);}})[_0x81bc('0x25')](function(){return _0x5b95e9;})['then'](respondWithResult(_0x303f61,null))[_0x81bc('0x4a')](handleError(_0x303f61,null));};exports[_0x81bc('0x81')]=function(_0x42a37c,_0x41db69,_0x516a00){return db[_0x81bc('0x45')]['find']({'where':{'id':_0x42a37c[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x41db69,null))[_0x81bc('0x25')](function(_0x32f196){if(_0x32f196){return _0x32f196[_0x81bc('0x81')](_0x42a37c[_0x81bc('0x35')][_0x81bc('0x63')]);}})['then'](function(_0x43f469){if(_0x43f469){return db[_0x81bc('0x5c')][_0x81bc('0x26')]({'where':{'ListId':_0x42a37c[_0x81bc('0x35')][_0x81bc('0x63')],'CampaignId':_0x42a37c[_0x81bc('0x4b')]['id']}})['then'](function(){return _0x43f469;});}})['then'](respondWithStatusCode(_0x41db69,null))[_0x81bc('0x4a')](handleError(_0x41db69,null));};exports[_0x81bc('0x82')]=function(_0x1edd1d,_0x9d8dcd,_0xae8668){var _0x3fa46d={};var _0x3b8868={};var _0xb7b759;var _0x505fb9;return db[_0x81bc('0x45')]['findOne']({'where':{'id':_0x1edd1d[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x9d8dcd,null))[_0x81bc('0x25')](function(_0x1f8b2b){if(_0x1f8b2b){_0xb7b759=_0x1f8b2b;_0x3b8868[_0x81bc('0x34')]=_['keys'](db[_0x81bc('0x61')]['rawAttributes']);_0x3b8868[_0x81bc('0x35')]=_['keys'](_0x1edd1d[_0x81bc('0x35')]);_0x3b8868[_0x81bc('0x3f')]=_[_0x81bc('0x37')](_0x3b8868[_0x81bc('0x34')],_0x3b8868[_0x81bc('0x35')]);_0x3fa46d['attributes']=_[_0x81bc('0x37')](_0x3b8868['model'],qs[_0x81bc('0x39')](_0x1edd1d[_0x81bc('0x35')]['fields']));_0x3fa46d[_0x81bc('0x38')]=_0x3fa46d[_0x81bc('0x38')]['length']?_0x3fa46d[_0x81bc('0x38')]:_0x3b8868['model'];_0x3fa46d[_0x81bc('0x3c')]=qs[_0x81bc('0x3d')](_0x1edd1d['query'][_0x81bc('0x3d')]);_0x3fa46d[_0x81bc('0x3e')]=qs[_0x81bc('0x3f')](_['pick'](_0x1edd1d[_0x81bc('0x35')],_0x3b8868['filters']));if(_0x1edd1d[_0x81bc('0x35')][_0x81bc('0x41')]){_0x3fa46d[_0x81bc('0x3e')]=_[_0x81bc('0x42')](_0x3fa46d['where'],{'$or':_[_0x81bc('0x2f')](_0x3fa46d[_0x81bc('0x38')],function(_0x296378){var _0x5b701f={};_0x5b701f[_0x296378]={'$like':'%'+_0x1edd1d[_0x81bc('0x35')][_0x81bc('0x41')]+'%'};return _0x5b701f;})});}_0x3fa46d=_[_0x81bc('0x42')]({},_0x3fa46d,_0x1edd1d[_0x81bc('0x44')]);return _0xb7b759['getBlackLists'](_0x3fa46d);}})[_0x81bc('0x25')](function(_0x4153a5){if(_0x4153a5){_0x505fb9=_0x4153a5[_0x81bc('0x3a')];if(!_0x1edd1d[_0x81bc('0x35')][_0x81bc('0x3b')](_0x81bc('0x5a'))){_0x3fa46d[_0x81bc('0x1c')]=qs[_0x81bc('0x1c')](_0x1edd1d[_0x81bc('0x35')][_0x81bc('0x1c')]);_0x3fa46d[_0x81bc('0x1f')]=qs[_0x81bc('0x1f')](_0x1edd1d['query']['offset']);}return _0xb7b759[_0x81bc('0x82')](_0x3fa46d);}})[_0x81bc('0x25')](function(_0x2dacc7){if(_0x2dacc7){return _0x2dacc7?{'count':_0x505fb9,'rows':_0x2dacc7}:null;}})[_0x81bc('0x25')](respondWithResult(_0x9d8dcd,null))[_0x81bc('0x4a')](handleError(_0x9d8dcd,null));};exports[_0x81bc('0x83')]=function(_0x1ea758,_0x56f4d6,_0x29fc43){var _0x134828,_0x5d5f42;return db['Campaign']['find']({'where':{'id':_0x1ea758[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](handleEntityNotFound(_0x56f4d6,null))[_0x81bc('0x25')](function(_0x2fc3f4){if(_0x2fc3f4){_0x5d5f42=_0x2fc3f4;return _0x2fc3f4[_0x81bc('0x83')](_0x1ea758[_0x81bc('0x4d')]['ids'],_['omit'](_0x1ea758[_0x81bc('0x4d')],[_0x81bc('0x63'),'id'])||{});}return null;})['spread'](function(_0x3134c3){var _0x499af6;_0x134828=_0x3134c3||[];var _0x41c018=[];if(_0x3134c3){for(var _0x3c36d7=0x0;_0x3c36d7<_0x3134c3['length'];_0x3c36d7+=0x1){var _0xb10307=_0x3134c3[_0x3c36d7][_0x81bc('0x27')]({'plain':!![]});_0x499af6=squel[_0x81bc('0x79')]()['into'](_0x81bc('0x84'))['fromQuery']([_0x81bc('0x68'),'ContactId','ListId',_0x81bc('0x5b'),_0x81bc('0x56'),_0x81bc('0x57')],squel[_0x81bc('0x6b')]()[_0x81bc('0x6c')](_0x81bc('0x68'),_0x81bc('0x68'))['field']('id','ContactId')[_0x81bc('0x6c')](_0xb10307[_0x81bc('0x7b')][_0x81bc('0x6f')](),_0x81bc('0x6a'))[_0x81bc('0x6c')](_0x1ea758['params']['id'][_0x81bc('0x6f')](),'CampaignId')[_0x81bc('0x6c')](_0x81bc('0x6d'),_0x81bc('0x56'))[_0x81bc('0x6c')](_0x81bc('0x6d'),'updatedAt')['from'](_0x81bc('0x71'))[_0x81bc('0x3e')](_0x81bc('0x72'))[_0x81bc('0x3e')](_0x81bc('0x7e'),_0xb10307[_0x81bc('0x7b')][_0x81bc('0x6f')]())[_0x81bc('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x41c018[_0x81bc('0x7f')](db[_0x81bc('0x85')][_0x81bc('0x35')](_0x499af6));}return BPromise[_0x81bc('0x80')](_0x41c018);}})['then'](function(){return _0x134828;})[_0x81bc('0x25')](respondWithResult(_0x56f4d6,null))[_0x81bc('0x4a')](handleError(_0x56f4d6,null));};exports['removeBlackLists']=function(_0x3c48b2,_0x259aff,_0x186cf7){return db[_0x81bc('0x45')][_0x81bc('0x4c')]({'where':{'id':_0x3c48b2[_0x81bc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x259aff,null))[_0x81bc('0x25')](function(_0x190f73){if(_0x190f73){return _0x190f73[_0x81bc('0x86')](_0x3c48b2[_0x81bc('0x35')][_0x81bc('0x63')]);}})[_0x81bc('0x25')](function(_0x223e33){if(_0x223e33){return db[_0x81bc('0x87')][_0x81bc('0x26')]({'where':{'ListId':_0x3c48b2[_0x81bc('0x35')][_0x81bc('0x63')],'CampaignId':_0x3c48b2[_0x81bc('0x4b')]['id']}})[_0x81bc('0x25')](function(){return _0x223e33;});}})[_0x81bc('0x25')](respondWithStatusCode(_0x259aff,null))['catch'](handleError(_0x259aff,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f1fbe1b..c829b75 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1c50d6,_0x1097f2){var _0x566560=function(_0x7fad7){while(--_0x7fad7){_0x1c50d6['push'](_0x1c50d6['shift']());}};_0x566560(++_0x1097f2);}(_0x7a54,0x106));var _0x47a5=function(_0x360072,_0x30daf4){_0x360072=_0x360072-0x0;var _0x44cd9b=_0x7a54[_0x360072];return _0x44cd9b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 8c312a9..ae3e13e 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 _0x2f68=['limit','include','map','model','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','attributes'];(function(_0x321504,_0xfde0ac){var _0xf9f5ac=function(_0x462ed7){while(--_0x462ed7){_0x321504['push'](_0x321504['shift']());}};_0xf9f5ac(++_0xfde0ac);}(_0x2f68,0x9a));var _0x82f6=function(_0x5987da,_0x355ca7){_0x5987da=_0x5987da-0x0;var _0x2c18b9=_0x2f68[_0x5987da];return _0x2c18b9;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});}exports[_0x82f6('0x15')]=function(_0xcbc95f){var _0x4072f0=this;return new Promise(function(_0x2bfd57,_0x1c79f9){return db[_0x82f6('0x16')][_0x82f6('0x17')]({'raw':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['where']||null:null,'attributes':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x19')]||null:null,'limit':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f['options'][_0x82f6('0x1a')]||null:null,'include':_0xcbc95f['options']?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x1b')]?_['map'](_0xcbc95f['options'][_0x82f6('0x1b')],function(_0x1d96d5){return{'model':db[_0x1d96d5['model']],'as':_0x1d96d5['as'],'attributes':_0x1d96d5['attributes'],'include':_0x1d96d5[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x1d96d5['include'],function(_0xfd8b68){return{'model':db[_0xfd8b68[_0x82f6('0x1d')]],'as':_0xfd8b68['as'],'attributes':_0xfd8b68['attributes'],'include':_0xfd8b68['include']?_[_0x82f6('0x1c')](_0xfd8b68['include'],function(_0x469b6b){return{'model':db[_0x469b6b[_0x82f6('0x1d')]],'as':_0x469b6b['as'],'attributes':_0x469b6b['attributes']};}):[]};}):[]};}):[]:[]})[_0x82f6('0xa')](function(_0x15c9b7){logger[_0x82f6('0xb')](_0x82f6('0x15'),_0xcbc95f);logger['debug'](_0x82f6('0x15'),_0xcbc95f,JSON[_0x82f6('0x10')](_0x15c9b7));_0x2bfd57(_0x15c9b7);})[_0x82f6('0x14')](function(_0x400137){logger[_0x82f6('0x11')](_0x82f6('0x15'),_0x400137[_0x82f6('0x12')],_0xcbc95f);_0x1c79f9(_0x4072f0[_0x82f6('0x11')](0x1f4,_0x400137[_0x82f6('0x12')]));});});};
\ No newline at end of file
+var _0x6b19=['message','result','catch','GetCampaign','findAll','options','raw','where','limit','include','map','model','attributes','then','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x361f1b,_0x9a653b){var _0x20f39d=function(_0x2774cc){while(--_0x2774cc){_0x361f1b['push'](_0x361f1b['shift']());}};_0x20f39d(++_0x9a653b);}(_0x6b19,0xe8));var _0x96b1=function(_0x59eac3,_0x2b1bb7){_0x59eac3=_0x59eac3-0x0;var _0x5239e2=_0x6b19[_0x59eac3];return _0x5239e2;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3e1a,_0x572fde,_0x57a23a){return new BPromise(function(_0x307e65,_0x535cc9){return client[_0x96b1('0x9')](_0x3e3e1a,_0x57a23a)['then'](function(_0x36ea50){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));logger[_0x96b1('0xd')](_0x96b1('0xe'),_0x572fde,_0x96b1('0xc'),JSON['stringify'](_0x36ea50));if(_0x36ea50['error']){if(_0x36ea50[_0x96b1('0xf')]['code']===0x1f4){logger['error'](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x535cc9(_0x36ea50['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x307e65(_0x36ea50['error'][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));_0x307e65(_0x36ea50[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x2d5a32){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x2d5a32);_0x535cc9(_0x2d5a32);});});}exports[_0x96b1('0x13')]=function(_0x38478c){var _0x2b192a=this;return new Promise(function(_0x19972b,_0x212b31){return db['Campaign'][_0x96b1('0x14')]({'raw':_0x38478c['options']?_0x38478c[_0x96b1('0x15')][_0x96b1('0x16')]===undefined?!![]:![]:!![],'where':_0x38478c[_0x96b1('0x15')]?_0x38478c['options'][_0x96b1('0x17')]||null:null,'attributes':_0x38478c[_0x96b1('0x15')]?_0x38478c[_0x96b1('0x15')]['attributes']||null:null,'limit':_0x38478c[_0x96b1('0x15')]?_0x38478c[_0x96b1('0x15')][_0x96b1('0x18')]||null:null,'include':_0x38478c[_0x96b1('0x15')]?_0x38478c['options'][_0x96b1('0x19')]?_[_0x96b1('0x1a')](_0x38478c[_0x96b1('0x15')]['include'],function(_0x2b4f8e){return{'model':db[_0x2b4f8e[_0x96b1('0x1b')]],'as':_0x2b4f8e['as'],'attributes':_0x2b4f8e[_0x96b1('0x1c')],'include':_0x2b4f8e[_0x96b1('0x19')]?_['map'](_0x2b4f8e[_0x96b1('0x19')],function(_0x548bae){return{'model':db[_0x548bae[_0x96b1('0x1b')]],'as':_0x548bae['as'],'attributes':_0x548bae['attributes'],'include':_0x548bae[_0x96b1('0x19')]?_[_0x96b1('0x1a')](_0x548bae['include'],function(_0x50dcbc){return{'model':db[_0x50dcbc['model']],'as':_0x50dcbc['as'],'attributes':_0x50dcbc[_0x96b1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x96b1('0x1d')](function(_0x18e56a){logger[_0x96b1('0xa')](_0x96b1('0x13'),_0x38478c);logger['debug'](_0x96b1('0x13'),_0x38478c,JSON[_0x96b1('0x1e')](_0x18e56a));_0x19972b(_0x18e56a);})[_0x96b1('0x12')](function(_0x209ce8){logger['error'](_0x96b1('0x13'),_0x209ce8[_0x96b1('0x10')],_0x38478c);_0x212b31(_0x2b192a['error'](0x1f4,_0x209ce8['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 9f6924c..5341a6a 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 _0x1e1a=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','isAuthenticated','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','create','clone','addLists','/:id/blacklists','put','update','delete','destroy','removeLists','removeBlackLists','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id'];(function(_0x5c082a,_0x19ac27){var _0x3b60ac=function(_0x2f37ef){while(--_0x2f37ef){_0x5c082a['push'](_0x5c082a['shift']());}};_0x3b60ac(++_0x19ac27);}(_0x1e1a,0x175));var _0xa1e1=function(_0x3addef,_0x37deb2){_0x3addef=_0x3addef-0x0;var _0x3a2b8e=_0x1e1a[_0x3addef];return _0x3a2b8e;};'use strict';var multer=require('multer');var util=require(_0xa1e1('0x0'));var path=require(_0xa1e1('0x1'));var timeout=require(_0xa1e1('0x2'));var express=require(_0xa1e1('0x3'));var router=express[_0xa1e1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa1e1('0x5'));var interaction=require(_0xa1e1('0x6'));var config=require(_0xa1e1('0x7'));var controller=require(_0xa1e1('0x8'));router[_0xa1e1('0x9')]('/',auth['isAuthenticated'](),controller[_0xa1e1('0xa')]);router[_0xa1e1('0x9')](_0xa1e1('0xb'),auth['isAuthenticated'](),controller[_0xa1e1('0xc')]);router[_0xa1e1('0x9')](_0xa1e1('0xd'),auth['isAuthenticated'](),controller[_0xa1e1('0xe')]);router['get'](_0xa1e1('0xf'),auth['isAuthenticated'](),controller[_0xa1e1('0x10')]);router['get'](_0xa1e1('0x11'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x13')]);router['get'](_0xa1e1('0x14'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x15')]);router['get'](_0xa1e1('0x16'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x17')]);router['get']('/:id/blacklists',auth[_0xa1e1('0x12')](),controller['getBlackLists']);router[_0xa1e1('0x18')]('/',auth['isAuthenticated'](),controller[_0xa1e1('0x19')]);router[_0xa1e1('0x18')]('/:id/clone',auth['isAuthenticated'](),controller[_0xa1e1('0x1a')]);router['post'](_0xa1e1('0x16'),auth['isAuthenticated'](),controller[_0xa1e1('0x1b')]);router['post'](_0xa1e1('0x1c'),auth[_0xa1e1('0x12')](),controller['addBlackLists']);router[_0xa1e1('0x1d')]('/:id',auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x1e')]);router[_0xa1e1('0x1f')](_0xa1e1('0xb'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x20')]);router[_0xa1e1('0x1f')](_0xa1e1('0x16'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x21')]);router[_0xa1e1('0x1f')](_0xa1e1('0x1c'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0xeaa7=['getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addBlackLists','put','update','delete','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','show','/:id/hoppers'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0xeaa7,0x113));var _0x7eaa=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xeaa7[_0x2cf2e9];return _0xd3670d;};'use strict';var multer=require(_0x7eaa('0x0'));var util=require(_0x7eaa('0x1'));var path=require(_0x7eaa('0x2'));var timeout=require(_0x7eaa('0x3'));var express=require(_0x7eaa('0x4'));var router=express[_0x7eaa('0x5')]();var fs_extra=require(_0x7eaa('0x6'));var auth=require(_0x7eaa('0x7'));var interaction=require(_0x7eaa('0x8'));var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7eaa('0x9')](_0x7eaa('0xa'),auth['isAuthenticated'](),controller[_0x7eaa('0xb')]);router[_0x7eaa('0x9')](_0x7eaa('0xc'),auth['isAuthenticated'](),controller[_0x7eaa('0xd')]);router[_0x7eaa('0x9')](_0x7eaa('0xe'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x10')]);router[_0x7eaa('0x9')](_0x7eaa('0x11'),auth[_0x7eaa('0xf')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x12')]);router[_0x7eaa('0x9')](_0x7eaa('0x13'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x14')]);router[_0x7eaa('0x9')](_0x7eaa('0x15'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x16')]);router[_0x7eaa('0x17')]('/',auth[_0x7eaa('0xf')](),controller['create']);router['post'](_0x7eaa('0x18'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x19')]);router[_0x7eaa('0x17')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x7eaa('0x17')]('/:id/blacklists',auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x1a')]);router[_0x7eaa('0x1b')](_0x7eaa('0xa'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x1c')]);router[_0x7eaa('0x1d')](_0x7eaa('0xa'),auth[_0x7eaa('0xf')](),controller['destroy']);router[_0x7eaa('0x1d')](_0x7eaa('0x13'),auth[_0x7eaa('0xf')](),controller[_0x7eaa('0x1e')]);router[_0x7eaa('0x1d')](_0x7eaa('0x15'),auth[_0x7eaa('0xf')](),controller['removeBlackLists']);module[_0x7eaa('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index f84c15d..83ce067 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 _0xcd78=['getDataValue','key','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x2a8122,_0xd957e){var _0x49a5c7=function(_0x12ab58){while(--_0x12ab58){_0x2a8122['push'](_0x2a8122['shift']());}};_0x49a5c7(++_0xd957e);}(_0xcd78,0x79));var _0x8cd7=function(_0x4fde1b,_0xd723f9){_0x4fde1b=_0x4fde1b-0x0;var _0x1364e5=_0xcd78[_0x4fde1b];return _0x1364e5;};'use strict';var Sequelize=require(_0x8cd7('0x0'));module[_0x8cd7('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8cd7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8cd7('0x3')]},'name':{'type':Sequelize[_0x8cd7('0x4')],'get':function(){return this[_0x8cd7('0x5')](_0x8cd7('0x6'));}}};
\ No newline at end of file
+var _0x9ae8=['getDataValue','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x4dbc34,_0x2bb5f5){var _0x4a9592=function(_0x5c1990){while(--_0x5c1990){_0x4dbc34['push'](_0x4dbc34['shift']());}};_0x4a9592(++_0x2bb5f5);}(_0x9ae8,0x13f));var _0x89ae=function(_0x1c0a05,_0x253ede){_0x1c0a05=_0x1c0a05-0x0;var _0x27a637=_0x9ae8[_0x1c0a05];return _0x27a637;};'use strict';var Sequelize=require(_0x89ae('0x0'));module[_0x89ae('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x89ae('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x89ae('0x3')]},'name':{'type':Sequelize[_0x89ae('0x4')],'get':function(){return this[_0x89ae('0x5')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index f2fda09..dc464db 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 _0x69b0=['Content-Range','apply','reject','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','length','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x5376a2,_0x23e471){var _0x29a3a0=function(_0x12c5cb){while(--_0x12c5cb){_0x5376a2['push'](_0x5376a2['shift']());}};_0x29a3a0(++_0x23e471);}(_0x69b0,0x1a4));var _0x069b=function(_0x33593e,_0x22ddd3){_0x33593e=_0x33593e-0x0;var _0x53db1a=_0x69b0[_0x33593e];return _0x53db1a;};'use strict';var emlformat=require(_0x069b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x069b('0x1'));var jsonpatch=require(_0x069b('0x2'));var rp=require(_0x069b('0x3'));var moment=require('moment');var BPromise=require(_0x069b('0x4'));var Mustache=require(_0x069b('0x5'));var util=require(_0x069b('0x6'));var path=require(_0x069b('0x7'));var sox=require(_0x069b('0x8'));var csv=require('to-csv');var ejs=require(_0x069b('0x9'));var fs=require('fs');var fs_extra=require(_0x069b('0xa'));var _=require(_0x069b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x069b('0xc'));var deskjs=require(_0x069b('0xd'));var toCsv=require(_0x069b('0xe'));var querystring=require(_0x069b('0xf'));var Papa=require(_0x069b('0x10'));var Redis=require(_0x069b('0x11'));var authService=require(_0x069b('0x12'));var qs=require(_0x069b('0x13'));var as=require(_0x069b('0x14'));var hardwareService=require(_0x069b('0x15'));var logger=require(_0x069b('0x16'))(_0x069b('0x17'));var utils=require('../../config/utils');var config=require(_0x069b('0x18'));var licenseUtil=require(_0x069b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337571,_0x30ea84){_0x30ea84=_0x30ea84||0xcc;return function(_0xe96cd7){if(_0xe96cd7){return _0x337571[_0x069b('0x1a')](_0x30ea84);}return _0x337571[_0x069b('0x1b')](_0x30ea84)[_0x069b('0x1c')]();};}function respondWithResult(_0x33c045,_0x41f637){_0x41f637=_0x41f637||0xc8;return function(_0x1feb88){if(_0x1feb88){return _0x33c045[_0x069b('0x1b')](_0x41f637)[_0x069b('0x1d')](_0x1feb88);}};}function respondWithFilteredResult(_0x35adcf,_0x35e21e){return function(_0x5382dd){if(_0x5382dd){var _0x2e38b0=typeof _0x35e21e[_0x069b('0x1e')]===_0x069b('0x1f')&&typeof _0x35e21e['limit']===_0x069b('0x1f');var _0x523c31=_0x5382dd[_0x069b('0x20')];var _0x5e396a=_0x2e38b0?0x0:_0x35e21e[_0x069b('0x1e')];var _0xe48b55=_0x2e38b0?_0x5382dd['count']:_0x35e21e[_0x069b('0x1e')]+_0x35e21e[_0x069b('0x21')];var _0x7920f;if(_0xe48b55>=_0x523c31){_0xe48b55=_0x523c31;_0x7920f=0xc8;}else{_0x7920f=0xce;}_0x35adcf[_0x069b('0x1b')](_0x7920f);return _0x35adcf[_0x069b('0x22')](_0x069b('0x23'),_0x5e396a+'-'+_0xe48b55+'/'+_0x523c31)[_0x069b('0x1d')](_0x5382dd);}return null;};}function patchUpdates(_0x26733a){return function(_0x8b82f5){try{jsonpatch[_0x069b('0x24')](_0x8b82f5,_0x26733a,!![]);}catch(_0x437715){return BPromise[_0x069b('0x25')](_0x437715);}return _0x8b82f5['save']();};}function saveUpdates(_0x9ffba5,_0x69d307){return function(_0x452cce){if(_0x452cce){return _0x452cce['update'](_0x9ffba5)[_0x069b('0x26')](function(_0x4f74a5){return _0x4f74a5;});}return null;};}function removeEntity(_0x23da2b,_0x4bc3be){return function(_0x3819a8){if(_0x3819a8){return _0x3819a8[_0x069b('0x27')]()[_0x069b('0x26')](function(){var _0x3a8272=_0x3819a8[_0x069b('0x28')]({'plain':!![]});var _0x46e2e8=_0x069b('0x29');return db[_0x069b('0x2a')][_0x069b('0x27')]({'where':{'type':_0x46e2e8,'resourceId':_0x3a8272['id']}})[_0x069b('0x26')](function(){return _0x3819a8;});})[_0x069b('0x26')](function(){_0x23da2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x550321,_0x8cfcc4){return function(_0x487ac3){if(!_0x487ac3){_0x550321[_0x069b('0x1a')](0x194);}return _0x487ac3;};}function handleError(_0x3d726d,_0x4f0930){_0x4f0930=_0x4f0930||0x1f4;return function(_0x541540){logger[_0x069b('0x2b')](_0x541540[_0x069b('0x2c')]);if(_0x541540[_0x069b('0x2d')]){delete _0x541540[_0x069b('0x2d')];}_0x3d726d[_0x069b('0x1b')](_0x4f0930)[_0x069b('0x2e')](_0x541540);};}exports[_0x069b('0x2f')]=function(_0x233af5,_0x58c23f){var _0x1a4a1a={},_0x47c381={},_0x39c203={'count':0x0,'rows':[]};var _0x5e5f21=_[_0x069b('0x30')](db[_0x069b('0x31')][_0x069b('0x32')],function(_0x31c438){return{'name':_0x31c438[_0x069b('0x33')],'type':_0x31c438['type'][_0x069b('0x34')]};});_0x47c381[_0x069b('0x35')]=_[_0x069b('0x30')](_0x5e5f21,_0x069b('0x2d'));_0x47c381[_0x069b('0x36')]=_[_0x069b('0x37')](_0x233af5[_0x069b('0x36')]);_0x47c381['filters']=_[_0x069b('0x38')](_0x47c381[_0x069b('0x35')],_0x47c381[_0x069b('0x36')]);_0x1a4a1a[_0x069b('0x39')]=_[_0x069b('0x38')](_0x47c381['model'],qs[_0x069b('0x3a')](_0x233af5[_0x069b('0x36')][_0x069b('0x3a')]));_0x1a4a1a[_0x069b('0x39')]=_0x1a4a1a['attributes']['length']?_0x1a4a1a['attributes']:_0x47c381[_0x069b('0x35')];if(!_0x233af5[_0x069b('0x36')][_0x069b('0x3b')](_0x069b('0x3c'))){_0x1a4a1a[_0x069b('0x21')]=qs['limit'](_0x233af5[_0x069b('0x36')][_0x069b('0x21')]);_0x1a4a1a[_0x069b('0x1e')]=qs[_0x069b('0x1e')](_0x233af5[_0x069b('0x36')][_0x069b('0x1e')]);}_0x1a4a1a[_0x069b('0x3d')]=qs[_0x069b('0x3e')](_0x233af5[_0x069b('0x36')][_0x069b('0x3e')]);_0x1a4a1a[_0x069b('0x3f')]=qs[_0x069b('0x40')](_[_0x069b('0x41')](_0x233af5['query'],_0x47c381['filters']),_0x5e5f21);if(_0x233af5['query'][_0x069b('0x42')]){_0x1a4a1a[_0x069b('0x3f')]=_[_0x069b('0x43')](_0x1a4a1a[_0x069b('0x3f')],{'$or':[{'key':{'$like':'%'+_0x233af5[_0x069b('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x233af5['query']['filter']+'%'}}]});}_0x1a4a1a=_[_0x069b('0x43')]({},_0x1a4a1a,_0x233af5[_0x069b('0x44')]);var _0x58da57={'where':_0x1a4a1a[_0x069b('0x3f')]};return db[_0x069b('0x31')][_0x069b('0x20')](_0x58da57)[_0x069b('0x26')](function(_0x46d567){_0x39c203[_0x069b('0x20')]=_0x46d567;if(_0x233af5['query'][_0x069b('0x45')]){_0x1a4a1a[_0x069b('0x46')]=[{'all':!![]}];}return db[_0x069b('0x31')]['findAll'](_0x1a4a1a);})[_0x069b('0x26')](function(_0x491661){_0x39c203[_0x069b('0x47')]=_0x491661;return _0x39c203;})[_0x069b('0x26')](respondWithFilteredResult(_0x58c23f,_0x1a4a1a))[_0x069b('0x48')](handleError(_0x58c23f,null));};exports['show']=function(_0x59d7ca,_0x30b07c){var _0x37f528={'raw':!![],'where':{'id':_0x59d7ca['params']['id']}},_0x3a243b={};_0x3a243b['model']=_[_0x069b('0x37')](db['CannedAnswer'][_0x069b('0x32')]);_0x3a243b['query']=_[_0x069b('0x37')](_0x59d7ca[_0x069b('0x36')]);_0x3a243b[_0x069b('0x40')]=_[_0x069b('0x38')](_0x3a243b[_0x069b('0x35')],_0x3a243b[_0x069b('0x36')]);_0x37f528[_0x069b('0x39')]=_[_0x069b('0x38')](_0x3a243b[_0x069b('0x35')],qs[_0x069b('0x3a')](_0x59d7ca[_0x069b('0x36')]['fields']));_0x37f528[_0x069b('0x39')]=_0x37f528[_0x069b('0x39')][_0x069b('0x49')]?_0x37f528[_0x069b('0x39')]:_0x3a243b['model'];if(_0x59d7ca[_0x069b('0x36')]['includeAll']){_0x37f528[_0x069b('0x46')]=[{'all':!![]}];}_0x37f528=_[_0x069b('0x43')]({},_0x37f528,_0x59d7ca[_0x069b('0x44')]);return db[_0x069b('0x31')]['find'](_0x37f528)[_0x069b('0x26')](handleEntityNotFound(_0x30b07c,null))[_0x069b('0x26')](respondWithResult(_0x30b07c,null))['catch'](handleError(_0x30b07c,null));};exports[_0x069b('0x4a')]=function(_0x3622ac,_0x21b6ea){if(_0x3622ac[_0x069b('0x4b')]['id']){delete _0x3622ac[_0x069b('0x4b')]['id'];}return db['CannedAnswer'][_0x069b('0x4c')]({'where':{'id':_0x3622ac['params']['id']}})[_0x069b('0x26')](handleEntityNotFound(_0x21b6ea,null))[_0x069b('0x26')](saveUpdates(_0x3622ac[_0x069b('0x4b')],null))['then'](respondWithResult(_0x21b6ea,null))[_0x069b('0x48')](handleError(_0x21b6ea,null));};exports[_0x069b('0x27')]=function(_0x25312c,_0x53f1b1){return db[_0x069b('0x31')][_0x069b('0x4c')]({'where':{'id':_0x25312c['params']['id']}})['then'](handleEntityNotFound(_0x53f1b1,null))[_0x069b('0x26')](removeEntity(_0x53f1b1,null))[_0x069b('0x48')](handleError(_0x53f1b1,null));};exports[_0x069b('0x4d')]=function(_0xae4320,_0x4e5371){var _0xae7f40={'key':_0xae4320[_0x069b('0x4b')]['key']};if(_0xae4320[_0x069b('0x4b')][_0x069b('0x4e')]){_0xae7f40[_0x069b('0x4e')]=_0xae4320['body'][_0x069b('0x4e')];}else if(_0xae4320[_0x069b('0x4b')][_0x069b('0x4f')]){_0xae7f40[_0x069b('0x4f')]=_0xae4320['body']['SmsAccountId'];}else if(_0xae4320['body'][_0x069b('0x50')]){_0xae7f40[_0x069b('0x50')]=_0xae4320['body'][_0x069b('0x50')];}else if(_0xae4320['body'][_0x069b('0x51')]){_0xae7f40[_0x069b('0x51')]=_0xae4320[_0x069b('0x4b')][_0x069b('0x51')];}return db[_0x069b('0x31')]['find']({'where':_0xae7f40})[_0x069b('0x26')](function(_0x4f1889){if(_0x4f1889){throw new db[(_0x069b('0x52'))][(_0x069b('0x53'))](_0x069b('0x54'));}return db[_0x069b('0x31')][_0x069b('0x4d')](_0xae4320[_0x069b('0x4b')]);})['then'](function(_0x1010a1){var _0x21fd20=_0xae4320['user'][_0x069b('0x28')]({'plain':!![]});if(!_0x21fd20)throw new Error(_0x069b('0x55'));if(_0x21fd20[_0x069b('0x56')]===_0x069b('0x57')){var _0x59465d=_0x1010a1[_0x069b('0x28')]({'plain':!![]});return db[_0x069b('0x58')][_0x069b('0x4c')]({'where':{'name':_0x069b('0x29'),'userProfileId':_0x21fd20[_0x069b('0x59')]},'raw':!![]})[_0x069b('0x26')](function(_0x45e770){if(_0x45e770&&_0x45e770[_0x069b('0x5a')]===0x0){return db[_0x069b('0x2a')][_0x069b('0x4d')]({'name':_0x59465d[_0x069b('0x2d')],'resourceId':_0x59465d['id'],'type':_0x45e770[_0x069b('0x2d')],'sectionId':_0x45e770['id']},{})['then'](function(){return _0x1010a1;});}else{return _0x1010a1;}})[_0x069b('0x48')](function(_0x3a2f1f){logger[_0x069b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a2f1f);throw _0x3a2f1f;});}return _0x1010a1;})[_0x069b('0x26')](respondWithResult(_0x4e5371,0xc9))[_0x069b('0x48')](handleError(_0x4e5371,null));};
\ No newline at end of file
+var _0xb1d7=['destroy','then','get','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','catch','show','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','UserProfileResource','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update'];(function(_0x51302c,_0x376113){var _0x20f6c1=function(_0x530cb3){while(--_0x530cb3){_0x51302c['push'](_0x51302c['shift']());}};_0x20f6c1(++_0x376113);}(_0xb1d7,0x184));var _0x7b1d=function(_0x1e9d40,_0x5a202d){_0x1e9d40=_0x1e9d40-0x0;var _0x44d721=_0xb1d7[_0x1e9d40];return _0x44d721;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b1d('0x0'));var zipdir=require(_0x7b1d('0x1'));var jsonpatch=require(_0x7b1d('0x2'));var rp=require(_0x7b1d('0x3'));var moment=require(_0x7b1d('0x4'));var BPromise=require(_0x7b1d('0x5'));var Mustache=require(_0x7b1d('0x6'));var util=require(_0x7b1d('0x7'));var path=require(_0x7b1d('0x8'));var sox=require(_0x7b1d('0x9'));var csv=require(_0x7b1d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b1d('0xb'));var _=require(_0x7b1d('0xc'));var squel=require(_0x7b1d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b1d('0xe'));var toCsv=require(_0x7b1d('0xa'));var querystring=require(_0x7b1d('0xf'));var Papa=require(_0x7b1d('0x10'));var Redis=require(_0x7b1d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7b1d('0x12'));var hardwareService=require(_0x7b1d('0x13'));var logger=require(_0x7b1d('0x14'))('api');var utils=require(_0x7b1d('0x15'));var config=require(_0x7b1d('0x16'));var licenseUtil=require(_0x7b1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219171,_0x4aac7a){_0x4aac7a=_0x4aac7a||0xcc;return function(_0x262b5f){if(_0x262b5f){return _0x219171[_0x7b1d('0x18')](_0x4aac7a);}return _0x219171[_0x7b1d('0x19')](_0x4aac7a)[_0x7b1d('0x1a')]();};}function respondWithResult(_0x22e2f3,_0x20fd6d){_0x20fd6d=_0x20fd6d||0xc8;return function(_0x3cb3cb){if(_0x3cb3cb){return _0x22e2f3[_0x7b1d('0x19')](_0x20fd6d)[_0x7b1d('0x1b')](_0x3cb3cb);}};}function respondWithFilteredResult(_0x12a067,_0x35dba4){return function(_0x47d50e){if(_0x47d50e){var _0x9f54f5=typeof _0x35dba4['offset']===_0x7b1d('0x1c')&&typeof _0x35dba4[_0x7b1d('0x1d')]===_0x7b1d('0x1c');var _0x56cebc=_0x47d50e[_0x7b1d('0x1e')];var _0x101080=_0x9f54f5?0x0:_0x35dba4[_0x7b1d('0x1f')];var _0x3d3bf3=_0x9f54f5?_0x47d50e[_0x7b1d('0x1e')]:_0x35dba4['offset']+_0x35dba4[_0x7b1d('0x1d')];var _0x292019;if(_0x3d3bf3>=_0x56cebc){_0x3d3bf3=_0x56cebc;_0x292019=0xc8;}else{_0x292019=0xce;}_0x12a067[_0x7b1d('0x19')](_0x292019);return _0x12a067['set'](_0x7b1d('0x20'),_0x101080+'-'+_0x3d3bf3+'/'+_0x56cebc)[_0x7b1d('0x1b')](_0x47d50e);}return null;};}function patchUpdates(_0x2ec2ba){return function(_0x456241){try{jsonpatch[_0x7b1d('0x21')](_0x456241,_0x2ec2ba,!![]);}catch(_0x14612b){return BPromise[_0x7b1d('0x22')](_0x14612b);}return _0x456241[_0x7b1d('0x23')]();};}function saveUpdates(_0x1cd54f,_0x350f60){return function(_0x2661f4){if(_0x2661f4){return _0x2661f4[_0x7b1d('0x24')](_0x1cd54f)['then'](function(_0x1ef7e3){return _0x1ef7e3;});}return null;};}function removeEntity(_0x595c49,_0xe5105f){return function(_0x319fd9){if(_0x319fd9){return _0x319fd9[_0x7b1d('0x25')]()[_0x7b1d('0x26')](function(){var _0x264805=_0x319fd9[_0x7b1d('0x27')]({'plain':!![]});var _0x53b61c=_0x7b1d('0x28');return db['UserProfileResource'][_0x7b1d('0x25')]({'where':{'type':_0x53b61c,'resourceId':_0x264805['id']}})[_0x7b1d('0x26')](function(){return _0x319fd9;});})[_0x7b1d('0x26')](function(){_0x595c49['status'](0xcc)[_0x7b1d('0x1a')]();});}};}function handleEntityNotFound(_0x3a547f,_0x436899){return function(_0xb0a797){if(!_0xb0a797){_0x3a547f[_0x7b1d('0x18')](0x194);}return _0xb0a797;};}function handleError(_0x2e3754,_0x22b343){_0x22b343=_0x22b343||0x1f4;return function(_0x352ca5){logger[_0x7b1d('0x29')](_0x352ca5[_0x7b1d('0x2a')]);if(_0x352ca5[_0x7b1d('0x2b')]){delete _0x352ca5['name'];}_0x2e3754['status'](_0x22b343)[_0x7b1d('0x2c')](_0x352ca5);};}exports[_0x7b1d('0x2d')]=function(_0x2d8ff1,_0x55c2ad){var _0x35502b={},_0x155986={},_0x48c1ec={'count':0x0,'rows':[]};var _0x2dca59=_[_0x7b1d('0x2e')](db[_0x7b1d('0x2f')][_0x7b1d('0x30')],function(_0x2cc7bc){return{'name':_0x2cc7bc[_0x7b1d('0x31')],'type':_0x2cc7bc[_0x7b1d('0x32')][_0x7b1d('0x33')]};});_0x155986[_0x7b1d('0x34')]=_[_0x7b1d('0x2e')](_0x2dca59,'name');_0x155986[_0x7b1d('0x35')]=_[_0x7b1d('0x36')](_0x2d8ff1[_0x7b1d('0x35')]);_0x155986[_0x7b1d('0x37')]=_[_0x7b1d('0x38')](_0x155986[_0x7b1d('0x34')],_0x155986[_0x7b1d('0x35')]);_0x35502b[_0x7b1d('0x39')]=_[_0x7b1d('0x38')](_0x155986['model'],qs['fields'](_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x3a')]));_0x35502b[_0x7b1d('0x39')]=_0x35502b[_0x7b1d('0x39')][_0x7b1d('0x3b')]?_0x35502b[_0x7b1d('0x39')]:_0x155986[_0x7b1d('0x34')];if(!_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x3c')]('nolimit')){_0x35502b['limit']=qs['limit'](_0x2d8ff1['query'][_0x7b1d('0x1d')]);_0x35502b['offset']=qs[_0x7b1d('0x1f')](_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x1f')]);}_0x35502b['order']=qs[_0x7b1d('0x3d')](_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x3d')]);_0x35502b[_0x7b1d('0x3e')]=qs['filters'](_[_0x7b1d('0x3f')](_0x2d8ff1[_0x7b1d('0x35')],_0x155986[_0x7b1d('0x37')]),_0x2dca59);if(_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x40')]){_0x35502b[_0x7b1d('0x3e')]=_[_0x7b1d('0x41')](_0x35502b[_0x7b1d('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x40')]+'%'}},{'value':{'$like':'%'+_0x2d8ff1[_0x7b1d('0x35')]['filter']+'%'}}]});}_0x35502b=_[_0x7b1d('0x41')]({},_0x35502b,_0x2d8ff1['options']);var _0x508073={'where':_0x35502b['where']};return db[_0x7b1d('0x2f')][_0x7b1d('0x1e')](_0x508073)['then'](function(_0x2ef86c){_0x48c1ec[_0x7b1d('0x1e')]=_0x2ef86c;if(_0x2d8ff1[_0x7b1d('0x35')][_0x7b1d('0x42')]){_0x35502b[_0x7b1d('0x43')]=[{'all':!![]}];}return db[_0x7b1d('0x2f')]['findAll'](_0x35502b);})[_0x7b1d('0x26')](function(_0x97888d){_0x48c1ec['rows']=_0x97888d;return _0x48c1ec;})[_0x7b1d('0x26')](respondWithFilteredResult(_0x55c2ad,_0x35502b))[_0x7b1d('0x44')](handleError(_0x55c2ad,null));};exports[_0x7b1d('0x45')]=function(_0x1704b1,_0xebd3b3){var _0x3ca458={'raw':!![],'where':{'id':_0x1704b1['params']['id']}},_0x4260a1={};_0x4260a1[_0x7b1d('0x34')]=_[_0x7b1d('0x36')](db[_0x7b1d('0x2f')][_0x7b1d('0x30')]);_0x4260a1[_0x7b1d('0x35')]=_['keys'](_0x1704b1['query']);_0x4260a1[_0x7b1d('0x37')]=_[_0x7b1d('0x38')](_0x4260a1[_0x7b1d('0x34')],_0x4260a1[_0x7b1d('0x35')]);_0x3ca458[_0x7b1d('0x39')]=_[_0x7b1d('0x38')](_0x4260a1[_0x7b1d('0x34')],qs[_0x7b1d('0x3a')](_0x1704b1[_0x7b1d('0x35')][_0x7b1d('0x3a')]));_0x3ca458[_0x7b1d('0x39')]=_0x3ca458[_0x7b1d('0x39')][_0x7b1d('0x3b')]?_0x3ca458[_0x7b1d('0x39')]:_0x4260a1[_0x7b1d('0x34')];if(_0x1704b1[_0x7b1d('0x35')][_0x7b1d('0x42')]){_0x3ca458[_0x7b1d('0x43')]=[{'all':!![]}];}_0x3ca458=_[_0x7b1d('0x41')]({},_0x3ca458,_0x1704b1[_0x7b1d('0x46')]);return db[_0x7b1d('0x2f')][_0x7b1d('0x47')](_0x3ca458)['then'](handleEntityNotFound(_0xebd3b3,null))[_0x7b1d('0x26')](respondWithResult(_0xebd3b3,null))[_0x7b1d('0x44')](handleError(_0xebd3b3,null));};exports[_0x7b1d('0x24')]=function(_0x3b4f33,_0x385b86){if(_0x3b4f33['body']['id']){delete _0x3b4f33[_0x7b1d('0x48')]['id'];}return db[_0x7b1d('0x2f')][_0x7b1d('0x47')]({'where':{'id':_0x3b4f33[_0x7b1d('0x49')]['id']}})[_0x7b1d('0x26')](handleEntityNotFound(_0x385b86,null))[_0x7b1d('0x26')](saveUpdates(_0x3b4f33[_0x7b1d('0x48')],null))['then'](respondWithResult(_0x385b86,null))[_0x7b1d('0x44')](handleError(_0x385b86,null));};exports[_0x7b1d('0x25')]=function(_0xe1997,_0x45a63c){return db[_0x7b1d('0x2f')][_0x7b1d('0x47')]({'where':{'id':_0xe1997[_0x7b1d('0x49')]['id']}})[_0x7b1d('0x26')](handleEntityNotFound(_0x45a63c,null))[_0x7b1d('0x26')](removeEntity(_0x45a63c,null))[_0x7b1d('0x44')](handleError(_0x45a63c,null));};exports[_0x7b1d('0x4a')]=function(_0x438872,_0x2895fb){var _0x2d33fd={'key':_0x438872[_0x7b1d('0x48')][_0x7b1d('0x33')]};if(_0x438872['body']['MailAccountId']){_0x2d33fd['MailAccountId']=_0x438872[_0x7b1d('0x48')][_0x7b1d('0x4b')];}else if(_0x438872[_0x7b1d('0x48')]['SmsAccountId']){_0x2d33fd[_0x7b1d('0x4c')]=_0x438872['body'][_0x7b1d('0x4c')];}else if(_0x438872[_0x7b1d('0x48')]['OpenchannelAccountId']){_0x2d33fd[_0x7b1d('0x4d')]=_0x438872[_0x7b1d('0x48')][_0x7b1d('0x4d')];}else if(_0x438872[_0x7b1d('0x48')][_0x7b1d('0x4e')]){_0x2d33fd[_0x7b1d('0x4e')]=_0x438872[_0x7b1d('0x48')][_0x7b1d('0x4e')];}return db[_0x7b1d('0x2f')]['find']({'where':_0x2d33fd})[_0x7b1d('0x26')](function(_0x312088){if(_0x312088){throw new db[(_0x7b1d('0x4f'))]['ValidationError'](_0x7b1d('0x50'));}return db[_0x7b1d('0x2f')]['create'](_0x438872[_0x7b1d('0x48')]);})[_0x7b1d('0x26')](function(_0x5a246e){var _0xd331e9=_0x438872[_0x7b1d('0x51')]['get']({'plain':!![]});if(!_0xd331e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd331e9[_0x7b1d('0x52')]===_0x7b1d('0x51')){var _0x18a4b8=_0x5a246e['get']({'plain':!![]});return db[_0x7b1d('0x53')]['find']({'where':{'name':_0x7b1d('0x28'),'userProfileId':_0xd331e9['userProfileId']},'raw':!![]})[_0x7b1d('0x26')](function(_0x1543a3){if(_0x1543a3&&_0x1543a3['autoAssociation']===0x0){return db[_0x7b1d('0x54')][_0x7b1d('0x4a')]({'name':_0x18a4b8[_0x7b1d('0x2b')],'resourceId':_0x18a4b8['id'],'type':_0x1543a3[_0x7b1d('0x2b')],'sectionId':_0x1543a3['id']},{})['then'](function(){return _0x5a246e;});}else{return _0x5a246e;}})['catch'](function(_0x7c5310){logger[_0x7b1d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7c5310);throw _0x7c5310;});}return _0x5a246e;})[_0x7b1d('0x26')](respondWithResult(_0x2895fb,0xc9))['catch'](handleError(_0x2895fb,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index f4bb88e..94f99d0 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 _0x6b0e=['./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x6b0e,0x185));var _0xe6b0=function(_0x1e851f,_0x1c7630){_0x1e851f=_0x1e851f-0x0;var _0x4c3e02=_0x6b0e[_0x1e851f];return _0x4c3e02;};'use strict';var _=require(_0xe6b0('0x0'));var util=require(_0xe6b0('0x1'));var logger=require(_0xe6b0('0x2'))('api');var moment=require(_0xe6b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xe6b0('0x4'));var fs=require('fs');var path=require(_0xe6b0('0x5'));var rimraf=require('rimraf');var config=require(_0xe6b0('0x6'));var attributes=require(_0xe6b0('0x7'));module[_0xe6b0('0x8')]=function(_0x2eb83e,_0x1eb26c){return _0x2eb83e['define']('CannedAnswer',attributes,{'tableName':_0xe6b0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe6b0('0xa'),'collate':_0xe6b0('0xb')});};
\ No newline at end of file
+var _0xc738=['utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers'];(function(_0x407f18,_0x2d5b3e){var _0x3b4d46=function(_0x57ff9a){while(--_0x57ff9a){_0x407f18['push'](_0x407f18['shift']());}};_0x3b4d46(++_0x2d5b3e);}(_0xc738,0x6a));var _0x8c73=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc738[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x8c73('0x0'));var logger=require('../../config/logger')(_0x8c73('0x1'));var moment=require('moment');var BPromise=require(_0x8c73('0x2'));var rp=require(_0x8c73('0x3'));var fs=require('fs');var path=require(_0x8c73('0x4'));var rimraf=require(_0x8c73('0x5'));var config=require(_0x8c73('0x6'));var attributes=require(_0x8c73('0x7'));module[_0x8c73('0x8')]=function(_0x1da948,_0x4fbc3a){return _0x1da948[_0x8c73('0x9')]('CannedAnswer',attributes,{'tableName':_0x8c73('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c73('0xb'),'collate':_0x8c73('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index c1c7e68..1044b52 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(_0x37545f,_0x4cfc2f){var _0x1d19be=function(_0x50178c){while(--_0x50178c){_0x37545f['push'](_0x37545f['shift']());}};_0x1d19be(++_0x4cfc2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x2e9e09,_0x4d5246){var _0x35cacc=function(_0x504a1a){while(--_0x504a1a){_0x2e9e09['push'](_0x2e9e09['shift']());}};_0x35cacc(++_0x4d5246);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 39cd44d..4c64d9c 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 _0xe879=['update','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','post','create','put'];(function(_0x55af25,_0x2d0b4a){var _0x5d94ad=function(_0x1090c6){while(--_0x1090c6){_0x55af25['push'](_0x55af25['shift']());}};_0x5d94ad(++_0x2d0b4a);}(_0xe879,0xf2));var _0x9e87=function(_0x197fde,_0x175d73){_0x197fde=_0x197fde-0x0;var _0x4fe854=_0xe879[_0x197fde];return _0x4fe854;};'use strict';var multer=require(_0x9e87('0x0'));var util=require(_0x9e87('0x1'));var path=require(_0x9e87('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e87('0x3'));var router=express['Router']();var fs_extra=require(_0x9e87('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9e87('0x5'));var config=require(_0x9e87('0x6'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x9e87('0x7')](),controller[_0x9e87('0x8')]);router['get'](_0x9e87('0x9'),auth[_0x9e87('0x7')](),controller['show']);router[_0x9e87('0xa')]('/',auth['isAuthenticated'](),controller[_0x9e87('0xb')]);router[_0x9e87('0xc')](_0x9e87('0x9'),auth['isAuthenticated'](),controller[_0x9e87('0xd')]);router['delete'](_0x9e87('0x9'),auth[_0x9e87('0x7')](),controller['destroy']);module[_0x9e87('0xe')]=router;
\ No newline at end of file
+var _0x410e=['./cannedAnswer.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x31cc4b,_0x2c2bf0){var _0x2b9fb2=function(_0x260fe3){while(--_0x260fe3){_0x31cc4b['push'](_0x31cc4b['shift']());}};_0x2b9fb2(++_0x2c2bf0);}(_0x410e,0x114));var _0xe410=function(_0xf709da,_0x5a742c){_0xf709da=_0xf709da-0x0;var _0x2e30a2=_0x410e[_0xf709da];return _0x2e30a2;};'use strict';var multer=require(_0xe410('0x0'));var util=require(_0xe410('0x1'));var path=require('path');var timeout=require(_0xe410('0x2'));var express=require(_0xe410('0x3'));var router=express[_0xe410('0x4')]();var fs_extra=require(_0xe410('0x5'));var auth=require(_0xe410('0x6'));var interaction=require(_0xe410('0x7'));var config=require(_0xe410('0x8'));var controller=require(_0xe410('0x9'));router[_0xe410('0xa')]('/',auth[_0xe410('0xb')](),controller['index']);router['get'](_0xe410('0xc'),auth[_0xe410('0xb')](),controller['show']);router[_0xe410('0xd')]('/',auth['isAuthenticated'](),controller[_0xe410('0xe')]);router[_0xe410('0xf')](_0xe410('0xc'),auth[_0xe410('0xb')](),controller[_0xe410('0x10')]);router[_0xe410('0x11')](_0xe410('0xc'),auth['isAuthenticated'](),controller[_0xe410('0x12')]);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 abb30dc..4a02370 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 _0xd87e=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x284235,_0x3c1a25){var _0x18d480=function(_0x51dd17){while(--_0x51dd17){_0x284235['push'](_0x284235['shift']());}};_0x18d480(++_0x3c1a25);}(_0xd87e,0x1bf));var _0xed87=function(_0x1ef726,_0x16fdea){_0x1ef726=_0x1ef726-0x0;var _0x4c3c66=_0xd87e[_0x1ef726];return _0x4c3c66;};'use strict';var Sequelize=require(_0xed87('0x0'));module[_0xed87('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xed87('0x2')},'clid':{'type':Sequelize[_0xed87('0x3')]},'src':{'type':Sequelize[_0xed87('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xed87('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xed87('0x3')]},'lastapp':{'type':Sequelize[_0xed87('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xed87('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xed87('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xed87('0x3')]},'userfield':{'type':Sequelize[_0xed87('0x3')]},'uniqueid':{'type':Sequelize[_0xed87('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xed87('0x3')]},'peeraccount':{'type':Sequelize[_0xed87('0x3')]},'type':{'type':Sequelize[_0xed87('0x3')]},'tag':{'type':Sequelize[_0xed87('0x3')]}};
\ No newline at end of file
+var _0x4345=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x84c65b,_0x4b3cdb){var _0x5d3e92=function(_0x4a914e){while(--_0x4a914e){_0x84c65b['push'](_0x84c65b['shift']());}};_0x5d3e92(++_0x4b3cdb);}(_0x4345,0x77));var _0x5434=function(_0x4ebc90,_0x166f4a){_0x4ebc90=_0x4ebc90-0x0;var _0x482500=_0x4345[_0x4ebc90];return _0x482500;};'use strict';var Sequelize=require(_0x5434('0x0'));module[_0x5434('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5434('0x2')},'clid':{'type':Sequelize[_0x5434('0x3')]},'src':{'type':Sequelize[_0x5434('0x3')]},'dst':{'type':Sequelize[_0x5434('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5434('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5434('0x3')]},'lastdata':{'type':Sequelize[_0x5434('0x3')]},'duration':{'type':Sequelize[_0x5434('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5434('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5434('0x3')]},'userfield':{'type':Sequelize[_0x5434('0x3')]},'uniqueid':{'type':Sequelize[_0x5434('0x3')]},'linkedid':{'type':Sequelize[_0x5434('0x3')]},'sequence':{'type':Sequelize[_0x5434('0x3')]},'peeraccount':{'type':Sequelize[_0x5434('0x3')]},'type':{'type':Sequelize[_0x5434('0x3')]},'tag':{'type':Sequelize[_0x5434('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 88b4b18..4da985c 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 _0x5577=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x4dea4e,_0xc1a71b){var _0xca799d=function(_0x5bc9fb){while(--_0x5bc9fb){_0x4dea4e['push'](_0x4dea4e['shift']());}};_0xca799d(++_0xc1a71b);}(_0x5577,0x1b4));var _0x7557=function(_0x21cb5f,_0x2aa2bd){_0x21cb5f=_0x21cb5f-0x0;var _0x394180=_0x5577[_0x21cb5f];return _0x394180;};'use strict';var emlformat=require(_0x7557('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7557('0x1'));var jsonpatch=require(_0x7557('0x2'));var rp=require('request-promise');var moment=require(_0x7557('0x3'));var BPromise=require(_0x7557('0x4'));var Mustache=require(_0x7557('0x5'));var util=require(_0x7557('0x6'));var path=require(_0x7557('0x7'));var sox=require(_0x7557('0x8'));var csv=require('to-csv');var ejs=require(_0x7557('0x9'));var fs=require('fs');var fs_extra=require(_0x7557('0xa'));var _=require(_0x7557('0xb'));var squel=require(_0x7557('0xc'));var crypto=require(_0x7557('0xd'));var jsforce=require(_0x7557('0xe'));var deskjs=require(_0x7557('0xf'));var toCsv=require(_0x7557('0x10'));var querystring=require(_0x7557('0x11'));var Papa=require(_0x7557('0x12'));var Redis=require(_0x7557('0x13'));var authService=require(_0x7557('0x14'));var qs=require(_0x7557('0x15'));var as=require(_0x7557('0x16'));var hardwareService=require(_0x7557('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x7557('0x18'));var config=require(_0x7557('0x19'));var licenseUtil=require(_0x7557('0x1a'));var db=require(_0x7557('0x1b'))['db'];function respondWithStatusCode(_0xb6ed30,_0x467ac5){_0x467ac5=_0x467ac5||0xcc;return function(_0x156ac1){if(_0x156ac1){return _0xb6ed30[_0x7557('0x1c')](_0x467ac5);}return _0xb6ed30[_0x7557('0x1d')](_0x467ac5)[_0x7557('0x1e')]();};}function respondWithResult(_0x5468df,_0x276031){_0x276031=_0x276031||0xc8;return function(_0x3fb7a6){if(_0x3fb7a6){return _0x5468df[_0x7557('0x1d')](_0x276031)['json'](_0x3fb7a6);}};}function respondWithFilteredResult(_0x3ad3a1,_0x3c3953){return function(_0x33098f){if(_0x33098f){var _0x325849=typeof _0x3c3953['offset']===_0x7557('0x1f')&&typeof _0x3c3953[_0x7557('0x20')]==='undefined';var _0x4a9cae=_0x33098f[_0x7557('0x21')];var _0x11f186=_0x325849?0x0:_0x3c3953[_0x7557('0x22')];var _0x40a81b=_0x325849?_0x33098f['count']:_0x3c3953[_0x7557('0x22')]+_0x3c3953['limit'];var _0x3e2972;if(_0x40a81b>=_0x4a9cae){_0x40a81b=_0x4a9cae;_0x3e2972=0xc8;}else{_0x3e2972=0xce;}_0x3ad3a1[_0x7557('0x1d')](_0x3e2972);return _0x3ad3a1[_0x7557('0x23')](_0x7557('0x24'),_0x11f186+'-'+_0x40a81b+'/'+_0x4a9cae)['json'](_0x33098f);}return null;};}function patchUpdates(_0x1b60a9){return function(_0x3180cd){try{jsonpatch[_0x7557('0x25')](_0x3180cd,_0x1b60a9,!![]);}catch(_0x34bed5){return BPromise[_0x7557('0x26')](_0x34bed5);}return _0x3180cd['save']();};}function saveUpdates(_0x502e49,_0x4eb212){return function(_0x211fbe){if(_0x211fbe){return _0x211fbe['update'](_0x502e49)[_0x7557('0x27')](function(_0x352b63){return _0x352b63;});}return null;};}function removeEntity(_0x1e97d3,_0x9bbcf6){return function(_0x1533b2){if(_0x1533b2){return _0x1533b2[_0x7557('0x28')]()[_0x7557('0x27')](function(){_0x1e97d3['status'](0xcc)[_0x7557('0x1e')]();});}};}function handleEntityNotFound(_0x5bc953,_0x3daeac){return function(_0x5b2c6a){if(!_0x5b2c6a){_0x5bc953[_0x7557('0x1c')](0x194);}return _0x5b2c6a;};}function handleError(_0x3aa642,_0x4758b9){_0x4758b9=_0x4758b9||0x1f4;return function(_0x42ae94){logger['error'](_0x42ae94[_0x7557('0x29')]);if(_0x42ae94['name']){delete _0x42ae94[_0x7557('0x2a')];}_0x3aa642[_0x7557('0x1d')](_0x4758b9)[_0x7557('0x2b')](_0x42ae94);};}exports['index']=function(_0x3b36eb,_0x2b4ca8){var _0x1c6df9={},_0x1c4649={},_0x19095d={'count':0x0,'rows':[]};var _0x414eec=_['map'](db[_0x7557('0x2c')][_0x7557('0x2d')],function(_0x9080c6){return{'name':_0x9080c6[_0x7557('0x2e')],'type':_0x9080c6['type'][_0x7557('0x2f')]};});_0x1c4649[_0x7557('0x30')]=_[_0x7557('0x31')](_0x414eec,_0x7557('0x2a'));_0x1c4649[_0x7557('0x32')]=_[_0x7557('0x33')](_0x3b36eb[_0x7557('0x32')]);_0x1c4649[_0x7557('0x34')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],_0x1c4649[_0x7557('0x32')]);_0x1c6df9[_0x7557('0x36')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],qs[_0x7557('0x37')](_0x3b36eb[_0x7557('0x32')][_0x7557('0x37')]));_0x1c6df9[_0x7557('0x36')]=_0x1c6df9[_0x7557('0x36')][_0x7557('0x38')]?_0x1c6df9[_0x7557('0x36')]:_0x1c4649[_0x7557('0x30')];if(!_0x3b36eb['query'][_0x7557('0x39')]('nolimit')){_0x1c6df9['limit']=qs[_0x7557('0x20')](_0x3b36eb['query'][_0x7557('0x20')]);_0x1c6df9['offset']=qs['offset'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x22')]);}_0x1c6df9[_0x7557('0x3a')]=qs['sort'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x3b')]);_0x1c6df9[_0x7557('0x3c')]=qs[_0x7557('0x34')](_[_0x7557('0x3d')](_0x3b36eb[_0x7557('0x32')],_0x1c4649[_0x7557('0x34')]),_0x414eec);if(_0x3b36eb[_0x7557('0x32')]['filter']){_0x1c6df9['where']=_['merge'](_0x1c6df9['where'],{'$or':_['map'](_0x414eec,function(_0x4f3c68){if(_0x4f3c68[_0x7557('0x3e')]!==_0x7557('0x3f')){var _0x3a7c60={};_0x3a7c60[_0x4f3c68[_0x7557('0x2a')]]={'$like':'%'+_0x3b36eb['query']['filter']+'%'};return _0x3a7c60;}})});}_0x1c6df9=_[_0x7557('0x40')]({},_0x1c6df9,_0x3b36eb[_0x7557('0x41')]);var _0x962488={'where':_0x1c6df9[_0x7557('0x3c')]};return db[_0x7557('0x2c')]['count'](_0x962488)[_0x7557('0x27')](function(_0x5149c9){_0x19095d[_0x7557('0x21')]=_0x5149c9;if(_0x3b36eb[_0x7557('0x32')][_0x7557('0x42')]){_0x1c6df9[_0x7557('0x43')]=[{'all':!![]}];}return db[_0x7557('0x2c')]['findAll'](_0x1c6df9);})[_0x7557('0x27')](function(_0x3023e5){_0x19095d[_0x7557('0x44')]=_0x3023e5;return _0x19095d;})[_0x7557('0x27')](respondWithFilteredResult(_0x2b4ca8,_0x1c6df9))['catch'](handleError(_0x2b4ca8,null));};exports[_0x7557('0x45')]=function(_0x59a75a,_0x156f3b){var _0x576461={'raw':!![],'where':{'id':_0x59a75a['params']['id']}},_0x16e40f={};_0x16e40f[_0x7557('0x30')]=_['keys'](db[_0x7557('0x2c')]['rawAttributes']);_0x16e40f[_0x7557('0x32')]=_[_0x7557('0x33')](_0x59a75a[_0x7557('0x32')]);_0x16e40f[_0x7557('0x34')]=_[_0x7557('0x35')](_0x16e40f[_0x7557('0x30')],_0x16e40f['query']);_0x576461['attributes']=_['intersection'](_0x16e40f[_0x7557('0x30')],qs[_0x7557('0x37')](_0x59a75a[_0x7557('0x32')][_0x7557('0x37')]));_0x576461[_0x7557('0x36')]=_0x576461['attributes'][_0x7557('0x38')]?_0x576461['attributes']:_0x16e40f[_0x7557('0x30')];if(_0x59a75a[_0x7557('0x32')][_0x7557('0x42')]){_0x576461[_0x7557('0x43')]=[{'all':!![]}];}_0x576461=_[_0x7557('0x40')]({},_0x576461,_0x59a75a[_0x7557('0x41')]);return db[_0x7557('0x2c')][_0x7557('0x46')](_0x576461)['then'](handleEntityNotFound(_0x156f3b,null))[_0x7557('0x27')](respondWithResult(_0x156f3b,null))[_0x7557('0x47')](handleError(_0x156f3b,null));};exports[_0x7557('0x48')]=function(_0x59904c,_0xb25031){return db['Cdr']['create'](_0x59904c[_0x7557('0x49')],{})[_0x7557('0x27')](respondWithResult(_0xb25031,0xc9))[_0x7557('0x47')](handleError(_0xb25031,null));};exports[_0x7557('0x4a')]=function(_0x3683c9,_0x4d9b43){if(_0x3683c9[_0x7557('0x49')]['id']){delete _0x3683c9[_0x7557('0x49')]['id'];}return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x3683c9[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x4d9b43,null))[_0x7557('0x27')](saveUpdates(_0x3683c9['body'],null))['then'](respondWithResult(_0x4d9b43,null))['catch'](handleError(_0x4d9b43,null));};exports['destroy']=function(_0x2b85c5,_0x36a2a1){return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x2b85c5[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x36a2a1,null))[_0x7557('0x27')](removeEntity(_0x36a2a1,null))[_0x7557('0x47')](handleError(_0x36a2a1,null));};exports['describe']=function(_0x46b871,_0x445e17){return db['Cdr'][_0x7557('0x4c')]()['then'](respondWithResult(_0x445e17,null))[_0x7557('0x47')](handleError(_0x445e17,null));};
\ No newline at end of file
+var _0x6aa7=['includeAll','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','length','attributes','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x6aa7,0x178));var _0x76aa=function(_0x2a7a58,_0x3f072d){_0x2a7a58=_0x2a7a58-0x0;var _0x175e2c=_0x6aa7[_0x2a7a58];return _0x175e2c;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x26b75e,_0x3599a9){return function(_0x4ef9b0){if(!_0x4ef9b0){_0x26b75e[_0x76aa('0x19')](0x194);}return _0x4ef9b0;};}function handleError(_0x1d6d15,_0x25c614){_0x25c614=_0x25c614||0x1f4;return function(_0x2e7ab4){logger[_0x76aa('0x29')](_0x2e7ab4[_0x76aa('0x2a')]);if(_0x2e7ab4[_0x76aa('0x2b')]){delete _0x2e7ab4[_0x76aa('0x2b')];}_0x1d6d15[_0x76aa('0x1a')](_0x25c614)[_0x76aa('0x2c')](_0x2e7ab4);};}exports['index']=function(_0x3fcb7f,_0x5a8030){var _0x994550={},_0x365ff8={},_0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x2d')](db[_0x76aa('0x2e')][_0x76aa('0x2f')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x30')],'type':_0x3827ec[_0x76aa('0x31')]['key']};});_0x365ff8[_0x76aa('0x32')]=_[_0x76aa('0x2d')](_0x1e90b9,_0x76aa('0x2b'));_0x365ff8[_0x76aa('0x33')]=_[_0x76aa('0x34')](_0x3fcb7f[_0x76aa('0x33')]);_0x365ff8[_0x76aa('0x35')]=_['intersection'](_0x365ff8[_0x76aa('0x32')],_0x365ff8[_0x76aa('0x33')]);_0x994550['attributes']=_[_0x76aa('0x36')](_0x365ff8['model'],qs[_0x76aa('0x37')](_0x3fcb7f['query'][_0x76aa('0x37')]));_0x994550['attributes']=_0x994550['attributes'][_0x76aa('0x38')]?_0x994550[_0x76aa('0x39')]:_0x365ff8[_0x76aa('0x32')];if(!_0x3fcb7f[_0x76aa('0x33')]['hasOwnProperty']('nolimit')){_0x994550[_0x76aa('0x1f')]=qs[_0x76aa('0x1f')](_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x1f')]);_0x994550[_0x76aa('0x1e')]=qs['offset'](_0x3fcb7f[_0x76aa('0x33')]['offset']);}_0x994550['order']=qs[_0x76aa('0x3a')](_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x3a')]);_0x994550[_0x76aa('0x3b')]=qs['filters'](_[_0x76aa('0x3c')](_0x3fcb7f[_0x76aa('0x33')],_0x365ff8[_0x76aa('0x35')]),_0x1e90b9);if(_0x3fcb7f['query'][_0x76aa('0x3d')]){_0x994550[_0x76aa('0x3b')]=_[_0x76aa('0x3e')](_0x994550[_0x76aa('0x3b')],{'$or':_[_0x76aa('0x2d')](_0x1e90b9,function(_0x982e62){if(_0x982e62[_0x76aa('0x31')]!==_0x76aa('0x3f')){var _0x283179={};_0x283179[_0x982e62['name']]={'$like':'%'+_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x3d')]+'%'};return _0x283179;}})});}_0x994550=_[_0x76aa('0x3e')]({},_0x994550,_0x3fcb7f[_0x76aa('0x40')]);var _0x64612e={'where':_0x994550[_0x76aa('0x3b')]};return db['Cdr']['count'](_0x64612e)[_0x76aa('0x27')](function(_0x262906){_0x2dec94[_0x76aa('0x1d')]=_0x262906;if(_0x3fcb7f[_0x76aa('0x33')]['includeAll']){_0x994550[_0x76aa('0x41')]=[{'all':!![]}];}return db[_0x76aa('0x2e')][_0x76aa('0x42')](_0x994550);})[_0x76aa('0x27')](function(_0x1138b5){_0x2dec94['rows']=_0x1138b5;return _0x2dec94;})[_0x76aa('0x27')](respondWithFilteredResult(_0x5a8030,_0x994550))['catch'](handleError(_0x5a8030,null));};exports[_0x76aa('0x43')]=function(_0x54b8fd,_0x496304){var _0x4f7f3a={'raw':!![],'where':{'id':_0x54b8fd['params']['id']}},_0x144f0a={};_0x144f0a['model']=_['keys'](db[_0x76aa('0x2e')][_0x76aa('0x2f')]);_0x144f0a[_0x76aa('0x33')]=_[_0x76aa('0x34')](_0x54b8fd[_0x76aa('0x33')]);_0x144f0a['filters']=_[_0x76aa('0x36')](_0x144f0a[_0x76aa('0x32')],_0x144f0a[_0x76aa('0x33')]);_0x4f7f3a[_0x76aa('0x39')]=_[_0x76aa('0x36')](_0x144f0a['model'],qs[_0x76aa('0x37')](_0x54b8fd[_0x76aa('0x33')]['fields']));_0x4f7f3a[_0x76aa('0x39')]=_0x4f7f3a['attributes'][_0x76aa('0x38')]?_0x4f7f3a[_0x76aa('0x39')]:_0x144f0a[_0x76aa('0x32')];if(_0x54b8fd[_0x76aa('0x33')][_0x76aa('0x44')]){_0x4f7f3a[_0x76aa('0x41')]=[{'all':!![]}];}_0x4f7f3a=_[_0x76aa('0x3e')]({},_0x4f7f3a,_0x54b8fd[_0x76aa('0x40')]);return db[_0x76aa('0x2e')][_0x76aa('0x45')](_0x4f7f3a)['then'](handleEntityNotFound(_0x496304,null))[_0x76aa('0x27')](respondWithResult(_0x496304,null))['catch'](handleError(_0x496304,null));};exports[_0x76aa('0x46')]=function(_0x3d3332,_0x5e95f5){return db[_0x76aa('0x2e')]['create'](_0x3d3332['body'],{})[_0x76aa('0x27')](respondWithResult(_0x5e95f5,0xc9))['catch'](handleError(_0x5e95f5,null));};exports[_0x76aa('0x26')]=function(_0x302a0c,_0x4315b3){if(_0x302a0c[_0x76aa('0x47')]['id']){delete _0x302a0c[_0x76aa('0x47')]['id'];}return db[_0x76aa('0x2e')]['find']({'where':{'id':_0x302a0c['params']['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x4315b3,null))[_0x76aa('0x27')](saveUpdates(_0x302a0c[_0x76aa('0x47')],null))[_0x76aa('0x27')](respondWithResult(_0x4315b3,null))[_0x76aa('0x48')](handleError(_0x4315b3,null));};exports[_0x76aa('0x28')]=function(_0x4c52d5,_0x95b7c5){return db[_0x76aa('0x2e')][_0x76aa('0x45')]({'where':{'id':_0x4c52d5['params']['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x95b7c5,null))['then'](removeEntity(_0x95b7c5,null))[_0x76aa('0x48')](handleError(_0x95b7c5,null));};exports['describe']=function(_0x339b0d,_0x4449c1){return db[_0x76aa('0x2e')][_0x76aa('0x49')]()[_0x76aa('0x27')](respondWithResult(_0x4449c1,null))[_0x76aa('0x48')](handleError(_0x4449c1,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index f79eabb..e11fab0 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x571dd4,_0x69bfae){var _0x134b59=function(_0x721b1){while(--_0x721b1){_0x571dd4['push'](_0x571dd4['shift']());}};_0x134b59(++_0x69bfae);}(_0x7a54,0x106));var _0x47a5=function(_0x30ede1,_0xa90d28){_0x30ede1=_0x30ede1-0x0;var _0xe1603d=_0x7a54[_0x30ede1];return _0xe1603d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x13f043,_0x39e34b){var _0x1b9bf1=function(_0x381c59){while(--_0x381c59){_0x13f043['push'](_0x13f043['shift']());}};_0x1b9bf1(++_0x39e34b);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 1e6f871..f00a1a7 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 _0xc0c0=['lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1658cc,_0x342989){var _0x36ccf6=function(_0x216077){while(--_0x216077){_0x1658cc['push'](_0x1658cc['shift']());}};_0x36ccf6(++_0x342989);}(_0xc0c0,0xd2));var _0x0c0c=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xc0c0[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x0c0c('0x0'));var util=require(_0x0c0c('0x1'));var moment=require(_0x0c0c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c0c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c0c('0x4'));var logger=require('../../config/logger')(_0x0c0c('0x5'));var config=require(_0x0c0c('0x6'));var jayson=require(_0x0c0c('0x7'));var client=jayson[_0x0c0c('0x8')][_0x0c0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf174,_0x5be767,_0x3e7e44){return new BPromise(function(_0x3d50b3,_0x29711a){return client[_0x0c0c('0xa')](_0x3bf174,_0x3e7e44)[_0x0c0c('0xb')](function(_0x580341){logger[_0x0c0c('0xc')](_0x0c0c('0xd'),_0x5be767,_0x0c0c('0xe'));logger[_0x0c0c('0xf')](_0x0c0c('0x10'),_0x5be767,'request\x20sent',JSON[_0x0c0c('0x11')](_0x580341));if(_0x580341[_0x0c0c('0x12')]){if(_0x580341[_0x0c0c('0x12')][_0x0c0c('0x13')]===0x1f4){logger[_0x0c0c('0x12')](_0x0c0c('0xd'),_0x5be767,_0x580341[_0x0c0c('0x12')][_0x0c0c('0x14')]);return _0x29711a(_0x580341[_0x0c0c('0x12')][_0x0c0c('0x14')]);}logger[_0x0c0c('0x12')](_0x0c0c('0xd'),_0x5be767,_0x580341['error'][_0x0c0c('0x14')]);return _0x3d50b3(_0x580341[_0x0c0c('0x12')][_0x0c0c('0x14')]);}else{logger['info'](_0x0c0c('0xd'),_0x5be767,_0x0c0c('0xe'));_0x3d50b3(_0x580341['result'][_0x0c0c('0x14')]);}})['catch'](function(_0x4f3d67){logger[_0x0c0c('0x12')]('Cdr,\x20%s,\x20%s',_0x5be767,_0x4f3d67);_0x29711a(_0x4f3d67);});});}
\ No newline at end of file
+var _0x36ed=['../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','error','code','message','result','moment','bluebird','ioredis'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x36ed,0xed));var _0xd36e=function(_0x5f1b3c,_0x49e42a){_0x5f1b3c=_0x5f1b3c-0x0;var _0x2fd484=_0x36ed[_0x5f1b3c];return _0x2fd484;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd36e('0x0'));var BPromise=require(_0xd36e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd36e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd36e('0x3'));var logger=require(_0xd36e('0x4'))('rpc');var config=require(_0xd36e('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd36e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x209817,_0x54b7a0,_0x3c051d){return new BPromise(function(_0x1d0cb5,_0x28ca39){return client[_0xd36e('0x7')](_0x209817,_0x3c051d)[_0xd36e('0x8')](function(_0x51a23c){logger[_0xd36e('0x9')](_0xd36e('0xa'),_0x54b7a0,_0xd36e('0xb'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x54b7a0,_0xd36e('0xb'),JSON['stringify'](_0x51a23c));if(_0x51a23c[_0xd36e('0xc')]){if(_0x51a23c['error'][_0xd36e('0xd')]===0x1f4){logger[_0xd36e('0xc')](_0xd36e('0xa'),_0x54b7a0,_0x51a23c[_0xd36e('0xc')]['message']);return _0x28ca39(_0x51a23c[_0xd36e('0xc')][_0xd36e('0xe')]);}logger[_0xd36e('0xc')]('Cdr,\x20%s,\x20%s',_0x54b7a0,_0x51a23c[_0xd36e('0xc')][_0xd36e('0xe')]);return _0x1d0cb5(_0x51a23c[_0xd36e('0xc')][_0xd36e('0xe')]);}else{logger[_0xd36e('0x9')](_0xd36e('0xa'),_0x54b7a0,_0xd36e('0xb'));_0x1d0cb5(_0x51a23c[_0xd36e('0xf')]['message']);}})['catch'](function(_0x301e14){logger[_0xd36e('0xc')]('Cdr,\x20%s,\x20%s',_0x54b7a0,_0x301e14);_0x28ca39(_0x301e14);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 4d98c2b..4ec0a7b 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 _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(_0x565605,_0x17dd6f){var _0x19193b=function(_0x3fb056){while(--_0x3fb056){_0x565605['push'](_0x565605['shift']());}};_0x19193b(++_0x17dd6f);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d3d0d,_0x67ac82){_0x2d3d0d=_0x2d3d0d-0x0;var _0xca35b6=_0xb10b[_0x2d3d0d];return _0xca35b6;};'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
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index bee4ac7..4eaec98 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 _0xd2a6=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0xd2a6,0x170));var _0x6d2a=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0xd2a6[_0x48ec91];return _0x22766c;};'use strict';var Sequelize=require(_0x6d2a('0x0'));module[_0x6d2a('0x1')]={'priority':{'type':Sequelize[_0x6d2a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6d2a('0x3')],'allowNull':![],'defaultValue':_0x6d2a('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6d2a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6d2a('0x5')}};
\ No newline at end of file
+var _0xd8cc=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3f6552,_0x2c54fc){var _0x3614c1=function(_0x248cd4){while(--_0x248cd4){_0x3f6552['push'](_0x3f6552['shift']());}};_0x3614c1(++_0x2c54fc);}(_0xd8cc,0xaf));var _0xcd8c=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0xd8cc[_0x16dbcd];return _0x34706e;};'use strict';var Sequelize=require(_0xcd8c('0x0'));module[_0xcd8c('0x1')]={'priority':{'type':Sequelize[_0xcd8c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcd8c('0x3')],'allowNull':![],'defaultValue':_0xcd8c('0x4')},'appdata':{'type':Sequelize[_0xcd8c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcd8c('0x3')],'defaultValue':_0xcd8c('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 2787122..63bc2c4 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 _0xfa20=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','show','params','model','keys','filters','intersection','query','fields','attributes','includeAll','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x597f6c,_0x2d7f48){var _0x20e8b8=function(_0x7552e6){while(--_0x7552e6){_0x597f6c['push'](_0x597f6c['shift']());}};_0x20e8b8(++_0x2d7f48);}(_0xfa20,0x141));var _0x0fa2=function(_0x4bf5ec,_0x333deb){_0x4bf5ec=_0x4bf5ec-0x0;var _0x128359=_0xfa20[_0x4bf5ec];return _0x128359;};'use strict';var emlformat=require(_0x0fa2('0x0'));var rimraf=require(_0x0fa2('0x1'));var zipdir=require(_0x0fa2('0x2'));var jsonpatch=require(_0x0fa2('0x3'));var rp=require(_0x0fa2('0x4'));var moment=require(_0x0fa2('0x5'));var BPromise=require(_0x0fa2('0x6'));var Mustache=require(_0x0fa2('0x7'));var util=require(_0x0fa2('0x8'));var path=require(_0x0fa2('0x9'));var sox=require(_0x0fa2('0xa'));var csv=require('to-csv');var ejs=require(_0x0fa2('0xb'));var fs=require('fs');var fs_extra=require(_0x0fa2('0xc'));var _=require('lodash');var squel=require(_0x0fa2('0xd'));var crypto=require(_0x0fa2('0xe'));var jsforce=require(_0x0fa2('0xf'));var deskjs=require(_0x0fa2('0x10'));var toCsv=require(_0x0fa2('0x11'));var querystring=require(_0x0fa2('0x12'));var Papa=require(_0x0fa2('0x13'));var Redis=require(_0x0fa2('0x14'));var authService=require(_0x0fa2('0x15'));var qs=require(_0x0fa2('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fa2('0x17'));var logger=require(_0x0fa2('0x18'))(_0x0fa2('0x19'));var utils=require(_0x0fa2('0x1a'));var config=require(_0x0fa2('0x1b'));var licenseUtil=require(_0x0fa2('0x1c'));var db=require(_0x0fa2('0x1d'))['db'];function respondWithStatusCode(_0x15a25c,_0x524360){_0x524360=_0x524360||0xcc;return function(_0x3d86ee){if(_0x3d86ee){return _0x15a25c['sendStatus'](_0x524360);}return _0x15a25c[_0x0fa2('0x1e')](_0x524360)['end']();};}function respondWithResult(_0x539b6b,_0x4a5ba2){_0x4a5ba2=_0x4a5ba2||0xc8;return function(_0x2d4c9d){if(_0x2d4c9d){return _0x539b6b[_0x0fa2('0x1e')](_0x4a5ba2)[_0x0fa2('0x1f')](_0x2d4c9d);}};}function respondWithFilteredResult(_0x157b03,_0x4366a8){return function(_0x46e317){if(_0x46e317){var _0x162cb3=typeof _0x4366a8[_0x0fa2('0x20')]==='undefined'&&typeof _0x4366a8[_0x0fa2('0x21')]===_0x0fa2('0x22');var _0x3e3baf=_0x46e317[_0x0fa2('0x23')];var _0x40f402=_0x162cb3?0x0:_0x4366a8[_0x0fa2('0x20')];var _0x2083a0=_0x162cb3?_0x46e317[_0x0fa2('0x23')]:_0x4366a8[_0x0fa2('0x20')]+_0x4366a8[_0x0fa2('0x21')];var _0x59177e;if(_0x2083a0>=_0x3e3baf){_0x2083a0=_0x3e3baf;_0x59177e=0xc8;}else{_0x59177e=0xce;}_0x157b03['status'](_0x59177e);return _0x157b03[_0x0fa2('0x24')](_0x0fa2('0x25'),_0x40f402+'-'+_0x2083a0+'/'+_0x3e3baf)['json'](_0x46e317);}return null;};}function patchUpdates(_0x383ebd){return function(_0x29b93c){try{jsonpatch[_0x0fa2('0x26')](_0x29b93c,_0x383ebd,!![]);}catch(_0x48d549){return BPromise[_0x0fa2('0x27')](_0x48d549);}return _0x29b93c[_0x0fa2('0x28')]();};}function saveUpdates(_0x5cbca0,_0x3b51bc){return function(_0x574ae0){if(_0x574ae0){return _0x574ae0[_0x0fa2('0x29')](_0x5cbca0)[_0x0fa2('0x2a')](function(_0xb6b606){return _0xb6b606;});}return null;};}function removeEntity(_0x2cf751,_0x7f6eb){return function(_0x4d921b){if(_0x4d921b){return _0x4d921b[_0x0fa2('0x2b')]()[_0x0fa2('0x2a')](function(){_0x2cf751[_0x0fa2('0x1e')](0xcc)[_0x0fa2('0x2c')]();});}};}function handleEntityNotFound(_0x16b313,_0x40d425){return function(_0x38a2c4){if(!_0x38a2c4){_0x16b313['sendStatus'](0x194);}return _0x38a2c4;};}function handleError(_0x461c54,_0x5180d1){_0x5180d1=_0x5180d1||0x1f4;return function(_0x3611ca){logger['error'](_0x3611ca[_0x0fa2('0x2d')]);if(_0x3611ca[_0x0fa2('0x2e')]){delete _0x3611ca[_0x0fa2('0x2e')];}_0x461c54[_0x0fa2('0x1e')](_0x5180d1)[_0x0fa2('0x2f')](_0x3611ca);};}exports[_0x0fa2('0x30')]=function(_0x50779a,_0xda3cdf){var _0x597f53={'raw':!![],'where':{'id':_0x50779a[_0x0fa2('0x31')]['id']}},_0x5060bf={};_0x5060bf[_0x0fa2('0x32')]=_[_0x0fa2('0x33')](db['ChatApplication']['rawAttributes']);_0x5060bf['query']=_['keys'](_0x50779a['query']);_0x5060bf[_0x0fa2('0x34')]=_[_0x0fa2('0x35')](_0x5060bf[_0x0fa2('0x32')],_0x5060bf[_0x0fa2('0x36')]);_0x597f53['attributes']=_['intersection'](_0x5060bf['model'],qs[_0x0fa2('0x37')](_0x50779a['query'][_0x0fa2('0x37')]));_0x597f53[_0x0fa2('0x38')]=_0x597f53[_0x0fa2('0x38')]['length']?_0x597f53['attributes']:_0x5060bf[_0x0fa2('0x32')];if(_0x50779a[_0x0fa2('0x36')][_0x0fa2('0x39')]){_0x597f53[_0x0fa2('0x3a')]=[{'all':!![]}];}_0x597f53=_[_0x0fa2('0x3b')]({},_0x597f53,_0x50779a[_0x0fa2('0x3c')]);return db[_0x0fa2('0x3d')][_0x0fa2('0x3e')](_0x597f53)[_0x0fa2('0x2a')](handleEntityNotFound(_0xda3cdf,null))[_0x0fa2('0x2a')](respondWithResult(_0xda3cdf,null))[_0x0fa2('0x3f')](handleError(_0xda3cdf,null));};exports[_0x0fa2('0x29')]=function(_0x18eb5a,_0x2a6317){if(_0x18eb5a[_0x0fa2('0x40')]['id']){delete _0x18eb5a[_0x0fa2('0x40')]['id'];}return db[_0x0fa2('0x3d')][_0x0fa2('0x3e')]({'where':{'id':_0x18eb5a['params']['id']}})['then'](handleEntityNotFound(_0x2a6317,null))[_0x0fa2('0x2a')](saveUpdates(_0x18eb5a[_0x0fa2('0x40')],null))[_0x0fa2('0x2a')](respondWithResult(_0x2a6317,null))[_0x0fa2('0x3f')](handleError(_0x2a6317,null));};exports[_0x0fa2('0x2b')]=function(_0x4526e7,_0x59df2b){return db[_0x0fa2('0x3d')][_0x0fa2('0x3e')]({'where':{'id':_0x4526e7[_0x0fa2('0x31')]['id']}})[_0x0fa2('0x2a')](handleEntityNotFound(_0x59df2b,null))[_0x0fa2('0x2a')](removeEntity(_0x59df2b,null))['catch'](handleError(_0x59df2b,null));};
\ No newline at end of file
+var _0x2cae=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model'];(function(_0x3e79e5,_0x2894b0){var _0x503dad=function(_0x328b87){while(--_0x328b87){_0x3e79e5['push'](_0x3e79e5['shift']());}};_0x503dad(++_0x2894b0);}(_0x2cae,0x16b));var _0xe2ca=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x2cae[_0x58afd5];return _0x3e503b;};'use strict';var emlformat=require(_0xe2ca('0x0'));var rimraf=require(_0xe2ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe2ca('0x2'));var moment=require(_0xe2ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe2ca('0x4'));var util=require(_0xe2ca('0x5'));var path=require(_0xe2ca('0x6'));var sox=require(_0xe2ca('0x7'));var csv=require('to-csv');var ejs=require(_0xe2ca('0x8'));var fs=require('fs');var fs_extra=require(_0xe2ca('0x9'));var _=require('lodash');var squel=require(_0xe2ca('0xa'));var crypto=require('crypto');var jsforce=require(_0xe2ca('0xb'));var deskjs=require(_0xe2ca('0xc'));var toCsv=require(_0xe2ca('0xd'));var querystring=require(_0xe2ca('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe2ca('0xf'));var hardwareService=require(_0xe2ca('0x10'));var logger=require(_0xe2ca('0x11'))(_0xe2ca('0x12'));var utils=require(_0xe2ca('0x13'));var config=require(_0xe2ca('0x14'));var licenseUtil=require(_0xe2ca('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1138ee,_0x2773cc){_0x2773cc=_0x2773cc||0xcc;return function(_0x199237){if(_0x199237){return _0x1138ee[_0xe2ca('0x16')](_0x2773cc);}return _0x1138ee[_0xe2ca('0x17')](_0x2773cc)['end']();};}function respondWithResult(_0x31f283,_0x3cfcc9){_0x3cfcc9=_0x3cfcc9||0xc8;return function(_0x27c3ad){if(_0x27c3ad){return _0x31f283[_0xe2ca('0x17')](_0x3cfcc9)[_0xe2ca('0x18')](_0x27c3ad);}};}function respondWithFilteredResult(_0x3a9612,_0x1c1514){return function(_0x29cdcf){if(_0x29cdcf){var _0x326340=typeof _0x1c1514[_0xe2ca('0x19')]==='undefined'&&typeof _0x1c1514[_0xe2ca('0x1a')]==='undefined';var _0x4ca8fd=_0x29cdcf[_0xe2ca('0x1b')];var _0x18cd42=_0x326340?0x0:_0x1c1514['offset'];var _0x393c23=_0x326340?_0x29cdcf[_0xe2ca('0x1b')]:_0x1c1514[_0xe2ca('0x19')]+_0x1c1514['limit'];var _0x4380fb;if(_0x393c23>=_0x4ca8fd){_0x393c23=_0x4ca8fd;_0x4380fb=0xc8;}else{_0x4380fb=0xce;}_0x3a9612[_0xe2ca('0x17')](_0x4380fb);return _0x3a9612[_0xe2ca('0x1c')]('Content-Range',_0x18cd42+'-'+_0x393c23+'/'+_0x4ca8fd)[_0xe2ca('0x18')](_0x29cdcf);}return null;};}function patchUpdates(_0x56b574){return function(_0x16f418){try{jsonpatch[_0xe2ca('0x1d')](_0x16f418,_0x56b574,!![]);}catch(_0x60d8e8){return BPromise[_0xe2ca('0x1e')](_0x60d8e8);}return _0x16f418[_0xe2ca('0x1f')]();};}function saveUpdates(_0x1b98d8,_0x50af69){return function(_0x1a1522){if(_0x1a1522){return _0x1a1522[_0xe2ca('0x20')](_0x1b98d8)[_0xe2ca('0x21')](function(_0x2ca129){return _0x2ca129;});}return null;};}function removeEntity(_0x18a6c6,_0x2772b5){return function(_0xa1fa2b){if(_0xa1fa2b){return _0xa1fa2b[_0xe2ca('0x22')]()[_0xe2ca('0x21')](function(){_0x18a6c6['status'](0xcc)[_0xe2ca('0x23')]();});}};}function handleEntityNotFound(_0x272bb3,_0x3f3d6e){return function(_0xc52f5e){if(!_0xc52f5e){_0x272bb3[_0xe2ca('0x16')](0x194);}return _0xc52f5e;};}function handleError(_0x4b2a2e,_0x524b6c){_0x524b6c=_0x524b6c||0x1f4;return function(_0x20ac37){logger[_0xe2ca('0x24')](_0x20ac37[_0xe2ca('0x25')]);if(_0x20ac37[_0xe2ca('0x26')]){delete _0x20ac37[_0xe2ca('0x26')];}_0x4b2a2e[_0xe2ca('0x17')](_0x524b6c)[_0xe2ca('0x27')](_0x20ac37);};}exports[_0xe2ca('0x28')]=function(_0x565e9b,_0x5df46f){var _0x333665={'raw':!![],'where':{'id':_0x565e9b[_0xe2ca('0x29')]['id']}},_0x300d0e={};_0x300d0e[_0xe2ca('0x2a')]=_[_0xe2ca('0x2b')](db[_0xe2ca('0x2c')][_0xe2ca('0x2d')]);_0x300d0e[_0xe2ca('0x2e')]=_[_0xe2ca('0x2b')](_0x565e9b[_0xe2ca('0x2e')]);_0x300d0e[_0xe2ca('0x2f')]=_[_0xe2ca('0x30')](_0x300d0e[_0xe2ca('0x2a')],_0x300d0e[_0xe2ca('0x2e')]);_0x333665['attributes']=_[_0xe2ca('0x30')](_0x300d0e[_0xe2ca('0x2a')],qs[_0xe2ca('0x31')](_0x565e9b[_0xe2ca('0x2e')][_0xe2ca('0x31')]));_0x333665[_0xe2ca('0x32')]=_0x333665[_0xe2ca('0x32')]['length']?_0x333665['attributes']:_0x300d0e['model'];if(_0x565e9b[_0xe2ca('0x2e')][_0xe2ca('0x33')]){_0x333665[_0xe2ca('0x34')]=[{'all':!![]}];}_0x333665=_[_0xe2ca('0x35')]({},_0x333665,_0x565e9b[_0xe2ca('0x36')]);return db['ChatApplication'][_0xe2ca('0x37')](_0x333665)[_0xe2ca('0x21')](handleEntityNotFound(_0x5df46f,null))['then'](respondWithResult(_0x5df46f,null))[_0xe2ca('0x38')](handleError(_0x5df46f,null));};exports[_0xe2ca('0x20')]=function(_0x21d7bf,_0x48b0f8){if(_0x21d7bf[_0xe2ca('0x39')]['id']){delete _0x21d7bf[_0xe2ca('0x39')]['id'];}return db[_0xe2ca('0x2c')]['find']({'where':{'id':_0x21d7bf[_0xe2ca('0x29')]['id']}})['then'](handleEntityNotFound(_0x48b0f8,null))[_0xe2ca('0x21')](saveUpdates(_0x21d7bf['body'],null))['then'](respondWithResult(_0x48b0f8,null))[_0xe2ca('0x38')](handleError(_0x48b0f8,null));};exports[_0xe2ca('0x22')]=function(_0x2dbf5e,_0x57e784){return db[_0xe2ca('0x2c')][_0xe2ca('0x37')]({'where':{'id':_0x2dbf5e[_0xe2ca('0x29')]['id']}})[_0xe2ca('0x21')](handleEntityNotFound(_0x57e784,null))['then'](removeEntity(_0x57e784,null))['catch'](handleError(_0x57e784,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7a206a4..90a1c9f 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 _0xc439=['api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2373c6,_0x4218c9){var _0xf2aaa9=function(_0x26eb3b){while(--_0x26eb3b){_0x2373c6['push'](_0x2373c6['shift']());}};_0xf2aaa9(++_0x4218c9);}(_0xc439,0x174));var _0x9c43=function(_0x4170cb,_0x20f4b0){_0x4170cb=_0x4170cb-0x0;var _0x396e15=_0xc439[_0x4170cb];return _0x396e15;};'use strict';var _=require(_0x9c43('0x0'));var util=require(_0x9c43('0x1'));var logger=require(_0x9c43('0x2'))(_0x9c43('0x3'));var moment=require(_0x9c43('0x4'));var BPromise=require(_0x9c43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c43('0x6'));var config=require(_0x9c43('0x7'));var attributes=require(_0x9c43('0x8'));module[_0x9c43('0x9')]=function(_0x34e2fc,_0x4e9ad5){return _0x34e2fc[_0x9c43('0xa')](_0x9c43('0xb'),attributes,{'tableName':_0x9c43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c43('0xd'),'collate':_0x9c43('0xe')});};
\ No newline at end of file
+var _0x072c=['path','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x072c,0x10f));var _0xc072=function(_0x5982d9,_0x319a1c){_0x5982d9=_0x5982d9-0x0;var _0x4b938e=_0x072c[_0x5982d9];return _0x4b938e;};'use strict';var _=require(_0xc072('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc072('0x1'));var moment=require(_0xc072('0x2'));var BPromise=require(_0xc072('0x3'));var rp=require(_0xc072('0x4'));var fs=require('fs');var path=require(_0xc072('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc072('0x6'));module['exports']=function(_0x852f18,_0x2fdd9a){return _0x852f18[_0xc072('0x7')](_0xc072('0x8'),attributes,{'tableName':_0xc072('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc072('0xa'),'collate':_0xc072('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index f94c24c..d4d78eb 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 _0x32ab=['../../mysqldb','../../config/logger','jayson/promise','request','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','lodash','moment','bluebird','randomstring'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x32ab,0x17c));var _0xb32a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x32ab[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xb32a('0x0'));var util=require('util');var moment=require(_0xb32a('0x1'));var BPromise=require(_0xb32a('0x2'));var rs=require(_0xb32a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb32a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb32a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb32a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d1638,_0x1e850f,_0x55fb79){return new BPromise(function(_0x4d1ba0,_0x33f31d){return client[_0xb32a('0x7')](_0x2d1638,_0x55fb79)['then'](function(_0x52c373){logger[_0xb32a('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1e850f,_0xb32a('0x9'));logger['debug'](_0xb32a('0xa'),_0x1e850f,_0xb32a('0x9'),JSON[_0xb32a('0xb')](_0x52c373));if(_0x52c373[_0xb32a('0xc')]){if(_0x52c373[_0xb32a('0xc')][_0xb32a('0xd')]===0x1f4){logger[_0xb32a('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1e850f,_0x52c373[_0xb32a('0xc')]['message']);return _0x33f31d(_0x52c373['error'][_0xb32a('0xe')]);}logger['error'](_0xb32a('0xf'),_0x1e850f,_0x52c373[_0xb32a('0xc')][_0xb32a('0xe')]);return _0x4d1ba0(_0x52c373[_0xb32a('0xc')][_0xb32a('0xe')]);}else{logger[_0xb32a('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1e850f,_0xb32a('0x9'));_0x4d1ba0(_0x52c373['result']['message']);}})['catch'](function(_0x23cecd){logger[_0xb32a('0xc')](_0xb32a('0xf'),_0x1e850f,_0x23cecd);_0x33f31d(_0x23cecd);});});}
\ No newline at end of file
+var _0xab6c=['request\x20sent','debug','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s'];(function(_0x1f03d2,_0x432acf){var _0x41130d=function(_0x1b40ec){while(--_0x1b40ec){_0x1f03d2['push'](_0x1f03d2['shift']());}};_0x41130d(++_0x432acf);}(_0xab6c,0xc0));var _0xcab6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xab6c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xcab6('0x0'));var util=require(_0xcab6('0x1'));var moment=require('moment');var BPromise=require(_0xcab6('0x2'));var rs=require(_0xcab6('0x3'));var fs=require('fs');var Redis=require(_0xcab6('0x4'));var db=require(_0xcab6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcab6('0x6'))(_0xcab6('0x7'));var config=require(_0xcab6('0x8'));var jayson=require(_0xcab6('0x9'));var client=jayson[_0xcab6('0xa')][_0xcab6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d691c,_0x5bdbbc,_0x1f5445){return new BPromise(function(_0x426a6c,_0x15d151){return client[_0xcab6('0xc')](_0x1d691c,_0x1f5445)[_0xcab6('0xd')](function(_0x527556){logger['info'](_0xcab6('0xe'),_0x5bdbbc,_0xcab6('0xf'));logger[_0xcab6('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5bdbbc,'request\x20sent',JSON['stringify'](_0x527556));if(_0x527556[_0xcab6('0x11')]){if(_0x527556[_0xcab6('0x11')][_0xcab6('0x12')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5bdbbc,_0x527556[_0xcab6('0x11')][_0xcab6('0x13')]);return _0x15d151(_0x527556[_0xcab6('0x11')][_0xcab6('0x13')]);}logger[_0xcab6('0x11')]('ChatApplication,\x20%s,\x20%s',_0x5bdbbc,_0x527556['error'][_0xcab6('0x13')]);return _0x426a6c(_0x527556[_0xcab6('0x11')][_0xcab6('0x13')]);}else{logger[_0xcab6('0x14')]('ChatApplication,\x20%s,\x20%s',_0x5bdbbc,_0xcab6('0xf'));_0x426a6c(_0x527556[_0xcab6('0x15')][_0xcab6('0x13')]);}})[_0xcab6('0x16')](function(_0x560f41){logger['error'](_0xcab6('0xe'),_0x5bdbbc,_0x560f41);_0x15d151(_0x560f41);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 0f08f99..ac73edb 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 _0x45aa=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update'];(function(_0x240a63,_0x3403f3){var _0x528aa3=function(_0x4b8b79){while(--_0x4b8b79){_0x240a63['push'](_0x240a63['shift']());}};_0x528aa3(++_0x3403f3);}(_0x45aa,0x1b8));var _0xa45a=function(_0x593567,_0x537f33){_0x593567=_0x593567-0x0;var _0x2e1562=_0x45aa[_0x593567];return _0x2e1562;};'use strict';var multer=require(_0xa45a('0x0'));var util=require(_0xa45a('0x1'));var path=require(_0xa45a('0x2'));var timeout=require(_0xa45a('0x3'));var express=require('express');var router=express[_0xa45a('0x4')]();var fs_extra=require(_0xa45a('0x5'));var auth=require(_0xa45a('0x6'));var interaction=require(_0xa45a('0x7'));var config=require(_0xa45a('0x8'));var controller=require(_0xa45a('0x9'));router[_0xa45a('0xa')](_0xa45a('0xb'),auth['isAuthenticated'](),controller[_0xa45a('0xc')]);router[_0xa45a('0xd')]('/:id',auth[_0xa45a('0xe')](),controller[_0xa45a('0xf')]);router[_0xa45a('0x10')](_0xa45a('0xb'),auth[_0xa45a('0xe')](),controller[_0xa45a('0x11')]);module[_0xa45a('0x12')]=router;
\ No newline at end of file
+var _0xd609=['put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x37b3b3,_0x295690){var _0xf12012=function(_0xcc31cf){while(--_0xcc31cf){_0x37b3b3['push'](_0x37b3b3['shift']());}};_0xf12012(++_0x295690);}(_0xd609,0x1f0));var _0x9d60=function(_0x5060fd,_0x5a4654){_0x5060fd=_0x5060fd-0x0;var _0x317be2=_0xd609[_0x5060fd];return _0x317be2;};'use strict';var multer=require(_0x9d60('0x0'));var util=require(_0x9d60('0x1'));var path=require('path');var timeout=require(_0x9d60('0x2'));var express=require(_0x9d60('0x3'));var router=express[_0x9d60('0x4')]();var fs_extra=require(_0x9d60('0x5'));var auth=require(_0x9d60('0x6'));var interaction=require(_0x9d60('0x7'));var config=require(_0x9d60('0x8'));var controller=require(_0x9d60('0x9'));router[_0x9d60('0xa')](_0x9d60('0xb'),auth[_0x9d60('0xc')](),controller[_0x9d60('0xd')]);router[_0x9d60('0xe')]('/:id',auth[_0x9d60('0xc')](),controller['update']);router[_0x9d60('0xf')](_0x9d60('0xb'),auth[_0x9d60('0xc')](),controller['destroy']);module[_0x9d60('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index b91720a..000fcbf 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 _0x9541=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3b39b8,_0x1e19b7){var _0x936eb=function(_0x51c343){while(--_0x51c343){_0x3b39b8['push'](_0x3b39b8['shift']());}};_0x936eb(++_0x1e19b7);}(_0x9541,0xb3));var _0x1954=function(_0x1b060d,_0x218177){_0x1b060d=_0x1b060d-0x0;var _0xf36c56=_0x9541[_0x1b060d];return _0xf36c56;};'use strict';var Sequelize=require(_0x1954('0x0'));module[_0x1954('0x1')]={'name':{'type':Sequelize[_0x1954('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1954('0x2')]},'write':{'type':Sequelize[_0x1954('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0db8=['STRING','BOOLEAN','sequelize'];(function(_0xb52ec4,_0x594a54){var _0xea5904=function(_0x408f97){while(--_0x408f97){_0xb52ec4['push'](_0xb52ec4['shift']());}};_0xea5904(++_0x594a54);}(_0x0db8,0x1cd));var _0x80db=function(_0x49f30e,_0xf28439){_0x49f30e=_0x49f30e-0x0;var _0x2cafd5=_0x0db8[_0x49f30e];return _0x2cafd5;};'use strict';var Sequelize=require(_0x80db('0x0'));module['exports']={'name':{'type':Sequelize[_0x80db('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x80db('0x1')]},'write':{'type':Sequelize[_0x80db('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 794c73d..df21735 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 _0x0b4e=['VIRTUAL','filter','options','includeAll','findAll','catch','show','params','length','include','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','nolimit','removeMembers','addMessage','ChatGroupId','create','getMessages','$gte','split','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','stack','name','send','map','ChatGroup','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge'];(function(_0x42fced,_0x55d428){var _0x12c61e=function(_0x29d41b){while(--_0x29d41b){_0x42fced['push'](_0x42fced['shift']());}};_0x12c61e(++_0x55d428);}(_0x0b4e,0x7f));var _0xe0b4=function(_0xe327b1,_0x333197){_0xe327b1=_0xe327b1-0x0;var _0x364891=_0x0b4e[_0xe327b1];return _0x364891;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0b4('0x0'));var zipdir=require(_0xe0b4('0x1'));var jsonpatch=require(_0xe0b4('0x2'));var rp=require(_0xe0b4('0x3'));var moment=require(_0xe0b4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe0b4('0x5'));var sox=require(_0xe0b4('0x6'));var csv=require('to-csv');var ejs=require(_0xe0b4('0x7'));var fs=require('fs');var fs_extra=require(_0xe0b4('0x8'));var _=require(_0xe0b4('0x9'));var squel=require(_0xe0b4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe0b4('0xb'));var toCsv=require(_0xe0b4('0xc'));var querystring=require('querystring');var Papa=require(_0xe0b4('0xd'));var Redis=require(_0xe0b4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe0b4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0b4('0x10'));var logger=require('../../config/logger')(_0xe0b4('0x11'));var utils=require(_0xe0b4('0x12'));var config=require(_0xe0b4('0x13'));var licenseUtil=require(_0xe0b4('0x14'));var db=require(_0xe0b4('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xe0b4('0x16'),'port':0x18eb});var socket=require(_0xe0b4('0x17'))(new Redis(config[_0xe0b4('0x18')]));require(_0xe0b4('0x19'))[_0xe0b4('0x1a')](socket);function respondWithStatusCode(_0x4dffdc,_0x495562){_0x495562=_0x495562||0xcc;return function(_0x4bce2e){if(_0x4bce2e){return _0x4dffdc[_0xe0b4('0x1b')](_0x495562);}return _0x4dffdc[_0xe0b4('0x1c')](_0x495562)[_0xe0b4('0x1d')]();};}function respondWithResult(_0xbcdd80,_0x5cb099){_0x5cb099=_0x5cb099||0xc8;return function(_0x52ebaa){if(_0x52ebaa){return _0xbcdd80['status'](_0x5cb099)[_0xe0b4('0x1e')](_0x52ebaa);}};}function respondWithFilteredResult(_0x432fc8,_0x5d9bf0){return function(_0x54a73a){if(_0x54a73a){var _0x173522=typeof _0x5d9bf0[_0xe0b4('0x1f')]===_0xe0b4('0x20')&&typeof _0x5d9bf0['limit']==='undefined';var _0x1b1e3c=_0x54a73a[_0xe0b4('0x21')];var _0x220069=_0x173522?0x0:_0x5d9bf0[_0xe0b4('0x1f')];var _0x1a7e93=_0x173522?_0x54a73a[_0xe0b4('0x21')]:_0x5d9bf0[_0xe0b4('0x1f')]+_0x5d9bf0[_0xe0b4('0x22')];var _0x3fad9e;if(_0x1a7e93>=_0x1b1e3c){_0x1a7e93=_0x1b1e3c;_0x3fad9e=0xc8;}else{_0x3fad9e=0xce;}_0x432fc8[_0xe0b4('0x1c')](_0x3fad9e);return _0x432fc8[_0xe0b4('0x23')]('Content-Range',_0x220069+'-'+_0x1a7e93+'/'+_0x1b1e3c)['json'](_0x54a73a);}return null;};}function patchUpdates(_0x532479){return function(_0x65c20d){try{jsonpatch[_0xe0b4('0x24')](_0x65c20d,_0x532479,!![]);}catch(_0x4276d6){return BPromise[_0xe0b4('0x25')](_0x4276d6);}return _0x65c20d['save']();};}function saveUpdates(_0x1d4adb,_0x2a52c7){return function(_0x5c2332){if(_0x5c2332){return _0x5c2332[_0xe0b4('0x26')](_0x1d4adb)[_0xe0b4('0x27')](function(_0x533106){return _0x533106;});}return null;};}function removeEntity(_0x2d33e0,_0x3a06f6){return function(_0x27a6e1){if(_0x27a6e1){return _0x27a6e1[_0xe0b4('0x28')]()[_0xe0b4('0x27')](function(){_0x2d33e0['status'](0xcc)[_0xe0b4('0x1d')]();});}};}function handleEntityNotFound(_0xf459c,_0x33b99f){return function(_0xa1d4bd){if(!_0xa1d4bd){_0xf459c[_0xe0b4('0x1b')](0x194);}return _0xa1d4bd;};}function handleError(_0x12bb5f,_0x4bb78e){_0x4bb78e=_0x4bb78e||0x1f4;return function(_0x415932){logger[_0xe0b4('0x29')](_0x415932[_0xe0b4('0x2a')]);if(_0x415932[_0xe0b4('0x2b')]){delete _0x415932['name'];}_0x12bb5f[_0xe0b4('0x1c')](_0x4bb78e)[_0xe0b4('0x2c')](_0x415932);};}exports['index']=function(_0x4ae48e,_0x3a8c64){var _0x116622={},_0x2e5796={},_0x29c353={'count':0x0,'rows':[]};var _0x416950=_[_0xe0b4('0x2d')](db[_0xe0b4('0x2e')]['rawAttributes'],function(_0x301cc7){return{'name':_0x301cc7[_0xe0b4('0x2f')],'type':_0x301cc7[_0xe0b4('0x30')][_0xe0b4('0x31')]};});_0x2e5796[_0xe0b4('0x32')]=_['map'](_0x416950,'name');_0x2e5796[_0xe0b4('0x33')]=_[_0xe0b4('0x34')](_0x4ae48e['query']);_0x2e5796['filters']=_[_0xe0b4('0x35')](_0x2e5796[_0xe0b4('0x32')],_0x2e5796[_0xe0b4('0x33')]);_0x116622[_0xe0b4('0x36')]=_[_0xe0b4('0x35')](_0x2e5796['model'],qs['fields'](_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x37')]));_0x116622[_0xe0b4('0x36')]=_0x116622[_0xe0b4('0x36')]['length']?_0x116622['attributes']:_0x2e5796[_0xe0b4('0x32')];if(!_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x38')]('nolimit')){_0x116622['limit']=qs[_0xe0b4('0x22')](_0x4ae48e['query'][_0xe0b4('0x22')]);_0x116622['offset']=qs[_0xe0b4('0x1f')](_0x4ae48e['query'][_0xe0b4('0x1f')]);}_0x116622[_0xe0b4('0x39')]=qs[_0xe0b4('0x3a')](_0x4ae48e[_0xe0b4('0x33')]['sort']);_0x116622[_0xe0b4('0x3b')]=qs[_0xe0b4('0x3c')](_[_0xe0b4('0x3d')](_0x4ae48e[_0xe0b4('0x33')],_0x2e5796[_0xe0b4('0x3c')]),_0x416950);if(_0x4ae48e['query']['filter']){_0x116622[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x116622[_0xe0b4('0x3b')],{'$or':_[_0xe0b4('0x2d')](_0x416950,function(_0x14ca18){if(_0x14ca18[_0xe0b4('0x30')]!==_0xe0b4('0x3f')){var _0x24deb1={};_0x24deb1[_0x14ca18[_0xe0b4('0x2b')]]={'$like':'%'+_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x40')]+'%'};return _0x24deb1;}})});}_0x116622=_[_0xe0b4('0x3e')]({},_0x116622,_0x4ae48e[_0xe0b4('0x41')]);var _0xf3e698={'where':_0x116622['where']};return db['ChatGroup'][_0xe0b4('0x21')](_0xf3e698)['then'](function(_0x399b6f){_0x29c353[_0xe0b4('0x21')]=_0x399b6f;if(_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x42')]){_0x116622['include']=[{'all':!![]}];}return db[_0xe0b4('0x2e')][_0xe0b4('0x43')](_0x116622);})[_0xe0b4('0x27')](function(_0x29e899){_0x29c353['rows']=_0x29e899;return _0x29c353;})[_0xe0b4('0x27')](respondWithFilteredResult(_0x3a8c64,_0x116622))[_0xe0b4('0x44')](handleError(_0x3a8c64,null));};exports[_0xe0b4('0x45')]=function(_0x47d508,_0x5cf259){var _0x61082e={'raw':!![],'where':{'id':_0x47d508[_0xe0b4('0x46')]['id']}},_0x18aa76={};_0x18aa76[_0xe0b4('0x32')]=_[_0xe0b4('0x34')](db[_0xe0b4('0x2e')]['rawAttributes']);_0x18aa76[_0xe0b4('0x33')]=_['keys'](_0x47d508[_0xe0b4('0x33')]);_0x18aa76[_0xe0b4('0x3c')]=_[_0xe0b4('0x35')](_0x18aa76[_0xe0b4('0x32')],_0x18aa76[_0xe0b4('0x33')]);_0x61082e[_0xe0b4('0x36')]=_[_0xe0b4('0x35')](_0x18aa76[_0xe0b4('0x32')],qs[_0xe0b4('0x37')](_0x47d508['query']['fields']));_0x61082e[_0xe0b4('0x36')]=_0x61082e['attributes'][_0xe0b4('0x47')]?_0x61082e[_0xe0b4('0x36')]:_0x18aa76[_0xe0b4('0x32')];if(_0x47d508[_0xe0b4('0x33')][_0xe0b4('0x42')]){_0x61082e[_0xe0b4('0x48')]=[{'all':!![]}];}_0x61082e=_[_0xe0b4('0x3e')]({},_0x61082e,_0x47d508[_0xe0b4('0x41')]);return db['ChatGroup']['find'](_0x61082e)['then'](handleEntityNotFound(_0x5cf259,null))[_0xe0b4('0x27')](respondWithResult(_0x5cf259,null))['catch'](handleError(_0x5cf259,null));};exports['create']=function(_0xe6e600,_0x23778a){return db[_0xe0b4('0x2e')]['create'](_0xe6e600[_0xe0b4('0x49')],{})['then'](respondWithResult(_0x23778a,0xc9))[_0xe0b4('0x44')](handleError(_0x23778a,null));};exports[_0xe0b4('0x26')]=function(_0x348271,_0x1aa0bf){if(_0x348271['body']['id']){delete _0x348271[_0xe0b4('0x49')]['id'];}return db[_0xe0b4('0x2e')][_0xe0b4('0x4a')]({'where':{'id':_0x348271['params']['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x1aa0bf,null))[_0xe0b4('0x27')](saveUpdates(_0x348271[_0xe0b4('0x49')],null))[_0xe0b4('0x27')](respondWithResult(_0x1aa0bf,null))['catch'](handleError(_0x1aa0bf,null));};exports[_0xe0b4('0x28')]=function(_0x34f3a5,_0x540ac7){return db[_0xe0b4('0x2e')]['find']({'where':{'id':_0x34f3a5[_0xe0b4('0x46')]['id']}})['then'](handleEntityNotFound(_0x540ac7,null))[_0xe0b4('0x27')](removeEntity(_0x540ac7,null))['catch'](handleError(_0x540ac7,null));};exports[_0xe0b4('0x4b')]=function(_0x11b03d,_0x2f831b){return db[_0xe0b4('0x2e')][_0xe0b4('0x4b')]()[_0xe0b4('0x27')](respondWithResult(_0x2f831b,null))['catch'](handleError(_0x2f831b,null));};exports[_0xe0b4('0x4c')]=function(_0x1771fe,_0x194136,_0x53bf30){return db[_0xe0b4('0x4d')][_0xe0b4('0x21')]({'where':{'ChatGroupId':_0x1771fe[_0xe0b4('0x46')]['id'],'ToId':_0x1771fe[_0xe0b4('0x4e')]['id'],'read':![]}})[_0xe0b4('0x27')](function(_0x3b7337){return{'id':_[_0xe0b4('0x4f')](_0x1771fe[_0xe0b4('0x46')]['id']),'count':_0x3b7337};})[_0xe0b4('0x27')](respondWithResult(_0x194136,null))[_0xe0b4('0x44')](handleError(_0x194136,null));};exports[_0xe0b4('0x50')]=function(_0x84a5e1,_0x576415,_0x562ac3){return db[_0xe0b4('0x2e')][_0xe0b4('0x4a')]({'where':{'id':_0x84a5e1[_0xe0b4('0x46')]['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x576415,null))[_0xe0b4('0x27')](function(_0x3e53f4){if(_0x3e53f4){return _0x3e53f4['addMembers'](_0x84a5e1['body'][_0xe0b4('0x51')],_[_0xe0b4('0x52')](_0x84a5e1[_0xe0b4('0x49')],[_0xe0b4('0x51'),'id'])||{});}})[_0xe0b4('0x27')](respondWithResult(_0x576415,null))[_0xe0b4('0x44')](handleError(_0x576415,null));};exports[_0xe0b4('0x53')]=function(_0x556f72,_0x38dc59,_0x201988){var _0x58feea={};var _0x54a853={};var _0xdd8172;var _0x18fa0e;return db[_0xe0b4('0x2e')][_0xe0b4('0x54')]({'where':{'id':_0x556f72[_0xe0b4('0x46')]['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x38dc59,null))[_0xe0b4('0x27')](function(_0x52f26b){if(_0x52f26b){_0xdd8172=_0x52f26b;_0x54a853[_0xe0b4('0x32')]=_[_0xe0b4('0x34')](db[_0xe0b4('0x55')][_0xe0b4('0x56')]);_0x54a853[_0xe0b4('0x33')]=_[_0xe0b4('0x34')](_0x556f72[_0xe0b4('0x33')]);_0x54a853[_0xe0b4('0x3c')]=_[_0xe0b4('0x35')](_0x54a853[_0xe0b4('0x32')],_0x54a853[_0xe0b4('0x33')]);_0x58feea[_0xe0b4('0x36')]=_['intersection'](_0x54a853[_0xe0b4('0x32')],qs['fields'](_0x556f72['query'][_0xe0b4('0x37')]));_0x58feea[_0xe0b4('0x36')]=_0x58feea['attributes'][_0xe0b4('0x47')]?_0x58feea[_0xe0b4('0x36')]:_0x54a853[_0xe0b4('0x32')];_0x58feea[_0xe0b4('0x39')]=qs[_0xe0b4('0x3a')](_0x556f72[_0xe0b4('0x33')][_0xe0b4('0x3a')]);_0x58feea[_0xe0b4('0x3b')]=qs[_0xe0b4('0x3c')](_['pick'](_0x556f72[_0xe0b4('0x33')],_0x54a853[_0xe0b4('0x3c')]));if(_0x556f72['query'][_0xe0b4('0x40')]){_0x58feea[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x58feea[_0xe0b4('0x3b')],{'$or':_[_0xe0b4('0x2d')](_0x58feea['attributes'],function(_0x1b6725){var _0x3be9be={};_0x3be9be[_0x1b6725]={'$like':'%'+_0x556f72[_0xe0b4('0x33')][_0xe0b4('0x40')]+'%'};return _0x3be9be;})});}_0x58feea=_[_0xe0b4('0x3e')]({},_0x58feea,_0x556f72[_0xe0b4('0x41')]);return _0xdd8172[_0xe0b4('0x53')](_0x58feea);}})[_0xe0b4('0x27')](function(_0x1b92c2){if(_0x1b92c2){_0x18fa0e=_0x1b92c2[_0xe0b4('0x47')];if(!_0x556f72[_0xe0b4('0x33')]['hasOwnProperty'](_0xe0b4('0x57'))){_0x58feea[_0xe0b4('0x22')]=qs[_0xe0b4('0x22')](_0x556f72[_0xe0b4('0x33')][_0xe0b4('0x22')]);_0x58feea[_0xe0b4('0x1f')]=qs[_0xe0b4('0x1f')](_0x556f72[_0xe0b4('0x33')]['offset']);}return _0xdd8172['getMembers'](_0x58feea);}})[_0xe0b4('0x27')](function(_0x125dd2){if(_0x125dd2){return _0x125dd2?{'count':_0x18fa0e,'rows':_0x125dd2}:null;}})[_0xe0b4('0x27')](respondWithResult(_0x38dc59,null))['catch'](handleError(_0x38dc59,null));};exports['removeMembers']=function(_0x4f456e,_0x7718f5,_0x39bc72){return db[_0xe0b4('0x2e')]['find']({'where':{'id':_0x4f456e['params']['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x7718f5,null))[_0xe0b4('0x27')](function(_0x2127f7){if(_0x2127f7){return _0x2127f7[_0xe0b4('0x58')](_0x4f456e['query'][_0xe0b4('0x51')]);}})[_0xe0b4('0x27')](respondWithStatusCode(_0x7718f5,null))[_0xe0b4('0x44')](handleError(_0x7718f5,null));};exports[_0xe0b4('0x59')]=function(_0x476332,_0x3aee75,_0x376ace){if(_0x476332[_0xe0b4('0x49')]['id']){delete _0x476332[_0xe0b4('0x49')]['id'];}return db[_0xe0b4('0x2e')]['find']({'where':{'id':_0x476332['params']['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x3aee75,null))[_0xe0b4('0x27')](function(_0x2c521e){if(_0x2c521e){_0x476332['body'][_0xe0b4('0x5a')]=_0x2c521e['id'];return db['ChatInternalMessage'][_0xe0b4('0x5b')](_0x476332['body']);}})['then'](respondWithResult(_0x3aee75,null))[_0xe0b4('0x44')](handleError(_0x3aee75,null));};exports[_0xe0b4('0x5c')]=function(_0x9038a5,_0x21a939,_0x1e9d89){var _0x59f82c={};var _0x2ca12d={};var _0x4bdf99;var _0x136a3d;return db[_0xe0b4('0x2e')][_0xe0b4('0x54')]({'where':{'id':_0x9038a5[_0xe0b4('0x46')]['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x21a939,null))[_0xe0b4('0x27')](function(_0x4eb0ed){if(_0x4eb0ed){_0x4bdf99=_0x4eb0ed;_0x2ca12d[_0xe0b4('0x32')]=_['keys'](db[_0xe0b4('0x4d')]['rawAttributes']);_0x2ca12d[_0xe0b4('0x33')]=_[_0xe0b4('0x34')](_0x9038a5[_0xe0b4('0x33')]);_0x2ca12d[_0xe0b4('0x3c')]=_[_0xe0b4('0x35')](_0x2ca12d[_0xe0b4('0x32')],_0x2ca12d['query']);_0x59f82c['attributes']=_[_0xe0b4('0x35')](_0x2ca12d[_0xe0b4('0x32')],qs[_0xe0b4('0x37')](_0x9038a5['query']['fields']));_0x59f82c['attributes']=_0x59f82c[_0xe0b4('0x36')][_0xe0b4('0x47')]?_0x59f82c[_0xe0b4('0x36')]:_0x2ca12d[_0xe0b4('0x32')];_0x59f82c[_0xe0b4('0x39')]=qs['sort'](_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x3a')]);_0x59f82c[_0xe0b4('0x3b')]=qs['filters'](_['pick'](_0x9038a5[_0xe0b4('0x33')],_0x2ca12d['filters']));if(_0x9038a5['query'][_0xe0b4('0x40')]){_0x59f82c[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x59f82c['where'],{'$or':_['map'](_0x59f82c['attributes'],function(_0x46cb1c){var _0x22ca84={};_0x22ca84[_0x46cb1c]={'$like':'%'+_0x9038a5[_0xe0b4('0x33')]['filter']+'%'};return _0x22ca84;})});}if(_0x9038a5[_0xe0b4('0x33')]['$gte']){var _0x352203=_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x5d')][_0xe0b4('0x5e')](',');var _0x9b9392={};_0x9b9392[_0x352203[0x0]]={'$gte':moment(_0x352203[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x59f82c[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x59f82c['where'],_0x9b9392);}_0x59f82c=_[_0xe0b4('0x3e')]({},_0x59f82c,_0x9038a5[_0xe0b4('0x41')]);return _0x4bdf99['getMessages'](_0x59f82c);}})[_0xe0b4('0x27')](function(_0x15206d){if(_0x15206d){_0x136a3d=_0x15206d['length'];if(!_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x38')]('nolimit')){_0x59f82c[_0xe0b4('0x22')]=qs['limit'](_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x22')]);_0x59f82c[_0xe0b4('0x1f')]=qs[_0xe0b4('0x1f')](_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x1f')]);}return _0x4bdf99[_0xe0b4('0x5c')](_0x59f82c);}})[_0xe0b4('0x27')](function(_0x29e322){if(_0x29e322){return _0x29e322?{'count':_0x136a3d,'rows':_0x29e322}:null;}})[_0xe0b4('0x27')](respondWithResult(_0x21a939,null))[_0xe0b4('0x44')](handleError(_0x21a939,null));};
\ No newline at end of file
+var _0x0786=['where','filters','merge','filter','options','includeAll','findAll','catch','show','params','length','include','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','pick','getMembers','removeMembers','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0786,0x148));var _0x6078=function(_0x519228,_0x2bcbc2){_0x519228=_0x519228-0x0;var _0xc3c605=_0x0786[_0x519228];return _0xc3c605;};'use strict';var emlformat=require(_0x6078('0x0'));var rimraf=require(_0x6078('0x1'));var zipdir=require(_0x6078('0x2'));var jsonpatch=require(_0x6078('0x3'));var rp=require(_0x6078('0x4'));var moment=require(_0x6078('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6078('0x6'));var util=require(_0x6078('0x7'));var path=require(_0x6078('0x8'));var sox=require(_0x6078('0x9'));var csv=require(_0x6078('0xa'));var ejs=require(_0x6078('0xb'));var fs=require('fs');var fs_extra=require(_0x6078('0xc'));var _=require(_0x6078('0xd'));var squel=require('squel');var crypto=require(_0x6078('0xe'));var jsforce=require(_0x6078('0xf'));var deskjs=require(_0x6078('0x10'));var toCsv=require(_0x6078('0xa'));var querystring=require('querystring');var Papa=require(_0x6078('0x11'));var Redis=require(_0x6078('0x12'));var authService=require(_0x6078('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6078('0x14'));var hardwareService=require(_0x6078('0x15'));var logger=require(_0x6078('0x16'))(_0x6078('0x17'));var utils=require(_0x6078('0x18'));var config=require(_0x6078('0x19'));var licenseUtil=require(_0x6078('0x1a'));var db=require(_0x6078('0x1b'))['db'];config[_0x6078('0x1c')]=_['defaults'](config[_0x6078('0x1c')],{'host':_0x6078('0x1d'),'port':0x18eb});var socket=require(_0x6078('0x1e'))(new Redis(config[_0x6078('0x1c')]));require(_0x6078('0x1f'))[_0x6078('0x20')](socket);function respondWithStatusCode(_0xf9458b,_0xd2abdf){_0xd2abdf=_0xd2abdf||0xcc;return function(_0x26a2db){if(_0x26a2db){return _0xf9458b[_0x6078('0x21')](_0xd2abdf);}return _0xf9458b[_0x6078('0x22')](_0xd2abdf)[_0x6078('0x23')]();};}function respondWithResult(_0x4ce8d9,_0x478231){_0x478231=_0x478231||0xc8;return function(_0x2d3b4f){if(_0x2d3b4f){return _0x4ce8d9[_0x6078('0x22')](_0x478231)[_0x6078('0x24')](_0x2d3b4f);}};}function respondWithFilteredResult(_0xfe1f6f,_0x196577){return function(_0x1e6e43){if(_0x1e6e43){var _0x1ee271=typeof _0x196577[_0x6078('0x25')]==='undefined'&&typeof _0x196577['limit']===_0x6078('0x26');var _0x58309c=_0x1e6e43[_0x6078('0x27')];var _0x10415e=_0x1ee271?0x0:_0x196577[_0x6078('0x25')];var _0x2e6fa1=_0x1ee271?_0x1e6e43[_0x6078('0x27')]:_0x196577[_0x6078('0x25')]+_0x196577[_0x6078('0x28')];var _0x43149a;if(_0x2e6fa1>=_0x58309c){_0x2e6fa1=_0x58309c;_0x43149a=0xc8;}else{_0x43149a=0xce;}_0xfe1f6f['status'](_0x43149a);return _0xfe1f6f[_0x6078('0x29')](_0x6078('0x2a'),_0x10415e+'-'+_0x2e6fa1+'/'+_0x58309c)['json'](_0x1e6e43);}return null;};}function patchUpdates(_0x1552ce){return function(_0xe740c6){try{jsonpatch[_0x6078('0x2b')](_0xe740c6,_0x1552ce,!![]);}catch(_0xcb0090){return BPromise[_0x6078('0x2c')](_0xcb0090);}return _0xe740c6['save']();};}function saveUpdates(_0x2e8748,_0x48637a){return function(_0x5c62cf){if(_0x5c62cf){return _0x5c62cf[_0x6078('0x2d')](_0x2e8748)[_0x6078('0x2e')](function(_0x278af6){return _0x278af6;});}return null;};}function removeEntity(_0x143756,_0x4514ec){return function(_0x1aa8e0){if(_0x1aa8e0){return _0x1aa8e0['destroy']()[_0x6078('0x2e')](function(){_0x143756[_0x6078('0x22')](0xcc)[_0x6078('0x23')]();});}};}function handleEntityNotFound(_0x1168f9,_0x45d501){return function(_0x216c3c){if(!_0x216c3c){_0x1168f9[_0x6078('0x21')](0x194);}return _0x216c3c;};}function handleError(_0x4ef92b,_0x261caf){_0x261caf=_0x261caf||0x1f4;return function(_0xe5c01f){logger[_0x6078('0x2f')](_0xe5c01f[_0x6078('0x30')]);if(_0xe5c01f[_0x6078('0x31')]){delete _0xe5c01f[_0x6078('0x31')];}_0x4ef92b[_0x6078('0x22')](_0x261caf)[_0x6078('0x32')](_0xe5c01f);};}exports[_0x6078('0x33')]=function(_0x46799b,_0x62cd23){var _0x3ab6d7={},_0x4adba4={},_0x37e1e7={'count':0x0,'rows':[]};var _0x2faa59=_[_0x6078('0x34')](db[_0x6078('0x35')][_0x6078('0x36')],function(_0x20a084){return{'name':_0x20a084[_0x6078('0x37')],'type':_0x20a084[_0x6078('0x38')][_0x6078('0x39')]};});_0x4adba4['model']=_['map'](_0x2faa59,_0x6078('0x31'));_0x4adba4[_0x6078('0x3a')]=_[_0x6078('0x3b')](_0x46799b[_0x6078('0x3a')]);_0x4adba4['filters']=_['intersection'](_0x4adba4['model'],_0x4adba4[_0x6078('0x3a')]);_0x3ab6d7[_0x6078('0x3c')]=_[_0x6078('0x3d')](_0x4adba4[_0x6078('0x3e')],qs[_0x6078('0x3f')](_0x46799b[_0x6078('0x3a')][_0x6078('0x3f')]));_0x3ab6d7[_0x6078('0x3c')]=_0x3ab6d7[_0x6078('0x3c')]['length']?_0x3ab6d7['attributes']:_0x4adba4[_0x6078('0x3e')];if(!_0x46799b['query'][_0x6078('0x40')](_0x6078('0x41'))){_0x3ab6d7['limit']=qs[_0x6078('0x28')](_0x46799b['query'][_0x6078('0x28')]);_0x3ab6d7['offset']=qs[_0x6078('0x25')](_0x46799b[_0x6078('0x3a')][_0x6078('0x25')]);}_0x3ab6d7[_0x6078('0x42')]=qs[_0x6078('0x43')](_0x46799b[_0x6078('0x3a')][_0x6078('0x43')]);_0x3ab6d7[_0x6078('0x44')]=qs[_0x6078('0x45')](_['pick'](_0x46799b[_0x6078('0x3a')],_0x4adba4[_0x6078('0x45')]),_0x2faa59);if(_0x46799b['query']['filter']){_0x3ab6d7[_0x6078('0x44')]=_[_0x6078('0x46')](_0x3ab6d7[_0x6078('0x44')],{'$or':_[_0x6078('0x34')](_0x2faa59,function(_0x4df069){if(_0x4df069['type']!=='VIRTUAL'){var _0x28551e={};_0x28551e[_0x4df069[_0x6078('0x31')]]={'$like':'%'+_0x46799b[_0x6078('0x3a')][_0x6078('0x47')]+'%'};return _0x28551e;}})});}_0x3ab6d7=_[_0x6078('0x46')]({},_0x3ab6d7,_0x46799b[_0x6078('0x48')]);var _0x27eb05={'where':_0x3ab6d7[_0x6078('0x44')]};return db[_0x6078('0x35')][_0x6078('0x27')](_0x27eb05)[_0x6078('0x2e')](function(_0x112c3f){_0x37e1e7[_0x6078('0x27')]=_0x112c3f;if(_0x46799b[_0x6078('0x3a')][_0x6078('0x49')]){_0x3ab6d7['include']=[{'all':!![]}];}return db[_0x6078('0x35')][_0x6078('0x4a')](_0x3ab6d7);})[_0x6078('0x2e')](function(_0x22893b){_0x37e1e7['rows']=_0x22893b;return _0x37e1e7;})[_0x6078('0x2e')](respondWithFilteredResult(_0x62cd23,_0x3ab6d7))[_0x6078('0x4b')](handleError(_0x62cd23,null));};exports[_0x6078('0x4c')]=function(_0x18a8cc,_0x257543){var _0x5e4409={'raw':!![],'where':{'id':_0x18a8cc[_0x6078('0x4d')]['id']}},_0x4e07ce={};_0x4e07ce[_0x6078('0x3e')]=_[_0x6078('0x3b')](db[_0x6078('0x35')]['rawAttributes']);_0x4e07ce[_0x6078('0x3a')]=_[_0x6078('0x3b')](_0x18a8cc[_0x6078('0x3a')]);_0x4e07ce[_0x6078('0x45')]=_[_0x6078('0x3d')](_0x4e07ce[_0x6078('0x3e')],_0x4e07ce[_0x6078('0x3a')]);_0x5e4409['attributes']=_['intersection'](_0x4e07ce['model'],qs[_0x6078('0x3f')](_0x18a8cc[_0x6078('0x3a')][_0x6078('0x3f')]));_0x5e4409['attributes']=_0x5e4409[_0x6078('0x3c')][_0x6078('0x4e')]?_0x5e4409['attributes']:_0x4e07ce[_0x6078('0x3e')];if(_0x18a8cc['query']['includeAll']){_0x5e4409[_0x6078('0x4f')]=[{'all':!![]}];}_0x5e4409=_['merge']({},_0x5e4409,_0x18a8cc[_0x6078('0x48')]);return db[_0x6078('0x35')][_0x6078('0x50')](_0x5e4409)[_0x6078('0x2e')](handleEntityNotFound(_0x257543,null))[_0x6078('0x2e')](respondWithResult(_0x257543,null))[_0x6078('0x4b')](handleError(_0x257543,null));};exports[_0x6078('0x51')]=function(_0x2140ae,_0x4ace3f){return db[_0x6078('0x35')][_0x6078('0x51')](_0x2140ae[_0x6078('0x52')],{})['then'](respondWithResult(_0x4ace3f,0xc9))['catch'](handleError(_0x4ace3f,null));};exports[_0x6078('0x2d')]=function(_0x16a50b,_0x40051f){if(_0x16a50b['body']['id']){delete _0x16a50b[_0x6078('0x52')]['id'];}return db[_0x6078('0x35')][_0x6078('0x50')]({'where':{'id':_0x16a50b[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x40051f,null))[_0x6078('0x2e')](saveUpdates(_0x16a50b[_0x6078('0x52')],null))[_0x6078('0x2e')](respondWithResult(_0x40051f,null))[_0x6078('0x4b')](handleError(_0x40051f,null));};exports[_0x6078('0x53')]=function(_0x35de86,_0x24daf7){return db[_0x6078('0x35')][_0x6078('0x50')]({'where':{'id':_0x35de86[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x24daf7,null))['then'](removeEntity(_0x24daf7,null))[_0x6078('0x4b')](handleError(_0x24daf7,null));};exports[_0x6078('0x54')]=function(_0x278115,_0x12fc18){return db[_0x6078('0x35')][_0x6078('0x54')]()[_0x6078('0x2e')](respondWithResult(_0x12fc18,null))['catch'](handleError(_0x12fc18,null));};exports[_0x6078('0x55')]=function(_0x2dbff9,_0x292941,_0x4473c5){return db[_0x6078('0x56')]['count']({'where':{'ChatGroupId':_0x2dbff9['params']['id'],'ToId':_0x2dbff9['user']['id'],'read':![]}})[_0x6078('0x2e')](function(_0x1825c7){return{'id':_[_0x6078('0x57')](_0x2dbff9['params']['id']),'count':_0x1825c7};})[_0x6078('0x2e')](respondWithResult(_0x292941,null))[_0x6078('0x4b')](handleError(_0x292941,null));};exports['addMembers']=function(_0x4bc7fe,_0x3dffca,_0x4d53a9){return db['ChatGroup']['find']({'where':{'id':_0x4bc7fe['params']['id']}})['then'](handleEntityNotFound(_0x3dffca,null))[_0x6078('0x2e')](function(_0x47a4e5){if(_0x47a4e5){return _0x47a4e5[_0x6078('0x58')](_0x4bc7fe['body'][_0x6078('0x59')],_[_0x6078('0x5a')](_0x4bc7fe[_0x6078('0x52')],[_0x6078('0x59'),'id'])||{});}})['then'](respondWithResult(_0x3dffca,null))[_0x6078('0x4b')](handleError(_0x3dffca,null));};exports['getMembers']=function(_0x179bef,_0x4ba0f2,_0x32afea){var _0x7da3e0={};var _0x17e8bc={};var _0x554c0a;var _0x552389;return db[_0x6078('0x35')][_0x6078('0x5b')]({'where':{'id':_0x179bef[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x4ba0f2,null))[_0x6078('0x2e')](function(_0x3a324e){if(_0x3a324e){_0x554c0a=_0x3a324e;_0x17e8bc[_0x6078('0x3e')]=_[_0x6078('0x3b')](db['User']['rawAttributes']);_0x17e8bc[_0x6078('0x3a')]=_[_0x6078('0x3b')](_0x179bef[_0x6078('0x3a')]);_0x17e8bc[_0x6078('0x45')]=_[_0x6078('0x3d')](_0x17e8bc[_0x6078('0x3e')],_0x17e8bc[_0x6078('0x3a')]);_0x7da3e0[_0x6078('0x3c')]=_[_0x6078('0x3d')](_0x17e8bc[_0x6078('0x3e')],qs[_0x6078('0x3f')](_0x179bef[_0x6078('0x3a')][_0x6078('0x3f')]));_0x7da3e0['attributes']=_0x7da3e0[_0x6078('0x3c')][_0x6078('0x4e')]?_0x7da3e0[_0x6078('0x3c')]:_0x17e8bc[_0x6078('0x3e')];_0x7da3e0[_0x6078('0x42')]=qs[_0x6078('0x43')](_0x179bef['query']['sort']);_0x7da3e0['where']=qs['filters'](_[_0x6078('0x5c')](_0x179bef[_0x6078('0x3a')],_0x17e8bc[_0x6078('0x45')]));if(_0x179bef[_0x6078('0x3a')][_0x6078('0x47')]){_0x7da3e0['where']=_[_0x6078('0x46')](_0x7da3e0[_0x6078('0x44')],{'$or':_[_0x6078('0x34')](_0x7da3e0[_0x6078('0x3c')],function(_0x5abdc0){var _0x512245={};_0x512245[_0x5abdc0]={'$like':'%'+_0x179bef['query'][_0x6078('0x47')]+'%'};return _0x512245;})});}_0x7da3e0=_['merge']({},_0x7da3e0,_0x179bef[_0x6078('0x48')]);return _0x554c0a[_0x6078('0x5d')](_0x7da3e0);}})[_0x6078('0x2e')](function(_0x33f980){if(_0x33f980){_0x552389=_0x33f980[_0x6078('0x4e')];if(!_0x179bef[_0x6078('0x3a')]['hasOwnProperty'](_0x6078('0x41'))){_0x7da3e0['limit']=qs[_0x6078('0x28')](_0x179bef[_0x6078('0x3a')][_0x6078('0x28')]);_0x7da3e0[_0x6078('0x25')]=qs[_0x6078('0x25')](_0x179bef[_0x6078('0x3a')]['offset']);}return _0x554c0a[_0x6078('0x5d')](_0x7da3e0);}})['then'](function(_0x2b7d38){if(_0x2b7d38){return _0x2b7d38?{'count':_0x552389,'rows':_0x2b7d38}:null;}})['then'](respondWithResult(_0x4ba0f2,null))[_0x6078('0x4b')](handleError(_0x4ba0f2,null));};exports['removeMembers']=function(_0x5db757,_0x173bd8,_0x38be01){return db[_0x6078('0x35')][_0x6078('0x50')]({'where':{'id':_0x5db757[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x173bd8,null))[_0x6078('0x2e')](function(_0xa20566){if(_0xa20566){return _0xa20566[_0x6078('0x5e')](_0x5db757[_0x6078('0x3a')][_0x6078('0x59')]);}})['then'](respondWithStatusCode(_0x173bd8,null))['catch'](handleError(_0x173bd8,null));};exports['addMessage']=function(_0x4dbd01,_0x21c8ce,_0x5ae18c){if(_0x4dbd01[_0x6078('0x52')]['id']){delete _0x4dbd01[_0x6078('0x52')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x4dbd01['params']['id']}})['then'](handleEntityNotFound(_0x21c8ce,null))['then'](function(_0x1eab83){if(_0x1eab83){_0x4dbd01[_0x6078('0x52')]['ChatGroupId']=_0x1eab83['id'];return db[_0x6078('0x56')][_0x6078('0x51')](_0x4dbd01[_0x6078('0x52')]);}})[_0x6078('0x2e')](respondWithResult(_0x21c8ce,null))[_0x6078('0x4b')](handleError(_0x21c8ce,null));};exports['getMessages']=function(_0x1c5965,_0x3bbd8f,_0x397ddb){var _0x5ad212={};var _0x3dbe6a={};var _0x439274;var _0x4f2a04;return db[_0x6078('0x35')][_0x6078('0x5b')]({'where':{'id':_0x1c5965[_0x6078('0x4d')]['id']}})[_0x6078('0x2e')](handleEntityNotFound(_0x3bbd8f,null))['then'](function(_0x27f14d){if(_0x27f14d){_0x439274=_0x27f14d;_0x3dbe6a[_0x6078('0x3e')]=_['keys'](db[_0x6078('0x56')][_0x6078('0x36')]);_0x3dbe6a[_0x6078('0x3a')]=_[_0x6078('0x3b')](_0x1c5965[_0x6078('0x3a')]);_0x3dbe6a[_0x6078('0x45')]=_[_0x6078('0x3d')](_0x3dbe6a['model'],_0x3dbe6a[_0x6078('0x3a')]);_0x5ad212[_0x6078('0x3c')]=_[_0x6078('0x3d')](_0x3dbe6a[_0x6078('0x3e')],qs[_0x6078('0x3f')](_0x1c5965[_0x6078('0x3a')][_0x6078('0x3f')]));_0x5ad212[_0x6078('0x3c')]=_0x5ad212[_0x6078('0x3c')][_0x6078('0x4e')]?_0x5ad212[_0x6078('0x3c')]:_0x3dbe6a['model'];_0x5ad212[_0x6078('0x42')]=qs[_0x6078('0x43')](_0x1c5965[_0x6078('0x3a')][_0x6078('0x43')]);_0x5ad212[_0x6078('0x44')]=qs[_0x6078('0x45')](_[_0x6078('0x5c')](_0x1c5965['query'],_0x3dbe6a[_0x6078('0x45')]));if(_0x1c5965[_0x6078('0x3a')][_0x6078('0x47')]){_0x5ad212[_0x6078('0x44')]=_[_0x6078('0x46')](_0x5ad212[_0x6078('0x44')],{'$or':_[_0x6078('0x34')](_0x5ad212[_0x6078('0x3c')],function(_0x24e63c){var _0x30413f={};_0x30413f[_0x24e63c]={'$like':'%'+_0x1c5965[_0x6078('0x3a')]['filter']+'%'};return _0x30413f;})});}if(_0x1c5965['query'][_0x6078('0x5f')]){var _0x3d8f07=_0x1c5965['query'][_0x6078('0x5f')][_0x6078('0x60')](',');var _0x32c48a={};_0x32c48a[_0x3d8f07[0x0]]={'$gte':moment(_0x3d8f07[0x1])['format'](_0x6078('0x61'))};_0x5ad212['where']=_['merge'](_0x5ad212[_0x6078('0x44')],_0x32c48a);}_0x5ad212=_[_0x6078('0x46')]({},_0x5ad212,_0x1c5965[_0x6078('0x48')]);return _0x439274[_0x6078('0x62')](_0x5ad212);}})[_0x6078('0x2e')](function(_0x2fa9a6){if(_0x2fa9a6){_0x4f2a04=_0x2fa9a6['length'];if(!_0x1c5965[_0x6078('0x3a')][_0x6078('0x40')](_0x6078('0x41'))){_0x5ad212[_0x6078('0x28')]=qs['limit'](_0x1c5965['query'][_0x6078('0x28')]);_0x5ad212[_0x6078('0x25')]=qs['offset'](_0x1c5965[_0x6078('0x3a')][_0x6078('0x25')]);}return _0x439274['getMessages'](_0x5ad212);}})[_0x6078('0x2e')](function(_0x535e40){if(_0x535e40){return _0x535e40?{'count':_0x4f2a04,'rows':_0x535e40}:null;}})[_0x6078('0x2e')](respondWithResult(_0x3bbd8f,null))['catch'](handleError(_0x3bbd8f,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index cfb1948..e6f9703 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 _0x2186=['update','remove','emit','events','save'];(function(_0x38569a,_0x1279f2){var _0x5aa538=function(_0xc7747f){while(--_0xc7747f){_0x38569a['push'](_0x38569a['shift']());}};_0x5aa538(++_0x1279f2);}(_0x2186,0x1ca));var _0x6218=function(_0x41c011,_0x49be6f){_0x41c011=_0x41c011-0x0;var _0x2bbb98=_0x2186[_0x41c011];return _0x2bbb98;};'use strict';var EventEmitter=require(_0x6218('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6218('0x1'),'afterUpdate':_0x6218('0x2'),'afterDestroy':_0x6218('0x3')};function emitEvent(_0x587b23){return function(_0x10aa49,_0x1bc6b1,_0x2b0e28){ChatGroupEvents[_0x6218('0x4')](_0x587b23+':'+_0x10aa49['id'],_0x10aa49);ChatGroupEvents[_0x6218('0x4')](_0x587b23,_0x10aa49);_0x2b0e28(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xd5c8=['exports','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0xd5c8,0x166));var _0x8d5c=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0xd5c8[_0x146837];return _0x3d7e60;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x8d5c('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8d5c('0x1')](0x0);var events={'afterCreate':_0x8d5c('0x2'),'afterUpdate':_0x8d5c('0x3'),'afterDestroy':_0x8d5c('0x4')};function emitEvent(_0x2c6d78){return function(_0xf26b15,_0x3dbbfc,_0x885e2){ChatGroupEvents['emit'](_0x2c6d78+':'+_0xf26b15['id'],_0xf26b15);ChatGroupEvents[_0x8d5c('0x5')](_0x2c6d78,_0xf26b15);_0x885e2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8d5c('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 1459413..1ec8bbe 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 _0xce54=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','moment','bluebird','request-promise','rimraf'];(function(_0x2503dc,_0x24d155){var _0x317eb8=function(_0x41c240){while(--_0x41c240){_0x2503dc['push'](_0x2503dc['shift']());}};_0x317eb8(++_0x24d155);}(_0xce54,0x1c9));var _0x4ce5=function(_0x34c7f3,_0x530552){_0x34c7f3=_0x34c7f3-0x0;var _0x45f682=_0xce54[_0x34c7f3];return _0x45f682;};'use strict';var _=require(_0x4ce5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4ce5('0x1'));var BPromise=require(_0x4ce5('0x2'));var rp=require(_0x4ce5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ce5('0x4'));var config=require(_0x4ce5('0x5'));var attributes=require(_0x4ce5('0x6'));module[_0x4ce5('0x7')]=function(_0x4ebfe4,_0x389848){return _0x4ebfe4[_0x4ce5('0x8')](_0x4ce5('0x9'),attributes,{'tableName':_0x4ce5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3695=['request-promise','rimraf','../../config/environment','./chatGroup.attributes','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x3695,0xf6));var _0x5369=function(_0x506291,_0x3e8323){_0x506291=_0x506291-0x0;var _0x1e1b8b=_0x3695[_0x506291];return _0x1e1b8b;};'use strict';var _=require(_0x5369('0x0'));var util=require(_0x5369('0x1'));var logger=require(_0x5369('0x2'))(_0x5369('0x3'));var moment=require(_0x5369('0x4'));var BPromise=require(_0x5369('0x5'));var rp=require(_0x5369('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5369('0x7'));var config=require(_0x5369('0x8'));var attributes=require(_0x5369('0x9'));module['exports']=function(_0x34308e,_0x5e37b2){return _0x34308e[_0x5369('0xa')]('ChatGroup',attributes,{'tableName':_0x5369('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index f4f0a1c..85d0f30 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 _0x1670=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0xc5e02a,_0xd9da3c){var _0xbeca77=function(_0x2a7d11){while(--_0x2a7d11){_0xc5e02a['push'](_0xc5e02a['shift']());}};_0xbeca77(++_0xd9da3c);}(_0x1670,0x9a));var _0x0167=function(_0x1c3bb1,_0x5a7c99){_0x1c3bb1=_0x1c3bb1-0x0;var _0xf6cc1d=_0x1670[_0x1c3bb1];return _0xf6cc1d;};'use strict';var _=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var moment=require('moment');var BPromise=require(_0x0167('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0167('0x3'));var db=require(_0x0167('0x4'))['db'];var utils=require(_0x0167('0x5'));var logger=require(_0x0167('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0167('0x7'));var client=jayson[_0x0167('0x8')][_0x0167('0x9')]({'port':0x232a});config[_0x0167('0xa')]=_[_0x0167('0xb')](config[_0x0167('0xa')],{'host':_0x0167('0xc'),'port':0x18eb});var socket=require(_0x0167('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x0167('0xe')](socket);function respondWithRpcPromise(_0x178f5f,_0x2b88ec,_0x1632d4){return new BPromise(function(_0x338288,_0x364dc7){return client[_0x0167('0xf')](_0x178f5f,_0x1632d4)[_0x0167('0x10')](function(_0x257ed6){logger[_0x0167('0x11')](_0x0167('0x12'),_0x2b88ec,_0x0167('0x13'));logger[_0x0167('0x14')](_0x0167('0x15'),_0x2b88ec,'request\x20sent',JSON[_0x0167('0x16')](_0x257ed6));if(_0x257ed6['error']){if(_0x257ed6[_0x0167('0x17')]['code']===0x1f4){logger[_0x0167('0x17')](_0x0167('0x12'),_0x2b88ec,_0x257ed6[_0x0167('0x17')]['message']);return _0x364dc7(_0x257ed6['error']['message']);}logger[_0x0167('0x17')](_0x0167('0x12'),_0x2b88ec,_0x257ed6['error'][_0x0167('0x18')]);return _0x338288(_0x257ed6['error']['message']);}else{logger[_0x0167('0x11')]('ChatGroup,\x20%s,\x20%s',_0x2b88ec,_0x0167('0x13'));_0x338288(_0x257ed6['result'][_0x0167('0x18')]);}})[_0x0167('0x19')](function(_0x170207){logger[_0x0167('0x17')](_0x0167('0x12'),_0x2b88ec,_0x170207);_0x364dc7(_0x170207);});});}
\ No newline at end of file
+var _0x4499=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x376971,_0x3d9579){var _0x2286ff=function(_0x10c7db){while(--_0x10c7db){_0x376971['push'](_0x376971['shift']());}};_0x2286ff(++_0x3d9579);}(_0x4499,0x145));var _0x9449=function(_0x5649c2,_0x5c8d04){_0x5649c2=_0x5649c2-0x0;var _0x28b072=_0x4499[_0x5649c2];return _0x28b072;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9449('0x0'));var BPromise=require(_0x9449('0x1'));var rs=require(_0x9449('0x2'));var fs=require('fs');var Redis=require(_0x9449('0x3'));var db=require(_0x9449('0x4'))['db'];var utils=require(_0x9449('0x5'));var logger=require('../../config/logger')(_0x9449('0x6'));var config=require(_0x9449('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9449('0x8')]({'port':0x232a});config[_0x9449('0x9')]=_[_0x9449('0xa')](config[_0x9449('0x9')],{'host':_0x9449('0xb'),'port':0x18eb});var socket=require(_0x9449('0xc'))(new Redis(config['redis']));require(_0x9449('0xd'))[_0x9449('0xe')](socket);function respondWithRpcPromise(_0xe7ec09,_0x1c34d0,_0x7784bd){return new BPromise(function(_0x5ad461,_0x405dc5){return client[_0x9449('0xf')](_0xe7ec09,_0x7784bd)[_0x9449('0x10')](function(_0x5d903e){logger[_0x9449('0x11')](_0x9449('0x12'),_0x1c34d0,_0x9449('0x13'));logger[_0x9449('0x14')](_0x9449('0x15'),_0x1c34d0,_0x9449('0x13'),JSON[_0x9449('0x16')](_0x5d903e));if(_0x5d903e[_0x9449('0x17')]){if(_0x5d903e[_0x9449('0x17')][_0x9449('0x18')]===0x1f4){logger[_0x9449('0x17')](_0x9449('0x12'),_0x1c34d0,_0x5d903e[_0x9449('0x17')][_0x9449('0x19')]);return _0x405dc5(_0x5d903e[_0x9449('0x17')][_0x9449('0x19')]);}logger[_0x9449('0x17')](_0x9449('0x12'),_0x1c34d0,_0x5d903e[_0x9449('0x17')][_0x9449('0x19')]);return _0x5ad461(_0x5d903e[_0x9449('0x17')]['message']);}else{logger['info'](_0x9449('0x12'),_0x1c34d0,_0x9449('0x13'));_0x5ad461(_0x5d903e['result'][_0x9449('0x19')]);}})[_0x9449('0x1a')](function(_0x2b76c8){logger[_0x9449('0x17')](_0x9449('0x12'),_0x1c34d0,_0x2b76c8);_0x405dc5(_0x2b76c8);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index ad62b6a..40e0531 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 _0x7182=['save','update','emit','removeListener','length','./chatGroup.events'];(function(_0x16ecd6,_0x23b605){var _0x4c4cf9=function(_0xd85893){while(--_0xd85893){_0x16ecd6['push'](_0x16ecd6['shift']());}};_0x4c4cf9(++_0x23b605);}(_0x7182,0xb9));var _0x2718=function(_0x4d0c0c,_0x4f82e8){_0x4d0c0c=_0x4d0c0c-0x0;var _0x5bbee8=_0x7182[_0x4d0c0c];return _0x5bbee8;};'use strict';var ChatGroupEvents=require(_0x2718('0x0'));var events=[_0x2718('0x1'),'remove',_0x2718('0x2')];function createListener(_0x11e8d1,_0x1f019f){return function(_0x1eb4e9){_0x1f019f[_0x2718('0x3')](_0x11e8d1,_0x1eb4e9);};}function removeListener(_0x2bfc07,_0x37edf7){return function(){ChatGroupEvents[_0x2718('0x4')](_0x2bfc07,_0x37edf7);};}exports['register']=function(_0x570198){for(var _0x2d8340=0x0,_0x3842ce=events[_0x2718('0x5')];_0x2d8340<_0x3842ce;_0x2d8340++){var _0x218771=events[_0x2d8340];var _0x144dbc=createListener('chatGroup:'+_0x218771,_0x570198);ChatGroupEvents['on'](_0x218771,_0x144dbc);}};
\ No newline at end of file
+var _0xd4dd=['chatGroup:','save','remove','update','emit','removeListener','register','length'];(function(_0x3a73ab,_0x1bcf37){var _0x536d2c=function(_0x411599){while(--_0x411599){_0x3a73ab['push'](_0x3a73ab['shift']());}};_0x536d2c(++_0x1bcf37);}(_0xd4dd,0x71));var _0xdd4d=function(_0x10969f,_0x2617be){_0x10969f=_0x10969f-0x0;var _0x123e98=_0xd4dd[_0x10969f];return _0x123e98;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xdd4d('0x0'),_0xdd4d('0x1'),_0xdd4d('0x2')];function createListener(_0x58f823,_0x54eb9a){return function(_0x2f59b9){_0x54eb9a[_0xdd4d('0x3')](_0x58f823,_0x2f59b9);};}function removeListener(_0x5d50b9,_0x10163e){return function(){ChatGroupEvents[_0xdd4d('0x4')](_0x5d50b9,_0x10163e);};}exports[_0xdd4d('0x5')]=function(_0x5b53e1){for(var _0x39a29b=0x0,_0x3815a5=events[_0xdd4d('0x6')];_0x39a29b<_0x3815a5;_0x39a29b++){var _0x17ef90=events[_0x39a29b];var _0x561f13=createListener(_0xdd4d('0x7')+_0x17ef90,_0x5b53e1);ChatGroupEvents['on'](_0x17ef90,_0x561f13);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index b4cf03b..104df76 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 _0xcdcc=['getMessages','post','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','get','/:id','show','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0x55e58c,_0x5278e9){var _0x32ce31=function(_0x4098d2){while(--_0x4098d2){_0x55e58c['push'](_0x55e58c['shift']());}};_0x32ce31(++_0x5278e9);}(_0xcdcc,0x13e));var _0xccdc=function(_0x5657ed,_0x48f5cb){_0x5657ed=_0x5657ed-0x0;var _0x23b0d8=_0xcdcc[_0x5657ed];return _0x23b0d8;};'use strict';var multer=require(_0xccdc('0x0'));var util=require(_0xccdc('0x1'));var path=require(_0xccdc('0x2'));var timeout=require(_0xccdc('0x3'));var express=require(_0xccdc('0x4'));var router=express['Router']();var fs_extra=require(_0xccdc('0x5'));var auth=require(_0xccdc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xccdc('0x7'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xccdc('0x8')](),controller[_0xccdc('0x9')]);router['get'](_0xccdc('0xa'),auth[_0xccdc('0x8')](),controller['describe']);router[_0xccdc('0xb')](_0xccdc('0xc'),auth[_0xccdc('0x8')](),controller[_0xccdc('0xd')]);router[_0xccdc('0xb')]('/:id/unread',auth[_0xccdc('0x8')](),controller[_0xccdc('0xe')]);router['get'](_0xccdc('0xf'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x10')]);router[_0xccdc('0xb')](_0xccdc('0x11'),auth['isAuthenticated'](),controller[_0xccdc('0x12')]);router[_0xccdc('0x13')]('/',auth[_0xccdc('0x8')](),controller[_0xccdc('0x14')]);router[_0xccdc('0x13')](_0xccdc('0xf'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x15')]);router[_0xccdc('0x13')](_0xccdc('0x11'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x16')]);router['put'](_0xccdc('0xc'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x17')]);router[_0xccdc('0x18')](_0xccdc('0xc'),auth['isAuthenticated'](),controller[_0xccdc('0x19')]);router[_0xccdc('0x18')]('/:id/members',auth[_0xccdc('0x8')](),controller[_0xccdc('0x1a')]);module[_0xccdc('0x1b')]=router;
\ No newline at end of file
+var _0x10bd=['express','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers','addMessage','update','delete','destroy','util','path','connect-timeout'];(function(_0x28237e,_0x2a7f11){var _0x1c014b=function(_0xaa0d6d){while(--_0xaa0d6d){_0x28237e['push'](_0x28237e['shift']());}};_0x1c014b(++_0x2a7f11);}(_0x10bd,0x1b7));var _0xd10b=function(_0xf663ee,_0xc6fefb){_0xf663ee=_0xf663ee-0x0;var _0x424e0a=_0x10bd[_0xf663ee];return _0x424e0a;};'use strict';var multer=require('multer');var util=require(_0xd10b('0x0'));var path=require(_0xd10b('0x1'));var timeout=require(_0xd10b('0x2'));var express=require(_0xd10b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd10b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd10b('0x5'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xd10b('0x6')](),controller[_0xd10b('0x7')]);router['get'](_0xd10b('0x8'),auth[_0xd10b('0x6')](),controller[_0xd10b('0x9')]);router[_0xd10b('0xa')](_0xd10b('0xb'),auth[_0xd10b('0x6')](),controller[_0xd10b('0xc')]);router[_0xd10b('0xa')](_0xd10b('0xd'),auth[_0xd10b('0x6')](),controller[_0xd10b('0xe')]);router[_0xd10b('0xa')]('/:id/members',auth[_0xd10b('0x6')](),controller[_0xd10b('0xf')]);router[_0xd10b('0xa')](_0xd10b('0x10'),auth[_0xd10b('0x6')](),controller[_0xd10b('0x11')]);router['post']('/',auth[_0xd10b('0x6')](),controller[_0xd10b('0x12')]);router[_0xd10b('0x13')](_0xd10b('0x14'),auth[_0xd10b('0x6')](),controller[_0xd10b('0x15')]);router[_0xd10b('0x13')](_0xd10b('0x10'),auth[_0xd10b('0x6')](),controller[_0xd10b('0x16')]);router['put']('/:id',auth[_0xd10b('0x6')](),controller[_0xd10b('0x17')]);router[_0xd10b('0x18')](_0xd10b('0xb'),auth['isAuthenticated'](),controller[_0xd10b('0x19')]);router[_0xd10b('0x18')](_0xd10b('0x14'),auth[_0xd10b('0x6')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index afb0a5f..5075ad3 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 _0x4e81=['DATE','long','ENUM','out','sequelize','exports','BOOLEAN','thumb','star','TEXT','STRING'];(function(_0x1f60c2,_0x361dfd){var _0x2958f8=function(_0x3ecdf6){while(--_0x3ecdf6){_0x1f60c2['push'](_0x1f60c2['shift']());}};_0x2958f8(++_0x361dfd);}(_0x4e81,0x1bc));var _0x14e8=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x4e81[_0x52ea08];return _0x28d546;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'closed':{'type':Sequelize[_0x14e8('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0x14e8('0x3')),'defaultValue':_0x14e8('0x4')},'ratingMessage':{'type':Sequelize[_0x14e8('0x5')]},'pathTranscript':{'type':Sequelize[_0x14e8('0x5')]},'mailTranscript':{'type':Sequelize[_0x14e8('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x14e8('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x14e8('0x6')]},'note':{'type':Sequelize[_0x14e8('0x6')]},'browserName':{'type':Sequelize[_0x14e8('0x6')]},'browserVersion':{'type':Sequelize[_0x14e8('0x6')]},'osName':{'type':Sequelize[_0x14e8('0x6')]},'osVersion':{'type':Sequelize[_0x14e8('0x6')]},'deviceModel':{'type':Sequelize[_0x14e8('0x6')]},'deviceVendor':{'type':Sequelize[_0x14e8('0x6')]},'deviceType':{'type':Sequelize[_0x14e8('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x14e8('0x6')]},'formData':{'type':Sequelize[_0x14e8('0x5')](_0x14e8('0x8'))},'read1stAt':{'type':Sequelize[_0x14e8('0x7')]},'lastMsgAt':{'type':Sequelize[_0x14e8('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x14e8('0x9')]('in',_0x14e8('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x14e8('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x14e8('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbcff=['TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb'];(function(_0x284c96,_0x3e1bec){var _0xbdbb1e=function(_0xb9050){while(--_0xb9050){_0x284c96['push'](_0x284c96['shift']());}};_0xbdbb1e(++_0x3e1bec);}(_0xbcff,0x12e));var _0xfbcf=function(_0xa9b620,_0x239db7){_0xa9b620=_0xa9b620-0x0;var _0x4b8b22=_0xbcff[_0xa9b620];return _0x4b8b22;};'use strict';var Sequelize=require(_0xfbcf('0x0'));module[_0xfbcf('0x1')]={'closed':{'type':Sequelize[_0xfbcf('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xfbcf('0x3')](_0xfbcf('0x4'),_0xfbcf('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xfbcf('0x6')]},'pathTranscript':{'type':Sequelize[_0xfbcf('0x6')]},'mailTranscript':{'type':Sequelize[_0xfbcf('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfbcf('0x7')]},'secondDisposition':{'type':Sequelize[_0xfbcf('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfbcf('0x7')]},'browserName':{'type':Sequelize[_0xfbcf('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xfbcf('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xfbcf('0x7')]},'deviceVendor':{'type':Sequelize[_0xfbcf('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xfbcf('0x7')]},'formData':{'type':Sequelize[_0xfbcf('0x6')](_0xfbcf('0x8'))},'read1stAt':{'type':Sequelize[_0xfbcf('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xfbcf('0x3')]('in',_0xfbcf('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xfbcf('0x7')]},'customerPort':{'type':Sequelize[_0xfbcf('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xfbcf('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xfbcf('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index cdced43..697b16d 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 _0x6b2b=['pick','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','includeAgent','spread','emit','chatInteractionTags:save','removeTags','server','files','tmp','transcript-%d-%s.zip','lastName','Account','Owner','get','Chat','osName','referer','N.A.','tail','existsSync','createReadStream','pipe','firstName','renderFile','views','downloadInteraction.ejs','.pdf','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','info','result','sendStatus','end','status','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','stack','name','render','merge','contact','interaction','Users','TagIds','Tags','split','forEach','push','catch','waiting','unmanaged','abandoned','total','UserId','talking','closed','disposition','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','field','color','from','tools_tags','select','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','create','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','format','now','pathTranscript','Messages','CmContact','agentAlias','customer','Visitor','agentIdentifier','%s%d','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x6b2b,0x159));var _0xb6b2=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x6b2b[_0x1abb09];return _0xea1c07;};'use strict';var emlformat=require(_0xb6b2('0x0'));var rimraf=require(_0xb6b2('0x1'));var zipdir=require(_0xb6b2('0x2'));var jsonpatch=require(_0xb6b2('0x3'));var rp=require(_0xb6b2('0x4'));var moment=require(_0xb6b2('0x5'));var BPromise=require(_0xb6b2('0x6'));var Mustache=require('mustache');var util=require(_0xb6b2('0x7'));var path=require(_0xb6b2('0x8'));var sox=require('sox');var csv=require(_0xb6b2('0x9'));var ejs=require(_0xb6b2('0xa'));var fs=require('fs');var fs_extra=require(_0xb6b2('0xb'));var _=require(_0xb6b2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb6b2('0xd'));var toCsv=require(_0xb6b2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb6b2('0xe'));var authService=require(_0xb6b2('0xf'));var qs=require(_0xb6b2('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb6b2('0x11'));var logger=require(_0xb6b2('0x12'))(_0xb6b2('0x13'));var utils=require(_0xb6b2('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb6b2('0x15')]=_['defaults'](config['redis'],{'host':_0xb6b2('0x16'),'port':0x18eb});var socket=require(_0xb6b2('0x17'))(new Redis(config[_0xb6b2('0x15')]));require('./chatInteraction.socket')[_0xb6b2('0x18')](socket);var jayson=require(_0xb6b2('0x19'));var client=jayson[_0xb6b2('0x1a')][_0xb6b2('0x1b')]({'port':0x232b});var client9004=jayson[_0xb6b2('0x1a')][_0xb6b2('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x1df918,_0xf772c1,_0x3c404f,_0x486b34){return new BPromise(function(_0x4ad7d8,_0x190814){var _0x5de903=_0x486b34||client;return _0x5de903[_0xb6b2('0x1c')](_0x1df918,_0x3c404f)['then'](function(_0x559b69){logger['info']('ChatInteraction,\x20%s,\x20%s',_0xf772c1,_0xb6b2('0x1d'));logger[_0xb6b2('0x1e')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xf772c1,_0xb6b2('0x1d'),JSON[_0xb6b2('0x1f')](_0x559b69));if(_0x559b69[_0xb6b2('0x20')]){if(_0x559b69[_0xb6b2('0x20')]['code']===0x1f4){logger[_0xb6b2('0x20')](_0xb6b2('0x21'),_0xf772c1,_0x559b69[_0xb6b2('0x20')][_0xb6b2('0x22')]);return _0x190814(_0x559b69[_0xb6b2('0x20')]['message']);}logger[_0xb6b2('0x20')](_0xb6b2('0x21'),_0xf772c1,_0x559b69[_0xb6b2('0x20')][_0xb6b2('0x22')]);return _0x4ad7d8(_0x559b69[_0xb6b2('0x20')][_0xb6b2('0x22')]);}else{logger[_0xb6b2('0x23')](_0xb6b2('0x21'),_0xf772c1,_0xb6b2('0x1d'));_0x4ad7d8(_0x559b69[_0xb6b2('0x24')][_0xb6b2('0x22')]);}})['catch'](function(_0x213fa6){logger[_0xb6b2('0x20')](_0xb6b2('0x21'),_0xf772c1,_0x213fa6);_0x190814(_0x213fa6);});});}function respondWithStatusCode(_0xa24596,_0xced468){_0xced468=_0xced468||0xcc;return function(_0x2609cf){if(_0x2609cf){return _0xa24596[_0xb6b2('0x25')](_0xced468);}return _0xa24596['status'](_0xced468)[_0xb6b2('0x26')]();};}function respondWithResult(_0x38e42b,_0x54d614){_0x54d614=_0x54d614||0xc8;return function(_0x4586e2){if(_0x4586e2){return _0x38e42b[_0xb6b2('0x27')](_0x54d614)['json'](_0x4586e2);}};}function respondWithFilteredResult(_0x42f738,_0x280981){return function(_0x3d12ab){if(_0x3d12ab){var _0x3876dc=typeof _0x280981[_0xb6b2('0x28')]==='undefined'&&typeof _0x280981[_0xb6b2('0x29')]===_0xb6b2('0x2a');var _0x40d714=_0x3d12ab[_0xb6b2('0x2b')];var _0xb7a94a=_0x3876dc?0x0:_0x280981['offset'];var _0x348077=_0x3876dc?_0x3d12ab[_0xb6b2('0x2b')]:_0x280981['offset']+_0x280981['limit'];var _0x2ff4e0;if(_0x348077>=_0x40d714){_0x348077=_0x40d714;_0x2ff4e0=0xc8;}else{_0x2ff4e0=0xce;}_0x42f738[_0xb6b2('0x27')](_0x2ff4e0);return _0x42f738['set'](_0xb6b2('0x2c'),_0xb7a94a+'-'+_0x348077+'/'+_0x40d714)['json'](_0x3d12ab);}return null;};}function patchUpdates(_0x21cff1){return function(_0x3bc0ba){try{jsonpatch[_0xb6b2('0x2d')](_0x3bc0ba,_0x21cff1,!![]);}catch(_0xcfdc4d){return BPromise[_0xb6b2('0x2e')](_0xcfdc4d);}return _0x3bc0ba['save']();};}function saveUpdates(_0x25a175,_0x527401){return function(_0x16d410){if(_0x16d410){return _0x16d410[_0xb6b2('0x2f')](_0x25a175)[_0xb6b2('0x30')](function(_0x413158){return _0x413158;});}return null;};}function removeEntity(_0x117b89,_0x407ed1){return function(_0x1f109b){if(_0x1f109b){return _0x1f109b[_0xb6b2('0x31')]()[_0xb6b2('0x30')](function(){_0x117b89[_0xb6b2('0x27')](0xcc)[_0xb6b2('0x26')]();});}};}function handleEntityNotFound(_0x250324,_0x2ae87d){return function(_0x4c05e5){if(!_0x4c05e5){_0x250324[_0xb6b2('0x25')](0x194);}return _0x4c05e5;};}function handleError(_0x218683,_0x5d3eb0){_0x5d3eb0=_0x5d3eb0||0x1f4;return function(_0x224a3e){logger[_0xb6b2('0x20')](_0x224a3e[_0xb6b2('0x32')]);if(_0x224a3e[_0xb6b2('0x33')]){delete _0x224a3e[_0xb6b2('0x33')];}_0x218683['status'](_0x5d3eb0)['send'](_0x224a3e);};}function getMustacheRender(_0x477351,_0x29146c){return Mustache[_0xb6b2('0x34')](_0x477351,_[_0xb6b2('0x35')](_0x29146c['body'],{'contact':_0x29146c[_0xb6b2('0x36')],'message':_0x29146c[_0xb6b2('0x22')],'agent':_0x29146c['agent'],'interaction':_0x29146c[_0xb6b2('0x37')],'account':_0x29146c['account']}))||'';}function getInteractionUsers(_0x8167e6,_0x4f9309){return new BPromise(function(_0x367e5e,_0x1a9865){try{if(_0x4f9309[_0x8167e6['id']]){_0x8167e6[_0xb6b2('0x38')]=_['map'](_0x4f9309[_0x8167e6['id']],function(_0x468075){return{'id':_0x468075['id'],'fullname':_0x468075['fullname']};});}}catch(_0x1b366b){_0x1a9865(_0x1b366b);}_0x367e5e(_0x8167e6);});}function getInteractionTags(_0x474f4f,_0x567330){return new BPromise(function(_0xf530c1,_0x4da618){try{if(_0x474f4f[_0xb6b2('0x39')]){_0x474f4f[_0xb6b2('0x3a')]=[];_0x474f4f[_0xb6b2('0x39')][_0xb6b2('0x3b')](',')[_0xb6b2('0x3c')](function(_0x1e8e01){_0x474f4f[_0xb6b2('0x3a')][_0xb6b2('0x3d')](_0x567330[_0x1e8e01]);});}delete _0x474f4f[_0xb6b2('0x39')];}catch(_0x15b076){_0x4da618(_0x15b076);}_0xf530c1(_0x474f4f);});}function updateChatInteraction(_0x50deeb,_0x22bf5c,_0x34c5ab){return new BPromise(function(_0x52f17e,_0x4b3163){return getInteractionUsers(_0x50deeb,_0x34c5ab)[_0xb6b2('0x30')](function(_0x1b0a76){return getInteractionTags(_0x1b0a76,_0x22bf5c);})['then'](function(_0x194359){return getStateInteraction(_0x194359);})[_0xb6b2('0x30')](function(_0x238ce8){_0x52f17e(_0x238ce8);})[_0xb6b2('0x3e')](function(_0x495280){_0x4b3163(_0x495280);});});}function getStateInteraction(_0x30c3c3){return new BPromise(function(_0x4de027){_0x30c3c3[_0xb6b2('0x3f')]=0x0;_0x30c3c3['talking']=0x0;_0x30c3c3['answered']=0x0;_0x30c3c3[_0xb6b2('0x40')]=0x0;_0x30c3c3[_0xb6b2('0x41')]=0x0;_0x30c3c3[_0xb6b2('0x42')]=0x0;if(!_0x30c3c3['closed']&&!_0x30c3c3['UserId']){_0x30c3c3['waiting']+=0x1;}if(!_0x30c3c3['closed']&&_0x30c3c3[_0xb6b2('0x43')]){_0x30c3c3[_0xb6b2('0x44')]+=0x1;if(_0x30c3c3[_0xb6b2('0x3f')]){_0x30c3c3[_0xb6b2('0x3f')]-=0x1;}}if(_0x30c3c3[_0xb6b2('0x45')]&&_0x30c3c3[_0xb6b2('0x46')]===_0xb6b2('0x41')){_0x30c3c3[_0xb6b2('0x41')]+=0x1;if(_0x30c3c3[_0xb6b2('0x3f')]){_0x30c3c3[_0xb6b2('0x3f')]-=0x1;}}else if(_0x30c3c3['closed']&&!_0x30c3c3[_0xb6b2('0x43')]&&_0x30c3c3['disposition']){_0x30c3c3[_0xb6b2('0x40')]+=0x1;if(_0x30c3c3[_0xb6b2('0x3f')]){_0x30c3c3[_0xb6b2('0x3f')]-=0x1;}}else if(_0x30c3c3['closed']&&_0x30c3c3['UserId']){_0x30c3c3['answered']+=0x1;if(_0x30c3c3[_0xb6b2('0x44')]){_0x30c3c3[_0xb6b2('0x44')]-=0x1;}}_0x30c3c3['total']+=0x1;_0x4de027(_0x30c3c3);});}exports['index']=function(_0x3f1723,_0x31c71e){var _0xe03c4d={},_0x1bfc58={},_0x25f015={'count':0x0,'rows':[]};var _0x39a308=_[_0xb6b2('0x47')](db['ChatInteraction'][_0xb6b2('0x48')],function(_0x4220c3){return{'name':_0x4220c3[_0xb6b2('0x49')],'type':_0x4220c3[_0xb6b2('0x4a')][_0xb6b2('0x4b')]};});_0x1bfc58[_0xb6b2('0x4c')]=_[_0xb6b2('0x47')](_0x39a308,'name');_0x1bfc58['query']=_['keys'](_0x3f1723[_0xb6b2('0x4d')]);_0x1bfc58[_0xb6b2('0x4e')]=_['intersection'](_0x1bfc58[_0xb6b2('0x4c')],_0x1bfc58[_0xb6b2('0x4d')]);_0xe03c4d[_0xb6b2('0x4f')]=_[_0xb6b2('0x50')](_0x1bfc58[_0xb6b2('0x4c')],qs[_0xb6b2('0x51')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x51')]));_0xe03c4d[_0xb6b2('0x4f')]=_0xe03c4d['attributes'][_0xb6b2('0x52')]?_0xe03c4d[_0xb6b2('0x4f')]:_0x1bfc58[_0xb6b2('0x4c')];if(!_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x53')](_0xb6b2('0x54'))){_0xe03c4d['limit']=qs[_0xb6b2('0x29')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x29')]);_0xe03c4d[_0xb6b2('0x28')]=qs[_0xb6b2('0x28')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x28')]);}_0xe03c4d[_0xb6b2('0x55')]=qs[_0xb6b2('0x56')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x56')]);_0xe03c4d[_0xb6b2('0x57')]=qs[_0xb6b2('0x4e')](_['pick'](_0x3f1723[_0xb6b2('0x4d')],_0x1bfc58[_0xb6b2('0x4e')]),_0x39a308);var _0xf564af=[];var _0x1d28e2=squel['select']()[_0xb6b2('0x58')]('id')[_0xb6b2('0x58')](_0xb6b2('0x33'))[_0xb6b2('0x58')](_0xb6b2('0x59'))[_0xb6b2('0x5a')](_0xb6b2('0x5b'));var _0x413f62=squel[_0xb6b2('0x5c')]()[_0xb6b2('0x58')]('u.id')[_0xb6b2('0x58')](_0xb6b2('0x5d'))[_0xb6b2('0x58')](_0xb6b2('0x5e'))[_0xb6b2('0x5a')]('user_has_chat_interactions','ui')[_0xb6b2('0x5f')](_0xb6b2('0x60'),'u',_0xb6b2('0x61'));var _0x562144=squel[_0xb6b2('0x5c')]()['from'](_0xb6b2('0x62'),'i')['left_join'](_0xb6b2('0x63'),'c',_0xb6b2('0x64'))[_0xb6b2('0x5f')](_0xb6b2('0x60'),'o',_0xb6b2('0x65'))[_0xb6b2('0x5f')](_0xb6b2('0x66'),'a',_0xb6b2('0x67'))[_0xb6b2('0x5f')](_0xb6b2('0x68'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join'](_0xb6b2('0x69'),'it',_0xb6b2('0x6a'))[_0xb6b2('0x5f')](_0xb6b2('0x5b'),'t',_0xb6b2('0x6b'));var _0x39be05=squel[_0xb6b2('0x6c')]();var _0x10f99f=[];var _0x2f270e=squel['expr']();var _0x50b05d;if(_0x3f1723[_0xb6b2('0x4d')]['search']){_0x50b05d=as[_0xb6b2('0x6d')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x6e')]);var _0x5bb7c2=_0x50b05d['sqlOperator'];for(var _0x4b4f0c=0x0;_0x4b4f0c<_0x50b05d['conditions'][_0xb6b2('0x52')];_0x4b4f0c++){var _0x3a156e=_0x50b05d[_0xb6b2('0x6f')][_0x4b4f0c];var _0x43ce06='i';var _0x589603=_[_0xb6b2('0x70')](_0x39a308,[_0xb6b2('0x33'),_0x3a156e[_0xb6b2('0x58')]]);if(!_0x589603){switch(_0x3a156e[_0xb6b2('0x58')]){case _0xb6b2('0x71'):if(_0x3a156e['value']==0x1){_0x562144['having']('`'+_0x3a156e['field']+_0xb6b2('0x72'));}else{_0x562144[_0xb6b2('0x73')]('`'+_0x3a156e['field']+_0xb6b2('0x74'));}break;case _0xb6b2('0x75'):if(_0x3a156e['operator']===_0xb6b2('0x76')){if(_0x3a156e[_0xb6b2('0x77')]['split']('\x20')[_0xb6b2('0x52')]>0x1){_0x39be05[_0x5bb7c2](_0xb6b2('0x78'),qs[_0xb6b2('0x79')](_0x3a156e[_0xb6b2('0x77')]),null);}else{var _0x5880bc='%'+_0x3a156e[_0xb6b2('0x77')]+'%';_0x39be05[_0x5bb7c2](_0xb6b2('0x7a'),_0x5880bc,_0x5880bc,_0x5880bc);}}else{_0x589603=_[_0xb6b2('0x70')](_0x39a308,[_0xb6b2('0x33'),_0xb6b2('0x7b')]);_0x3a156e[_0xb6b2('0x58')]=_0xb6b2('0x7b');_0x50ca0c=as[_0xb6b2('0x7c')](_0x43ce06,_0x589603[_0xb6b2('0x4a')],_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c[_0xb6b2('0x7d')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x26')]);}break;case _0xb6b2('0x7f'):var _0x5176ba=_0x3a156e[_0xb6b2('0x77')][_0xb6b2('0x3b')](',')[_0xb6b2('0x47')](function(_0x24be70){return Number(_0x24be70);});_0x5176ba[_0xb6b2('0x3c')](function(_0x3433ec){_0x2f270e['or'](_0xb6b2('0x80'),'%,'+_0x3433ec+',%');});_0x10f99f=_[_0xb6b2('0x81')](_0x10f99f,_0x5176ba);break;case _0xb6b2('0x82'):if(_0x3a156e['operator']==='$substring'){_0x39be05[_0x5bb7c2](_0xb6b2('0x83'),'%'+_0x3a156e['value']+'%',null);}else{_0x589603=_['find'](_0x39a308,[_0xb6b2('0x33'),_0xb6b2('0x43')]);_0x3a156e[_0xb6b2('0x58')]=_0xb6b2('0x43');_0x50ca0c=as[_0xb6b2('0x7c')](_0x43ce06,_0x589603[_0xb6b2('0x4a')],_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c[_0xb6b2('0x7d')],_0x50ca0c['value'][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')]['end']);}break;case _0xb6b2('0x84'):_0x50ca0c=as[_0xb6b2('0x7c')]('me',null,_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c[_0xb6b2('0x7d')],_0x50ca0c['value'][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x26')]);break;}}else{var _0x50ca0c=as[_0xb6b2('0x7c')](_0x43ce06,_0x589603[_0xb6b2('0x4a')],_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c['text'],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x26')]);}}}else{var _0x32d111=_(_0x3f1723['query'])[_0xb6b2('0x85')]()[_0xb6b2('0x47')](function(_0xda9b6b){return _[_0xb6b2('0x86')](_0x39a308,[_0xb6b2('0x33'),_0xda9b6b])?_0xda9b6b:undefined;})[_0xb6b2('0x87')]()[_0xb6b2('0x77')]();if(!_[_0xb6b2('0x88')](_0x32d111)){_0x32d111[_0xb6b2('0x3c')](function(_0x33ff3a){if(_0x33ff3a===_0xb6b2('0x89')){_0x562144[_0xb6b2('0x57')]('i.ChatWebsiteId\x20IN\x20?',[][_0xb6b2('0x8a')](_0x3f1723['query'][_0x33ff3a]));}else if(_0x33ff3a===_0xb6b2('0x8b')){var _0x4e7443=JSON[_0xb6b2('0x8c')](_0x3f1723['query'][_0x33ff3a])[_0xb6b2('0x8d')];var _0x9138ea=JSON[_0xb6b2('0x8c')](_0x3f1723['query'][_0x33ff3a])[_0xb6b2('0x8e')];_0x562144[_0xb6b2('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4e7443,_0x9138ea);}else{if(_0x3f1723[_0xb6b2('0x4d')][_0x33ff3a]===_0xb6b2('0x8f')){_0x562144['where']('i.'+_0x33ff3a+'\x20IS\x20NULL');}else{_0x562144[_0xb6b2('0x57')]('i.'+_0x33ff3a+_0xb6b2('0x90'),_0x3f1723[_0xb6b2('0x4d')][_0x33ff3a]);}}});}if(_0x3f1723['query'][_0xb6b2('0x91')]){if(_0x3f1723['query'][_0xb6b2('0x91')]==0x1){_0x562144['having']('`unreadMessages`\x20=\x200');}else{_0x562144[_0xb6b2('0x73')](_0xb6b2('0x92'));}}if(_0x3f1723[_0xb6b2('0x4d')]['tag']){_0x10f99f=_[_0xb6b2('0x93')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x94')])?_0x3f1723[_0xb6b2('0x4d')]['tag']:new Array(_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x94')]);_0x10f99f[_0xb6b2('0x3c')](function(_0x1e7faa){_0x2f270e['or'](_0xb6b2('0x80'),'%,'+_0x1e7faa+',%');});}if(_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x95')]){var _0x494900=_0x3f1723['query']['filter'][_0xb6b2('0x96')]('\x5c','\x5c\x5c')[_0xb6b2('0x96')](/'/g,'\x27\x27');if(qs[_0xb6b2('0x97')](_0x494900)){_0x39be05['or'](_0xb6b2('0x98'),_0x494900+'%');}else{_0x39be05['or'](_0xb6b2('0x99'),qs['getFullTextValue'](_0x494900))['or'](_0xb6b2('0x9a'),_0x494900+'%');}}}_0x562144[_0xb6b2('0x57')](_0x39be05);_0x562144[_0xb6b2('0x9b')](_0xb6b2('0x9c'));var _0x2b69b9={'type':db[_0xb6b2('0x9d')]['QueryTypes'][_0xb6b2('0x9e')],'raw':!![]};var _0x467bcc=_0x562144[_0xb6b2('0x9f')]();_0x467bcc['field'](_0xb6b2('0x9c'));_0x467bcc['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb6b2('0x71'));if(_0xe03c4d[_0xb6b2('0x55')]){_0xe03c4d[_0xb6b2('0x55')][_0xb6b2('0x3c')](function(_0x2bffe4){var _0x4b12f6=_0x2bffe4[0x0]===_0xb6b2('0xa0')?_0x2bffe4[0x0]:'i.'+_0x2bffe4[0x0];_0x562144[_0xb6b2('0x55')](_0x4b12f6,_0x2bffe4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb6b2('0x88')](_0x10f99f)){_0x562144[_0xb6b2('0x73')](_0x2f270e);_0x467bcc[_0xb6b2('0x57')](_0xb6b2('0xa1'),_0x10f99f);}BPromise[_0xb6b2('0xa2')]()[_0xb6b2('0x30')](function(){if(!_0x50b05d){if(_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x89')])return;_0x467bcc[_0xb6b2('0x57')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x562144[_0xb6b2('0x57')](_0xb6b2('0xa3'));return;}if(_0x3f1723[_0xb6b2('0xa4')][_0xb6b2('0xa5')]!==_0xb6b2('0xa6'))return;return _0x3f1723[_0xb6b2('0xa4')][_0xb6b2('0xa7')]({'attributes':['id'],'raw':!![]})[_0xb6b2('0x30')](function(_0x311dc1){if(_[_0xb6b2('0x88')](_0x311dc1)){_0x467bcc[_0xb6b2('0x57')](_0xb6b2('0xa8'));_0x562144['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x467bcc[_0xb6b2('0x57')](_0xb6b2('0xa9'),_[_0xb6b2('0x47')](_0x311dc1,'id'));_0x562144[_0xb6b2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xb6b2('0x47')](_0x311dc1,'id'));}});})[_0xb6b2('0x30')](function(){if(_0x3f1723[_0xb6b2('0xa4')][_0xb6b2('0xa5')]===_0xb6b2('0xa6')&&!_0x50b05d&&!_0x3f1723[_0xb6b2('0x4d')]['ChatWebsiteId'])return[];return db[_0xb6b2('0xaa')][_0xb6b2('0x4d')](_0x467bcc[_0xb6b2('0xab')](),_0x2b69b9);})[_0xb6b2('0x30')](function(_0x54b460){_0x25f015[_0xb6b2('0x2b')]=_0x54b460['length'];if(_0x25f015[_0xb6b2('0x2b')]===0x0)return[];return db[_0xb6b2('0xaa')]['query'](_0x1d28e2[_0xb6b2('0xab')](),_0x2b69b9)[_0xb6b2('0x30')](function(_0x28861f){_0xf564af=_[_0xb6b2('0xac')](_0x28861f,'id');_0x2b69b9=_[_0xb6b2('0x35')](_0x2b69b9,{'model':db[_0xb6b2('0xad')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f1723['query'][_0xb6b2('0x51')]){_0xe03c4d[_0xb6b2('0x4f')][_0xb6b2('0x3c')](function(_0x307c12){_0x562144[_0xb6b2('0x58')]('i.'+_0x307c12);});}else{_0x562144[_0xb6b2('0x58')](_0xb6b2('0xae'),'unreadMessages');_0x562144['field'](_0xb6b2('0xaf'),_0xb6b2('0xb0'));_0x562144[_0xb6b2('0x58')]('a.mandatoryDisposition',_0xb6b2('0xb1'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb2'),_0xb6b2('0xa0'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb3'));_0x562144['field']('c.firstName',_0xb6b2('0xb4'));_0x562144[_0xb6b2('0x58')]('c.lastName',_0xb6b2('0xb5'));_0x562144[_0xb6b2('0x58')]('c.email',_0xb6b2('0xb6'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb7'),_0xb6b2('0xb8'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb9'),_0xb6b2('0xba'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xbb'),_0xb6b2('0xbc'));_0x562144[_0xb6b2('0x58')]('o.fullname','Owner.fullname');_0x562144[_0xb6b2('0x58')](_0xb6b2('0xbd'),_0xb6b2('0xbe'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xbf'),'TagIds');}if(_0xe03c4d['limit'])_0x562144[_0xb6b2('0x29')](_0xe03c4d[_0xb6b2('0x29')]);if(_0xe03c4d['offset'])_0x562144['offset'](_0xe03c4d[_0xb6b2('0x28')]);return db['sequelize']['query'](_0x562144[_0xb6b2('0xab')](),_0x2b69b9);})['then'](function(_0x42801a){if(_0x42801a['length']>0x0)_0x413f62[_0xb6b2('0x57')](_0xb6b2('0xc0'),_[_0xb6b2('0x47')](_0x42801a,'id'));return db[_0xb6b2('0xaa')][_0xb6b2('0x4d')](_0x413f62['toString'](),_0x2b69b9)['then'](function(_0x579822){var _0x2a1a72=_[_0xb6b2('0xc1')](_0x579822,_0xb6b2('0xc2'));var _0x18033d=[];_0x42801a[_0xb6b2('0x3c')](function(_0x16eca0){_0x18033d['push'](updateChatInteraction(_0x16eca0,_0xf564af,_0x2a1a72));});return BPromise[_0xb6b2('0xc3')](_0x18033d);});});})['then'](function(_0x544207){_0x25f015[_0xb6b2('0xc4')]=_0x544207;return _0x25f015;})['then'](respondWithFilteredResult(_0x31c71e,_0xe03c4d))[_0xb6b2('0x3e')](handleError(_0x31c71e,null));};exports[_0xb6b2('0xc5')]=function(_0x38a48a,_0x6b42b2){var _0x498ae6={'raw':![],'where':{'id':_0x38a48a[_0xb6b2('0xc6')]['id']}},_0x4bb27d={};_0x4bb27d[_0xb6b2('0x4c')]=_[_0xb6b2('0x85')](db[_0xb6b2('0xad')][_0xb6b2('0x48')]);_0x4bb27d[_0xb6b2('0x4d')]=_[_0xb6b2('0x85')](_0x38a48a['query']);_0x4bb27d[_0xb6b2('0x4e')]=_[_0xb6b2('0x50')](_0x4bb27d['model'],_0x4bb27d[_0xb6b2('0x4d')]);_0x498ae6[_0xb6b2('0x4f')]=_['intersection'](_0x4bb27d[_0xb6b2('0x4c')],qs['fields'](_0x38a48a[_0xb6b2('0x4d')][_0xb6b2('0x51')]));_0x498ae6[_0xb6b2('0x4f')]=_0x498ae6[_0xb6b2('0x4f')][_0xb6b2('0x52')]?_0x498ae6[_0xb6b2('0x4f')]:_0x4bb27d['model'];if(_0x38a48a[_0xb6b2('0x4d')][_0xb6b2('0xc7')]){_0x498ae6[_0xb6b2('0xc8')]=[{'all':!![]}];}_0x498ae6=_[_0xb6b2('0x35')]({},_0x498ae6,_0x38a48a['options']);return db['ChatInteraction'][_0xb6b2('0x70')](_0x498ae6)[_0xb6b2('0x30')](handleEntityNotFound(_0x6b42b2,null))[_0xb6b2('0x30')](respondWithResult(_0x6b42b2,null))['catch'](handleError(_0x6b42b2,null));};exports['create']=function(_0x17efe8,_0x5e26f6){return db[_0xb6b2('0xad')]['create'](_0x17efe8[_0xb6b2('0x84')],{})[_0xb6b2('0x30')](respondWithResult(_0x5e26f6,0xc9))['catch'](handleError(_0x5e26f6,null));};exports[_0xb6b2('0x2f')]=function(_0xc842d1,_0x188993){if(_0xc842d1['body']['id']){delete _0xc842d1['body']['id'];}return db[_0xb6b2('0xad')]['find']({'where':{'id':_0xc842d1[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x188993,null))['then'](saveUpdates(_0xc842d1[_0xb6b2('0x84')],null))['then'](respondWithResult(_0x188993,null))['catch'](handleError(_0x188993,null));};exports[_0xb6b2('0x31')]=function(_0x3b6d6e,_0x13404a){return db['ChatInteraction'][_0xb6b2('0x70')]({'where':{'id':_0x3b6d6e[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x13404a,null))[_0xb6b2('0x30')](removeEntity(_0x13404a,null))['catch'](handleError(_0x13404a,null));};exports[_0xb6b2('0xc9')]=function(_0x58389d,_0x2a5635){return db[_0xb6b2('0xad')][_0xb6b2('0xc9')]()['then'](respondWithResult(_0x2a5635,null))['catch'](handleError(_0x2a5635,null));};exports[_0xb6b2('0xca')]=function(_0x46b423,_0x4faeba){var _0x556665=_0x46b423[_0xb6b2('0xc6')]['id'];var _0x48f595;var _0x4c644e;var _0x3bd135;return db[_0xb6b2('0xad')][_0xb6b2('0xcb')]({'where':{'id':_0x556665}})[_0xb6b2('0x30')](function(_0x27605d){_0x48f595=_0x27605d;return db[_0xb6b2('0xcc')][_0xb6b2('0xcb')]({'where':{'id':_0x27605d[_0xb6b2('0x89')]},'attributes':['id',_0xb6b2('0xcd'),_0xb6b2('0xce'),_0xb6b2('0xcf'),_0xb6b2('0xd0'),_0xb6b2('0xd1')],'raw':!![]});})[_0xb6b2('0x30')](function(_0x10c516){if(_0x10c516&&_0x10c516[_0xb6b2('0xcd')]&&_0x10c516[_0xb6b2('0xce')]){_0x4c644e=_0x10c516;var _0x359314={'interaction':{'id':_0x556665},'agent':{'id':_0x46b423[_0xb6b2('0xa4')]['id'],'name':_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0x33')],'fullname':_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0xd2')],'email':_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0xd3')]},'contact':_0x46b423[_0xb6b2('0x84')][_0xb6b2('0x36')],'account':_0x46b423['body'][_0xb6b2('0xd4')]};var _0x5665b4={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x10c516[_0xb6b2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0xd3')]],'buttons':null,'topic':_0x4c644e[_0xb6b2('0xcf')],'note':_[_0xb6b2('0xd5')](_0x4c644e[_0xb6b2('0xd0')])?null:getMustacheRender(_0x4c644e[_0xb6b2('0xd0')],_0x359314),'metadata':null},'redirect':_0xb6b2('0xd6'),'json':!![]};try{if(!_[_0xb6b2('0xd5')](_0x4c644e['vidaooMetadata'])){var _0x2c3831=getMustacheRender(_0x4c644e['vidaooMetadata'],_0x359314);var _0x18ddaa=JSON[_0xb6b2('0x8c')](_0x2c3831);_0x5665b4['body'][_0xb6b2('0xd7')]=_0x18ddaa;}}catch(_0x585a9a){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5665b4);}else{throw new db[(_0xb6b2('0x9d'))][(_0xb6b2('0xd8'))](_0xb6b2('0xd9'));}})[_0xb6b2('0x30')](function(_0x11aaa0){_0x3bd135=_0x11aaa0;if(_0x3bd135['id']){var _0x3d9379={'body':_0x3bd135['join_url'],'ChatWebsiteId':_0x4c644e['id'],'ChatInteractionId':_0x48f595['id'],'direction':_0xb6b2('0xda'),'UserId':_0x46b423[_0xb6b2('0xa4')]['id']};return db[_0xb6b2('0xdb')][_0xb6b2('0xdc')](_0x3d9379,{});}else{throw new db[(_0xb6b2('0x9d'))][(_0xb6b2('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xb6b2('0x30')](function(){return _0x48f595['updateAttributes']({'vidaooSessionId':_0x3bd135['id']});})[_0xb6b2('0x30')](respondWithResult(_0x4faeba,null))[_0xb6b2('0x3e')](handleError(_0x4faeba,null));};exports[_0xb6b2('0xdd')]=function(_0x1d6aea,_0x369788){if(_0x1d6aea[_0xb6b2('0x84')]['id']){delete _0x1d6aea['body']['id'];}return db[_0xb6b2('0xad')][_0xb6b2('0x70')]({'where':{'id':_0x1d6aea[_0xb6b2('0xc6')]['id']},'include':[{'model':db['CmContact'],'as':_0xb6b2('0x75')}]})['then'](handleEntityNotFound(_0x369788,null))[_0xb6b2('0x30')](saveUpdates(_0x1d6aea[_0xb6b2('0x84')],null))[_0xb6b2('0x30')](respondWithResult(_0x369788,null))[_0xb6b2('0x3e')](handleError(_0x369788,null));};exports[_0xb6b2('0xde')]=function(_0x3c1a40,_0x4c0f3b,_0x42fff2){if(_0x3c1a40['body']['id']){delete _0x3c1a40['body']['id'];}return db[_0xb6b2('0xad')]['find']({'where':{'id':_0x3c1a40['params']['id']}})[_0xb6b2('0x30')](function(_0x16864f){if(!_0x16864f){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xb6b2('0xde'),0x194,_0xb6b2('0xdf'));_0x4c0f3b['sendStatus'](0x194);}else{if(_0x16864f[_0xb6b2('0x43')]){throw new db[(_0xb6b2('0x9d'))]['ValidationError'](_0xb6b2('0xe0'));}}return _0x16864f;})[_0xb6b2('0x30')](function(_0x184b74){if(_0x184b74){return _0x184b74[_0xb6b2('0x2f')]({'closed':_0x3c1a40[_0xb6b2('0x84')]['closed'],'disposition':_0x3c1a40[_0xb6b2('0x84')][_0xb6b2('0x46')]})[_0xb6b2('0x30')](function(_0x26d7b9){return _0x26d7b9;});}})['then'](function(_0x26c9dc){return respondWithRpcPromise(_0xb6b2('0xe1'),_0xb6b2('0xde'),_0x3c1a40[_0xb6b2('0x84')],client9004);})['then'](respondWithResult(_0x4c0f3b,null))['catch'](handleError(_0x4c0f3b,null));};exports[_0xb6b2('0xe2')]=function(_0x5f1d67,_0x3b4797,_0x4910f0){_0x5f1d67[_0xb6b2('0x84')][_0xb6b2('0x33')]=_0x5f1d67[_0xb6b2('0xe3')][_0xb6b2('0xe4')];_0x5f1d67[_0xb6b2('0x84')]['basename']=_0x5f1d67[_0xb6b2('0xe3')][_0xb6b2('0xe5')];_0x5f1d67['body'][_0xb6b2('0x4a')]=_0x5f1d67[_0xb6b2('0xe3')][_0xb6b2('0xe6')];return db[_0xb6b2('0xe7')][_0xb6b2('0xdc')](_0x5f1d67[_0xb6b2('0x84')])['then'](respondWithResult(_0x3b4797,0xc9))[_0xb6b2('0x3e')](handleError(_0x3b4797,null));};exports[_0xb6b2('0xe8')]=function(_0x121900,_0xeff631,_0xe796e0){return db[_0xb6b2('0xad')][_0xb6b2('0xcb')]({'where':{'id':_0x121900[_0xb6b2('0xc6')]['id']},'raw':!![]})[_0xb6b2('0x30')](handleEntityNotFound(_0xeff631,null))[_0xb6b2('0x30')](function(_0x2e44b1){if(_0x2e44b1){if(_0x2e44b1[_0xb6b2('0x45')]){return _0xeff631[_0xb6b2('0x27')](0x193)[_0xb6b2('0xe9')]({'status':0x193,'message':_0xb6b2('0xea')});}return db['Attachment']['findOne']({'where':{'id':_0x121900[_0xb6b2('0x4d')]['attachId']},'raw':!![]})[_0xb6b2('0x30')](handleEntityNotFound(_0xeff631,null));}})[_0xb6b2('0x30')](function(_0x45443a){if(_0x45443a){var _0x1e711a=_0x45443a[_0xb6b2('0xeb')]!==null;var _0xfcdf13=path[_0xb6b2('0xec')](config['root'],_0xb6b2('0xed'));if(_0x1e711a){_0xfcdf13=path[_0xb6b2('0xec')](_0xfcdf13,_0xb6b2('0xee'));}var _0x139bda=path[_0xb6b2('0xec')](_0xfcdf13,_0x45443a[_0xb6b2('0xef')]);return _0xeff631[_0xb6b2('0xf0')](_0x139bda);}})['catch'](handleError(_0xeff631,null));};exports[_0xb6b2('0xf1')]=function(_0x536151,_0x2011aa){var _0x2eb30e=null;var _0x47dff2=null;var _0x461a20=null;var _0x17edce=null;if(_0x536151[_0xb6b2('0x84')]['id']){delete _0x536151[_0xb6b2('0x84')]['id'];}if(_0x536151[_0xb6b2('0x84')][_0xb6b2('0xf2')]){_0x17edce=path['join'](config[_0xb6b2('0xf3')],'server/files/chat/upload/',util[_0xb6b2('0xf4')]('transcript-%s.txt',Date[_0xb6b2('0xf5')]()));_0x536151[_0xb6b2('0x84')][_0xb6b2('0xf6')]=_0x17edce;}return db['ChatInteraction'][_0xb6b2('0x70')]({'where':{'id':_0x536151['params']['id']},'include':[{'model':db[_0xb6b2('0xdb')],'as':_0xb6b2('0xf7'),'include':[{'model':db[_0xb6b2('0x82')],'as':'User'}]}]})[_0xb6b2('0x30')](handleEntityNotFound(_0x2011aa,null))[_0xb6b2('0x30')](saveUpdates(_0x536151[_0xb6b2('0x84')],null))[_0xb6b2('0x30')](function(_0x674576){if(_0x674576){_0x2eb30e=_0x674576;return db[_0xb6b2('0xcc')][_0xb6b2('0x70')]({'where':{'id':_0x2eb30e[_0xb6b2('0x89')]}});}})[_0xb6b2('0x30')](function(_0x5187b7){if(_0x5187b7){_0x461a20=_0x5187b7;return db[_0xb6b2('0xf8')]['find']({'where':{'id':_0x2eb30e[_0xb6b2('0x7b')]}});}})[_0xb6b2('0x30')](function(_0x72931f){if(_0x72931f){_0x47dff2=_0x72931f;if(_0x17edce){var _0x41392e=null;for(var _0x5a656e=0x1;_0x5a656e<_0x2eb30e[_0xb6b2('0xf7')][_0xb6b2('0x52')];++_0x5a656e){_0x41392e=_0x2eb30e[_0xb6b2('0xf7')][_0x5a656e];var _0x29d098=_0x41392e['UserId']?util[_0xb6b2('0xf4')]('%s%d',_0x461a20[_0xb6b2('0xf9')],_0x41392e[_0xb6b2('0x43')]):'System';var _0x2f95ba=_0x536151['body'][_0xb6b2('0xfa')]||util[_0xb6b2('0xf4')]('%s%d',_0xb6b2('0xfb'),_0x41392e[_0xb6b2('0x7b')]);switch(_0x461a20[_0xb6b2('0xfc')]){case'website_alias':_0x29d098=_0x41392e[_0xb6b2('0x43')]?util[_0xb6b2('0xf4')](_0xb6b2('0xfd'),_0x461a20[_0xb6b2('0xf9')],_0x41392e[_0xb6b2('0x43')]):_0xb6b2('0xfe');break;case _0xb6b2('0xff'):_0x29d098=_0x41392e['UserId']?_0x41392e[_0xb6b2('0x82')][_0xb6b2('0x100')]||_0x41392e[_0xb6b2('0x82')][_0xb6b2('0xd2')]:'System';break;case _0xb6b2('0x101'):_0x29d098=_0x41392e[_0xb6b2('0x43')]?_0x41392e[_0xb6b2('0x82')][_0xb6b2('0xd2')]:_0xb6b2('0xfe');break;default:_0x29d098=_0x41392e['UserId']?util[_0xb6b2('0xf4')](_0xb6b2('0xfd'),_0x461a20[_0xb6b2('0xf9')],_0x41392e[_0xb6b2('0x43')]):_0xb6b2('0xfe');}var _0x224bcc=util[_0xb6b2('0xf4')](_0xb6b2('0x102'),moment(_0x41392e['createdAt'])[_0xb6b2('0xf4')](_0xb6b2('0x103')),_0x41392e[_0xb6b2('0x104')]==='in'?_0x2f95ba:_0x29d098,_0x41392e['body']);if(!_0x41392e[_0xb6b2('0x105')]){fs[_0xb6b2('0x106')](_0x17edce,_0x224bcc);}}return db['MailAccount'][_0xb6b2('0xcb')]({'where':{'service':!![]},'include':[{'model':db[_0xb6b2('0x107')],'as':_0xb6b2('0x108'),'raw':!![]}]});}}})['then'](function(_0x5b068a){if(_0x5b068a&&_0x5b068a[_0xb6b2('0x108')]&&_0x536151['body']){var _0x2a3e7c={'tls':{'rejectUnauthorized':![]}};if(_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x109')]){_0x2a3e7c[_0xb6b2('0x109')]=_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x109')];}else{_0x2a3e7c[_0xb6b2('0x10a')]=_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x10a')];_0x2a3e7c['port']=_0x5b068a['Smtp']['port'];_0x2a3e7c[_0xb6b2('0x10b')]=_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x10b')];}if(_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x10c')]){_0x2a3e7c[_0xb6b2('0x10d')]={'user':_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0xa4')],'pass':_0x5b068a['Smtp'][_0xb6b2('0x10e')]};}return respondWithRpcPromise(_0xb6b2('0x10f'),_0xb6b2('0x110'),{'account':_0x2a3e7c,'message':{'from':util[_0xb6b2('0xf4')](_0xb6b2('0x111'),_0x5b068a[_0xb6b2('0x33')],_0x5b068a[_0xb6b2('0xd3')]||_0x5b068a[_0xb6b2('0x108')]['user']),'to':_0x536151['body']['mailTranscript'],'subject':_0xb6b2('0x112'),'text':util[_0xb6b2('0xf4')](_0xb6b2('0x113'),_0x536151[_0xb6b2('0x84')][_0xb6b2('0xf2')]),'attachments':[{'path':_0x17edce}]}})[_0xb6b2('0x30')](function(){return _0x2eb30e;})[_0xb6b2('0x3e')](function(_0x29a939){console[_0xb6b2('0x20')](_0x29a939);});}else{return _0x2eb30e;}})[_0xb6b2('0x30')](respondWithStatusCode(_0x2011aa,0xc8))['catch'](handleError(_0x2011aa,null));};exports[_0xb6b2('0x114')]=function(_0x1e6db7,_0x1fa7e5,_0x5e1544){return db[_0xb6b2('0xdb')][_0xb6b2('0x70')]({'where':{'id':_0x1e6db7[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x1fa7e5,null))[_0xb6b2('0x30')](function(_0x492d85){if(_0x492d85){return _0x492d85[_0xb6b2('0x114')](_0x1e6db7['body'][_0xb6b2('0x115')],_[_0xb6b2('0x116')](_0x1e6db7['body'],[_0xb6b2('0x115'),'id'])||{});}})[_0xb6b2('0x30')](respondWithResult(_0x1fa7e5,null))[_0xb6b2('0x3e')](handleError(_0x1fa7e5,null));};exports['getMessages']=function(_0x259eef,_0x55a2d8,_0x48f78d){var _0x3229fc={'raw':![],'where':{}};var _0x8458cc={};var _0x543449={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb6b2('0xcb')]({'where':{'id':_0x259eef[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x55a2d8,null))[_0xb6b2('0x30')](function(_0x1b5e04){if(_0x1b5e04){_0x8458cc[_0xb6b2('0x4c')]=_['keys'](db[_0xb6b2('0xdb')]['rawAttributes']);_0x8458cc['query']=_['keys'](_0x259eef['query']);_0x8458cc[_0xb6b2('0x4e')]=_[_0xb6b2('0x50')](_0x8458cc[_0xb6b2('0x4c')],_0x8458cc['query']);_0x3229fc['attributes']=_['intersection'](_0x8458cc[_0xb6b2('0x4c')],qs[_0xb6b2('0x51')](_0x259eef[_0xb6b2('0x4d')]['fields']));_0x3229fc['attributes']=_0x3229fc[_0xb6b2('0x4f')][_0xb6b2('0x52')]?_0x3229fc['attributes']:_0x8458cc[_0xb6b2('0x4c')];if(!_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x53')](_0xb6b2('0x54'))){_0x3229fc[_0xb6b2('0x29')]=qs[_0xb6b2('0x29')](_0x259eef[_0xb6b2('0x4d')]['limit']);_0x3229fc[_0xb6b2('0x28')]=qs['offset'](_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x28')]);}_0x3229fc['order']=qs['sort'](_0x259eef['query'][_0xb6b2('0x56')]);_0x3229fc[_0xb6b2('0x57')]=qs[_0xb6b2('0x4e')](_[_0xb6b2('0x117')](_0x259eef[_0xb6b2('0x4d')],_0x8458cc[_0xb6b2('0x4e')]));_0x3229fc[_0xb6b2('0x57')]['ChatInteractionId']=_0x1b5e04['id'];if(_0x259eef[_0xb6b2('0x4d')]['filter']){_0x3229fc['where']=_[_0xb6b2('0x35')](_0x3229fc['where'],{'$or':_['map'](_0x3229fc[_0xb6b2('0x4f')],function(_0x502878){var _0x50be29={};_0x50be29[_0x502878]={'$like':'%'+_0x259eef[_0xb6b2('0x4d')]['filter']+'%'};return _0x50be29;})});}if(_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x8d')]){var _0x1c23e8=_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x8d')][_0xb6b2('0x3b')](',');var _0x1bf9ea={};_0x1bf9ea[_0x1c23e8[0x0]]={'$gte':moment(_0x1c23e8[0x1])[_0xb6b2('0xf4')](_0xb6b2('0x118'))};_0x3229fc['where']=_['merge'](_0x3229fc[_0xb6b2('0x57')],_0x1bf9ea);}_0x3229fc=_[_0xb6b2('0x35')]({},_0x3229fc,_0x259eef[_0xb6b2('0x119')]);return db['ChatMessage'][_0xb6b2('0x2b')]({'where':_0x3229fc[_0xb6b2('0x57')]})[_0xb6b2('0x30')](function(_0x406c72){_0x543449[_0xb6b2('0x2b')]=_0x406c72;if(_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0xc7')]){_0x3229fc[_0xb6b2('0xc8')]=[{'all':!![]}];}return db['ChatMessage'][_0xb6b2('0x11a')](_0x3229fc);})[_0xb6b2('0x30')](function(_0x29e297){_0x543449[_0xb6b2('0xc4')]=_0x29e297;return _0x543449;});}})['then'](respondWithFilteredResult(_0x55a2d8,_0x3229fc))[_0xb6b2('0x3e')](handleError(_0x55a2d8,null));};exports[_0xb6b2('0x11b')]=function(_0x7368f3,_0xb9017a,_0x31e38f){var _0x2ddca3={'where':{}},_0x27d92c={},_0x5ba306={'count':0x0,'rows':[]};return db[_0xb6b2('0xad')][_0xb6b2('0xcb')]({'where':{'id':_0x7368f3[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0xb9017a,null))[_0xb6b2('0x30')](function(_0x37fcc8){if(_0x37fcc8){_0x27d92c[_0xb6b2('0x4c')]=_[_0xb6b2('0x85')](db[_0xb6b2('0xdb')][_0xb6b2('0x48')]);_0x27d92c[_0xb6b2('0x4d')]=_[_0xb6b2('0x85')](_0x7368f3[_0xb6b2('0x4d')]);_0x27d92c[_0xb6b2('0x4e')]=_['intersection'](_0x27d92c['model'],_0x27d92c[_0xb6b2('0x4d')]);_0x2ddca3[_0xb6b2('0x4f')]=_[_0xb6b2('0x50')](_0x27d92c[_0xb6b2('0x4c')],qs[_0xb6b2('0x51')](_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x51')]));_0x2ddca3[_0xb6b2('0x4f')]=_0x2ddca3[_0xb6b2('0x4f')][_0xb6b2('0x52')]?_0x2ddca3['attributes']:_0x27d92c[_0xb6b2('0x4c')];if(!_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x53')](_0xb6b2('0x54'))){_0x2ddca3[_0xb6b2('0x29')]=qs[_0xb6b2('0x29')](_0x7368f3[_0xb6b2('0x4d')]['limit']);_0x2ddca3[_0xb6b2('0x28')]=qs[_0xb6b2('0x28')](_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x28')]);}_0x2ddca3['order']=qs[_0xb6b2('0x56')](_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x56')]);_0x2ddca3['where']=qs['filters'](_[_0xb6b2('0x117')](_0x7368f3[_0xb6b2('0x4d')],_0x27d92c[_0xb6b2('0x4e')]));_0x2ddca3[_0xb6b2('0x57')][_0xb6b2('0xc2')]=_0x37fcc8['id'];if(_0x7368f3['query']['filter']){_0x2ddca3[_0xb6b2('0x57')]=_[_0xb6b2('0x35')](_0x2ddca3['where'],{'$or':_['map'](_0x2ddca3[_0xb6b2('0x4f')],function(_0x15ea1e){var _0x20c077={};_0x20c077[_0x15ea1e]={'$like':'%'+_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x95')]+'%'};return _0x20c077;})});}_0x2ddca3['where'][_0xb6b2('0x105')]=![];if(_0x7368f3[_0xb6b2('0x4d')]['id']){_0x2ddca3[_0xb6b2('0x57')]['id']={'$gt':_0x7368f3[_0xb6b2('0x4d')]['id']};}_0x2ddca3=_[_0xb6b2('0x35')]({},_0x2ddca3,_0x7368f3['options']);return db[_0xb6b2('0xdb')][_0xb6b2('0x2b')]({'where':_0x2ddca3['where']})[_0xb6b2('0x30')](function(_0x8d955c){_0x5ba306['count']=_0x8d955c;_0x2ddca3[_0xb6b2('0xc8')]=[];if(_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x11c')]){_0x2ddca3[_0xb6b2('0xc8')]['push']({'model':db[_0xb6b2('0x82')],'as':'User','attributes':['id',_0xb6b2('0xd2'),_0xb6b2('0x100')]});}if(_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0xc7')]){_0x2ddca3[_0xb6b2('0xc8')]=[{'all':!![]}];}return db[_0xb6b2('0xdb')][_0xb6b2('0x11a')](_0x2ddca3);})[_0xb6b2('0x30')](function(_0x42281b){_0x5ba306[_0xb6b2('0xc4')]=_0x42281b;return _0x5ba306;});}})['then'](respondWithFilteredResult(_0xb9017a,_0x2ddca3))[_0xb6b2('0x3e')](handleError(_0xb9017a,null));};exports['addTags']=function(_0x27bd38,_0x2ae9dc,_0x126984){return db[_0xb6b2('0xad')]['find']({'where':{'id':_0x27bd38['params']['id']}})['then'](handleEntityNotFound(_0x2ae9dc,null))[_0xb6b2('0x30')](function(_0x173edb){if(_0x173edb){return _0x173edb['setTags'](_0x27bd38['body']['ids'],_[_0xb6b2('0x116')](_0x27bd38[_0xb6b2('0x84')],['ids','id'])||{})[_0xb6b2('0x11d')](function(){return db[_0xb6b2('0x7f')][_0xb6b2('0x11a')]({'attributes':['id','name',_0xb6b2('0x59')],'where':{'id':_0x27bd38[_0xb6b2('0x84')][_0xb6b2('0x115')]}});})[_0xb6b2('0x30')](function(_0xbdef8f){socket[_0xb6b2('0x11e')](_0xb6b2('0x11f'),{'id':Number(_0x27bd38[_0xb6b2('0xc6')]['id']),'tags':_0xbdef8f||[]});return{'id':Number(_0x27bd38[_0xb6b2('0xc6')]['id']),'tags':_0xbdef8f||[]};});}})[_0xb6b2('0x30')](respondWithResult(_0x2ae9dc,null))['catch'](handleError(_0x2ae9dc,null));};exports[_0xb6b2('0x120')]=function(_0x27cd16,_0x1a10aa,_0x3a6610){return db[_0xb6b2('0xad')]['find']({'where':{'id':_0x27cd16['params']['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x1a10aa,null))['then'](function(_0x40bd7d){if(_0x40bd7d){return _0x40bd7d[_0xb6b2('0x120')](_0x27cd16[_0xb6b2('0x4d')][_0xb6b2('0x115')]);}})['then'](respondWithStatusCode(_0x1a10aa,null))[_0xb6b2('0x3e')](handleError(_0x1a10aa,null));};exports[_0xb6b2('0xf0')]=function(_0xb33f09,_0x431b79){var _0xb273b7=moment()['unix']()[_0xb6b2('0xab')]();var _0x50328e=path[_0xb6b2('0xec')](config['root'],_0xb6b2('0x121'),_0xb6b2('0x122'),_0xb6b2('0x123'));var _0x40942a=path[_0xb6b2('0xec')](config[_0xb6b2('0xf3')],'server',_0xb6b2('0x122'),'attachments');var _0x92eeba=path[_0xb6b2('0xec')](_0x50328e,_0xb273b7);var _0x3d1f79=util[_0xb6b2('0xf4')](_0xb6b2('0x124'),_0xb33f09['params']['id'],_0xb273b7);var _0x289110=path[_0xb6b2('0xec')](_0x50328e,_0x3d1f79);var _0x34be29=[];_0x34be29[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0x82')],'as':_0xb6b2('0x82'),'attributes':['id',_0xb6b2('0xd2')],'raw':!![]});_0x34be29[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0xf8')],'as':_0xb6b2('0x75'),'attributes':['id','firstName',_0xb6b2('0x125')],'raw':!![]});if(_0xb33f09[_0xb6b2('0x4d')]['attachments']){_0x34be29[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0xe7')],'as':_0xb6b2('0xe7'),'raw':!![]});}var _0x2d0c9f=[{'model':db[_0xb6b2('0xdb')],'as':_0xb6b2('0xf7'),'attributes':['id',_0xb6b2('0x84'),_0xb6b2('0x8b'),_0xb6b2('0x104'),_0xb6b2('0x105'),_0xb6b2('0x91')],'include':_0x34be29}];_0x2d0c9f['push']({'model':db['ChatWebsite'],'as':_0xb6b2('0x126'),'attributes':['id',_0xb6b2('0x33')]});_0x2d0c9f[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0x82')],'as':_0xb6b2('0x127'),'attributes':['id','fullname']});return db[_0xb6b2('0xad')][_0xb6b2('0x70')]({'where':{'id':_0xb33f09[_0xb6b2('0xc6')]['id']},'include':_0x2d0c9f})['then'](handleEntityNotFound(_0x431b79,null))[_0xb6b2('0x30')](function(_0x20ff2e){if(_0x20ff2e){var _0x40f6c1=_0x20ff2e[_0xb6b2('0x128')]({'plain':!![]});fs['mkdirSync'](_0x92eeba);var _0x4bec5f={'channel':_0xb6b2('0x129'),'account':_0x40f6c1[_0xb6b2('0x126')][_0xb6b2('0x33')],'agent':_0x40f6c1['Owner']?_0x40f6c1[_0xb6b2('0x127')][_0xb6b2('0xd2')]:'N.A.','createdAt':moment(_0x40f6c1['createdAt'])[_0xb6b2('0xf4')](_0xb6b2('0x118'))['toString'](),'closedAt':_0x40f6c1['closed']?moment(_0x40f6c1['closedAt'])['format'](_0xb6b2('0x118'))[_0xb6b2('0xab')]():'','disposition':_0x40f6c1[_0xb6b2('0x46')],'chatInfo':{'browser':_0x40f6c1['browserName'],'os':_0x40f6c1[_0xb6b2('0x12a')],'referer':_0x40f6c1[_0xb6b2('0x12b')],'customerIp':_0x40f6c1['customerIp'],'customerPort':_0x40f6c1['customerPort']?_0x40f6c1['customerPort']:_0xb6b2('0x12c')},'messages':_(_0x40f6c1[_0xb6b2('0xf7')])[_0xb6b2('0x12d')]()[_0xb6b2('0x95')]({'secret':![]})['map'](function(_0x4e226e){if(_0x4e226e[_0xb6b2('0xe7')]){var _0x28c834=path['join'](_0x40942a,_0x4e226e[_0xb6b2('0xe7')][_0xb6b2('0xef')]);if(fs[_0xb6b2('0x12e')](_0x28c834)){fs[_0xb6b2('0x12f')](_0x28c834)[_0xb6b2('0x130')](fs['createWriteStream'](path[_0xb6b2('0xec')](_0x92eeba,_0x4e226e[_0xb6b2('0xe7')][_0xb6b2('0xef')])));}}return{'date':moment(_0x4e226e['createdAt'])[_0xb6b2('0xf4')](_0xb6b2('0x118'))['toString'](),'sender':_0x4e226e[_0xb6b2('0x104')]===_0xb6b2('0xda')?_0x4e226e[_0xb6b2('0x82')]?_0x4e226e['User']['fullname']:_0xb6b2('0xfe'):_0x4e226e['Contact'][_0xb6b2('0x131')]+(_0x4e226e['Contact'][_0xb6b2('0x125')]?'\x20'+_0x4e226e[_0xb6b2('0x75')][_0xb6b2('0x125')]:''),'body':_0x4e226e[_0xb6b2('0xe7')]?_0x4e226e[_0xb6b2('0xe7')][_0xb6b2('0xef')]:_0x4e226e[_0xb6b2('0x84')],'direction':_0x4e226e[_0xb6b2('0x104')]===_0xb6b2('0xda')?'A':'C','secret':_0x4e226e[_0xb6b2('0x105')],'read':_0x4e226e[_0xb6b2('0x91')],'attachment':_0x4e226e[_0xb6b2('0xe7')]};})[_0xb6b2('0x77')]()};return ejs[_0xb6b2('0x132')](path[_0xb6b2('0xec')](config['root'],'server',_0xb6b2('0x133'),_0xb6b2('0x134')),{'interaction':_0x4bec5f})['then'](function(_0x3824a2){var _0x53aa75=path[_0xb6b2('0xec')](_0x92eeba,'transcript-'+_0x40f6c1['id']+'-'+_0xb273b7+_0xb6b2('0x135'));var _0x4d9b2a={'path':_0x53aa75,'channel':_0xb6b2('0x129'),'interactionId':_0x40f6c1['id']};return pdf['createPdfFromHTML'](_0x3824a2,_0x4d9b2a);})[_0xb6b2('0x30')](function(){return new BPromise(function(_0x131ad9,_0x5dbe7f){zipdir(_0x92eeba,{'saveTo':_0x289110},function(_0xb6b198,_0x2a8d9b){if(_0xb6b198)return _0x5dbe7f(_0xb6b198);return _0x131ad9(_0x2a8d9b);});})['then'](function(){return new BPromise(function(_0x225ce0,_0x432fd1){rimraf(_0x92eeba,function(_0x36abe8){if(_0x36abe8)_0x432fd1(_0x36abe8);return _0x225ce0();});});})['then'](function(){return _0x431b79['download'](_0x289110,_0x3d1f79,function(_0x1cde6c){if(_0x1cde6c){console[_0xb6b2('0x136')]('err',_0x1cde6c);}else{fs[_0xb6b2('0x137')](_0x289110);}});});});}else{return _0x431b79[_0xb6b2('0x25')](0xc8);}})[_0xb6b2('0x3e')](handleError(_0x431b79,null));};
\ No newline at end of file
+var _0xc22b=['Account','N.A.','closedAt','browserName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','zip-dir','request-promise','moment','bluebird','mustache','util','lodash','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','end','sendStatus','stack','name','render','body','contact','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','show','params','includeAll','include','merge','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','offline-chat/','basename','close','mailTranscript','server/files/chat/upload/','pathTranscript','Messages','User','CmContact','format','%s%d','agentAlias','System','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','firstName','lastName','Owner','get','mkdirSync','Chat'];(function(_0x5128e5,_0x319cb1){var _0x31b9b4=function(_0x81bcff){while(--_0x81bcff){_0x5128e5['push'](_0x5128e5['shift']());}};_0x31b9b4(++_0x319cb1);}(_0xc22b,0x14d));var _0xbc22=function(_0x3a5ce5,_0x501ad8){_0x3a5ce5=_0x3a5ce5-0x0;var _0x45ab6c=_0xc22b[_0x3a5ce5];return _0x45ab6c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbc22('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc22('0x1'));var moment=require(_0xbc22('0x2'));var BPromise=require(_0xbc22('0x3'));var Mustache=require(_0xbc22('0x4'));var util=require(_0xbc22('0x5'));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(_0xbc22('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbc22('0x7'));var deskjs=require(_0xbc22('0x8'));var toCsv=require(_0xbc22('0x9'));var querystring=require('querystring');var Papa=require(_0xbc22('0xa'));var Redis=require('ioredis');var authService=require(_0xbc22('0xb'));var qs=require(_0xbc22('0xc'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbc22('0xd'));var hardwareService=require(_0xbc22('0xe'));var logger=require(_0xbc22('0xf'))(_0xbc22('0x10'));var utils=require('../../config/utils');var config=require(_0xbc22('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc22('0x12'))['db'];config[_0xbc22('0x13')]=_[_0xbc22('0x14')](config[_0xbc22('0x13')],{'host':_0xbc22('0x15'),'port':0x18eb});var socket=require(_0xbc22('0x16'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xbc22('0x17')](socket);var jayson=require(_0xbc22('0x18'));var client=jayson[_0xbc22('0x19')][_0xbc22('0x1a')]({'port':0x232b});var client9004=jayson[_0xbc22('0x19')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1193d4,_0x3637fb,_0x3b682b,_0x26a6d2){return new BPromise(function(_0x5ad2e9,_0x16d77f){var _0x192023=_0x26a6d2||client;return _0x192023[_0xbc22('0x1b')](_0x1193d4,_0x3b682b)[_0xbc22('0x1c')](function(_0xb1dfe0){logger[_0xbc22('0x1d')](_0xbc22('0x1e'),_0x3637fb,_0xbc22('0x1f'));logger[_0xbc22('0x20')](_0xbc22('0x21'),_0x3637fb,_0xbc22('0x1f'),JSON[_0xbc22('0x22')](_0xb1dfe0));if(_0xb1dfe0['error']){if(_0xb1dfe0[_0xbc22('0x23')][_0xbc22('0x24')]===0x1f4){logger[_0xbc22('0x23')](_0xbc22('0x1e'),_0x3637fb,_0xb1dfe0['error'][_0xbc22('0x25')]);return _0x16d77f(_0xb1dfe0[_0xbc22('0x23')][_0xbc22('0x25')]);}logger[_0xbc22('0x23')](_0xbc22('0x1e'),_0x3637fb,_0xb1dfe0['error']['message']);return _0x5ad2e9(_0xb1dfe0['error'][_0xbc22('0x25')]);}else{logger[_0xbc22('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x3637fb,_0xbc22('0x1f'));_0x5ad2e9(_0xb1dfe0[_0xbc22('0x26')][_0xbc22('0x25')]);}})[_0xbc22('0x27')](function(_0x3dbe4d){logger[_0xbc22('0x23')](_0xbc22('0x1e'),_0x3637fb,_0x3dbe4d);_0x16d77f(_0x3dbe4d);});});}function respondWithStatusCode(_0x54204f,_0x3fb59a){_0x3fb59a=_0x3fb59a||0xcc;return function(_0x105930){if(_0x105930){return _0x54204f['sendStatus'](_0x3fb59a);}return _0x54204f[_0xbc22('0x28')](_0x3fb59a)['end']();};}function respondWithResult(_0x3b2dba,_0x3ef71a){_0x3ef71a=_0x3ef71a||0xc8;return function(_0x33f010){if(_0x33f010){return _0x3b2dba[_0xbc22('0x28')](_0x3ef71a)[_0xbc22('0x29')](_0x33f010);}};}function respondWithFilteredResult(_0x4b41f3,_0x17aef3){return function(_0x88b2d2){if(_0x88b2d2){var _0x560333=typeof _0x17aef3[_0xbc22('0x2a')]==='undefined'&&typeof _0x17aef3['limit']===_0xbc22('0x2b');var _0x40c9be=_0x88b2d2['count'];var _0x32f970=_0x560333?0x0:_0x17aef3[_0xbc22('0x2a')];var _0x34311a=_0x560333?_0x88b2d2[_0xbc22('0x2c')]:_0x17aef3[_0xbc22('0x2a')]+_0x17aef3[_0xbc22('0x2d')];var _0x4ee60c;if(_0x34311a>=_0x40c9be){_0x34311a=_0x40c9be;_0x4ee60c=0xc8;}else{_0x4ee60c=0xce;}_0x4b41f3['status'](_0x4ee60c);return _0x4b41f3[_0xbc22('0x2e')](_0xbc22('0x2f'),_0x32f970+'-'+_0x34311a+'/'+_0x40c9be)[_0xbc22('0x29')](_0x88b2d2);}return null;};}function patchUpdates(_0x25a666){return function(_0x2f1d0f){try{jsonpatch[_0xbc22('0x30')](_0x2f1d0f,_0x25a666,!![]);}catch(_0xef3436){return BPromise[_0xbc22('0x31')](_0xef3436);}return _0x2f1d0f['save']();};}function saveUpdates(_0x46112d,_0x40485c){return function(_0x537dc2){if(_0x537dc2){return _0x537dc2[_0xbc22('0x32')](_0x46112d)[_0xbc22('0x1c')](function(_0x4fb994){return _0x4fb994;});}return null;};}function removeEntity(_0x314b89,_0x40de9e){return function(_0x1ec5cd){if(_0x1ec5cd){return _0x1ec5cd[_0xbc22('0x33')]()[_0xbc22('0x1c')](function(){_0x314b89[_0xbc22('0x28')](0xcc)[_0xbc22('0x34')]();});}};}function handleEntityNotFound(_0x190c1c,_0x6749f4){return function(_0x44dad0){if(!_0x44dad0){_0x190c1c[_0xbc22('0x35')](0x194);}return _0x44dad0;};}function handleError(_0x599025,_0x3d7738){_0x3d7738=_0x3d7738||0x1f4;return function(_0x5737ca){logger['error'](_0x5737ca[_0xbc22('0x36')]);if(_0x5737ca[_0xbc22('0x37')]){delete _0x5737ca[_0xbc22('0x37')];}_0x599025[_0xbc22('0x28')](_0x3d7738)['send'](_0x5737ca);};}function getMustacheRender(_0x5841d3,_0x272aa4){return Mustache[_0xbc22('0x38')](_0x5841d3,_['merge'](_0x272aa4[_0xbc22('0x39')],{'contact':_0x272aa4[_0xbc22('0x3a')],'message':_0x272aa4[_0xbc22('0x25')],'agent':_0x272aa4['agent'],'interaction':_0x272aa4[_0xbc22('0x3b')],'account':_0x272aa4[_0xbc22('0x3c')]}))||'';}function getInteractionUsers(_0x39f893,_0x107330){return new BPromise(function(_0x2a5e00,_0x124a1c){try{if(_0x107330[_0x39f893['id']]){_0x39f893[_0xbc22('0x3d')]=_[_0xbc22('0x3e')](_0x107330[_0x39f893['id']],function(_0x58c049){return{'id':_0x58c049['id'],'fullname':_0x58c049[_0xbc22('0x3f')]};});}}catch(_0x15596c){_0x124a1c(_0x15596c);}_0x2a5e00(_0x39f893);});}function getInteractionTags(_0xd31348,_0x1ff4cc){return new BPromise(function(_0x3cc86f,_0x159c56){try{if(_0xd31348[_0xbc22('0x40')]){_0xd31348[_0xbc22('0x41')]=[];_0xd31348[_0xbc22('0x40')][_0xbc22('0x42')](',')[_0xbc22('0x43')](function(_0x2a8968){_0xd31348[_0xbc22('0x41')][_0xbc22('0x44')](_0x1ff4cc[_0x2a8968]);});}delete _0xd31348[_0xbc22('0x40')];}catch(_0x245a25){_0x159c56(_0x245a25);}_0x3cc86f(_0xd31348);});}function updateChatInteraction(_0x463d1f,_0x468301,_0x44f911){return new BPromise(function(_0xef14da,_0x44fe7b){return getInteractionUsers(_0x463d1f,_0x44f911)['then'](function(_0x48ee8b){return getInteractionTags(_0x48ee8b,_0x468301);})[_0xbc22('0x1c')](function(_0x151450){return getStateInteraction(_0x151450);})['then'](function(_0x2da21f){_0xef14da(_0x2da21f);})[_0xbc22('0x27')](function(_0x42762d){_0x44fe7b(_0x42762d);});});}function getStateInteraction(_0x317230){return new BPromise(function(_0x21aef4){_0x317230[_0xbc22('0x45')]=0x0;_0x317230[_0xbc22('0x46')]=0x0;_0x317230[_0xbc22('0x47')]=0x0;_0x317230['unmanaged']=0x0;_0x317230[_0xbc22('0x48')]=0x0;_0x317230[_0xbc22('0x49')]=0x0;if(!_0x317230[_0xbc22('0x4a')]&&!_0x317230[_0xbc22('0x4b')]){_0x317230[_0xbc22('0x45')]+=0x1;}if(!_0x317230[_0xbc22('0x4a')]&&_0x317230[_0xbc22('0x4b')]){_0x317230[_0xbc22('0x46')]+=0x1;if(_0x317230[_0xbc22('0x45')]){_0x317230[_0xbc22('0x45')]-=0x1;}}if(_0x317230['closed']&&_0x317230[_0xbc22('0x4c')]==='abandoned'){_0x317230[_0xbc22('0x48')]+=0x1;if(_0x317230[_0xbc22('0x45')]){_0x317230[_0xbc22('0x45')]-=0x1;}}else if(_0x317230['closed']&&!_0x317230[_0xbc22('0x4b')]&&_0x317230[_0xbc22('0x4c')]){_0x317230[_0xbc22('0x4d')]+=0x1;if(_0x317230[_0xbc22('0x45')]){_0x317230[_0xbc22('0x45')]-=0x1;}}else if(_0x317230[_0xbc22('0x4a')]&&_0x317230[_0xbc22('0x4b')]){_0x317230['answered']+=0x1;if(_0x317230['talking']){_0x317230[_0xbc22('0x46')]-=0x1;}}_0x317230[_0xbc22('0x49')]+=0x1;_0x21aef4(_0x317230);});}exports['index']=function(_0x14b80d,_0x1caab1){var _0x553290={},_0xcd954f={},_0xd81a5={'count':0x0,'rows':[]};var _0x384bb7=_[_0xbc22('0x3e')](db[_0xbc22('0x4e')][_0xbc22('0x4f')],function(_0x4d75c4){return{'name':_0x4d75c4[_0xbc22('0x50')],'type':_0x4d75c4[_0xbc22('0x51')][_0xbc22('0x52')]};});_0xcd954f[_0xbc22('0x53')]=_['map'](_0x384bb7,_0xbc22('0x37'));_0xcd954f[_0xbc22('0x54')]=_[_0xbc22('0x55')](_0x14b80d['query']);_0xcd954f['filters']=_[_0xbc22('0x56')](_0xcd954f[_0xbc22('0x53')],_0xcd954f['query']);_0x553290[_0xbc22('0x57')]=_[_0xbc22('0x56')](_0xcd954f[_0xbc22('0x53')],qs[_0xbc22('0x58')](_0x14b80d['query'][_0xbc22('0x58')]));_0x553290[_0xbc22('0x57')]=_0x553290[_0xbc22('0x57')][_0xbc22('0x59')]?_0x553290[_0xbc22('0x57')]:_0xcd954f['model'];if(!_0x14b80d['query'][_0xbc22('0x5a')]('nolimit')){_0x553290[_0xbc22('0x2d')]=qs[_0xbc22('0x2d')](_0x14b80d['query'][_0xbc22('0x2d')]);_0x553290['offset']=qs[_0xbc22('0x2a')](_0x14b80d[_0xbc22('0x54')]['offset']);}_0x553290['order']=qs[_0xbc22('0x5b')](_0x14b80d[_0xbc22('0x54')][_0xbc22('0x5b')]);_0x553290[_0xbc22('0x5c')]=qs[_0xbc22('0x5d')](_[_0xbc22('0x5e')](_0x14b80d['query'],_0xcd954f[_0xbc22('0x5d')]),_0x384bb7);var _0x2ea03d=[];var _0x4e5f74=squel[_0xbc22('0x5f')]()[_0xbc22('0x60')]('id')[_0xbc22('0x60')](_0xbc22('0x37'))['field'](_0xbc22('0x61'))[_0xbc22('0x62')](_0xbc22('0x63'));var _0x2b79dd=squel['select']()['field'](_0xbc22('0x64'))[_0xbc22('0x60')](_0xbc22('0x65'))[_0xbc22('0x60')]('ui.ChatInteractionId')['from']('user_has_chat_interactions','ui')[_0xbc22('0x66')](_0xbc22('0x67'),'u',_0xbc22('0x68'));var _0x2da8be=squel[_0xbc22('0x5f')]()[_0xbc22('0x62')](_0xbc22('0x69'),'i')[_0xbc22('0x66')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xbc22('0x66')](_0xbc22('0x67'),'o',_0xbc22('0x6a'))['left_join']('chat_websites','a',_0xbc22('0x6b'))[_0xbc22('0x66')](_0xbc22('0x6c'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xbc22('0x66')](_0xbc22('0x6d'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xbc22('0x66')](_0xbc22('0x63'),'t',_0xbc22('0x6e'));var _0x39feff=squel['expr']();var _0x1749f1=[];var _0x55b176=squel[_0xbc22('0x6f')]();var _0x2cd30c;if(_0x14b80d[_0xbc22('0x54')]['search']){_0x2cd30c=as['parseSearch'](_0x14b80d[_0xbc22('0x54')][_0xbc22('0x70')]);var _0x4857eb=_0x2cd30c['sqlOperator'];for(var _0x2d56f0=0x0;_0x2d56f0<_0x2cd30c[_0xbc22('0x71')]['length'];_0x2d56f0++){var _0x43fce5=_0x2cd30c[_0xbc22('0x71')][_0x2d56f0];var _0x5b8643='i';var _0x17cf5a=_['find'](_0x384bb7,['name',_0x43fce5[_0xbc22('0x60')]]);if(!_0x17cf5a){switch(_0x43fce5[_0xbc22('0x60')]){case _0xbc22('0x72'):if(_0x43fce5[_0xbc22('0x73')]==0x1){_0x2da8be[_0xbc22('0x74')]('`'+_0x43fce5[_0xbc22('0x60')]+'`\x20=\x200');}else{_0x2da8be[_0xbc22('0x74')]('`'+_0x43fce5[_0xbc22('0x60')]+_0xbc22('0x75'));}break;case _0xbc22('0x76'):if(_0x43fce5[_0xbc22('0x77')]==='$substring'){if(_0x43fce5[_0xbc22('0x73')][_0xbc22('0x42')]('\x20')[_0xbc22('0x59')]>0x1){_0x39feff[_0x4857eb]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbc22('0x78')](_0x43fce5['value']),null);}else{var _0x40bc3b='%'+_0x43fce5[_0xbc22('0x73')]+'%';_0x39feff[_0x4857eb](_0xbc22('0x79'),_0x40bc3b,_0x40bc3b,_0x40bc3b);}}else{_0x17cf5a=_[_0xbc22('0x7a')](_0x384bb7,[_0xbc22('0x37'),_0xbc22('0x7b')]);_0x43fce5[_0xbc22('0x60')]=_0xbc22('0x7b');_0x15b980=as[_0xbc22('0x7c')](_0x5b8643,_0x17cf5a[_0xbc22('0x51')],_0x43fce5);_0x39feff[_0x4857eb](_0x15b980[_0xbc22('0x7d')],_0x15b980['value'][_0xbc22('0x7e')],_0x15b980['value'][_0xbc22('0x34')]);}break;case _0xbc22('0x7f'):var _0x35ccd4=_0x43fce5[_0xbc22('0x73')]['split'](',')['map'](function(_0x2d4acf){return Number(_0x2d4acf);});_0x35ccd4['forEach'](function(_0x4c9d0e){_0x55b176['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4c9d0e+',%');});_0x1749f1=_[_0xbc22('0x80')](_0x1749f1,_0x35ccd4);break;case'User':if(_0x43fce5['operator']===_0xbc22('0x81')){_0x39feff[_0x4857eb](_0xbc22('0x82'),'%'+_0x43fce5['value']+'%',null);}else{_0x17cf5a=_[_0xbc22('0x7a')](_0x384bb7,[_0xbc22('0x37'),_0xbc22('0x4b')]);_0x43fce5['field']=_0xbc22('0x4b');_0x15b980=as[_0xbc22('0x7c')](_0x5b8643,_0x17cf5a[_0xbc22('0x51')],_0x43fce5);_0x39feff[_0x4857eb](_0x15b980[_0xbc22('0x7d')],_0x15b980[_0xbc22('0x73')][_0xbc22('0x7e')],_0x15b980[_0xbc22('0x73')][_0xbc22('0x34')]);}break;case _0xbc22('0x39'):_0x15b980=as[_0xbc22('0x7c')]('me',null,_0x43fce5);_0x39feff[_0x4857eb](_0x15b980['text'],_0x15b980['value'][_0xbc22('0x7e')],_0x15b980[_0xbc22('0x73')][_0xbc22('0x34')]);break;}}else{var _0x15b980=as['buildExpression'](_0x5b8643,_0x17cf5a[_0xbc22('0x51')],_0x43fce5);_0x39feff[_0x4857eb](_0x15b980[_0xbc22('0x7d')],_0x15b980['value'][_0xbc22('0x7e')],_0x15b980[_0xbc22('0x73')][_0xbc22('0x34')]);}}}else{var _0x4f13e8=_(_0x14b80d[_0xbc22('0x54')])[_0xbc22('0x55')]()[_0xbc22('0x3e')](function(_0x1c7c20){return _[_0xbc22('0x83')](_0x384bb7,[_0xbc22('0x37'),_0x1c7c20])?_0x1c7c20:undefined;})[_0xbc22('0x84')]()[_0xbc22('0x73')]();if(!_[_0xbc22('0x85')](_0x4f13e8)){_0x4f13e8[_0xbc22('0x43')](function(_0x23ff5e){if(_0x23ff5e===_0xbc22('0x86')){_0x2da8be['where'](_0xbc22('0x87'),[][_0xbc22('0x88')](_0x14b80d['query'][_0x23ff5e]));}else if(_0x23ff5e===_0xbc22('0x89')){var _0x2e1f93=JSON[_0xbc22('0x8a')](_0x14b80d[_0xbc22('0x54')][_0x23ff5e])[_0xbc22('0x8b')];var _0x2c1623=JSON[_0xbc22('0x8a')](_0x14b80d[_0xbc22('0x54')][_0x23ff5e])['$lte'];_0x2da8be[_0xbc22('0x5c')](_0xbc22('0x8c'),_0x2e1f93,_0x2c1623);}else{if(_0x14b80d['query'][_0x23ff5e]===_0xbc22('0x8d')){_0x2da8be[_0xbc22('0x5c')]('i.'+_0x23ff5e+_0xbc22('0x8e'));}else{_0x2da8be[_0xbc22('0x5c')]('i.'+_0x23ff5e+_0xbc22('0x8f'),_0x14b80d[_0xbc22('0x54')][_0x23ff5e]);}}});}if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x90')]){if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x90')]==0x1){_0x2da8be[_0xbc22('0x74')](_0xbc22('0x91'));}else{_0x2da8be['having'](_0xbc22('0x92'));}}if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x93')]){_0x1749f1=_[_0xbc22('0x94')](_0x14b80d[_0xbc22('0x54')][_0xbc22('0x93')])?_0x14b80d[_0xbc22('0x54')]['tag']:new Array(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x93')]);_0x1749f1[_0xbc22('0x43')](function(_0x2c9c83){_0x55b176['or'](_0xbc22('0x95'),'%,'+_0x2c9c83+',%');});}if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x96')]){var _0xe527ab=_0x14b80d['query'][_0xbc22('0x96')][_0xbc22('0x97')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xbc22('0x98')](_0xe527ab)){_0x39feff['or'](_0xbc22('0x99'),_0xe527ab+'%');}else{_0x39feff['or'](_0xbc22('0x9a'),qs[_0xbc22('0x78')](_0xe527ab))['or'](_0xbc22('0x9b'),_0xe527ab+'%');}}}_0x2da8be[_0xbc22('0x5c')](_0x39feff);_0x2da8be['group'](_0xbc22('0x9c'));var _0xf56a4f={'type':db['Sequelize'][_0xbc22('0x9d')][_0xbc22('0x9e')],'raw':!![]};var _0x605a20=_0x2da8be[_0xbc22('0x9f')]();_0x605a20[_0xbc22('0x60')](_0xbc22('0x9c'));_0x605a20[_0xbc22('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbc22('0x72'));if(_0x553290[_0xbc22('0xa0')]){_0x553290['order'][_0xbc22('0x43')](function(_0x298edb){var _0x217f73=_0x298edb[0x0]==='contactName'?_0x298edb[0x0]:'i.'+_0x298edb[0x0];_0x2da8be[_0xbc22('0xa0')](_0x217f73,_0x298edb[0x1]===_0xbc22('0xa1')?![]:!![]);});}if(!_[_0xbc22('0x85')](_0x1749f1)){_0x2da8be[_0xbc22('0x74')](_0x55b176);_0x605a20[_0xbc22('0x5c')](_0xbc22('0xa2'),_0x1749f1);}BPromise[_0xbc22('0xa3')]()['then'](function(){if(!_0x2cd30c){if(_0x14b80d[_0xbc22('0x54')][_0xbc22('0x86')])return;_0x605a20[_0xbc22('0x5c')](_0xbc22('0xa4'));_0x2da8be['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x14b80d[_0xbc22('0xa5')][_0xbc22('0xa6')]!==_0xbc22('0xa7'))return;return _0x14b80d['user'][_0xbc22('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x46e40d){if(_[_0xbc22('0x85')](_0x46e40d)){_0x605a20[_0xbc22('0x5c')](_0xbc22('0xa9'));_0x2da8be['where'](_0xbc22('0xa9'));}else{_0x605a20[_0xbc22('0x5c')](_0xbc22('0x87'),_['map'](_0x46e40d,'id'));_0x2da8be['where']('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x46e40d,'id'));}});})['then'](function(){if(_0x14b80d[_0xbc22('0xa5')][_0xbc22('0xa6')]==='agent'&&!_0x2cd30c&&!_0x14b80d[_0xbc22('0x54')][_0xbc22('0x86')])return[];return db[_0xbc22('0xaa')][_0xbc22('0x54')](_0x605a20[_0xbc22('0xab')](),_0xf56a4f);})['then'](function(_0x1d8398){_0xd81a5['count']=_0x1d8398['length'];if(_0xd81a5['count']===0x0)return[];return db[_0xbc22('0xaa')][_0xbc22('0x54')](_0x4e5f74[_0xbc22('0xab')](),_0xf56a4f)[_0xbc22('0x1c')](function(_0x8abba0){_0x2ea03d=_[_0xbc22('0xac')](_0x8abba0,'id');_0xf56a4f=_['merge'](_0xf56a4f,{'model':db[_0xbc22('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14b80d['query'][_0xbc22('0x58')]){_0x553290['attributes']['forEach'](function(_0x426cc6){_0x2da8be['field']('i.'+_0x426cc6);});}else{_0x2da8be['field'](_0xbc22('0xad'),'unreadMessages');_0x2da8be[_0xbc22('0x60')](_0xbc22('0xae'),_0xbc22('0xaf'));_0x2da8be[_0xbc22('0x60')](_0xbc22('0xb0'),'Account.mandatoryDisposition');_0x2da8be[_0xbc22('0x60')](_0xbc22('0xb1'),_0xbc22('0xb2'));_0x2da8be[_0xbc22('0x60')](_0xbc22('0xb3'));_0x2da8be['field'](_0xbc22('0xb4'),_0xbc22('0xb5'));_0x2da8be['field'](_0xbc22('0xb6'),_0xbc22('0xb7'));_0x2da8be[_0xbc22('0x60')]('c.email',_0xbc22('0xb8'));_0x2da8be[_0xbc22('0x60')](_0xbc22('0xb9'),'Contact.phone');_0x2da8be[_0xbc22('0x60')](_0xbc22('0xba'),_0xbc22('0xbb'));_0x2da8be[_0xbc22('0x60')]('c.fax',_0xbc22('0xbc'));_0x2da8be[_0xbc22('0x60')](_0xbc22('0xbd'),'Owner.fullname');_0x2da8be[_0xbc22('0x60')](_0xbc22('0xbe'),_0xbc22('0xbf'));_0x2da8be['field'](_0xbc22('0xc0'),_0xbc22('0x40'));}if(_0x553290[_0xbc22('0x2d')])_0x2da8be[_0xbc22('0x2d')](_0x553290['limit']);if(_0x553290['offset'])_0x2da8be[_0xbc22('0x2a')](_0x553290[_0xbc22('0x2a')]);return db[_0xbc22('0xaa')]['query'](_0x2da8be['toString'](),_0xf56a4f);})[_0xbc22('0x1c')](function(_0x1cc606){if(_0x1cc606[_0xbc22('0x59')]>0x0)_0x2b79dd[_0xbc22('0x5c')]('ui.ChatInteractionId\x20IN\x20?',_[_0xbc22('0x3e')](_0x1cc606,'id'));return db[_0xbc22('0xaa')]['query'](_0x2b79dd[_0xbc22('0xab')](),_0xf56a4f)[_0xbc22('0x1c')](function(_0x4e5752){var _0x2e946d=_[_0xbc22('0xc1')](_0x4e5752,_0xbc22('0xc2'));var _0x3c91b3=[];_0x1cc606[_0xbc22('0x43')](function(_0x2e1592){_0x3c91b3['push'](updateChatInteraction(_0x2e1592,_0x2ea03d,_0x2e946d));});return BPromise['all'](_0x3c91b3);});});})['then'](function(_0x4a4be7){_0xd81a5['rows']=_0x4a4be7;return _0xd81a5;})[_0xbc22('0x1c')](respondWithFilteredResult(_0x1caab1,_0x553290))['catch'](handleError(_0x1caab1,null));};exports[_0xbc22('0xc3')]=function(_0x1ca974,_0x12c3a1){var _0x113ef6={'raw':![],'where':{'id':_0x1ca974[_0xbc22('0xc4')]['id']}},_0x4965e0={};_0x4965e0[_0xbc22('0x53')]=_[_0xbc22('0x55')](db['ChatInteraction'][_0xbc22('0x4f')]);_0x4965e0[_0xbc22('0x54')]=_['keys'](_0x1ca974[_0xbc22('0x54')]);_0x4965e0[_0xbc22('0x5d')]=_['intersection'](_0x4965e0[_0xbc22('0x53')],_0x4965e0[_0xbc22('0x54')]);_0x113ef6[_0xbc22('0x57')]=_[_0xbc22('0x56')](_0x4965e0['model'],qs['fields'](_0x1ca974['query'][_0xbc22('0x58')]));_0x113ef6[_0xbc22('0x57')]=_0x113ef6[_0xbc22('0x57')][_0xbc22('0x59')]?_0x113ef6[_0xbc22('0x57')]:_0x4965e0[_0xbc22('0x53')];if(_0x1ca974['query'][_0xbc22('0xc5')]){_0x113ef6[_0xbc22('0xc6')]=[{'all':!![]}];}_0x113ef6=_[_0xbc22('0xc7')]({},_0x113ef6,_0x1ca974[_0xbc22('0xc8')]);return db[_0xbc22('0x4e')][_0xbc22('0x7a')](_0x113ef6)['then'](handleEntityNotFound(_0x12c3a1,null))[_0xbc22('0x1c')](respondWithResult(_0x12c3a1,null))[_0xbc22('0x27')](handleError(_0x12c3a1,null));};exports[_0xbc22('0xc9')]=function(_0x345490,_0x13bc89){return db['ChatInteraction'][_0xbc22('0xc9')](_0x345490[_0xbc22('0x39')],{})[_0xbc22('0x1c')](respondWithResult(_0x13bc89,0xc9))[_0xbc22('0x27')](handleError(_0x13bc89,null));};exports['update']=function(_0x4ff77b,_0x58ea6e){if(_0x4ff77b[_0xbc22('0x39')]['id']){delete _0x4ff77b[_0xbc22('0x39')]['id'];}return db[_0xbc22('0x4e')]['find']({'where':{'id':_0x4ff77b['params']['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0x58ea6e,null))[_0xbc22('0x1c')](saveUpdates(_0x4ff77b[_0xbc22('0x39')],null))[_0xbc22('0x1c')](respondWithResult(_0x58ea6e,null))['catch'](handleError(_0x58ea6e,null));};exports[_0xbc22('0x33')]=function(_0x36793b,_0xc02b95){return db[_0xbc22('0x4e')][_0xbc22('0x7a')]({'where':{'id':_0x36793b[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0xc02b95,null))[_0xbc22('0x1c')](removeEntity(_0xc02b95,null))['catch'](handleError(_0xc02b95,null));};exports[_0xbc22('0xca')]=function(_0x5ebe68,_0x153d87){return db[_0xbc22('0x4e')][_0xbc22('0xca')]()[_0xbc22('0x1c')](respondWithResult(_0x153d87,null))[_0xbc22('0x27')](handleError(_0x153d87,null));};exports[_0xbc22('0xcb')]=function(_0x424ff7,_0x13b747){var _0x26f0b0=_0x424ff7['params']['id'];var _0x344461;var _0x448e19;var _0x1b0395;return db[_0xbc22('0x4e')][_0xbc22('0xcc')]({'where':{'id':_0x26f0b0}})['then'](function(_0x111816){_0x344461=_0x111816;return db[_0xbc22('0xcd')][_0xbc22('0xcc')]({'where':{'id':_0x111816['ChatWebsiteId']},'attributes':['id',_0xbc22('0xce'),_0xbc22('0xcf'),_0xbc22('0xd0'),'vidaooNote',_0xbc22('0xd1')],'raw':!![]});})[_0xbc22('0x1c')](function(_0x59efe4){if(_0x59efe4&&_0x59efe4[_0xbc22('0xce')]&&_0x59efe4[_0xbc22('0xcf')]){_0x448e19=_0x59efe4;var _0x750385={'interaction':{'id':_0x26f0b0},'agent':{'id':_0x424ff7[_0xbc22('0xa5')]['id'],'name':_0x424ff7[_0xbc22('0xa5')][_0xbc22('0x37')],'fullname':_0x424ff7['user'][_0xbc22('0x3f')],'email':_0x424ff7[_0xbc22('0xa5')][_0xbc22('0xd2')]},'contact':_0x424ff7[_0xbc22('0x39')]['contact'],'account':_0x424ff7[_0xbc22('0x39')][_0xbc22('0x3c')]};var _0x886f7d={'rejectUnauthorized':![],'method':_0xbc22('0xd3'),'url':_0xbc22('0xd4'),'headers':{'X-APIKEY':_0x59efe4[_0xbc22('0xce')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x424ff7['user'][_0xbc22('0xd2')]],'buttons':null,'topic':_0x448e19[_0xbc22('0xd0')],'note':_[_0xbc22('0xd5')](_0x448e19[_0xbc22('0xd6')])?null:getMustacheRender(_0x448e19[_0xbc22('0xd6')],_0x750385),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xbc22('0xd5')](_0x448e19[_0xbc22('0xd1')])){var _0x23ae7d=getMustacheRender(_0x448e19[_0xbc22('0xd1')],_0x750385);var _0x59f570=JSON['parse'](_0x23ae7d);_0x886f7d[_0xbc22('0x39')]['metadata']=_0x59f570;}}catch(_0x25f1b9){throw new db['Sequelize'][(_0xbc22('0xd7'))](_0xbc22('0xd8'));}return rp(_0x886f7d);}else{throw new db[(_0xbc22('0xd9'))][(_0xbc22('0xd7'))](_0xbc22('0xda'));}})['then'](function(_0x237198){_0x1b0395=_0x237198;if(_0x1b0395['id']){var _0x4039ce={'body':_0x1b0395['join_url'],'ChatWebsiteId':_0x448e19['id'],'ChatInteractionId':_0x344461['id'],'direction':_0xbc22('0xdb'),'UserId':_0x424ff7[_0xbc22('0xa5')]['id']};return db[_0xbc22('0xdc')][_0xbc22('0xc9')](_0x4039ce,{});}else{throw new db[(_0xbc22('0xd9'))]['ValidationError'](_0xbc22('0xdd'));}})[_0xbc22('0x1c')](function(){return _0x344461['updateAttributes']({'vidaooSessionId':_0x1b0395['id']});})[_0xbc22('0x1c')](respondWithResult(_0x13b747,null))[_0xbc22('0x27')](handleError(_0x13b747,null));};exports[_0xbc22('0xde')]=function(_0x5bce00,_0x25a17d){if(_0x5bce00[_0xbc22('0x39')]['id']){delete _0x5bce00['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5bce00[_0xbc22('0xc4')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x25a17d,null))[_0xbc22('0x1c')](saveUpdates(_0x5bce00[_0xbc22('0x39')],null))[_0xbc22('0x1c')](respondWithResult(_0x25a17d,null))[_0xbc22('0x27')](handleError(_0x25a17d,null));};exports[_0xbc22('0xdf')]=function(_0x1df06a,_0x475494,_0x14856f){if(_0x1df06a[_0xbc22('0x39')]['id']){delete _0x1df06a[_0xbc22('0x39')]['id'];}return db[_0xbc22('0x4e')][_0xbc22('0x7a')]({'where':{'id':_0x1df06a[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](function(_0x5c94c2){if(!_0x5c94c2){logger[_0xbc22('0x23')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xbc22('0xdf'),0x194,_0xbc22('0xe0'));_0x475494[_0xbc22('0x35')](0x194);}else{if(_0x5c94c2['UserId']){throw new db['Sequelize'][(_0xbc22('0xd7'))](_0xbc22('0xe1'));}}return _0x5c94c2;})[_0xbc22('0x1c')](function(_0x427b72){if(_0x427b72){return _0x427b72[_0xbc22('0x32')]({'closed':_0x1df06a['body'][_0xbc22('0x4a')],'disposition':_0x1df06a[_0xbc22('0x39')][_0xbc22('0x4c')]})[_0xbc22('0x1c')](function(_0x3e853e){return _0x3e853e;});}})[_0xbc22('0x1c')](function(_0x537934){return respondWithRpcPromise('AbandonInteraction','abandon',_0x1df06a[_0xbc22('0x39')],client9004);})[_0xbc22('0x1c')](respondWithResult(_0x475494,null))[_0xbc22('0x27')](handleError(_0x475494,null));};exports[_0xbc22('0xe2')]=function(_0x5cc8b6,_0x15e9dd,_0x35ad2f){_0x5cc8b6[_0xbc22('0x39')]['name']=_0x5cc8b6[_0xbc22('0xe3')]['originalname'];_0x5cc8b6[_0xbc22('0x39')]['basename']=_0x5cc8b6[_0xbc22('0xe3')][_0xbc22('0xe4')];_0x5cc8b6['body'][_0xbc22('0x51')]=_0x5cc8b6[_0xbc22('0xe3')][_0xbc22('0xe5')];return db[_0xbc22('0xe6')][_0xbc22('0xc9')](_0x5cc8b6[_0xbc22('0x39')])[_0xbc22('0x1c')](respondWithResult(_0x15e9dd,0xc9))[_0xbc22('0x27')](handleError(_0x15e9dd,null));};exports[_0xbc22('0xe7')]=function(_0x2fc954,_0x3ac4b9,_0x27f355){return db[_0xbc22('0x4e')][_0xbc22('0xcc')]({'where':{'id':_0x2fc954[_0xbc22('0xc4')]['id']},'raw':!![]})[_0xbc22('0x1c')](handleEntityNotFound(_0x3ac4b9,null))[_0xbc22('0x1c')](function(_0x56d95d){if(_0x56d95d){if(_0x56d95d[_0xbc22('0x4a')]){return _0x3ac4b9[_0xbc22('0x28')](0x193)[_0xbc22('0x29')]({'status':0x193,'message':_0xbc22('0xe8')});}return db[_0xbc22('0xe6')][_0xbc22('0xcc')]({'where':{'id':_0x2fc954[_0xbc22('0x54')][_0xbc22('0xe9')]},'raw':!![]})[_0xbc22('0x1c')](handleEntityNotFound(_0x3ac4b9,null));}})[_0xbc22('0x1c')](function(_0x2e0767){if(_0x2e0767){var _0x422b6b=_0x2e0767['ChatOfflineMessageId']!==null;var _0x4e6a9a=path[_0xbc22('0xea')](config[_0xbc22('0xeb')],'server/files/attachments/');if(_0x422b6b){_0x4e6a9a=path[_0xbc22('0xea')](_0x4e6a9a,_0xbc22('0xec'));}var _0x20a42c=path[_0xbc22('0xea')](_0x4e6a9a,_0x2e0767[_0xbc22('0xed')]);return _0x3ac4b9['download'](_0x20a42c);}})[_0xbc22('0x27')](handleError(_0x3ac4b9,null));};exports[_0xbc22('0xee')]=function(_0x7aa0de,_0x5b2209){var _0x5cb61d=null;var _0x58e0a9=null;var _0x586d52=null;var _0xde20d7=null;if(_0x7aa0de[_0xbc22('0x39')]['id']){delete _0x7aa0de['body']['id'];}if(_0x7aa0de[_0xbc22('0x39')][_0xbc22('0xef')]){_0xde20d7=path[_0xbc22('0xea')](config[_0xbc22('0xeb')],_0xbc22('0xf0'),util['format']('transcript-%s.txt',Date['now']()));_0x7aa0de[_0xbc22('0x39')][_0xbc22('0xf1')]=_0xde20d7;}return db[_0xbc22('0x4e')][_0xbc22('0x7a')]({'where':{'id':_0x7aa0de[_0xbc22('0xc4')]['id']},'include':[{'model':db[_0xbc22('0xdc')],'as':_0xbc22('0xf2'),'include':[{'model':db['User'],'as':_0xbc22('0xf3')}]}]})['then'](handleEntityNotFound(_0x5b2209,null))[_0xbc22('0x1c')](saveUpdates(_0x7aa0de[_0xbc22('0x39')],null))[_0xbc22('0x1c')](function(_0x5b2b06){if(_0x5b2b06){_0x5cb61d=_0x5b2b06;return db[_0xbc22('0xcd')][_0xbc22('0x7a')]({'where':{'id':_0x5cb61d[_0xbc22('0x86')]}});}})[_0xbc22('0x1c')](function(_0x3bd1e8){if(_0x3bd1e8){_0x586d52=_0x3bd1e8;return db[_0xbc22('0xf4')][_0xbc22('0x7a')]({'where':{'id':_0x5cb61d[_0xbc22('0x7b')]}});}})['then'](function(_0x3eecd4){if(_0x3eecd4){_0x58e0a9=_0x3eecd4;if(_0xde20d7){var _0x2da35a=null;for(var _0x65e471=0x1;_0x65e471<_0x5cb61d[_0xbc22('0xf2')][_0xbc22('0x59')];++_0x65e471){_0x2da35a=_0x5cb61d['Messages'][_0x65e471];var _0x1b11e8=_0x2da35a[_0xbc22('0x4b')]?util[_0xbc22('0xf5')](_0xbc22('0xf6'),_0x586d52[_0xbc22('0xf7')],_0x2da35a[_0xbc22('0x4b')]):_0xbc22('0xf8');var _0x4a6e85=_0x7aa0de[_0xbc22('0x39')]['customer']||util['format'](_0xbc22('0xf6'),_0xbc22('0xf9'),_0x2da35a[_0xbc22('0x7b')]);switch(_0x586d52[_0xbc22('0xfa')]){case'website_alias':_0x1b11e8=_0x2da35a[_0xbc22('0x4b')]?util[_0xbc22('0xf5')]('%s%d',_0x586d52[_0xbc22('0xf7')],_0x2da35a[_0xbc22('0x4b')]):'System';break;case _0xbc22('0xfb'):_0x1b11e8=_0x2da35a[_0xbc22('0x4b')]?_0x2da35a['User'][_0xbc22('0xfc')]||_0x2da35a[_0xbc22('0xf3')][_0xbc22('0x3f')]:_0xbc22('0xf8');break;case _0xbc22('0xfd'):_0x1b11e8=_0x2da35a[_0xbc22('0x4b')]?_0x2da35a[_0xbc22('0xf3')][_0xbc22('0x3f')]:_0xbc22('0xf8');break;default:_0x1b11e8=_0x2da35a['UserId']?util[_0xbc22('0xf5')](_0xbc22('0xf6'),_0x586d52[_0xbc22('0xf7')],_0x2da35a['UserId']):_0xbc22('0xf8');}var _0x588a54=util['format'](_0xbc22('0xfe'),moment(_0x2da35a[_0xbc22('0x89')])[_0xbc22('0xf5')](_0xbc22('0xff')),_0x2da35a[_0xbc22('0x100')]==='in'?_0x4a6e85:_0x1b11e8,_0x2da35a[_0xbc22('0x39')]);if(!_0x2da35a[_0xbc22('0x101')]){fs[_0xbc22('0x102')](_0xde20d7,_0x588a54);}}return db[_0xbc22('0x103')][_0xbc22('0xcc')]({'where':{'service':!![]},'include':[{'model':db[_0xbc22('0x104')],'as':_0xbc22('0x105'),'raw':!![]}]});}}})['then'](function(_0x4a2ae3){if(_0x4a2ae3&&_0x4a2ae3['Smtp']&&_0x7aa0de['body']){var _0x524246={'tls':{'rejectUnauthorized':![]}};if(_0x4a2ae3[_0xbc22('0x105')]['service']){_0x524246[_0xbc22('0x106')]=_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x106')];}else{_0x524246['host']=_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x107')];_0x524246[_0xbc22('0x108')]=_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x108')];_0x524246['secure']=_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x109')];}if(_0x4a2ae3[_0xbc22('0x105')][_0xbc22('0x10a')]){_0x524246[_0xbc22('0x10b')]={'user':_0x4a2ae3[_0xbc22('0x105')]['user'],'pass':_0x4a2ae3['Smtp'][_0xbc22('0x10c')]};}return respondWithRpcPromise('SendMail',_0xbc22('0x10d'),{'account':_0x524246,'message':{'from':util[_0xbc22('0xf5')](_0xbc22('0x10e'),_0x4a2ae3[_0xbc22('0x37')],_0x4a2ae3[_0xbc22('0xd2')]||_0x4a2ae3['Smtp']['user']),'to':_0x7aa0de[_0xbc22('0x39')][_0xbc22('0xef')],'subject':'Mail\x20Transcript','text':util[_0xbc22('0xf5')](_0xbc22('0x10f'),_0x7aa0de[_0xbc22('0x39')][_0xbc22('0xef')]),'attachments':[{'path':_0xde20d7}]}})[_0xbc22('0x1c')](function(){return _0x5cb61d;})['catch'](function(_0x30f855){console[_0xbc22('0x23')](_0x30f855);});}else{return _0x5cb61d;}})[_0xbc22('0x1c')](respondWithStatusCode(_0x5b2209,0xc8))[_0xbc22('0x27')](handleError(_0x5b2209,null));};exports[_0xbc22('0x110')]=function(_0x5a960b,_0x30b45a,_0x16e38c){return db[_0xbc22('0xdc')][_0xbc22('0x7a')]({'where':{'id':_0x5a960b['params']['id']}})['then'](handleEntityNotFound(_0x30b45a,null))['then'](function(_0x47c616){if(_0x47c616){return _0x47c616[_0xbc22('0x110')](_0x5a960b[_0xbc22('0x39')][_0xbc22('0x111')],_[_0xbc22('0x112')](_0x5a960b[_0xbc22('0x39')],[_0xbc22('0x111'),'id'])||{});}})[_0xbc22('0x1c')](respondWithResult(_0x30b45a,null))[_0xbc22('0x27')](handleError(_0x30b45a,null));};exports[_0xbc22('0x113')]=function(_0x5cf3c9,_0xdae268,_0x5aa775){var _0x5cb1bf={'raw':![],'where':{}};var _0x390785={};var _0x30b796={'count':0x0,'rows':[]};return db[_0xbc22('0x4e')][_0xbc22('0xcc')]({'where':{'id':_0x5cf3c9[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0xdae268,null))[_0xbc22('0x1c')](function(_0xd8ffaa){if(_0xd8ffaa){_0x390785['model']=_[_0xbc22('0x55')](db[_0xbc22('0xdc')]['rawAttributes']);_0x390785[_0xbc22('0x54')]=_[_0xbc22('0x55')](_0x5cf3c9[_0xbc22('0x54')]);_0x390785[_0xbc22('0x5d')]=_[_0xbc22('0x56')](_0x390785[_0xbc22('0x53')],_0x390785['query']);_0x5cb1bf[_0xbc22('0x57')]=_[_0xbc22('0x56')](_0x390785['model'],qs[_0xbc22('0x58')](_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x58')]));_0x5cb1bf['attributes']=_0x5cb1bf[_0xbc22('0x57')][_0xbc22('0x59')]?_0x5cb1bf[_0xbc22('0x57')]:_0x390785[_0xbc22('0x53')];if(!_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x5a')](_0xbc22('0x114'))){_0x5cb1bf[_0xbc22('0x2d')]=qs[_0xbc22('0x2d')](_0x5cf3c9['query']['limit']);_0x5cb1bf[_0xbc22('0x2a')]=qs[_0xbc22('0x2a')](_0x5cf3c9[_0xbc22('0x54')]['offset']);}_0x5cb1bf['order']=qs['sort'](_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x5b')]);_0x5cb1bf['where']=qs[_0xbc22('0x5d')](_['pick'](_0x5cf3c9[_0xbc22('0x54')],_0x390785[_0xbc22('0x5d')]));_0x5cb1bf['where']['ChatInteractionId']=_0xd8ffaa['id'];if(_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x96')]){_0x5cb1bf['where']=_[_0xbc22('0xc7')](_0x5cb1bf['where'],{'$or':_[_0xbc22('0x3e')](_0x5cb1bf[_0xbc22('0x57')],function(_0x5885ed){var _0x21a262={};_0x21a262[_0x5885ed]={'$like':'%'+_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x96')]+'%'};return _0x21a262;})});}if(_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x8b')]){var _0x3ee325=_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0x8b')][_0xbc22('0x42')](',');var _0x5bb211={};_0x5bb211[_0x3ee325[0x0]]={'$gte':moment(_0x3ee325[0x1])[_0xbc22('0xf5')](_0xbc22('0x115'))};_0x5cb1bf[_0xbc22('0x5c')]=_[_0xbc22('0xc7')](_0x5cb1bf[_0xbc22('0x5c')],_0x5bb211);}_0x5cb1bf=_[_0xbc22('0xc7')]({},_0x5cb1bf,_0x5cf3c9['options']);return db[_0xbc22('0xdc')][_0xbc22('0x2c')]({'where':_0x5cb1bf['where']})[_0xbc22('0x1c')](function(_0x541f35){_0x30b796[_0xbc22('0x2c')]=_0x541f35;if(_0x5cf3c9[_0xbc22('0x54')][_0xbc22('0xc5')]){_0x5cb1bf[_0xbc22('0xc6')]=[{'all':!![]}];}return db['ChatMessage'][_0xbc22('0x116')](_0x5cb1bf);})[_0xbc22('0x1c')](function(_0x3a53ce){_0x30b796[_0xbc22('0x117')]=_0x3a53ce;return _0x30b796;});}})[_0xbc22('0x1c')](respondWithFilteredResult(_0xdae268,_0x5cb1bf))[_0xbc22('0x27')](handleError(_0xdae268,null));};exports[_0xbc22('0x118')]=function(_0x490eab,_0x5e5485,_0x254dfc){var _0xa3e070={'where':{}},_0x5ad37c={},_0x169e75={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbc22('0xcc')]({'where':{'id':_0x490eab['params']['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0x5e5485,null))[_0xbc22('0x1c')](function(_0x37bf80){if(_0x37bf80){_0x5ad37c[_0xbc22('0x53')]=_[_0xbc22('0x55')](db['ChatMessage']['rawAttributes']);_0x5ad37c[_0xbc22('0x54')]=_[_0xbc22('0x55')](_0x490eab[_0xbc22('0x54')]);_0x5ad37c[_0xbc22('0x5d')]=_['intersection'](_0x5ad37c['model'],_0x5ad37c[_0xbc22('0x54')]);_0xa3e070[_0xbc22('0x57')]=_[_0xbc22('0x56')](_0x5ad37c[_0xbc22('0x53')],qs['fields'](_0x490eab[_0xbc22('0x54')]['fields']));_0xa3e070['attributes']=_0xa3e070[_0xbc22('0x57')][_0xbc22('0x59')]?_0xa3e070[_0xbc22('0x57')]:_0x5ad37c['model'];if(!_0x490eab['query'][_0xbc22('0x5a')](_0xbc22('0x114'))){_0xa3e070['limit']=qs[_0xbc22('0x2d')](_0x490eab[_0xbc22('0x54')][_0xbc22('0x2d')]);_0xa3e070[_0xbc22('0x2a')]=qs[_0xbc22('0x2a')](_0x490eab[_0xbc22('0x54')][_0xbc22('0x2a')]);}_0xa3e070[_0xbc22('0xa0')]=qs[_0xbc22('0x5b')](_0x490eab[_0xbc22('0x54')][_0xbc22('0x5b')]);_0xa3e070['where']=qs[_0xbc22('0x5d')](_[_0xbc22('0x5e')](_0x490eab[_0xbc22('0x54')],_0x5ad37c[_0xbc22('0x5d')]));_0xa3e070[_0xbc22('0x5c')][_0xbc22('0xc2')]=_0x37bf80['id'];if(_0x490eab[_0xbc22('0x54')][_0xbc22('0x96')]){_0xa3e070[_0xbc22('0x5c')]=_['merge'](_0xa3e070['where'],{'$or':_[_0xbc22('0x3e')](_0xa3e070['attributes'],function(_0x504430){var _0x18f444={};_0x18f444[_0x504430]={'$like':'%'+_0x490eab[_0xbc22('0x54')][_0xbc22('0x96')]+'%'};return _0x18f444;})});}_0xa3e070['where']['secret']=![];if(_0x490eab[_0xbc22('0x54')]['id']){_0xa3e070[_0xbc22('0x5c')]['id']={'$gt':_0x490eab['query']['id']};}_0xa3e070=_[_0xbc22('0xc7')]({},_0xa3e070,_0x490eab[_0xbc22('0xc8')]);return db[_0xbc22('0xdc')]['count']({'where':_0xa3e070[_0xbc22('0x5c')]})[_0xbc22('0x1c')](function(_0x5d4b4f){_0x169e75[_0xbc22('0x2c')]=_0x5d4b4f;_0xa3e070[_0xbc22('0xc6')]=[];if(_0x490eab[_0xbc22('0x54')][_0xbc22('0x119')]){_0xa3e070['include'][_0xbc22('0x44')]({'model':db[_0xbc22('0xf3')],'as':_0xbc22('0xf3'),'attributes':['id',_0xbc22('0x3f'),_0xbc22('0xfc')]});}if(_0x490eab[_0xbc22('0x54')][_0xbc22('0xc5')]){_0xa3e070[_0xbc22('0xc6')]=[{'all':!![]}];}return db['ChatMessage'][_0xbc22('0x116')](_0xa3e070);})[_0xbc22('0x1c')](function(_0x411450){_0x169e75['rows']=_0x411450;return _0x169e75;});}})[_0xbc22('0x1c')](respondWithFilteredResult(_0x5e5485,_0xa3e070))['catch'](handleError(_0x5e5485,null));};exports[_0xbc22('0x11a')]=function(_0x1dca17,_0x2d6b1c,_0x43ad71){return db[_0xbc22('0x4e')]['find']({'where':{'id':_0x1dca17[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0x2d6b1c,null))[_0xbc22('0x1c')](function(_0x482629){if(_0x482629){return _0x482629[_0xbc22('0x11b')](_0x1dca17[_0xbc22('0x39')]['ids'],_[_0xbc22('0x112')](_0x1dca17[_0xbc22('0x39')],[_0xbc22('0x111'),'id'])||{})[_0xbc22('0x11c')](function(){return db[_0xbc22('0x7f')][_0xbc22('0x116')]({'attributes':['id','name',_0xbc22('0x61')],'where':{'id':_0x1dca17[_0xbc22('0x39')][_0xbc22('0x111')]}});})['then'](function(_0x4116c3){socket['emit'](_0xbc22('0x11d'),{'id':Number(_0x1dca17['params']['id']),'tags':_0x4116c3||[]});return{'id':Number(_0x1dca17[_0xbc22('0xc4')]['id']),'tags':_0x4116c3||[]};});}})[_0xbc22('0x1c')](respondWithResult(_0x2d6b1c,null))['catch'](handleError(_0x2d6b1c,null));};exports[_0xbc22('0x11e')]=function(_0x4f3ca9,_0x5493f0,_0x43fc04){return db[_0xbc22('0x4e')][_0xbc22('0x7a')]({'where':{'id':_0x4f3ca9[_0xbc22('0xc4')]['id']}})[_0xbc22('0x1c')](handleEntityNotFound(_0x5493f0,null))['then'](function(_0x1006cf){if(_0x1006cf){return _0x1006cf[_0xbc22('0x11e')](_0x4f3ca9[_0xbc22('0x54')][_0xbc22('0x111')]);}})[_0xbc22('0x1c')](respondWithStatusCode(_0x5493f0,null))[_0xbc22('0x27')](handleError(_0x5493f0,null));};exports[_0xbc22('0x11f')]=function(_0x3444d5,_0x2719a9){var _0xfdb23f=moment()[_0xbc22('0x120')]()[_0xbc22('0xab')]();var _0x4ac701=path[_0xbc22('0xea')](config[_0xbc22('0xeb')],'server','files',_0xbc22('0x121'));var _0x2aa91a=path[_0xbc22('0xea')](config[_0xbc22('0xeb')],_0xbc22('0x122'),_0xbc22('0x123'),_0xbc22('0x124'));var _0x4d2f0b=path[_0xbc22('0xea')](_0x4ac701,_0xfdb23f);var _0xeb7d63=util['format']('transcript-%d-%s.zip',_0x3444d5[_0xbc22('0xc4')]['id'],_0xfdb23f);var _0xe70e8c=path[_0xbc22('0xea')](_0x4ac701,_0xeb7d63);var _0x240f63=[];_0x240f63['push']({'model':db[_0xbc22('0xf3')],'as':'User','attributes':['id',_0xbc22('0x3f')],'raw':!![]});_0x240f63[_0xbc22('0x44')]({'model':db[_0xbc22('0xf4')],'as':'Contact','attributes':['id',_0xbc22('0x125'),_0xbc22('0x126')],'raw':!![]});if(_0x3444d5[_0xbc22('0x54')][_0xbc22('0x124')]){_0x240f63['push']({'model':db['Attachment'],'as':_0xbc22('0xe6'),'raw':!![]});}var _0x9f561d=[{'model':db[_0xbc22('0xdc')],'as':_0xbc22('0xf2'),'attributes':['id','body',_0xbc22('0x89'),'direction','secret','read'],'include':_0x240f63}];_0x9f561d[_0xbc22('0x44')]({'model':db[_0xbc22('0xcd')],'as':'Account','attributes':['id',_0xbc22('0x37')]});_0x9f561d['push']({'model':db[_0xbc22('0xf3')],'as':_0xbc22('0x127'),'attributes':['id',_0xbc22('0x3f')]});return db['ChatInteraction'][_0xbc22('0x7a')]({'where':{'id':_0x3444d5[_0xbc22('0xc4')]['id']},'include':_0x9f561d})['then'](handleEntityNotFound(_0x2719a9,null))[_0xbc22('0x1c')](function(_0x553a28){if(_0x553a28){var _0x30bb85=_0x553a28[_0xbc22('0x128')]({'plain':!![]});fs[_0xbc22('0x129')](_0x4d2f0b);var _0x50c287={'channel':_0xbc22('0x12a'),'account':_0x30bb85[_0xbc22('0x12b')][_0xbc22('0x37')],'agent':_0x30bb85['Owner']?_0x30bb85['Owner']['fullname']:_0xbc22('0x12c'),'createdAt':moment(_0x30bb85[_0xbc22('0x89')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x30bb85['closed']?moment(_0x30bb85[_0xbc22('0x12d')])[_0xbc22('0xf5')](_0xbc22('0x115'))[_0xbc22('0xab')]():'','disposition':_0x30bb85[_0xbc22('0x4c')],'chatInfo':{'browser':_0x30bb85[_0xbc22('0x12e')],'os':_0x30bb85['osName'],'referer':_0x30bb85[_0xbc22('0x12f')],'customerIp':_0x30bb85[_0xbc22('0x130')],'customerPort':_0x30bb85[_0xbc22('0x131')]?_0x30bb85[_0xbc22('0x131')]:'N.A.'},'messages':_(_0x30bb85[_0xbc22('0xf2')])['tail']()[_0xbc22('0x96')]({'secret':![]})[_0xbc22('0x3e')](function(_0x26d36e){if(_0x26d36e['Attachment']){var _0x562959=path[_0xbc22('0xea')](_0x2aa91a,_0x26d36e[_0xbc22('0xe6')]['basename']);if(fs[_0xbc22('0x132')](_0x562959)){fs[_0xbc22('0x133')](_0x562959)[_0xbc22('0x134')](fs['createWriteStream'](path['join'](_0x4d2f0b,_0x26d36e['Attachment'][_0xbc22('0xed')])));}}return{'date':moment(_0x26d36e['createdAt'])[_0xbc22('0xf5')](_0xbc22('0x115'))[_0xbc22('0xab')](),'sender':_0x26d36e[_0xbc22('0x100')]===_0xbc22('0xdb')?_0x26d36e['User']?_0x26d36e[_0xbc22('0xf3')][_0xbc22('0x3f')]:'System':_0x26d36e[_0xbc22('0x76')][_0xbc22('0x125')]+(_0x26d36e[_0xbc22('0x76')][_0xbc22('0x126')]?'\x20'+_0x26d36e['Contact'][_0xbc22('0x126')]:''),'body':_0x26d36e[_0xbc22('0xe6')]?_0x26d36e[_0xbc22('0xe6')][_0xbc22('0xed')]:_0x26d36e[_0xbc22('0x39')],'direction':_0x26d36e['direction']===_0xbc22('0xdb')?'A':'C','secret':_0x26d36e[_0xbc22('0x101')],'read':_0x26d36e[_0xbc22('0x90')],'attachment':_0x26d36e['Attachment']};})[_0xbc22('0x73')]()};return ejs[_0xbc22('0x135')](path['join'](config[_0xbc22('0xeb')],_0xbc22('0x122'),'views',_0xbc22('0x136')),{'interaction':_0x50c287})[_0xbc22('0x1c')](function(_0x45c2cf){var _0x26c77c=path['join'](_0x4d2f0b,_0xbc22('0x137')+_0x30bb85['id']+'-'+_0xfdb23f+_0xbc22('0x138'));var _0xf276ba={'path':_0x26c77c,'channel':_0xbc22('0x12a'),'interactionId':_0x30bb85['id']};return pdf[_0xbc22('0x139')](_0x45c2cf,_0xf276ba);})[_0xbc22('0x1c')](function(){return new BPromise(function(_0x227fd4,_0x5c8992){zipdir(_0x4d2f0b,{'saveTo':_0xe70e8c},function(_0x49574b,_0x220d75){if(_0x49574b)return _0x5c8992(_0x49574b);return _0x227fd4(_0x220d75);});})['then'](function(){return new BPromise(function(_0x5951cc,_0x42c4a8){rimraf(_0x4d2f0b,function(_0x4a2007){if(_0x4a2007)_0x42c4a8(_0x4a2007);return _0x5951cc();});});})[_0xbc22('0x1c')](function(){return _0x2719a9['download'](_0xe70e8c,_0xeb7d63,function(_0xe592f8){if(_0xe592f8){console[_0xbc22('0x13a')](_0xbc22('0x13b'),_0xe592f8);}else{fs['unlinkSync'](_0xe70e8c);}});});});}else{return _0x2719a9['sendStatus'](0xc8);}})[_0xbc22('0x27')](handleError(_0x2719a9,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 737d217..db62e93 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 _0xe6f0=['setMaxListeners','save','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6f0,0x1a5));var _0x0e6f=function(_0x3fec1f,_0x563512){_0x3fec1f=_0x3fec1f-0x0;var _0x5cb79b=_0xe6f0[_0x3fec1f];return _0x5cb79b;};'use strict';var EventEmitter=require(_0x0e6f('0x0'));var ChatInteraction=require(_0x0e6f('0x1'))['db'][_0x0e6f('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x0e6f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0e6f('0x4')](0x0);var events={'afterCreate':_0x0e6f('0x5'),'afterUpdate':'update','afterDestroy':_0x0e6f('0x6')};function emitEvent(_0x3a6e7c){return function(_0x3b60b4,_0x54a845,_0x29197d){_0x3b60b4['getUsers']({'attributes':['id'],'raw':!![]})[_0x0e6f('0x7')](function(_0x4271be){_0x3b60b4[_0x0e6f('0x8')]('Users',_0x4271be[_0x0e6f('0x9')](function(_0x57ac2b){return{'id':_0x57ac2b['id']};}));return ChatMessage[_0x0e6f('0xa')]({'where':{'ChatInteractionId':_0x3b60b4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0e6f('0x7')](function(_0x238ad9){_0x3b60b4[_0x0e6f('0x8')](_0x0e6f('0xb'),_0x238ad9[_0x0e6f('0xc')]);ChatInteractionEvents[_0x0e6f('0xd')](_0x3a6e7c+':'+_0x3b60b4['id'],_0x3b60b4);ChatInteractionEvents['emit'](_0x3a6e7c,_0x3b60b4);_0x29197d(null);})[_0x0e6f('0xe')](_0x29197d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x0e6f('0xf')](e,emitEvent(event));}}module[_0x0e6f('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xb6ae=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events'];(function(_0x19b5d5,_0x154edf){var _0x3e1ef3=function(_0x3744de){while(--_0x3744de){_0x19b5d5['push'](_0x19b5d5['shift']());}};_0x3e1ef3(++_0x154edf);}(_0xb6ae,0x7d));var _0xeb6a=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0xb6ae[_0x124f88];return _0xed0e3b;};'use strict';var EventEmitter=require(_0xeb6a('0x0'));var ChatInteraction=require(_0xeb6a('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xeb6a('0x1'))['db'][_0xeb6a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xeb6a('0x3')](0x0);var events={'afterCreate':_0xeb6a('0x4'),'afterUpdate':_0xeb6a('0x5'),'afterDestroy':_0xeb6a('0x6')};function emitEvent(_0x29a21d){return function(_0x599021,_0x41c1ff,_0x2e55ca){_0x599021['getUsers']({'attributes':['id'],'raw':!![]})[_0xeb6a('0x7')](function(_0x69ba04){_0x599021[_0xeb6a('0x8')](_0xeb6a('0x9'),_0x69ba04[_0xeb6a('0xa')](function(_0x4b24c3){return{'id':_0x4b24c3['id']};}));return ChatMessage[_0xeb6a('0xb')]({'where':{'ChatInteractionId':_0x599021['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x24d8d5){_0x599021[_0xeb6a('0x8')](_0xeb6a('0xc'),_0x24d8d5[_0xeb6a('0xd')]);ChatInteractionEvents[_0xeb6a('0xe')](_0x29a21d+':'+_0x599021['id'],_0x599021);ChatInteractionEvents[_0xeb6a('0xe')](_0x29a21d,_0x599021);_0x2e55ca(null);})['catch'](_0x2e55ca(null));};}for(var e in events){if(events[_0xeb6a('0xf')](e)){var event=events[e];ChatInteraction[_0xeb6a('0x10')](e,emitEvent(event));}}module[_0xeb6a('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 8aebf4e..b09b3a6 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 _0x692c=['api','moment','bluebird','request-promise','rimraf','define','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger'];(function(_0x533b87,_0x591790){var _0xf39d05=function(_0x3a5f60){while(--_0x3a5f60){_0x533b87['push'](_0x533b87['shift']());}};_0xf39d05(++_0x591790);}(_0x692c,0x84));var _0xc692=function(_0x698254,_0x487811){_0x698254=_0x698254-0x0;var _0x1736c6=_0x692c[_0x698254];return _0x1736c6;};'use strict';var _=require(_0xc692('0x0'));var util=require(_0xc692('0x1'));var logger=require(_0xc692('0x2'))(_0xc692('0x3'));var moment=require(_0xc692('0x4'));var BPromise=require(_0xc692('0x5'));var rp=require(_0xc692('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc692('0x7'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x4c837a,_0x400fbd){return _0x4c837a[_0xc692('0x8')]('ChatInteraction',attributes,{'tableName':_0xc692('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc93261,_0x4c01c4,_0x598332){if(_0xc93261[_0xc692('0xa')](_0xc692('0xb'))){_0xc93261[_0xc692('0xc')]=moment()['format'](_0xc692('0xd'));}_0x598332(null,_0xc93261);}},'charset':_0xc692('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe612=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xe612,0xe3));var _0x2e61=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe612[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e61('0x0'))(_0x2e61('0x1'));var moment=require(_0x2e61('0x2'));var BPromise=require('bluebird');var rp=require(_0x2e61('0x3'));var fs=require('fs');var path=require(_0x2e61('0x4'));var rimraf=require(_0x2e61('0x5'));var config=require(_0x2e61('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x2e61('0x7')]=function(_0xb5a926,_0x4d410c){return _0xb5a926['define'](_0x2e61('0x8'),attributes,{'tableName':_0x2e61('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c93c5,_0x350b54,_0x35d108){if(_0x2c93c5[_0x2e61('0xa')](_0x2e61('0xb'))){_0x2c93c5[_0x2e61('0xc')]=moment()['format'](_0x2e61('0xd'));}_0x35d108(null,_0x2c93c5);}},'charset':_0x2e61('0xe'),'collate':_0x2e61('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index b1b7158..09193bd 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 _0xd062=['socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UpdateChatInteraction','update','body','options','raw','where','attributes','stringify','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x87c726,_0x2235d3){var _0xbcdcdd=function(_0x22565c){while(--_0x22565c){_0x87c726['push'](_0x87c726['shift']());}};_0xbcdcdd(++_0x2235d3);}(_0xd062,0xa0));var _0x2d06=function(_0x543dd8,_0xfe806e){_0x543dd8=_0x543dd8-0x0;var _0x2f8b46=_0xd062[_0x543dd8];return _0x2f8b46;};'use strict';var _=require('lodash');var util=require(_0x2d06('0x0'));var moment=require(_0x2d06('0x1'));var BPromise=require(_0x2d06('0x2'));var rs=require(_0x2d06('0x3'));var fs=require('fs');var Redis=require(_0x2d06('0x4'));var db=require(_0x2d06('0x5'))['db'];var utils=require(_0x2d06('0x6'));var logger=require(_0x2d06('0x7'))(_0x2d06('0x8'));var config=require(_0x2d06('0x9'));var jayson=require(_0x2d06('0xa'));var client=jayson[_0x2d06('0xb')][_0x2d06('0xc')]({'port':0x232a});config[_0x2d06('0xd')]=_[_0x2d06('0xe')](config[_0x2d06('0xd')],{'host':_0x2d06('0xf'),'port':0x18eb});var socket=require(_0x2d06('0x10'))(new Redis(config[_0x2d06('0xd')]));require(_0x2d06('0x11'))[_0x2d06('0x12')](socket);function respondWithRpcPromise(_0x16e6d3,_0x82e084,_0x40e510){return new BPromise(function(_0xd9117d,_0x344c29){return client['request'](_0x16e6d3,_0x40e510)[_0x2d06('0x13')](function(_0x5dd5a9){logger[_0x2d06('0x14')](_0x2d06('0x15'),_0x82e084,'request\x20sent');logger[_0x2d06('0x16')](_0x2d06('0x17'),_0x82e084,_0x2d06('0x18'),JSON['stringify'](_0x5dd5a9));if(_0x5dd5a9[_0x2d06('0x19')]){if(_0x5dd5a9['error'][_0x2d06('0x1a')]===0x1f4){logger['error'](_0x2d06('0x15'),_0x82e084,_0x5dd5a9['error'][_0x2d06('0x1b')]);return _0x344c29(_0x5dd5a9[_0x2d06('0x19')][_0x2d06('0x1b')]);}logger[_0x2d06('0x19')](_0x2d06('0x15'),_0x82e084,_0x5dd5a9[_0x2d06('0x19')][_0x2d06('0x1b')]);return _0xd9117d(_0x5dd5a9['error'][_0x2d06('0x1b')]);}else{logger['info'](_0x2d06('0x15'),_0x82e084,_0x2d06('0x18'));_0xd9117d(_0x5dd5a9['result'][_0x2d06('0x1b')]);}})['catch'](function(_0x3310bf){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x82e084,_0x3310bf);_0x344c29(_0x3310bf);});});}exports[_0x2d06('0x1c')]=function(_0x4f0a96){var _0x4ed3ee=this;return new Promise(function(_0x318168,_0x2bf91e){return db['ChatInteraction'][_0x2d06('0x1d')](_0x4f0a96[_0x2d06('0x1e')],{'raw':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')][_0x2d06('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')][_0x2d06('0x21')]||null:null,'attributes':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')][_0x2d06('0x22')]||null:null,'limit':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')]['limit']||null:null})[_0x2d06('0x13')](function(_0x5b97f4){logger[_0x2d06('0x14')](_0x2d06('0x1c'),_0x4f0a96);logger[_0x2d06('0x16')](_0x2d06('0x1c'),_0x4f0a96,JSON[_0x2d06('0x23')](_0x5b97f4));_0x318168(_0x5b97f4);})[_0x2d06('0x24')](function(_0x3271c7){logger[_0x2d06('0x19')]('UpdateChatInteraction',_0x3271c7[_0x2d06('0x1b')],_0x4f0a96);_0x2bf91e(_0x4ed3ee[_0x2d06('0x19')](0x1f4,_0x3271c7['message']));});});};exports[_0x2d06('0x25')]=function(_0x8a2f80){return new Promise(function(_0x2d26a7,_0x5d91ac){return db['ChatInteraction'][_0x2d06('0x26')]({'where':_0x8a2f80[_0x2d06('0x1f')]?_0x8a2f80[_0x2d06('0x1f')][_0x2d06('0x21')]||null:null})[_0x2d06('0x13')](function(_0x1096a9){if(_0x1096a9){return _0x1096a9[_0x2d06('0x27')](_0x8a2f80[_0x2d06('0x1e')][_0x2d06('0x28')],_[_0x2d06('0x29')](_0x8a2f80[_0x2d06('0x1e')],['ids','id'])||{});}})[_0x2d06('0x2a')](function(_0x37ce58){logger[_0x2d06('0x14')](_0x2d06('0x2b'),_0x8a2f80);logger[_0x2d06('0x16')](_0x2d06('0x2b'),_0x8a2f80,JSON['stringify'](_0x37ce58));_0x2d26a7(_0x37ce58);})[_0x2d06('0x24')](function(_0x186c7f){logger[_0x2d06('0x19')](_0x2d06('0x2b'),_0x186c7f[_0x2d06('0x1b')],_0x8a2f80);_0x5d91ac(_this[_0x2d06('0x19')](0x1f4,_0x186c7f[_0x2d06('0x1b')]));});});};
\ No newline at end of file
+var _0xc936=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','debug','catch','addTags','body','ids','omit','spread','AddTags','util','moment','randomstring','../../config/logger'];(function(_0x361fa2,_0x3cca67){var _0x30597a=function(_0x2feede){while(--_0x2feede){_0x361fa2['push'](_0x361fa2['shift']());}};_0x30597a(++_0x3cca67);}(_0xc936,0x182));var _0x6c93=function(_0x47be0c,_0x5c22b9){_0x47be0c=_0x47be0c-0x0;var _0x4037af=_0xc936[_0x47be0c];return _0x4037af;};'use strict';var _=require('lodash');var util=require(_0x6c93('0x0'));var moment=require(_0x6c93('0x1'));var BPromise=require('bluebird');var rs=require(_0x6c93('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6c93('0x3'))(_0x6c93('0x4'));var config=require(_0x6c93('0x5'));var jayson=require(_0x6c93('0x6'));var client=jayson[_0x6c93('0x7')][_0x6c93('0x8')]({'port':0x232a});config[_0x6c93('0x9')]=_[_0x6c93('0xa')](config['redis'],{'host':_0x6c93('0xb'),'port':0x18eb});var socket=require(_0x6c93('0xc'))(new Redis(config['redis']));require(_0x6c93('0xd'))['register'](socket);function respondWithRpcPromise(_0x31cdd2,_0x48ed83,_0x387c92){return new BPromise(function(_0x550e29,_0x45ff0b){return client['request'](_0x31cdd2,_0x387c92)[_0x6c93('0xe')](function(_0x181aba){logger[_0x6c93('0xf')](_0x6c93('0x10'),_0x48ed83,_0x6c93('0x11'));logger['debug'](_0x6c93('0x12'),_0x48ed83,_0x6c93('0x11'),JSON[_0x6c93('0x13')](_0x181aba));if(_0x181aba[_0x6c93('0x14')]){if(_0x181aba['error'][_0x6c93('0x15')]===0x1f4){logger[_0x6c93('0x14')](_0x6c93('0x10'),_0x48ed83,_0x181aba[_0x6c93('0x14')][_0x6c93('0x16')]);return _0x45ff0b(_0x181aba['error'][_0x6c93('0x16')]);}logger[_0x6c93('0x14')](_0x6c93('0x10'),_0x48ed83,_0x181aba[_0x6c93('0x14')][_0x6c93('0x16')]);return _0x550e29(_0x181aba['error']['message']);}else{logger[_0x6c93('0xf')](_0x6c93('0x10'),_0x48ed83,_0x6c93('0x11'));_0x550e29(_0x181aba[_0x6c93('0x17')][_0x6c93('0x16')]);}})['catch'](function(_0x4a2f03){logger[_0x6c93('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x48ed83,_0x4a2f03);_0x45ff0b(_0x4a2f03);});});}exports[_0x6c93('0x18')]=function(_0x3a4dfa){var _0x19433b=this;return new Promise(function(_0x1da4da,_0x1449f6){return db[_0x6c93('0x19')][_0x6c93('0x1a')](_0x3a4dfa['body'],{'raw':_0x3a4dfa['options']?_0x3a4dfa[_0x6c93('0x1b')][_0x6c93('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4dfa[_0x6c93('0x1b')]?_0x3a4dfa[_0x6c93('0x1b')][_0x6c93('0x1d')]||null:null,'attributes':_0x3a4dfa[_0x6c93('0x1b')]?_0x3a4dfa[_0x6c93('0x1b')][_0x6c93('0x1e')]||null:null,'limit':_0x3a4dfa[_0x6c93('0x1b')]?_0x3a4dfa[_0x6c93('0x1b')]['limit']||null:null})['then'](function(_0x188538){logger['info']('UpdateChatInteraction',_0x3a4dfa);logger[_0x6c93('0x1f')]('UpdateChatInteraction',_0x3a4dfa,JSON[_0x6c93('0x13')](_0x188538));_0x1da4da(_0x188538);})[_0x6c93('0x20')](function(_0x4a08db){logger['error'](_0x6c93('0x18'),_0x4a08db[_0x6c93('0x16')],_0x3a4dfa);_0x1449f6(_0x19433b[_0x6c93('0x14')](0x1f4,_0x4a08db[_0x6c93('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0xa923dd){return new Promise(function(_0x44549c,_0x3c38fc){return db['ChatInteraction']['find']({'where':_0xa923dd[_0x6c93('0x1b')]?_0xa923dd[_0x6c93('0x1b')][_0x6c93('0x1d')]||null:null})[_0x6c93('0xe')](function(_0x3754a8){if(_0x3754a8){return _0x3754a8[_0x6c93('0x21')](_0xa923dd[_0x6c93('0x22')][_0x6c93('0x23')],_[_0x6c93('0x24')](_0xa923dd[_0x6c93('0x22')],[_0x6c93('0x23'),'id'])||{});}})[_0x6c93('0x25')](function(_0x90ecbe){logger['info']('AddTags',_0xa923dd);logger['debug']('AddTags',_0xa923dd,JSON[_0x6c93('0x13')](_0x90ecbe));_0x44549c(_0x90ecbe);})['catch'](function(_0xce172c){logger[_0x6c93('0x14')](_0x6c93('0x26'),_0xce172c[_0x6c93('0x16')],_0xa923dd);_0x3c38fc(_this[_0x6c93('0x14')](0x1f4,_0xce172c[_0x6c93('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f1db2d5..d471d0c 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 _0xea85=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit'];(function(_0x26a591,_0x2202a6){var _0x25bbc3=function(_0x34ba10){while(--_0x34ba10){_0x26a591['push'](_0x26a591['shift']());}};_0x25bbc3(++_0x2202a6);}(_0xea85,0x1ea));var _0x5ea8=function(_0x2dcc5e,_0xee1ec2){_0x2dcc5e=_0x2dcc5e-0x0;var _0x40c2d4=_0xea85[_0x2dcc5e];return _0x40c2d4;};'use strict';var ChatInteractionEvents=require(_0x5ea8('0x0'));var events=[_0x5ea8('0x1'),_0x5ea8('0x2'),_0x5ea8('0x3')];function createListener(_0x664ad7,_0x483e29){return function(_0x2a620b){_0x483e29[_0x5ea8('0x4')](_0x664ad7,_0x2a620b);};}function removeListener(_0x159005,_0x2e9052){return function(){ChatInteractionEvents[_0x5ea8('0x5')](_0x159005,_0x2e9052);};}exports[_0x5ea8('0x6')]=function(_0x4f5975){for(var _0x563fc9=0x0,_0x333b3c=events[_0x5ea8('0x7')];_0x563fc9<_0x333b3c;_0x563fc9++){var _0x2f4142=events[_0x563fc9];var _0x20dd3c=createListener(_0x5ea8('0x8')+_0x2f4142,_0x4f5975);ChatInteractionEvents['on'](_0x2f4142,_0x20dd3c);}};
\ No newline at end of file
+var _0x2d57=['save','remove','emit','register','length'];(function(_0x322bef,_0x4890d4){var _0x229e60=function(_0x45f89b){while(--_0x45f89b){_0x322bef['push'](_0x322bef['shift']());}};_0x229e60(++_0x4890d4);}(_0x2d57,0xaf));var _0x72d5=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x2d57[_0x111e94];return _0x3de107;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x72d5('0x0'),_0x72d5('0x1'),'update'];function createListener(_0x5790a9,_0x50e7de){return function(_0x401855){_0x50e7de[_0x72d5('0x2')](_0x5790a9,_0x401855);};}function removeListener(_0x5de1e1,_0x12314e){return function(){ChatInteractionEvents['removeListener'](_0x5de1e1,_0x12314e);};}exports[_0x72d5('0x3')]=function(_0x2bf1fa){for(var _0x5afb9a=0x0,_0x557e57=events[_0x72d5('0x4')];_0x5afb9a<_0x557e57;_0x5afb9a++){var _0x912c70=events[_0x5afb9a];var _0x4d1060=createListener('chatInteraction:'+_0x912c70,_0x2bf1fa);ChatInteractionEvents['on'](_0x912c70,_0x4d1060);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 6fbef4e..b5f8300 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 _0xb18f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','/describe','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','addMessage','tracked','chatinteraction:addtags','put','chatinteraction:update','update','customUpdate','/:id/close','close','delete','chat','destroy','removeTags','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x39d182,_0x4c4547){var _0x575302=function(_0x10b878){while(--_0x10b878){_0x39d182['push'](_0x39d182['shift']());}};_0x575302(++_0x4c4547);}(_0xb18f,0x91));var _0xfb18=function(_0x27091c,_0x309348){_0x27091c=_0x27091c-0x0;var _0x3ad65a=_0xb18f[_0x27091c];return _0x3ad65a;};'use strict';var multer=require(_0xfb18('0x0'));var util=require('util');var path=require(_0xfb18('0x1'));var timeout=require(_0xfb18('0x2'));var express=require('express');var router=express[_0xfb18('0x3')]();var fs_extra=require(_0xfb18('0x4'));var auth=require(_0xfb18('0x5'));var interaction=require(_0xfb18('0x6'));var config=require(_0xfb18('0x7'));var controller=require(_0xfb18('0x8'));router['get']('/',auth[_0xfb18('0x9')](),controller['index']);router['get'](_0xfb18('0xa'),auth[_0xfb18('0x9')](),controller[_0xfb18('0xb')]);router[_0xfb18('0xc')](_0xfb18('0xd'),auth[_0xfb18('0xe')](),controller[_0xfb18('0xf')]);router[_0xfb18('0xc')](_0xfb18('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xfb18('0xc')](_0xfb18('0x11'),auth[_0xfb18('0x9')](),controller[_0xfb18('0x12')]);router[_0xfb18('0xc')](_0xfb18('0x13'),auth[_0xfb18('0xe')](),controller[_0xfb18('0x14')]);router[_0xfb18('0xc')](_0xfb18('0x15'),auth['isAuthenticated'](),controller[_0xfb18('0x16')]);router['post']('/',auth[_0xfb18('0x9')](),controller[_0xfb18('0x17')]);router[_0xfb18('0x18')](_0xfb18('0x19'),auth['isAuthenticated'](),controller[_0xfb18('0x1a')]);var upload=multer({'storage':multer[_0xfb18('0x1b')]({'destination':function(_0x51d6af,_0x352c92,_0x2b1e0a){_0x2b1e0a(null,path[_0xfb18('0x1c')](config[_0xfb18('0x1d')],_0xfb18('0x1e')));},'filename':function(_0x4fe169,_0xadf240,_0x3ae776){_0x3ae776(null,util['format'](_0xfb18('0x1f'),Date[_0xfb18('0x20')](),_0xadf240[_0xfb18('0x21')][_0xfb18('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xfb18('0x23'),upload['single']('file'),controller['attachmentUpload']);router[_0xfb18('0x18')](_0xfb18('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xfb18('0x24')]);router[_0xfb18('0x18')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xfb18('0x25')]('chat',_0xfb18('0x26')),controller['addTags']);router[_0xfb18('0x27')]('/:id',auth[_0xfb18('0x9')](),interaction[_0xfb18('0x25')]('chat',_0xfb18('0x28')),controller[_0xfb18('0x29')]);router[_0xfb18('0x27')]('/:id/custom_update',controller[_0xfb18('0x2a')]);router[_0xfb18('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xfb18('0x27')](_0xfb18('0x2b'),controller[_0xfb18('0x2c')]);router[_0xfb18('0x2d')](_0xfb18('0xd'),auth[_0xfb18('0x9')](),interaction[_0xfb18('0x25')](_0xfb18('0x2e'),'chatinteraction:destroy'),controller[_0xfb18('0x2f')]);router[_0xfb18('0x2d')]('/:id/tags',auth[_0xfb18('0x9')](),controller[_0xfb18('0x30')]);module[_0xfb18('0x31')]=router;
\ No newline at end of file
+var _0xa82c=['customUpdate','/:id/abandon','abandon','close','/:id','chatinteraction:destroy','destroy','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','getMessages','/:id/my_messages','isChatInteractionAuthorized','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','file','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa82c,0xc0));var _0xca82=function(_0x4ded64,_0x21a971){_0x4ded64=_0x4ded64-0x0;var _0x12b320=_0xa82c[_0x4ded64];return _0x12b320;};'use strict';var multer=require(_0xca82('0x0'));var util=require(_0xca82('0x1'));var path=require(_0xca82('0x2'));var timeout=require('connect-timeout');var express=require(_0xca82('0x3'));var router=express['Router']();var fs_extra=require(_0xca82('0x4'));var auth=require(_0xca82('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xca82('0x6'));var controller=require(_0xca82('0x7'));router[_0xca82('0x8')]('/',auth[_0xca82('0x9')](),controller[_0xca82('0xa')]);router[_0xca82('0x8')]('/describe',auth[_0xca82('0x9')](),controller[_0xca82('0xb')]);router[_0xca82('0x8')]('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0xca82('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xca82('0x8')]('/:id/messages',auth[_0xca82('0x9')](),controller[_0xca82('0xc')]);router[_0xca82('0x8')](_0xca82('0xd'),auth[_0xca82('0xe')](),controller['getMyMessages']);router[_0xca82('0x8')](_0xca82('0xf'),auth['isAuthenticated'](),controller[_0xca82('0x10')]);router[_0xca82('0x11')]('/',auth['isAuthenticated'](),controller[_0xca82('0x12')]);router[_0xca82('0x11')](_0xca82('0x13'),auth[_0xca82('0x9')](),controller[_0xca82('0x14')]);var upload=multer({'storage':multer[_0xca82('0x15')]({'destination':function(_0x131b26,_0xf57e31,_0x120c49){_0x120c49(null,path['join'](config['root'],_0xca82('0x16')));},'filename':function(_0xcce01b,_0x2f12fa,_0x3293d5){_0x3293d5(null,util[_0xca82('0x17')](_0xca82('0x18'),Date[_0xca82('0x19')](),_0x2f12fa[_0xca82('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xca82('0x11')](_0xca82('0x1b'),upload['single'](_0xca82('0x1c')),controller['attachmentUpload']);router[_0xca82('0x11')](_0xca82('0x1d'),auth[_0xca82('0xe')](),controller[_0xca82('0x1e')]);router['post'](_0xca82('0x1f'),auth['isAuthenticated'](),interaction[_0xca82('0x20')](_0xca82('0x21'),_0xca82('0x22')),controller[_0xca82('0x23')]);router[_0xca82('0x24')]('/:id',auth[_0xca82('0x9')](),interaction[_0xca82('0x20')]('chat','chatinteraction:update'),controller['update']);router['put'](_0xca82('0x25'),controller[_0xca82('0x26')]);router[_0xca82('0x24')](_0xca82('0x27'),auth[_0xca82('0xe')](),controller[_0xca82('0x28')]);router[_0xca82('0x24')]('/:id/close',controller[_0xca82('0x29')]);router['delete'](_0xca82('0x2a'),auth[_0xca82('0x9')](),interaction[_0xca82('0x20')](_0xca82('0x21'),_0xca82('0x2b')),controller[_0xca82('0x2c')]);router[_0xca82('0x2d')](_0xca82('0x1f'),auth[_0xca82('0x9')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7877309..d78fca8 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 _0x4daa=['BOOLEAN','medium'];(function(_0x39a3e1,_0x7aea5d){var _0x5c142b=function(_0x3e2233){while(--_0x3e2233){_0x39a3e1['push'](_0x39a3e1['shift']());}};_0x5c142b(++_0x7aea5d);}(_0x4daa,0x1c1));var _0xa4da=function(_0x3e3d0a,_0x4745dd){_0x3e3d0a=_0x3e3d0a-0x0;var _0x3fc765=_0x4daa[_0x3e3d0a];return _0x3fc765;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xa4da('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xa4da('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xf2d7=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x540687,_0x1f5277){var _0x53e71a=function(_0x2ea95a){while(--_0x2ea95a){_0x540687['push'](_0x540687['shift']());}};_0x53e71a(++_0x1f5277);}(_0xf2d7,0xa6));var _0x7f2d=function(_0x5436c0,_0x45beac){_0x5436c0=_0x5436c0-0x0;var _0x51a455=_0xf2d7[_0x5436c0];return _0x51a455;};'use strict';var Sequelize=require(_0x7f2d('0x0'));module[_0x7f2d('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7f2d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7f2d('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7f2d('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 4ce0f35..04e2c01 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 _0x8a20=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x39fe18,_0x5a2db7){var _0x9fc66b=function(_0x408b30){while(--_0x408b30){_0x39fe18['push'](_0x39fe18['shift']());}};_0x9fc66b(++_0x5a2db7);}(_0x8a20,0x14e));var _0x08a2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8a20[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x08a2('0x0'));var rimraf=require(_0x08a2('0x1'));var zipdir=require(_0x08a2('0x2'));var jsonpatch=require(_0x08a2('0x3'));var rp=require('request-promise');var moment=require(_0x08a2('0x4'));var BPromise=require(_0x08a2('0x5'));var Mustache=require(_0x08a2('0x6'));var util=require('util');var path=require(_0x08a2('0x7'));var sox=require('sox');var csv=require(_0x08a2('0x8'));var ejs=require(_0x08a2('0x9'));var fs=require('fs');var fs_extra=require(_0x08a2('0xa'));var _=require(_0x08a2('0xb'));var squel=require(_0x08a2('0xc'));var crypto=require(_0x08a2('0xd'));var jsforce=require(_0x08a2('0xe'));var deskjs=require(_0x08a2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x08a2('0x10'));var Papa=require('papaparse');var Redis=require(_0x08a2('0x11'));var authService=require(_0x08a2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x08a2('0x13'));var hardwareService=require(_0x08a2('0x14'));var logger=require(_0x08a2('0x15'))(_0x08a2('0x16'));var utils=require(_0x08a2('0x17'));var config=require(_0x08a2('0x18'));var licenseUtil=require(_0x08a2('0x19'));var db=require(_0x08a2('0x1a'))['db'];config[_0x08a2('0x1b')]=_[_0x08a2('0x1c')](config[_0x08a2('0x1b')],{'host':_0x08a2('0x1d'),'port':0x18eb});var socket=require(_0x08a2('0x1e'))(new Redis(config[_0x08a2('0x1b')]));require(_0x08a2('0x1f'))[_0x08a2('0x20')](socket);function respondWithStatusCode(_0x1cec65,_0x523eff){_0x523eff=_0x523eff||0xcc;return function(_0x9fd3ff){if(_0x9fd3ff){return _0x1cec65['sendStatus'](_0x523eff);}return _0x1cec65['status'](_0x523eff)[_0x08a2('0x21')]();};}function respondWithResult(_0x313119,_0x267dfa){_0x267dfa=_0x267dfa||0xc8;return function(_0x5ae8db){if(_0x5ae8db){return _0x313119[_0x08a2('0x22')](_0x267dfa)[_0x08a2('0x23')](_0x5ae8db);}};}function respondWithFilteredResult(_0x4a299c,_0x26b48d){return function(_0x21deea){if(_0x21deea){var _0x508540=typeof _0x26b48d[_0x08a2('0x24')]===_0x08a2('0x25')&&typeof _0x26b48d[_0x08a2('0x26')]==='undefined';var _0x3e6190=_0x21deea[_0x08a2('0x27')];var _0x29f29d=_0x508540?0x0:_0x26b48d[_0x08a2('0x24')];var _0x3b5621=_0x508540?_0x21deea['count']:_0x26b48d['offset']+_0x26b48d[_0x08a2('0x26')];var _0x1bffd3;if(_0x3b5621>=_0x3e6190){_0x3b5621=_0x3e6190;_0x1bffd3=0xc8;}else{_0x1bffd3=0xce;}_0x4a299c[_0x08a2('0x22')](_0x1bffd3);return _0x4a299c[_0x08a2('0x28')](_0x08a2('0x29'),_0x29f29d+'-'+_0x3b5621+'/'+_0x3e6190)[_0x08a2('0x23')](_0x21deea);}return null;};}function patchUpdates(_0x4778b1){return function(_0x49137a){try{jsonpatch[_0x08a2('0x2a')](_0x49137a,_0x4778b1,!![]);}catch(_0x14fc52){return BPromise[_0x08a2('0x2b')](_0x14fc52);}return _0x49137a['save']();};}function saveUpdates(_0x28aac,_0x487596){return function(_0x30ac06){if(_0x30ac06){return _0x30ac06[_0x08a2('0x2c')](_0x28aac)[_0x08a2('0x2d')](function(_0x437ecd){return _0x437ecd;});}return null;};}function removeEntity(_0x1a6bb5,_0x16e0dd){return function(_0x14ac39){if(_0x14ac39){return _0x14ac39[_0x08a2('0x2e')]()[_0x08a2('0x2d')](function(){_0x1a6bb5[_0x08a2('0x22')](0xcc)[_0x08a2('0x21')]();});}};}function handleEntityNotFound(_0x3aaac7,_0x50b518){return function(_0x1d1049){if(!_0x1d1049){_0x3aaac7['sendStatus'](0x194);}return _0x1d1049;};}function handleError(_0x415fce,_0x1a9e2c){_0x1a9e2c=_0x1a9e2c||0x1f4;return function(_0x16c435){logger[_0x08a2('0x2f')](_0x16c435[_0x08a2('0x30')]);if(_0x16c435[_0x08a2('0x31')]){delete _0x16c435[_0x08a2('0x31')];}_0x415fce[_0x08a2('0x22')](_0x1a9e2c)[_0x08a2('0x32')](_0x16c435);};}exports[_0x08a2('0x33')]=function(_0x4d0d70,_0x15d4e1){var _0x106733={},_0x436cfc={},_0x85944a={'count':0x0,'rows':[]};var _0x3b3315=_[_0x08a2('0x34')](db['ChatInternalMessage'][_0x08a2('0x35')],function(_0x4248b4){return{'name':_0x4248b4['fieldName'],'type':_0x4248b4[_0x08a2('0x36')][_0x08a2('0x37')]};});_0x436cfc['model']=_[_0x08a2('0x34')](_0x3b3315,'name');_0x436cfc[_0x08a2('0x38')]=_[_0x08a2('0x39')](_0x4d0d70[_0x08a2('0x38')]);_0x436cfc[_0x08a2('0x3a')]=_[_0x08a2('0x3b')](_0x436cfc['model'],_0x436cfc[_0x08a2('0x38')]);_0x106733['attributes']=_[_0x08a2('0x3b')](_0x436cfc[_0x08a2('0x3c')],qs[_0x08a2('0x3d')](_0x4d0d70[_0x08a2('0x38')]['fields']));_0x106733['attributes']=_0x106733['attributes']['length']?_0x106733[_0x08a2('0x3e')]:_0x436cfc[_0x08a2('0x3c')];if(!_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x3f')]('nolimit')){_0x106733[_0x08a2('0x26')]=qs[_0x08a2('0x26')](_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x26')]);_0x106733[_0x08a2('0x24')]=qs[_0x08a2('0x24')](_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x24')]);}_0x106733[_0x08a2('0x40')]=qs['sort'](_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x41')]);_0x106733['where']=qs[_0x08a2('0x3a')](_[_0x08a2('0x42')](_0x4d0d70[_0x08a2('0x38')],_0x436cfc[_0x08a2('0x3a')]),_0x3b3315);if(_0x4d0d70['query'][_0x08a2('0x43')]){_0x106733[_0x08a2('0x44')]=_[_0x08a2('0x45')](_0x106733['where'],{'$or':_['map'](_0x3b3315,function(_0x25f8d5){if(_0x25f8d5['type']!==_0x08a2('0x46')){var _0x3a7d81={};_0x3a7d81[_0x25f8d5['name']]={'$like':'%'+_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x43')]+'%'};return _0x3a7d81;}})});}_0x106733=_[_0x08a2('0x45')]({},_0x106733,_0x4d0d70['options']);var _0x341132={'where':_0x106733[_0x08a2('0x44')]};return db[_0x08a2('0x47')][_0x08a2('0x27')](_0x341132)['then'](function(_0x54c019){_0x85944a[_0x08a2('0x27')]=_0x54c019;if(_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x48')]){_0x106733[_0x08a2('0x49')]=[{'all':!![]}];}return db[_0x08a2('0x47')][_0x08a2('0x4a')](_0x106733);})[_0x08a2('0x2d')](function(_0x416504){_0x85944a[_0x08a2('0x4b')]=_0x416504;return _0x85944a;})[_0x08a2('0x2d')](respondWithFilteredResult(_0x15d4e1,_0x106733))[_0x08a2('0x4c')](handleError(_0x15d4e1,null));};exports[_0x08a2('0x4d')]=function(_0x55cc7a,_0x5f5391){var _0x3fde89={'raw':!![],'where':{'id':_0x55cc7a[_0x08a2('0x4e')]['id']}},_0x19267b={};_0x19267b[_0x08a2('0x3c')]=_[_0x08a2('0x39')](db[_0x08a2('0x47')]['rawAttributes']);_0x19267b[_0x08a2('0x38')]=_[_0x08a2('0x39')](_0x55cc7a['query']);_0x19267b[_0x08a2('0x3a')]=_['intersection'](_0x19267b[_0x08a2('0x3c')],_0x19267b[_0x08a2('0x38')]);_0x3fde89[_0x08a2('0x3e')]=_['intersection'](_0x19267b[_0x08a2('0x3c')],qs[_0x08a2('0x3d')](_0x55cc7a[_0x08a2('0x38')][_0x08a2('0x3d')]));_0x3fde89[_0x08a2('0x3e')]=_0x3fde89[_0x08a2('0x3e')]['length']?_0x3fde89[_0x08a2('0x3e')]:_0x19267b[_0x08a2('0x3c')];if(_0x55cc7a['query'][_0x08a2('0x48')]){_0x3fde89[_0x08a2('0x49')]=[{'all':!![]}];}_0x3fde89=_[_0x08a2('0x45')]({},_0x3fde89,_0x55cc7a[_0x08a2('0x4f')]);return db[_0x08a2('0x47')][_0x08a2('0x50')](_0x3fde89)[_0x08a2('0x2d')](handleEntityNotFound(_0x5f5391,null))[_0x08a2('0x2d')](respondWithResult(_0x5f5391,null))[_0x08a2('0x4c')](handleError(_0x5f5391,null));};exports[_0x08a2('0x51')]=function(_0x40dc0c,_0x8f39a1){return db[_0x08a2('0x47')][_0x08a2('0x51')](_0x40dc0c[_0x08a2('0x52')],{})[_0x08a2('0x2d')](respondWithResult(_0x8f39a1,0xc9))['catch'](handleError(_0x8f39a1,null));};exports[_0x08a2('0x2c')]=function(_0x17fe4f,_0x51494c){if(_0x17fe4f[_0x08a2('0x52')]['id']){delete _0x17fe4f[_0x08a2('0x52')]['id'];}return db[_0x08a2('0x47')][_0x08a2('0x50')]({'where':{'id':_0x17fe4f[_0x08a2('0x4e')]['id']}})[_0x08a2('0x2d')](handleEntityNotFound(_0x51494c,null))['then'](saveUpdates(_0x17fe4f[_0x08a2('0x52')],null))[_0x08a2('0x2d')](respondWithResult(_0x51494c,null))[_0x08a2('0x4c')](handleError(_0x51494c,null));};exports[_0x08a2('0x2e')]=function(_0x447065,_0x13f789){return db[_0x08a2('0x47')][_0x08a2('0x50')]({'where':{'id':_0x447065[_0x08a2('0x4e')]['id']}})[_0x08a2('0x2d')](handleEntityNotFound(_0x13f789,null))[_0x08a2('0x2d')](removeEntity(_0x13f789,null))['catch'](handleError(_0x13f789,null));};exports[_0x08a2('0x53')]=function(_0x48ec2a,_0x451159){return db[_0x08a2('0x47')][_0x08a2('0x53')]()[_0x08a2('0x2d')](respondWithResult(_0x451159,null))[_0x08a2('0x4c')](handleError(_0x451159,null));};function wrapUser(_0x3d6055){return function(_0x471e3b){var _0x59f9e3=_0x3d6055[_0x08a2('0x54')]({'plain':!![]});_0x59f9e3[_0x08a2('0x55')]=[];if(_0x471e3b){_0x59f9e3[_0x08a2('0x56')]=_0x471e3b[_0x08a2('0x57')];_0x59f9e3[_0x08a2('0x58')]=_0x471e3b;}else{_0x59f9e3[_0x08a2('0x56')]=moment(0x0)[_0x08a2('0x59')](_0x08a2('0x5a'));_0x59f9e3[_0x08a2('0x58')]={};}return _0x59f9e3;};}exports[_0x08a2('0x5b')]=function(_0x5040af,_0x2f13c1,_0x4caaa6){var _0x3278a7=[];return db[_0x08a2('0x5c')]['findAll']({'where':{'role':[_0x08a2('0x5d'),_0x08a2('0x5e'),_0x08a2('0x5f')]},'attributes':['id',_0x08a2('0x60'),_0x08a2('0x31'),_0x08a2('0x61'),_0x08a2('0x62'),_0x08a2('0x63'),_0x08a2('0x64'),'lastLoginAt',_0x08a2('0x65'),_0x08a2('0x66')],'order':qs['sort'](_0x08a2('0x67')),'include':[{'model':db[_0x08a2('0x68')],'as':_0x08a2('0x69'),'attributes':['id',_0x08a2('0x31'),_0x08a2('0x36')],'through':{'attributes':[]}}]})[_0x08a2('0x2d')](function(_0x16a12c){if(_0x16a12c){var _0x5dc640=_0x5040af[_0x08a2('0x5f')][_0x08a2('0x54')]({'plain':!![]});if(!_0x5dc640)throw new Error(_0x08a2('0x6a'));if(_0x5dc640[_0x08a2('0x61')]===_0x08a2('0x5f')){return db[_0x08a2('0x6b')][_0x08a2('0x50')]({'where':{'name':'Agents','userProfileId':_0x5dc640[_0x08a2('0x6c')]},'raw':!![]})[_0x08a2('0x2d')](function(_0x476ad1){if(_0x476ad1){if(_0x476ad1[_0x08a2('0x6d')]===0x0){return db[_0x08a2('0x6e')][_0x08a2('0x4a')]({'where':{'sectionId':_0x476ad1['id']},'raw':!![]})[_0x08a2('0x2d')](function(_0x5adf01){var _0x5bc953=[];if(_[_0x08a2('0x6f')](_0x5adf01)){_0x5bc953=_[_0x08a2('0x43')](_0x16a12c,function(_0x1417c3){if(_0x1417c3[_0x08a2('0x61')]!==_0x08a2('0x5d')){return _0x1417c3;}});return _0x5bc953;}else{for(var _0x138b26=0x0;_0x138b26<_0x16a12c[_0x08a2('0x70')];_0x138b26++){var _0x15f291=_0x16a12c[_0x138b26];if(_0x15f291[_0x08a2('0x61')]==='agent'){var _0x195486=_[_0x08a2('0x50')](_0x5adf01,function(_0x2db0d4){return _0x2db0d4[_0x08a2('0x71')]===_0x15f291['id'];});if(_0x195486)_0x5bc953[_0x08a2('0x72')](_0x15f291);}else{_0x5bc953[_0x08a2('0x72')](_0x15f291);}}return _0x5bc953;}});}else{return _0x16a12c;}}else{var _0x433c21=_['filter'](_0x16a12c,function(_0x52eff6){if(_0x52eff6['role']!==_0x08a2('0x5d')){return _0x52eff6;}});return _0x433c21;}});}else{return _0x16a12c;}}})[_0x08a2('0x2d')](function(_0x4c3a7b){var _0x1de82b=[];if(_0x4c3a7b){_0x3278a7=_0x4c3a7b;for(var _0x497d21=0x0;_0x497d21<_0x4c3a7b['length'];_0x497d21+=0x1){_0x3278a7[_0x497d21][_0x08a2('0x55')]=[];_0x1de82b['push'](db[_0x08a2('0x47')][_0x08a2('0x50')]({'where':{'FromId':[_0x5040af[_0x08a2('0x5f')]['id'],_0x4c3a7b[_0x497d21]['id']],'ToId':[_0x5040af[_0x08a2('0x5f')]['id'],_0x4c3a7b[_0x497d21]['id']],'ChatGroupId':null},'attributes':['id',_0x08a2('0x57'),_0x08a2('0x73'),'ToId',_0x08a2('0x74'),'body'],'order':qs['sort'](_0x08a2('0x75')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x08a2('0x2d')](wrapUser(_0x4c3a7b[_0x497d21])));}return BPromise[_0x08a2('0x76')](_0x1de82b);}return[];})[_0x08a2('0x2d')](function(_0x37a9a2){return{'rows':_0x37a9a2,'count':_0x37a9a2[_0x08a2('0x70')]};})['then'](respondWithResult(_0x2f13c1,null))['catch'](handleError(_0x2f13c1,null));};
\ No newline at end of file
+var _0x2a4c=['showWebBar','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','-createdAt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','show','params','filters','catch','create','body','update','destroy','find','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger'];(function(_0x323a3d,_0x2be54b){var _0x498c54=function(_0x112640){while(--_0x112640){_0x323a3d['push'](_0x323a3d['shift']());}};_0x498c54(++_0x2be54b);}(_0x2a4c,0x7e));var _0xc2a4=function(_0x17ceb4,_0x5ea813){_0x17ceb4=_0x17ceb4-0x0;var _0x580289=_0x2a4c[_0x17ceb4];return _0x580289;};'use strict';var emlformat=require(_0xc2a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2a4('0x1'));var jsonpatch=require(_0xc2a4('0x2'));var rp=require(_0xc2a4('0x3'));var moment=require(_0xc2a4('0x4'));var BPromise=require(_0xc2a4('0x5'));var Mustache=require('mustache');var util=require(_0xc2a4('0x6'));var path=require(_0xc2a4('0x7'));var sox=require(_0xc2a4('0x8'));var csv=require(_0xc2a4('0x9'));var ejs=require(_0xc2a4('0xa'));var fs=require('fs');var fs_extra=require(_0xc2a4('0xb'));var _=require(_0xc2a4('0xc'));var squel=require('squel');var crypto=require(_0xc2a4('0xd'));var jsforce=require(_0xc2a4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc2a4('0x9'));var querystring=require(_0xc2a4('0xf'));var Papa=require(_0xc2a4('0x10'));var Redis=require(_0xc2a4('0x11'));var authService=require(_0xc2a4('0x12'));var qs=require(_0xc2a4('0x13'));var as=require(_0xc2a4('0x14'));var hardwareService=require(_0xc2a4('0x15'));var logger=require('../../config/logger')(_0xc2a4('0x16'));var utils=require(_0xc2a4('0x17'));var config=require(_0xc2a4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc2a4('0x19'))['db'];config[_0xc2a4('0x1a')]=_[_0xc2a4('0x1b')](config['redis'],{'host':_0xc2a4('0x1c'),'port':0x18eb});var socket=require(_0xc2a4('0x1d'))(new Redis(config[_0xc2a4('0x1a')]));require(_0xc2a4('0x1e'))['register'](socket);function respondWithStatusCode(_0x3fa07c,_0x2da8b4){_0x2da8b4=_0x2da8b4||0xcc;return function(_0x124989){if(_0x124989){return _0x3fa07c[_0xc2a4('0x1f')](_0x2da8b4);}return _0x3fa07c[_0xc2a4('0x20')](_0x2da8b4)[_0xc2a4('0x21')]();};}function respondWithResult(_0x4ed283,_0x3f3844){_0x3f3844=_0x3f3844||0xc8;return function(_0x2986dc){if(_0x2986dc){return _0x4ed283['status'](_0x3f3844)[_0xc2a4('0x22')](_0x2986dc);}};}function respondWithFilteredResult(_0x39a34b,_0x57b27c){return function(_0x3dcd2e){if(_0x3dcd2e){var _0x2ccec8=typeof _0x57b27c[_0xc2a4('0x23')]===_0xc2a4('0x24')&&typeof _0x57b27c[_0xc2a4('0x25')]===_0xc2a4('0x24');var _0x5eb5a0=_0x3dcd2e[_0xc2a4('0x26')];var _0x5728c7=_0x2ccec8?0x0:_0x57b27c[_0xc2a4('0x23')];var _0x151991=_0x2ccec8?_0x3dcd2e['count']:_0x57b27c[_0xc2a4('0x23')]+_0x57b27c[_0xc2a4('0x25')];var _0x174615;if(_0x151991>=_0x5eb5a0){_0x151991=_0x5eb5a0;_0x174615=0xc8;}else{_0x174615=0xce;}_0x39a34b[_0xc2a4('0x20')](_0x174615);return _0x39a34b['set'](_0xc2a4('0x27'),_0x5728c7+'-'+_0x151991+'/'+_0x5eb5a0)['json'](_0x3dcd2e);}return null;};}function patchUpdates(_0x3bd78a){return function(_0x702dd2){try{jsonpatch[_0xc2a4('0x28')](_0x702dd2,_0x3bd78a,!![]);}catch(_0x509962){return BPromise['reject'](_0x509962);}return _0x702dd2[_0xc2a4('0x29')]();};}function saveUpdates(_0x40f6e1,_0x18f463){return function(_0x753580){if(_0x753580){return _0x753580['update'](_0x40f6e1)[_0xc2a4('0x2a')](function(_0xc66b32){return _0xc66b32;});}return null;};}function removeEntity(_0x1f2179,_0x1921c0){return function(_0x3cbf9f){if(_0x3cbf9f){return _0x3cbf9f['destroy']()[_0xc2a4('0x2a')](function(){_0x1f2179[_0xc2a4('0x20')](0xcc)[_0xc2a4('0x21')]();});}};}function handleEntityNotFound(_0x323c13,_0x79f1e4){return function(_0x17f3c2){if(!_0x17f3c2){_0x323c13['sendStatus'](0x194);}return _0x17f3c2;};}function handleError(_0x50cb7d,_0x25ee27){_0x25ee27=_0x25ee27||0x1f4;return function(_0x5a80cb){logger[_0xc2a4('0x2b')](_0x5a80cb[_0xc2a4('0x2c')]);if(_0x5a80cb[_0xc2a4('0x2d')]){delete _0x5a80cb[_0xc2a4('0x2d')];}_0x50cb7d[_0xc2a4('0x20')](_0x25ee27)['send'](_0x5a80cb);};}exports[_0xc2a4('0x2e')]=function(_0x35315a,_0x32a184){var _0x45042b={},_0x2844ea={},_0x47934b={'count':0x0,'rows':[]};var _0x187f96=_[_0xc2a4('0x2f')](db['ChatInternalMessage'][_0xc2a4('0x30')],function(_0x2b22a5){return{'name':_0x2b22a5[_0xc2a4('0x31')],'type':_0x2b22a5[_0xc2a4('0x32')]['key']};});_0x2844ea[_0xc2a4('0x33')]=_[_0xc2a4('0x2f')](_0x187f96,'name');_0x2844ea['query']=_[_0xc2a4('0x34')](_0x35315a[_0xc2a4('0x35')]);_0x2844ea['filters']=_[_0xc2a4('0x36')](_0x2844ea[_0xc2a4('0x33')],_0x2844ea[_0xc2a4('0x35')]);_0x45042b['attributes']=_[_0xc2a4('0x36')](_0x2844ea[_0xc2a4('0x33')],qs[_0xc2a4('0x37')](_0x35315a[_0xc2a4('0x35')]['fields']));_0x45042b[_0xc2a4('0x38')]=_0x45042b[_0xc2a4('0x38')][_0xc2a4('0x39')]?_0x45042b[_0xc2a4('0x38')]:_0x2844ea[_0xc2a4('0x33')];if(!_0x35315a[_0xc2a4('0x35')]['hasOwnProperty'](_0xc2a4('0x3a'))){_0x45042b[_0xc2a4('0x25')]=qs[_0xc2a4('0x25')](_0x35315a[_0xc2a4('0x35')][_0xc2a4('0x25')]);_0x45042b[_0xc2a4('0x23')]=qs[_0xc2a4('0x23')](_0x35315a[_0xc2a4('0x35')]['offset']);}_0x45042b['order']=qs[_0xc2a4('0x3b')](_0x35315a[_0xc2a4('0x35')][_0xc2a4('0x3b')]);_0x45042b[_0xc2a4('0x3c')]=qs['filters'](_[_0xc2a4('0x3d')](_0x35315a[_0xc2a4('0x35')],_0x2844ea['filters']),_0x187f96);if(_0x35315a[_0xc2a4('0x35')][_0xc2a4('0x3e')]){_0x45042b[_0xc2a4('0x3c')]=_[_0xc2a4('0x3f')](_0x45042b[_0xc2a4('0x3c')],{'$or':_[_0xc2a4('0x2f')](_0x187f96,function(_0x3f6299){if(_0x3f6299[_0xc2a4('0x32')]!==_0xc2a4('0x40')){var _0x36757c={};_0x36757c[_0x3f6299[_0xc2a4('0x2d')]]={'$like':'%'+_0x35315a['query'][_0xc2a4('0x3e')]+'%'};return _0x36757c;}})});}_0x45042b=_['merge']({},_0x45042b,_0x35315a[_0xc2a4('0x41')]);var _0x57c1ec={'where':_0x45042b[_0xc2a4('0x3c')]};return db[_0xc2a4('0x42')][_0xc2a4('0x26')](_0x57c1ec)[_0xc2a4('0x2a')](function(_0x43461c){_0x47934b[_0xc2a4('0x26')]=_0x43461c;if(_0x35315a[_0xc2a4('0x35')][_0xc2a4('0x43')]){_0x45042b[_0xc2a4('0x44')]=[{'all':!![]}];}return db[_0xc2a4('0x42')][_0xc2a4('0x45')](_0x45042b);})['then'](function(_0x397929){_0x47934b[_0xc2a4('0x46')]=_0x397929;return _0x47934b;})[_0xc2a4('0x2a')](respondWithFilteredResult(_0x32a184,_0x45042b))['catch'](handleError(_0x32a184,null));};exports[_0xc2a4('0x47')]=function(_0x1d805f,_0x3a2585){var _0x413ad4={'raw':!![],'where':{'id':_0x1d805f[_0xc2a4('0x48')]['id']}},_0x382e29={};_0x382e29[_0xc2a4('0x33')]=_[_0xc2a4('0x34')](db[_0xc2a4('0x42')][_0xc2a4('0x30')]);_0x382e29[_0xc2a4('0x35')]=_['keys'](_0x1d805f[_0xc2a4('0x35')]);_0x382e29[_0xc2a4('0x49')]=_[_0xc2a4('0x36')](_0x382e29['model'],_0x382e29[_0xc2a4('0x35')]);_0x413ad4[_0xc2a4('0x38')]=_[_0xc2a4('0x36')](_0x382e29[_0xc2a4('0x33')],qs[_0xc2a4('0x37')](_0x1d805f[_0xc2a4('0x35')][_0xc2a4('0x37')]));_0x413ad4[_0xc2a4('0x38')]=_0x413ad4[_0xc2a4('0x38')][_0xc2a4('0x39')]?_0x413ad4[_0xc2a4('0x38')]:_0x382e29[_0xc2a4('0x33')];if(_0x1d805f[_0xc2a4('0x35')][_0xc2a4('0x43')]){_0x413ad4['include']=[{'all':!![]}];}_0x413ad4=_[_0xc2a4('0x3f')]({},_0x413ad4,_0x1d805f[_0xc2a4('0x41')]);return db[_0xc2a4('0x42')]['find'](_0x413ad4)[_0xc2a4('0x2a')](handleEntityNotFound(_0x3a2585,null))['then'](respondWithResult(_0x3a2585,null))[_0xc2a4('0x4a')](handleError(_0x3a2585,null));};exports['create']=function(_0x5725b4,_0x2b8c2c){return db[_0xc2a4('0x42')][_0xc2a4('0x4b')](_0x5725b4[_0xc2a4('0x4c')],{})['then'](respondWithResult(_0x2b8c2c,0xc9))[_0xc2a4('0x4a')](handleError(_0x2b8c2c,null));};exports[_0xc2a4('0x4d')]=function(_0x2996c7,_0x4cd54c){if(_0x2996c7[_0xc2a4('0x4c')]['id']){delete _0x2996c7['body']['id'];}return db[_0xc2a4('0x42')]['find']({'where':{'id':_0x2996c7['params']['id']}})[_0xc2a4('0x2a')](handleEntityNotFound(_0x4cd54c,null))[_0xc2a4('0x2a')](saveUpdates(_0x2996c7[_0xc2a4('0x4c')],null))[_0xc2a4('0x2a')](respondWithResult(_0x4cd54c,null))['catch'](handleError(_0x4cd54c,null));};exports[_0xc2a4('0x4e')]=function(_0x518f55,_0x27ad06){return db[_0xc2a4('0x42')][_0xc2a4('0x4f')]({'where':{'id':_0x518f55[_0xc2a4('0x48')]['id']}})[_0xc2a4('0x2a')](handleEntityNotFound(_0x27ad06,null))[_0xc2a4('0x2a')](removeEntity(_0x27ad06,null))[_0xc2a4('0x4a')](handleError(_0x27ad06,null));};exports[_0xc2a4('0x50')]=function(_0xa25e58,_0x44d839){return db[_0xc2a4('0x42')]['describe']()[_0xc2a4('0x2a')](respondWithResult(_0x44d839,null))['catch'](handleError(_0x44d839,null));};function wrapUser(_0x20ecac){return function(_0x4b8b19){var _0x3bdc31=_0x20ecac[_0xc2a4('0x51')]({'plain':!![]});_0x3bdc31[_0xc2a4('0x52')]=[];if(_0x4b8b19){_0x3bdc31[_0xc2a4('0x53')]=_0x4b8b19['createdAt'];_0x3bdc31[_0xc2a4('0x54')]=_0x4b8b19;}else{_0x3bdc31['lastMessageAt']=moment(0x0)[_0xc2a4('0x55')](_0xc2a4('0x56'));_0x3bdc31['lastMessage']={};}return _0x3bdc31;};}exports[_0xc2a4('0x57')]=function(_0x27b9ad,_0x21f60e,_0x4aaf67){var _0x5afa22=[];return db[_0xc2a4('0x58')][_0xc2a4('0x45')]({'where':{'role':[_0xc2a4('0x59'),_0xc2a4('0x5a'),_0xc2a4('0x5b')]},'attributes':['id',_0xc2a4('0x5c'),_0xc2a4('0x2d'),_0xc2a4('0x5d'),_0xc2a4('0x5e'),_0xc2a4('0x5f'),'online',_0xc2a4('0x60'),_0xc2a4('0x61'),_0xc2a4('0x62')],'order':qs[_0xc2a4('0x3b')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xc2a4('0x63'),'attributes':['id',_0xc2a4('0x2d'),_0xc2a4('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x15ca9e){if(_0x15ca9e){var _0x4057c4=_0x27b9ad[_0xc2a4('0x5b')][_0xc2a4('0x51')]({'plain':!![]});if(!_0x4057c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4057c4[_0xc2a4('0x5d')]===_0xc2a4('0x5b')){return db[_0xc2a4('0x64')][_0xc2a4('0x4f')]({'where':{'name':_0xc2a4('0x65'),'userProfileId':_0x4057c4[_0xc2a4('0x66')]},'raw':!![]})[_0xc2a4('0x2a')](function(_0x3b7b99){if(_0x3b7b99){if(_0x3b7b99[_0xc2a4('0x67')]===0x0){return db[_0xc2a4('0x68')][_0xc2a4('0x45')]({'where':{'sectionId':_0x3b7b99['id']},'raw':!![]})[_0xc2a4('0x2a')](function(_0x44d743){var _0x43897f=[];if(_[_0xc2a4('0x69')](_0x44d743)){_0x43897f=_[_0xc2a4('0x3e')](_0x15ca9e,function(_0x17292a){if(_0x17292a[_0xc2a4('0x5d')]!==_0xc2a4('0x59')){return _0x17292a;}});return _0x43897f;}else{for(var _0x195c59=0x0;_0x195c59<_0x15ca9e['length'];_0x195c59++){var _0x3b97ab=_0x15ca9e[_0x195c59];if(_0x3b97ab['role']===_0xc2a4('0x59')){var _0xd0496d=_[_0xc2a4('0x4f')](_0x44d743,function(_0x2bcc73){return _0x2bcc73[_0xc2a4('0x6a')]===_0x3b97ab['id'];});if(_0xd0496d)_0x43897f[_0xc2a4('0x6b')](_0x3b97ab);}else{_0x43897f[_0xc2a4('0x6b')](_0x3b97ab);}}return _0x43897f;}});}else{return _0x15ca9e;}}else{var _0x1544a3=_['filter'](_0x15ca9e,function(_0x3556e3){if(_0x3556e3['role']!==_0xc2a4('0x59')){return _0x3556e3;}});return _0x1544a3;}});}else{return _0x15ca9e;}}})[_0xc2a4('0x2a')](function(_0x400ea9){var _0x281b11=[];if(_0x400ea9){_0x5afa22=_0x400ea9;for(var _0x29fbad=0x0;_0x29fbad<_0x400ea9[_0xc2a4('0x39')];_0x29fbad+=0x1){_0x5afa22[_0x29fbad][_0xc2a4('0x52')]=[];_0x281b11['push'](db['ChatInternalMessage'][_0xc2a4('0x4f')]({'where':{'FromId':[_0x27b9ad['user']['id'],_0x400ea9[_0x29fbad]['id']],'ToId':[_0x27b9ad[_0xc2a4('0x5b')]['id'],_0x400ea9[_0x29fbad]['id']],'ChatGroupId':null},'attributes':['id',_0xc2a4('0x6c'),_0xc2a4('0x6d'),'ToId',_0xc2a4('0x6e'),'body'],'order':qs[_0xc2a4('0x3b')](_0xc2a4('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc2a4('0x2a')](wrapUser(_0x400ea9[_0x29fbad])));}return BPromise['all'](_0x281b11);}return[];})[_0xc2a4('0x2a')](function(_0x15ba2f){return{'rows':_0x15ba2f,'count':_0x15ba2f[_0xc2a4('0x39')]};})[_0xc2a4('0x2a')](respondWithResult(_0x21f60e,null))[_0xc2a4('0x4a')](handleError(_0x21f60e,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 5fc1845..4598863 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 _0xfd6e=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x314a07,_0x5bf266){var _0x5ecb57=function(_0x1416bf){while(--_0x1416bf){_0x314a07['push'](_0x314a07['shift']());}};_0x5ecb57(++_0x5bf266);}(_0xfd6e,0x1b0));var _0xefd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd6e[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0xefd6('0x0'));var ChatInternalMessage=require(_0xefd6('0x1'))['db'][_0xefd6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xefd6('0x3')](0x0);var events={'afterCreate':_0xefd6('0x4'),'afterUpdate':_0xefd6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x433511){return function(_0x839f34,_0x1eb842,_0x2df7ed){ChatInternalMessageEvents[_0xefd6('0x6')](_0x433511+':'+_0x839f34['id'],_0x839f34);ChatInternalMessageEvents[_0xefd6('0x6')](_0x433511,_0x839f34);_0x2df7ed(null);};}for(var e in events){if(events[_0xefd6('0x7')](e)){var event=events[e];ChatInternalMessage[_0xefd6('0x8')](e,emitEvent(event));}}module[_0xefd6('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x774a=['emit','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x774a,0xa2));var _0xa774=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x774a[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xa774('0x0'))['db'][_0xa774('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa774('0x2')](0x0);var events={'afterCreate':_0xa774('0x3'),'afterUpdate':_0xa774('0x4'),'afterDestroy':_0xa774('0x5')};function emitEvent(_0x453c98){return function(_0x24b340,_0x16c354,_0x1a0abb){ChatInternalMessageEvents[_0xa774('0x6')](_0x453c98+':'+_0x24b340['id'],_0x24b340);ChatInternalMessageEvents[_0xa774('0x6')](_0x453c98,_0x24b340);_0x1a0abb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xa774('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index cf32996..b8d6e74 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 _0x4213=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util'];(function(_0x10616d,_0x55e992){var _0x2b9b47=function(_0x34c345){while(--_0x34c345){_0x10616d['push'](_0x10616d['shift']());}};_0x2b9b47(++_0x55e992);}(_0x4213,0x140));var _0x3421=function(_0x1532ae,_0xa14bcc){_0x1532ae=_0x1532ae-0x0;var _0x5c09d1=_0x4213[_0x1532ae];return _0x5c09d1;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require(_0x3421('0x7'));var rimraf=require(_0x3421('0x8'));var config=require(_0x3421('0x9'));var attributes=require(_0x3421('0xa'));module['exports']=function(_0x1566de,_0xe1d745){return _0x1566de['define'](_0x3421('0xb'),attributes,{'tableName':_0x3421('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3421('0xd')});};
\ No newline at end of file
+var _0x2a49=['bluebird','request-promise','path','../../config/environment','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x2aeedd,_0x1951b0){var _0x1ae237=function(_0x48273d){while(--_0x48273d){_0x2aeedd['push'](_0x2aeedd['shift']());}};_0x1ae237(++_0x1951b0);}(_0x2a49,0x97));var _0x92a4=function(_0x3a19c0,_0x5cd24c){_0x3a19c0=_0x3a19c0-0x0;var _0x21763b=_0x2a49[_0x3a19c0];return _0x21763b;};'use strict';var _=require(_0x92a4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x92a4('0x1'));var moment=require(_0x92a4('0x2'));var BPromise=require(_0x92a4('0x3'));var rp=require(_0x92a4('0x4'));var fs=require('fs');var path=require(_0x92a4('0x5'));var rimraf=require('rimraf');var config=require(_0x92a4('0x6'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x158ca6,_0x1be390){return _0x158ca6[_0x92a4('0x7')](_0x92a4('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x92a4('0x9'),'collate':_0x92a4('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index a9dc3f9..48001ff 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 _0xd370=['rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0xd370,0x1d3));var _0x0d37=function(_0x28beaf,_0x122959){_0x28beaf=_0x28beaf-0x0;var _0x2df201=_0xd370[_0x28beaf];return _0x2df201;};'use strict';var _=require(_0x0d37('0x0'));var util=require(_0x0d37('0x1'));var moment=require(_0x0d37('0x2'));var BPromise=require(_0x0d37('0x3'));var rs=require(_0x0d37('0x4'));var fs=require('fs');var Redis=require(_0x0d37('0x5'));var db=require(_0x0d37('0x6'))['db'];var utils=require(_0x0d37('0x7'));var logger=require(_0x0d37('0x8'))(_0x0d37('0x9'));var config=require(_0x0d37('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0d37('0xb')][_0x0d37('0xc')]({'port':0x232a});config[_0x0d37('0xd')]=_[_0x0d37('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0d37('0xf'))(new Redis(config[_0x0d37('0xd')]));require('./chatInternalMessage.socket')[_0x0d37('0x10')](socket);function respondWithRpcPromise(_0x56a47d,_0x49d2e0,_0x14eede){return new BPromise(function(_0x2afe78,_0x5c1a46){return client[_0x0d37('0x11')](_0x56a47d,_0x14eede)['then'](function(_0x5847f4){logger['info'](_0x0d37('0x12'),_0x49d2e0,_0x0d37('0x13'));logger[_0x0d37('0x14')](_0x0d37('0x15'),_0x49d2e0,'request\x20sent',JSON['stringify'](_0x5847f4));if(_0x5847f4[_0x0d37('0x16')]){if(_0x5847f4[_0x0d37('0x16')][_0x0d37('0x17')]===0x1f4){logger[_0x0d37('0x16')](_0x0d37('0x12'),_0x49d2e0,_0x5847f4['error'][_0x0d37('0x18')]);return _0x5c1a46(_0x5847f4[_0x0d37('0x16')][_0x0d37('0x18')]);}logger[_0x0d37('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x49d2e0,_0x5847f4['error'][_0x0d37('0x18')]);return _0x2afe78(_0x5847f4[_0x0d37('0x16')]['message']);}else{logger[_0x0d37('0x19')](_0x0d37('0x12'),_0x49d2e0,'request\x20sent');_0x2afe78(_0x5847f4[_0x0d37('0x1a')][_0x0d37('0x18')]);}})[_0x0d37('0x1b')](function(_0x5db285){logger[_0x0d37('0x16')](_0x0d37('0x12'),_0x49d2e0,_0x5db285);_0x5c1a46(_0x5db285);});});}
\ No newline at end of file
+var _0xb0d2=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x155506,_0x202f81){var _0x14b973=function(_0x560bd2){while(--_0x560bd2){_0x155506['push'](_0x155506['shift']());}};_0x14b973(++_0x202f81);}(_0xb0d2,0x1cf));var _0x2b0d=function(_0x12df7e,_0xa01ff2){_0x12df7e=_0x12df7e-0x0;var _0x54603f=_0xb0d2[_0x12df7e];return _0x54603f;};'use strict';var _=require(_0x2b0d('0x0'));var util=require(_0x2b0d('0x1'));var moment=require(_0x2b0d('0x2'));var BPromise=require(_0x2b0d('0x3'));var rs=require(_0x2b0d('0x4'));var fs=require('fs');var Redis=require(_0x2b0d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b0d('0x6'));var logger=require('../../config/logger')(_0x2b0d('0x7'));var config=require(_0x2b0d('0x8'));var jayson=require(_0x2b0d('0x9'));var client=jayson['client'][_0x2b0d('0xa')]({'port':0x232a});config[_0x2b0d('0xb')]=_['defaults'](config[_0x2b0d('0xb')],{'host':_0x2b0d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b0d('0xb')]));require(_0x2b0d('0xd'))['register'](socket);function respondWithRpcPromise(_0x1621d8,_0xf2ad86,_0x123adc){return new BPromise(function(_0x2f4cc7,_0xea8ef3){return client[_0x2b0d('0xe')](_0x1621d8,_0x123adc)[_0x2b0d('0xf')](function(_0x322a01){logger[_0x2b0d('0x10')](_0x2b0d('0x11'),_0xf2ad86,_0x2b0d('0x12'));logger[_0x2b0d('0x13')](_0x2b0d('0x14'),_0xf2ad86,'request\x20sent',JSON[_0x2b0d('0x15')](_0x322a01));if(_0x322a01['error']){if(_0x322a01[_0x2b0d('0x16')][_0x2b0d('0x17')]===0x1f4){logger[_0x2b0d('0x16')](_0x2b0d('0x11'),_0xf2ad86,_0x322a01[_0x2b0d('0x16')][_0x2b0d('0x18')]);return _0xea8ef3(_0x322a01['error'][_0x2b0d('0x18')]);}logger[_0x2b0d('0x16')](_0x2b0d('0x11'),_0xf2ad86,_0x322a01[_0x2b0d('0x16')]['message']);return _0x2f4cc7(_0x322a01['error'][_0x2b0d('0x18')]);}else{logger[_0x2b0d('0x10')](_0x2b0d('0x11'),_0xf2ad86,_0x2b0d('0x12'));_0x2f4cc7(_0x322a01['result'][_0x2b0d('0x18')]);}})[_0x2b0d('0x19')](function(_0x58ffc8){logger[_0x2b0d('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0xf2ad86,_0x58ffc8);_0xea8ef3(_0x58ffc8);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index e2b8527..297e73e 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 _0xc960=['emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc960,0x114));var _0x0c96=function(_0x12fae2,_0x4045c1){_0x12fae2=_0x12fae2-0x0;var _0x5d6abc=_0xc960[_0x12fae2];return _0x5d6abc;};'use strict';var ChatInternalMessageEvents=require(_0x0c96('0x0'));var events=[_0x0c96('0x1'),_0x0c96('0x2'),_0x0c96('0x3')];function createListener(_0x262812,_0x43699c){return function(_0x1200aa){_0x43699c[_0x0c96('0x4')](_0x262812,_0x1200aa);};}function removeListener(_0x296beb,_0x495e7a){return function(){ChatInternalMessageEvents['removeListener'](_0x296beb,_0x495e7a);};}exports[_0x0c96('0x5')]=function(_0x3b8d56){for(var _0x1aa866=0x0,_0x5886e8=events[_0x0c96('0x6')];_0x1aa866<_0x5886e8;_0x1aa866++){var _0x573004=events[_0x1aa866];var _0x10a702=createListener(_0x0c96('0x7')+_0x573004,_0x3b8d56);ChatInternalMessageEvents['on'](_0x573004,_0x10a702);}};
\ No newline at end of file
+var _0xddb5=['./chatInternalMessage.events','save','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xddb5,0x108));var _0x5ddb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xddb5[_0x3947c9];return _0x2e7871;};'use strict';var ChatInternalMessageEvents=require(_0x5ddb('0x0'));var events=[_0x5ddb('0x1'),'remove',_0x5ddb('0x2')];function createListener(_0x4b638f,_0x3e2efe){return function(_0x37c0f5){_0x3e2efe[_0x5ddb('0x3')](_0x4b638f,_0x37c0f5);};}function removeListener(_0x3cf3eb,_0x456bbb){return function(){ChatInternalMessageEvents[_0x5ddb('0x4')](_0x3cf3eb,_0x456bbb);};}exports[_0x5ddb('0x5')]=function(_0x193dab){for(var _0x46506f=0x0,_0x16caa3=events[_0x5ddb('0x6')];_0x46506f<_0x16caa3;_0x46506f++){var _0x478d1f=events[_0x46506f];var _0x54466f=createListener(_0x5ddb('0x7')+_0x478d1f,_0x193dab);ChatInternalMessageEvents['on'](_0x478d1f,_0x54466f);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 6f0f1e2..f59af33 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 _0x30f0=['index','/describe','describe','/users','show','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x30f0,0x12b));var _0x030f=function(_0x3e9784,_0xf05e6e){_0x3e9784=_0x3e9784-0x0;var _0x2994a1=_0x30f0[_0x3e9784];return _0x2994a1;};'use strict';var multer=require(_0x030f('0x0'));var util=require(_0x030f('0x1'));var path=require(_0x030f('0x2'));var timeout=require(_0x030f('0x3'));var express=require(_0x030f('0x4'));var router=express[_0x030f('0x5')]();var fs_extra=require(_0x030f('0x6'));var auth=require(_0x030f('0x7'));var interaction=require(_0x030f('0x8'));var config=require(_0x030f('0x9'));var controller=require(_0x030f('0xa'));router[_0x030f('0xb')]('/',auth[_0x030f('0xc')](),controller[_0x030f('0xd')]);router[_0x030f('0xb')](_0x030f('0xe'),auth[_0x030f('0xc')](),controller[_0x030f('0xf')]);router[_0x030f('0xb')](_0x030f('0x10'),auth[_0x030f('0xc')](),controller['getUsers']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x030f('0x11')]);router[_0x030f('0x12')]('/',auth[_0x030f('0xc')](),controller[_0x030f('0x13')]);router[_0x030f('0x14')](_0x030f('0x15'),controller['update']);router[_0x030f('0x16')](_0x030f('0x15'),auth[_0x030f('0xc')](),controller['destroy']);module[_0x030f('0x17')]=router;
\ No newline at end of file
+var _0xdee0=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','show','post','create','put','update'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0xdee0,0xdb));var _0x0dee=function(_0x226920,_0x21ce02){_0x226920=_0x226920-0x0;var _0x18b964=_0xdee0[_0x226920];return _0x18b964;};'use strict';var multer=require(_0x0dee('0x0'));var util=require(_0x0dee('0x1'));var path=require(_0x0dee('0x2'));var timeout=require(_0x0dee('0x3'));var express=require(_0x0dee('0x4'));var router=express[_0x0dee('0x5')]();var fs_extra=require(_0x0dee('0x6'));var auth=require(_0x0dee('0x7'));var interaction=require(_0x0dee('0x8'));var config=require(_0x0dee('0x9'));var controller=require(_0x0dee('0xa'));router['get']('/',auth[_0x0dee('0xb')](),controller[_0x0dee('0xc')]);router[_0x0dee('0xd')](_0x0dee('0xe'),auth['isAuthenticated'](),controller[_0x0dee('0xf')]);router[_0x0dee('0xd')](_0x0dee('0x10'),auth['isAuthenticated'](),controller[_0x0dee('0x11')]);router[_0x0dee('0xd')](_0x0dee('0x12'),auth['isAuthenticated'](),controller[_0x0dee('0x13')]);router[_0x0dee('0x14')]('/',auth[_0x0dee('0xb')](),controller[_0x0dee('0x15')]);router[_0x0dee('0x16')](_0x0dee('0x12'),controller[_0x0dee('0x17')]);router[_0x0dee('0x18')](_0x0dee('0x12'),auth[_0x0dee('0xb')](),controller[_0x0dee('0x19')]);module[_0x0dee('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 774dd2e..89e20a3 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 _0xd2bf=['DATE','STRING','TEXT','sequelize','BOOLEAN','out'];(function(_0x457d1a,_0x6b408d){var _0x51388c=function(_0x478abe){while(--_0x478abe){_0x457d1a['push'](_0x457d1a['shift']());}};_0x51388c(++_0x6b408d);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0xd2bf[_0x199bc4];return _0x136ffb;};'use strict';var Sequelize=require(_0xfd2b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfd2b('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfd2b('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfd2b('0x2')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xfd2b('0x3')]},'providerName':{'type':Sequelize[_0xfd2b('0x4')]},'providerResponse':{'type':Sequelize[_0xfd2b('0x5')]}};
\ No newline at end of file
+var _0x659c=['medium','BOOLEAN','ENUM','out','STRING','TEXT','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x659c,0x1aa));var _0xc659=function(_0x4aa348,_0x1659bd){_0x4aa348=_0x4aa348-0x0;var _0x3d1670=_0x659c[_0x4aa348];return _0x3d1670;};'use strict';var Sequelize=require(_0xc659('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xc659('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc659('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc659('0x3')]('in',_0xc659('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc659('0x5')]},'providerResponse':{'type':Sequelize[_0xc659('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index a44dc26..f0074d2 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 _0x068a=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','length','find','create','body','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','RejectMessage','rejectMessage','Sequelize','contact','User','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x1c81d7,_0x23fb0f){var _0x52961e=function(_0x2b0022){while(--_0x2b0022){_0x1c81d7['push'](_0x1c81d7['shift']());}};_0x52961e(++_0x23fb0f);}(_0x068a,0xfe));var _0xa068=function(_0x30fddd,_0x16fe5f){_0x30fddd=_0x30fddd-0x0;var _0x3005e3=_0x068a[_0x30fddd];return _0x3005e3;};'use strict';var emlformat=require(_0xa068('0x0'));var rimraf=require(_0xa068('0x1'));var zipdir=require(_0xa068('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa068('0x3'));var BPromise=require(_0xa068('0x4'));var Mustache=require(_0xa068('0x5'));var util=require('util');var path=require(_0xa068('0x6'));var sox=require('sox');var csv=require(_0xa068('0x7'));var ejs=require(_0xa068('0x8'));var fs=require('fs');var fs_extra=require(_0xa068('0x9'));var _=require(_0xa068('0xa'));var squel=require('squel');var crypto=require(_0xa068('0xb'));var jsforce=require(_0xa068('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa068('0xd'));var Papa=require(_0xa068('0xe'));var Redis=require(_0xa068('0xf'));var authService=require(_0xa068('0x10'));var qs=require(_0xa068('0x11'));var as=require(_0xa068('0x12'));var hardwareService=require(_0xa068('0x13'));var logger=require(_0xa068('0x14'))('api');var utils=require(_0xa068('0x15'));var config=require(_0xa068('0x16'));var licenseUtil=require(_0xa068('0x17'));var db=require(_0xa068('0x18'))['db'];config[_0xa068('0x19')]=_[_0xa068('0x1a')](config['redis'],{'host':_0xa068('0x1b'),'port':0x18eb});var socket=require(_0xa068('0x1c'))(new Redis(config[_0xa068('0x19')]));require(_0xa068('0x1d'))[_0xa068('0x1e')](socket);var jayson=require(_0xa068('0x1f'));var client=jayson[_0xa068('0x20')][_0xa068('0x21')]({'port':0x232c});var client9002=jayson[_0xa068('0x20')][_0xa068('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1246a1,_0x32391e,_0x8251c6,_0x59d4f0){return new BPromise(function(_0x1eef08,_0x58f0e3){var _0x1860d7=_0x59d4f0||client;return _0x1860d7[_0xa068('0x22')](_0x1246a1,_0x8251c6)['then'](function(_0xbd45db){logger[_0xa068('0x23')](_0xa068('0x24'),_0x32391e,_0xa068('0x25'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x32391e,_0xa068('0x25'),JSON[_0xa068('0x26')](_0xbd45db));if(_0xbd45db['error']){if(_0xbd45db[_0xa068('0x27')]['code']===0x1f4){logger[_0xa068('0x27')](_0xa068('0x24'),_0x32391e,_0xbd45db[_0xa068('0x27')][_0xa068('0x28')]);return _0x58f0e3(_0xbd45db[_0xa068('0x27')][_0xa068('0x28')]);}logger[_0xa068('0x27')](_0xa068('0x24'),_0x32391e,_0xbd45db[_0xa068('0x27')]['message']);return _0x1eef08(_0xbd45db['error'][_0xa068('0x28')]);}else{logger[_0xa068('0x23')](_0xa068('0x24'),_0x32391e,_0xa068('0x25'));_0x1eef08(_0xbd45db['result']['message']);}})[_0xa068('0x29')](function(_0x3523a8){logger['error'](_0xa068('0x24'),_0x32391e,_0x3523a8);_0x58f0e3(_0x3523a8);});});}function respondWithStatusCode(_0x4dc0b0,_0x14e25e){_0x14e25e=_0x14e25e||0xcc;return function(_0x27455d){if(_0x27455d){return _0x4dc0b0['sendStatus'](_0x14e25e);}return _0x4dc0b0['status'](_0x14e25e)['end']();};}function respondWithResult(_0x42b4b0,_0x5b4b5b){_0x5b4b5b=_0x5b4b5b||0xc8;return function(_0x72acd6){if(_0x72acd6){return _0x42b4b0[_0xa068('0x2a')](_0x5b4b5b)[_0xa068('0x2b')](_0x72acd6);}};}function respondWithFilteredResult(_0x39a785,_0x5d79d8){return function(_0x3c15e2){if(_0x3c15e2){var _0xa305a5=typeof _0x5d79d8[_0xa068('0x2c')]===_0xa068('0x2d')&&typeof _0x5d79d8[_0xa068('0x2e')]===_0xa068('0x2d');var _0x615939=_0x3c15e2[_0xa068('0x2f')];var _0x2ca324=_0xa305a5?0x0:_0x5d79d8[_0xa068('0x2c')];var _0x5cf276=_0xa305a5?_0x3c15e2['count']:_0x5d79d8[_0xa068('0x2c')]+_0x5d79d8['limit'];var _0x53d19f;if(_0x5cf276>=_0x615939){_0x5cf276=_0x615939;_0x53d19f=0xc8;}else{_0x53d19f=0xce;}_0x39a785[_0xa068('0x2a')](_0x53d19f);return _0x39a785[_0xa068('0x30')](_0xa068('0x31'),_0x2ca324+'-'+_0x5cf276+'/'+_0x615939)[_0xa068('0x2b')](_0x3c15e2);}return null;};}function patchUpdates(_0x106b10){return function(_0x12b1bf){try{jsonpatch[_0xa068('0x32')](_0x12b1bf,_0x106b10,!![]);}catch(_0x4abb8a){return BPromise[_0xa068('0x33')](_0x4abb8a);}return _0x12b1bf[_0xa068('0x34')]();};}function saveUpdates(_0x1c8da8,_0x379bd6){return function(_0x405474){if(_0x405474){return _0x405474[_0xa068('0x35')](_0x1c8da8)[_0xa068('0x36')](function(_0x838f58){return _0x838f58;});}return null;};}function removeEntity(_0x2cc4da,_0x31567a){return function(_0x2c8280){if(_0x2c8280){return _0x2c8280[_0xa068('0x37')]()['then'](function(){_0x2cc4da[_0xa068('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0f5f,_0x524f25){return function(_0x67a15f){if(!_0x67a15f){_0x2e0f5f[_0xa068('0x38')](0x194);}return _0x67a15f;};}function handleError(_0x24406b,_0x3a9db6){_0x3a9db6=_0x3a9db6||0x1f4;return function(_0xde8dec){logger[_0xa068('0x27')](_0xde8dec[_0xa068('0x39')]);if(_0xde8dec[_0xa068('0x3a')]){delete _0xde8dec[_0xa068('0x3a')];}_0x24406b[_0xa068('0x2a')](_0x3a9db6)[_0xa068('0x3b')](_0xde8dec);};}exports['index']=function(_0x3aea29,_0x4d9b3e){var _0x2f1117={},_0xe3b1b8={},_0x2525c8={'count':0x0,'rows':[]};var _0x38f756=_[_0xa068('0x3c')](db[_0xa068('0x3d')][_0xa068('0x3e')],function(_0x35bbf2){return{'name':_0x35bbf2[_0xa068('0x3f')],'type':_0x35bbf2['type']['key']};});_0xe3b1b8[_0xa068('0x40')]=_[_0xa068('0x3c')](_0x38f756,'name');_0xe3b1b8['query']=_['keys'](_0x3aea29[_0xa068('0x41')]);_0xe3b1b8[_0xa068('0x42')]=_[_0xa068('0x43')](_0xe3b1b8[_0xa068('0x40')],_0xe3b1b8[_0xa068('0x41')]);_0x2f1117[_0xa068('0x44')]=_[_0xa068('0x43')](_0xe3b1b8[_0xa068('0x40')],qs[_0xa068('0x45')](_0x3aea29[_0xa068('0x41')][_0xa068('0x45')]));_0x2f1117[_0xa068('0x44')]=_0x2f1117[_0xa068('0x44')]['length']?_0x2f1117[_0xa068('0x44')]:_0xe3b1b8['model'];if(!_0x3aea29['query'][_0xa068('0x46')]('nolimit')){_0x2f1117[_0xa068('0x2e')]=qs[_0xa068('0x2e')](_0x3aea29[_0xa068('0x41')]['limit']);_0x2f1117[_0xa068('0x2c')]=qs[_0xa068('0x2c')](_0x3aea29[_0xa068('0x41')]['offset']);}_0x2f1117['order']=qs[_0xa068('0x47')](_0x3aea29[_0xa068('0x41')][_0xa068('0x47')]);_0x2f1117['where']=qs[_0xa068('0x42')](_[_0xa068('0x48')](_0x3aea29[_0xa068('0x41')],_0xe3b1b8[_0xa068('0x42')]),_0x38f756);if(_0x3aea29['query']['filter']){_0x2f1117[_0xa068('0x49')]=_['merge'](_0x2f1117[_0xa068('0x49')],{'$or':_[_0xa068('0x3c')](_0x38f756,function(_0x54c2c5){if(_0x54c2c5[_0xa068('0x4a')]!==_0xa068('0x4b')){var _0x31cfd7={};_0x31cfd7[_0x54c2c5[_0xa068('0x3a')]]={'$like':'%'+_0x3aea29[_0xa068('0x41')]['filter']+'%'};return _0x31cfd7;}})});}_0x2f1117=_[_0xa068('0x4c')]({},_0x2f1117,_0x3aea29[_0xa068('0x4d')]);var _0x1d6736={'where':_0x2f1117[_0xa068('0x49')]};return db[_0xa068('0x3d')]['count'](_0x1d6736)[_0xa068('0x36')](function(_0x3655c6){_0x2525c8['count']=_0x3655c6;if(_0x3aea29['query'][_0xa068('0x4e')]){_0x2f1117['include']=[{'all':!![]}];}return db[_0xa068('0x3d')][_0xa068('0x4f')](_0x2f1117);})['then'](function(_0x32028b){_0x2525c8[_0xa068('0x50')]=_0x32028b;return _0x2525c8;})['then'](respondWithFilteredResult(_0x4d9b3e,_0x2f1117))[_0xa068('0x29')](handleError(_0x4d9b3e,null));};exports[_0xa068('0x51')]=function(_0x3d16c8,_0x3533b0){var _0x432594={'raw':!![],'where':{'id':_0x3d16c8[_0xa068('0x52')]['id']}},_0x3efd99={};_0x3efd99[_0xa068('0x40')]=_[_0xa068('0x53')](db[_0xa068('0x3d')][_0xa068('0x3e')]);_0x3efd99[_0xa068('0x41')]=_['keys'](_0x3d16c8[_0xa068('0x41')]);_0x3efd99[_0xa068('0x42')]=_[_0xa068('0x43')](_0x3efd99['model'],_0x3efd99[_0xa068('0x41')]);_0x432594[_0xa068('0x44')]=_['intersection'](_0x3efd99[_0xa068('0x40')],qs[_0xa068('0x45')](_0x3d16c8[_0xa068('0x41')][_0xa068('0x45')]));_0x432594[_0xa068('0x44')]=_0x432594['attributes'][_0xa068('0x54')]?_0x432594[_0xa068('0x44')]:_0x3efd99['model'];if(_0x3d16c8[_0xa068('0x41')][_0xa068('0x4e')]){_0x432594['include']=[{'all':!![]}];}_0x432594=_[_0xa068('0x4c')]({},_0x432594,_0x3d16c8['options']);return db[_0xa068('0x3d')][_0xa068('0x55')](_0x432594)[_0xa068('0x36')](handleEntityNotFound(_0x3533b0,null))[_0xa068('0x36')](respondWithResult(_0x3533b0,null))[_0xa068('0x29')](handleError(_0x3533b0,null));};exports[_0xa068('0x56')]=function(_0x20c793,_0x1d1a6d){return db[_0xa068('0x3d')][_0xa068('0x56')](_0x20c793[_0xa068('0x57')],{})[_0xa068('0x36')](respondWithResult(_0x1d1a6d,0xc9))[_0xa068('0x29')](handleError(_0x1d1a6d,null));};exports[_0xa068('0x35')]=function(_0x3ffba6,_0x4cd5f3){if(_0x3ffba6[_0xa068('0x57')]['id']){delete _0x3ffba6[_0xa068('0x57')]['id'];}return db[_0xa068('0x3d')][_0xa068('0x55')]({'where':{'id':_0x3ffba6['params']['id']}})[_0xa068('0x36')](handleEntityNotFound(_0x4cd5f3,null))[_0xa068('0x36')](saveUpdates(_0x3ffba6[_0xa068('0x57')],null))[_0xa068('0x36')](respondWithResult(_0x4cd5f3,null))[_0xa068('0x29')](handleError(_0x4cd5f3,null));};exports[_0xa068('0x37')]=function(_0xf6b510,_0x27be55){return db[_0xa068('0x3d')][_0xa068('0x55')]({'where':{'id':_0xf6b510['params']['id']}})[_0xa068('0x36')](handleEntityNotFound(_0x27be55,null))['then'](removeEntity(_0x27be55,null))['catch'](handleError(_0x27be55,null));};exports[_0xa068('0x58')]=function(_0x4c64cd,_0x2d375c){return db['ChatMessage'][_0xa068('0x58')]()[_0xa068('0x36')](respondWithResult(_0x2d375c,null))[_0xa068('0x29')](handleError(_0x2d375c,null));};var interaction_log=require(_0xa068('0x14'))(_0xa068('0x59'));exports['accept']=function(_0x242f4c,_0x58087b,_0x49b49c){var _0x563238={'agent':{},'channel':_0xa068('0x5a')};if(_0x242f4c[_0xa068('0x57')]['id']){delete _0x242f4c[_0xa068('0x57')]['id'];}_0x242f4c['body']['read']=!![];_0x242f4c[_0xa068('0x57')][_0xa068('0x5b')]=moment()[_0xa068('0x5c')](_0xa068('0x5d'));_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')]=_0x242f4c['body']['UserId']||_0x242f4c[_0xa068('0x5f')]['id'];_0x563238[_0xa068('0x60')]['id']=_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')];return db[_0xa068('0x3d')][_0xa068('0x55')]({'where':{'id':_0x242f4c[_0xa068('0x52')]['id'],'UserId':null}})[_0xa068('0x36')](handleEntityNotFound(_0x58087b,null))[_0xa068('0x36')](saveUpdates(_0x242f4c[_0xa068('0x57')],null))['then'](function(_0x24e995){if(_0x24e995){_0x563238[_0xa068('0x28')]=_0x24e995[_0xa068('0x61')]({'plain':!![]});return db[_0xa068('0x62')][_0xa068('0x55')]({'where':{'id':_0x24e995['ChatInteractionId']}});}return null;})[_0xa068('0x36')](handleEntityNotFound(_0x58087b,null))[_0xa068('0x36')](function(_0x4642cf){if(_0x4642cf){return _0x4642cf[_0xa068('0x35')]({'UserId':_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')],'read1stAt':_[_0xa068('0x63')](_0x4642cf[_0xa068('0x64')])?moment()[_0xa068('0x5c')](_0xa068('0x5d')):undefined});}return null;})[_0xa068('0x36')](function(_0x31304a){if(_0x31304a){_0x563238[_0xa068('0x65')]=_0x31304a[_0xa068('0x61')]({'plain':!![]});interaction_log[_0xa068('0x23')](_0xa068('0x66'),_0x242f4c[_0xa068('0x5f')]['id'],_0x242f4c[_0xa068('0x5f')]['name'],_0x242f4c[_0xa068('0x5f')][_0xa068('0x67')],_0x563238[_0xa068('0x65')]['id'],_0x242f4c[_0xa068('0x57')]?JSON[_0xa068('0x26')](_0x242f4c[_0xa068('0x57')]):_0xa068('0x68'));return respondWithRpcPromise(_0xa068('0x69'),_0xa068('0x6a'),_0x563238);}return null;})['then'](function(_0x5a596f){var _0x3fa311=_0xa068('0x6b')+_0x5a596f['message'][_0xa068('0x6c')];return db[_0xa068('0x6d')][_0xa068('0x41')](_0x3fa311,{'type':db['Sequelize'][_0xa068('0x6e')][_0xa068('0x6f')],'raw':!![]})['then'](function(_0x30a6){return _0x30a6;});})[_0xa068('0x36')](function(_0x2ba909){if(_0x2ba909){_0x563238[_0xa068('0x28')]['contact']=_0x2ba909[0x0];if(!_0x242f4c['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')],'role':_0xa068('0x60')},'attributes':['id',_0xa068('0x3a'),_0xa068('0x70'),_0xa068('0x71'),_0xa068('0x72')],'raw':!![]});}return null;})['then'](function(_0x3621f7){if(!_0x3621f7)return null;_0x563238[_0xa068('0x28')][_0xa068('0x60')]=_0x3621f7;return _0x563238;})[_0xa068('0x36')](function(_0x551ab4){if(_0x551ab4){if(_0x242f4c['body'][_0xa068('0x73')]){_0x563238[_0xa068('0x28')][_0xa068('0x74')]=util[_0xa068('0x5c')](_0xa068('0x75'),_0x242f4c['user'][_0xa068('0x3a')]);_0x563238['message']['channel']=_0x563238[_0xa068('0x76')];_0x563238[_0xa068('0x28')][_0xa068('0x77')]=_0x563238[_0xa068('0x76')];_0x563238[_0xa068('0x28')][_0xa068('0x78')]=_0xa068('0x79');return respondWithRpcPromise(_0xa068('0x7a'),'EventManager',{'event':_0xa068('0x7b'),'message':_[_0xa068('0x4c')](_0x563238[_0xa068('0x28')],JSON[_0xa068('0x7c')](_0x563238[_0xa068('0x65')]['formData']))},client9002)['then'](function(){return _0x563238;});}return _0x563238;}return null;})[_0xa068('0x36')](respondWithResult(_0x58087b,null))['catch'](handleError(_0x58087b,null));};var interaction_log=require('../../config/logger')(_0xa068('0x59'));exports[_0xa068('0x33')]=function(_0x4b16d5,_0x1fee28,_0x5258a8){var _0x3bc5b6={'agent':{},'channel':_0xa068('0x5a')};if(_0x4b16d5[_0xa068('0x57')]['id']){delete _0x4b16d5[_0xa068('0x57')]['id'];}_0x4b16d5[_0xa068('0x57')][_0xa068('0x5e')]=_0x4b16d5[_0xa068('0x57')][_0xa068('0x5e')]||_0x4b16d5[_0xa068('0x5f')]['id'];_0x3bc5b6[_0xa068('0x60')]['id']=_0x4b16d5[_0xa068('0x57')]['UserId'];return db[_0xa068('0x3d')]['find']({'where':{'id':_0x4b16d5[_0xa068('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1fee28,null))[_0xa068('0x36')](function(_0x222668){if(_0x222668){_0x3bc5b6[_0xa068('0x28')]=_0x222668[_0xa068('0x61')]({'plain':!![]});return db[_0xa068('0x62')][_0xa068('0x55')]({'where':{'id':_0x222668['ChatInteractionId']}});}return null;})[_0xa068('0x36')](handleEntityNotFound(_0x1fee28,null))[_0xa068('0x36')](function(_0x44bc92){if(_0x44bc92){_0x3bc5b6[_0xa068('0x65')]=_0x44bc92[_0xa068('0x61')]({'plain':!![]});interaction_log[_0xa068('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b16d5[_0xa068('0x5f')]['id'],_0x4b16d5[_0xa068('0x5f')][_0xa068('0x3a')],_0x4b16d5[_0xa068('0x5f')][_0xa068('0x67')],_0x3bc5b6[_0xa068('0x65')]['id'],_0x4b16d5[_0xa068('0x57')]?JSON[_0xa068('0x26')](_0x4b16d5[_0xa068('0x57')]):_0xa068('0x68'));return respondWithRpcPromise(_0xa068('0x7d'),_0xa068('0x7e'),_0x3bc5b6);}return null;})[_0xa068('0x36')](function(_0x4d9922){var _0x381e75=_0xa068('0x6b')+_0x4d9922[_0xa068('0x28')][_0xa068('0x6c')];return db[_0xa068('0x6d')][_0xa068('0x41')](_0x381e75,{'type':db[_0xa068('0x7f')][_0xa068('0x6e')][_0xa068('0x6f')],'raw':!![]})[_0xa068('0x36')](function(_0x55d97f){return _0x55d97f;});})['then'](function(_0x1cc41b){if(_0x1cc41b){_0x3bc5b6[_0xa068('0x28')][_0xa068('0x80')]=_0x1cc41b[0x0];if(!_0x4b16d5[_0xa068('0x57')][_0xa068('0x5e')])return;return db[_0xa068('0x81')]['find']({'where':{'id':_0x4b16d5['body'][_0xa068('0x5e')],'role':_0xa068('0x60')},'attributes':['id',_0xa068('0x3a'),_0xa068('0x70'),_0xa068('0x71'),_0xa068('0x72')],'raw':!![]});}return null;})[_0xa068('0x36')](function(_0x30be5d){if(!_0x30be5d)return null;_0x3bc5b6[_0xa068('0x28')][_0xa068('0x60')]=_0x30be5d;return _0x3bc5b6;})[_0xa068('0x36')](function(_0x3ee4b7){if(_0x3ee4b7){_0x3ee4b7['message'][_0xa068('0x74')]=util[_0xa068('0x5c')]('SIP/%s',_0x4b16d5['user'][_0xa068('0x3a')]);_0x3ee4b7['message']['channel']=_0x3bc5b6['channel'];_0x3ee4b7[_0xa068('0x28')][_0xa068('0x77')]=_0x3bc5b6[_0xa068('0x76')];_0x3ee4b7[_0xa068('0x28')][_0xa068('0x78')]=_0xa068('0x33');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0xa068('0x4c')](_0x3bc5b6[_0xa068('0x28')],JSON[_0xa068('0x7c')](_0x3bc5b6[_0xa068('0x65')]['formData']))},client9002);return _0x3bc5b6;}return null;})['then'](respondWithResult(_0x1fee28,null))['catch'](handleError(_0x1fee28,null));};
\ No newline at end of file
+var _0x6921=['name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','ChatMessage','count','include','catch','params','includeAll','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','User','format','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack'];(function(_0x433f44,_0xa365ce){var _0x73664=function(_0x14501b){while(--_0x14501b){_0x433f44['push'](_0x433f44['shift']());}};_0x73664(++_0xa365ce);}(_0x6921,0x157));var _0x1692=function(_0x2edcdf,_0x2c1680){_0x2edcdf=_0x2edcdf-0x0;var _0x11a8ae=_0x6921[_0x2edcdf];return _0x11a8ae;};'use strict';var emlformat=require(_0x1692('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1692('0x1'));var jsonpatch=require(_0x1692('0x2'));var rp=require(_0x1692('0x3'));var moment=require(_0x1692('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1692('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1692('0x6'));var csv=require(_0x1692('0x7'));var ejs=require(_0x1692('0x8'));var fs=require('fs');var fs_extra=require(_0x1692('0x9'));var _=require(_0x1692('0xa'));var squel=require(_0x1692('0xb'));var crypto=require(_0x1692('0xc'));var jsforce=require(_0x1692('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1692('0xe'));var authService=require(_0x1692('0xf'));var qs=require(_0x1692('0x10'));var as=require(_0x1692('0x11'));var hardwareService=require(_0x1692('0x12'));var logger=require(_0x1692('0x13'))('api');var utils=require(_0x1692('0x14'));var config=require(_0x1692('0x15'));var licenseUtil=require(_0x1692('0x16'));var db=require(_0x1692('0x17'))['db'];config['redis']=_[_0x1692('0x18')](config['redis'],{'host':_0x1692('0x19'),'port':0x18eb});var socket=require(_0x1692('0x1a'))(new Redis(config['redis']));require(_0x1692('0x1b'))['register'](socket);var jayson=require(_0x1692('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x1692('0x1d')][_0x1692('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x289bdd,_0x1b68e,_0x42bccd,_0x378571){return new BPromise(function(_0x5063e5,_0x51fe19){var _0x7dad01=_0x378571||client;return _0x7dad01[_0x1692('0x1f')](_0x289bdd,_0x42bccd)['then'](function(_0x489116){logger[_0x1692('0x20')]('ChatMessage,\x20%s,\x20%s',_0x1b68e,'request\x20sent');logger[_0x1692('0x21')](_0x1692('0x22'),_0x1b68e,_0x1692('0x23'),JSON[_0x1692('0x24')](_0x489116));if(_0x489116[_0x1692('0x25')]){if(_0x489116[_0x1692('0x25')]['code']===0x1f4){logger[_0x1692('0x25')](_0x1692('0x26'),_0x1b68e,_0x489116[_0x1692('0x25')][_0x1692('0x27')]);return _0x51fe19(_0x489116['error'][_0x1692('0x27')]);}logger['error'](_0x1692('0x26'),_0x1b68e,_0x489116[_0x1692('0x25')]['message']);return _0x5063e5(_0x489116[_0x1692('0x25')][_0x1692('0x27')]);}else{logger[_0x1692('0x20')](_0x1692('0x26'),_0x1b68e,'request\x20sent');_0x5063e5(_0x489116[_0x1692('0x28')][_0x1692('0x27')]);}})['catch'](function(_0x487aa4){logger[_0x1692('0x25')](_0x1692('0x26'),_0x1b68e,_0x487aa4);_0x51fe19(_0x487aa4);});});}function respondWithStatusCode(_0x59ed9b,_0x3a046b){_0x3a046b=_0x3a046b||0xcc;return function(_0x1c3af9){if(_0x1c3af9){return _0x59ed9b['sendStatus'](_0x3a046b);}return _0x59ed9b['status'](_0x3a046b)[_0x1692('0x29')]();};}function respondWithResult(_0x40f9b2,_0xb0d45a){_0xb0d45a=_0xb0d45a||0xc8;return function(_0x2a8e23){if(_0x2a8e23){return _0x40f9b2[_0x1692('0x2a')](_0xb0d45a)['json'](_0x2a8e23);}};}function respondWithFilteredResult(_0x18fcca,_0x34336e){return function(_0x435ff5){if(_0x435ff5){var _0x28eef9=typeof _0x34336e[_0x1692('0x2b')]===_0x1692('0x2c')&&typeof _0x34336e[_0x1692('0x2d')]===_0x1692('0x2c');var _0x35dae4=_0x435ff5['count'];var _0x29327c=_0x28eef9?0x0:_0x34336e['offset'];var _0x28b1a5=_0x28eef9?_0x435ff5['count']:_0x34336e[_0x1692('0x2b')]+_0x34336e[_0x1692('0x2d')];var _0x35addd;if(_0x28b1a5>=_0x35dae4){_0x28b1a5=_0x35dae4;_0x35addd=0xc8;}else{_0x35addd=0xce;}_0x18fcca[_0x1692('0x2a')](_0x35addd);return _0x18fcca[_0x1692('0x2e')](_0x1692('0x2f'),_0x29327c+'-'+_0x28b1a5+'/'+_0x35dae4)['json'](_0x435ff5);}return null;};}function patchUpdates(_0x65662c){return function(_0x177fc6){try{jsonpatch[_0x1692('0x30')](_0x177fc6,_0x65662c,!![]);}catch(_0x5ad166){return BPromise[_0x1692('0x31')](_0x5ad166);}return _0x177fc6[_0x1692('0x32')]();};}function saveUpdates(_0x107af2,_0x5d1f0e){return function(_0x4620dc){if(_0x4620dc){return _0x4620dc[_0x1692('0x33')](_0x107af2)[_0x1692('0x34')](function(_0x2d359d){return _0x2d359d;});}return null;};}function removeEntity(_0x3e399d,_0x94350f){return function(_0x341718){if(_0x341718){return _0x341718[_0x1692('0x35')]()[_0x1692('0x34')](function(){_0x3e399d[_0x1692('0x2a')](0xcc)[_0x1692('0x29')]();});}};}function handleEntityNotFound(_0x155e69,_0x22a26f){return function(_0x308951){if(!_0x308951){_0x155e69[_0x1692('0x36')](0x194);}return _0x308951;};}function handleError(_0x31cfad,_0x23abaf){_0x23abaf=_0x23abaf||0x1f4;return function(_0x542cce){logger[_0x1692('0x25')](_0x542cce[_0x1692('0x37')]);if(_0x542cce['name']){delete _0x542cce[_0x1692('0x38')];}_0x31cfad[_0x1692('0x2a')](_0x23abaf)[_0x1692('0x39')](_0x542cce);};}exports[_0x1692('0x3a')]=function(_0x49c0ff,_0x314a36){var _0x422648={},_0x7d4c04={},_0x464901={'count':0x0,'rows':[]};var _0x4d384c=_[_0x1692('0x3b')](db['ChatMessage'][_0x1692('0x3c')],function(_0x35f837){return{'name':_0x35f837['fieldName'],'type':_0x35f837['type'][_0x1692('0x3d')]};});_0x7d4c04[_0x1692('0x3e')]=_[_0x1692('0x3b')](_0x4d384c,_0x1692('0x38'));_0x7d4c04[_0x1692('0x3f')]=_[_0x1692('0x40')](_0x49c0ff[_0x1692('0x3f')]);_0x7d4c04[_0x1692('0x41')]=_[_0x1692('0x42')](_0x7d4c04['model'],_0x7d4c04[_0x1692('0x3f')]);_0x422648[_0x1692('0x43')]=_[_0x1692('0x42')](_0x7d4c04[_0x1692('0x3e')],qs[_0x1692('0x44')](_0x49c0ff['query'][_0x1692('0x44')]));_0x422648['attributes']=_0x422648[_0x1692('0x43')][_0x1692('0x45')]?_0x422648[_0x1692('0x43')]:_0x7d4c04['model'];if(!_0x49c0ff[_0x1692('0x3f')][_0x1692('0x46')](_0x1692('0x47'))){_0x422648['limit']=qs[_0x1692('0x2d')](_0x49c0ff[_0x1692('0x3f')][_0x1692('0x2d')]);_0x422648[_0x1692('0x2b')]=qs[_0x1692('0x2b')](_0x49c0ff[_0x1692('0x3f')][_0x1692('0x2b')]);}_0x422648[_0x1692('0x48')]=qs[_0x1692('0x49')](_0x49c0ff['query'][_0x1692('0x49')]);_0x422648[_0x1692('0x4a')]=qs[_0x1692('0x41')](_['pick'](_0x49c0ff['query'],_0x7d4c04[_0x1692('0x41')]),_0x4d384c);if(_0x49c0ff[_0x1692('0x3f')]['filter']){_0x422648[_0x1692('0x4a')]=_[_0x1692('0x4b')](_0x422648['where'],{'$or':_[_0x1692('0x3b')](_0x4d384c,function(_0x3d0ee5){if(_0x3d0ee5[_0x1692('0x4c')]!==_0x1692('0x4d')){var _0x568232={};_0x568232[_0x3d0ee5['name']]={'$like':'%'+_0x49c0ff[_0x1692('0x3f')]['filter']+'%'};return _0x568232;}})});}_0x422648=_[_0x1692('0x4b')]({},_0x422648,_0x49c0ff[_0x1692('0x4e')]);var _0x442ee6={'where':_0x422648[_0x1692('0x4a')]};return db[_0x1692('0x4f')][_0x1692('0x50')](_0x442ee6)['then'](function(_0x6be107){_0x464901[_0x1692('0x50')]=_0x6be107;if(_0x49c0ff[_0x1692('0x3f')]['includeAll']){_0x422648[_0x1692('0x51')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x422648);})[_0x1692('0x34')](function(_0x1c1d14){_0x464901['rows']=_0x1c1d14;return _0x464901;})[_0x1692('0x34')](respondWithFilteredResult(_0x314a36,_0x422648))[_0x1692('0x52')](handleError(_0x314a36,null));};exports['show']=function(_0x2bf2ce,_0x116cd6){var _0x318d20={'raw':!![],'where':{'id':_0x2bf2ce[_0x1692('0x53')]['id']}},_0x4da772={};_0x4da772[_0x1692('0x3e')]=_[_0x1692('0x40')](db[_0x1692('0x4f')][_0x1692('0x3c')]);_0x4da772[_0x1692('0x3f')]=_['keys'](_0x2bf2ce[_0x1692('0x3f')]);_0x4da772['filters']=_[_0x1692('0x42')](_0x4da772[_0x1692('0x3e')],_0x4da772[_0x1692('0x3f')]);_0x318d20[_0x1692('0x43')]=_[_0x1692('0x42')](_0x4da772['model'],qs[_0x1692('0x44')](_0x2bf2ce[_0x1692('0x3f')]['fields']));_0x318d20[_0x1692('0x43')]=_0x318d20[_0x1692('0x43')][_0x1692('0x45')]?_0x318d20[_0x1692('0x43')]:_0x4da772[_0x1692('0x3e')];if(_0x2bf2ce[_0x1692('0x3f')][_0x1692('0x54')]){_0x318d20[_0x1692('0x51')]=[{'all':!![]}];}_0x318d20=_[_0x1692('0x4b')]({},_0x318d20,_0x2bf2ce[_0x1692('0x4e')]);return db[_0x1692('0x4f')][_0x1692('0x55')](_0x318d20)[_0x1692('0x34')](handleEntityNotFound(_0x116cd6,null))[_0x1692('0x34')](respondWithResult(_0x116cd6,null))['catch'](handleError(_0x116cd6,null));};exports[_0x1692('0x56')]=function(_0x196cb4,_0x2e6a5e){return db[_0x1692('0x4f')][_0x1692('0x56')](_0x196cb4[_0x1692('0x57')],{})[_0x1692('0x34')](respondWithResult(_0x2e6a5e,0xc9))[_0x1692('0x52')](handleError(_0x2e6a5e,null));};exports['update']=function(_0x15c70b,_0xb19b61){if(_0x15c70b[_0x1692('0x57')]['id']){delete _0x15c70b[_0x1692('0x57')]['id'];}return db[_0x1692('0x4f')][_0x1692('0x55')]({'where':{'id':_0x15c70b[_0x1692('0x53')]['id']}})[_0x1692('0x34')](handleEntityNotFound(_0xb19b61,null))[_0x1692('0x34')](saveUpdates(_0x15c70b[_0x1692('0x57')],null))[_0x1692('0x34')](respondWithResult(_0xb19b61,null))['catch'](handleError(_0xb19b61,null));};exports[_0x1692('0x35')]=function(_0x2d6a39,_0x2da7b4){return db[_0x1692('0x4f')][_0x1692('0x55')]({'where':{'id':_0x2d6a39[_0x1692('0x53')]['id']}})[_0x1692('0x34')](handleEntityNotFound(_0x2da7b4,null))['then'](removeEntity(_0x2da7b4,null))[_0x1692('0x52')](handleError(_0x2da7b4,null));};exports['describe']=function(_0xb6bccf,_0x1ddc6e){return db[_0x1692('0x4f')][_0x1692('0x58')]()[_0x1692('0x34')](respondWithResult(_0x1ddc6e,null))[_0x1692('0x52')](handleError(_0x1ddc6e,null));};var interaction_log=require(_0x1692('0x13'))(_0x1692('0x59'));exports[_0x1692('0x5a')]=function(_0x3b49f2,_0x2f9240,_0x1484d7){var _0x4f1a6d={'agent':{},'channel':_0x1692('0x5b')};if(_0x3b49f2['body']['id']){delete _0x3b49f2[_0x1692('0x57')]['id'];}_0x3b49f2['body'][_0x1692('0x5c')]=!![];_0x3b49f2[_0x1692('0x57')][_0x1692('0x5d')]=moment()['format'](_0x1692('0x5e'));_0x3b49f2[_0x1692('0x57')]['UserId']=_0x3b49f2[_0x1692('0x57')][_0x1692('0x5f')]||_0x3b49f2[_0x1692('0x60')]['id'];_0x4f1a6d[_0x1692('0x61')]['id']=_0x3b49f2[_0x1692('0x57')][_0x1692('0x5f')];return db[_0x1692('0x4f')][_0x1692('0x55')]({'where':{'id':_0x3b49f2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f9240,null))[_0x1692('0x34')](saveUpdates(_0x3b49f2[_0x1692('0x57')],null))[_0x1692('0x34')](function(_0x355c22){if(_0x355c22){_0x4f1a6d[_0x1692('0x27')]=_0x355c22['get']({'plain':!![]});return db[_0x1692('0x62')][_0x1692('0x55')]({'where':{'id':_0x355c22[_0x1692('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x2f9240,null))[_0x1692('0x34')](function(_0x3e1d50){if(_0x3e1d50){return _0x3e1d50[_0x1692('0x33')]({'UserId':_0x3b49f2[_0x1692('0x57')][_0x1692('0x5f')],'read1stAt':_[_0x1692('0x64')](_0x3e1d50['read1stAt'])?moment()['format'](_0x1692('0x5e')):undefined});}return null;})['then'](function(_0x256bf0){if(_0x256bf0){_0x4f1a6d['interaction']=_0x256bf0[_0x1692('0x65')]({'plain':!![]});interaction_log[_0x1692('0x20')](_0x1692('0x66'),_0x3b49f2['user']['id'],_0x3b49f2['user']['name'],_0x3b49f2[_0x1692('0x60')][_0x1692('0x67')],_0x4f1a6d[_0x1692('0x68')]['id'],_0x3b49f2[_0x1692('0x57')]?JSON[_0x1692('0x24')](_0x3b49f2[_0x1692('0x57')]):_0x1692('0x69'));return respondWithRpcPromise('AcceptMessage',_0x1692('0x6a'),_0x4f1a6d);}return null;})[_0x1692('0x34')](function(_0x5cfc46){var _0x581d28=_0x1692('0x6b')+_0x5cfc46[_0x1692('0x27')]['ContactId'];return db[_0x1692('0x6c')][_0x1692('0x3f')](_0x581d28,{'type':db[_0x1692('0x6d')][_0x1692('0x6e')]['SELECT'],'raw':!![]})[_0x1692('0x34')](function(_0x361e68){return _0x361e68;});})['then'](function(_0x3ca539){if(_0x3ca539){_0x4f1a6d[_0x1692('0x27')][_0x1692('0x6f')]=_0x3ca539[0x0];if(!_0x3b49f2[_0x1692('0x57')]['UserId'])return;return db['User']['find']({'where':{'id':_0x3b49f2[_0x1692('0x57')][_0x1692('0x5f')],'role':_0x1692('0x61')},'attributes':['id',_0x1692('0x38'),_0x1692('0x70'),_0x1692('0x71'),_0x1692('0x72')],'raw':!![]});}return null;})[_0x1692('0x34')](function(_0x19e389){if(!_0x19e389)return null;_0x4f1a6d[_0x1692('0x27')]['agent']=_0x19e389;return _0x4f1a6d;})[_0x1692('0x34')](function(_0x2772cb){if(_0x2772cb){if(_0x3b49f2['body'][_0x1692('0x73')]){_0x4f1a6d[_0x1692('0x27')][_0x1692('0x74')]=util['format'](_0x1692('0x75'),_0x3b49f2[_0x1692('0x60')][_0x1692('0x38')]);_0x4f1a6d['message']['channel']=_0x4f1a6d['channel'];_0x4f1a6d[_0x1692('0x27')][_0x1692('0x76')]=_0x4f1a6d[_0x1692('0x77')];_0x4f1a6d[_0x1692('0x27')][_0x1692('0x78')]=_0x1692('0x5a');return respondWithRpcPromise(_0x1692('0x79'),_0x1692('0x79'),{'event':_0x1692('0x7a'),'message':_['merge'](_0x4f1a6d[_0x1692('0x27')],JSON[_0x1692('0x7b')](_0x4f1a6d[_0x1692('0x68')][_0x1692('0x7c')]))},client9002)[_0x1692('0x34')](function(){return _0x4f1a6d;});}return _0x4f1a6d;}return null;})['then'](respondWithResult(_0x2f9240,null))[_0x1692('0x52')](handleError(_0x2f9240,null));};var interaction_log=require(_0x1692('0x13'))('chat-interactions');exports[_0x1692('0x31')]=function(_0x3e2362,_0x56858d,_0x53f22b){var _0x77ba2d={'agent':{},'channel':_0x1692('0x5b')};if(_0x3e2362[_0x1692('0x57')]['id']){delete _0x3e2362[_0x1692('0x57')]['id'];}_0x3e2362['body']['UserId']=_0x3e2362[_0x1692('0x57')][_0x1692('0x5f')]||_0x3e2362[_0x1692('0x60')]['id'];_0x77ba2d[_0x1692('0x61')]['id']=_0x3e2362['body'][_0x1692('0x5f')];return db[_0x1692('0x4f')][_0x1692('0x55')]({'where':{'id':_0x3e2362[_0x1692('0x53')]['id'],'UserId':null}})[_0x1692('0x34')](handleEntityNotFound(_0x56858d,null))[_0x1692('0x34')](function(_0x3252ca){if(_0x3252ca){_0x77ba2d[_0x1692('0x27')]=_0x3252ca[_0x1692('0x65')]({'plain':!![]});return db[_0x1692('0x62')][_0x1692('0x55')]({'where':{'id':_0x3252ca[_0x1692('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x56858d,null))[_0x1692('0x34')](function(_0x1e651a){if(_0x1e651a){_0x77ba2d[_0x1692('0x68')]=_0x1e651a['get']({'plain':!![]});interaction_log[_0x1692('0x20')](_0x1692('0x7d'),_0x3e2362[_0x1692('0x60')]['id'],_0x3e2362['user']['name'],_0x3e2362['user'][_0x1692('0x67')],_0x77ba2d[_0x1692('0x68')]['id'],_0x3e2362['body']?JSON[_0x1692('0x24')](_0x3e2362['body']):_0x1692('0x69'));return respondWithRpcPromise(_0x1692('0x7e'),_0x1692('0x7f'),_0x77ba2d);}return null;})[_0x1692('0x34')](function(_0x482bc7){var _0x13d099=_0x1692('0x6b')+_0x482bc7['message'][_0x1692('0x80')];return db['sequelize'][_0x1692('0x3f')](_0x13d099,{'type':db['Sequelize'][_0x1692('0x6e')][_0x1692('0x81')],'raw':!![]})['then'](function(_0x5d3b1d){return _0x5d3b1d;});})[_0x1692('0x34')](function(_0x1cb462){if(_0x1cb462){_0x77ba2d[_0x1692('0x27')][_0x1692('0x6f')]=_0x1cb462[0x0];if(!_0x3e2362[_0x1692('0x57')][_0x1692('0x5f')])return;return db[_0x1692('0x82')][_0x1692('0x55')]({'where':{'id':_0x3e2362[_0x1692('0x57')][_0x1692('0x5f')],'role':_0x1692('0x61')},'attributes':['id',_0x1692('0x38'),_0x1692('0x70'),_0x1692('0x71'),_0x1692('0x72')],'raw':!![]});}return null;})['then'](function(_0x549c45){if(!_0x549c45)return null;_0x77ba2d[_0x1692('0x27')][_0x1692('0x61')]=_0x549c45;return _0x77ba2d;})[_0x1692('0x34')](function(_0x20d961){if(_0x20d961){_0x20d961['message'][_0x1692('0x74')]=util[_0x1692('0x83')](_0x1692('0x75'),_0x3e2362[_0x1692('0x60')][_0x1692('0x38')]);_0x20d961['message']['channel']=_0x77ba2d['channel'];_0x20d961[_0x1692('0x27')][_0x1692('0x76')]=_0x77ba2d[_0x1692('0x77')];_0x20d961[_0x1692('0x27')]['event']='reject';respondWithRpcPromise('EventManager',_0x1692('0x79'),{'event':_0x1692('0x84'),'message':_['merge'](_0x77ba2d[_0x1692('0x27')],JSON['parse'](_0x77ba2d[_0x1692('0x68')][_0x1692('0x7c')]))},client9002);return _0x77ba2d;}return null;})[_0x1692('0x34')](respondWithResult(_0x56858d,null))[_0x1692('0x52')](handleError(_0x56858d,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c728a62..ab7d3ca 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 _0x2cef=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x4966a4,_0x39662c){var _0x3c6bf6=function(_0x53c4f2){while(--_0x53c4f2){_0x4966a4['push'](_0x4966a4['shift']());}};_0x3c6bf6(++_0x39662c);}(_0x2cef,0x97));var _0xf2ce=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2cef[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xf2ce('0x0'));var ChatMessage=require(_0xf2ce('0x1'))['db'][_0xf2ce('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf2ce('0x3')](0x0);var events={'afterCreate':_0xf2ce('0x4'),'afterUpdate':_0xf2ce('0x5'),'afterDestroy':_0xf2ce('0x6')};function emitEvent(_0x5334cf){return function(_0x4f1b4a,_0x4ef215,_0x3329c1){ChatMessageEvents[_0xf2ce('0x7')](_0x5334cf+':'+_0x4f1b4a['id'],_0x4f1b4a);ChatMessageEvents[_0xf2ce('0x7')](_0x5334cf,_0x4f1b4a);_0x3329c1(null);};}for(var e in events){if(events[_0xf2ce('0x8')](e)){var event=events[e];ChatMessage[_0xf2ce('0x9')](e,emitEvent(event));}}module[_0xf2ce('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x041d=['events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x041d,0x10e));var _0xd041=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x041d[_0x525c7b];return _0x27b33e;};'use strict';var EventEmitter=require(_0xd041('0x0'));var ChatMessage=require(_0xd041('0x1'))['db'][_0xd041('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd041('0x3')](0x0);var events={'afterCreate':_0xd041('0x4'),'afterUpdate':'update','afterDestroy':_0xd041('0x5')};function emitEvent(_0x1879c6){return function(_0x8883b9,_0x53e04f,_0x4aa86b){ChatMessageEvents[_0xd041('0x6')](_0x1879c6+':'+_0x8883b9['id'],_0x8883b9);ChatMessageEvents[_0xd041('0x6')](_0x1879c6,_0x8883b9);_0x4aa86b(null);};}for(var e in events){if(events[_0xd041('0x7')](e)){var event=events[e];ChatMessage[_0xd041('0x8')](e,emitEvent(event));}}module[_0xd041('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 5a3e620..e5321a0 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 _0x1f36=['UserId','ChatInteraction','ChatInteractionId','update','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','out','secret'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x1f36,0x1ed));var _0x61f3=function(_0x5989e9,_0xef6905){_0x5989e9=_0x5989e9-0x0;var _0xac49f2=_0x1f36[_0x5989e9];return _0xac49f2;};'use strict';var _=require(_0x61f3('0x0'));var util=require(_0x61f3('0x1'));var logger=require(_0x61f3('0x2'))(_0x61f3('0x3'));var moment=require('moment');var BPromise=require(_0x61f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f3('0x5'));var rimraf=require(_0x61f3('0x6'));var config=require(_0x61f3('0x7'));var attributes=require(_0x61f3('0x8'));module[_0x61f3('0x9')]=function(_0x12c372,_0x72af3d){return _0x12c372['define'](_0x61f3('0xa'),attributes,{'tableName':_0x61f3('0xb'),'paranoid':![],'indexes':[{'name':_0x61f3('0xc'),'fields':[_0x61f3('0xd')],'type':_0x61f3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e184d,_0x3e7987,_0x51f786){var _0x1dba23=_0x12c372[_0x61f3('0xf')];var _0x14b24e=_0x3e184d[_0x61f3('0x10')]({'plain':!![]});if(_0x14b24e[_0x61f3('0x11')]['toLowerCase']()==='in'||_0x14b24e[_0x61f3('0x11')]['toLowerCase']()===_0x61f3('0x12')&&!_0x14b24e[_0x61f3('0x13')]&&!_['isNil'](_0x14b24e[_0x61f3('0x14')])){_0x1dba23[_0x61f3('0x15')]['findOne']({'where':{'id':_0x14b24e[_0x61f3('0x16')]}})['then'](function(_0x42c8b4){if(_0x42c8b4){_0x42c8b4[_0x61f3('0x17')]({'lastMsgAt':_0x14b24e['createdAt'],'lastMsgDirection':_0x14b24e[_0x61f3('0x11')]['toLowerCase']()});}})[_0x61f3('0x18')](function(_0x222d54){console[_0x61f3('0x19')](_0x222d54);});}_0x51f786();}},'charset':'utf8mb4','collate':_0x61f3('0x1a')});};
\ No newline at end of file
+var _0xfa1e=['ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x4a9028,_0xfd691){var _0x5da302=function(_0x185c50){while(--_0x185c50){_0x4a9028['push'](_0x4a9028['shift']());}};_0x5da302(++_0xfd691);}(_0xfa1e,0xb1));var _0xefa1=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0xfa1e[_0x3f5dca];return _0x5b833a;};'use strict';var _=require(_0xefa1('0x0'));var util=require('util');var logger=require(_0xefa1('0x1'))(_0xefa1('0x2'));var moment=require(_0xefa1('0x3'));var BPromise=require(_0xefa1('0x4'));var rp=require(_0xefa1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefa1('0x6'));var config=require(_0xefa1('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x1b7a93,_0x13e091){return _0x1b7a93[_0xefa1('0x8')](_0xefa1('0x9'),attributes,{'tableName':_0xefa1('0xa'),'paranoid':![],'indexes':[{'name':_0xefa1('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b2059,_0x3b9774,_0x52b9fa){var _0x3cf990=_0x1b7a93[_0xefa1('0xc')];var _0x4aa5a4=_0x5b2059[_0xefa1('0xd')]({'plain':!![]});if(_0x4aa5a4[_0xefa1('0xe')][_0xefa1('0xf')]()==='in'||_0x4aa5a4[_0xefa1('0xe')][_0xefa1('0xf')]()===_0xefa1('0x10')&&!_0x4aa5a4[_0xefa1('0x11')]&&!_[_0xefa1('0x12')](_0x4aa5a4['UserId'])){_0x3cf990[_0xefa1('0x13')][_0xefa1('0x14')]({'where':{'id':_0x4aa5a4[_0xefa1('0x15')]}})[_0xefa1('0x16')](function(_0x1fd773){if(_0x1fd773){_0x1fd773[_0xefa1('0x17')]({'lastMsgAt':_0x4aa5a4[_0xefa1('0x18')],'lastMsgDirection':_0x4aa5a4[_0xefa1('0xe')][_0xefa1('0xf')]()});}})[_0xefa1('0x19')](function(_0xc3adfd){console['error'](_0xc3adfd);});}_0x52b9fa();}},'charset':_0xefa1('0x1a'),'collate':_0xefa1('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index e0452ab..5edec92 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 _0xae4e=['client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x138293,_0x197e7f){var _0x34c4a2=function(_0x20192b){while(--_0x20192b){_0x138293['push'](_0x138293['shift']());}};_0x34c4a2(++_0x197e7f);}(_0xae4e,0x116));var _0xeae4=function(_0x13c223,_0x433b38){_0x13c223=_0x13c223-0x0;var _0x3e8d83=_0xae4e[_0x13c223];return _0x3e8d83;};'use strict';var _=require(_0xeae4('0x0'));var util=require(_0xeae4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeae4('0x2'));var fs=require('fs');var Redis=require(_0xeae4('0x3'));var db=require(_0xeae4('0x4'))['db'];var utils=require(_0xeae4('0x5'));var logger=require(_0xeae4('0x6'))(_0xeae4('0x7'));var config=require(_0xeae4('0x8'));var jayson=require(_0xeae4('0x9'));var client=jayson[_0xeae4('0xa')][_0xeae4('0xb')]({'port':0x232a});config[_0xeae4('0xc')]=_[_0xeae4('0xd')](config['redis'],{'host':_0xeae4('0xe'),'port':0x18eb});var socket=require(_0xeae4('0xf'))(new Redis(config[_0xeae4('0xc')]));require(_0xeae4('0x10'))[_0xeae4('0x11')](socket);function respondWithRpcPromise(_0x412af8,_0xea104a,_0x8cbd2d){return new BPromise(function(_0x95276f,_0x44e6c8){return client[_0xeae4('0x12')](_0x412af8,_0x8cbd2d)[_0xeae4('0x13')](function(_0x3f7de4){logger[_0xeae4('0x14')](_0xeae4('0x15'),_0xea104a,_0xeae4('0x16'));logger[_0xeae4('0x17')](_0xeae4('0x18'),_0xea104a,_0xeae4('0x16'),JSON[_0xeae4('0x19')](_0x3f7de4));if(_0x3f7de4[_0xeae4('0x1a')]){if(_0x3f7de4[_0xeae4('0x1a')][_0xeae4('0x1b')]===0x1f4){logger['error'](_0xeae4('0x15'),_0xea104a,_0x3f7de4[_0xeae4('0x1a')][_0xeae4('0x1c')]);return _0x44e6c8(_0x3f7de4['error'][_0xeae4('0x1c')]);}logger[_0xeae4('0x1a')](_0xeae4('0x15'),_0xea104a,_0x3f7de4['error'][_0xeae4('0x1c')]);return _0x95276f(_0x3f7de4['error'][_0xeae4('0x1c')]);}else{logger[_0xeae4('0x14')]('ChatMessage,\x20%s,\x20%s',_0xea104a,_0xeae4('0x16'));_0x95276f(_0x3f7de4[_0xeae4('0x1d')]['message']);}})[_0xeae4('0x1e')](function(_0x414b4a){logger['error'](_0xeae4('0x15'),_0xea104a,_0x414b4a);_0x44e6c8(_0x414b4a);});});}exports[_0xeae4('0x1f')]=function(_0x5efb17){var _0x3bc873=this;return new Promise(function(_0x11f20c,_0x3d98d1){return db['ChatMessage'][_0xeae4('0x20')](_0x5efb17[_0xeae4('0x21')],{'raw':_0x5efb17[_0xeae4('0x22')]?_0x5efb17['options'][_0xeae4('0x23')]===undefined?!![]:![]:!![]})[_0xeae4('0x13')](function(_0x8103be){logger['info'](_0xeae4('0x1f'),_0x5efb17);logger[_0xeae4('0x17')](_0xeae4('0x1f'),_0x5efb17,JSON[_0xeae4('0x19')](_0x8103be));_0x11f20c(_0x8103be);})['catch'](function(_0x341738){logger[_0xeae4('0x1a')](_0xeae4('0x1f'),_0x341738['message'],_0x5efb17);_0x3d98d1(_0x3bc873[_0xeae4('0x1a')](0x1f4,_0x341738['message']));});});};
\ No newline at end of file
+var _0xf62d=['register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x1c3f44,_0x3b9db4){var _0x1bc285=function(_0x4f1781){while(--_0x4f1781){_0x1c3f44['push'](_0x1c3f44['shift']());}};_0x1bc285(++_0x3b9db4);}(_0xf62d,0x1c0));var _0xdf62=function(_0x3cf636,_0x47f6f4){_0x3cf636=_0x3cf636-0x0;var _0x102851=_0xf62d[_0x3cf636];return _0x102851;};'use strict';var _=require(_0xdf62('0x0'));var util=require(_0xdf62('0x1'));var moment=require('moment');var BPromise=require(_0xdf62('0x2'));var rs=require(_0xdf62('0x3'));var fs=require('fs');var Redis=require(_0xdf62('0x4'));var db=require(_0xdf62('0x5'))['db'];var utils=require(_0xdf62('0x6'));var logger=require(_0xdf62('0x7'))(_0xdf62('0x8'));var config=require(_0xdf62('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xdf62('0xa')]=_['defaults'](config[_0xdf62('0xa')],{'host':_0xdf62('0xb'),'port':0x18eb});var socket=require(_0xdf62('0xc'))(new Redis(config[_0xdf62('0xa')]));require(_0xdf62('0xd'))[_0xdf62('0xe')](socket);function respondWithRpcPromise(_0x2a3460,_0x1316f3,_0xfb08d7){return new BPromise(function(_0x58cd3d,_0x29c360){return client['request'](_0x2a3460,_0xfb08d7)[_0xdf62('0xf')](function(_0x496b40){logger[_0xdf62('0x10')](_0xdf62('0x11'),_0x1316f3,_0xdf62('0x12'));logger[_0xdf62('0x13')](_0xdf62('0x14'),_0x1316f3,_0xdf62('0x12'),JSON['stringify'](_0x496b40));if(_0x496b40[_0xdf62('0x15')]){if(_0x496b40[_0xdf62('0x15')][_0xdf62('0x16')]===0x1f4){logger[_0xdf62('0x15')]('ChatMessage,\x20%s,\x20%s',_0x1316f3,_0x496b40['error'][_0xdf62('0x17')]);return _0x29c360(_0x496b40['error'][_0xdf62('0x17')]);}logger[_0xdf62('0x15')](_0xdf62('0x11'),_0x1316f3,_0x496b40[_0xdf62('0x15')]['message']);return _0x58cd3d(_0x496b40['error'][_0xdf62('0x17')]);}else{logger[_0xdf62('0x10')]('ChatMessage,\x20%s,\x20%s',_0x1316f3,'request\x20sent');_0x58cd3d(_0x496b40[_0xdf62('0x18')][_0xdf62('0x17')]);}})[_0xdf62('0x19')](function(_0x39b9b0){logger[_0xdf62('0x15')](_0xdf62('0x11'),_0x1316f3,_0x39b9b0);_0x29c360(_0x39b9b0);});});}exports[_0xdf62('0x1a')]=function(_0x47a69b){var _0x93bcb9=this;return new Promise(function(_0x537d43,_0x281519){return db[_0xdf62('0x1b')][_0xdf62('0x1c')](_0x47a69b[_0xdf62('0x1d')],{'raw':_0x47a69b[_0xdf62('0x1e')]?_0x47a69b['options'][_0xdf62('0x1f')]===undefined?!![]:![]:!![]})[_0xdf62('0xf')](function(_0x361057){logger[_0xdf62('0x10')](_0xdf62('0x1a'),_0x47a69b);logger[_0xdf62('0x13')]('CreateChatMessage',_0x47a69b,JSON[_0xdf62('0x20')](_0x361057));_0x537d43(_0x361057);})[_0xdf62('0x19')](function(_0x3da7f4){logger['error']('CreateChatMessage',_0x3da7f4[_0xdf62('0x17')],_0x47a69b);_0x281519(_0x93bcb9[_0xdf62('0x15')](0x1f4,_0x3da7f4[_0xdf62('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 2ce798c..0e90b99 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 _0x29d4=['removeListener','register','length','./chatMessage.events','remove','update'];(function(_0x522a3b,_0x22b40a){var _0x761494=function(_0x4c599a){while(--_0x4c599a){_0x522a3b['push'](_0x522a3b['shift']());}};_0x761494(++_0x22b40a);}(_0x29d4,0x1a1));var _0x429d=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x29d4[_0x54d4fe];return _0x1ab5bb;};'use strict';var ChatMessageEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatMessageEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatMessage:'+_0x4befb9,_0x1c55aa);ChatMessageEvents['on'](_0x4befb9,_0x9fc337);}};
\ No newline at end of file
+var _0x3e9d=['chatMessage:','./chatMessage.events','save','update','removeListener','register','length'];(function(_0x59ef68,_0x33eb5d){var _0x338883=function(_0x54f450){while(--_0x54f450){_0x59ef68['push'](_0x59ef68['shift']());}};_0x338883(++_0x33eb5d);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x595300,_0x528932){_0x595300=_0x595300-0x0;var _0x3a027b=_0x3e9d[_0x595300];return _0x3a027b;};'use strict';var ChatMessageEvents=require(_0xd3e9('0x0'));var events=[_0xd3e9('0x1'),'remove',_0xd3e9('0x2')];function createListener(_0x4bc1c3,_0x328e91){return function(_0x2ebba5){_0x328e91['emit'](_0x4bc1c3,_0x2ebba5);};}function removeListener(_0x4887ba,_0xa499a3){return function(){ChatMessageEvents[_0xd3e9('0x3')](_0x4887ba,_0xa499a3);};}exports[_0xd3e9('0x4')]=function(_0x3dea0a){for(var _0x568eea=0x0,_0x4dc1de=events[_0xd3e9('0x5')];_0x568eea<_0x4dc1de;_0x568eea++){var _0x140f2d=events[_0x568eea];var _0x45364e=createListener(_0xd3e9('0x6')+_0x140f2d,_0x3dea0a);ChatMessageEvents['on'](_0x140f2d,_0x45364e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index b192b48..5372053 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 _0xaeee=['/:id/accept','accept','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update'];(function(_0x51dd8b,_0x326222){var _0x11cc3d=function(_0x2f1138){while(--_0x2f1138){_0x51dd8b['push'](_0x51dd8b['shift']());}};_0x11cc3d(++_0x326222);}(_0xaeee,0x124));var _0xeaee=function(_0x330bdf,_0x4f10f3){_0x330bdf=_0x330bdf-0x0;var _0x3db14d=_0xaeee[_0x330bdf];return _0x3db14d;};'use strict';var multer=require(_0xeaee('0x0'));var util=require('util');var path=require(_0xeaee('0x1'));var timeout=require(_0xeaee('0x2'));var express=require(_0xeaee('0x3'));var router=express['Router']();var fs_extra=require(_0xeaee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeaee('0x5'));var config=require(_0xeaee('0x6'));var controller=require('./chatMessage.controller');router[_0xeaee('0x7')]('/',auth[_0xeaee('0x8')](),controller[_0xeaee('0x9')]);router['get'](_0xeaee('0xa'),auth[_0xeaee('0x8')](),controller[_0xeaee('0xb')]);router[_0xeaee('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xeaee('0xc')]);router[_0xeaee('0xd')]('/',auth[_0xeaee('0x8')](),interaction[_0xeaee('0xe')](_0xeaee('0xf'),_0xeaee('0x10')),controller[_0xeaee('0x11')]);router[_0xeaee('0x12')]('/:id',controller[_0xeaee('0x13')]);router['put'](_0xeaee('0x14'),auth[_0xeaee('0x8')](),controller[_0xeaee('0x15')]);router[_0xeaee('0x12')]('/:id/reject',auth[_0xeaee('0x8')](),controller['reject']);router[_0xeaee('0x16')](_0xeaee('0x17'),auth[_0xeaee('0x8')](),controller[_0xeaee('0x18')]);module[_0xeaee('0x19')]=router;
\ No newline at end of file
+var _0xba8b=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','post','chat','chatmessage:create','create','update','put','/:id/accept','delete','destroy','exports','multer','util','path'];(function(_0x2872b2,_0x1dddd0){var _0x2d537d=function(_0xe22932){while(--_0xe22932){_0x2872b2['push'](_0x2872b2['shift']());}};_0x2d537d(++_0x1dddd0);}(_0xba8b,0xac));var _0xbba8=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xba8b[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0xbba8('0x0'));var util=require(_0xbba8('0x1'));var path=require(_0xbba8('0x2'));var timeout=require(_0xbba8('0x3'));var express=require(_0xbba8('0x4'));var router=express['Router']();var fs_extra=require(_0xbba8('0x5'));var auth=require(_0xbba8('0x6'));var interaction=require(_0xbba8('0x7'));var config=require(_0xbba8('0x8'));var controller=require(_0xbba8('0x9'));router[_0xbba8('0xa')]('/',auth[_0xbba8('0xb')](),controller[_0xbba8('0xc')]);router[_0xbba8('0xa')](_0xbba8('0xd'),auth[_0xbba8('0xb')](),controller['describe']);router[_0xbba8('0xa')](_0xbba8('0xe'),auth[_0xbba8('0xb')](),controller['show']);router[_0xbba8('0xf')]('/',auth[_0xbba8('0xb')](),interaction['tracked'](_0xbba8('0x10'),_0xbba8('0x11')),controller[_0xbba8('0x12')]);router['put'](_0xbba8('0xe'),controller[_0xbba8('0x13')]);router[_0xbba8('0x14')](_0xbba8('0x15'),auth[_0xbba8('0xb')](),controller['accept']);router[_0xbba8('0x14')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0xbba8('0x16')](_0xbba8('0xe'),auth[_0xbba8('0xb')](),controller[_0xbba8('0x17')]);module[_0xbba8('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index c2cd8c0..4ae1fc2 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 _0x5f66=['medium','TEXT','exports'];(function(_0x51b9cd,_0x2f3f83){var _0x4ebcf7=function(_0x588728){while(--_0x588728){_0x51b9cd['push'](_0x51b9cd['shift']());}};_0x4ebcf7(++_0x2f3f83);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'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
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5b4c44,_0x2e495e){_0x5b4c44=_0x5b4c44-0x0;var _0x58485a=_0x0b0e[_0x5b4c44];return _0x58485a;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index ebc95b5..a039755 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x32612d,_0x17aa87){var _0x487e65=function(_0x5a9fad){while(--_0x5a9fad){_0x32612d['push'](_0x32612d['shift']());}};_0x487e65(++_0x17aa87);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1e93f9,_0x1c8388){var _0x3c2f41=function(_0x2f371e){while(--_0x2f371e){_0x1e93f9['push'](_0x1e93f9['shift']());}};_0x3c2f41(++_0x1c8388);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index e859fb5..ad10d05 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 _0x099f=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2610ff,_0x54f0b7){var _0x1c88c3=function(_0x354890){while(--_0x354890){_0x2610ff['push'](_0x2610ff['shift']());}};_0x1c88c3(++_0x54f0b7);}(_0x099f,0x133));var _0xf099=function(_0x1dfb1e,_0x888459){_0x1dfb1e=_0x1dfb1e-0x0;var _0x1d45d0=_0x099f[_0x1dfb1e];return _0x1d45d0;};'use strict';var EventEmitter=require(_0xf099('0x0'));var ChatOfflineMessage=require(_0xf099('0x1'))['db'][_0xf099('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xf099('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf099('0x4'),'afterDestroy':_0xf099('0x5')};function emitEvent(_0x8c3488){return function(_0x24270f,_0x3f46c0,_0x35a43a){ChatOfflineMessageEvents[_0xf099('0x6')](_0x8c3488+':'+_0x24270f['id'],_0x24270f);ChatOfflineMessageEvents['emit'](_0x8c3488,_0x24270f);_0x35a43a(null);};}for(var e in events){if(events[_0xf099('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xf099('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xbeea=['remove','emit','hasOwnProperty','exports','events','update'];(function(_0x55d7c2,_0x4ce6fb){var _0x1755ef=function(_0xddc25c){while(--_0xddc25c){_0x55d7c2['push'](_0x55d7c2['shift']());}};_0x1755ef(++_0x4ce6fb);}(_0xbeea,0xfa));var _0xabee=function(_0x518502,_0x23df26){_0x518502=_0x518502-0x0;var _0x59791d=_0xbeea[_0x518502];return _0x59791d;};'use strict';var EventEmitter=require(_0xabee('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xabee('0x1'),'afterDestroy':_0xabee('0x2')};function emitEvent(_0x21c081){return function(_0x274882,_0x2ea93c,_0x222b23){ChatOfflineMessageEvents[_0xabee('0x3')](_0x21c081+':'+_0x274882['id'],_0x274882);ChatOfflineMessageEvents[_0xabee('0x3')](_0x21c081,_0x274882);_0x222b23(null);};}for(var e in events){if(events[_0xabee('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xabee('0x5')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 8c731d3..69f10b8 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 _0xe667=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x2c97be,_0x36e2ab){var _0x305a3f=function(_0x3f40b2){while(--_0x3f40b2){_0x2c97be['push'](_0x2c97be['shift']());}};_0x305a3f(++_0x36e2ab);}(_0xe667,0xb0));var _0x7e66=function(_0x3976c2,_0x60dd0f){_0x3976c2=_0x3976c2-0x0;var _0x1d3076=_0xe667[_0x3976c2];return _0x1d3076;};'use strict';var attributes=require(_0x7e66('0x0'));module[_0x7e66('0x1')]=function(_0x54ee81){return _0x54ee81[_0x7e66('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x7e66('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e66('0x4'),'collate':_0x7e66('0x5')});};
\ No newline at end of file
+var _0xfc44=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x501b1f,_0x3eec44){var _0x46303e=function(_0x50cb9f){while(--_0x50cb9f){_0x501b1f['push'](_0x501b1f['shift']());}};_0x46303e(++_0x3eec44);}(_0xfc44,0xdf));var _0x4fc4=function(_0x33fe92,_0x2f9e93){_0x33fe92=_0x33fe92-0x0;var _0x56e956=_0xfc44[_0x33fe92];return _0x56e956;};'use strict';var attributes=require(_0x4fc4('0x0'));module[_0x4fc4('0x1')]=function(_0x4f7e68){return _0x4f7e68['define']('ChatOfflineMessage',attributes,{'tableName':_0x4fc4('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4fc4('0x3'),'collate':_0x4fc4('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7896332..bdb858c 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 _0x0b1a=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b1a,0x10c));var _0xa0b1=function(_0x5914a0,_0x4c5621){_0x5914a0=_0x5914a0-0x0;var _0x487478=_0x0b1a[_0x5914a0];return _0x487478;};'use strict';var _=require(_0xa0b1('0x0'));var util=require(_0xa0b1('0x1'));var moment=require(_0xa0b1('0x2'));var BPromise=require(_0xa0b1('0x3'));var rs=require(_0xa0b1('0x4'));var fs=require('fs');var Redis=require(_0xa0b1('0x5'));var db=require(_0xa0b1('0x6'))['db'];var utils=require(_0xa0b1('0x7'));var logger=require(_0xa0b1('0x8'))(_0xa0b1('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa0b1('0xa')][_0xa0b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e6d17,_0x692771,_0x96fa55){return new BPromise(function(_0x5d94ca,_0x56a728){return client[_0xa0b1('0xc')](_0x2e6d17,_0x96fa55)[_0xa0b1('0xd')](function(_0x50c1c0){logger[_0xa0b1('0xe')](_0xa0b1('0xf'),_0x692771,_0xa0b1('0x10'));logger[_0xa0b1('0x11')](_0xa0b1('0x12'),_0x692771,'request\x20sent',JSON['stringify'](_0x50c1c0));if(_0x50c1c0[_0xa0b1('0x13')]){if(_0x50c1c0[_0xa0b1('0x13')][_0xa0b1('0x14')]===0x1f4){logger[_0xa0b1('0x13')](_0xa0b1('0xf'),_0x692771,_0x50c1c0[_0xa0b1('0x13')][_0xa0b1('0x15')]);return _0x56a728(_0x50c1c0['error'][_0xa0b1('0x15')]);}logger[_0xa0b1('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x692771,_0x50c1c0[_0xa0b1('0x13')]['message']);return _0x5d94ca(_0x50c1c0[_0xa0b1('0x13')][_0xa0b1('0x15')]);}else{logger['info'](_0xa0b1('0xf'),_0x692771,'request\x20sent');_0x5d94ca(_0x50c1c0[_0xa0b1('0x16')][_0xa0b1('0x15')]);}})[_0xa0b1('0x17')](function(_0x3b1918){logger[_0xa0b1('0x13')](_0xa0b1('0xf'),_0x692771,_0x3b1918);_0x56a728(_0x3b1918);});});}
\ No newline at end of file
+var _0x1580=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x1580,0x15a));var _0x0158=function(_0xa77c4f,_0x474fad){_0xa77c4f=_0xa77c4f-0x0;var _0x1a37ee=_0x1580[_0xa77c4f];return _0x1a37ee;};'use strict';var _=require(_0x0158('0x0'));var util=require(_0x0158('0x1'));var moment=require(_0x0158('0x2'));var BPromise=require(_0x0158('0x3'));var rs=require(_0x0158('0x4'));var fs=require('fs');var Redis=require(_0x0158('0x5'));var db=require(_0x0158('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0158('0x7'))('rpc');var config=require(_0x0158('0x8'));var jayson=require(_0x0158('0x9'));var client=jayson['client'][_0x0158('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b9af3,_0xecf81c,_0x2d7a30){return new BPromise(function(_0x3e885c,_0x4d5047){return client[_0x0158('0xb')](_0x2b9af3,_0x2d7a30)[_0x0158('0xc')](function(_0x4b5450){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xecf81c,_0x0158('0xd'));logger['debug'](_0x0158('0xe'),_0xecf81c,_0x0158('0xd'),JSON[_0x0158('0xf')](_0x4b5450));if(_0x4b5450[_0x0158('0x10')]){if(_0x4b5450[_0x0158('0x10')]['code']===0x1f4){logger[_0x0158('0x10')](_0x0158('0x11'),_0xecf81c,_0x4b5450['error'][_0x0158('0x12')]);return _0x4d5047(_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);}logger[_0x0158('0x10')](_0x0158('0x11'),_0xecf81c,_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);return _0x3e885c(_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);}else{logger[_0x0158('0x13')](_0x0158('0x11'),_0xecf81c,_0x0158('0xd'));_0x3e885c(_0x4b5450[_0x0158('0x14')][_0x0158('0x12')]);}})[_0x0158('0x15')](function(_0x52d6af){logger['error'](_0x0158('0x11'),_0xecf81c,_0x52d6af);_0x4d5047(_0x52d6af);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 1183c25..0f57e53 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 _0xbee3=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x440fde,_0x445ce0){var _0x11052c=function(_0x49f547){while(--_0x49f547){_0x440fde['push'](_0x440fde['shift']());}};_0x11052c(++_0x445ce0);}(_0xbee3,0x135));var _0x3bee=function(_0x541cc4,_0x4e0979){_0x541cc4=_0x541cc4-0x0;var _0x94514c=_0xbee3[_0x541cc4];return _0x94514c;};'use strict';var multer=require(_0x3bee('0x0'));var util=require(_0x3bee('0x1'));var path=require(_0x3bee('0x2'));var timeout=require(_0x3bee('0x3'));var express=require(_0x3bee('0x4'));var router=express[_0x3bee('0x5')]();var fs_extra=require(_0x3bee('0x6'));var auth=require(_0x3bee('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3bee('0x8'));var controller=require(_0x3bee('0x9'));router[_0x3bee('0xa')]('/',auth[_0x3bee('0xb')](),controller['index']);router['get'](_0x3bee('0xc'),auth[_0x3bee('0xb')](),controller['describe']);router[_0x3bee('0xa')](_0x3bee('0xd'),auth[_0x3bee('0xb')](),controller[_0x3bee('0xe')]);router[_0x3bee('0xf')]('/',auth[_0x3bee('0xb')](),controller[_0x3bee('0x10')]);router[_0x3bee('0x11')](_0x3bee('0xd'),auth[_0x3bee('0xb')](),controller[_0x3bee('0x12')]);router[_0x3bee('0x13')](_0x3bee('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3bee('0x14')]=router;
\ No newline at end of file
+var _0x8934=['update','delete','exports','multer','util','path','express','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','/:id'];(function(_0x46ec32,_0x1e842f){var _0x338f60=function(_0x10e02c){while(--_0x10e02c){_0x46ec32['push'](_0x46ec32['shift']());}};_0x338f60(++_0x1e842f);}(_0x8934,0x135));var _0x4893=function(_0x512859,_0x42808d){_0x512859=_0x512859-0x0;var _0x596a03=_0x8934[_0x512859];return _0x596a03;};'use strict';var multer=require(_0x4893('0x0'));var util=require(_0x4893('0x1'));var path=require(_0x4893('0x2'));var timeout=require('connect-timeout');var express=require(_0x4893('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4893('0x4'));var controller=require('./chatOfflineMessage.controller');router[_0x4893('0x5')]('/',auth[_0x4893('0x6')](),controller[_0x4893('0x7')]);router[_0x4893('0x5')]('/describe',auth[_0x4893('0x6')](),controller[_0x4893('0x8')]);router[_0x4893('0x5')]('/:id',auth[_0x4893('0x6')](),controller[_0x4893('0x9')]);router[_0x4893('0xa')]('/',auth[_0x4893('0x6')](),controller[_0x4893('0xb')]);router[_0x4893('0xc')](_0x4893('0xd'),auth[_0x4893('0x6')](),controller[_0x4893('0xe')]);router[_0x4893('0xf')](_0x4893('0xd'),auth[_0x4893('0x6')](),controller['destroy']);module[_0x4893('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index d91dc1a..3db130a 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 _0x5bf3=['mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x554092,_0x211b5f){var _0x33d000=function(_0x43b7a6){while(--_0x43b7a6){_0x554092['push'](_0x554092['shift']());}};_0x33d000(++_0x211b5f);}(_0x5bf3,0xd0));var _0x35bf=function(_0x18df06,_0x26d5cb){_0x18df06=_0x18df06-0x0;var _0x15553a=_0x5bf3[_0x18df06];return _0x15553a;};'use strict';var Sequelize=require(_0x35bf('0x0'));module[_0x35bf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x35bf('0x2'),_0x35bf('0x3')),'defaultValue':_0x35bf('0x2')},'selector':{'type':Sequelize[_0x35bf('0x4')]},'timeout':{'type':Sequelize[_0x35bf('0x5')]}};
\ No newline at end of file
+var _0x6539=['INTEGER','sequelize','exports','mouseOver','STRING'];(function(_0x1a0637,_0x59771a){var _0x11f9e1=function(_0x57698e){while(--_0x57698e){_0x1a0637['push'](_0x1a0637['shift']());}};_0x11f9e1(++_0x59771a);}(_0x6539,0x1c3));var _0x9653=function(_0x534dbe,_0xdbed7f){_0x534dbe=_0x534dbe-0x0;var _0x2fe58a=_0x6539[_0x534dbe];return _0x2fe58a;};'use strict';var Sequelize=require(_0x9653('0x0'));module[_0x9653('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x9653('0x2')},'selector':{'type':Sequelize[_0x9653('0x3')]},'timeout':{'type':Sequelize[_0x9653('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 7d1a0c5..c6d7ebd 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 _0x3ca4=['count','status','Content-Range','apply','reject','save','then','destroy','error','send','show','params','keys','query','filters','intersection','fields','attributes','length','model','includeAll','merge','ChatProactiveAction','find','create','body','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit'];(function(_0x18a8c5,_0x547d26){var _0x2d8579=function(_0x480b7f){while(--_0x480b7f){_0x18a8c5['push'](_0x18a8c5['shift']());}};_0x2d8579(++_0x547d26);}(_0x3ca4,0x17d));var _0x43ca=function(_0x44ace3,_0x52cbcc){_0x44ace3=_0x44ace3-0x0;var _0x1334a2=_0x3ca4[_0x44ace3];return _0x1334a2;};'use strict';var emlformat=require(_0x43ca('0x0'));var rimraf=require(_0x43ca('0x1'));var zipdir=require(_0x43ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x43ca('0x3'));var BPromise=require(_0x43ca('0x4'));var Mustache=require(_0x43ca('0x5'));var util=require(_0x43ca('0x6'));var path=require(_0x43ca('0x7'));var sox=require(_0x43ca('0x8'));var csv=require(_0x43ca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43ca('0xa'));var _=require(_0x43ca('0xb'));var squel=require(_0x43ca('0xc'));var crypto=require(_0x43ca('0xd'));var jsforce=require(_0x43ca('0xe'));var deskjs=require(_0x43ca('0xf'));var toCsv=require(_0x43ca('0x9'));var querystring=require(_0x43ca('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x43ca('0x11'));var qs=require(_0x43ca('0x12'));var as=require(_0x43ca('0x13'));var hardwareService=require(_0x43ca('0x14'));var logger=require('../../config/logger')(_0x43ca('0x15'));var utils=require(_0x43ca('0x16'));var config=require(_0x43ca('0x17'));var licenseUtil=require(_0x43ca('0x18'));var db=require(_0x43ca('0x19'))['db'];function respondWithStatusCode(_0x246ead,_0x30184f){_0x30184f=_0x30184f||0xcc;return function(_0x2ede07){if(_0x2ede07){return _0x246ead[_0x43ca('0x1a')](_0x30184f);}return _0x246ead['status'](_0x30184f)[_0x43ca('0x1b')]();};}function respondWithResult(_0x13cf26,_0x4b710d){_0x4b710d=_0x4b710d||0xc8;return function(_0x309176){if(_0x309176){return _0x13cf26['status'](_0x4b710d)[_0x43ca('0x1c')](_0x309176);}};}function respondWithFilteredResult(_0x567579,_0xdccc62){return function(_0x1a8bf6){if(_0x1a8bf6){var _0x51a517=typeof _0xdccc62[_0x43ca('0x1d')]===_0x43ca('0x1e')&&typeof _0xdccc62[_0x43ca('0x1f')]==='undefined';var _0x4fb5e4=_0x1a8bf6['count'];var _0x5e50c9=_0x51a517?0x0:_0xdccc62[_0x43ca('0x1d')];var _0x268817=_0x51a517?_0x1a8bf6[_0x43ca('0x20')]:_0xdccc62['offset']+_0xdccc62[_0x43ca('0x1f')];var _0x806f68;if(_0x268817>=_0x4fb5e4){_0x268817=_0x4fb5e4;_0x806f68=0xc8;}else{_0x806f68=0xce;}_0x567579[_0x43ca('0x21')](_0x806f68);return _0x567579['set'](_0x43ca('0x22'),_0x5e50c9+'-'+_0x268817+'/'+_0x4fb5e4)['json'](_0x1a8bf6);}return null;};}function patchUpdates(_0x106d07){return function(_0x9bc5dc){try{jsonpatch[_0x43ca('0x23')](_0x9bc5dc,_0x106d07,!![]);}catch(_0x5ae497){return BPromise[_0x43ca('0x24')](_0x5ae497);}return _0x9bc5dc[_0x43ca('0x25')]();};}function saveUpdates(_0x2af64f,_0x2ad8fa){return function(_0x35d34c){if(_0x35d34c){return _0x35d34c['update'](_0x2af64f)[_0x43ca('0x26')](function(_0x34767e){return _0x34767e;});}return null;};}function removeEntity(_0x557b96,_0x379902){return function(_0x22d6ac){if(_0x22d6ac){return _0x22d6ac[_0x43ca('0x27')]()[_0x43ca('0x26')](function(){_0x557b96[_0x43ca('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2da1ec,_0xc07cde){return function(_0x29f2ee){if(!_0x29f2ee){_0x2da1ec[_0x43ca('0x1a')](0x194);}return _0x29f2ee;};}function handleError(_0x14287e,_0x1de54b){_0x1de54b=_0x1de54b||0x1f4;return function(_0x3b2078){logger[_0x43ca('0x28')](_0x3b2078['stack']);if(_0x3b2078['name']){delete _0x3b2078['name'];}_0x14287e[_0x43ca('0x21')](_0x1de54b)[_0x43ca('0x29')](_0x3b2078);};}exports[_0x43ca('0x2a')]=function(_0x9d09b9,_0x34dc4f){var _0x36884b={'raw':!![],'where':{'id':_0x9d09b9[_0x43ca('0x2b')]['id']}},_0xffad2d={};_0xffad2d['model']=_[_0x43ca('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0xffad2d[_0x43ca('0x2d')]=_[_0x43ca('0x2c')](_0x9d09b9[_0x43ca('0x2d')]);_0xffad2d[_0x43ca('0x2e')]=_[_0x43ca('0x2f')](_0xffad2d['model'],_0xffad2d[_0x43ca('0x2d')]);_0x36884b['attributes']=_[_0x43ca('0x2f')](_0xffad2d['model'],qs[_0x43ca('0x30')](_0x9d09b9[_0x43ca('0x2d')]['fields']));_0x36884b[_0x43ca('0x31')]=_0x36884b[_0x43ca('0x31')][_0x43ca('0x32')]?_0x36884b[_0x43ca('0x31')]:_0xffad2d[_0x43ca('0x33')];if(_0x9d09b9[_0x43ca('0x2d')][_0x43ca('0x34')]){_0x36884b['include']=[{'all':!![]}];}_0x36884b=_[_0x43ca('0x35')]({},_0x36884b,_0x9d09b9['options']);return db[_0x43ca('0x36')][_0x43ca('0x37')](_0x36884b)['then'](handleEntityNotFound(_0x34dc4f,null))[_0x43ca('0x26')](respondWithResult(_0x34dc4f,null))['catch'](handleError(_0x34dc4f,null));};exports['create']=function(_0x10f75c,_0x2f69ba){return db[_0x43ca('0x36')][_0x43ca('0x38')](_0x10f75c[_0x43ca('0x39')],{})[_0x43ca('0x26')](respondWithResult(_0x2f69ba,0xc9))[_0x43ca('0x3a')](handleError(_0x2f69ba,null));};exports['update']=function(_0x43b29b,_0x67b8b0){if(_0x43b29b['body']['id']){delete _0x43b29b[_0x43ca('0x39')]['id'];}return db[_0x43ca('0x36')]['find']({'where':{'id':_0x43b29b[_0x43ca('0x2b')]['id']}})['then'](handleEntityNotFound(_0x67b8b0,null))['then'](saveUpdates(_0x43b29b[_0x43ca('0x39')],null))[_0x43ca('0x26')](respondWithResult(_0x67b8b0,null))[_0x43ca('0x3a')](handleError(_0x67b8b0,null));};exports[_0x43ca('0x27')]=function(_0xa466c9,_0x2205c4){return db[_0x43ca('0x36')][_0x43ca('0x37')]({'where':{'id':_0xa466c9[_0x43ca('0x2b')]['id']}})[_0x43ca('0x26')](handleEntityNotFound(_0x2205c4,null))[_0x43ca('0x26')](removeEntity(_0x2205c4,null))[_0x43ca('0x3a')](handleError(_0x2205c4,null));};
\ No newline at end of file
+var _0x2263=['to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','show','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x1e43a9,_0x5051f5){var _0x3e51a7=function(_0x4634fb){while(--_0x4634fb){_0x1e43a9['push'](_0x1e43a9['shift']());}};_0x3e51a7(++_0x5051f5);}(_0x2263,0x6e));var _0x3226=function(_0x4ad0f7,_0x1920b0){_0x4ad0f7=_0x4ad0f7-0x0;var _0x30f5c8=_0x2263[_0x4ad0f7];return _0x30f5c8;};'use strict';var emlformat=require(_0x3226('0x0'));var rimraf=require(_0x3226('0x1'));var zipdir=require(_0x3226('0x2'));var jsonpatch=require(_0x3226('0x3'));var rp=require(_0x3226('0x4'));var moment=require(_0x3226('0x5'));var BPromise=require(_0x3226('0x6'));var Mustache=require(_0x3226('0x7'));var util=require('util');var path=require(_0x3226('0x8'));var sox=require(_0x3226('0x9'));var csv=require(_0x3226('0xa'));var ejs=require(_0x3226('0xb'));var fs=require('fs');var fs_extra=require(_0x3226('0xc'));var _=require('lodash');var squel=require(_0x3226('0xd'));var crypto=require(_0x3226('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3226('0xa'));var querystring=require(_0x3226('0xf'));var Papa=require('papaparse');var Redis=require(_0x3226('0x10'));var authService=require(_0x3226('0x11'));var qs=require(_0x3226('0x12'));var as=require(_0x3226('0x13'));var hardwareService=require(_0x3226('0x14'));var logger=require(_0x3226('0x15'))(_0x3226('0x16'));var utils=require('../../config/utils');var config=require(_0x3226('0x17'));var licenseUtil=require(_0x3226('0x18'));var db=require(_0x3226('0x19'))['db'];function respondWithStatusCode(_0x58aed4,_0x4e7fab){_0x4e7fab=_0x4e7fab||0xcc;return function(_0x485859){if(_0x485859){return _0x58aed4['sendStatus'](_0x4e7fab);}return _0x58aed4['status'](_0x4e7fab)['end']();};}function respondWithResult(_0x24ffc4,_0x425030){_0x425030=_0x425030||0xc8;return function(_0x114f4b){if(_0x114f4b){return _0x24ffc4[_0x3226('0x1a')](_0x425030)['json'](_0x114f4b);}};}function respondWithFilteredResult(_0x5b5c77,_0x2808e5){return function(_0xfc7cb5){if(_0xfc7cb5){var _0x86bb0f=typeof _0x2808e5['offset']===_0x3226('0x1b')&&typeof _0x2808e5[_0x3226('0x1c')]===_0x3226('0x1b');var _0x31d4f0=_0xfc7cb5[_0x3226('0x1d')];var _0x4113a1=_0x86bb0f?0x0:_0x2808e5['offset'];var _0x4b3521=_0x86bb0f?_0xfc7cb5[_0x3226('0x1d')]:_0x2808e5['offset']+_0x2808e5[_0x3226('0x1c')];var _0x1149e1;if(_0x4b3521>=_0x31d4f0){_0x4b3521=_0x31d4f0;_0x1149e1=0xc8;}else{_0x1149e1=0xce;}_0x5b5c77[_0x3226('0x1a')](_0x1149e1);return _0x5b5c77[_0x3226('0x1e')](_0x3226('0x1f'),_0x4113a1+'-'+_0x4b3521+'/'+_0x31d4f0)[_0x3226('0x20')](_0xfc7cb5);}return null;};}function patchUpdates(_0x4d4cd8){return function(_0x2b4d38){try{jsonpatch[_0x3226('0x21')](_0x2b4d38,_0x4d4cd8,!![]);}catch(_0x4dc9a8){return BPromise[_0x3226('0x22')](_0x4dc9a8);}return _0x2b4d38[_0x3226('0x23')]();};}function saveUpdates(_0x146362,_0x4eb7a9){return function(_0x29d92f){if(_0x29d92f){return _0x29d92f[_0x3226('0x24')](_0x146362)[_0x3226('0x25')](function(_0x3b7dad){return _0x3b7dad;});}return null;};}function removeEntity(_0x3191f8,_0x1109b7){return function(_0x29be67){if(_0x29be67){return _0x29be67[_0x3226('0x26')]()['then'](function(){_0x3191f8[_0x3226('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d6341,_0x5b8d32){return function(_0x26c845){if(!_0x26c845){_0x3d6341['sendStatus'](0x194);}return _0x26c845;};}function handleError(_0x1d7689,_0x4aff0c){_0x4aff0c=_0x4aff0c||0x1f4;return function(_0x10942a){logger[_0x3226('0x27')](_0x10942a['stack']);if(_0x10942a[_0x3226('0x28')]){delete _0x10942a[_0x3226('0x28')];}_0x1d7689[_0x3226('0x1a')](_0x4aff0c)[_0x3226('0x29')](_0x10942a);};}exports[_0x3226('0x2a')]=function(_0x38c83c,_0x12e26d){var _0x4b9174={'raw':!![],'where':{'id':_0x38c83c['params']['id']}},_0x34d2aa={};_0x34d2aa[_0x3226('0x2b')]=_[_0x3226('0x2c')](db[_0x3226('0x2d')]['rawAttributes']);_0x34d2aa[_0x3226('0x2e')]=_['keys'](_0x38c83c['query']);_0x34d2aa[_0x3226('0x2f')]=_[_0x3226('0x30')](_0x34d2aa[_0x3226('0x2b')],_0x34d2aa[_0x3226('0x2e')]);_0x4b9174[_0x3226('0x31')]=_[_0x3226('0x30')](_0x34d2aa[_0x3226('0x2b')],qs[_0x3226('0x32')](_0x38c83c[_0x3226('0x2e')]['fields']));_0x4b9174[_0x3226('0x31')]=_0x4b9174[_0x3226('0x31')][_0x3226('0x33')]?_0x4b9174[_0x3226('0x31')]:_0x34d2aa[_0x3226('0x2b')];if(_0x38c83c[_0x3226('0x2e')][_0x3226('0x34')]){_0x4b9174[_0x3226('0x35')]=[{'all':!![]}];}_0x4b9174=_[_0x3226('0x36')]({},_0x4b9174,_0x38c83c[_0x3226('0x37')]);return db[_0x3226('0x2d')][_0x3226('0x38')](_0x4b9174)[_0x3226('0x25')](handleEntityNotFound(_0x12e26d,null))[_0x3226('0x25')](respondWithResult(_0x12e26d,null))['catch'](handleError(_0x12e26d,null));};exports['create']=function(_0x323f17,_0x49cb32){return db[_0x3226('0x2d')]['create'](_0x323f17[_0x3226('0x39')],{})[_0x3226('0x25')](respondWithResult(_0x49cb32,0xc9))[_0x3226('0x3a')](handleError(_0x49cb32,null));};exports[_0x3226('0x24')]=function(_0x32438f,_0x4df2a9){if(_0x32438f[_0x3226('0x39')]['id']){delete _0x32438f['body']['id'];}return db[_0x3226('0x2d')]['find']({'where':{'id':_0x32438f[_0x3226('0x3b')]['id']}})[_0x3226('0x25')](handleEntityNotFound(_0x4df2a9,null))[_0x3226('0x25')](saveUpdates(_0x32438f['body'],null))[_0x3226('0x25')](respondWithResult(_0x4df2a9,null))[_0x3226('0x3a')](handleError(_0x4df2a9,null));};exports[_0x3226('0x26')]=function(_0xde7a6f,_0x18099b){return db[_0x3226('0x2d')][_0x3226('0x38')]({'where':{'id':_0xde7a6f[_0x3226('0x3b')]['id']}})[_0x3226('0x25')](handleEntityNotFound(_0x18099b,null))[_0x3226('0x25')](removeEntity(_0x18099b,null))[_0x3226('0x3a')](handleError(_0x18099b,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index bd40416..95ccac3 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 _0xa711=['chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','ChatProactiveAction'];(function(_0x2e7abb,_0x1e2a4a){var _0xb46ecd=function(_0x99533a){while(--_0x99533a){_0x2e7abb['push'](_0x2e7abb['shift']());}};_0xb46ecd(++_0x1e2a4a);}(_0xa711,0x12d));var _0x1a71=function(_0x1c09bf,_0x259ee2){_0x1c09bf=_0x1c09bf-0x0;var _0x40cdfa=_0xa711[_0x1c09bf];return _0x40cdfa;};'use strict';var _=require(_0x1a71('0x0'));var util=require('util');var logger=require(_0x1a71('0x1'))(_0x1a71('0x2'));var moment=require(_0x1a71('0x3'));var BPromise=require(_0x1a71('0x4'));var rp=require(_0x1a71('0x5'));var fs=require('fs');var path=require(_0x1a71('0x6'));var rimraf=require('rimraf');var config=require(_0x1a71('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x22d966,_0x3d2e99){return _0x22d966['define'](_0x1a71('0x8'),attributes,{'tableName':_0x1a71('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe844=['../../config/environment','exports','define','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xf3fb4e,_0x1f8665){var _0x561bdb=function(_0x2a538c){while(--_0x2a538c){_0xf3fb4e['push'](_0xf3fb4e['shift']());}};_0x561bdb(++_0x1f8665);}(_0xe844,0xc1));var _0x4e84=function(_0x238de8,_0x1e0e37){_0x238de8=_0x238de8-0x0;var _0x43e2a7=_0xe844[_0x238de8];return _0x43e2a7;};'use strict';var _=require(_0x4e84('0x0'));var util=require('util');var logger=require(_0x4e84('0x1'))('api');var moment=require(_0x4e84('0x2'));var BPromise=require(_0x4e84('0x3'));var rp=require(_0x4e84('0x4'));var fs=require('fs');var path=require(_0x4e84('0x5'));var rimraf=require(_0x4e84('0x6'));var config=require(_0x4e84('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x4e84('0x8')]=function(_0x2cb2b0,_0x512f32){return _0x2cb2b0[_0x4e84('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index eb43acd..7065855 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 _0xcadc=['debug','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0xfde4,_0x30585c){var _0x2328fc=function(_0x389859){while(--_0x389859){_0xfde4['push'](_0xfde4['shift']());}};_0x2328fc(++_0x30585c);}(_0xcadc,0x1a6));var _0xccad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcadc[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xccad('0x0'));var moment=require(_0xccad('0x1'));var BPromise=require(_0xccad('0x2'));var rs=require(_0xccad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xccad('0x4'))['db'];var utils=require(_0xccad('0x5'));var logger=require(_0xccad('0x6'))(_0xccad('0x7'));var config=require(_0xccad('0x8'));var jayson=require(_0xccad('0x9'));var client=jayson[_0xccad('0xa')][_0xccad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58dbcf,_0x21e6c0,_0x4cf210){return new BPromise(function(_0x5e4347,_0x1e166d){return client[_0xccad('0xc')](_0x58dbcf,_0x4cf210)[_0xccad('0xd')](function(_0x39897b){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x21e6c0,_0xccad('0xe'));logger[_0xccad('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x21e6c0,_0xccad('0xe'),JSON[_0xccad('0x10')](_0x39897b));if(_0x39897b[_0xccad('0x11')]){if(_0x39897b[_0xccad('0x11')][_0xccad('0x12')]===0x1f4){logger['error'](_0xccad('0x13'),_0x21e6c0,_0x39897b[_0xccad('0x11')][_0xccad('0x14')]);return _0x1e166d(_0x39897b[_0xccad('0x11')]['message']);}logger['error'](_0xccad('0x13'),_0x21e6c0,_0x39897b[_0xccad('0x11')][_0xccad('0x14')]);return _0x5e4347(_0x39897b[_0xccad('0x11')][_0xccad('0x14')]);}else{logger['info'](_0xccad('0x13'),_0x21e6c0,_0xccad('0xe'));_0x5e4347(_0x39897b[_0xccad('0x15')]['message']);}})[_0xccad('0x16')](function(_0x3b49fc){logger[_0xccad('0x11')](_0xccad('0x13'),_0x21e6c0,_0x3b49fc);_0x1e166d(_0x3b49fc);});});}
\ No newline at end of file
+var _0xff86=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x5a2e19,_0x3a283e){var _0x225ca3=function(_0x260d38){while(--_0x260d38){_0x5a2e19['push'](_0x5a2e19['shift']());}};_0x225ca3(++_0x3a283e);}(_0xff86,0x173));var _0x6ff8=function(_0x15b021,_0xa10159){_0x15b021=_0x15b021-0x0;var _0x27d4ce=_0xff86[_0x15b021];return _0x27d4ce;};'use strict';var _=require(_0x6ff8('0x0'));var util=require(_0x6ff8('0x1'));var moment=require(_0x6ff8('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ff8('0x3'));var fs=require('fs');var Redis=require(_0x6ff8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ff8('0x5'));var logger=require(_0x6ff8('0x6'))(_0x6ff8('0x7'));var config=require('../../config/environment');var jayson=require(_0x6ff8('0x8'));var client=jayson[_0x6ff8('0x9')][_0x6ff8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x576c89,_0x377f29,_0x4f8f2c){return new BPromise(function(_0x5a9682,_0x53d98d){return client['request'](_0x576c89,_0x4f8f2c)[_0x6ff8('0xb')](function(_0x3cf90d){logger[_0x6ff8('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x377f29,_0x6ff8('0xd'));logger[_0x6ff8('0xe')](_0x6ff8('0xf'),_0x377f29,_0x6ff8('0xd'),JSON[_0x6ff8('0x10')](_0x3cf90d));if(_0x3cf90d[_0x6ff8('0x11')]){if(_0x3cf90d[_0x6ff8('0x11')][_0x6ff8('0x12')]===0x1f4){logger[_0x6ff8('0x11')](_0x6ff8('0x13'),_0x377f29,_0x3cf90d['error'][_0x6ff8('0x14')]);return _0x53d98d(_0x3cf90d['error'][_0x6ff8('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x377f29,_0x3cf90d[_0x6ff8('0x11')][_0x6ff8('0x14')]);return _0x5a9682(_0x3cf90d['error'][_0x6ff8('0x14')]);}else{logger[_0x6ff8('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x377f29,_0x6ff8('0xd'));_0x5a9682(_0x3cf90d[_0x6ff8('0x15')]['message']);}})[_0x6ff8('0x16')](function(_0x14bd8c){logger[_0x6ff8('0x11')](_0x6ff8('0x13'),_0x377f29,_0x14bd8c);_0x53d98d(_0x14bd8c);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 1de1f28..4eff461 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x1f3707,_0x3fd9ca){var _0x577ba7=function(_0x590925){while(--_0x590925){_0x1f3707['push'](_0x1f3707['shift']());}};_0x577ba7(++_0x3fd9ca);}(_0x4819,0xcd));var _0x9481=function(_0x2f7c40,_0xb36203){_0x2f7c40=_0x2f7c40-0x0;var _0x57a4a5=_0x4819[_0x2f7c40];return _0x57a4a5;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router;
\ No newline at end of file
+var _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x5db5b9,_0x10249a){var _0x19519e=function(_0x5a6141){while(--_0x5a6141){_0x5db5b9['push'](_0x5db5b9['shift']());}};_0x19519e(++_0x10249a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xaa7629,_0x219723){_0xaa7629=_0xaa7629-0x0;var _0x487c07=_0x7fbe[_0xaa7629];return _0x487c07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 412fb97..0a1f57d 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 _0x8721=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x1c95f6,_0x440967){var _0x2192b6=function(_0x1c8efd){while(--_0x1c8efd){_0x1c95f6['push'](_0x1c95f6['shift']());}};_0x2192b6(++_0x440967);}(_0x8721,0x11a));var _0x1872=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0x8721[_0x5d4f12];return _0x4eb577;};'use strict';var Sequelize=require(_0x1872('0x0'));module[_0x1872('0x1')]={'name':{'type':Sequelize[_0x1872('0x2')],'unique':_0x1872('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1872('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1872('0x5')](_0x1872('0x6'),_0x1872('0x7'),_0x1872('0x8'))}};
\ No newline at end of file
+var _0x50c6=['ENUM','rrmemory','beepall','exports','STRING','INTEGER'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x50c6,0x1ef));var _0x650c=function(_0x552fe3,_0x4f2ea3){_0x552fe3=_0x552fe3-0x0;var _0x368701=_0x50c6[_0x552fe3];return _0x368701;};'use strict';var Sequelize=require('sequelize');module[_0x650c('0x0')]={'name':{'type':Sequelize[_0x650c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x650c('0x1')]},'timeout':{'type':Sequelize[_0x650c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x650c('0x3')](_0x650c('0x4'),_0x650c('0x5'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 5453a7b..1db3d50 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 _0x3572=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatQueue','include','rows','show','params','intersection','includeAll','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','order','ChatQueueId','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Team','User','Agents','interface','flatMap','sequelize','each','findOrCreate','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','transaction','isEmpty','forEach','userChatQueue:remove','addAgents','spread','emit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0xce8fdb,_0x45943c){var _0x3cc5b8=function(_0x287b17){while(--_0x287b17){_0xce8fdb['push'](_0xce8fdb['shift']());}};_0x3cc5b8(++_0x45943c);}(_0x3572,0x87));var _0x2357=function(_0x3c14ab,_0x1bac70){_0x3c14ab=_0x3c14ab-0x0;var _0x2e4a9f=_0x3572[_0x3c14ab];return _0x2e4a9f;};'use strict';var emlformat=require(_0x2357('0x0'));var rimraf=require(_0x2357('0x1'));var zipdir=require(_0x2357('0x2'));var jsonpatch=require(_0x2357('0x3'));var rp=require(_0x2357('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2357('0x5'));var util=require(_0x2357('0x6'));var path=require(_0x2357('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2357('0x8'));var _=require(_0x2357('0x9'));var squel=require(_0x2357('0xa'));var crypto=require(_0x2357('0xb'));var jsforce=require(_0x2357('0xc'));var deskjs=require(_0x2357('0xd'));var toCsv=require(_0x2357('0xe'));var querystring=require('querystring');var Papa=require(_0x2357('0xf'));var Redis=require(_0x2357('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2357('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2357('0x12'))(_0x2357('0x13'));var utils=require(_0x2357('0x14'));var config=require(_0x2357('0x15'));var licenseUtil=require(_0x2357('0x16'));var db=require(_0x2357('0x17'))['db'];config[_0x2357('0x18')]=_[_0x2357('0x19')](config[_0x2357('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2357('0x1a'))(new Redis(config[_0x2357('0x18')]));require('./chatQueue.socket')[_0x2357('0x1b')](socket);var jayson=require(_0x2357('0x1c'));var client=jayson[_0x2357('0x1d')][_0x2357('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1ea7e0,_0x23373f,_0x161499,_0x323fe8){return new BPromise(function(_0x2c74c3,_0x3046e2){var _0x450232=_0x323fe8||client;return _0x450232[_0x2357('0x1f')](_0x1ea7e0,_0x161499)['then'](function(_0x59548c){logger[_0x2357('0x20')]('ChatQueue,\x20%s,\x20%s',_0x23373f,_0x2357('0x21'));logger[_0x2357('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23373f,_0x2357('0x21'),JSON['stringify'](_0x59548c));if(_0x59548c[_0x2357('0x23')]){if(_0x59548c['error'][_0x2357('0x24')]===0x1f4){logger[_0x2357('0x23')](_0x2357('0x25'),_0x23373f,_0x59548c['error']['message']);return _0x3046e2(_0x59548c[_0x2357('0x23')][_0x2357('0x26')]);}logger[_0x2357('0x23')]('ChatQueue,\x20%s,\x20%s',_0x23373f,_0x59548c[_0x2357('0x23')]['message']);return _0x2c74c3(_0x59548c[_0x2357('0x23')][_0x2357('0x26')]);}else{logger[_0x2357('0x20')]('ChatQueue,\x20%s,\x20%s',_0x23373f,_0x2357('0x21'));_0x2c74c3(_0x59548c[_0x2357('0x27')]['message']);}})[_0x2357('0x28')](function(_0x2e7783){logger[_0x2357('0x23')](_0x2357('0x25'),_0x23373f,_0x2e7783);_0x3046e2(_0x2e7783);});});}function respondWithStatusCode(_0x4972c0,_0x59ed30){_0x59ed30=_0x59ed30||0xcc;return function(_0x1d6594){if(_0x1d6594){return _0x4972c0[_0x2357('0x29')](_0x59ed30);}return _0x4972c0[_0x2357('0x2a')](_0x59ed30)[_0x2357('0x2b')]();};}function respondWithResult(_0x3cb63f,_0xe40b7e){_0xe40b7e=_0xe40b7e||0xc8;return function(_0x5c8c78){if(_0x5c8c78){return _0x3cb63f[_0x2357('0x2a')](_0xe40b7e)[_0x2357('0x2c')](_0x5c8c78);}};}function respondWithFilteredResult(_0x1a4ffc,_0x14ccb6){return function(_0x1479c3){if(_0x1479c3){var _0x50f794=typeof _0x14ccb6[_0x2357('0x2d')]===_0x2357('0x2e')&&typeof _0x14ccb6[_0x2357('0x2f')]===_0x2357('0x2e');var _0x165bff=_0x1479c3[_0x2357('0x30')];var _0x1d89d4=_0x50f794?0x0:_0x14ccb6[_0x2357('0x2d')];var _0x1f8ce0=_0x50f794?_0x1479c3['count']:_0x14ccb6[_0x2357('0x2d')]+_0x14ccb6['limit'];var _0x263949;if(_0x1f8ce0>=_0x165bff){_0x1f8ce0=_0x165bff;_0x263949=0xc8;}else{_0x263949=0xce;}_0x1a4ffc[_0x2357('0x2a')](_0x263949);return _0x1a4ffc[_0x2357('0x31')](_0x2357('0x32'),_0x1d89d4+'-'+_0x1f8ce0+'/'+_0x165bff)[_0x2357('0x2c')](_0x1479c3);}return null;};}function patchUpdates(_0x113dce){return function(_0x2dd8e9){try{jsonpatch[_0x2357('0x33')](_0x2dd8e9,_0x113dce,!![]);}catch(_0x1be753){return BPromise['reject'](_0x1be753);}return _0x2dd8e9['save']();};}function saveUpdates(_0x39d8b6,_0x4f6266){return function(_0x35978c){if(_0x35978c){return _0x35978c['update'](_0x39d8b6)[_0x2357('0x34')](function(_0x300ba0){return _0x300ba0;});}return null;};}function removeEntity(_0x5c97d8,_0x18d53a){return function(_0x7ccb38){if(_0x7ccb38){return _0x7ccb38[_0x2357('0x35')]()[_0x2357('0x34')](function(){var _0x4735f6=_0x7ccb38[_0x2357('0x36')]({'plain':!![]});var _0x44b237=_0x2357('0x37');return db[_0x2357('0x38')][_0x2357('0x35')]({'where':{'type':_0x44b237,'resourceId':_0x4735f6['id']}})[_0x2357('0x34')](function(){return _0x7ccb38;});})[_0x2357('0x34')](function(){_0x5c97d8[_0x2357('0x2a')](0xcc)[_0x2357('0x2b')]();});}};}function handleEntityNotFound(_0x5a5d97,_0x278fce){return function(_0x32eb48){if(!_0x32eb48){_0x5a5d97[_0x2357('0x29')](0x194);}return _0x32eb48;};}function handleError(_0x2436ff,_0x567b22){_0x567b22=_0x567b22||0x1f4;return function(_0x2fc00d){logger['error'](_0x2fc00d[_0x2357('0x39')]);if(_0x2fc00d[_0x2357('0x3a')]){delete _0x2fc00d[_0x2357('0x3a')];}_0x2436ff['status'](_0x567b22)['send'](_0x2fc00d);};}exports[_0x2357('0x3b')]=function(_0x47b921,_0x502dde){var _0xf890cb={},_0x101093={},_0x24539f={'count':0x0,'rows':[]};var _0x2e30d3=_[_0x2357('0x3c')](db['ChatQueue'][_0x2357('0x3d')],function(_0x212293){return{'name':_0x212293[_0x2357('0x3e')],'type':_0x212293['type'][_0x2357('0x3f')]};});_0x101093['model']=_[_0x2357('0x3c')](_0x2e30d3,_0x2357('0x3a'));_0x101093[_0x2357('0x40')]=_[_0x2357('0x41')](_0x47b921[_0x2357('0x40')]);_0x101093[_0x2357('0x42')]=_['intersection'](_0x101093[_0x2357('0x43')],_0x101093['query']);_0xf890cb['attributes']=_['intersection'](_0x101093['model'],qs[_0x2357('0x44')](_0x47b921[_0x2357('0x40')]['fields']));_0xf890cb[_0x2357('0x45')]=_0xf890cb['attributes'][_0x2357('0x46')]?_0xf890cb[_0x2357('0x45')]:_0x101093[_0x2357('0x43')];if(!_0x47b921[_0x2357('0x40')][_0x2357('0x47')](_0x2357('0x48'))){_0xf890cb[_0x2357('0x2f')]=qs['limit'](_0x47b921['query'][_0x2357('0x2f')]);_0xf890cb[_0x2357('0x2d')]=qs[_0x2357('0x2d')](_0x47b921[_0x2357('0x40')][_0x2357('0x2d')]);}_0xf890cb['order']=qs[_0x2357('0x49')](_0x47b921['query'][_0x2357('0x49')]);_0xf890cb[_0x2357('0x4a')]=qs['filters'](_[_0x2357('0x4b')](_0x47b921[_0x2357('0x40')],_0x101093[_0x2357('0x42')]),_0x2e30d3);if(_0x47b921['query'][_0x2357('0x4c')]){_0xf890cb[_0x2357('0x4a')]=_[_0x2357('0x4d')](_0xf890cb[_0x2357('0x4a')],{'$or':_[_0x2357('0x3c')](_0x2e30d3,function(_0x25d4e4){if(_0x25d4e4['type']!=='VIRTUAL'){var _0x2aec50={};_0x2aec50[_0x25d4e4[_0x2357('0x3a')]]={'$like':'%'+_0x47b921[_0x2357('0x40')][_0x2357('0x4c')]+'%'};return _0x2aec50;}})});}_0xf890cb=_['merge']({},_0xf890cb,_0x47b921[_0x2357('0x4e')]);var _0x1be43c={'where':_0xf890cb[_0x2357('0x4a')]};return db[_0x2357('0x4f')][_0x2357('0x30')](_0x1be43c)[_0x2357('0x34')](function(_0x33cab1){_0x24539f['count']=_0x33cab1;if(_0x47b921[_0x2357('0x40')]['includeAll']){_0xf890cb[_0x2357('0x50')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0xf890cb);})[_0x2357('0x34')](function(_0x5f326b){_0x24539f[_0x2357('0x51')]=_0x5f326b;return _0x24539f;})[_0x2357('0x34')](respondWithFilteredResult(_0x502dde,_0xf890cb))['catch'](handleError(_0x502dde,null));};exports[_0x2357('0x52')]=function(_0x22d36c,_0x43467a){var _0x3ca3da={'raw':!![],'where':{'id':_0x22d36c[_0x2357('0x53')]['id']}},_0x1cd7ed={};_0x1cd7ed['model']=_['keys'](db[_0x2357('0x4f')][_0x2357('0x3d')]);_0x1cd7ed[_0x2357('0x40')]=_[_0x2357('0x41')](_0x22d36c[_0x2357('0x40')]);_0x1cd7ed['filters']=_[_0x2357('0x54')](_0x1cd7ed['model'],_0x1cd7ed[_0x2357('0x40')]);_0x3ca3da['attributes']=_['intersection'](_0x1cd7ed[_0x2357('0x43')],qs[_0x2357('0x44')](_0x22d36c[_0x2357('0x40')][_0x2357('0x44')]));_0x3ca3da[_0x2357('0x45')]=_0x3ca3da['attributes'][_0x2357('0x46')]?_0x3ca3da[_0x2357('0x45')]:_0x1cd7ed[_0x2357('0x43')];if(_0x22d36c[_0x2357('0x40')][_0x2357('0x55')]){_0x3ca3da['include']=[{'all':!![]}];}_0x3ca3da=_[_0x2357('0x4d')]({},_0x3ca3da,_0x22d36c[_0x2357('0x4e')]);return db['ChatQueue'][_0x2357('0x56')](_0x3ca3da)[_0x2357('0x34')](handleEntityNotFound(_0x43467a,null))[_0x2357('0x34')](respondWithResult(_0x43467a,null))['catch'](handleError(_0x43467a,null));};exports[_0x2357('0x57')]=function(_0x2cbe9e,_0x10a842){return db[_0x2357('0x4f')]['create'](_0x2cbe9e[_0x2357('0x58')],{})['then'](function(_0x21fe74){var _0x27afc0=_0x2cbe9e[_0x2357('0x59')]['get']({'plain':!![]});if(!_0x27afc0)throw new Error(_0x2357('0x5a'));if(_0x27afc0[_0x2357('0x5b')]===_0x2357('0x59')){var _0x3efd6a=_0x21fe74[_0x2357('0x36')]({'plain':!![]});var _0x1df6c9=_0x2357('0x37');return db[_0x2357('0x5c')][_0x2357('0x56')]({'where':{'name':_0x1df6c9,'userProfileId':_0x27afc0[_0x2357('0x5d')]},'raw':!![]})[_0x2357('0x34')](function(_0x410136){if(_0x410136&&_0x410136[_0x2357('0x5e')]===0x0){return db['UserProfileResource'][_0x2357('0x57')]({'name':_0x3efd6a['name'],'resourceId':_0x3efd6a['id'],'type':_0x410136['name'],'sectionId':_0x410136['id']},{})[_0x2357('0x34')](function(){return _0x21fe74;});}else{return _0x21fe74;}})[_0x2357('0x28')](function(_0x4b5319){logger[_0x2357('0x23')](_0x2357('0x5f'),_0x4b5319);throw _0x4b5319;});}return _0x21fe74;})[_0x2357('0x34')](respondWithResult(_0x10a842,0xc9))['catch'](handleError(_0x10a842,null));};exports['update']=function(_0x41fa50,_0x1b72d5){if(_0x41fa50[_0x2357('0x58')]['id']){delete _0x41fa50[_0x2357('0x58')]['id'];}return db[_0x2357('0x4f')]['find']({'where':{'id':_0x41fa50[_0x2357('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b72d5,null))[_0x2357('0x34')](saveUpdates(_0x41fa50['body'],null))[_0x2357('0x34')](respondWithResult(_0x1b72d5,null))[_0x2357('0x28')](handleError(_0x1b72d5,null));};exports[_0x2357('0x35')]=function(_0x16ff9b,_0x221050){return db[_0x2357('0x4f')]['find']({'where':{'id':_0x16ff9b['params']['id']}})['then'](handleEntityNotFound(_0x221050,null))[_0x2357('0x34')](removeEntity(_0x221050,null))['catch'](handleError(_0x221050,null));};exports[_0x2357('0x60')]=function(_0x2843b8,_0x32770a){return db['ChatQueue']['describe']()[_0x2357('0x34')](respondWithResult(_0x32770a,null))['catch'](handleError(_0x32770a,null));};exports[_0x2357('0x61')]=function(_0x16790b,_0x4ea3cc,_0x390697){var _0x6259ea={'raw':!![],'where':{}},_0x241c3f={},_0x37568f;return db[_0x2357('0x4f')][_0x2357('0x62')]({'where':{'id':_0x16790b[_0x2357('0x53')]['id']}})['then'](handleEntityNotFound(_0x4ea3cc,null))[_0x2357('0x34')](function(_0x11575e){if(_0x11575e){_0x37568f=_0x11575e['get']({'plain':!![]});_0x241c3f['model']=_[_0x2357('0x41')](db[_0x2357('0x63')]['rawAttributes']);_0x241c3f['query']=_[_0x2357('0x41')](_0x16790b[_0x2357('0x40')]);_0x241c3f['filters']=_[_0x2357('0x54')](_0x241c3f[_0x2357('0x43')],_0x241c3f[_0x2357('0x40')]);_0x6259ea[_0x2357('0x45')]=_[_0x2357('0x54')](_0x241c3f[_0x2357('0x43')],qs['fields'](_0x16790b[_0x2357('0x40')]['fields']));_0x6259ea[_0x2357('0x45')]=_0x6259ea[_0x2357('0x45')]['length']?_0x6259ea['attributes']:_0x241c3f[_0x2357('0x43')];if(!_0x16790b[_0x2357('0x40')]['hasOwnProperty'](_0x2357('0x48'))){_0x6259ea[_0x2357('0x2f')]=qs['limit'](_0x16790b[_0x2357('0x40')][_0x2357('0x2f')]);_0x6259ea[_0x2357('0x2d')]=qs['offset'](_0x16790b[_0x2357('0x40')][_0x2357('0x2d')]);}_0x6259ea[_0x2357('0x64')]=qs[_0x2357('0x49')](_0x16790b['query'][_0x2357('0x49')]);_0x6259ea[_0x2357('0x4a')]=qs['filters'](_['pick'](_0x16790b[_0x2357('0x40')],_0x241c3f[_0x2357('0x42')]));_0x6259ea[_0x2357('0x4a')][_0x2357('0x65')]=_0x11575e['id'];if(_0x16790b[_0x2357('0x40')][_0x2357('0x4c')]){_0x6259ea[_0x2357('0x4a')]=_[_0x2357('0x4d')](_0x6259ea['where'],{'$or':_[_0x2357('0x3c')](_0x6259ea['attributes'],function(_0x2d7fda){var _0x2fc915={};_0x2fc915[_0x2d7fda]={'$like':'%'+_0x16790b[_0x2357('0x40')][_0x2357('0x4c')]+'%'};return _0x2fc915;})});}_0x6259ea=_[_0x2357('0x4d')]({},_0x6259ea,_0x16790b['options']);return db[_0x2357('0x63')][_0x2357('0x66')](_0x6259ea);}})[_0x2357('0x34')](function(_0xab8a48){if(_0xab8a48){return db['User'][_0x2357('0x67')]({'where':{'id':_[_0x2357('0x3c')](_0xab8a48,_0x2357('0x68')),'role':_0x2357('0x69')},'attributes':['id',_0x2357('0x3a'),_0x2357('0x6a'),_0x2357('0x6b'),_0x2357('0x6c')]});}})[_0x2357('0x34')](function(_0x13f371){if(_0x13f371){return{'count':_0x13f371['count'],'rows':_[_0x2357('0x3c')](_0x13f371[_0x2357('0x51')],function(_0x7077a8){return{'membername':_0x7077a8[_0x2357('0x3a')],'UserId':_0x7077a8['id'],'queue_name':_0x37568f[_0x2357('0x3a')],'ChatQueueId':_0x37568f['id'],'interface':util[_0x2357('0x6d')]('%s/%s',_0x2357('0x6e'),_0x7077a8[_0x2357('0x3a')]),'penalty':0x0,'paused':_0x7077a8['chatPause'],'createdAt':_0x7077a8['createdAt'],'updatedAt':_0x7077a8[_0x2357('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4ea3cc,_0x6259ea))[_0x2357('0x28')](handleError(_0x4ea3cc,null));};exports[_0x2357('0x6f')]=function(_0xcd3e83,_0x8b8546,_0x5e42a5){var _0xd68cbb={};var _0x4dd001={};var _0x285664;var _0x37cef0;return db['ChatQueue'][_0x2357('0x62')]({'where':{'id':_0xcd3e83[_0x2357('0x53')]['id']}})[_0x2357('0x34')](handleEntityNotFound(_0x8b8546,null))[_0x2357('0x34')](function(_0x439670){if(_0x439670){_0x285664=_0x439670;_0x4dd001['model']=_[_0x2357('0x41')](db['Team'][_0x2357('0x3d')]);_0x4dd001[_0x2357('0x40')]=_['keys'](_0xcd3e83[_0x2357('0x40')]);_0x4dd001['filters']=_[_0x2357('0x54')](_0x4dd001[_0x2357('0x43')],_0x4dd001['query']);_0xd68cbb[_0x2357('0x45')]=_[_0x2357('0x54')](_0x4dd001[_0x2357('0x43')],qs['fields'](_0xcd3e83[_0x2357('0x40')]['fields']));_0xd68cbb[_0x2357('0x45')]=_0xd68cbb[_0x2357('0x45')]['length']?_0xd68cbb[_0x2357('0x45')]:_0x4dd001[_0x2357('0x43')];_0xd68cbb['order']=qs[_0x2357('0x49')](_0xcd3e83[_0x2357('0x40')]['sort']);_0xd68cbb[_0x2357('0x4a')]=qs[_0x2357('0x42')](_[_0x2357('0x4b')](_0xcd3e83[_0x2357('0x40')],_0x4dd001[_0x2357('0x42')]));if(_0xcd3e83[_0x2357('0x40')][_0x2357('0x4c')]){_0xd68cbb['where']=_['merge'](_0xd68cbb[_0x2357('0x4a')],{'$or':_[_0x2357('0x3c')](_0xd68cbb['attributes'],function(_0xaa2502){var _0x95900={};_0x95900[_0xaa2502]={'$like':'%'+_0xcd3e83['query'][_0x2357('0x4c')]+'%'};return _0x95900;})});}_0xd68cbb=_[_0x2357('0x4d')]({},_0xd68cbb,_0xcd3e83[_0x2357('0x4e')]);return _0x285664[_0x2357('0x6f')](_0xd68cbb);}})[_0x2357('0x34')](function(_0x11698){if(_0x11698){_0x37cef0=_0x11698[_0x2357('0x46')];if(!_0xcd3e83[_0x2357('0x40')]['hasOwnProperty']('nolimit')){_0xd68cbb['limit']=qs['limit'](_0xcd3e83['query'][_0x2357('0x2f')]);_0xd68cbb[_0x2357('0x2d')]=qs[_0x2357('0x2d')](_0xcd3e83['query']['offset']);}return _0x285664[_0x2357('0x6f')](_0xd68cbb);}})[_0x2357('0x34')](function(_0x4b3e12){if(_0x4b3e12){return _0x4b3e12?{'count':_0x37cef0,'rows':_0x4b3e12}:null;}})[_0x2357('0x34')](respondWithResult(_0x8b8546,null))[_0x2357('0x28')](handleError(_0x8b8546,null));};exports[_0x2357('0x70')]=function(_0x18a956,_0x57b4ee,_0x5bb198){var _0x4c500c=_0x18a956['body'][_0x2357('0x71')];return db[_0x2357('0x72')]['findAll']({'where':{'id':_0x4c500c},'attributes':['id'],'include':[{'model':db[_0x2357('0x73')],'as':_0x2357('0x74'),'attributes':['id',_0x2357('0x3a'),'online','voicePause',_0x2357('0x75')],'raw':!![]}]})[_0x2357('0x34')](function(_0x1701cd){if(_0x1701cd){var _0x55a450=_[_0x2357('0x76')](_0x1701cd,function(_0x54ebd6){var _0x206d6e=_0x54ebd6[_0x2357('0x36')]({'plain':!![]});return _0x206d6e[_0x2357('0x74')];});return db[_0x2357('0x4f')]['find']({'where':{'id':_0x18a956['params']['id']}})[_0x2357('0x34')](function(_0x569cc0){return db[_0x2357('0x77')]['transaction'](function(_0x5dd227){return _0x569cc0[_0x2357('0x70')](_0x4c500c,{'transaction':_0x5dd227})[_0x2357('0x34')](function(){return BPromise[_0x2357('0x78')](_0x55a450,function(_0x5ecdd1){return db[_0x2357('0x63')][_0x2357('0x79')]({'where':{'UserId':_0x5ecdd1['id'],'ChatQueueId':_0x18a956[_0x2357('0x53')]['id']},'transaction':_0x5dd227});});})[_0x2357('0x34')](function(){_0x55a450['forEach'](function(_0x3cc8dd){socket['emit'](_0x2357('0x7a'),{'UserId':_0x3cc8dd['id'],'ChatQueueId':_0x569cc0['id']});});});});});}})['then'](respondWithStatusCode(_0x57b4ee,null))[_0x2357('0x28')](handleError(_0x57b4ee,null));};exports[_0x2357('0x7b')]=function(_0x41bd4c,_0x25a528,_0x2289a9){return db[_0x2357('0x72')][_0x2357('0x66')]({'where':{'id':_0x41bd4c[_0x2357('0x40')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x25a528,null))[_0x2357('0x34')](function(_0x485152){var _0x27d631=_[_0x2357('0x3c')](_0x485152,'id');var _0x17985e=[];var _0x710a0d=[];var _0x2a84d6=squel[_0x2357('0x7c')]();_0x2a84d6[_0x2357('0x7d')](_0x2357('0x7e'))[_0x2357('0x7f')](_0x2357('0x80'),'tq')[_0x2357('0x81')](_0x2357('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2357('0x83'),_0x41bd4c['params']['id']);for(var _0x3b1437=0x0;_0x3b1437<_0x485152[_0x2357('0x46')];_0x3b1437+=0x1){let _0x357257=_0x485152[_0x3b1437];for(var _0x3ae48e=0x0;_0x3ae48e<_0x357257[_0x2357('0x74')][_0x2357('0x46')];_0x3ae48e+=0x1){let _0x3a1689=_0x357257[_0x2357('0x74')][_0x3ae48e];var _0x4cc835=_0x2a84d6[_0x2357('0x84')]();_0x4cc835[_0x2357('0x4a')](_0x2357('0x85'),_0x3a1689['id']);_0x710a0d['push'](db[_0x2357('0x77')]['query'](_0x4cc835[_0x2357('0x86')](),{'type':db[_0x2357('0x77')][_0x2357('0x87')][_0x2357('0x88')]})[_0x2357('0x34')](function(_0x1776f4){if(_0x1776f4['length']===0x1){return _0x3a1689['id'];}else{var _0x53c9f3=_[_0x2357('0x89')](_[_0x2357('0x3c')](_0x1776f4,'TeamId'),function(_0x27f7f6){return _[_0x2357('0x8a')](_0x27d631,_0x27f7f6);});if(_0x53c9f3){return _0x3a1689['id'];}}}));}}return BPromise[_0x2357('0x8b')](_0x710a0d)[_0x2357('0x34')](function(_0x52b0c1){_0x17985e=_(_0x17985e)[_0x2357('0x8c')](_0x52b0c1)['compact']()[_0x2357('0x8d')]();return db[_0x2357('0x4f')][_0x2357('0x56')]({'where':{'id':_0x41bd4c['params']['id']}})[_0x2357('0x34')](function(_0x402512){return db[_0x2357('0x77')][_0x2357('0x8e')](function(_0x522c33){return _0x402512['removeTeams'](_0x41bd4c[_0x2357('0x40')][_0x2357('0x71')],{'transaction':_0x522c33})[_0x2357('0x34')](function(){if(!_[_0x2357('0x8f')](_0x17985e)){return _0x402512['removeAgents'](_0x17985e,{'transaction':_0x522c33});}})['then'](function(){_0x17985e[_0x2357('0x90')](function(_0xc9bca9){socket['emit'](_0x2357('0x91'),{'UserId':_0xc9bca9,'ChatQueueId':_0x402512['id']});});});});});});})[_0x2357('0x34')](respondWithStatusCode(_0x25a528,null))[_0x2357('0x28')](handleError(_0x25a528,null));};exports[_0x2357('0x92')]=function(_0x1119da,_0xaa0e6e,_0x230df3){return db['ChatQueue'][_0x2357('0x56')]({'where':{'id':_0x1119da[_0x2357('0x53')]['id']}})[_0x2357('0x34')](handleEntityNotFound(_0xaa0e6e,null))[_0x2357('0x34')](function(_0x78f1de){if(_0x78f1de){return _0x78f1de[_0x2357('0x92')](_0x1119da[_0x2357('0x58')][_0x2357('0x71')],_['omit'](_0x1119da['body'],[_0x2357('0x71'),'id'])||{})[_0x2357('0x93')](function(_0x483da7){for(var _0x4071c9=0x0;_0x4071c9<_0x1119da[_0x2357('0x58')][_0x2357('0x71')][_0x2357('0x46')];_0x4071c9+=0x1){socket[_0x2357('0x94')](_0x2357('0x7a'),{'UserId':Number(_0x1119da[_0x2357('0x58')][_0x2357('0x71')][_0x4071c9]),'ChatQueueId':Number(_0x1119da['params']['id'])});}return _0x483da7;});}})[_0x2357('0x34')](respondWithResult(_0xaa0e6e,null))[_0x2357('0x28')](handleError(_0xaa0e6e,null));};exports['removeAgents']=function(_0x32a35f,_0x5e35c9,_0xbda0fb){return db[_0x2357('0x4f')][_0x2357('0x56')]({'where':{'id':_0x32a35f[_0x2357('0x53')]['id']}})[_0x2357('0x34')](handleEntityNotFound(_0x5e35c9,null))['then'](function(_0x1fd4f3){if(_0x1fd4f3){return _0x1fd4f3[_0x2357('0x95')](_0x32a35f[_0x2357('0x40')][_0x2357('0x71')])[_0x2357('0x34')](function(){if(_[_0x2357('0x96')](_0x32a35f[_0x2357('0x40')]['ids'])){for(var _0x276e05=0x0;_0x276e05<_0x32a35f[_0x2357('0x40')][_0x2357('0x71')][_0x2357('0x46')];_0x276e05+=0x1){socket[_0x2357('0x94')](_0x2357('0x91'),{'UserId':Number(_0x32a35f['query'][_0x2357('0x71')][_0x276e05]),'ChatQueueId':Number(_0x32a35f[_0x2357('0x53')]['id'])});}}else{socket[_0x2357('0x94')]('userChatQueue:remove',{'UserId':Number(_0x32a35f[_0x2357('0x40')][_0x2357('0x71')]),'ChatQueueId':Number(_0x32a35f[_0x2357('0x53')]['id'])});}});}})[_0x2357('0x34')](respondWithStatusCode(_0x5e35c9,null))[_0x2357('0x28')](handleError(_0x5e35c9,null));};exports[_0x2357('0x97')]=function(_0xf2bc43,_0x594815,_0x20f369){var _0x5665a2={};var _0x4e1eea={};var _0x6da90c;var _0x1c9e25;return db[_0x2357('0x4f')]['findOne']({'where':{'id':_0xf2bc43['params']['id']}})[_0x2357('0x34')](handleEntityNotFound(_0x594815,null))[_0x2357('0x34')](function(_0x388e32){if(_0x388e32){_0x6da90c=_0x388e32;_0x4e1eea[_0x2357('0x43')]=_[_0x2357('0x41')](db[_0x2357('0x73')]['rawAttributes']);_0x4e1eea['query']=_['keys'](_0xf2bc43[_0x2357('0x40')]);_0x4e1eea[_0x2357('0x42')]=_[_0x2357('0x54')](_0x4e1eea[_0x2357('0x43')],_0x4e1eea[_0x2357('0x40')]);_0x5665a2[_0x2357('0x45')]=_['intersection'](_0x4e1eea[_0x2357('0x43')],qs['fields'](_0xf2bc43['query'][_0x2357('0x44')]));_0x5665a2[_0x2357('0x45')]=_0x5665a2[_0x2357('0x45')][_0x2357('0x46')]?_0x5665a2[_0x2357('0x45')]:_0x4e1eea[_0x2357('0x43')];_0x5665a2[_0x2357('0x64')]=qs[_0x2357('0x49')](_0xf2bc43[_0x2357('0x40')][_0x2357('0x49')]);_0x5665a2[_0x2357('0x4a')]=qs[_0x2357('0x42')](_[_0x2357('0x4b')](_0xf2bc43[_0x2357('0x40')],_0x4e1eea[_0x2357('0x42')]));if(_0xf2bc43[_0x2357('0x40')][_0x2357('0x4c')]){_0x5665a2[_0x2357('0x4a')]=_[_0x2357('0x4d')](_0x5665a2[_0x2357('0x4a')],{'$or':_['map'](_0x5665a2[_0x2357('0x45')],function(_0x4fb6b1){var _0x379e65={};_0x379e65[_0x4fb6b1]={'$like':'%'+_0xf2bc43[_0x2357('0x40')][_0x2357('0x4c')]+'%'};return _0x379e65;})});}_0x5665a2=_['merge']({},_0x5665a2,_0xf2bc43[_0x2357('0x4e')]);return _0x6da90c[_0x2357('0x97')](_0x5665a2);}})[_0x2357('0x34')](function(_0x48910){if(_0x48910){_0x1c9e25=_0x48910['length'];if(!_0xf2bc43[_0x2357('0x40')][_0x2357('0x47')](_0x2357('0x48'))){_0x5665a2[_0x2357('0x2f')]=qs[_0x2357('0x2f')](_0xf2bc43[_0x2357('0x40')][_0x2357('0x2f')]);_0x5665a2[_0x2357('0x2d')]=qs['offset'](_0xf2bc43[_0x2357('0x40')][_0x2357('0x2d')]);}return _0x6da90c[_0x2357('0x97')](_0x5665a2);}})[_0x2357('0x34')](function(_0x52deed){if(_0x52deed){return _0x52deed?{'count':_0x1c9e25,'rows':_0x52deed}:null;}})[_0x2357('0x34')](respondWithResult(_0x594815,null))[_0x2357('0x28')](handleError(_0x594815,null));};
\ No newline at end of file
+var _0x7050=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','describe','findOne','ChatQueueId','merge','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','value','emit','userChatQueue:remove','addAgents','ids','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','catch','status','end','undefined','limit','count','offset','set','json','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7050,0x17e));var _0x0705=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x7050[_0x3a73bc];return _0x32891b;};'use strict';var emlformat=require(_0x0705('0x0'));var rimraf=require(_0x0705('0x1'));var zipdir=require(_0x0705('0x2'));var jsonpatch=require(_0x0705('0x3'));var rp=require(_0x0705('0x4'));var moment=require(_0x0705('0x5'));var BPromise=require(_0x0705('0x6'));var Mustache=require(_0x0705('0x7'));var util=require(_0x0705('0x8'));var path=require(_0x0705('0x9'));var sox=require(_0x0705('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0705('0xb'));var _=require(_0x0705('0xc'));var squel=require(_0x0705('0xd'));var crypto=require(_0x0705('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0705('0xf'));var toCsv=require(_0x0705('0x10'));var querystring=require(_0x0705('0x11'));var Papa=require(_0x0705('0x12'));var Redis=require(_0x0705('0x13'));var authService=require(_0x0705('0x14'));var qs=require(_0x0705('0x15'));var as=require(_0x0705('0x16'));var hardwareService=require(_0x0705('0x17'));var logger=require(_0x0705('0x18'))(_0x0705('0x19'));var utils=require(_0x0705('0x1a'));var config=require(_0x0705('0x1b'));var licenseUtil=require(_0x0705('0x1c'));var db=require(_0x0705('0x1d'))['db'];config[_0x0705('0x1e')]=_['defaults'](config[_0x0705('0x1e')],{'host':_0x0705('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0705('0x1e')]));require(_0x0705('0x20'))[_0x0705('0x21')](socket);var jayson=require(_0x0705('0x22'));var client=jayson[_0x0705('0x23')][_0x0705('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x116312,_0x6eda79,_0x2bd624,_0x3fdbda){return new BPromise(function(_0x124a42,_0x288cce){var _0x3e0a30=_0x3fdbda||client;return _0x3e0a30[_0x0705('0x25')](_0x116312,_0x2bd624)[_0x0705('0x26')](function(_0x14175b){logger[_0x0705('0x27')]('ChatQueue,\x20%s,\x20%s',_0x6eda79,_0x0705('0x28'));logger['debug'](_0x0705('0x29'),_0x6eda79,_0x0705('0x28'),JSON[_0x0705('0x2a')](_0x14175b));if(_0x14175b[_0x0705('0x2b')]){if(_0x14175b[_0x0705('0x2b')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x6eda79,_0x14175b[_0x0705('0x2b')][_0x0705('0x2c')]);return _0x288cce(_0x14175b[_0x0705('0x2b')][_0x0705('0x2c')]);}logger[_0x0705('0x2b')](_0x0705('0x2d'),_0x6eda79,_0x14175b[_0x0705('0x2b')][_0x0705('0x2c')]);return _0x124a42(_0x14175b['error'][_0x0705('0x2c')]);}else{logger[_0x0705('0x27')]('ChatQueue,\x20%s,\x20%s',_0x6eda79,'request\x20sent');_0x124a42(_0x14175b['result'][_0x0705('0x2c')]);}})[_0x0705('0x2e')](function(_0x31585f){logger[_0x0705('0x2b')](_0x0705('0x2d'),_0x6eda79,_0x31585f);_0x288cce(_0x31585f);});});}function respondWithStatusCode(_0x5c40b1,_0x4eb491){_0x4eb491=_0x4eb491||0xcc;return function(_0x5b826d){if(_0x5b826d){return _0x5c40b1['sendStatus'](_0x4eb491);}return _0x5c40b1[_0x0705('0x2f')](_0x4eb491)[_0x0705('0x30')]();};}function respondWithResult(_0x235d11,_0x37344c){_0x37344c=_0x37344c||0xc8;return function(_0x1578b0){if(_0x1578b0){return _0x235d11[_0x0705('0x2f')](_0x37344c)['json'](_0x1578b0);}};}function respondWithFilteredResult(_0x2c3008,_0x91314a){return function(_0x11add0){if(_0x11add0){var _0xcc7fa=typeof _0x91314a['offset']===_0x0705('0x31')&&typeof _0x91314a[_0x0705('0x32')]===_0x0705('0x31');var _0x36fc22=_0x11add0[_0x0705('0x33')];var _0x2ebe73=_0xcc7fa?0x0:_0x91314a['offset'];var _0x598c7b=_0xcc7fa?_0x11add0[_0x0705('0x33')]:_0x91314a[_0x0705('0x34')]+_0x91314a[_0x0705('0x32')];var _0x1c2e1b;if(_0x598c7b>=_0x36fc22){_0x598c7b=_0x36fc22;_0x1c2e1b=0xc8;}else{_0x1c2e1b=0xce;}_0x2c3008['status'](_0x1c2e1b);return _0x2c3008[_0x0705('0x35')]('Content-Range',_0x2ebe73+'-'+_0x598c7b+'/'+_0x36fc22)[_0x0705('0x36')](_0x11add0);}return null;};}function patchUpdates(_0x687b87){return function(_0xb4bec7){try{jsonpatch[_0x0705('0x37')](_0xb4bec7,_0x687b87,!![]);}catch(_0x3ac448){return BPromise[_0x0705('0x38')](_0x3ac448);}return _0xb4bec7[_0x0705('0x39')]();};}function saveUpdates(_0x57ce35,_0x3575ef){return function(_0x1500ec){if(_0x1500ec){return _0x1500ec['update'](_0x57ce35)[_0x0705('0x26')](function(_0x43a579){return _0x43a579;});}return null;};}function removeEntity(_0x5649dd,_0x43ac79){return function(_0x113de2){if(_0x113de2){return _0x113de2[_0x0705('0x3a')]()[_0x0705('0x26')](function(){var _0x3c32d0=_0x113de2[_0x0705('0x3b')]({'plain':!![]});var _0x4c5c0a=_0x0705('0x3c');return db[_0x0705('0x3d')][_0x0705('0x3a')]({'where':{'type':_0x4c5c0a,'resourceId':_0x3c32d0['id']}})[_0x0705('0x26')](function(){return _0x113de2;});})[_0x0705('0x26')](function(){_0x5649dd[_0x0705('0x2f')](0xcc)[_0x0705('0x30')]();});}};}function handleEntityNotFound(_0x5936b7,_0x2acfad){return function(_0x3fc7d1){if(!_0x3fc7d1){_0x5936b7[_0x0705('0x3e')](0x194);}return _0x3fc7d1;};}function handleError(_0x17a558,_0x320e04){_0x320e04=_0x320e04||0x1f4;return function(_0x37a95f){logger[_0x0705('0x2b')](_0x37a95f[_0x0705('0x3f')]);if(_0x37a95f[_0x0705('0x40')]){delete _0x37a95f[_0x0705('0x40')];}_0x17a558[_0x0705('0x2f')](_0x320e04)['send'](_0x37a95f);};}exports[_0x0705('0x41')]=function(_0x417c7b,_0x19a468){var _0x3fc1f0={},_0x5212b8={},_0x355906={'count':0x0,'rows':[]};var _0x5a7807=_[_0x0705('0x42')](db[_0x0705('0x43')][_0x0705('0x44')],function(_0x19fbb1){return{'name':_0x19fbb1[_0x0705('0x45')],'type':_0x19fbb1[_0x0705('0x46')]['key']};});_0x5212b8[_0x0705('0x47')]=_[_0x0705('0x42')](_0x5a7807,_0x0705('0x40'));_0x5212b8[_0x0705('0x48')]=_[_0x0705('0x49')](_0x417c7b[_0x0705('0x48')]);_0x5212b8[_0x0705('0x4a')]=_['intersection'](_0x5212b8[_0x0705('0x47')],_0x5212b8[_0x0705('0x48')]);_0x3fc1f0[_0x0705('0x4b')]=_[_0x0705('0x4c')](_0x5212b8[_0x0705('0x47')],qs['fields'](_0x417c7b[_0x0705('0x48')][_0x0705('0x4d')]));_0x3fc1f0[_0x0705('0x4b')]=_0x3fc1f0[_0x0705('0x4b')][_0x0705('0x4e')]?_0x3fc1f0[_0x0705('0x4b')]:_0x5212b8[_0x0705('0x47')];if(!_0x417c7b['query'][_0x0705('0x4f')](_0x0705('0x50'))){_0x3fc1f0[_0x0705('0x32')]=qs[_0x0705('0x32')](_0x417c7b[_0x0705('0x48')]['limit']);_0x3fc1f0[_0x0705('0x34')]=qs[_0x0705('0x34')](_0x417c7b[_0x0705('0x48')]['offset']);}_0x3fc1f0[_0x0705('0x51')]=qs[_0x0705('0x52')](_0x417c7b[_0x0705('0x48')][_0x0705('0x52')]);_0x3fc1f0[_0x0705('0x53')]=qs[_0x0705('0x4a')](_[_0x0705('0x54')](_0x417c7b[_0x0705('0x48')],_0x5212b8[_0x0705('0x4a')]),_0x5a7807);if(_0x417c7b[_0x0705('0x48')][_0x0705('0x55')]){_0x3fc1f0['where']=_['merge'](_0x3fc1f0[_0x0705('0x53')],{'$or':_[_0x0705('0x42')](_0x5a7807,function(_0x5374cc){if(_0x5374cc[_0x0705('0x46')]!==_0x0705('0x56')){var _0xb17c77={};_0xb17c77[_0x5374cc[_0x0705('0x40')]]={'$like':'%'+_0x417c7b[_0x0705('0x48')]['filter']+'%'};return _0xb17c77;}})});}_0x3fc1f0=_['merge']({},_0x3fc1f0,_0x417c7b[_0x0705('0x57')]);var _0x15dc7c={'where':_0x3fc1f0[_0x0705('0x53')]};return db[_0x0705('0x43')][_0x0705('0x33')](_0x15dc7c)[_0x0705('0x26')](function(_0x422b86){_0x355906[_0x0705('0x33')]=_0x422b86;if(_0x417c7b[_0x0705('0x48')][_0x0705('0x58')]){_0x3fc1f0[_0x0705('0x59')]=[{'all':!![]}];}return db['ChatQueue'][_0x0705('0x5a')](_0x3fc1f0);})[_0x0705('0x26')](function(_0x2d6bde){_0x355906[_0x0705('0x5b')]=_0x2d6bde;return _0x355906;})[_0x0705('0x26')](respondWithFilteredResult(_0x19a468,_0x3fc1f0))[_0x0705('0x2e')](handleError(_0x19a468,null));};exports['show']=function(_0x5544e9,_0x48742d){var _0x3e9f96={'raw':!![],'where':{'id':_0x5544e9[_0x0705('0x5c')]['id']}},_0x396d47={};_0x396d47[_0x0705('0x47')]=_['keys'](db['ChatQueue'][_0x0705('0x44')]);_0x396d47[_0x0705('0x48')]=_[_0x0705('0x49')](_0x5544e9[_0x0705('0x48')]);_0x396d47[_0x0705('0x4a')]=_[_0x0705('0x4c')](_0x396d47[_0x0705('0x47')],_0x396d47[_0x0705('0x48')]);_0x3e9f96['attributes']=_[_0x0705('0x4c')](_0x396d47['model'],qs[_0x0705('0x4d')](_0x5544e9[_0x0705('0x48')][_0x0705('0x4d')]));_0x3e9f96[_0x0705('0x4b')]=_0x3e9f96[_0x0705('0x4b')][_0x0705('0x4e')]?_0x3e9f96[_0x0705('0x4b')]:_0x396d47[_0x0705('0x47')];if(_0x5544e9[_0x0705('0x48')]['includeAll']){_0x3e9f96[_0x0705('0x59')]=[{'all':!![]}];}_0x3e9f96=_['merge']({},_0x3e9f96,_0x5544e9[_0x0705('0x57')]);return db[_0x0705('0x43')][_0x0705('0x5d')](_0x3e9f96)[_0x0705('0x26')](handleEntityNotFound(_0x48742d,null))['then'](respondWithResult(_0x48742d,null))[_0x0705('0x2e')](handleError(_0x48742d,null));};exports[_0x0705('0x5e')]=function(_0x44733c,_0xfebe3a){return db[_0x0705('0x43')][_0x0705('0x5e')](_0x44733c[_0x0705('0x5f')],{})[_0x0705('0x26')](function(_0x4db397){var _0x41b40b=_0x44733c[_0x0705('0x60')][_0x0705('0x3b')]({'plain':!![]});if(!_0x41b40b)throw new Error(_0x0705('0x61'));if(_0x41b40b[_0x0705('0x62')]===_0x0705('0x60')){var _0x6d662c=_0x4db397['get']({'plain':!![]});var _0x3fec73='ChatQueues';return db[_0x0705('0x63')]['find']({'where':{'name':_0x3fec73,'userProfileId':_0x41b40b[_0x0705('0x64')]},'raw':!![]})[_0x0705('0x26')](function(_0x43fc96){if(_0x43fc96&&_0x43fc96['autoAssociation']===0x0){return db['UserProfileResource'][_0x0705('0x5e')]({'name':_0x6d662c['name'],'resourceId':_0x6d662c['id'],'type':_0x43fc96[_0x0705('0x40')],'sectionId':_0x43fc96['id']},{})[_0x0705('0x26')](function(){return _0x4db397;});}else{return _0x4db397;}})[_0x0705('0x2e')](function(_0x339765){logger[_0x0705('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x339765);throw _0x339765;});}return _0x4db397;})[_0x0705('0x26')](respondWithResult(_0xfebe3a,0xc9))['catch'](handleError(_0xfebe3a,null));};exports[_0x0705('0x65')]=function(_0x3c6bbd,_0x57a8c0){if(_0x3c6bbd[_0x0705('0x5f')]['id']){delete _0x3c6bbd[_0x0705('0x5f')]['id'];}return db[_0x0705('0x43')][_0x0705('0x5d')]({'where':{'id':_0x3c6bbd[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x57a8c0,null))[_0x0705('0x26')](saveUpdates(_0x3c6bbd[_0x0705('0x5f')],null))['then'](respondWithResult(_0x57a8c0,null))['catch'](handleError(_0x57a8c0,null));};exports[_0x0705('0x3a')]=function(_0x27b788,_0x494d2c){return db[_0x0705('0x43')][_0x0705('0x5d')]({'where':{'id':_0x27b788[_0x0705('0x5c')]['id']}})['then'](handleEntityNotFound(_0x494d2c,null))[_0x0705('0x26')](removeEntity(_0x494d2c,null))['catch'](handleError(_0x494d2c,null));};exports[_0x0705('0x66')]=function(_0x358d2c,_0x1c1915){return db[_0x0705('0x43')][_0x0705('0x66')]()[_0x0705('0x26')](respondWithResult(_0x1c1915,null))[_0x0705('0x2e')](handleError(_0x1c1915,null));};exports['getMembers']=function(_0x242a65,_0x497939,_0x20d182){var _0x42a271={'raw':!![],'where':{}},_0x577cd1={},_0xcd9260;return db[_0x0705('0x43')][_0x0705('0x67')]({'where':{'id':_0x242a65['params']['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x497939,null))[_0x0705('0x26')](function(_0x3da91c){if(_0x3da91c){_0xcd9260=_0x3da91c[_0x0705('0x3b')]({'plain':!![]});_0x577cd1[_0x0705('0x47')]=_[_0x0705('0x49')](db['UserChatQueue']['rawAttributes']);_0x577cd1[_0x0705('0x48')]=_[_0x0705('0x49')](_0x242a65[_0x0705('0x48')]);_0x577cd1[_0x0705('0x4a')]=_[_0x0705('0x4c')](_0x577cd1['model'],_0x577cd1['query']);_0x42a271[_0x0705('0x4b')]=_[_0x0705('0x4c')](_0x577cd1[_0x0705('0x47')],qs[_0x0705('0x4d')](_0x242a65['query'][_0x0705('0x4d')]));_0x42a271['attributes']=_0x42a271['attributes'][_0x0705('0x4e')]?_0x42a271['attributes']:_0x577cd1[_0x0705('0x47')];if(!_0x242a65[_0x0705('0x48')][_0x0705('0x4f')](_0x0705('0x50'))){_0x42a271['limit']=qs[_0x0705('0x32')](_0x242a65[_0x0705('0x48')][_0x0705('0x32')]);_0x42a271['offset']=qs[_0x0705('0x34')](_0x242a65[_0x0705('0x48')]['offset']);}_0x42a271['order']=qs[_0x0705('0x52')](_0x242a65[_0x0705('0x48')][_0x0705('0x52')]);_0x42a271[_0x0705('0x53')]=qs[_0x0705('0x4a')](_[_0x0705('0x54')](_0x242a65[_0x0705('0x48')],_0x577cd1[_0x0705('0x4a')]));_0x42a271['where'][_0x0705('0x68')]=_0x3da91c['id'];if(_0x242a65[_0x0705('0x48')][_0x0705('0x55')]){_0x42a271[_0x0705('0x53')]=_['merge'](_0x42a271[_0x0705('0x53')],{'$or':_[_0x0705('0x42')](_0x42a271[_0x0705('0x4b')],function(_0xd29402){var _0x1c4ae3={};_0x1c4ae3[_0xd29402]={'$like':'%'+_0x242a65[_0x0705('0x48')][_0x0705('0x55')]+'%'};return _0x1c4ae3;})});}_0x42a271=_[_0x0705('0x69')]({},_0x42a271,_0x242a65[_0x0705('0x57')]);return db[_0x0705('0x6a')][_0x0705('0x5a')](_0x42a271);}})[_0x0705('0x26')](function(_0x582898){if(_0x582898){return db[_0x0705('0x6b')][_0x0705('0x6c')]({'where':{'id':_[_0x0705('0x42')](_0x582898,_0x0705('0x6d')),'role':_0x0705('0x6e')},'attributes':['id',_0x0705('0x40'),_0x0705('0x6f'),_0x0705('0x70'),_0x0705('0x71')]});}})[_0x0705('0x26')](function(_0x5851f9){if(_0x5851f9){return{'count':_0x5851f9['count'],'rows':_[_0x0705('0x42')](_0x5851f9[_0x0705('0x5b')],function(_0x571166){return{'membername':_0x571166['name'],'UserId':_0x571166['id'],'queue_name':_0xcd9260['name'],'ChatQueueId':_0xcd9260['id'],'interface':util['format'](_0x0705('0x72'),_0x0705('0x73'),_0x571166[_0x0705('0x40')]),'penalty':0x0,'paused':_0x571166['chatPause'],'createdAt':_0x571166[_0x0705('0x71')],'updatedAt':_0x571166['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x497939,_0x42a271))[_0x0705('0x2e')](handleError(_0x497939,null));};exports['getTeams']=function(_0x2e43f6,_0x270d92,_0x5ad4ac){var _0x36190b={};var _0x45bd7f={};var _0x3f8a5a;var _0x20fccc;return db[_0x0705('0x43')]['findOne']({'where':{'id':_0x2e43f6[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x270d92,null))['then'](function(_0x22dabf){if(_0x22dabf){_0x3f8a5a=_0x22dabf;_0x45bd7f[_0x0705('0x47')]=_[_0x0705('0x49')](db[_0x0705('0x74')][_0x0705('0x44')]);_0x45bd7f['query']=_['keys'](_0x2e43f6[_0x0705('0x48')]);_0x45bd7f[_0x0705('0x4a')]=_[_0x0705('0x4c')](_0x45bd7f['model'],_0x45bd7f['query']);_0x36190b[_0x0705('0x4b')]=_[_0x0705('0x4c')](_0x45bd7f[_0x0705('0x47')],qs[_0x0705('0x4d')](_0x2e43f6[_0x0705('0x48')][_0x0705('0x4d')]));_0x36190b[_0x0705('0x4b')]=_0x36190b[_0x0705('0x4b')][_0x0705('0x4e')]?_0x36190b[_0x0705('0x4b')]:_0x45bd7f[_0x0705('0x47')];_0x36190b[_0x0705('0x51')]=qs[_0x0705('0x52')](_0x2e43f6[_0x0705('0x48')]['sort']);_0x36190b['where']=qs[_0x0705('0x4a')](_[_0x0705('0x54')](_0x2e43f6[_0x0705('0x48')],_0x45bd7f['filters']));if(_0x2e43f6['query'][_0x0705('0x55')]){_0x36190b[_0x0705('0x53')]=_[_0x0705('0x69')](_0x36190b[_0x0705('0x53')],{'$or':_[_0x0705('0x42')](_0x36190b[_0x0705('0x4b')],function(_0xaab347){var _0x3de1fa={};_0x3de1fa[_0xaab347]={'$like':'%'+_0x2e43f6[_0x0705('0x48')][_0x0705('0x55')]+'%'};return _0x3de1fa;})});}_0x36190b=_[_0x0705('0x69')]({},_0x36190b,_0x2e43f6[_0x0705('0x57')]);return _0x3f8a5a['getTeams'](_0x36190b);}})['then'](function(_0x304da5){if(_0x304da5){_0x20fccc=_0x304da5[_0x0705('0x4e')];if(!_0x2e43f6[_0x0705('0x48')][_0x0705('0x4f')]('nolimit')){_0x36190b[_0x0705('0x32')]=qs[_0x0705('0x32')](_0x2e43f6[_0x0705('0x48')]['limit']);_0x36190b['offset']=qs[_0x0705('0x34')](_0x2e43f6[_0x0705('0x48')][_0x0705('0x34')]);}return _0x3f8a5a[_0x0705('0x75')](_0x36190b);}})[_0x0705('0x26')](function(_0x5ca230){if(_0x5ca230){return _0x5ca230?{'count':_0x20fccc,'rows':_0x5ca230}:null;}})[_0x0705('0x26')](respondWithResult(_0x270d92,null))[_0x0705('0x2e')](handleError(_0x270d92,null));};exports[_0x0705('0x76')]=function(_0x392224,_0x2b74ed,_0x253c59){var _0x1e2cea=_0x392224[_0x0705('0x5f')]['ids'];return db[_0x0705('0x74')][_0x0705('0x5a')]({'where':{'id':_0x1e2cea},'attributes':['id'],'include':[{'model':db[_0x0705('0x6b')],'as':_0x0705('0x77'),'attributes':['id',_0x0705('0x40'),_0x0705('0x78'),_0x0705('0x79'),_0x0705('0x7a')],'raw':!![]}]})[_0x0705('0x26')](function(_0xa6b1d8){if(_0xa6b1d8){var _0x142ce4=_[_0x0705('0x7b')](_0xa6b1d8,function(_0x550494){var _0x1b4464=_0x550494['get']({'plain':!![]});return _0x1b4464['Agents'];});return db['ChatQueue'][_0x0705('0x5d')]({'where':{'id':_0x392224[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](function(_0x4261fe){return db['sequelize'][_0x0705('0x7c')](function(_0x13b722){return _0x4261fe[_0x0705('0x76')](_0x1e2cea,{'transaction':_0x13b722})[_0x0705('0x26')](function(){return BPromise[_0x0705('0x7d')](_0x142ce4,function(_0x4b92a1){return db[_0x0705('0x6a')][_0x0705('0x7e')]({'where':{'UserId':_0x4b92a1['id'],'ChatQueueId':_0x392224[_0x0705('0x5c')]['id']},'transaction':_0x13b722});});})['then'](function(){_0x142ce4[_0x0705('0x7f')](function(_0x18b2b8){socket['emit'](_0x0705('0x80'),{'UserId':_0x18b2b8['id'],'ChatQueueId':_0x4261fe['id']});});});});});}})[_0x0705('0x26')](respondWithStatusCode(_0x2b74ed,null))[_0x0705('0x2e')](handleError(_0x2b74ed,null));};exports[_0x0705('0x81')]=function(_0x110848,_0x361a80,_0x25ebf8){return db[_0x0705('0x74')][_0x0705('0x5a')]({'where':{'id':_0x110848[_0x0705('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0705('0x6b')],'as':_0x0705('0x77'),'attributes':['id'],'raw':!![]}]})[_0x0705('0x26')](handleEntityNotFound(_0x361a80,null))[_0x0705('0x26')](function(_0x304462){var _0x154933=_['map'](_0x304462,'id');var _0x37095d=[];var _0xdb895f=[];var _0x429d55=squel[_0x0705('0x82')]();_0x429d55[_0x0705('0x83')](_0x0705('0x84'))[_0x0705('0x85')](_0x0705('0x86'),'tq')['join']('user_has_teams','ut',_0x0705('0x87'))['where']('ChatQueueId\x20=\x20?',_0x110848['params']['id']);for(var _0x2f1d2b=0x0;_0x2f1d2b<_0x304462[_0x0705('0x4e')];_0x2f1d2b+=0x1){let _0x567bf8=_0x304462[_0x2f1d2b];for(var _0x3e283f=0x0;_0x3e283f<_0x567bf8[_0x0705('0x77')]['length'];_0x3e283f+=0x1){let _0xf836a3=_0x567bf8[_0x0705('0x77')][_0x3e283f];var _0x134606=_0x429d55['clone']();_0x134606['where'](_0x0705('0x88'),_0xf836a3['id']);_0xdb895f[_0x0705('0x89')](db[_0x0705('0x8a')][_0x0705('0x48')](_0x134606[_0x0705('0x8b')](),{'type':db[_0x0705('0x8a')][_0x0705('0x8c')]['SELECT']})[_0x0705('0x26')](function(_0x1da6ee){if(_0x1da6ee[_0x0705('0x4e')]===0x1){return _0xf836a3['id'];}else{var _0x513203=_[_0x0705('0x8d')](_[_0x0705('0x42')](_0x1da6ee,_0x0705('0x8e')),function(_0x1a990b){return _[_0x0705('0x8f')](_0x154933,_0x1a990b);});if(_0x513203){return _0xf836a3['id'];}}}));}}return BPromise[_0x0705('0x90')](_0xdb895f)[_0x0705('0x26')](function(_0x5065ae){_0x37095d=_(_0x37095d)['union'](_0x5065ae)['compact']()[_0x0705('0x91')]();return db[_0x0705('0x43')][_0x0705('0x5d')]({'where':{'id':_0x110848['params']['id']}})[_0x0705('0x26')](function(_0x18f871){return db[_0x0705('0x8a')]['transaction'](function(_0x169f50){return _0x18f871[_0x0705('0x81')](_0x110848[_0x0705('0x48')]['ids'],{'transaction':_0x169f50})[_0x0705('0x26')](function(){if(!_['isEmpty'](_0x37095d)){return _0x18f871['removeAgents'](_0x37095d,{'transaction':_0x169f50});}})[_0x0705('0x26')](function(){_0x37095d['forEach'](function(_0x862de3){socket[_0x0705('0x92')](_0x0705('0x93'),{'UserId':_0x862de3,'ChatQueueId':_0x18f871['id']});});});});});});})[_0x0705('0x26')](respondWithStatusCode(_0x361a80,null))[_0x0705('0x2e')](handleError(_0x361a80,null));};exports['addAgents']=function(_0x4fbf4e,_0x1f1e1e,_0x10229d){return db[_0x0705('0x43')][_0x0705('0x5d')]({'where':{'id':_0x4fbf4e[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x1f1e1e,null))[_0x0705('0x26')](function(_0x49aaef){if(_0x49aaef){return _0x49aaef[_0x0705('0x94')](_0x4fbf4e[_0x0705('0x5f')]['ids'],_['omit'](_0x4fbf4e[_0x0705('0x5f')],[_0x0705('0x95'),'id'])||{})['spread'](function(_0x2e0661){for(var _0x47fc19=0x0;_0x47fc19<_0x4fbf4e['body']['ids'][_0x0705('0x4e')];_0x47fc19+=0x1){socket[_0x0705('0x92')](_0x0705('0x80'),{'UserId':Number(_0x4fbf4e['body'][_0x0705('0x95')][_0x47fc19]),'ChatQueueId':Number(_0x4fbf4e[_0x0705('0x5c')]['id'])});}return _0x2e0661;});}})[_0x0705('0x26')](respondWithResult(_0x1f1e1e,null))[_0x0705('0x2e')](handleError(_0x1f1e1e,null));};exports[_0x0705('0x96')]=function(_0x2cc361,_0x5c3aae,_0xcdb51d){return db[_0x0705('0x43')]['find']({'where':{'id':_0x2cc361[_0x0705('0x5c')]['id']}})[_0x0705('0x26')](handleEntityNotFound(_0x5c3aae,null))[_0x0705('0x26')](function(_0x8becac){if(_0x8becac){return _0x8becac[_0x0705('0x96')](_0x2cc361[_0x0705('0x48')][_0x0705('0x95')])[_0x0705('0x26')](function(){if(_['isArray'](_0x2cc361[_0x0705('0x48')][_0x0705('0x95')])){for(var _0x577d1f=0x0;_0x577d1f<_0x2cc361[_0x0705('0x48')]['ids'][_0x0705('0x4e')];_0x577d1f+=0x1){socket['emit'](_0x0705('0x93'),{'UserId':Number(_0x2cc361['query']['ids'][_0x577d1f]),'ChatQueueId':Number(_0x2cc361[_0x0705('0x5c')]['id'])});}}else{socket[_0x0705('0x92')](_0x0705('0x93'),{'UserId':Number(_0x2cc361['query'][_0x0705('0x95')]),'ChatQueueId':Number(_0x2cc361[_0x0705('0x5c')]['id'])});}});}})[_0x0705('0x26')](respondWithStatusCode(_0x5c3aae,null))['catch'](handleError(_0x5c3aae,null));};exports['getAgents']=function(_0x49732a,_0x314c00,_0x12cec1){var _0x73e522={};var _0x1def84={};var _0x594a5f;var _0x79672b;return db[_0x0705('0x43')][_0x0705('0x67')]({'where':{'id':_0x49732a[_0x0705('0x5c')]['id']}})['then'](handleEntityNotFound(_0x314c00,null))[_0x0705('0x26')](function(_0x2b034f){if(_0x2b034f){_0x594a5f=_0x2b034f;_0x1def84[_0x0705('0x47')]=_[_0x0705('0x49')](db[_0x0705('0x6b')][_0x0705('0x44')]);_0x1def84[_0x0705('0x48')]=_['keys'](_0x49732a[_0x0705('0x48')]);_0x1def84['filters']=_[_0x0705('0x4c')](_0x1def84[_0x0705('0x47')],_0x1def84[_0x0705('0x48')]);_0x73e522[_0x0705('0x4b')]=_[_0x0705('0x4c')](_0x1def84[_0x0705('0x47')],qs[_0x0705('0x4d')](_0x49732a[_0x0705('0x48')][_0x0705('0x4d')]));_0x73e522[_0x0705('0x4b')]=_0x73e522[_0x0705('0x4b')][_0x0705('0x4e')]?_0x73e522['attributes']:_0x1def84[_0x0705('0x47')];_0x73e522[_0x0705('0x51')]=qs['sort'](_0x49732a[_0x0705('0x48')][_0x0705('0x52')]);_0x73e522[_0x0705('0x53')]=qs[_0x0705('0x4a')](_['pick'](_0x49732a[_0x0705('0x48')],_0x1def84['filters']));if(_0x49732a[_0x0705('0x48')][_0x0705('0x55')]){_0x73e522['where']=_[_0x0705('0x69')](_0x73e522[_0x0705('0x53')],{'$or':_[_0x0705('0x42')](_0x73e522[_0x0705('0x4b')],function(_0x8e5ec4){var _0xea3b06={};_0xea3b06[_0x8e5ec4]={'$like':'%'+_0x49732a[_0x0705('0x48')]['filter']+'%'};return _0xea3b06;})});}_0x73e522=_[_0x0705('0x69')]({},_0x73e522,_0x49732a['options']);return _0x594a5f[_0x0705('0x97')](_0x73e522);}})[_0x0705('0x26')](function(_0x50d318){if(_0x50d318){_0x79672b=_0x50d318['length'];if(!_0x49732a[_0x0705('0x48')]['hasOwnProperty'](_0x0705('0x50'))){_0x73e522[_0x0705('0x32')]=qs[_0x0705('0x32')](_0x49732a['query'][_0x0705('0x32')]);_0x73e522[_0x0705('0x34')]=qs['offset'](_0x49732a[_0x0705('0x48')][_0x0705('0x34')]);}return _0x594a5f[_0x0705('0x97')](_0x73e522);}})[_0x0705('0x26')](function(_0x1e732a){if(_0x1e732a){return _0x1e732a?{'count':_0x79672b,'rows':_0x1e732a}:null;}})['then'](respondWithResult(_0x314c00,null))['catch'](handleError(_0x314c00,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 007b923..330db24 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 _0x0662=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0662,0x175));var _0x2066=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0662[_0x110c3d];return _0x226d67;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x2066('0x0'))['db'][_0x2066('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2066('0x2')](0x0);var events={'afterCreate':_0x2066('0x3'),'afterUpdate':'update','afterDestroy':_0x2066('0x4')};function emitEvent(_0x1bef84){return function(_0x782930,_0x278653,_0x1db5d5){ChatQueueEvents[_0x2066('0x5')](_0x1bef84+':'+_0x782930['id'],_0x782930);ChatQueueEvents[_0x2066('0x5')](_0x1bef84,_0x782930);_0x1db5d5(null);};}for(var e in events){if(events[_0x2066('0x6')](e)){var event=events[e];ChatQueue[_0x2066('0x7')](e,emitEvent(event));}}module[_0x2066('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x083e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x083e,0x140));var _0xe083=function(_0x31b350,_0x5be290){_0x31b350=_0x31b350-0x0;var _0x1870dc=_0x083e[_0x31b350];return _0x1870dc;};'use strict';var EventEmitter=require(_0xe083('0x0'));var ChatQueue=require(_0xe083('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe083('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe083('0x3'),'afterDestroy':_0xe083('0x4')};function emitEvent(_0xaf9304){return function(_0x17205d,_0x1dbcad,_0x3f8ad6){ChatQueueEvents[_0xe083('0x5')](_0xaf9304+':'+_0x17205d['id'],_0x17205d);ChatQueueEvents['emit'](_0xaf9304,_0x17205d);_0x3f8ad6(null);};}for(var e in events){if(events[_0xe083('0x6')](e)){var event=events[e];ChatQueue[_0xe083('0x7')](e,emitEvent(event));}}module[_0xe083('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index dfddacc..660e26c 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 _0x0a5c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x31a755,_0x203ce1){var _0x4aa72b=function(_0xa3568c){while(--_0xa3568c){_0x31a755['push'](_0x31a755['shift']());}};_0x4aa72b(++_0x203ce1);}(_0x0a5c,0x1af));var _0xc0a5=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x0a5c[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xc0a5('0x0'));var util=require(_0xc0a5('0x1'));var logger=require(_0xc0a5('0x2'))(_0xc0a5('0x3'));var moment=require(_0xc0a5('0x4'));var BPromise=require(_0xc0a5('0x5'));var rp=require(_0xc0a5('0x6'));var fs=require('fs');var path=require(_0xc0a5('0x7'));var rimraf=require(_0xc0a5('0x8'));var config=require(_0xc0a5('0x9'));var attributes=require(_0xc0a5('0xa'));module[_0xc0a5('0xb')]=function(_0x3aaaf6,_0x269c4e){return _0x3aaaf6[_0xc0a5('0xc')](_0xc0a5('0xd'),attributes,{'tableName':_0xc0a5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5045=['./chatQueue.attributes','exports','ChatQueue','chat_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x36e9d6,_0x354e9b){var _0x1fe0e1=function(_0x535a63){while(--_0x535a63){_0x36e9d6['push'](_0x36e9d6['shift']());}};_0x1fe0e1(++_0x354e9b);}(_0x5045,0x1b4));var _0x5504=function(_0x59e3c2,_0x5d21a8){_0x59e3c2=_0x59e3c2-0x0;var _0x2a0b9f=_0x5045[_0x59e3c2];return _0x2a0b9f;};'use strict';var _=require('lodash');var util=require(_0x5504('0x0'));var logger=require(_0x5504('0x1'))(_0x5504('0x2'));var moment=require(_0x5504('0x3'));var BPromise=require('bluebird');var rp=require(_0x5504('0x4'));var fs=require('fs');var path=require(_0x5504('0x5'));var rimraf=require(_0x5504('0x6'));var config=require(_0x5504('0x7'));var attributes=require(_0x5504('0x8'));module[_0x5504('0x9')]=function(_0x55c8f2,_0x1935af){return _0x55c8f2['define'](_0x5504('0xa'),attributes,{'tableName':_0x5504('0xb'),'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 6cbeaf4..6bc5783 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 _0x161a=['../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','moment','bluebird','ioredis','../../config/utils'];(function(_0x1b3db4,_0x3be734){var _0x294216=function(_0x3bce45){while(--_0x3bce45){_0x1b3db4['push'](_0x1b3db4['shift']());}};_0x294216(++_0x3be734);}(_0x161a,0x140));var _0xa161=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x161a[_0x2de0a7];return _0x429437;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa161('0x0'));var BPromise=require(_0xa161('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa161('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa161('0x3'));var logger=require(_0xa161('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa161('0x5'));var client=jayson[_0xa161('0x6')][_0xa161('0x7')]({'port':0x232a});config[_0xa161('0x8')]=_[_0xa161('0x9')](config[_0xa161('0x8')],{'host':_0xa161('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa161('0x8')]));require(_0xa161('0xb'))[_0xa161('0xc')](socket);function respondWithRpcPromise(_0x3d3074,_0x306e62,_0x1a3301){return new BPromise(function(_0x1c443e,_0x29f617){return client[_0xa161('0xd')](_0x3d3074,_0x1a3301)[_0xa161('0xe')](function(_0x29574e){logger[_0xa161('0xf')](_0xa161('0x10'),_0x306e62,'request\x20sent');logger[_0xa161('0x11')](_0xa161('0x12'),_0x306e62,_0xa161('0x13'),JSON[_0xa161('0x14')](_0x29574e));if(_0x29574e['error']){if(_0x29574e[_0xa161('0x15')][_0xa161('0x16')]===0x1f4){logger['error'](_0xa161('0x10'),_0x306e62,_0x29574e[_0xa161('0x15')]['message']);return _0x29f617(_0x29574e[_0xa161('0x15')][_0xa161('0x17')]);}logger[_0xa161('0x15')]('ChatQueue,\x20%s,\x20%s',_0x306e62,_0x29574e[_0xa161('0x15')][_0xa161('0x17')]);return _0x1c443e(_0x29574e[_0xa161('0x15')][_0xa161('0x17')]);}else{logger[_0xa161('0xf')](_0xa161('0x10'),_0x306e62,_0xa161('0x13'));_0x1c443e(_0x29574e['result'][_0xa161('0x17')]);}})[_0xa161('0x18')](function(_0x55c558){logger[_0xa161('0x15')]('ChatQueue,\x20%s,\x20%s',_0x306e62,_0x55c558);_0x29f617(_0x55c558);});});}exports[_0xa161('0x19')]=function(_0x3ccf0c){var _0x2dd796=this;return new Promise(function(_0x269d56,_0xf6cd86){return db['ChatQueue'][_0xa161('0x1a')]({'raw':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x1d')]||null:null,'attributes':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x1e')]||null:null,'limit':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c['options'][_0xa161('0x1f')]||null:null,'include':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x20')]?_[_0xa161('0x21')](_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x20')],function(_0x2b1331){return{'model':db[_0x2b1331[_0xa161('0x22')]],'as':_0x2b1331['as'],'attributes':_0x2b1331[_0xa161('0x1e')],'include':_0x2b1331[_0xa161('0x20')]?_['map'](_0x2b1331[_0xa161('0x20')],function(_0x492da1){return{'model':db[_0x492da1[_0xa161('0x22')]],'as':_0x492da1['as'],'attributes':_0x492da1[_0xa161('0x1e')],'include':_0x492da1[_0xa161('0x20')]?_[_0xa161('0x21')](_0x492da1[_0xa161('0x20')],function(_0x20ce3c){return{'model':db[_0x20ce3c[_0xa161('0x22')]],'as':_0x20ce3c['as'],'attributes':_0x20ce3c[_0xa161('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa161('0xe')](function(_0x150e36){logger[_0xa161('0xf')](_0xa161('0x19'),_0x3ccf0c);logger[_0xa161('0x11')](_0xa161('0x19'),_0x3ccf0c,JSON[_0xa161('0x14')](_0x150e36));_0x269d56(_0x150e36);})['catch'](function(_0x3579b6){logger['error'](_0xa161('0x19'),_0x3579b6['message'],_0x3ccf0c);_0xf6cd86(_0x2dd796[_0xa161('0x15')](0x1f4,_0x3579b6[_0xa161('0x17')]));});});};exports[_0xa161('0x23')]=function(_0x15f3d9){var _0x527870=this;return new Promise(function(_0x306cd5,_0x2a2cdf){return db['ChatQueue']['find']({'raw':_0x15f3d9[_0xa161('0x1b')]?_0x15f3d9['options']['raw']===undefined?!![]:![]:!![],'where':_0x15f3d9['options']?_0x15f3d9[_0xa161('0x1b')][_0xa161('0x1d')]||null:null,'attributes':_0x15f3d9[_0xa161('0x1b')]?_0x15f3d9[_0xa161('0x1b')][_0xa161('0x1e')]||null:null,'include':_0x15f3d9[_0xa161('0x1b')]?_0x15f3d9['options'][_0xa161('0x20')]?_['map'](_0x15f3d9[_0xa161('0x1b')][_0xa161('0x20')],function(_0x56417e){return{'model':db[_0x56417e[_0xa161('0x22')]],'as':_0x56417e['as'],'attributes':_0x56417e[_0xa161('0x1e')],'include':_0x56417e[_0xa161('0x20')]?_['map'](_0x56417e[_0xa161('0x20')],function(_0x305902){return{'model':db[_0x305902[_0xa161('0x22')]],'as':_0x305902['as'],'attributes':_0x305902[_0xa161('0x1e')],'include':_0x305902[_0xa161('0x20')]?_[_0xa161('0x21')](_0x305902[_0xa161('0x20')],function(_0x533a27){return{'model':db[_0x533a27[_0xa161('0x22')]],'as':_0x533a27['as'],'attributes':_0x533a27['attributes']};}):[]};}):[]};}):[]:[]})[_0xa161('0xe')](function(_0x54a278){logger[_0xa161('0xf')](_0xa161('0x23'),_0x15f3d9);logger['debug']('ShowChatQueue',_0x15f3d9,JSON['stringify'](_0x54a278));_0x306cd5(_0x54a278);})[_0xa161('0x18')](function(_0x133f1c){logger[_0xa161('0x15')]('ShowChatQueue',_0x133f1c[_0xa161('0x17')],_0x15f3d9);_0x2a2cdf(_0x527870[_0xa161('0x15')](0x1f4,_0x133f1c[_0xa161('0x17')]));});});};
\ No newline at end of file
+var _0x4760=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','map','include','model','attributes','stringify','find','ShowChatQueue','lodash','moment','bluebird','randomstring'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4760,0x1b4));var _0x0476=function(_0x2c6f61,_0x1c8020){_0x2c6f61=_0x2c6f61-0x0;var _0x266f3f=_0x4760[_0x2c6f61];return _0x266f3f;};'use strict';var _=require(_0x0476('0x0'));var util=require('util');var moment=require(_0x0476('0x1'));var BPromise=require(_0x0476('0x2'));var rs=require(_0x0476('0x3'));var fs=require('fs');var Redis=require(_0x0476('0x4'));var db=require(_0x0476('0x5'))['db'];var utils=require(_0x0476('0x6'));var logger=require('../../config/logger')(_0x0476('0x7'));var config=require(_0x0476('0x8'));var jayson=require(_0x0476('0x9'));var client=jayson[_0x0476('0xa')][_0x0476('0xb')]({'port':0x232a});config[_0x0476('0xc')]=_[_0x0476('0xd')](config[_0x0476('0xc')],{'host':_0x0476('0xe'),'port':0x18eb});var socket=require(_0x0476('0xf'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x57c684,_0x2818b4,_0x2d0c24){return new BPromise(function(_0x35db49,_0x572ec2){return client[_0x0476('0x10')](_0x57c684,_0x2d0c24)[_0x0476('0x11')](function(_0x5aee81){logger[_0x0476('0x12')](_0x0476('0x13'),_0x2818b4,_0x0476('0x14'));logger[_0x0476('0x15')](_0x0476('0x16'),_0x2818b4,_0x0476('0x14'),JSON['stringify'](_0x5aee81));if(_0x5aee81[_0x0476('0x17')]){if(_0x5aee81[_0x0476('0x17')][_0x0476('0x18')]===0x1f4){logger[_0x0476('0x17')](_0x0476('0x13'),_0x2818b4,_0x5aee81['error'][_0x0476('0x19')]);return _0x572ec2(_0x5aee81[_0x0476('0x17')][_0x0476('0x19')]);}logger[_0x0476('0x17')](_0x0476('0x13'),_0x2818b4,_0x5aee81[_0x0476('0x17')][_0x0476('0x19')]);return _0x35db49(_0x5aee81['error'][_0x0476('0x19')]);}else{logger[_0x0476('0x12')](_0x0476('0x13'),_0x2818b4,_0x0476('0x14'));_0x35db49(_0x5aee81[_0x0476('0x1a')]['message']);}})[_0x0476('0x1b')](function(_0x9d1d1a){logger[_0x0476('0x17')](_0x0476('0x13'),_0x2818b4,_0x9d1d1a);_0x572ec2(_0x9d1d1a);});});}exports[_0x0476('0x1c')]=function(_0x4f0fd5){var _0x377188=this;return new Promise(function(_0x328f00,_0x45f854){return db[_0x0476('0x1d')][_0x0476('0x1e')]({'raw':_0x4f0fd5[_0x0476('0x1f')]?_0x4f0fd5[_0x0476('0x1f')][_0x0476('0x20')]===undefined?!![]:![]:!![],'where':_0x4f0fd5['options']?_0x4f0fd5['options']['where']||null:null,'attributes':_0x4f0fd5[_0x0476('0x1f')]?_0x4f0fd5[_0x0476('0x1f')]['attributes']||null:null,'limit':_0x4f0fd5[_0x0476('0x1f')]?_0x4f0fd5[_0x0476('0x1f')]['limit']||null:null,'include':_0x4f0fd5['options']?_0x4f0fd5[_0x0476('0x1f')]['include']?_[_0x0476('0x21')](_0x4f0fd5[_0x0476('0x1f')][_0x0476('0x22')],function(_0x192d27){return{'model':db[_0x192d27[_0x0476('0x23')]],'as':_0x192d27['as'],'attributes':_0x192d27['attributes'],'include':_0x192d27['include']?_[_0x0476('0x21')](_0x192d27[_0x0476('0x22')],function(_0x27ef0){return{'model':db[_0x27ef0['model']],'as':_0x27ef0['as'],'attributes':_0x27ef0[_0x0476('0x24')],'include':_0x27ef0[_0x0476('0x22')]?_[_0x0476('0x21')](_0x27ef0['include'],function(_0xf7d72f){return{'model':db[_0xf7d72f[_0x0476('0x23')]],'as':_0xf7d72f['as'],'attributes':_0xf7d72f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0476('0x11')](function(_0x56384a){logger[_0x0476('0x12')](_0x0476('0x1c'),_0x4f0fd5);logger[_0x0476('0x15')](_0x0476('0x1c'),_0x4f0fd5,JSON[_0x0476('0x25')](_0x56384a));_0x328f00(_0x56384a);})[_0x0476('0x1b')](function(_0xeee617){logger[_0x0476('0x17')]('GetChatQueue',_0xeee617[_0x0476('0x19')],_0x4f0fd5);_0x45f854(_0x377188[_0x0476('0x17')](0x1f4,_0xeee617[_0x0476('0x19')]));});});};exports['ShowChatQueue']=function(_0x252028){var _0x217f4d=this;return new Promise(function(_0x316512,_0x51bfd2){return db[_0x0476('0x1d')][_0x0476('0x26')]({'raw':_0x252028[_0x0476('0x1f')]?_0x252028[_0x0476('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x252028['options']?_0x252028[_0x0476('0x1f')]['where']||null:null,'attributes':_0x252028[_0x0476('0x1f')]?_0x252028['options']['attributes']||null:null,'include':_0x252028[_0x0476('0x1f')]?_0x252028[_0x0476('0x1f')]['include']?_[_0x0476('0x21')](_0x252028['options'][_0x0476('0x22')],function(_0x286b63){return{'model':db[_0x286b63[_0x0476('0x23')]],'as':_0x286b63['as'],'attributes':_0x286b63[_0x0476('0x24')],'include':_0x286b63['include']?_[_0x0476('0x21')](_0x286b63['include'],function(_0x3288b7){return{'model':db[_0x3288b7[_0x0476('0x23')]],'as':_0x3288b7['as'],'attributes':_0x3288b7[_0x0476('0x24')],'include':_0x3288b7[_0x0476('0x22')]?_[_0x0476('0x21')](_0x3288b7[_0x0476('0x22')],function(_0x1baef1){return{'model':db[_0x1baef1[_0x0476('0x23')]],'as':_0x1baef1['as'],'attributes':_0x1baef1[_0x0476('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0476('0x11')](function(_0x2208c7){logger['info'](_0x0476('0x27'),_0x252028);logger['debug'](_0x0476('0x27'),_0x252028,JSON[_0x0476('0x25')](_0x2208c7));_0x316512(_0x2208c7);})[_0x0476('0x1b')](function(_0x2903c2){logger[_0x0476('0x17')](_0x0476('0x27'),_0x2903c2[_0x0476('0x19')],_0x252028);_0x51bfd2(_0x217f4d[_0x0476('0x17')](0x1f4,_0x2903c2[_0x0476('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 4668117..cc8b4cb 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 _0xed1f=['register','length','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed1f,0x6a));var _0xfed1=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xed1f[_0x178e48];return _0x440d7e;};'use strict';var ChatQueueEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),_0xfed1('0x2'),_0xfed1('0x3')];function createListener(_0xa45937,_0x25f345){return function(_0x1dd614){_0x25f345[_0xfed1('0x4')](_0xa45937,_0x1dd614);};}function removeListener(_0x2209b3,_0x45c3c1){return function(){ChatQueueEvents[_0xfed1('0x5')](_0x2209b3,_0x45c3c1);};}exports[_0xfed1('0x6')]=function(_0x3d6706){for(var _0x42751d=0x0,_0x380e18=events[_0xfed1('0x7')];_0x42751d<_0x380e18;_0x42751d++){var _0x2a6082=events[_0x42751d];var _0x2967ef=createListener('chatQueue:'+_0x2a6082,_0x3d6706);ChatQueueEvents['on'](_0x2a6082,_0x2967ef);}};
\ No newline at end of file
+var _0x0e85=['update','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x26005e,_0x481ec1){var _0x16df4b=function(_0xedcaab){while(--_0xedcaab){_0x26005e['push'](_0x26005e['shift']());}};_0x16df4b(++_0x481ec1);}(_0x0e85,0x7c));var _0x50e8=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x0e85[_0x29d915];return _0x160f86;};'use strict';var ChatQueueEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){ChatQueueEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);ChatQueueEvents['on'](_0x108edc,_0x42665e);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index afbfb80..0e5c195 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x6eae2,_0x5e3b82){var _0x5def02=function(_0x168cad){while(--_0x168cad){_0x6eae2['push'](_0x6eae2['shift']());}};_0x5def02(++_0x5e3b82);}(_0x55ca,0x126));var _0xa55c=function(_0x2e689d,_0x4c3b29){_0x2e689d=_0x2e689d-0x0;var _0x540160=_0x55ca[_0x2e689d];return _0x540160;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x36981f,_0x35de12){var _0x4c1845=function(_0xe1ff6b){while(--_0xe1ff6b){_0x36981f['push'](_0x36981f['shift']());}};_0x4c1845(++_0x35de12);}(_0x814b,0x1a2));var _0xb814=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x814b[_0x166d93];return _0xba708;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 37ad961..50ecbe2 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 _0x3072=['DATE','sequelize','exports','STRING'];(function(_0x3bde1b,_0x8f8f7d){var _0x1029f2=function(_0x24ad4c){while(--_0x24ad4c){_0x3bde1b['push'](_0x3bde1b['shift']());}};_0x1029f2(++_0x8f8f7d);}(_0x3072,0xe1));var _0x2307=function(_0x4d9540,_0x26cc84){_0x4d9540=_0x4d9540-0x0;var _0x2d211e=_0x3072[_0x4d9540];return _0x2d211e;};'use strict';var moment=require('moment');var Sequelize=require(_0x2307('0x0'));module[_0x2307('0x1')]={'uniqueid':{'type':Sequelize[_0x2307('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2307('0x2')]},'joinAt':{'type':Sequelize[_0x2307('0x3')]},'leaveAt':{'type':Sequelize[_0x2307('0x3')]},'acceptAt':{'type':Sequelize[_0x2307('0x3')]},'exitAt':{'type':Sequelize[_0x2307('0x3')]},'reason':{'type':Sequelize[_0x2307('0x2')]}};
\ No newline at end of file
+var _0x3c15=['STRING','DATE','sequelize','exports'];(function(_0x48c417,_0x44e01d){var _0x30aa48=function(_0x5e089c){while(--_0x5e089c){_0x48c417['push'](_0x48c417['shift']());}};_0x30aa48(++_0x44e01d);}(_0x3c15,0x172));var _0x53c1=function(_0xf64789,_0x55bdfa){_0xf64789=_0xf64789-0x0;var _0x3622f1=_0x3c15[_0xf64789];return _0x3622f1;};'use strict';var moment=require('moment');var Sequelize=require(_0x53c1('0x0'));module[_0x53c1('0x1')]={'uniqueid':{'type':Sequelize[_0x53c1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x53c1('0x2')]},'joinAt':{'type':Sequelize[_0x53c1('0x3')]},'leaveAt':{'type':Sequelize[_0x53c1('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x53c1('0x3')]},'reason':{'type':Sequelize[_0x53c1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 0dadd95..27f02d2 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 _0x1db9=['merge','VIRTUAL','include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x1db9,0x176));var _0x91db=function(_0x589032,_0x34c698){_0x589032=_0x589032-0x0;var _0x2df59c=_0x1db9[_0x589032];return _0x2df59c;};'use strict';var emlformat=require(_0x91db('0x0'));var rimraf=require(_0x91db('0x1'));var zipdir=require(_0x91db('0x2'));var jsonpatch=require(_0x91db('0x3'));var rp=require(_0x91db('0x4'));var moment=require(_0x91db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x91db('0x6'));var util=require(_0x91db('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x91db('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91db('0x9'));var squel=require(_0x91db('0xa'));var crypto=require(_0x91db('0xb'));var jsforce=require(_0x91db('0xc'));var deskjs=require(_0x91db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x91db('0xe'));var Papa=require('papaparse');var Redis=require(_0x91db('0xf'));var authService=require(_0x91db('0x10'));var qs=require(_0x91db('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91db('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x91db('0x13'));var licenseUtil=require(_0x91db('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x540c48,_0x2b9b98){_0x2b9b98=_0x2b9b98||0xcc;return function(_0x329277){if(_0x329277){return _0x540c48[_0x91db('0x15')](_0x2b9b98);}return _0x540c48[_0x91db('0x16')](_0x2b9b98)[_0x91db('0x17')]();};}function respondWithResult(_0x4c3124,_0x371158){_0x371158=_0x371158||0xc8;return function(_0x285052){if(_0x285052){return _0x4c3124[_0x91db('0x16')](_0x371158)[_0x91db('0x18')](_0x285052);}};}function respondWithFilteredResult(_0x2df307,_0x33b39d){return function(_0x260b56){if(_0x260b56){var _0x143bc4=typeof _0x33b39d[_0x91db('0x19')]===_0x91db('0x1a')&&typeof _0x33b39d[_0x91db('0x1b')]===_0x91db('0x1a');var _0x5f5440=_0x260b56[_0x91db('0x1c')];var _0x23d125=_0x143bc4?0x0:_0x33b39d[_0x91db('0x19')];var _0x42e66c=_0x143bc4?_0x260b56[_0x91db('0x1c')]:_0x33b39d[_0x91db('0x19')]+_0x33b39d['limit'];var _0x4ae820;if(_0x42e66c>=_0x5f5440){_0x42e66c=_0x5f5440;_0x4ae820=0xc8;}else{_0x4ae820=0xce;}_0x2df307[_0x91db('0x16')](_0x4ae820);return _0x2df307[_0x91db('0x1d')](_0x91db('0x1e'),_0x23d125+'-'+_0x42e66c+'/'+_0x5f5440)[_0x91db('0x18')](_0x260b56);}return null;};}function patchUpdates(_0x50cf9c){return function(_0x168dea){try{jsonpatch[_0x91db('0x1f')](_0x168dea,_0x50cf9c,!![]);}catch(_0x6e3ca6){return BPromise[_0x91db('0x20')](_0x6e3ca6);}return _0x168dea[_0x91db('0x21')]();};}function saveUpdates(_0x31b96c,_0xaad1f6){return function(_0x8e323f){if(_0x8e323f){return _0x8e323f[_0x91db('0x22')](_0x31b96c)[_0x91db('0x23')](function(_0x554454){return _0x554454;});}return null;};}function removeEntity(_0x58774f,_0x134caa){return function(_0x2ac8d5){if(_0x2ac8d5){return _0x2ac8d5['destroy']()[_0x91db('0x23')](function(){_0x58774f[_0x91db('0x16')](0xcc)[_0x91db('0x17')]();});}};}function handleEntityNotFound(_0x6e3a9c,_0x3729d3){return function(_0x4e2a8f){if(!_0x4e2a8f){_0x6e3a9c['sendStatus'](0x194);}return _0x4e2a8f;};}function handleError(_0x42e53f,_0x2f0b86){_0x2f0b86=_0x2f0b86||0x1f4;return function(_0x329118){logger['error'](_0x329118[_0x91db('0x24')]);if(_0x329118[_0x91db('0x25')]){delete _0x329118[_0x91db('0x25')];}_0x42e53f[_0x91db('0x16')](_0x2f0b86)['send'](_0x329118);};}exports[_0x91db('0x26')]=function(_0x2a00d1,_0x1805ef){var _0x49c504={},_0x2ff6c8={},_0x69fdc2={'count':0x0,'rows':[]};var _0x2d3ebd=_[_0x91db('0x27')](db[_0x91db('0x28')][_0x91db('0x29')],function(_0x2e6a27){return{'name':_0x2e6a27[_0x91db('0x2a')],'type':_0x2e6a27[_0x91db('0x2b')][_0x91db('0x2c')]};});_0x2ff6c8[_0x91db('0x2d')]=_[_0x91db('0x27')](_0x2d3ebd,_0x91db('0x25'));_0x2ff6c8[_0x91db('0x2e')]=_['keys'](_0x2a00d1[_0x91db('0x2e')]);_0x2ff6c8[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],_0x2ff6c8[_0x91db('0x2e')]);_0x49c504['attributes']=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],qs[_0x91db('0x31')](_0x2a00d1['query'][_0x91db('0x31')]));_0x49c504['attributes']=_0x49c504[_0x91db('0x32')][_0x91db('0x33')]?_0x49c504[_0x91db('0x32')]:_0x2ff6c8[_0x91db('0x2d')];if(!_0x2a00d1['query'][_0x91db('0x34')](_0x91db('0x35'))){_0x49c504[_0x91db('0x1b')]=qs['limit'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x1b')]);_0x49c504['offset']=qs[_0x91db('0x19')](_0x2a00d1[_0x91db('0x2e')]['offset']);}_0x49c504[_0x91db('0x36')]=qs['sort'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x37')]);_0x49c504['where']=qs['filters'](_['pick'](_0x2a00d1[_0x91db('0x2e')],_0x2ff6c8[_0x91db('0x2f')]),_0x2d3ebd);if(_0x2a00d1['query'][_0x91db('0x38')]){_0x49c504[_0x91db('0x39')]=_[_0x91db('0x3a')](_0x49c504[_0x91db('0x39')],{'$or':_[_0x91db('0x27')](_0x2d3ebd,function(_0x3cccc7){if(_0x3cccc7[_0x91db('0x2b')]!==_0x91db('0x3b')){var _0xcdc472={};_0xcdc472[_0x3cccc7[_0x91db('0x25')]]={'$like':'%'+_0x2a00d1[_0x91db('0x2e')]['filter']+'%'};return _0xcdc472;}})});}_0x49c504=_[_0x91db('0x3a')]({},_0x49c504,_0x2a00d1['options']);var _0x14de6d={'where':_0x49c504[_0x91db('0x39')]};return db['ChatQueueReport'][_0x91db('0x1c')](_0x14de6d)[_0x91db('0x23')](function(_0x16a7e9){_0x69fdc2[_0x91db('0x1c')]=_0x16a7e9;if(_0x2a00d1[_0x91db('0x2e')]['includeAll']){_0x49c504[_0x91db('0x3c')]=[{'all':!![]}];}return db[_0x91db('0x28')][_0x91db('0x3d')](_0x49c504);})['then'](function(_0x4733a4){_0x69fdc2[_0x91db('0x3e')]=_0x4733a4;return _0x69fdc2;})[_0x91db('0x23')](respondWithFilteredResult(_0x1805ef,_0x49c504))['catch'](handleError(_0x1805ef,null));};exports[_0x91db('0x3f')]=function(_0x2b7830,_0x29831c){var _0x3d73a7={'raw':!![],'where':{'id':_0x2b7830['params']['id']}},_0x3609e1={};_0x3609e1[_0x91db('0x2d')]=_['keys'](db[_0x91db('0x28')][_0x91db('0x29')]);_0x3609e1[_0x91db('0x2e')]=_[_0x91db('0x40')](_0x2b7830[_0x91db('0x2e')]);_0x3609e1[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x3609e1[_0x91db('0x2d')],_0x3609e1[_0x91db('0x2e')]);_0x3d73a7[_0x91db('0x32')]=_[_0x91db('0x30')](_0x3609e1['model'],qs['fields'](_0x2b7830[_0x91db('0x2e')][_0x91db('0x31')]));_0x3d73a7[_0x91db('0x32')]=_0x3d73a7['attributes'][_0x91db('0x33')]?_0x3d73a7[_0x91db('0x32')]:_0x3609e1[_0x91db('0x2d')];if(_0x2b7830[_0x91db('0x2e')][_0x91db('0x41')]){_0x3d73a7['include']=[{'all':!![]}];}_0x3d73a7=_[_0x91db('0x3a')]({},_0x3d73a7,_0x2b7830['options']);return db[_0x91db('0x28')][_0x91db('0x42')](_0x3d73a7)[_0x91db('0x23')](handleEntityNotFound(_0x29831c,null))[_0x91db('0x23')](respondWithResult(_0x29831c,null))[_0x91db('0x43')](handleError(_0x29831c,null));};exports[_0x91db('0x44')]=function(_0x17f7b3,_0xd5a8fb){return db[_0x91db('0x28')]['create'](_0x17f7b3['body'],{})[_0x91db('0x23')](respondWithResult(_0xd5a8fb,0xc9))[_0x91db('0x43')](handleError(_0xd5a8fb,null));};exports[_0x91db('0x22')]=function(_0x410423,_0x27e224){if(_0x410423['body']['id']){delete _0x410423[_0x91db('0x45')]['id'];}return db[_0x91db('0x28')][_0x91db('0x42')]({'where':{'id':_0x410423[_0x91db('0x46')]['id']}})[_0x91db('0x23')](handleEntityNotFound(_0x27e224,null))['then'](saveUpdates(_0x410423[_0x91db('0x45')],null))[_0x91db('0x23')](respondWithResult(_0x27e224,null))[_0x91db('0x43')](handleError(_0x27e224,null));};exports[_0x91db('0x47')]=function(_0x50b269,_0x3d8dfb){return db['ChatQueueReport']['find']({'where':{'id':_0x50b269[_0x91db('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d8dfb,null))[_0x91db('0x23')](removeEntity(_0x3d8dfb,null))['catch'](handleError(_0x3d8dfb,null));};exports['describe']=function(_0x2c30ff,_0x371277){return db[_0x91db('0x28')]['describe']()[_0x91db('0x23')](respondWithResult(_0x371277,null))[_0x91db('0x43')](handleError(_0x371277,null));};
\ No newline at end of file
+var _0xc7b3=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3a75a9,_0x146dfd){var _0x562618=function(_0xb160b2){while(--_0xb160b2){_0x3a75a9['push'](_0x3a75a9['shift']());}};_0x562618(++_0x146dfd);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc7b3[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x3c7b('0x0'));var rimraf=require(_0x3c7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c7b('0x2'));var rp=require(_0x3c7b('0x3'));var moment=require(_0x3c7b('0x4'));var BPromise=require(_0x3c7b('0x5'));var Mustache=require(_0x3c7b('0x6'));var util=require(_0x3c7b('0x7'));var path=require('path');var sox=require(_0x3c7b('0x8'));var csv=require(_0x3c7b('0x9'));var ejs=require(_0x3c7b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c7b('0xb'));var squel=require(_0x3c7b('0xc'));var crypto=require('crypto');var jsforce=require(_0x3c7b('0xd'));var deskjs=require(_0x3c7b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3c7b('0xf'));var Papa=require(_0x3c7b('0x10'));var Redis=require(_0x3c7b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3c7b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7b('0x13'));var logger=require(_0x3c7b('0x14'))('api');var utils=require(_0x3c7b('0x15'));var config=require(_0x3c7b('0x16'));var licenseUtil=require(_0x3c7b('0x17'));var db=require(_0x3c7b('0x18'))['db'];function respondWithStatusCode(_0x31b453,_0x4450c6){_0x4450c6=_0x4450c6||0xcc;return function(_0x5d1ba2){if(_0x5d1ba2){return _0x31b453[_0x3c7b('0x19')](_0x4450c6);}return _0x31b453['status'](_0x4450c6)[_0x3c7b('0x1a')]();};}function respondWithResult(_0x2136b8,_0x187049){_0x187049=_0x187049||0xc8;return function(_0x31630d){if(_0x31630d){return _0x2136b8[_0x3c7b('0x1b')](_0x187049)[_0x3c7b('0x1c')](_0x31630d);}};}function respondWithFilteredResult(_0x2b4ee8,_0x18054e){return function(_0x326541){if(_0x326541){var _0x38a02c=typeof _0x18054e[_0x3c7b('0x1d')]===_0x3c7b('0x1e')&&typeof _0x18054e['limit']===_0x3c7b('0x1e');var _0x287d05=_0x326541[_0x3c7b('0x1f')];var _0x457c09=_0x38a02c?0x0:_0x18054e[_0x3c7b('0x1d')];var _0x38a9f6=_0x38a02c?_0x326541[_0x3c7b('0x1f')]:_0x18054e[_0x3c7b('0x1d')]+_0x18054e[_0x3c7b('0x20')];var _0x23d01c;if(_0x38a9f6>=_0x287d05){_0x38a9f6=_0x287d05;_0x23d01c=0xc8;}else{_0x23d01c=0xce;}_0x2b4ee8[_0x3c7b('0x1b')](_0x23d01c);return _0x2b4ee8[_0x3c7b('0x21')](_0x3c7b('0x22'),_0x457c09+'-'+_0x38a9f6+'/'+_0x287d05)[_0x3c7b('0x1c')](_0x326541);}return null;};}function patchUpdates(_0x2f1966){return function(_0x1c4878){try{jsonpatch[_0x3c7b('0x23')](_0x1c4878,_0x2f1966,!![]);}catch(_0xd05d3){return BPromise['reject'](_0xd05d3);}return _0x1c4878[_0x3c7b('0x24')]();};}function saveUpdates(_0x2d93eb,_0x29372e){return function(_0x2a390e){if(_0x2a390e){return _0x2a390e[_0x3c7b('0x25')](_0x2d93eb)[_0x3c7b('0x26')](function(_0x2bcd73){return _0x2bcd73;});}return null;};}function removeEntity(_0x45c647,_0x39575b){return function(_0x29acf5){if(_0x29acf5){return _0x29acf5[_0x3c7b('0x27')]()[_0x3c7b('0x26')](function(){_0x45c647[_0x3c7b('0x1b')](0xcc)[_0x3c7b('0x1a')]();});}};}function handleEntityNotFound(_0x47f23c,_0x5866d2){return function(_0x416f8d){if(!_0x416f8d){_0x47f23c[_0x3c7b('0x19')](0x194);}return _0x416f8d;};}function handleError(_0x4d4193,_0x35b449){_0x35b449=_0x35b449||0x1f4;return function(_0x181097){logger[_0x3c7b('0x28')](_0x181097[_0x3c7b('0x29')]);if(_0x181097[_0x3c7b('0x2a')]){delete _0x181097[_0x3c7b('0x2a')];}_0x4d4193[_0x3c7b('0x1b')](_0x35b449)[_0x3c7b('0x2b')](_0x181097);};}exports[_0x3c7b('0x2c')]=function(_0x528556,_0x4f8d48){var _0x44e5ba={},_0x1162e1={},_0x288fe4={'count':0x0,'rows':[]};var _0x2e5974=_[_0x3c7b('0x2d')](db[_0x3c7b('0x2e')][_0x3c7b('0x2f')],function(_0x3793e6){return{'name':_0x3793e6['fieldName'],'type':_0x3793e6[_0x3c7b('0x30')][_0x3c7b('0x31')]};});_0x1162e1[_0x3c7b('0x32')]=_['map'](_0x2e5974,_0x3c7b('0x2a'));_0x1162e1[_0x3c7b('0x33')]=_[_0x3c7b('0x34')](_0x528556['query']);_0x1162e1[_0x3c7b('0x35')]=_[_0x3c7b('0x36')](_0x1162e1[_0x3c7b('0x32')],_0x1162e1['query']);_0x44e5ba[_0x3c7b('0x37')]=_[_0x3c7b('0x36')](_0x1162e1['model'],qs[_0x3c7b('0x38')](_0x528556[_0x3c7b('0x33')][_0x3c7b('0x38')]));_0x44e5ba['attributes']=_0x44e5ba[_0x3c7b('0x37')][_0x3c7b('0x39')]?_0x44e5ba['attributes']:_0x1162e1['model'];if(!_0x528556[_0x3c7b('0x33')][_0x3c7b('0x3a')]('nolimit')){_0x44e5ba[_0x3c7b('0x20')]=qs[_0x3c7b('0x20')](_0x528556[_0x3c7b('0x33')]['limit']);_0x44e5ba[_0x3c7b('0x1d')]=qs[_0x3c7b('0x1d')](_0x528556[_0x3c7b('0x33')][_0x3c7b('0x1d')]);}_0x44e5ba[_0x3c7b('0x3b')]=qs[_0x3c7b('0x3c')](_0x528556[_0x3c7b('0x33')][_0x3c7b('0x3c')]);_0x44e5ba[_0x3c7b('0x3d')]=qs[_0x3c7b('0x35')](_[_0x3c7b('0x3e')](_0x528556['query'],_0x1162e1[_0x3c7b('0x35')]),_0x2e5974);if(_0x528556[_0x3c7b('0x33')][_0x3c7b('0x3f')]){_0x44e5ba[_0x3c7b('0x3d')]=_['merge'](_0x44e5ba['where'],{'$or':_[_0x3c7b('0x2d')](_0x2e5974,function(_0x215987){if(_0x215987[_0x3c7b('0x30')]!==_0x3c7b('0x40')){var _0x2091a6={};_0x2091a6[_0x215987[_0x3c7b('0x2a')]]={'$like':'%'+_0x528556[_0x3c7b('0x33')][_0x3c7b('0x3f')]+'%'};return _0x2091a6;}})});}_0x44e5ba=_[_0x3c7b('0x41')]({},_0x44e5ba,_0x528556[_0x3c7b('0x42')]);var _0x324898={'where':_0x44e5ba['where']};return db[_0x3c7b('0x2e')][_0x3c7b('0x1f')](_0x324898)[_0x3c7b('0x26')](function(_0x57025a){_0x288fe4[_0x3c7b('0x1f')]=_0x57025a;if(_0x528556[_0x3c7b('0x33')][_0x3c7b('0x43')]){_0x44e5ba[_0x3c7b('0x44')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x3c7b('0x45')](_0x44e5ba);})[_0x3c7b('0x26')](function(_0x3abc48){_0x288fe4[_0x3c7b('0x46')]=_0x3abc48;return _0x288fe4;})[_0x3c7b('0x26')](respondWithFilteredResult(_0x4f8d48,_0x44e5ba))[_0x3c7b('0x47')](handleError(_0x4f8d48,null));};exports['show']=function(_0x2afd92,_0x38f8ab){var _0xd58cbf={'raw':!![],'where':{'id':_0x2afd92['params']['id']}},_0x44828e={};_0x44828e['model']=_[_0x3c7b('0x34')](db[_0x3c7b('0x2e')][_0x3c7b('0x2f')]);_0x44828e[_0x3c7b('0x33')]=_[_0x3c7b('0x34')](_0x2afd92['query']);_0x44828e[_0x3c7b('0x35')]=_[_0x3c7b('0x36')](_0x44828e['model'],_0x44828e['query']);_0xd58cbf[_0x3c7b('0x37')]=_[_0x3c7b('0x36')](_0x44828e[_0x3c7b('0x32')],qs[_0x3c7b('0x38')](_0x2afd92[_0x3c7b('0x33')]['fields']));_0xd58cbf[_0x3c7b('0x37')]=_0xd58cbf['attributes'][_0x3c7b('0x39')]?_0xd58cbf[_0x3c7b('0x37')]:_0x44828e[_0x3c7b('0x32')];if(_0x2afd92['query'][_0x3c7b('0x43')]){_0xd58cbf['include']=[{'all':!![]}];}_0xd58cbf=_['merge']({},_0xd58cbf,_0x2afd92[_0x3c7b('0x42')]);return db[_0x3c7b('0x2e')][_0x3c7b('0x48')](_0xd58cbf)[_0x3c7b('0x26')](handleEntityNotFound(_0x38f8ab,null))['then'](respondWithResult(_0x38f8ab,null))[_0x3c7b('0x47')](handleError(_0x38f8ab,null));};exports[_0x3c7b('0x49')]=function(_0x568ab8,_0x4d28eb){return db[_0x3c7b('0x2e')]['create'](_0x568ab8['body'],{})[_0x3c7b('0x26')](respondWithResult(_0x4d28eb,0xc9))[_0x3c7b('0x47')](handleError(_0x4d28eb,null));};exports['update']=function(_0x332f6d,_0x5412d1){if(_0x332f6d[_0x3c7b('0x4a')]['id']){delete _0x332f6d[_0x3c7b('0x4a')]['id'];}return db[_0x3c7b('0x2e')][_0x3c7b('0x48')]({'where':{'id':_0x332f6d[_0x3c7b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5412d1,null))[_0x3c7b('0x26')](saveUpdates(_0x332f6d[_0x3c7b('0x4a')],null))[_0x3c7b('0x26')](respondWithResult(_0x5412d1,null))[_0x3c7b('0x47')](handleError(_0x5412d1,null));};exports['destroy']=function(_0xbf374d,_0xccab2d){return db['ChatQueueReport'][_0x3c7b('0x48')]({'where':{'id':_0xbf374d[_0x3c7b('0x4b')]['id']}})[_0x3c7b('0x26')](handleEntityNotFound(_0xccab2d,null))[_0x3c7b('0x26')](removeEntity(_0xccab2d,null))['catch'](handleError(_0xccab2d,null));};exports[_0x3c7b('0x4c')]=function(_0x5d1dd6,_0xd0634a){return db[_0x3c7b('0x2e')][_0x3c7b('0x4c')]()['then'](respondWithResult(_0xd0634a,null))[_0x3c7b('0x47')](handleError(_0xd0634a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 4487deb..19dada4 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2e6448,_0x417d91){var _0xfb736b=function(_0x2b0a86){while(--_0x2b0a86){_0x2e6448['push'](_0x2e6448['shift']());}};_0xfb736b(++_0x417d91);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3072e2,_0x648a09){var _0x42c45b=function(_0x2ddff5){while(--_0x2ddff5){_0x3072e2['push'](_0x3072e2['shift']());}};_0x42c45b(++_0x648a09);}(_0xe706,0xa3));var _0x6e70=function(_0xcad01d,_0xef9abc){_0xcad01d=_0xcad01d-0x0;var _0x76a4a6=_0xe706[_0xcad01d];return _0x76a4a6;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index ca42ea3..78d319a 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 _0x0056=['message','catch','CreateChatQueueReport','body','options','raw','stringify','ChatQueueReport','attributes','limit','UpdateChatQueueReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x0056,0xdb));var _0x6005=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0x0056[_0x5bc5fe];return _0x298ea7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6005('0x0'));var BPromise=require(_0x6005('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6005('0x2'));var db=require(_0x6005('0x3'))['db'];var utils=require(_0x6005('0x4'));var logger=require(_0x6005('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6005('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee6d4,_0x377a38,_0x3aef8a){return new BPromise(function(_0x58491d,_0xa09a6b){return client[_0x6005('0x7')](_0x3ee6d4,_0x3aef8a)[_0x6005('0x8')](function(_0x33d361){logger[_0x6005('0x9')](_0x6005('0xa'),_0x377a38,_0x6005('0xb'));logger[_0x6005('0xc')](_0x6005('0xd'),_0x377a38,_0x6005('0xb'),JSON['stringify'](_0x33d361));if(_0x33d361[_0x6005('0xe')]){if(_0x33d361[_0x6005('0xe')]['code']===0x1f4){logger[_0x6005('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x377a38,_0x33d361[_0x6005('0xe')][_0x6005('0xf')]);return _0xa09a6b(_0x33d361[_0x6005('0xe')][_0x6005('0xf')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x377a38,_0x33d361[_0x6005('0xe')][_0x6005('0xf')]);return _0x58491d(_0x33d361[_0x6005('0xe')]['message']);}else{logger[_0x6005('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x377a38,_0x6005('0xb'));_0x58491d(_0x33d361['result'][_0x6005('0xf')]);}})[_0x6005('0x10')](function(_0x1217f0){logger['error'](_0x6005('0xa'),_0x377a38,_0x1217f0);_0xa09a6b(_0x1217f0);});});}exports[_0x6005('0x11')]=function(_0xf4207a){var _0x4a40c6=this;return new Promise(function(_0x41e7d3,_0x4c0b40){return db['ChatQueueReport']['create'](_0xf4207a[_0x6005('0x12')],{'raw':_0xf4207a[_0x6005('0x13')]?_0xf4207a[_0x6005('0x13')][_0x6005('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x53c30b){logger[_0x6005('0x9')](_0x6005('0x11'),_0xf4207a);logger[_0x6005('0xc')]('CreateChatQueueReport',_0xf4207a,JSON[_0x6005('0x15')](_0x53c30b));_0x41e7d3(_0x53c30b);})[_0x6005('0x10')](function(_0x213c90){logger[_0x6005('0xe')]('CreateChatQueueReport',_0x213c90[_0x6005('0xf')],_0xf4207a);_0x4c0b40(_0x4a40c6[_0x6005('0xe')](0x1f4,_0x213c90[_0x6005('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x59f6c9){var _0x3d4d90=this;return new Promise(function(_0x5a8474,_0x4659a4){return db[_0x6005('0x16')]['update'](_0x59f6c9['body'],{'raw':_0x59f6c9[_0x6005('0x13')]?_0x59f6c9[_0x6005('0x13')][_0x6005('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59f6c9['options']?_0x59f6c9[_0x6005('0x13')]['where']||null:null,'attributes':_0x59f6c9[_0x6005('0x13')]?_0x59f6c9[_0x6005('0x13')][_0x6005('0x17')]||null:null,'limit':_0x59f6c9[_0x6005('0x13')]?_0x59f6c9[_0x6005('0x13')][_0x6005('0x18')]||null:null})[_0x6005('0x8')](function(_0x576390){logger[_0x6005('0x9')](_0x6005('0x19'),_0x59f6c9);logger['debug']('UpdateChatQueueReport',_0x59f6c9,JSON['stringify'](_0x576390));_0x5a8474(_0x576390);})['catch'](function(_0x58223c){logger['error']('UpdateChatQueueReport',_0x58223c['message'],_0x59f6c9);_0x4659a4(_0x3d4d90[_0x6005('0xe')](0x1f4,_0x58223c[_0x6005('0xf')]));});});};
\ No newline at end of file
+var _0x7e37=['UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw'];(function(_0x5aa53a,_0x1e952f){var _0x37b309=function(_0x5c3ab3){while(--_0x5c3ab3){_0x5aa53a['push'](_0x5aa53a['shift']());}};_0x37b309(++_0x1e952f);}(_0x7e37,0xf3));var _0x77e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e37[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x77e3('0x0'));var util=require(_0x77e3('0x1'));var moment=require(_0x77e3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77e3('0x3'));var db=require(_0x77e3('0x4'))['db'];var utils=require(_0x77e3('0x5'));var logger=require(_0x77e3('0x6'))(_0x77e3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x77e3('0x8')][_0x77e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcb6b7,_0x377126,_0x3cedb1){return new BPromise(function(_0xc56c2,_0x5ed9fb){return client[_0x77e3('0xa')](_0xcb6b7,_0x3cedb1)[_0x77e3('0xb')](function(_0x3b9b35){logger['info'](_0x77e3('0xc'),_0x377126,_0x77e3('0xd'));logger[_0x77e3('0xe')](_0x77e3('0xf'),_0x377126,_0x77e3('0xd'),JSON[_0x77e3('0x10')](_0x3b9b35));if(_0x3b9b35[_0x77e3('0x11')]){if(_0x3b9b35['error'][_0x77e3('0x12')]===0x1f4){logger[_0x77e3('0x11')](_0x77e3('0xc'),_0x377126,_0x3b9b35[_0x77e3('0x11')][_0x77e3('0x13')]);return _0x5ed9fb(_0x3b9b35[_0x77e3('0x11')][_0x77e3('0x13')]);}logger[_0x77e3('0x11')](_0x77e3('0xc'),_0x377126,_0x3b9b35[_0x77e3('0x11')][_0x77e3('0x13')]);return _0xc56c2(_0x3b9b35['error']['message']);}else{logger[_0x77e3('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x377126,'request\x20sent');_0xc56c2(_0x3b9b35[_0x77e3('0x15')][_0x77e3('0x13')]);}})[_0x77e3('0x16')](function(_0x3d2090){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x377126,_0x3d2090);_0x5ed9fb(_0x3d2090);});});}exports[_0x77e3('0x17')]=function(_0x35b769){var _0x3a8f6b=this;return new Promise(function(_0x53a834,_0xc0dba2){return db[_0x77e3('0x18')][_0x77e3('0x19')](_0x35b769[_0x77e3('0x1a')],{'raw':_0x35b769[_0x77e3('0x1b')]?_0x35b769[_0x77e3('0x1b')][_0x77e3('0x1c')]===undefined?!![]:![]:!![]})[_0x77e3('0xb')](function(_0x10dcfb){logger[_0x77e3('0x14')](_0x77e3('0x17'),_0x35b769);logger['debug'](_0x77e3('0x17'),_0x35b769,JSON[_0x77e3('0x10')](_0x10dcfb));_0x53a834(_0x10dcfb);})[_0x77e3('0x16')](function(_0x12dc4a){logger['error']('CreateChatQueueReport',_0x12dc4a[_0x77e3('0x13')],_0x35b769);_0xc0dba2(_0x3a8f6b[_0x77e3('0x11')](0x1f4,_0x12dc4a[_0x77e3('0x13')]));});});};exports[_0x77e3('0x1d')]=function(_0x15bde9){var _0x572309=this;return new Promise(function(_0x44ae6a,_0x3c4a74){return db[_0x77e3('0x18')][_0x77e3('0x1e')](_0x15bde9[_0x77e3('0x1a')],{'raw':_0x15bde9[_0x77e3('0x1b')]?_0x15bde9[_0x77e3('0x1b')][_0x77e3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15bde9[_0x77e3('0x1b')]?_0x15bde9[_0x77e3('0x1b')][_0x77e3('0x1f')]||null:null,'attributes':_0x15bde9[_0x77e3('0x1b')]?_0x15bde9[_0x77e3('0x1b')][_0x77e3('0x20')]||null:null,'limit':_0x15bde9[_0x77e3('0x1b')]?_0x15bde9[_0x77e3('0x1b')][_0x77e3('0x21')]||null:null})['then'](function(_0x9b3d3f){logger[_0x77e3('0x14')](_0x77e3('0x1d'),_0x15bde9);logger['debug'](_0x77e3('0x1d'),_0x15bde9,JSON['stringify'](_0x9b3d3f));_0x44ae6a(_0x9b3d3f);})[_0x77e3('0x16')](function(_0x2be6e4){logger[_0x77e3('0x11')](_0x77e3('0x1d'),_0x2be6e4[_0x77e3('0x13')],_0x15bde9);_0x3c4a74(_0x572309[_0x77e3('0x11')](0x1f4,_0x2be6e4[_0x77e3('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 5cbe377..4dd293b 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 _0x2631=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','post','create','update','delete','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2631,0x6a));var _0x1263=function(_0x447fe7,_0x340107){_0x447fe7=_0x447fe7-0x0;var _0x539c72=_0x2631[_0x447fe7];return _0x539c72;};'use strict';var multer=require(_0x1263('0x0'));var util=require(_0x1263('0x1'));var path=require(_0x1263('0x2'));var timeout=require(_0x1263('0x3'));var express=require(_0x1263('0x4'));var router=express[_0x1263('0x5')]();var fs_extra=require(_0x1263('0x6'));var auth=require(_0x1263('0x7'));var interaction=require(_0x1263('0x8'));var config=require(_0x1263('0x9'));var controller=require(_0x1263('0xa'));router[_0x1263('0xb')]('/',auth[_0x1263('0xc')](),controller[_0x1263('0xd')]);router['get'](_0x1263('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x1263('0xb')]('/:id',auth[_0x1263('0xc')](),controller['show']);router[_0x1263('0xf')]('/',auth[_0x1263('0xc')](),controller[_0x1263('0x10')]);router['put']('/:id',auth[_0x1263('0xc')](),controller[_0x1263('0x11')]);router[_0x1263('0x12')](_0x1263('0x13'),auth[_0x1263('0xc')](),controller[_0x1263('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xf080=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','delete'];(function(_0x532d78,_0x25b6a8){var _0x5990c4=function(_0x3f23fe){while(--_0x3f23fe){_0x532d78['push'](_0x532d78['shift']());}};_0x5990c4(++_0x25b6a8);}(_0xf080,0x74));var _0x0f08=function(_0x4dfc32,_0x2d9f40){_0x4dfc32=_0x4dfc32-0x0;var _0x2e7ae6=_0xf080[_0x4dfc32];return _0x2e7ae6;};'use strict';var multer=require(_0x0f08('0x0'));var util=require(_0x0f08('0x1'));var path=require('path');var timeout=require(_0x0f08('0x2'));var express=require(_0x0f08('0x3'));var router=express[_0x0f08('0x4')]();var fs_extra=require(_0x0f08('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0f08('0x6'));var controller=require(_0x0f08('0x7'));router[_0x0f08('0x8')]('/',auth[_0x0f08('0x9')](),controller[_0x0f08('0xa')]);router['get'](_0x0f08('0xb'),auth[_0x0f08('0x9')](),controller['describe']);router[_0x0f08('0x8')](_0x0f08('0xc'),auth[_0x0f08('0x9')](),controller[_0x0f08('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0f08('0xe')](_0x0f08('0xc'),auth[_0x0f08('0x9')](),controller[_0x0f08('0xf')]);router[_0x0f08('0x10')](_0x0f08('0xc'),auth[_0x0f08('0x9')](),controller[_0x0f08('0x11')]);module[_0x0f08('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 13145f6..a3a3db8 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3ba74d,_0x3e0456){var _0x3bcd85=function(_0x464df6){while(--_0x464df6){_0x3ba74d['push'](_0x3ba74d['shift']());}};_0x3bcd85(++_0x3e0456);}(_0xaa88,0x137));var _0x8aa8=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0xaa88[_0x5ce15c];return _0x36e4f5;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x5e4bec,_0xed6336){var _0x3a6c7a=function(_0x3b111b){while(--_0x3b111b){_0x5e4bec['push'](_0x5e4bec['shift']());}};_0x3a6c7a(++_0xed6336);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0xf3cd[_0x57d370];return _0x550fd2;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index ecc89ae..97f67c1 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 _0x8972=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','params','include','find','create','catch','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x319a7a,_0x1d3fef){var _0xd50de4=function(_0x435c1f){while(--_0x435c1f){_0x319a7a['push'](_0x319a7a['shift']());}};_0xd50de4(++_0x1d3fef);}(_0x8972,0xd8));var _0x2897=function(_0x44c7ce,_0x5eea1b){_0x44c7ce=_0x44c7ce-0x0;var _0x2fee57=_0x8972[_0x44c7ce];return _0x2fee57;};'use strict';var emlformat=require(_0x2897('0x0'));var rimraf=require(_0x2897('0x1'));var zipdir=require(_0x2897('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2897('0x3'));var moment=require(_0x2897('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2897('0x5'));var util=require(_0x2897('0x6'));var path=require(_0x2897('0x7'));var sox=require(_0x2897('0x8'));var csv=require(_0x2897('0x9'));var ejs=require(_0x2897('0xa'));var fs=require('fs');var fs_extra=require(_0x2897('0xb'));var _=require(_0x2897('0xc'));var squel=require(_0x2897('0xd'));var crypto=require(_0x2897('0xe'));var jsforce=require(_0x2897('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2897('0x10'));var Papa=require('papaparse');var Redis=require(_0x2897('0x11'));var authService=require(_0x2897('0x12'));var qs=require(_0x2897('0x13'));var as=require(_0x2897('0x14'));var hardwareService=require(_0x2897('0x15'));var logger=require(_0x2897('0x16'))(_0x2897('0x17'));var utils=require('../../config/utils');var config=require(_0x2897('0x18'));var licenseUtil=require(_0x2897('0x19'));var db=require(_0x2897('0x1a'))['db'];function respondWithStatusCode(_0x1e13ea,_0x14bcba){_0x14bcba=_0x14bcba||0xcc;return function(_0x5cc092){if(_0x5cc092){return _0x1e13ea[_0x2897('0x1b')](_0x14bcba);}return _0x1e13ea[_0x2897('0x1c')](_0x14bcba)[_0x2897('0x1d')]();};}function respondWithResult(_0x18d5ce,_0x333dee){_0x333dee=_0x333dee||0xc8;return function(_0x10e536){if(_0x10e536){return _0x18d5ce['status'](_0x333dee)[_0x2897('0x1e')](_0x10e536);}};}function respondWithFilteredResult(_0x476997,_0x36ea56){return function(_0x22e07c){if(_0x22e07c){var _0x3eedaf=typeof _0x36ea56[_0x2897('0x1f')]===_0x2897('0x20')&&typeof _0x36ea56[_0x2897('0x21')]===_0x2897('0x20');var _0x30215c=_0x22e07c['count'];var _0x5298dd=_0x3eedaf?0x0:_0x36ea56[_0x2897('0x1f')];var _0x2e5e07=_0x3eedaf?_0x22e07c[_0x2897('0x22')]:_0x36ea56[_0x2897('0x1f')]+_0x36ea56[_0x2897('0x21')];var _0x531de5;if(_0x2e5e07>=_0x30215c){_0x2e5e07=_0x30215c;_0x531de5=0xc8;}else{_0x531de5=0xce;}_0x476997['status'](_0x531de5);return _0x476997[_0x2897('0x23')](_0x2897('0x24'),_0x5298dd+'-'+_0x2e5e07+'/'+_0x30215c)['json'](_0x22e07c);}return null;};}function patchUpdates(_0x6fa1af){return function(_0x30f920){try{jsonpatch['apply'](_0x30f920,_0x6fa1af,!![]);}catch(_0x3f14ac){return BPromise['reject'](_0x3f14ac);}return _0x30f920[_0x2897('0x25')]();};}function saveUpdates(_0x1929da,_0x2eb70a){return function(_0xcca818){if(_0xcca818){return _0xcca818['update'](_0x1929da)[_0x2897('0x26')](function(_0x576799){return _0x576799;});}return null;};}function removeEntity(_0x21fb77,_0x53de22){return function(_0x59758c){if(_0x59758c){return _0x59758c[_0x2897('0x27')]()[_0x2897('0x26')](function(){_0x21fb77[_0x2897('0x1c')](0xcc)[_0x2897('0x1d')]();});}};}function handleEntityNotFound(_0x4857ff,_0x15a823){return function(_0x56da22){if(!_0x56da22){_0x4857ff['sendStatus'](0x194);}return _0x56da22;};}function handleError(_0x4e62ac,_0x37a20e){_0x37a20e=_0x37a20e||0x1f4;return function(_0x55374f){logger[_0x2897('0x28')](_0x55374f['stack']);if(_0x55374f['name']){delete _0x55374f['name'];}_0x4e62ac['status'](_0x37a20e)[_0x2897('0x29')](_0x55374f);};}exports[_0x2897('0x2a')]=function(_0x942599,_0x84bc74){var _0x3bb17d={},_0x8c4c32={},_0x118288={'count':0x0,'rows':[]};var _0x21579f=_[_0x2897('0x2b')](db[_0x2897('0x2c')][_0x2897('0x2d')],function(_0x2623da){return{'name':_0x2623da[_0x2897('0x2e')],'type':_0x2623da[_0x2897('0x2f')]['key']};});_0x8c4c32['model']=_[_0x2897('0x2b')](_0x21579f,_0x2897('0x30'));_0x8c4c32[_0x2897('0x31')]=_[_0x2897('0x32')](_0x942599[_0x2897('0x31')]);_0x8c4c32[_0x2897('0x33')]=_[_0x2897('0x34')](_0x8c4c32['model'],_0x8c4c32[_0x2897('0x31')]);_0x3bb17d['attributes']=_[_0x2897('0x34')](_0x8c4c32[_0x2897('0x35')],qs['fields'](_0x942599['query'][_0x2897('0x36')]));_0x3bb17d[_0x2897('0x37')]=_0x3bb17d['attributes'][_0x2897('0x38')]?_0x3bb17d[_0x2897('0x37')]:_0x8c4c32[_0x2897('0x35')];if(!_0x942599['query']['hasOwnProperty'](_0x2897('0x39'))){_0x3bb17d[_0x2897('0x21')]=qs['limit'](_0x942599[_0x2897('0x31')][_0x2897('0x21')]);_0x3bb17d[_0x2897('0x1f')]=qs[_0x2897('0x1f')](_0x942599[_0x2897('0x31')][_0x2897('0x1f')]);}_0x3bb17d[_0x2897('0x3a')]=qs[_0x2897('0x3b')](_0x942599[_0x2897('0x31')][_0x2897('0x3b')]);_0x3bb17d[_0x2897('0x3c')]=qs[_0x2897('0x33')](_['pick'](_0x942599['query'],_0x8c4c32[_0x2897('0x33')]),_0x21579f);if(_0x942599[_0x2897('0x31')][_0x2897('0x3d')]){_0x3bb17d[_0x2897('0x3c')]=_[_0x2897('0x3e')](_0x3bb17d[_0x2897('0x3c')],{'$or':_[_0x2897('0x2b')](_0x21579f,function(_0x1a49cd){if(_0x1a49cd[_0x2897('0x2f')]!=='VIRTUAL'){var _0x5ded23={};_0x5ded23[_0x1a49cd['name']]={'$like':'%'+_0x942599[_0x2897('0x31')][_0x2897('0x3d')]+'%'};return _0x5ded23;}})});}_0x3bb17d=_[_0x2897('0x3e')]({},_0x3bb17d,_0x942599[_0x2897('0x3f')]);var _0x2b21af={'where':_0x3bb17d['where']};return db[_0x2897('0x2c')][_0x2897('0x22')](_0x2b21af)[_0x2897('0x26')](function(_0x2dc83a){_0x118288[_0x2897('0x22')]=_0x2dc83a;if(_0x942599[_0x2897('0x31')][_0x2897('0x40')]){_0x3bb17d['include']=[{'all':!![]}];}return db[_0x2897('0x2c')][_0x2897('0x41')](_0x3bb17d);})[_0x2897('0x26')](function(_0x5e6993){_0x118288[_0x2897('0x42')]=_0x5e6993;return _0x118288;})['then'](respondWithFilteredResult(_0x84bc74,_0x3bb17d))['catch'](handleError(_0x84bc74,null));};exports[_0x2897('0x43')]=function(_0x53f349,_0x314bba){var _0x1394dc={'raw':!![],'where':{'id':_0x53f349[_0x2897('0x44')]['id']}},_0x604c4c={};_0x604c4c['model']=_[_0x2897('0x32')](db[_0x2897('0x2c')][_0x2897('0x2d')]);_0x604c4c[_0x2897('0x31')]=_['keys'](_0x53f349[_0x2897('0x31')]);_0x604c4c[_0x2897('0x33')]=_[_0x2897('0x34')](_0x604c4c[_0x2897('0x35')],_0x604c4c[_0x2897('0x31')]);_0x1394dc[_0x2897('0x37')]=_[_0x2897('0x34')](_0x604c4c[_0x2897('0x35')],qs[_0x2897('0x36')](_0x53f349[_0x2897('0x31')][_0x2897('0x36')]));_0x1394dc[_0x2897('0x37')]=_0x1394dc['attributes'][_0x2897('0x38')]?_0x1394dc[_0x2897('0x37')]:_0x604c4c['model'];if(_0x53f349[_0x2897('0x31')][_0x2897('0x40')]){_0x1394dc[_0x2897('0x45')]=[{'all':!![]}];}_0x1394dc=_[_0x2897('0x3e')]({},_0x1394dc,_0x53f349['options']);return db['ChatTransferReport'][_0x2897('0x46')](_0x1394dc)[_0x2897('0x26')](handleEntityNotFound(_0x314bba,null))['then'](respondWithResult(_0x314bba,null))['catch'](handleError(_0x314bba,null));};exports[_0x2897('0x47')]=function(_0x39fd1b,_0x563803){return db[_0x2897('0x2c')][_0x2897('0x47')](_0x39fd1b['body'],{})[_0x2897('0x26')](respondWithResult(_0x563803,0xc9))[_0x2897('0x48')](handleError(_0x563803,null));};exports[_0x2897('0x49')]=function(_0x4b4317,_0x248e51){if(_0x4b4317[_0x2897('0x4a')]['id']){delete _0x4b4317['body']['id'];}return db[_0x2897('0x2c')]['find']({'where':{'id':_0x4b4317[_0x2897('0x44')]['id']}})[_0x2897('0x26')](handleEntityNotFound(_0x248e51,null))['then'](saveUpdates(_0x4b4317[_0x2897('0x4a')],null))[_0x2897('0x26')](respondWithResult(_0x248e51,null))[_0x2897('0x48')](handleError(_0x248e51,null));};exports[_0x2897('0x27')]=function(_0x22a301,_0x52a166){return db['ChatTransferReport']['find']({'where':{'id':_0x22a301[_0x2897('0x44')]['id']}})[_0x2897('0x26')](handleEntityNotFound(_0x52a166,null))['then'](removeEntity(_0x52a166,null))[_0x2897('0x48')](handleError(_0x52a166,null));};exports[_0x2897('0x4b')]=function(_0x49cbed,_0x25f9d9){return db[_0x2897('0x2c')][_0x2897('0x4b')]()['then'](respondWithResult(_0x25f9d9,null))[_0x2897('0x48')](handleError(_0x25f9d9,null));};
\ No newline at end of file
+var _0x9714=['attributes','intersection','fields','length','hasOwnProperty','nolimit','where','filters','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','moment','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x9714,0xa8));var _0x4971=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0x9714[_0x37e886];return _0x57c5cd;};'use strict';var emlformat=require(_0x4971('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4971('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4971('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4971('0x3'));var path=require(_0x4971('0x4'));var sox=require(_0x4971('0x5'));var csv=require('to-csv');var ejs=require(_0x4971('0x6'));var fs=require('fs');var fs_extra=require(_0x4971('0x7'));var _=require(_0x4971('0x8'));var squel=require('squel');var crypto=require(_0x4971('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4971('0xa'));var toCsv=require(_0x4971('0xb'));var querystring=require(_0x4971('0xc'));var Papa=require(_0x4971('0xd'));var Redis=require(_0x4971('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4971('0xf'));var as=require(_0x4971('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4971('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x4971('0x12'));var licenseUtil=require(_0x4971('0x13'));var db=require(_0x4971('0x14'))['db'];function respondWithStatusCode(_0xb0a49b,_0x2bc01b){_0x2bc01b=_0x2bc01b||0xcc;return function(_0x472961){if(_0x472961){return _0xb0a49b['sendStatus'](_0x2bc01b);}return _0xb0a49b[_0x4971('0x15')](_0x2bc01b)[_0x4971('0x16')]();};}function respondWithResult(_0x38ef6b,_0x5a7db5){_0x5a7db5=_0x5a7db5||0xc8;return function(_0x169dac){if(_0x169dac){return _0x38ef6b['status'](_0x5a7db5)[_0x4971('0x17')](_0x169dac);}};}function respondWithFilteredResult(_0x43f44f,_0x5c764e){return function(_0x2faa74){if(_0x2faa74){var _0x48e35e=typeof _0x5c764e[_0x4971('0x18')]==='undefined'&&typeof _0x5c764e['limit']===_0x4971('0x19');var _0x591975=_0x2faa74[_0x4971('0x1a')];var _0x2fc12b=_0x48e35e?0x0:_0x5c764e[_0x4971('0x18')];var _0x4676fd=_0x48e35e?_0x2faa74[_0x4971('0x1a')]:_0x5c764e['offset']+_0x5c764e[_0x4971('0x1b')];var _0x4e0103;if(_0x4676fd>=_0x591975){_0x4676fd=_0x591975;_0x4e0103=0xc8;}else{_0x4e0103=0xce;}_0x43f44f[_0x4971('0x15')](_0x4e0103);return _0x43f44f[_0x4971('0x1c')](_0x4971('0x1d'),_0x2fc12b+'-'+_0x4676fd+'/'+_0x591975)[_0x4971('0x17')](_0x2faa74);}return null;};}function patchUpdates(_0x19dda7){return function(_0x9d590d){try{jsonpatch[_0x4971('0x1e')](_0x9d590d,_0x19dda7,!![]);}catch(_0x244011){return BPromise[_0x4971('0x1f')](_0x244011);}return _0x9d590d[_0x4971('0x20')]();};}function saveUpdates(_0x4d0490,_0x36bb51){return function(_0x1f37de){if(_0x1f37de){return _0x1f37de[_0x4971('0x21')](_0x4d0490)[_0x4971('0x22')](function(_0x5cdff0){return _0x5cdff0;});}return null;};}function removeEntity(_0x243ea3,_0x490ce6){return function(_0x1975bc){if(_0x1975bc){return _0x1975bc[_0x4971('0x23')]()[_0x4971('0x22')](function(){_0x243ea3[_0x4971('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ac339,_0x8b0f52){return function(_0x4f32fb){if(!_0x4f32fb){_0x2ac339['sendStatus'](0x194);}return _0x4f32fb;};}function handleError(_0xbfb52b,_0x30dd33){_0x30dd33=_0x30dd33||0x1f4;return function(_0xcf105e){logger[_0x4971('0x24')](_0xcf105e[_0x4971('0x25')]);if(_0xcf105e[_0x4971('0x26')]){delete _0xcf105e[_0x4971('0x26')];}_0xbfb52b[_0x4971('0x15')](_0x30dd33)['send'](_0xcf105e);};}exports[_0x4971('0x27')]=function(_0x29d884,_0x21bfb5){var _0x59de69={},_0x2b697c={},_0x35b2b5={'count':0x0,'rows':[]};var _0x10a116=_[_0x4971('0x28')](db['ChatTransferReport'][_0x4971('0x29')],function(_0x34757c){return{'name':_0x34757c[_0x4971('0x2a')],'type':_0x34757c[_0x4971('0x2b')][_0x4971('0x2c')]};});_0x2b697c[_0x4971('0x2d')]=_[_0x4971('0x28')](_0x10a116,_0x4971('0x26'));_0x2b697c[_0x4971('0x2e')]=_[_0x4971('0x2f')](_0x29d884['query']);_0x2b697c['filters']=_['intersection'](_0x2b697c[_0x4971('0x2d')],_0x2b697c['query']);_0x59de69[_0x4971('0x30')]=_[_0x4971('0x31')](_0x2b697c[_0x4971('0x2d')],qs[_0x4971('0x32')](_0x29d884[_0x4971('0x2e')][_0x4971('0x32')]));_0x59de69[_0x4971('0x30')]=_0x59de69[_0x4971('0x30')][_0x4971('0x33')]?_0x59de69[_0x4971('0x30')]:_0x2b697c['model'];if(!_0x29d884[_0x4971('0x2e')][_0x4971('0x34')](_0x4971('0x35'))){_0x59de69[_0x4971('0x1b')]=qs[_0x4971('0x1b')](_0x29d884[_0x4971('0x2e')][_0x4971('0x1b')]);_0x59de69[_0x4971('0x18')]=qs['offset'](_0x29d884[_0x4971('0x2e')][_0x4971('0x18')]);}_0x59de69['order']=qs['sort'](_0x29d884[_0x4971('0x2e')]['sort']);_0x59de69[_0x4971('0x36')]=qs[_0x4971('0x37')](_['pick'](_0x29d884['query'],_0x2b697c['filters']),_0x10a116);if(_0x29d884[_0x4971('0x2e')][_0x4971('0x38')]){_0x59de69['where']=_[_0x4971('0x39')](_0x59de69[_0x4971('0x36')],{'$or':_[_0x4971('0x28')](_0x10a116,function(_0x54ddbf){if(_0x54ddbf['type']!==_0x4971('0x3a')){var _0x39bcb3={};_0x39bcb3[_0x54ddbf[_0x4971('0x26')]]={'$like':'%'+_0x29d884[_0x4971('0x2e')][_0x4971('0x38')]+'%'};return _0x39bcb3;}})});}_0x59de69=_['merge']({},_0x59de69,_0x29d884[_0x4971('0x3b')]);var _0x17033c={'where':_0x59de69[_0x4971('0x36')]};return db[_0x4971('0x3c')][_0x4971('0x1a')](_0x17033c)[_0x4971('0x22')](function(_0x1307d3){_0x35b2b5[_0x4971('0x1a')]=_0x1307d3;if(_0x29d884['query'][_0x4971('0x3d')]){_0x59de69[_0x4971('0x3e')]=[{'all':!![]}];}return db[_0x4971('0x3c')][_0x4971('0x3f')](_0x59de69);})['then'](function(_0x41a7e3){_0x35b2b5[_0x4971('0x40')]=_0x41a7e3;return _0x35b2b5;})[_0x4971('0x22')](respondWithFilteredResult(_0x21bfb5,_0x59de69))[_0x4971('0x41')](handleError(_0x21bfb5,null));};exports[_0x4971('0x42')]=function(_0x37c962,_0x3771fd){var _0x545fd8={'raw':!![],'where':{'id':_0x37c962['params']['id']}},_0x25418d={};_0x25418d[_0x4971('0x2d')]=_['keys'](db[_0x4971('0x3c')]['rawAttributes']);_0x25418d[_0x4971('0x2e')]=_[_0x4971('0x2f')](_0x37c962[_0x4971('0x2e')]);_0x25418d[_0x4971('0x37')]=_[_0x4971('0x31')](_0x25418d['model'],_0x25418d['query']);_0x545fd8[_0x4971('0x30')]=_[_0x4971('0x31')](_0x25418d['model'],qs['fields'](_0x37c962[_0x4971('0x2e')][_0x4971('0x32')]));_0x545fd8[_0x4971('0x30')]=_0x545fd8['attributes'][_0x4971('0x33')]?_0x545fd8['attributes']:_0x25418d['model'];if(_0x37c962[_0x4971('0x2e')]['includeAll']){_0x545fd8[_0x4971('0x3e')]=[{'all':!![]}];}_0x545fd8=_[_0x4971('0x39')]({},_0x545fd8,_0x37c962[_0x4971('0x3b')]);return db[_0x4971('0x3c')][_0x4971('0x43')](_0x545fd8)[_0x4971('0x22')](handleEntityNotFound(_0x3771fd,null))[_0x4971('0x22')](respondWithResult(_0x3771fd,null))[_0x4971('0x41')](handleError(_0x3771fd,null));};exports['create']=function(_0x26d6d2,_0x5aec79){return db[_0x4971('0x3c')][_0x4971('0x44')](_0x26d6d2[_0x4971('0x45')],{})[_0x4971('0x22')](respondWithResult(_0x5aec79,0xc9))[_0x4971('0x41')](handleError(_0x5aec79,null));};exports['update']=function(_0x274675,_0x16e2c6){if(_0x274675[_0x4971('0x45')]['id']){delete _0x274675['body']['id'];}return db[_0x4971('0x3c')][_0x4971('0x43')]({'where':{'id':_0x274675[_0x4971('0x46')]['id']}})[_0x4971('0x22')](handleEntityNotFound(_0x16e2c6,null))[_0x4971('0x22')](saveUpdates(_0x274675[_0x4971('0x45')],null))[_0x4971('0x22')](respondWithResult(_0x16e2c6,null))['catch'](handleError(_0x16e2c6,null));};exports[_0x4971('0x23')]=function(_0x304bd2,_0x5f3bb0){return db[_0x4971('0x3c')][_0x4971('0x43')]({'where':{'id':_0x304bd2['params']['id']}})[_0x4971('0x22')](handleEntityNotFound(_0x5f3bb0,null))[_0x4971('0x22')](removeEntity(_0x5f3bb0,null))['catch'](handleError(_0x5f3bb0,null));};exports[_0x4971('0x47')]=function(_0x44500c,_0x4a99ff){return db[_0x4971('0x3c')][_0x4971('0x47')]()[_0x4971('0x22')](respondWithResult(_0x4a99ff,null))['catch'](handleError(_0x4a99ff,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index db30f08..eb34ec9 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 _0x6106=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x721852,_0x3fceef){var _0x5d4ed0=function(_0x880af5){while(--_0x880af5){_0x721852['push'](_0x721852['shift']());}};_0x5d4ed0(++_0x3fceef);}(_0x6106,0x129));var _0x6610=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x6106[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x6610('0x0'));var util=require(_0x6610('0x1'));var logger=require(_0x6610('0x2'))(_0x6610('0x3'));var moment=require(_0x6610('0x4'));var BPromise=require(_0x6610('0x5'));var rp=require(_0x6610('0x6'));var fs=require('fs');var path=require(_0x6610('0x7'));var rimraf=require(_0x6610('0x8'));var config=require(_0x6610('0x9'));var attributes=require(_0x6610('0xa'));module[_0x6610('0xb')]=function(_0x1776ca,_0x51b4e5){return _0x1776ca[_0x6610('0xc')](_0x6610('0xd'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6610('0xe'),'fields':[_0x6610('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd51e=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x29d82d,_0x3a5623){var _0xf9d8a1=function(_0x443097){while(--_0x443097){_0x29d82d['push'](_0x29d82d['shift']());}};_0xf9d8a1(++_0x3a5623);}(_0xd51e,0x7e));var _0xed51=function(_0x57b35d,_0x229c1d){_0x57b35d=_0x57b35d-0x0;var _0x3fb76e=_0xd51e[_0x57b35d];return _0x3fb76e;};'use strict';var _=require(_0xed51('0x0'));var util=require(_0xed51('0x1'));var logger=require(_0xed51('0x2'))(_0xed51('0x3'));var moment=require(_0xed51('0x4'));var BPromise=require(_0xed51('0x5'));var rp=require(_0xed51('0x6'));var fs=require('fs');var path=require(_0xed51('0x7'));var rimraf=require('rimraf');var config=require(_0xed51('0x8'));var attributes=require(_0xed51('0x9'));module[_0xed51('0xa')]=function(_0x3baea0,_0x150528){return _0x3baea0[_0xed51('0xb')](_0xed51('0xc'),attributes,{'tableName':_0xed51('0xd'),'paranoid':![],'indexes':[{'name':_0xed51('0xe'),'fields':[_0xed51('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 5dca2fc..b7d4e30 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 _0x0cbb=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x0cbb,0x16f));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb0cb('0x0'));var util=require(_0xb0cb('0x1'));var moment=require(_0xb0cb('0x2'));var BPromise=require(_0xb0cb('0x3'));var rs=require(_0xb0cb('0x4'));var fs=require('fs');var Redis=require(_0xb0cb('0x5'));var db=require(_0xb0cb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0cb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb0cb('0x8'));var client=jayson[_0xb0cb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c8c76,_0x30244b,_0x3f472d){return new BPromise(function(_0x45d22e,_0x18dc1a){return client['request'](_0x2c8c76,_0x3f472d)[_0xb0cb('0xa')](function(_0x104915){logger[_0xb0cb('0xb')](_0xb0cb('0xc'),_0x30244b,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x30244b,_0xb0cb('0xd'),JSON['stringify'](_0x104915));if(_0x104915[_0xb0cb('0xe')]){if(_0x104915[_0xb0cb('0xe')][_0xb0cb('0xf')]===0x1f4){logger['error'](_0xb0cb('0xc'),_0x30244b,_0x104915['error']['message']);return _0x18dc1a(_0x104915[_0xb0cb('0xe')][_0xb0cb('0x10')]);}logger[_0xb0cb('0xe')](_0xb0cb('0xc'),_0x30244b,_0x104915[_0xb0cb('0xe')][_0xb0cb('0x10')]);return _0x45d22e(_0x104915['error'][_0xb0cb('0x10')]);}else{logger[_0xb0cb('0xb')](_0xb0cb('0xc'),_0x30244b,'request\x20sent');_0x45d22e(_0x104915['result'][_0xb0cb('0x10')]);}})[_0xb0cb('0x11')](function(_0x26f23f){logger['error'](_0xb0cb('0xc'),_0x30244b,_0x26f23f);_0x18dc1a(_0x26f23f);});});}
\ No newline at end of file
+var _0x8bc2=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1c1852,_0x376b11){var _0x47ec77=function(_0x5a073e){while(--_0x5a073e){_0x1c1852['push'](_0x1c1852['shift']());}};_0x47ec77(++_0x376b11);}(_0x8bc2,0xe0));var _0x28bc=function(_0x50fac7,_0x338b99){_0x50fac7=_0x50fac7-0x0;var _0x4983de=_0x8bc2[_0x50fac7];return _0x4983de;};'use strict';var _=require(_0x28bc('0x0'));var util=require(_0x28bc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28bc('0x2'));var db=require(_0x28bc('0x3'))['db'];var utils=require(_0x28bc('0x4'));var logger=require(_0x28bc('0x5'))(_0x28bc('0x6'));var config=require(_0x28bc('0x7'));var jayson=require(_0x28bc('0x8'));var client=jayson[_0x28bc('0x9')][_0x28bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15d9f1,_0x559fad,_0x2f2250){return new BPromise(function(_0x25bfcf,_0xe21cd3){return client[_0x28bc('0xb')](_0x15d9f1,_0x2f2250)[_0x28bc('0xc')](function(_0x30cd1a){logger[_0x28bc('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x559fad,_0x28bc('0xe'));logger['debug'](_0x28bc('0xf'),_0x559fad,_0x28bc('0xe'),JSON['stringify'](_0x30cd1a));if(_0x30cd1a[_0x28bc('0x10')]){if(_0x30cd1a[_0x28bc('0x10')]['code']===0x1f4){logger[_0x28bc('0x10')](_0x28bc('0x11'),_0x559fad,_0x30cd1a[_0x28bc('0x10')][_0x28bc('0x12')]);return _0xe21cd3(_0x30cd1a[_0x28bc('0x10')][_0x28bc('0x12')]);}logger[_0x28bc('0x10')](_0x28bc('0x11'),_0x559fad,_0x30cd1a[_0x28bc('0x10')][_0x28bc('0x12')]);return _0x25bfcf(_0x30cd1a[_0x28bc('0x10')][_0x28bc('0x12')]);}else{logger[_0x28bc('0xd')](_0x28bc('0x11'),_0x559fad,'request\x20sent');_0x25bfcf(_0x30cd1a[_0x28bc('0x13')][_0x28bc('0x12')]);}})[_0x28bc('0x14')](function(_0x16c019){logger['error'](_0x28bc('0x11'),_0x559fad,_0x16c019);_0xe21cd3(_0x16c019);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 9fe1835..ccc66d4 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 _0xe08f=['post','create','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x44989b,_0x1824e8){var _0x1c771c=function(_0xbbfbac){while(--_0xbbfbac){_0x44989b['push'](_0x44989b['shift']());}};_0x1c771c(++_0x1824e8);}(_0xe08f,0x17a));var _0xfe08=function(_0x287af7,_0x241f71){_0x287af7=_0x287af7-0x0;var _0x3dedb8=_0xe08f[_0x287af7];return _0x3dedb8;};'use strict';var multer=require(_0xfe08('0x0'));var util=require(_0xfe08('0x1'));var path=require('path');var timeout=require(_0xfe08('0x2'));var express=require('express');var router=express[_0xfe08('0x3')]();var fs_extra=require(_0xfe08('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe08('0x5'));var config=require('../../config/environment');var controller=require(_0xfe08('0x6'));router[_0xfe08('0x7')]('/',auth[_0xfe08('0x8')](),controller['index']);router['get'](_0xfe08('0x9'),auth[_0xfe08('0x8')](),controller[_0xfe08('0xa')]);router[_0xfe08('0x7')](_0xfe08('0xb'),auth[_0xfe08('0x8')](),controller[_0xfe08('0xc')]);router[_0xfe08('0xd')]('/',auth[_0xfe08('0x8')](),controller[_0xfe08('0xe')]);router['put'](_0xfe08('0xb'),auth['isAuthenticated'](),controller[_0xfe08('0xf')]);router['delete'](_0xfe08('0xb'),auth[_0xfe08('0x8')](),controller['destroy']);module[_0xfe08('0x10')]=router;
\ No newline at end of file
+var _0xa06f=['../../config/environment','get','index','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2b0ae1,_0x258625){var _0x2bfcb9=function(_0x306c6f){while(--_0x306c6f){_0x2b0ae1['push'](_0x2b0ae1['shift']());}};_0x2bfcb9(++_0x258625);}(_0xa06f,0x12a));var _0xfa06=function(_0x448b8a,_0x4b8ccc){_0x448b8a=_0x448b8a-0x0;var _0x17e781=_0xa06f[_0x448b8a];return _0x17e781;};'use strict';var multer=require(_0xfa06('0x0'));var util=require(_0xfa06('0x1'));var path=require('path');var timeout=require(_0xfa06('0x2'));var express=require(_0xfa06('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfa06('0x4'));var interaction=require(_0xfa06('0x5'));var config=require(_0xfa06('0x6'));var controller=require('./chatTransferReport.controller');router[_0xfa06('0x7')]('/',auth['isAuthenticated'](),controller[_0xfa06('0x8')]);router[_0xfa06('0x7')](_0xfa06('0x9'),auth[_0xfa06('0xa')](),controller['describe']);router['get'](_0xfa06('0xb'),auth[_0xfa06('0xa')](),controller['show']);router[_0xfa06('0xc')]('/',auth[_0xfa06('0xa')](),controller[_0xfa06('0xd')]);router[_0xfa06('0xe')]('/:id',auth[_0xfa06('0xa')](),controller[_0xfa06('0xf')]);router[_0xfa06('0x10')](_0xfa06('0xb'),auth[_0xfa06('0xa')](),controller[_0xfa06('0x11')]);module[_0xfa06('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 780c5bb..0ec6b2c 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 _0xead1=['STRING','address','email','Agent','#011F6A','INTEGER','ENUM','rounded','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports'];(function(_0x4ec6db,_0x393d10){var _0x5b46fc=function(_0x18d087){while(--_0x18d087){_0x4ec6db['push'](_0x4ec6db['shift']());}};_0x5b46fc(++_0x393d10);}(_0xead1,0x129));var _0x1ead=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xead1[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x1ead('0x0'));var rs=require(_0x1ead('0x1'));module[_0x1ead('0x2')]={'name':{'type':Sequelize[_0x1ead('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x1ead('0x3')],'allowNull':![],'unique':_0x1ead('0x4')},'description':{'type':Sequelize[_0x1ead('0x3')]},'mapKey':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x5')},'mapKeyOffline':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x6')},'customerAlias':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ead('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ead('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1ead('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1ead('0x9')](_0x1ead('0xa'),'squared'),'defaultValue':_0x1ead('0xa')},'header_online':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xb')},'start_chat_button':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xc')},'offline_chat_button':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xd')},'download_transcript':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1ead('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1ead('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x12')},'noteTitle':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x13')},'placeholderMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x14')},'closingMessageButton':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x15')},'skipMessageButton':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x16')},'conditionAgreement':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x17')},'ratingType':{'type':Sequelize[_0x1ead('0x9')](_0x1ead('0x18'),_0x1ead('0x19')),'defaultValue':_0x1ead('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1ead('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1ead('0x1a'),'variable':null,'config':{'placeholder':_0x1ead('0x1b'),'type':_0x1ead('0x1c'),'required':!![]},'props':{'title':_0x1ead('0x1b'),'helpText':''}},{'type':_0x1ead('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x1ead('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1ead('0x1d')]('onlineForm')?JSON['parse'](this[_0x1ead('0x1d')](_0x1ead('0x1e'))):{};},'set':function(_0x5a56b1){return this[_0x1ead('0x1f')]('onlineForm',JSON[_0x1ead('0x20')](_0x5a56b1));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1ead('0x20')]({'items':[{'type':_0x1ead('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1ead('0x5'),'type':_0x1ead('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x1ead('0x21'),'helpText':_0x1ead('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x1ead('0x1d')](_0x1ead('0x23'))?JSON['parse'](this[_0x1ead('0x1d')](_0x1ead('0x23'))):{};},'set':function(_0x244b1a){return this['setDataValue'](_0x1ead('0x23'),JSON[_0x1ead('0x20')](_0x244b1a));}},'token':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1ead('0x3')]},'waitingTitle':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x24')},'waitingMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1ead('0x16')},'sendUnmanaged':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1ead('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1ead('0x10')],'defaultValue':function(){return _0x1ead('0x28');}},'notificationSound':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1ead('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x2a')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x1ead('0x2b')},'defaultTitle':{'type':Sequelize[_0x1ead('0x3')]},'customerAvatar':{'type':Sequelize[_0x1ead('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1ead('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x2c')},'systemAvatar':{'type':Sequelize[_0x1ead('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1ead('0x8')],'comment':_0x1ead('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![],'comment':_0x1ead('0x2e'),'set':function(_0x5645bd){if(!_0x5645bd)this[_0x1ead('0x1f')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x1ead('0x2f'),_0x5645bd);}},'vidaooEscalation':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1ead('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ead('0x30')},'vidaooNote':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':function(){return _0x1ead('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1ead('0x10')]}};
\ No newline at end of file
+var _0x70c8=['parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','name','text','input','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm'];(function(_0xe66337,_0xb5c585){var _0x1a6d47=function(_0x2d260b){while(--_0x2d260b){_0xe66337['push'](_0xe66337['shift']());}};_0x1a6d47(++_0xb5c585);}(_0x70c8,0x196));var _0x870c=function(_0x240eee,_0x565a46){_0x240eee=_0x240eee-0x0;var _0xbc0fd6=_0x70c8[_0x240eee];return _0xbc0fd6;};'use strict';var Sequelize=require(_0x870c('0x0'));var rs=require(_0x870c('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x870c('0x2')]},'mapKey':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x3')},'mapKeyOffline':{'type':Sequelize[_0x870c('0x2')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x4')},'customerAlias':{'type':Sequelize[_0x870c('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'defaultValue':_0x870c('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'defaultValue':_0x870c('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x870c('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x870c('0x2')]},'animation':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x870c('0x9')](_0x870c('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0xc')},'offline_chat_button':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xd')},'header_offline':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xe')},'download_transcript':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x870c('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x870c('0x10')]},'closingQuestion':{'type':Sequelize[_0x870c('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x12')},'noteTitle':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x13')},'placeholderMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x15')},'closingMessageButton':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xd')},'skipMessageButton':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x16')},'conditionAgreement':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x17')},'ratingType':{'type':Sequelize[_0x870c('0x9')]('star','thumb'),'defaultValue':_0x870c('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x870c('0x10')],'defaultValue':function(){return JSON[_0x870c('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x870c('0x1a'),'type':_0x870c('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x870c('0x1c'),'props':{'title':_0x870c('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x870c('0x3'),'type':_0x870c('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue'](_0x870c('0x1d'))):{};},'set':function(_0x4d7e6a){return this[_0x870c('0x1e')](_0x870c('0x1d'),JSON[_0x870c('0x19')](_0x4d7e6a));}},'offlineForm':{'type':Sequelize[_0x870c('0x10')],'defaultValue':function(){return JSON[_0x870c('0x19')]({'items':[{'type':_0x870c('0x1c'),'props':{'title':_0x870c('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x870c('0x3'),'type':'email'},'variable':null},{'type':_0x870c('0x1f'),'config':{'placeholder':_0x870c('0x20')},'props':{'title':_0x870c('0x20'),'helpText':_0x870c('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x870c('0x22'))?JSON[_0x870c('0x23')](this['getDataValue'](_0x870c('0x22'))):{};},'set':function(_0x3d4f56){return this[_0x870c('0x1e')](_0x870c('0x22'),JSON[_0x870c('0x19')](_0x3d4f56));}},'token':{'type':Sequelize[_0x870c('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x870c('0x2')]},'forwardOffline':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x870c('0x2')]},'waitingTitle':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x24')},'waitingMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x27')},'skipUnmanaged':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x16')},'sendUnmanaged':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x870c('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x870c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x870c('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x870c('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x870c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x2a')},'messagesAlignment':{'type':Sequelize[_0x870c('0x2')],'defaultValue':_0x870c('0x2b')},'defaultTitle':{'type':Sequelize[_0x870c('0x2')]},'customerAvatar':{'type':Sequelize[_0x870c('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x870c('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x870c('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x870c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x870c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x870c('0x2d')},'systemAvatar':{'type':Sequelize[_0x870c('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x870c('0x7')],'comment':_0x870c('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![],'comment':_0x870c('0x2f'),'set':function(_0x3d0a47){if(!_0x3d0a47)this[_0x870c('0x1e')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x870c('0x30'),_0x3d0a47);}},'vidaooEscalation':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x870c('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x870c('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x870c('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x870c('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 2c32eaa..7d017fe 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 _0xb10b=['removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','get','UserProfileResource','stack','name','index','map','ChatWebsite','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','findAll','rows','mandatoryDispositionPause','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','Pause','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','asc','defaults','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','referer','browser','version','format','%s\x20%s','unknown','device','threadId','ChatInteraction','ContactId','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','describe','ListId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','labelText','textColor','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit'];(function(_0x267a7f,_0x49ebfc){var _0x341f37=function(_0x178ac8){while(--_0x178ac8){_0x267a7f['push'](_0x267a7f['shift']());}};_0x341f37(++_0x49ebfc);}(_0xb10b,0x12a));var _0xbb10=function(_0x39686e,_0x3d83bb){_0x39686e=_0x39686e-0x0;var _0x1b765e=_0xb10b[_0x39686e];return _0x1b765e;};'use strict';var BPromise=require(_0xbb10('0x0'));var Mustache=require('mustache');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var ejs=require(_0xbb10('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb10('0x4'));var querystring=require(_0xbb10('0x5'));var Redis=require(_0xbb10('0x6'));var qs=require(_0xbb10('0x7'));var logger=require(_0xbb10('0x8'))(_0xbb10('0x9'));var config=require('../../config/environment');var db=require(_0xbb10('0xa'))['db'];config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);var htmlToText=require(_0xbb10('0x10'));var jayson=require(_0xbb10('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xbb10('0x12')][_0xbb10('0x13')]({'port':0x232a});var client9003=jayson[_0xbb10('0x12')]['http']({'port':0x232b});var client9001=jayson[_0xbb10('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x44fb19,_0x916a32,_0x285009,_0x193a27){return new BPromise(function(_0x442548,_0x147230){var _0x58a612=_0x193a27||client;return _0x58a612[_0xbb10('0x14')](_0x44fb19,_0x285009)[_0xbb10('0x15')](function(_0x45b9d6){logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));logger[_0xbb10('0x19')](_0xbb10('0x1a'),_0x916a32,_0xbb10('0x18'),JSON[_0xbb10('0x1b')](_0x45b9d6));if(_0x45b9d6['error']){if(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1d')]===0x1f4){logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);return _0x147230(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6['error'][_0xbb10('0x1e')]);return _0x442548(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}else{logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));_0x442548(_0x45b9d6['result'][_0xbb10('0x1e')]);}})[_0xbb10('0x1f')](function(_0x50aea1){logger['error'](_0xbb10('0x17'),_0x916a32,_0x50aea1);_0x147230(_0x50aea1);});});}function respondWithStatusCode(_0x311abe,_0x2e911d){_0x2e911d=_0x2e911d||0xcc;return function(_0x317da4){if(_0x317da4){return _0x311abe[_0xbb10('0x20')](_0x2e911d);}return _0x311abe[_0xbb10('0x21')](_0x2e911d)[_0xbb10('0x22')]();};}function respondWithResult(_0x436104,_0x7f2377){_0x7f2377=_0x7f2377||0xc8;return function(_0x395404){if(_0x395404){return _0x436104[_0xbb10('0x21')](_0x7f2377)[_0xbb10('0x23')](_0x395404);}};}function respondWithFilteredResult(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(_0x4fb5e0){var _0xc93a04=typeof _0x4fedac[_0xbb10('0x24')]===_0xbb10('0x25')&&typeof _0x4fedac['limit']===_0xbb10('0x25');var _0x24d586=_0x4fb5e0[_0xbb10('0x26')];var _0x1d5e95=_0xc93a04?0x0:_0x4fedac[_0xbb10('0x24')];var _0x20d946=_0xc93a04?_0x4fb5e0[_0xbb10('0x26')]:_0x4fedac['offset']+_0x4fedac[_0xbb10('0x27')];var _0x21ac54;if(_0x20d946>=_0x24d586){_0x20d946=_0x24d586;_0x21ac54=0xc8;}else{_0x21ac54=0xce;}_0x537898[_0xbb10('0x21')](_0x21ac54);return _0x537898[_0xbb10('0x28')](_0xbb10('0x29'),_0x1d5e95+'-'+_0x20d946+'/'+_0x24d586)[_0xbb10('0x23')](_0x4fb5e0);}return null;};}function saveUpdates(_0x5d5c80){return function(_0x221624){if(_0x221624){return _0x221624['update'](_0x5d5c80)[_0xbb10('0x15')](function(_0x56f2da){return _0x56f2da;});}return null;};}function removeEntity(_0x16ad2a){return function(_0x1dcc9c){if(_0x1dcc9c){return _0x1dcc9c[_0xbb10('0x2a')]()['then'](function(){var _0x518d47=_0x1dcc9c[_0xbb10('0x2b')]({'plain':!![]});var _0x34f65e='ChatWebsites';return db[_0xbb10('0x2c')][_0xbb10('0x2a')]({'where':{'type':_0x34f65e,'resourceId':_0x518d47['id']}})[_0xbb10('0x15')](function(){return _0x1dcc9c;});})[_0xbb10('0x15')](function(){_0x16ad2a[_0xbb10('0x21')](0xcc)[_0xbb10('0x22')]();});}};}function handleEntityNotFound(_0xf85197){return function(_0x4975f5){if(!_0x4975f5){_0xf85197[_0xbb10('0x20')](0x194);}return _0x4975f5;};}function handleError(_0x1da9c9,_0x441d15){_0x441d15=_0x441d15||0x1f4;return function(_0x8c1ce6){logger[_0xbb10('0x1c')](_0x8c1ce6[_0xbb10('0x2d')]);if(_0x8c1ce6[_0xbb10('0x2e')]){delete _0x8c1ce6[_0xbb10('0x2e')];}_0x1da9c9[_0xbb10('0x21')](_0x441d15)['send'](_0x8c1ce6);};}exports[_0xbb10('0x2f')]=function(_0x150107,_0x1ddd9e){var _0x3c3c45={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x570f5a={},_0x111762={'count':0x0,'rows':[]};var _0x3eb3cc=_[_0xbb10('0x30')](db[_0xbb10('0x31')][_0xbb10('0x32')],function(_0x15d895){return{'name':_0x15d895[_0xbb10('0x33')],'type':_0x15d895['type'][_0xbb10('0x34')]};});_0x570f5a[_0xbb10('0x35')]=_['map'](_0x3eb3cc,'name');_0x570f5a['query']=_[_0xbb10('0x36')](_0x150107[_0xbb10('0x37')]);_0x570f5a[_0xbb10('0x38')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],_0x570f5a[_0xbb10('0x37')]);_0x3c3c45[_0xbb10('0x39')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3c3c45['attributes']=_0x3c3c45[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x3c3c45['attributes']:_0x570f5a[_0xbb10('0x35')];if(!_0x150107[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x3c3c45[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x150107['query'][_0xbb10('0x27')]);_0x3c3c45[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x150107[_0xbb10('0x37')]['offset']);}_0x3c3c45[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x3c3c45['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x150107['query'],_0x570f5a['filters']),_0x3eb3cc);if(_0x150107[_0xbb10('0x37')]['filter']){_0x3c3c45[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3c3c45['where'],{'$or':_[_0xbb10('0x30')](_0x3eb3cc,function(_0x1d82bf){if(_0x1d82bf[_0xbb10('0x43')]!=='VIRTUAL'){var _0x2dd02b={};_0x2dd02b[_0x1d82bf[_0xbb10('0x2e')]]={'$like':'%'+_0x150107[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2dd02b;}})});}_0x3c3c45=_[_0xbb10('0x42')]({},_0x3c3c45,_0x150107[_0xbb10('0x45')]);var _0x190781={'where':_0x3c3c45[_0xbb10('0x41')]};return db[_0xbb10('0x31')][_0xbb10('0x26')](_0x190781)[_0xbb10('0x15')](function(_0x1eadd2){_0x111762['count']=_0x1eadd2;if(_0x150107[_0xbb10('0x37')][_0xbb10('0x46')]){_0x3c3c45['include']=[{'all':!![]}];}return db[_0xbb10('0x31')][_0xbb10('0x47')](_0x3c3c45);})[_0xbb10('0x15')](function(_0x5a5226){_0x111762[_0xbb10('0x48')]=_0x5a5226;return _0x111762;})[_0xbb10('0x15')](respondWithFilteredResult(_0x1ddd9e,_0x3c3c45))[_0xbb10('0x1f')](handleError(_0x1ddd9e,null));};exports['show']=function(_0x4a9793,_0xcb3354){var _0x76a208={'raw':![],'where':{'id':_0x4a9793['params']['id']},'include':[{'model':db['Pause'],'as':_0xbb10('0x49')}]},_0x2b12bd={};_0x2b12bd[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x31')][_0xbb10('0x32')]);_0x2b12bd[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x4a9793[_0xbb10('0x37')]);_0x2b12bd[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x2b12bd['model'],_0x2b12bd['query']);_0x76a208[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x2b12bd[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x4a9793[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x76a208[_0xbb10('0x39')]=_0x76a208[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x76a208[_0xbb10('0x39')]:_0x2b12bd[_0xbb10('0x35')];if(_0x4a9793[_0xbb10('0x37')][_0xbb10('0x46')]){_0x76a208[_0xbb10('0x4b')]=[{'all':!![]}];}_0x76a208=_[_0xbb10('0x42')]({},_0x76a208,_0x4a9793['options']);return db[_0xbb10('0x31')]['find'](_0x76a208)[_0xbb10('0x15')](handleEntityNotFound(_0xcb3354,null))[_0xbb10('0x15')](respondWithResult(_0xcb3354,null))[_0xbb10('0x1f')](handleError(_0xcb3354,null));};exports[_0xbb10('0x4c')]=function(_0x26e66e,_0x32d8e9){return db[_0xbb10('0x31')][_0xbb10('0x4c')](_0x26e66e[_0xbb10('0x4d')],{})[_0xbb10('0x15')](function(_0x44a056){var _0x1c2dce=_0x26e66e[_0xbb10('0x4e')][_0xbb10('0x2b')]({'plain':!![]});if(!_0x1c2dce)throw new Error(_0xbb10('0x4f'));if(_0x1c2dce['role']===_0xbb10('0x4e')){var _0x466eb7=_0x44a056[_0xbb10('0x2b')]({'plain':!![]});var _0x4ce8e7=_0xbb10('0x50');return db[_0xbb10('0x51')]['find']({'where':{'name':_0x4ce8e7,'userProfileId':_0x1c2dce[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x15')](function(_0x2909a1){if(_0x2909a1&&_0x2909a1[_0xbb10('0x53')]===0x0){return db[_0xbb10('0x2c')][_0xbb10('0x4c')]({'name':_0x466eb7[_0xbb10('0x2e')],'resourceId':_0x466eb7['id'],'type':_0x2909a1[_0xbb10('0x2e')],'sectionId':_0x2909a1['id']},{})[_0xbb10('0x15')](function(){return _0x44a056;});}else{return _0x44a056;}})[_0xbb10('0x1f')](function(_0x2eb05a){logger[_0xbb10('0x1c')](_0xbb10('0x54'),_0x2eb05a);throw _0x2eb05a;});}return _0x44a056;})['then'](respondWithResult(_0x32d8e9,0xc9))['catch'](handleError(_0x32d8e9,null));};exports[_0xbb10('0x55')]=function(_0x3e6338,_0x3d0cb7){if(_0x3e6338[_0xbb10('0x4d')]['id']){delete _0x3e6338['body']['id'];}return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x3e6338[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x58')],'as':_0xbb10('0x49')}]})[_0xbb10('0x15')](handleEntityNotFound(_0x3d0cb7,null))[_0xbb10('0x15')](saveUpdates(_0x3e6338[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x3d0cb7,null))[_0xbb10('0x1f')](handleError(_0x3d0cb7,null));};exports[_0xbb10('0x2a')]=function(_0x4917a5,_0x5e03cb){return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x4917a5[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5e03cb,null))['then'](removeEntity(_0x5e03cb,null))['catch'](handleError(_0x5e03cb,null));};exports['describe']=function(_0x3ebc5f,_0x249b33){return db[_0xbb10('0x31')]['describe']()[_0xbb10('0x15')](respondWithResult(_0x249b33,null))[_0xbb10('0x1f')](handleError(_0x249b33,null));};exports['addDisposition']=function(_0x4a560c,_0x27d7b9){if(_0x4a560c[_0xbb10('0x4d')]['id']){delete _0x4a560c[_0xbb10('0x4d')]['id'];}return db[_0xbb10('0x31')]['find']({'where':{'id':_0x4a560c[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x27d7b9,null))[_0xbb10('0x15')](function(_0x5202d7){if(_0x5202d7){_0x4a560c[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x5202d7['id'];return db[_0xbb10('0x5a')]['create'](_0x4a560c[_0xbb10('0x4d')]);}})[_0xbb10('0x15')](respondWithResult(_0x27d7b9,null))[_0xbb10('0x1f')](handleError(_0x27d7b9,null));};exports[_0xbb10('0x5b')]=function(_0x5e4a6e,_0x251417){var _0x258e55={'raw':![],'where':{}};var _0x108e5b={};var _0x2d0f4b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x5e4a6e[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x251417,null))[_0xbb10('0x15')](function(_0x12f750){if(_0x12f750){_0x108e5b[_0xbb10('0x35')]=_[_0xbb10('0x36')](db['Disposition']['rawAttributes']);_0x108e5b['query']=_[_0xbb10('0x36')](_0x5e4a6e[_0xbb10('0x37')]);_0x108e5b[_0xbb10('0x38')]=_['intersection'](_0x108e5b['model'],_0x108e5b[_0xbb10('0x37')]);_0x258e55[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x108e5b[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x5e4a6e[_0xbb10('0x37')]['fields']));_0x258e55[_0xbb10('0x39')]=_0x258e55[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x258e55[_0xbb10('0x39')]:_0x108e5b[_0xbb10('0x35')];if(!_0x5e4a6e['query']['hasOwnProperty']('nolimit')){_0x258e55[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x27')]);_0x258e55[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x5e4a6e['query'][_0xbb10('0x24')]);}_0x258e55['order']=qs['sort'](_0x5e4a6e['query'][_0xbb10('0x3f')]);_0x258e55[_0xbb10('0x41')]=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x5e4a6e['query'],_0x108e5b[_0xbb10('0x38')]));_0x258e55['where']['ChatWebsiteId']=_0x12f750['id'];if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]){_0x258e55[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x258e55[_0xbb10('0x41')],{'$or':_['map'](_0x258e55[_0xbb10('0x39')],function(_0x19fcec){var _0x2c6429={};_0x2c6429[_0x19fcec]={'$like':'%'+_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2c6429;})});}_0x258e55=_[_0xbb10('0x42')]({},_0x258e55,_0x5e4a6e[_0xbb10('0x45')]);return db['Disposition'][_0xbb10('0x26')]({'where':_0x258e55[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x322b41){_0x2d0f4b[_0xbb10('0x26')]=_0x322b41;if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x46')]){_0x258e55[_0xbb10('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0xbb10('0x47')](_0x258e55);})[_0xbb10('0x15')](function(_0x145baf){_0x2d0f4b['rows']=_0x145baf;return _0x2d0f4b;});}})['then'](respondWithFilteredResult(_0x251417,_0x258e55))['catch'](handleError(_0x251417,null));};exports[_0xbb10('0x5d')]=function(_0x5a3c44,_0x4e3d6a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5a3c44[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4e3d6a,null))[_0xbb10('0x15')](function(_0x24dca6){if(_0x24dca6){return _0x24dca6[_0xbb10('0x5d')](_0x5a3c44[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x4e3d6a,null))[_0xbb10('0x1f')](handleError(_0x4e3d6a,null));};exports[_0xbb10('0x5f')]=function(_0x46b6d2,_0x35b811){if(_0x46b6d2['body']['id']){delete _0x46b6d2['body']['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x46b6d2[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x35b811,null))['then'](function(_0x17d596){if(_0x17d596){_0x46b6d2[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x17d596['id'];return db[_0xbb10('0x60')][_0xbb10('0x4c')](_0x46b6d2['body']);}})['then'](respondWithResult(_0x35b811,null))[_0xbb10('0x1f')](handleError(_0x35b811,null));};exports[_0xbb10('0x61')]=function(_0x22c030,_0x5239da){var _0x256b35={'raw':![],'where':{}};var _0x13e2ab={};var _0x50bcc9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x22c030[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5239da,null))['then'](function(_0x32d5a5){if(_0x32d5a5){_0x13e2ab[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x60')][_0xbb10('0x32')]);_0x13e2ab[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x22c030[_0xbb10('0x37')]);_0x13e2ab[_0xbb10('0x38')]=_['intersection'](_0x13e2ab[_0xbb10('0x35')],_0x13e2ab[_0xbb10('0x37')]);_0x256b35[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x13e2ab[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x256b35[_0xbb10('0x39')]=_0x256b35[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x256b35[_0xbb10('0x39')]:_0x13e2ab['model'];if(!_0x22c030['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x256b35[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x22c030[_0xbb10('0x37')]['limit']);_0x256b35[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x256b35[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x22c030['query'][_0xbb10('0x3f')]);_0x256b35[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x22c030['query'],_0x13e2ab[_0xbb10('0x38')]));_0x256b35[_0xbb10('0x41')][_0xbb10('0x59')]=_0x32d5a5['id'];if(_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]){_0x256b35['where']=_[_0xbb10('0x42')](_0x256b35['where'],{'$or':_[_0xbb10('0x30')](_0x256b35[_0xbb10('0x39')],function(_0x5d767f){var _0x5aaa20={};_0x5aaa20[_0x5d767f]={'$like':'%'+_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5aaa20;})});}_0x256b35=_[_0xbb10('0x42')]({},_0x256b35,_0x22c030[_0xbb10('0x45')]);return db[_0xbb10('0x60')][_0xbb10('0x26')]({'where':_0x256b35[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x252ab8){_0x50bcc9[_0xbb10('0x26')]=_0x252ab8;if(_0x22c030[_0xbb10('0x37')]['includeAll']){_0x256b35[_0xbb10('0x4b')]=[{'all':!![]}];}return db[_0xbb10('0x60')][_0xbb10('0x47')](_0x256b35);})[_0xbb10('0x15')](function(_0xfe02f5){_0x50bcc9[_0xbb10('0x48')]=_0xfe02f5;return _0x50bcc9;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x5239da,_0x256b35))[_0xbb10('0x1f')](handleError(_0x5239da,null));};exports[_0xbb10('0x62')]=function(_0x18a136,_0x1c4235){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x18a136[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c4235,null))[_0xbb10('0x15')](function(_0x3675cd){if(_0x3675cd){return _0x3675cd[_0xbb10('0x62')](_0x18a136[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x1c4235,null))[_0xbb10('0x1f')](handleError(_0x1c4235,null));};exports[_0xbb10('0x63')]=function(_0x44d1d2,_0x12e89d){_0x44d1d2[_0xbb10('0x4d')][_0xbb10('0x64')]=_0x44d1d2['file']['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x44d1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x12e89d,null))[_0xbb10('0x15')](saveUpdates(_0x44d1d2[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x12e89d,null))[_0xbb10('0x1f')](handleError(_0x12e89d,null));};exports[_0xbb10('0x65')]=function(_0x5642c3,_0xdd3c7e){_0x5642c3['body'][_0xbb10('0x66')]=_0x5642c3[_0xbb10('0x67')]['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5642c3['params']['id']}})['then'](handleEntityNotFound(_0xdd3c7e,null))[_0xbb10('0x15')](saveUpdates(_0x5642c3[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xdd3c7e,null))[_0xbb10('0x1f')](handleError(_0xdd3c7e,null));};exports[_0xbb10('0x68')]=function(_0x4c3bdc,_0xe7c0a3){_0x4c3bdc[_0xbb10('0x4d')][_0xbb10('0x69')]=_0x4c3bdc['file'][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4c3bdc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0xe7c0a3,null))[_0xbb10('0x15')](saveUpdates(_0x4c3bdc[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xe7c0a3,null))[_0xbb10('0x1f')](handleError(_0xe7c0a3,null));};exports['addSystemAvatar']=function(_0x4fc544,_0x37e40c){_0x4fc544[_0xbb10('0x4d')][_0xbb10('0x6b')]=_0x4fc544[_0xbb10('0x67')][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4fc544[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x37e40c,null))[_0xbb10('0x15')](saveUpdates(_0x4fc544[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0x37e40c,null))[_0xbb10('0x1f')](handleError(_0x37e40c,null));};exports['getLogo']=function(_0x1e022d,_0x123587){var _0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x6e'));var _0x4258fc={'where':{'id':_0x1e022d[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x64')],'raw':!![]};var _0x3c92f4=![];return require(_0xbb10('0x6f'))['getLicense']()[_0xbb10('0x15')](function(_0x5e1ac5){if(_0x5e1ac5){_0x3c92f4=_0x5e1ac5[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x4258fc);})[_0xbb10('0x15')](handleEntityNotFound(_0x123587,null))[_0xbb10('0x15')](function(_0x4e9cad){if(_0x4e9cad){if(!_[_0xbb10('0x71')](_0x4e9cad['sitepic'])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]))&&_0x3c92f4){_0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]);}}return _0x123587[_0xbb10('0x74')](_0x24076a);}})[_0xbb10('0x1f')](handleError(_0x123587,null));};exports[_0xbb10('0x75')]=function(_0x589565,_0x3696b3){var _0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x76'));var _0x7673a0={'where':{'id':_0x589565[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x66')],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x7673a0)[_0xbb10('0x15')](handleEntityNotFound(_0x3696b3,null))['then'](function(_0x51063a){if(_0x51063a){if(!_[_0xbb10('0x71')](_0x51063a[_0xbb10('0x66')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a['agentAvatar']))){_0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a[_0xbb10('0x66')]);}}return _0x3696b3[_0xbb10('0x74')](_0x516520);}})[_0xbb10('0x1f')](handleError(_0x3696b3,null));};exports['getCustomerAvatar']=function(_0xdfdc42,_0x4093a4){var _0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x78'));var _0x2764e1={'where':{'id':_0xdfdc42['params']['id']},'attributes':['id',_0xbb10('0x69'),'showCustomerAvatar'],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x2764e1)['then'](handleEntityNotFound(_0x4093a4,null))[_0xbb10('0x15')](function(_0x225064){if(_0x225064){if(!_[_0xbb10('0x71')](_0x225064[_0xbb10('0x69')])){if(fs[_0xbb10('0x72')](path['join'](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x225064['customerAvatar']))&&_0x225064['showCustomerAvatar']){_0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x225064[_0xbb10('0x69')]);}}return _0x4093a4[_0xbb10('0x74')](_0xb7c454);}})['catch'](handleError(_0x4093a4,null));};exports[_0xbb10('0x79')]=function(_0x42a2d7,_0x352de4){var _0x1bd1c1=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x7a'));var _0x485c1a={'where':{'id':_0x42a2d7['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x485c1a)[_0xbb10('0x15')](handleEntityNotFound(_0x352de4,null))[_0xbb10('0x15')](function(_0x25cba1){if(_0x25cba1){if(!_[_0xbb10('0x71')](_0x25cba1[_0xbb10('0x6b')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x25cba1['systemAvatar']))){_0x1bd1c1=path['join'](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x25cba1[_0xbb10('0x6b')]);}}return _0x352de4['download'](_0x1bd1c1);}})[_0xbb10('0x1f')](handleError(_0x352de4,null));};exports[_0xbb10('0x7b')]=function(_0x2c638d,_0x290280){var _0x2a6589=require(_0xbb10('0x7c'));var _0x485f46=new _0x2a6589();var _0x57fe03=_0x485f46[_0xbb10('0x7d')](_0x2c638d['headers'][_0xbb10('0x7e')])[_0xbb10('0x7f')]();var _0x152ca9={'body':_0x2c638d[_0xbb10('0x4d')],'channel':_0xbb10('0x80')};var _0x2dfa04=[];var _0x13a29e=[];var _0x1388f6={};var _0xd3c2c8=![];return db[_0xbb10('0x81')]['describe']()[_0xbb10('0x15')](function(_0x5a9277){if(!_0x5a9277){throw new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0x83'));}_0x2dfa04=_[_0xbb10('0x84')](_[_0xbb10('0x36')](_0x5a9277),[_0xbb10('0x85'),'updatedAt']);_0x13a29e=_[_0xbb10('0x84')](_['keys'](_0x5a9277),[_0xbb10('0x85'),_0xbb10('0x86'),_0xbb10('0x87'),'ListId']);if(_0x2c638d[_0xbb10('0x4d')]['id']){delete _0x2c638d[_0xbb10('0x4d')]['id'];}if(_[_0xbb10('0x71')](_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')])){throw new db[(_0xbb10('0x82'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x2c638d[_0xbb10('0x4d')]['body'])||_0x2c638d[_0xbb10('0x4d')]['body']===''){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0x8a'));}if(_['isNil'](_0x2c638d['body'][_0xbb10('0x8b')])){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}if(!_[_0xbb10('0x8c')](_0x13a29e,_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x8b')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}_0x1388f6[_0x2c638d[_0xbb10('0x4d')]['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x2c638d[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e'),'include':[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0x8f'),'where':_0x1388f6,'limit':0x1,'order':[[_0xbb10('0x86'),'DESC']]}]},{'model':db[_0xbb10('0x90')],'as':_0xbb10('0x91')}]});})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x5e3fac){if(_0x5e3fac&&_0x5e3fac['List']){_0x152ca9[_0xbb10('0x92')]=_0x5e3fac;_0x152ca9[_0xbb10('0x93')]=_0x5e3fac[_0xbb10('0x91')];_0x152ca9[_0xbb10('0x94')]=_0x5e3fac[_0xbb10('0x8e')];_0x152ca9['applications']=_[_0xbb10('0x95')](_0x152ca9[_0xbb10('0x93')],['priority'],[_0xbb10('0x96')]);if(_0x152ca9[_0xbb10('0x92')]['Applications']){delete _0x152ca9[_0xbb10('0x92')]['Applications'];}if(_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')]&&_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')][_0xbb10('0x8f')][_0xbb10('0x3b')]){return _0x152ca9[_0xbb10('0x92')]['List'][_0xbb10('0x8f')][0x0];}var _0x4720a1=_[_0xbb10('0x97')](_0x2c638d[_0xbb10('0x4d')],{'firstName':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')],'ListId':_0x5e3fac['ListId']});_0x4720a1[_0x2c638d['body']['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0x4c')](_0x4720a1,{'fields':_0x2dfa04,'raw':!![]});}})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x3d7b4d){_0x152ca9[_0xbb10('0x98')]=_0x3d7b4d;var _0x577d27=_0x2c638d['body'][_0xbb10('0x99')];if(_0x2c638d['headers'][_0xbb10('0x9a')]){_0x577d27=_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9a')];}else if(_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9c')]){_0x577d27=_[_0xbb10('0x9d')](_0x2c638d[_0xbb10('0x9b')]['x-forwarded-for'][_0xbb10('0x9e')](','));}if(_0x3d7b4d){var _0x1eca6c={'ContactId':_0x3d7b4d['id'],'ChatWebsiteId':_0x2c638d['params']['id'],'from':(_0x3d7b4d[_0xbb10('0x9f')]||'')+'\x20'+(_0x3d7b4d[_0xbb10('0xa0')]||''),'customerIp':_0x577d27,'customerPort':_0x2c638d[_0xbb10('0x9b')]['x-real-port']?_0x2c638d['headers']['x-real-port']:null,'referer':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa1')],'browserName':_0x57fe03['browser'][_0xbb10('0x2e')]&&_0x57fe03[_0xbb10('0xa2')][_0xbb10('0xa3')]?util[_0xbb10('0xa4')](_0xbb10('0xa5'),_0x57fe03[_0xbb10('0xa2')][_0xbb10('0x2e')],_0x57fe03['browser'][_0xbb10('0xa3')]):'unknown','browserVersion':_0x57fe03['browser']['version']||_0xbb10('0xa6'),'osName':util[_0xbb10('0xa4')]('%s\x20%s',_0x57fe03['os'][_0xbb10('0x2e')],_0x57fe03['os']['version']),'osVersion':_0x57fe03['os'][_0xbb10('0xa3')],'deviceModel':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')]&&_0x57fe03['device']['vendor']?util[_0xbb10('0xa4')]('%s\x20%s\x20%s',_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')],_0x57fe03['device']['vendor'],_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')]):null,'deviceVendor':_0x57fe03[_0xbb10('0xa7')]['vendor'],'deviceType':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')],'formData':JSON[_0xbb10('0x1b')](_0x2c638d['body'])};var _0x414066={'ChatWebsiteId':_0x2c638d[_0xbb10('0x57')]['id'],'closed':![]};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]){_0x414066[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x10ca4a){if(_0x10ca4a){return[_0x10ca4a,![]];}_0x1eca6c[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')]['threadId'];_0x1eca6c['externalUrl']=_0x2c638d[_0xbb10('0x4d')]['externalUrl'];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x4e5236){return[_0x4e5236,!![]];});});}_0x414066[_0xbb10('0xaa')]=_0x3d7b4d['id'];if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]['id']){_0x414066['id']=_0x2c638d['body'][_0xbb10('0xab')]['id'];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x150d4c){if(_0x150d4c){return[_0x150d4c,![]];}return db[_0xbb10('0xa9')]['create'](_0x1eca6c)[_0xbb10('0x15')](function(_0x2f0262){return[_0x2f0262,!![]];});});}return db['ChatInteraction'][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x2d0de5){return[_0x2d0de5,!![]];});}})[_0xbb10('0xac')](function(_0x3abc15,_0x43df3c){if(_0x3abc15){_0xd3c2c8=_0x43df3c;if(!_0x43df3c){var _0x45593c={'from':(_0x152ca9[_0xbb10('0x98')][_0xbb10('0x9f')]||'')+'\x20'+(_0x152ca9[_0xbb10('0x98')][_0xbb10('0xa0')]||'')};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')]&&_0x2c638d['body'][_0xbb10('0xa8')]!=_0x2c638d[_0xbb10('0x4d')]['messageId']){_0x45593c['threadId']=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')];}return _0x3abc15[_0xbb10('0x55')](_0x45593c);}else{return _0x3abc15;}}})[_0xbb10('0x15')](function(_0x27fb82){_0x152ca9[_0xbb10('0xab')]=_0x27fb82[_0xbb10('0x2b')]({'plain':!![]});_0x152ca9[_0xbb10('0xab')][_0xbb10('0xae')]=_0xd3c2c8;if(_0x152ca9['interaction']['created']){if(_0x152ca9['account']['autoclose']){_0x152ca9['applications']['push']({'id':0x0,'priority':_0x152ca9[_0xbb10('0x93')][_0xbb10('0x3b')]+0x1,'app':_0xbb10('0xaf'),'appdata':_0xbb10('0xb0'),'interval':'*,*,*,*'});}}return db[_0xbb10('0xb1')][_0xbb10('0x4c')]({'body':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x4d')],'ChatWebsiteId':_0x2c638d['params']['id'],'ChatInteractionId':_0x27fb82['id'],'direction':'in','ContactId':_0x152ca9['contact']['id'],'AttachmentId':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xb2')]});})['then'](function(_0x581832){_0x152ca9[_0xbb10('0x1e')]=_0x581832;if(_0x152ca9[_0xbb10('0xab')][_0xbb10('0xb3')]){return db[_0xbb10('0xb4')][_0xbb10('0x56')]({'attributes':['id','name'],'where':{'id':_0x152ca9[_0xbb10('0xab')]['UserId']}})['then'](function(_0x9d96e2){if(_0x9d96e2){_0x152ca9[_0xbb10('0x93')][_0xbb10('0xb5')]({'id':0x0,'priority':0x0,'app':_0xbb10('0xb6'),'appdata':_0x9d96e2[_0xbb10('0x2e')]+','+(_0x152ca9[_0xbb10('0x92')]['waitForTheAssignedAgent']||0xa),'interval':_0xbb10('0xb7')});_0x152ca9[_0xbb10('0xb8')]=!![];}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);});}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);})[_0xbb10('0x15')](function(_0xce60f4){respondWithRpcPromise(_0xbb10('0xbb'),_0xbb10('0xbb'),{'event':_0xbb10('0x7b'),'message':_0xce60f4},client9002);return _0xce60f4;})[_0xbb10('0x15')](respondWithResult(_0x290280,null))[_0xbb10('0x1f')](handleError(_0x290280,null));};exports[_0xbb10('0xbc')]=function(_0x45b31c,_0x3cf074){var _0x232a1b,_0xbdc520,_0x246ee3;var _0x43a203=[];var _0x1ca43e={};var _0x1f84b0=_0x45b31c['files']||[];var _0x2158e2=[];var _0x47883f;return db[_0xbb10('0x81')][_0xbb10('0xbd')]()[_0xbb10('0x15')](function(_0x2b1f0f){if(!_0x2b1f0f){throw new db[(_0xbb10('0x82'))]['ValidationError']('no\x20available\x20attributes');}_0x43a203=_['difference'](_[_0xbb10('0x36')](_0x2b1f0f),[_0xbb10('0x85'),'updatedAt',_0xbb10('0x87'),_0xbb10('0xbe')]);if(_0x45b31c[_0xbb10('0x4d')]['id']){delete _0x45b31c['body']['id'];}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')])){throw _0x3cf074['status'](0x1f4)[_0xbb10('0xbf')](new db['Sequelize'][(_0xbb10('0x89'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x45b31c['body']['body'])||_0x45b31c['body']['body']===''){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0xc1')+_0x43a203));}if(!_[_0xbb10('0x8c')](_0x43a203,_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline'])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0xc2')+_0x43a203));}_0x1ca43e[_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')]]=_0x45b31c[_0xbb10('0x4d')]['from'];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x45b31c[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e')},{'model':db[_0xbb10('0xc3')],'as':_0xbb10('0xc3')}]});})[_0xbb10('0x15')](handleEntityNotFound(_0x3cf074,null))[_0xbb10('0x15')](function(_0x3c01ff){if(_0x3c01ff&&_0x3c01ff['List']){_0xbdc520=_0x3c01ff;var _0x59d917=_[_0xbb10('0x97')](_0x45b31c['body'],{'firstName':_0x45b31c['body'][_0xbb10('0x88')],'phone':_0x45b31c[_0xbb10('0x4d')]['from'],'ListId':_0x3c01ff[_0xbb10('0xbe')]});_0x59d917[_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline']]=_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0xc4')]({'where':_0x1ca43e,'defaults':_0x59d917});}})[_0xbb10('0xac')](function(_0x4d2c76){if(_0x4d2c76){_0x246ee3=_0x4d2c76;var _0x4fc260=fs['readFileSync'](path[_0xbb10('0x6c')](config['root'],_0xbb10('0xc5')),'utf8');var _0x510467=ejs[_0xbb10('0xc6')](_0x4fc260,{'body':_[_0xbb10('0xc7')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x4d')]),'bodyTitle':_0xbdc520[_0xbb10('0xc8')]});return db[_0xbb10('0xc9')]['create']({'body':_0x510467,'plainBody':htmlToText['fromString'](_0x510467),'ContactId':_0x4d2c76['id'],'ChatWebsiteId':_0xbdc520['id']});}})['then'](function(_0x5ad067){_0x47883f=_0x5ad067;if(_0x1f84b0[_0xbb10('0x3b')]){var _0x18632f=_0x1f84b0[_0xbb10('0x30')](function(_0x26bc1c){return{'name':_0x26bc1c[_0xbb10('0xca')],'basename':_0x26bc1c[_0xbb10('0x6a')],'type':_0x26bc1c['mimetype'],'ChatOfflineMessageId':_0x5ad067['id']};});_0x2158e2=_0x18632f[_0xbb10('0x30')](_0x207bbb=>{var _0x35586a={'filename':_0x207bbb[_0xbb10('0x2e')],'path':path['join'](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x207bbb[_0xbb10('0xcd')])};return _0x35586a;});if(!_0xbdc520[_0xbb10('0xce')]){return db[_0xbb10('0xcf')][_0xbb10('0xd0')](function(_0x4b7bf8){return db[_0xbb10('0xd1')][_0xbb10('0xd2')](_0x18632f,{'transaction':_0x4b7bf8});});}}})[_0xbb10('0x15')](function(){if(_0x47883f){_0x232a1b=_0x47883f;return db[_0xbb10('0xc3')][_0xbb10('0x5c')]({'where':{'active':!![]},'include':[{'model':db[_0xbb10('0xd3')],'as':_0xbb10('0xd4'),'raw':!![]}]});}})['then'](function(_0x2cbbb6){if(_0x2cbbb6&&_0x2cbbb6[_0xbb10('0xd4')]&&_0xbdc520[_0xbb10('0xd5')]&&_0xbdc520['forwardOfflineAddress']){var _0x595664={'tls':{'rejectUnauthorized':![]}};if(_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')]){_0x595664[_0xbb10('0xd6')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')];}else{_0x595664[_0xbb10('0xd7')]=_0x2cbbb6[_0xbb10('0xd4')]['host'];_0x595664[_0xbb10('0xd8')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd8')];_0x595664['secure']=_0x2cbbb6['Smtp']['secure'];}if(_0x2cbbb6['Smtp'][_0xbb10('0xd9')]){_0x595664[_0xbb10('0xda')]={'user':_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')],'pass':_0x2cbbb6['Smtp'][_0xbb10('0xdb')]};}return respondWithRpcPromise('SendMail',_0xbb10('0xdc'),{'account':_0x595664,'message':{'from':util[_0xbb10('0xa4')](_0xbb10('0xdd'),_0x2cbbb6[_0xbb10('0x2e')],_0x2cbbb6[_0xbb10('0xde')]||_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')]),'to':_0xbdc520[_0xbb10('0xdf')],'subject':_0xbdc520[_0xbb10('0xe0')],'html':_0x232a1b[_0xbb10('0x4d')],'attachments':_0x2158e2}},client9003)[_0xbb10('0x15')](function(){return _0x232a1b;})[_0xbb10('0x1f')](function(_0x4c969d){console[_0xbb10('0x1c')](_0x4c969d);});}})[_0xbb10('0x15')](function(){if(_0xbdc520&&_0xbdc520[_0xbb10('0xce')]&&_0xbdc520['MailAccountId']){var _0x204ebf=[];if(_0x1f84b0['length']){_0x204ebf=_0x1f84b0[_0xbb10('0x30')](function(_0x446bcf){return{'name':_0x446bcf[_0xbb10('0xca')],'basename':_0x446bcf[_0xbb10('0x6a')],'type':_0x446bcf[_0xbb10('0xe1')],'ChatOfflineMessageId':_0x47883f['id']};});}var _0x533327;if(!_['isNil'](_0xbdc520[_0xbb10('0xe2')])){var _0x4cf5cc=_['map'](_0x45b31c[_0xbb10('0x4d')],function(_0x5621b1){return _0x5621b1;});var _0xa9ed32=_[_0xbb10('0xe3')](_0x4cf5cc)[0x0];var _0x3f0a4e=_[_0xbb10('0xe4')](_0xa9ed32,function(_0x309b4a){return _0x309b4a;});_0x533327=_0x3f0a4e[0x1][_0xbdc520[_0xbb10('0xe2')]];}var _0x3a0940={'from':_0x246ee3[_0xbb10('0xde')],'firstName':_0x246ee3['firstName'],'lastName':_0x246ee3[_0xbb10('0xa0')],'mapKey':'email','message':{'from':_0x246ee3[_0xbb10('0xde')],'to':_0xbdc520['MailAccount'][_0xbb10('0xde')],'cc':'','subject':_[_0xbb10('0x71')](_0x533327)?_0xbdc520['offlineMessageSubject']:_0x533327,'messageId':'','sentAt':new Date(),'attach':_0x204ebf[_0xbb10('0x3b')],'attachments':_0x204ebf,'originChannel':_0xbb10('0xe5'),'ChatWebsiteId':_0xbdc520['id'],'ChatOfflineMessageId':_0x232a1b['id'],'originTo':_0xbdc520[_0xbb10('0xc3')]['email']},'body':_0x232a1b[_0xbb10('0x4d')]};var _0x1a8503={'account':{'id':_0xbdc520[_0xbb10('0xe6')]},'body':_0x3a0940,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xbb10('0xe7'),_0xbb10('0xe8'),_0x1a8503,client9001)[_0xbb10('0x15')](function(){return _0x232a1b;})['catch'](function(_0x3e6756){console['error'](_0x3e6756);});}return;})[_0xbb10('0x15')](function(){if(_0x232a1b){return _0x232a1b;}})[_0xbb10('0x15')](respondWithResult(_0x3cf074,null))[_0xbb10('0x1f')](function(_0xd94118){console[_0xbb10('0x1c')](_0xbb10('0x1f'),_0xd94118);for(var _0x23e592 of _0x1f84b0){var _0x44d28a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x23e592[_0xbb10('0x6a')]);fs_extra['remove'](_0x44d28a)[_0xbb10('0x1f')](function(_0x1067f2){console[_0xbb10('0x1c')](_0xbb10('0xe9'),_0x44d28a,_0x1067f2);});}});};exports[_0xbb10('0xea')]=function(_0x431673,_0x81d970){return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':{'id':_0x431673['params']['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x81d970,null))[_0xbb10('0x15')](function(_0x4102af){if(_0x4102af){return _0x4102af[_0xbb10('0xea')](_0x431673['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x431673[_0xbb10('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x81d970,null))[_0xbb10('0x1f')](handleError(_0x81d970,null));};exports['getInteractions']=function(_0x37c688,_0x4874be){var _0x3fd69e={'raw':![],'where':{}};var _0x1aa860={};var _0x28cd8e={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x37c688[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4874be,null))['then'](function(_0x20c514){if(_0x20c514){_0x1aa860[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xa9')][_0xbb10('0x32')]);_0x1aa860[_0xbb10('0x37')]=_['keys'](_0x37c688[_0xbb10('0x37')]);_0x1aa860[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x1aa860[_0xbb10('0x35')],_0x1aa860[_0xbb10('0x37')]);_0x3fd69e[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x1aa860['model'],qs[_0xbb10('0x3a')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3fd69e['attributes']=_0x3fd69e[_0xbb10('0x39')]['length']?_0x3fd69e[_0xbb10('0x39')]:_0x1aa860[_0xbb10('0x35')];if(!_0x37c688[_0xbb10('0x37')]['hasOwnProperty']('nolimit')){_0x3fd69e[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x27')]);_0x3fd69e[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x3fd69e[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x37c688[_0xbb10('0x37')]['sort']);_0x3fd69e['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x37c688['query'],_0x1aa860['filters']));_0x3fd69e[_0xbb10('0x41')][_0xbb10('0x59')]=_0x20c514['id'];if(_0x37c688[_0xbb10('0x37')]['filter']){_0x3fd69e[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3fd69e['where'],{'$or':_[_0xbb10('0x30')](_0x3fd69e[_0xbb10('0x39')],function(_0x544c9c){var _0x5a5349={};_0x5a5349[_0x544c9c]={'$like':'%'+_0x37c688[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5a5349;})});}_0x3fd69e=_[_0xbb10('0x42')]({},_0x3fd69e,_0x37c688['options']);return db['ChatInteraction'][_0xbb10('0x26')]({'where':_0x3fd69e[_0xbb10('0x41')]})['then'](function(_0x1e9dd2){_0x28cd8e[_0xbb10('0x26')]=_0x1e9dd2;if(_0x37c688['query'][_0xbb10('0x46')]){_0x3fd69e[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['User'],'as':_0xbb10('0xed'),'attributes':['name',_0xbb10('0xee'),_0xbb10('0xef')],'required':![]},{'model':db[_0xbb10('0xf0')],'as':_0xbb10('0xf1'),'attributes':['id',_0xbb10('0x2e'),_0xbb10('0xf2')],'where':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?{'id':_0x37c688['query'][_0xbb10('0xf3')]}:undefined,'required':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?!![]:![]}];}return db[_0xbb10('0xa9')]['findAll'](_0x3fd69e);})['then'](function(_0xd23108){_0x28cd8e[_0xbb10('0x48')]=_0xd23108;return _0x28cd8e;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x4874be,_0x3fd69e))[_0xbb10('0x1f')](handleError(_0x4874be,null));};function iftimePromise(_0x5b2e0b,_0x215028){return respondWithRpcPromise(_0xbb10('0xf4'),'getSnippet',{'command':_0x215028[_0xbb10('0xf5')]?util['format']('iftime\x20%s,%s',_0x5b2e0b[_0xbb10('0xf6')],_0x215028[_0xbb10('0xf5')]):util[_0xbb10('0xa4')](_0xbb10('0xf7'),_0x5b2e0b[_0xbb10('0xf6')])},client9002)['then'](function(_0x38403e){var _0x262078=_0x38403e&&_0x38403e[_0xbb10('0xf8')](_0xbb10('0xf9'))>=0x0?!![]:![];logger[_0xbb10('0x16')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],_0x262078?_0xbb10('0xfb'):_0xbb10('0xfc'),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return _0x262078;})[_0xbb10('0x1f')](function(_0x9fcc26){logger[_0xbb10('0x1c')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],util[_0xbb10('0xfe')](_0x9fcc26,{'showHidden':![],'depth':null}),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return![];});}exports[_0xbb10('0xff')]=function(_0x1b4873,_0x1ca72c){var _0x36615e=0x0;var _0x2f38d3=0x0;var _0x5a4d21=![];var _0x57b891;var _0x19eaa2;return db[_0xbb10('0x31')]['find']({'where':{'id':_0x1b4873[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x100')],'as':'Interval','include':[{'model':db[_0xbb10('0x100')],'as':_0xbb10('0x101'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xbb10('0x15')](handleEntityNotFound(_0x1ca72c,null))[_0xbb10('0x15')](function(_0xb4fdea){if(_0xb4fdea){_0x57b891=_0xb4fdea;return _0xb4fdea[_0xbb10('0x102')]({'raw':!![]});}})['then'](function(_0x170061){if(_0x57b891){if(_0x170061){_0x19eaa2=_0x170061;}}return require(_0xbb10('0x6f'))[_0xbb10('0x103')]();})[_0xbb10('0x15')](function(_0x5c0732){if(_0x5c0732){_0x2f38d3=_0x5c0732[_0xbb10('0x104')];_0x5a4d21=_0x5c0732[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0xa9')][_0xbb10('0x26')]({'where':{'closed':![]}});})[_0xbb10('0x15')](function(_0x2f626b){_0x36615e=_0x2f626b;if(_0x2f38d3&&_0x2f626b>_0x2f38d3){return db[_0xbb10('0x105')][_0xbb10('0x5c')]({'where':{'id':0x1}})[_0xbb10('0x15')](function(_0x2fd942){if(_0x2fd942){_0x2fd942['increment'](_0xbb10('0x106'));}});}})[_0xbb10('0x15')](function(){if(_0x57b891[_0xbb10('0x100')]&&_0x57b891[_0xbb10('0x100')]['Intervals']){var _0x5116d8=[];for(var _0x8bfc0f=0x0;_0x8bfc0f<_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0xbb10('0x3b')];_0x8bfc0f++){var _0x5f0576=_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0x8bfc0f][_0xbb10('0x2b')]({'plain':!![]});_0x5116d8['push'](iftimePromise(_0x5f0576,_0x57b891));}return BPromise['all'](_0x5116d8)[_0xbb10('0x15')](function(_0xd6b33){return _['some'](_0xd6b33);});}else{return!![];}})['then'](function(_0x424bb1){var _0x615606=fs[_0xbb10('0x107')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x108')),'utf8');var _0x408544={'remote':_0x57b891[_0xbb10('0x109')],'query':querystring[_0xbb10('0x1b')](_[_0xbb10('0x42')](_0x57b891[_0xbb10('0x2b')]({'plain':!![]}),{'customerIp':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x9c')]||_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x10a')]||_0x1b4873[_0xbb10('0x10b')]['remoteAddress']||_0x1b4873['ip'],'referer':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0xa1')],'openedInteractions':_0x36615e,'maxInteractions':_0x2f38d3,'virtual':_0x5a4d21['virtual'],'online':_0x424bb1,'custom':_0x5a4d21}))['replace'](/'/g,'\x5c\x27')};_0x1ca72c['send'](ejs['render'](Mustache['render'](_0x615606,_0x408544),{'proactiveActions':_0x19eaa2,'alignment':_0x57b891['alignment'],'verticalAlignment':_0x57b891['verticalAlignment'],'div_color':_0x57b891['color'],'labelText':_0x57b891[_0xbb10('0x10c')],'text_color':_0x57b891[_0xbb10('0x10d')],'button_color':_0x57b891['color_button'],'background_color':_0x57b891[_0xbb10('0x10e')]}));})[_0xbb10('0x1f')](handleError(_0x1ca72c,null));};exports[_0xbb10('0x10f')]=function(_0x3b9bec,_0x1d099a){var _0x1d36fa=_0x3b9bec[_0xbb10('0x57')]['id'];var _0x23179d=_0x3b9bec[_0xbb10('0x4d')];var _0x14d9e7=0xc8;var _0x19dfef=null;return db[_0xbb10('0xcf')]['transaction']({'isolationLevel':db[_0xbb10('0xcf')][_0xbb10('0x110')][_0xbb10('0x111')][_0xbb10('0x112')]},function(_0x155f92){return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x1d36fa},'transaction':_0x155f92})['then'](function(_0x52209c){if(_0x52209c){return db[_0xbb10('0x90')][_0xbb10('0x2a')]({'where':{'ChatWebsiteId':_0x1d36fa},'transaction':_0x155f92})['then'](function(){var _0x3e433b=_[_0xbb10('0x30')](_0x23179d,function(_0x201e05){_0x201e05[_0xbb10('0x59')]=_0x1d36fa;return _0x201e05;});return db[_0xbb10('0x90')]['bulkCreate'](_0x3e433b,{'transaction':_0x155f92});});}else{_0x14d9e7=0x194;_0x19dfef=[];}});})['then'](function(){if(_0x14d9e7!==0x194){return db[_0xbb10('0x90')][_0xbb10('0x113')]({'where':{'ChatWebsiteId':_0x1d36fa},'order':'priority'})[_0xbb10('0x15')](function(_0x4cf976){_0x19dfef=_0x4cf976;});}})[_0xbb10('0x1f')](function(_0x1a2f42){_0x14d9e7=0x1f4;logger[_0xbb10('0x1c')](_0x1a2f42[_0xbb10('0x2d')]);if(_0x1a2f42[_0xbb10('0x2e')]){delete _0x1a2f42[_0xbb10('0x2e')];}_0x19dfef=_0x1a2f42;})[_0xbb10('0x114')](function(){if(_0x19dfef===null){_0x1d099a['sendStatus'](_0x14d9e7);}else{if(_0x14d9e7===0x1f4){_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0xbf')](_0x19dfef);}else{_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0x23')](_0x19dfef);}}});};exports['getApplications']=function(_0x20347b,_0x22ffc6){var _0x530785={};var _0x49ef50={};var _0xeac82d;var _0x5a4de3;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x20347b[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x22ffc6,null))['then'](function(_0x90ab9f){if(_0x90ab9f){_0xeac82d=_0x90ab9f;_0x49ef50['model']=_[_0xbb10('0x36')](db[_0xbb10('0x90')][_0xbb10('0x32')]);_0x49ef50[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x20347b[_0xbb10('0x37')]);_0x49ef50[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],_0x49ef50['query']);_0x530785[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x20347b[_0xbb10('0x37')]['fields']));_0x530785[_0xbb10('0x39')]=_0x530785[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x530785[_0xbb10('0x39')]:_0x49ef50[_0xbb10('0x35')];_0x530785['order']=qs['sort'](_0x20347b['query'][_0xbb10('0x3f')]);_0x530785['where']=qs['filters'](_[_0xbb10('0x40')](_0x20347b['query'],_0x49ef50[_0xbb10('0x38')]));if(_0x20347b[_0xbb10('0x37')]['filter']){_0x530785[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x530785[_0xbb10('0x41')],{'$or':_[_0xbb10('0x30')](_0x530785['attributes'],function(_0x4b08b2){var _0x57abfe={};_0x57abfe[_0x4b08b2]={'$like':'%'+_0x20347b[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x57abfe;})});}_0x530785=_['merge']({},_0x530785,_0x20347b[_0xbb10('0x45')]);return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x33a92a){if(_0x33a92a){_0x5a4de3=_0x33a92a[_0xbb10('0x3b')];if(!_0x20347b['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x530785[_0xbb10('0x27')]=qs['limit'](_0x20347b[_0xbb10('0x37')]['limit']);_0x530785[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x20347b[_0xbb10('0x37')]['offset']);}return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x4ba58f){if(_0x4ba58f){return _0x4ba58f?{'count':_0x5a4de3,'rows':_0x4ba58f}:null;}})[_0xbb10('0x15')](respondWithResult(_0x22ffc6,null))[_0xbb10('0x1f')](handleError(_0x22ffc6,null));};exports[_0xbb10('0x116')]=function(_0x2e03eb,_0x24e7bc){return db['chatProactiveAction']['find']({'where':{'id':_0x2e03eb[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24e7bc,null))[_0xbb10('0x15')](function(_0x1b0734){if(_0x1b0734){return _0x1b0734[_0xbb10('0x116')](_0x2e03eb['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x2e03eb[_0xbb10('0x4d')],[_0xbb10('0x5e'),'id'])||{});}})[_0xbb10('0x15')](respondWithResult(_0x24e7bc,null))['catch'](handleError(_0x24e7bc,null));};exports['getProactiveActions']=function(_0x2f675c,_0x18f6b1){var _0x1052f5={};var _0x119e8f={};var _0x5a031b;var _0x4c8e28;return db[_0xbb10('0x31')]['findOne']({'where':{'id':_0x2f675c['params']['id']}})['then'](handleEntityNotFound(_0x18f6b1,null))['then'](function(_0x3758dd){if(_0x3758dd){_0x5a031b=_0x3758dd;_0x119e8f[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x117')][_0xbb10('0x32')]);_0x119e8f['query']=_[_0xbb10('0x36')](_0x2f675c[_0xbb10('0x37')]);_0x119e8f[_0xbb10('0x38')]=_['intersection'](_0x119e8f[_0xbb10('0x35')],_0x119e8f[_0xbb10('0x37')]);_0x1052f5[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x119e8f[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x1052f5[_0xbb10('0x39')]=_0x1052f5[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x1052f5[_0xbb10('0x39')]:_0x119e8f[_0xbb10('0x35')];_0x1052f5[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x2f675c['query']['sort']);_0x1052f5['where']=qs[_0xbb10('0x38')](_['pick'](_0x2f675c[_0xbb10('0x37')],_0x119e8f['filters']));if(_0x2f675c[_0xbb10('0x37')]['filter']){_0x1052f5['where']=_[_0xbb10('0x42')](_0x1052f5[_0xbb10('0x41')],{'$or':_['map'](_0x1052f5[_0xbb10('0x39')],function(_0x131d48){var _0x338e7a={};_0x338e7a[_0x131d48]={'$like':'%'+_0x2f675c[_0xbb10('0x37')]['filter']+'%'};return _0x338e7a;})});}_0x1052f5=_['merge']({},_0x1052f5,_0x2f675c[_0xbb10('0x45')]);return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x53f3c2){if(_0x53f3c2){_0x4c8e28=_0x53f3c2[_0xbb10('0x3b')];if(!_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3c')]('nolimit')){_0x1052f5[_0xbb10('0x27')]=qs['limit'](_0x2f675c['query'][_0xbb10('0x27')]);_0x1052f5['offset']=qs[_0xbb10('0x24')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x24')]);}return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x57a6bc){if(_0x57a6bc){return _0x57a6bc?{'count':_0x4c8e28,'rows':_0x57a6bc}:null;}})[_0xbb10('0x15')](respondWithResult(_0x18f6b1,null))[_0xbb10('0x1f')](handleError(_0x18f6b1,null));};exports[_0xbb10('0x118')]=function(_0x2701e8,_0x1b0086){var _0x1c387b=_0x2701e8['query']['online']===_0xbb10('0x119')?_0xbb10('0x11a'):_0xbb10('0x11b');return db[_0xbb10('0x31')][_0xbb10('0x56')]({'attributes':['id',_0x1c387b],'where':{'id':_0x2701e8['params']['id']}})['then'](handleEntityNotFound(_0x1b0086,null))[_0xbb10('0x15')](function(_0x23cbf4){if(_0x23cbf4){var _0x536519=_0x23cbf4[_0x1c387b];var _0x50dde9=_0x536519&&_0x536519[_0xbb10('0x11c')]?_0x536519[_0xbb10('0x11c')]:[];_0x1b0086[_0xbb10('0xbf')]({'fromKey':_[_0xbb10('0x71')](_0x536519[_0xbb10('0x11d')])?undefined:_0x536519[_0xbb10('0x11d')],'count':_0x50dde9['length'],'rows':_0x50dde9});}})[_0xbb10('0x1f')](handleError(_0x1b0086,null));};exports[_0xbb10('0x11e')]=function(_0x261c9b,_0x232794){var _0x35b3f8={'raw':![],'where':{}};var _0x3783d0={};var _0xdd7d5c={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x261c9b['params']['id']}})['then'](handleEntityNotFound(_0x232794,null))['then'](function(_0x111c15){if(_0x111c15){_0x3783d0[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xc9')]['rawAttributes']);_0x3783d0['query']=_['keys'](_0x261c9b[_0xbb10('0x37')]);_0x3783d0[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],_0x3783d0[_0xbb10('0x37')]);_0x35b3f8[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x35b3f8[_0xbb10('0x39')]=_0x35b3f8[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x35b3f8['attributes']:_0x3783d0[_0xbb10('0x35')];if(!_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x35b3f8[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x261c9b['query'][_0xbb10('0x27')]);_0x35b3f8[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x35b3f8[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x35b3f8['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x261c9b[_0xbb10('0x37')],_0x3783d0[_0xbb10('0x38')]));_0x35b3f8[_0xbb10('0x41')][_0xbb10('0x59')]=_0x111c15['id'];if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x44')]){_0x35b3f8[_0xbb10('0x41')]=_['merge'](_0x35b3f8[_0xbb10('0x41')],{'$or':_['map'](_0x35b3f8[_0xbb10('0x39')],function(_0x2cd1b0){var _0x57e0b2={};_0x57e0b2[_0x2cd1b0]={'$like':'%'+_0x261c9b['query'][_0xbb10('0x44')]+'%'};return _0x57e0b2;})});}_0x35b3f8=_[_0xbb10('0x42')]({},_0x35b3f8,_0x261c9b[_0xbb10('0x45')]);return db[_0xbb10('0xc9')][_0xbb10('0x26')]({'where':_0x35b3f8[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x40a208){_0xdd7d5c[_0xbb10('0x26')]=_0x40a208;if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x46')]){_0x35b3f8[_0xbb10('0x4b')]=[{'all':!![]}];}else{_0x35b3f8[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['Attachment'],'as':_0xbb10('0x11f'),'required':![]}];}return db['ChatOfflineMessage'][_0xbb10('0x47')](_0x35b3f8);})[_0xbb10('0x15')](function(_0x234dc5){_0xdd7d5c[_0xbb10('0x48')]=_0x234dc5;return _0xdd7d5c;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x232794,_0x35b3f8))[_0xbb10('0x1f')](handleError(_0x232794,null));};exports[_0xbb10('0x120')]=function(_0x45dcaa,_0x5c88bd){return db['ChatWebsite']['find']({'where':{'id':_0x45dcaa[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5c88bd,null))[_0xbb10('0x15')](function(_0x54c61c){if(_0x54c61c){return _0x54c61c[_0xbb10('0x120')](_0x45dcaa['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x45dcaa['body'],[_0xbb10('0x5e'),'id'])||{})[_0xbb10('0xac')](function(_0xa52322){for(var _0xc1691=0x0;_0xc1691<_0x45dcaa[_0xbb10('0x4d')]['ids'][_0xbb10('0x3b')];_0xc1691+=0x1){socket[_0xbb10('0x121')]('userChatWebsite:save',{'UserId':Number(_0x45dcaa[_0xbb10('0x4d')][_0xbb10('0x5e')][_0xc1691]),'ChatWebsiteId':Number(_0x45dcaa['params']['id'])});}return _0xa52322;});}})[_0xbb10('0x15')](respondWithResult(_0x5c88bd,null))[_0xbb10('0x1f')](handleError(_0x5c88bd,null));};exports[_0xbb10('0x122')]=function(_0x24f1d2,_0x481a0a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x24f1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x481a0a,null))['then'](function(_0x284b77){if(_0x284b77){return _0x284b77[_0xbb10('0x122')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])['then'](function(){if(_[_0xbb10('0x123')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])){for(var _0x28c680=0x0;_0x28c680<_0x24f1d2[_0xbb10('0x37')]['ids']['length'];_0x28c680+=0x1){socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2['query']['ids'][_0x28c680]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}}else{socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x481a0a,null))['catch'](handleError(_0x481a0a,null));};exports[_0xbb10('0x125')]=function(_0x1c3cbc,_0x24bda8){var _0x27ddfc={};var _0x39a047={};var _0x9a80a7;var _0x5e08c5;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x1c3cbc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24bda8,null))['then'](function(_0x21ad98){if(_0x21ad98){_0x9a80a7=_0x21ad98;_0x39a047[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xb4')][_0xbb10('0x32')]);_0x39a047[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x1c3cbc[_0xbb10('0x37')]);_0x39a047[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],_0x39a047[_0xbb10('0x37')]);_0x27ddfc['attributes']=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],qs['fields'](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x27ddfc[_0xbb10('0x39')]=_0x27ddfc['attributes'][_0xbb10('0x3b')]?_0x27ddfc[_0xbb10('0x39')]:_0x39a047[_0xbb10('0x35')];_0x27ddfc[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x1c3cbc[_0xbb10('0x37')]['sort']);_0x27ddfc[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x1c3cbc[_0xbb10('0x37')],_0x39a047[_0xbb10('0x38')]));if(_0x1c3cbc[_0xbb10('0x37')]['filter']){_0x27ddfc[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x27ddfc['where'],{'$or':_[_0xbb10('0x30')](_0x27ddfc['attributes'],function(_0x31c086){var _0x40845c={};_0x40845c[_0x31c086]={'$like':'%'+_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x40845c;})});}_0x27ddfc=_[_0xbb10('0x42')]({},_0x27ddfc,_0x1c3cbc[_0xbb10('0x45')]);return _0x9a80a7[_0xbb10('0x125')](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x55ee36){if(_0x55ee36){_0x5e08c5=_0x55ee36['length'];if(!_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x27ddfc[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x27')]);_0x27ddfc[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x1c3cbc['query'][_0xbb10('0x24')]);}return _0x9a80a7['getAgents'](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x2a618a){if(_0x2a618a){return _0x2a618a?{'count':_0x5e08c5,'rows':_0x2a618a}:null;}})['then'](respondWithResult(_0x24bda8,null))[_0xbb10('0x1f')](handleError(_0x24bda8,null));};
\ No newline at end of file
+var _0x5f66=['Start','startRouting','EventManager','offline','files','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','forwardOfflineAddress','service','host','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','toPairsIn','mapValues','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','attachments','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','custom','License','increment','chatLicenseExceeded','all','some','x-real-ip','connection','remoteAddress','replace','alignment','color','labelText','textColor','color_button','backgroundColor','addApplications','Transaction','READ_COMMITTED','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','mandatoryDispositionPause','map','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatWebsite','include','rows','show','params','Pause','keys','rawAttributes','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','Disposition','getDispositions','removeDispositions','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','asc','contact','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','stringify','ChatInteraction','threadId','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','forcedOwnership'];(function(_0x47b5bb,_0xe5e615){var _0x363df1=function(_0x4d1d54){while(--_0x4d1d54){_0x47b5bb['push'](_0x47b5bb['shift']());}};_0x363df1(++_0xe5e615);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x65f6('0x0'));var util=require('util');var path=require(_0x65f6('0x1'));var ejs=require(_0x65f6('0x2'));var fs=require('fs');var fs_extra=require(_0x65f6('0x3'));var _=require(_0x65f6('0x4'));var querystring=require(_0x65f6('0x5'));var Redis=require('ioredis');var qs=require(_0x65f6('0x6'));var logger=require('../../config/logger')(_0x65f6('0x7'));var config=require(_0x65f6('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);var htmlToText=require('html-to-text');var jayson=require(_0x65f6('0xe'));var client=jayson[_0x65f6('0xf')][_0x65f6('0x10')]({'port':0x232c});var client9002=jayson[_0x65f6('0xf')]['http']({'port':0x232a});var client9003=jayson[_0x65f6('0xf')]['http']({'port':0x232b});var client9001=jayson['client'][_0x65f6('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x576875,_0x419819,_0x4862a5,_0x2f964a){return new BPromise(function(_0x186a6a,_0x2c4ee5){var _0x217570=_0x2f964a||client;return _0x217570[_0x65f6('0x11')](_0x576875,_0x4862a5)[_0x65f6('0x12')](function(_0x44144b){logger[_0x65f6('0x13')](_0x65f6('0x14'),_0x419819,_0x65f6('0x15'));logger['debug'](_0x65f6('0x16'),_0x419819,'request\x20sent',JSON['stringify'](_0x44144b));if(_0x44144b[_0x65f6('0x17')]){if(_0x44144b[_0x65f6('0x17')][_0x65f6('0x18')]===0x1f4){logger[_0x65f6('0x17')](_0x65f6('0x14'),_0x419819,_0x44144b[_0x65f6('0x17')][_0x65f6('0x19')]);return _0x2c4ee5(_0x44144b[_0x65f6('0x17')]['message']);}logger['error'](_0x65f6('0x14'),_0x419819,_0x44144b['error']['message']);return _0x186a6a(_0x44144b['error'][_0x65f6('0x19')]);}else{logger[_0x65f6('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x419819,_0x65f6('0x15'));_0x186a6a(_0x44144b[_0x65f6('0x1a')][_0x65f6('0x19')]);}})[_0x65f6('0x1b')](function(_0x219ab2){logger[_0x65f6('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x419819,_0x219ab2);_0x2c4ee5(_0x219ab2);});});}function respondWithStatusCode(_0x197a49,_0x4bb39e){_0x4bb39e=_0x4bb39e||0xcc;return function(_0x5b9e2a){if(_0x5b9e2a){return _0x197a49[_0x65f6('0x1c')](_0x4bb39e);}return _0x197a49[_0x65f6('0x1d')](_0x4bb39e)['end']();};}function respondWithResult(_0x1eeaaa,_0x471a33){_0x471a33=_0x471a33||0xc8;return function(_0x2317ce){if(_0x2317ce){return _0x1eeaaa[_0x65f6('0x1d')](_0x471a33)['json'](_0x2317ce);}};}function respondWithFilteredResult(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(_0x20a161){var _0x5963e0=typeof _0x59ea32['offset']==='undefined'&&typeof _0x59ea32[_0x65f6('0x1e')]===_0x65f6('0x1f');var _0x4b2292=_0x20a161[_0x65f6('0x20')];var _0x28f710=_0x5963e0?0x0:_0x59ea32['offset'];var _0x325cb4=_0x5963e0?_0x20a161[_0x65f6('0x20')]:_0x59ea32[_0x65f6('0x21')]+_0x59ea32['limit'];var _0x4ac04b;if(_0x325cb4>=_0x4b2292){_0x325cb4=_0x4b2292;_0x4ac04b=0xc8;}else{_0x4ac04b=0xce;}_0x9d7bb0['status'](_0x4ac04b);return _0x9d7bb0[_0x65f6('0x22')](_0x65f6('0x23'),_0x28f710+'-'+_0x325cb4+'/'+_0x4b2292)[_0x65f6('0x24')](_0x20a161);}return null;};}function saveUpdates(_0x408ccc){return function(_0x518cac){if(_0x518cac){return _0x518cac[_0x65f6('0x25')](_0x408ccc)[_0x65f6('0x12')](function(_0x4ace4c){return _0x4ace4c;});}return null;};}function removeEntity(_0x4ea23d){return function(_0x154cbd){if(_0x154cbd){return _0x154cbd[_0x65f6('0x26')]()['then'](function(){var _0x4e50c0=_0x154cbd[_0x65f6('0x27')]({'plain':!![]});var _0x1ce43c=_0x65f6('0x28');return db[_0x65f6('0x29')][_0x65f6('0x26')]({'where':{'type':_0x1ce43c,'resourceId':_0x4e50c0['id']}})[_0x65f6('0x12')](function(){return _0x154cbd;});})['then'](function(){_0x4ea23d[_0x65f6('0x1d')](0xcc)[_0x65f6('0x2a')]();});}};}function handleEntityNotFound(_0x46f03c){return function(_0x4bc037){if(!_0x4bc037){_0x46f03c[_0x65f6('0x1c')](0x194);}return _0x4bc037;};}function handleError(_0x2a7aa8,_0xbaed3c){_0xbaed3c=_0xbaed3c||0x1f4;return function(_0x45510a){logger[_0x65f6('0x17')](_0x45510a[_0x65f6('0x2b')]);if(_0x45510a['name']){delete _0x45510a[_0x65f6('0x2c')];}_0x2a7aa8[_0x65f6('0x1d')](_0xbaed3c)['send'](_0x45510a);};}exports[_0x65f6('0x2d')]=function(_0x5a740a,_0x2b403b){var _0x50494b={'include':[{'model':db['Pause'],'as':_0x65f6('0x2e')}]},_0x2b9fb6={},_0x24f7fd={'count':0x0,'rows':[]};var _0x13e41a=_[_0x65f6('0x2f')](db['ChatWebsite']['rawAttributes'],function(_0x30109d){return{'name':_0x30109d['fieldName'],'type':_0x30109d[_0x65f6('0x30')]['key']};});_0x2b9fb6[_0x65f6('0x31')]=_[_0x65f6('0x2f')](_0x13e41a,'name');_0x2b9fb6[_0x65f6('0x32')]=_['keys'](_0x5a740a['query']);_0x2b9fb6[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x2b9fb6[_0x65f6('0x31')],_0x2b9fb6[_0x65f6('0x32')]);_0x50494b[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x2b9fb6[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x5a740a['query'][_0x65f6('0x36')]));_0x50494b['attributes']=_0x50494b[_0x65f6('0x35')][_0x65f6('0x37')]?_0x50494b[_0x65f6('0x35')]:_0x2b9fb6[_0x65f6('0x31')];if(!_0x5a740a['query'][_0x65f6('0x38')](_0x65f6('0x39'))){_0x50494b[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x5a740a[_0x65f6('0x32')][_0x65f6('0x1e')]);_0x50494b[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x5a740a[_0x65f6('0x32')]['offset']);}_0x50494b[_0x65f6('0x3a')]=qs[_0x65f6('0x3b')](_0x5a740a[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x50494b[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x5a740a[_0x65f6('0x32')],_0x2b9fb6[_0x65f6('0x33')]),_0x13e41a);if(_0x5a740a[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x50494b[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x50494b[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x13e41a,function(_0x2cb38d){if(_0x2cb38d['type']!==_0x65f6('0x40')){var _0x37cd36={};_0x37cd36[_0x2cb38d[_0x65f6('0x2c')]]={'$like':'%'+_0x5a740a[_0x65f6('0x32')]['filter']+'%'};return _0x37cd36;}})});}_0x50494b=_[_0x65f6('0x3f')]({},_0x50494b,_0x5a740a[_0x65f6('0x41')]);var _0x2b01eb={'where':_0x50494b['where']};return db[_0x65f6('0x42')][_0x65f6('0x20')](_0x2b01eb)[_0x65f6('0x12')](function(_0x2179e5){_0x24f7fd['count']=_0x2179e5;if(_0x5a740a[_0x65f6('0x32')]['includeAll']){_0x50494b[_0x65f6('0x43')]=[{'all':!![]}];}return db[_0x65f6('0x42')]['findAll'](_0x50494b);})[_0x65f6('0x12')](function(_0x5085db){_0x24f7fd[_0x65f6('0x44')]=_0x5085db;return _0x24f7fd;})[_0x65f6('0x12')](respondWithFilteredResult(_0x2b403b,_0x50494b))[_0x65f6('0x1b')](handleError(_0x2b403b,null));};exports[_0x65f6('0x45')]=function(_0x3ec18f,_0x3837b2){var _0x4d30c5={'raw':![],'where':{'id':_0x3ec18f[_0x65f6('0x46')]['id']},'include':[{'model':db[_0x65f6('0x47')],'as':_0x65f6('0x2e')}]},_0x51bf6c={};_0x51bf6c[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0x42')][_0x65f6('0x49')]);_0x51bf6c[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x3ec18f['query']);_0x51bf6c[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x51bf6c[_0x65f6('0x31')],_0x51bf6c['query']);_0x4d30c5[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x51bf6c['model'],qs[_0x65f6('0x36')](_0x3ec18f[_0x65f6('0x32')]['fields']));_0x4d30c5[_0x65f6('0x35')]=_0x4d30c5['attributes'][_0x65f6('0x37')]?_0x4d30c5[_0x65f6('0x35')]:_0x51bf6c[_0x65f6('0x31')];if(_0x3ec18f['query'][_0x65f6('0x4a')]){_0x4d30c5[_0x65f6('0x43')]=[{'all':!![]}];}_0x4d30c5=_['merge']({},_0x4d30c5,_0x3ec18f[_0x65f6('0x41')]);return db[_0x65f6('0x42')]['find'](_0x4d30c5)[_0x65f6('0x12')](handleEntityNotFound(_0x3837b2,null))[_0x65f6('0x12')](respondWithResult(_0x3837b2,null))[_0x65f6('0x1b')](handleError(_0x3837b2,null));};exports[_0x65f6('0x4b')]=function(_0x234fa7,_0x2350ca){return db[_0x65f6('0x42')][_0x65f6('0x4b')](_0x234fa7['body'],{})['then'](function(_0x5ca62e){var _0x19f40c=_0x234fa7[_0x65f6('0x4c')][_0x65f6('0x27')]({'plain':!![]});if(!_0x19f40c)throw new Error(_0x65f6('0x4d'));if(_0x19f40c['role']===_0x65f6('0x4c')){var _0x2032b9=_0x5ca62e[_0x65f6('0x27')]({'plain':!![]});var _0x50f63a=_0x65f6('0x28');return db[_0x65f6('0x4e')][_0x65f6('0x4f')]({'where':{'name':_0x50f63a,'userProfileId':_0x19f40c['userProfileId']},'raw':!![]})['then'](function(_0x1d337d){if(_0x1d337d&&_0x1d337d[_0x65f6('0x50')]===0x0){return db[_0x65f6('0x29')][_0x65f6('0x4b')]({'name':_0x2032b9[_0x65f6('0x2c')],'resourceId':_0x2032b9['id'],'type':_0x1d337d[_0x65f6('0x2c')],'sectionId':_0x1d337d['id']},{})[_0x65f6('0x12')](function(){return _0x5ca62e;});}else{return _0x5ca62e;}})[_0x65f6('0x1b')](function(_0x2d8b5b){logger[_0x65f6('0x17')](_0x65f6('0x51'),_0x2d8b5b);throw _0x2d8b5b;});}return _0x5ca62e;})[_0x65f6('0x12')](respondWithResult(_0x2350ca,0xc9))[_0x65f6('0x1b')](handleError(_0x2350ca,null));};exports[_0x65f6('0x25')]=function(_0x5ba9c6,_0x47610a){if(_0x5ba9c6[_0x65f6('0x52')]['id']){delete _0x5ba9c6[_0x65f6('0x52')]['id'];}return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x5ba9c6[_0x65f6('0x46')]['id']},'include':[{'model':db[_0x65f6('0x47')],'as':_0x65f6('0x2e')}]})['then'](handleEntityNotFound(_0x47610a,null))[_0x65f6('0x12')](saveUpdates(_0x5ba9c6[_0x65f6('0x52')],null))[_0x65f6('0x12')](respondWithResult(_0x47610a,null))[_0x65f6('0x1b')](handleError(_0x47610a,null));};exports['destroy']=function(_0x2923ff,_0x2fc20f){return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x2923ff[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x2fc20f,null))['then'](removeEntity(_0x2fc20f,null))[_0x65f6('0x1b')](handleError(_0x2fc20f,null));};exports[_0x65f6('0x53')]=function(_0x3974ef,_0x3c23e3){return db[_0x65f6('0x42')][_0x65f6('0x53')]()['then'](respondWithResult(_0x3c23e3,null))['catch'](handleError(_0x3c23e3,null));};exports['addDisposition']=function(_0x336a7d,_0x367d95){if(_0x336a7d[_0x65f6('0x52')]['id']){delete _0x336a7d[_0x65f6('0x52')]['id'];}return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x336a7d['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x367d95,null))[_0x65f6('0x12')](function(_0x54b569){if(_0x54b569){_0x336a7d[_0x65f6('0x52')][_0x65f6('0x54')]=_0x54b569['id'];return db[_0x65f6('0x55')]['create'](_0x336a7d[_0x65f6('0x52')]);}})[_0x65f6('0x12')](respondWithResult(_0x367d95,null))['catch'](handleError(_0x367d95,null));};exports[_0x65f6('0x56')]=function(_0x3edc6b,_0x1301f5){var _0x417b44={'raw':![],'where':{}};var _0x3d55f7={};var _0x2226bf={'count':0x0,'rows':[]};return db[_0x65f6('0x42')]['findOne']({'where':{'id':_0x3edc6b['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x1301f5,null))[_0x65f6('0x12')](function(_0x4a9524){if(_0x4a9524){_0x3d55f7[_0x65f6('0x31')]=_['keys'](db[_0x65f6('0x55')]['rawAttributes']);_0x3d55f7[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x3edc6b[_0x65f6('0x32')]);_0x3d55f7[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x3d55f7[_0x65f6('0x31')],_0x3d55f7[_0x65f6('0x32')]);_0x417b44[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x3d55f7['model'],qs['fields'](_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x36')]));_0x417b44[_0x65f6('0x35')]=_0x417b44['attributes']['length']?_0x417b44[_0x65f6('0x35')]:_0x3d55f7[_0x65f6('0x31')];if(!_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x417b44[_0x65f6('0x1e')]=qs['limit'](_0x3edc6b['query'][_0x65f6('0x1e')]);_0x417b44[_0x65f6('0x21')]=qs['offset'](_0x3edc6b[_0x65f6('0x32')]['offset']);}_0x417b44[_0x65f6('0x3a')]=qs[_0x65f6('0x3b')](_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x417b44['where']=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x3edc6b[_0x65f6('0x32')],_0x3d55f7['filters']));_0x417b44['where'][_0x65f6('0x54')]=_0x4a9524['id'];if(_0x3edc6b['query'][_0x65f6('0x3e')]){_0x417b44[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x417b44[_0x65f6('0x3c')],{'$or':_['map'](_0x417b44['attributes'],function(_0x56f7f1){var _0x2e29b4={};_0x2e29b4[_0x56f7f1]={'$like':'%'+_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x3e')]+'%'};return _0x2e29b4;})});}_0x417b44=_['merge']({},_0x417b44,_0x3edc6b[_0x65f6('0x41')]);return db[_0x65f6('0x55')][_0x65f6('0x20')]({'where':_0x417b44['where']})[_0x65f6('0x12')](function(_0x15809e){_0x2226bf['count']=_0x15809e;if(_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x417b44['include']=[{'all':!![]}];}return db[_0x65f6('0x55')]['findAll'](_0x417b44);})[_0x65f6('0x12')](function(_0x55ea91){_0x2226bf[_0x65f6('0x44')]=_0x55ea91;return _0x2226bf;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x1301f5,_0x417b44))['catch'](handleError(_0x1301f5,null));};exports[_0x65f6('0x57')]=function(_0x442e25,_0x2a700b){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x442e25[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x2a700b,null))[_0x65f6('0x12')](function(_0x31dba0){if(_0x31dba0){return _0x31dba0[_0x65f6('0x57')](_0x442e25[_0x65f6('0x32')]['ids']);}})[_0x65f6('0x12')](respondWithStatusCode(_0x2a700b,null))[_0x65f6('0x1b')](handleError(_0x2a700b,null));};exports[_0x65f6('0x58')]=function(_0x219e42,_0x5694f9){if(_0x219e42[_0x65f6('0x52')]['id']){delete _0x219e42[_0x65f6('0x52')]['id'];}return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x219e42['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x5694f9,null))['then'](function(_0x31f6c1){if(_0x31f6c1){_0x219e42[_0x65f6('0x52')]['ChatWebsiteId']=_0x31f6c1['id'];return db['CannedAnswer'][_0x65f6('0x4b')](_0x219e42[_0x65f6('0x52')]);}})['then'](respondWithResult(_0x5694f9,null))[_0x65f6('0x1b')](handleError(_0x5694f9,null));};exports[_0x65f6('0x59')]=function(_0x73d359,_0x4edba0){var _0x1348ec={'raw':![],'where':{}};var _0x246510={};var _0x5889dc={'count':0x0,'rows':[]};return db[_0x65f6('0x42')]['findOne']({'where':{'id':_0x73d359[_0x65f6('0x46')]['id']}})['then'](handleEntityNotFound(_0x4edba0,null))['then'](function(_0x20687f){if(_0x20687f){_0x246510[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0x5a')][_0x65f6('0x49')]);_0x246510[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x73d359[_0x65f6('0x32')]);_0x246510['filters']=_['intersection'](_0x246510[_0x65f6('0x31')],_0x246510['query']);_0x1348ec[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x246510[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x73d359[_0x65f6('0x32')]['fields']));_0x1348ec[_0x65f6('0x35')]=_0x1348ec[_0x65f6('0x35')][_0x65f6('0x37')]?_0x1348ec['attributes']:_0x246510[_0x65f6('0x31')];if(!_0x73d359[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x1348ec[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x73d359['query']['limit']);_0x1348ec[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x73d359[_0x65f6('0x32')][_0x65f6('0x21')]);}_0x1348ec['order']=qs['sort'](_0x73d359[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x1348ec[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x73d359[_0x65f6('0x32')],_0x246510['filters']));_0x1348ec['where']['ChatWebsiteId']=_0x20687f['id'];if(_0x73d359[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x1348ec[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x1348ec['where'],{'$or':_['map'](_0x1348ec[_0x65f6('0x35')],function(_0x27e44b){var _0x56077a={};_0x56077a[_0x27e44b]={'$like':'%'+_0x73d359[_0x65f6('0x32')]['filter']+'%'};return _0x56077a;})});}_0x1348ec=_[_0x65f6('0x3f')]({},_0x1348ec,_0x73d359['options']);return db[_0x65f6('0x5a')][_0x65f6('0x20')]({'where':_0x1348ec['where']})[_0x65f6('0x12')](function(_0x330e18){_0x5889dc[_0x65f6('0x20')]=_0x330e18;if(_0x73d359[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x1348ec[_0x65f6('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0x65f6('0x5b')](_0x1348ec);})['then'](function(_0x24495c){_0x5889dc['rows']=_0x24495c;return _0x5889dc;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x4edba0,_0x1348ec))[_0x65f6('0x1b')](handleError(_0x4edba0,null));};exports[_0x65f6('0x5c')]=function(_0x41e59a,_0x535558){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x41e59a[_0x65f6('0x46')]['id']}})['then'](handleEntityNotFound(_0x535558,null))['then'](function(_0xccd888){if(_0xccd888){return _0xccd888[_0x65f6('0x5c')](_0x41e59a['query'][_0x65f6('0x5d')]);}})[_0x65f6('0x12')](respondWithStatusCode(_0x535558,null))[_0x65f6('0x1b')](handleError(_0x535558,null));};exports['addLogo']=function(_0x2c8938,_0xf1e6a1){_0x2c8938['body'][_0x65f6('0x5e')]=_0x2c8938[_0x65f6('0x5f')][_0x65f6('0x60')];return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x2c8938[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0xf1e6a1,null))['then'](saveUpdates(_0x2c8938[_0x65f6('0x52')],null))['then'](respondWithResult(_0xf1e6a1,null))[_0x65f6('0x1b')](handleError(_0xf1e6a1,null));};exports[_0x65f6('0x61')]=function(_0x31ec61,_0x22be6e){_0x31ec61[_0x65f6('0x52')][_0x65f6('0x62')]=_0x31ec61['file'][_0x65f6('0x60')];return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x31ec61[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x22be6e,null))['then'](saveUpdates(_0x31ec61['body'],null))['then'](respondWithResult(_0x22be6e,null))[_0x65f6('0x1b')](handleError(_0x22be6e,null));};exports[_0x65f6('0x63')]=function(_0xcfc47a,_0x59b715){_0xcfc47a[_0x65f6('0x52')]['customerAvatar']=_0xcfc47a['file'][_0x65f6('0x60')];return db[_0x65f6('0x42')]['find']({'where':{'id':_0xcfc47a[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x59b715,null))[_0x65f6('0x12')](saveUpdates(_0xcfc47a[_0x65f6('0x52')],null))[_0x65f6('0x12')](respondWithResult(_0x59b715,null))[_0x65f6('0x1b')](handleError(_0x59b715,null));};exports[_0x65f6('0x64')]=function(_0x3291ac,_0x477f29){_0x3291ac[_0x65f6('0x52')][_0x65f6('0x65')]=_0x3291ac[_0x65f6('0x5f')]['filename'];return db[_0x65f6('0x42')]['find']({'where':{'id':_0x3291ac['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x477f29,null))[_0x65f6('0x12')](saveUpdates(_0x3291ac[_0x65f6('0x52')],null))[_0x65f6('0x12')](respondWithResult(_0x477f29,null))['catch'](handleError(_0x477f29,null));};exports[_0x65f6('0x66')]=function(_0x565b63,_0x490512){var _0x416ed4=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x69'));var _0xd893ef={'where':{'id':_0x565b63[_0x65f6('0x46')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5c8131=![];return require('../../config/license/util')[_0x65f6('0x6a')]()[_0x65f6('0x12')](function(_0x365044){if(_0x365044){_0x5c8131=_0x365044['custom'];}})[_0x65f6('0x12')](function(){return db['ChatWebsite']['find'](_0xd893ef);})[_0x65f6('0x12')](handleEntityNotFound(_0x490512,null))[_0x65f6('0x12')](function(_0x2dbed5){if(_0x2dbed5){if(!_[_0x65f6('0x6b')](_0x2dbed5[_0x65f6('0x5e')])){if(fs['existsSync'](path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x6c'),_0x2dbed5[_0x65f6('0x5e')]))&&_0x5c8131){_0x416ed4=path['join'](config[_0x65f6('0x68')],_0x65f6('0x6c'),_0x2dbed5[_0x65f6('0x5e')]);}}return _0x490512[_0x65f6('0x6d')](_0x416ed4);}})[_0x65f6('0x1b')](handleError(_0x490512,null));};exports[_0x65f6('0x6e')]=function(_0x2f9814,_0x8aab06){var _0x558410=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x6f'));var _0x8adb47={'where':{'id':_0x2f9814[_0x65f6('0x46')]['id']},'attributes':['id',_0x65f6('0x62')],'raw':!![]};return db['ChatWebsite'][_0x65f6('0x4f')](_0x8adb47)[_0x65f6('0x12')](handleEntityNotFound(_0x8aab06,null))['then'](function(_0x34f1e6){if(_0x34f1e6){if(!_['isNil'](_0x34f1e6[_0x65f6('0x62')])){if(fs[_0x65f6('0x70')](path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x34f1e6['agentAvatar']))){_0x558410=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x34f1e6[_0x65f6('0x62')]);}}return _0x8aab06[_0x65f6('0x6d')](_0x558410);}})['catch'](handleError(_0x8aab06,null));};exports['getCustomerAvatar']=function(_0x38006c,_0x22a9e7){var _0x2993ee=path[_0x65f6('0x67')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x534004={'where':{'id':_0x38006c[_0x65f6('0x46')]['id']},'attributes':['id',_0x65f6('0x72'),_0x65f6('0x73')],'raw':!![]};return db['ChatWebsite'][_0x65f6('0x4f')](_0x534004)[_0x65f6('0x12')](handleEntityNotFound(_0x22a9e7,null))[_0x65f6('0x12')](function(_0x18c6a8){if(_0x18c6a8){if(!_[_0x65f6('0x6b')](_0x18c6a8['customerAvatar'])){if(fs[_0x65f6('0x70')](path[_0x65f6('0x67')](config['root'],'server/files/images/avatars/',_0x18c6a8[_0x65f6('0x72')]))&&_0x18c6a8[_0x65f6('0x73')]){_0x2993ee=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x18c6a8['customerAvatar']);}}return _0x22a9e7[_0x65f6('0x6d')](_0x2993ee);}})['catch'](handleError(_0x22a9e7,null));};exports[_0x65f6('0x74')]=function(_0x5d181a,_0x38fcc9){var _0x5cec52=path[_0x65f6('0x67')](config['root'],_0x65f6('0x75'));var _0x3b9aed={'where':{'id':_0x5d181a['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x65f6('0x42')][_0x65f6('0x4f')](_0x3b9aed)[_0x65f6('0x12')](handleEntityNotFound(_0x38fcc9,null))[_0x65f6('0x12')](function(_0x861892){if(_0x861892){if(!_[_0x65f6('0x6b')](_0x861892[_0x65f6('0x65')])){if(fs[_0x65f6('0x70')](path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x861892[_0x65f6('0x65')]))){_0x5cec52=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x861892[_0x65f6('0x65')]);}}return _0x38fcc9[_0x65f6('0x6d')](_0x5cec52);}})['catch'](handleError(_0x38fcc9,null));};exports[_0x65f6('0x76')]=function(_0x91d7bf,_0x11bdf3){var _0x16e246=require(_0x65f6('0x77'));var _0x1dbf36=new _0x16e246();var _0x849936=_0x1dbf36[_0x65f6('0x78')](_0x91d7bf[_0x65f6('0x79')]['user-agent'])[_0x65f6('0x7a')]();var _0x585e99={'body':_0x91d7bf[_0x65f6('0x52')],'channel':_0x65f6('0x7b')};var _0x5c2f2c=[];var _0x38db52=[];var _0x39dedf={};var _0x5c7462=![];return db[_0x65f6('0x7c')][_0x65f6('0x53')]()[_0x65f6('0x12')](function(_0x207831){if(!_0x207831){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))]('no\x20available\x20attributes');}_0x5c2f2c=_[_0x65f6('0x7f')](_[_0x65f6('0x48')](_0x207831),[_0x65f6('0x80'),_0x65f6('0x81')]);_0x38db52=_['difference'](_['keys'](_0x207831),['createdAt',_0x65f6('0x81'),_0x65f6('0x82'),_0x65f6('0x83')]);if(_0x91d7bf[_0x65f6('0x52')]['id']){delete _0x91d7bf[_0x65f6('0x52')]['id'];}if(_['isNil'](_0x91d7bf['body'][_0x65f6('0x84')])){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x91d7bf[_0x65f6('0x52')]['body'])||_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x52')]===''){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))](_0x65f6('0x85'));}if(_[_0x65f6('0x6b')](_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x86')])){throw new db[(_0x65f6('0x7d'))]['ValidationError'](_0x65f6('0x87')+_0x38db52);}if(!_[_0x65f6('0x88')](_0x38db52,_0x91d7bf['body'][_0x65f6('0x86')])){throw new db['Sequelize'][(_0x65f6('0x7e'))](_0x65f6('0x89')+_0x38db52);}_0x39dedf[_0x91d7bf[_0x65f6('0x52')]['mapKey']]=_0x91d7bf[_0x65f6('0x52')]['from'];})['then'](function(){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x91d7bf['params']['id']},'include':[{'model':db[_0x65f6('0x8a')],'as':'List','include':[{'model':db[_0x65f6('0x7c')],'as':_0x65f6('0x8b'),'where':_0x39dedf,'limit':0x1,'order':[[_0x65f6('0x81'),_0x65f6('0x8c')]]}]},{'model':db[_0x65f6('0x8d')],'as':_0x65f6('0x8e')}]});})[_0x65f6('0x12')](handleEntityNotFound(_0x11bdf3,null))[_0x65f6('0x12')](function(_0x5ed6ff){if(_0x5ed6ff&&_0x5ed6ff[_0x65f6('0x8f')]){_0x585e99[_0x65f6('0x90')]=_0x5ed6ff;_0x585e99[_0x65f6('0x91')]=_0x5ed6ff[_0x65f6('0x8e')];_0x585e99[_0x65f6('0x92')]=_0x5ed6ff['List'];_0x585e99[_0x65f6('0x91')]=_['orderBy'](_0x585e99[_0x65f6('0x91')],['priority'],[_0x65f6('0x93')]);if(_0x585e99[_0x65f6('0x90')][_0x65f6('0x8e')]){delete _0x585e99[_0x65f6('0x90')][_0x65f6('0x8e')];}if(_0x585e99[_0x65f6('0x90')][_0x65f6('0x8f')]&&_0x585e99[_0x65f6('0x90')][_0x65f6('0x8f')][_0x65f6('0x8b')][_0x65f6('0x37')]){return _0x585e99[_0x65f6('0x90')][_0x65f6('0x8f')][_0x65f6('0x8b')][0x0];}var _0x37fa08=_[_0x65f6('0x9')](_0x91d7bf[_0x65f6('0x52')],{'firstName':_0x91d7bf['body'][_0x65f6('0x84')],'ListId':_0x5ed6ff['ListId']});_0x37fa08[_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x86')]]=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x84')];return db[_0x65f6('0x7c')][_0x65f6('0x4b')](_0x37fa08,{'fields':_0x5c2f2c,'raw':!![]});}})['then'](handleEntityNotFound(_0x11bdf3,null))[_0x65f6('0x12')](function(_0x1ac0bd){_0x585e99[_0x65f6('0x94')]=_0x1ac0bd;var _0x359734=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x95')];if(_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x96')]){_0x359734=_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x96')];}else if(_0x91d7bf[_0x65f6('0x79')]['x-forwarded-for']){_0x359734=_['first'](_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x97')][_0x65f6('0x98')](','));}if(_0x1ac0bd){var _0x179fed={'ContactId':_0x1ac0bd['id'],'ChatWebsiteId':_0x91d7bf[_0x65f6('0x46')]['id'],'from':(_0x1ac0bd[_0x65f6('0x99')]||'')+'\x20'+(_0x1ac0bd[_0x65f6('0x9a')]||''),'customerIp':_0x359734,'customerPort':_0x91d7bf['headers'][_0x65f6('0x9b')]?_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x9b')]:null,'referer':_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x9c')],'browserName':_0x849936[_0x65f6('0x9d')][_0x65f6('0x2c')]&&_0x849936[_0x65f6('0x9d')][_0x65f6('0x9e')]?util[_0x65f6('0x9f')](_0x65f6('0xa0'),_0x849936[_0x65f6('0x9d')][_0x65f6('0x2c')],_0x849936['browser']['version']):'unknown','browserVersion':_0x849936[_0x65f6('0x9d')][_0x65f6('0x9e')]||_0x65f6('0xa1'),'osName':util['format'](_0x65f6('0xa0'),_0x849936['os'][_0x65f6('0x2c')],_0x849936['os'][_0x65f6('0x9e')]),'osVersion':_0x849936['os']['version'],'deviceModel':_0x849936[_0x65f6('0xa2')][_0x65f6('0x31')]&&_0x849936['device'][_0x65f6('0xa3')]?util[_0x65f6('0x9f')](_0x65f6('0xa4'),_0x849936['device'][_0x65f6('0x31')],_0x849936[_0x65f6('0xa2')][_0x65f6('0xa3')],_0x849936[_0x65f6('0xa2')][_0x65f6('0x30')]):null,'deviceVendor':_0x849936[_0x65f6('0xa2')][_0x65f6('0xa3')],'deviceType':_0x849936[_0x65f6('0xa2')][_0x65f6('0x30')],'formData':JSON[_0x65f6('0xa5')](_0x91d7bf['body'])};var _0x43c89e={'ChatWebsiteId':_0x91d7bf[_0x65f6('0x46')]['id'],'closed':![]};if(_0x91d7bf[_0x65f6('0x52')]['threadId']){_0x43c89e['threadId']=_0x91d7bf[_0x65f6('0x52')]['threadId'];return db[_0x65f6('0xa6')][_0x65f6('0x4f')]({'where':_0x43c89e})[_0x65f6('0x12')](function(_0xbf4abe){if(_0xbf4abe){return[_0xbf4abe,![]];}_0x179fed[_0x65f6('0xa7')]=_0x91d7bf['body'][_0x65f6('0xa7')];_0x179fed[_0x65f6('0xa8')]=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xa8')];return db['ChatInteraction'][_0x65f6('0x4b')](_0x179fed)[_0x65f6('0x12')](function(_0x11d3fb){return[_0x11d3fb,!![]];});});}_0x43c89e[_0x65f6('0xa9')]=_0x1ac0bd['id'];if(_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xaa')]&&_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xaa')]['id']){_0x43c89e['id']=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xaa')]['id'];return db[_0x65f6('0xa6')][_0x65f6('0x4f')]({'where':_0x43c89e})[_0x65f6('0x12')](function(_0x31e87d){if(_0x31e87d){return[_0x31e87d,![]];}return db[_0x65f6('0xa6')]['create'](_0x179fed)[_0x65f6('0x12')](function(_0x1cca16){return[_0x1cca16,!![]];});});}return db['ChatInteraction']['create'](_0x179fed)[_0x65f6('0x12')](function(_0x7c1efc){return[_0x7c1efc,!![]];});}})[_0x65f6('0xab')](function(_0x2bcdec,_0x21b9ba){if(_0x2bcdec){_0x5c7462=_0x21b9ba;if(!_0x21b9ba){var _0x33e01f={'from':(_0x585e99[_0x65f6('0x94')]['firstName']||'')+'\x20'+(_0x585e99[_0x65f6('0x94')]['lastName']||'')};if(_0x91d7bf['body'][_0x65f6('0xa7')]&&_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xac')]&&_0x91d7bf[_0x65f6('0x52')]['threadId']!=_0x91d7bf['body'][_0x65f6('0xac')]){_0x33e01f[_0x65f6('0xa7')]=_0x91d7bf['body']['messageId'];}return _0x2bcdec['update'](_0x33e01f);}else{return _0x2bcdec;}}})[_0x65f6('0x12')](function(_0x42dc3a){_0x585e99[_0x65f6('0xaa')]=_0x42dc3a[_0x65f6('0x27')]({'plain':!![]});_0x585e99[_0x65f6('0xaa')]['created']=_0x5c7462;if(_0x585e99['interaction'][_0x65f6('0xad')]){if(_0x585e99[_0x65f6('0x90')][_0x65f6('0xae')]){_0x585e99['applications']['push']({'id':0x0,'priority':_0x585e99[_0x65f6('0x91')][_0x65f6('0x37')]+0x1,'app':'close','appdata':_0x65f6('0xaf'),'interval':_0x65f6('0xb0')});}}return db['ChatMessage'][_0x65f6('0x4b')]({'body':_0x91d7bf['body'][_0x65f6('0x52')],'ChatWebsiteId':_0x91d7bf[_0x65f6('0x46')]['id'],'ChatInteractionId':_0x42dc3a['id'],'direction':'in','ContactId':_0x585e99[_0x65f6('0x94')]['id'],'AttachmentId':_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xb1')]});})[_0x65f6('0x12')](function(_0x5ca33e){_0x585e99[_0x65f6('0x19')]=_0x5ca33e;if(_0x585e99[_0x65f6('0xaa')]['UserId']){return db[_0x65f6('0xb2')][_0x65f6('0x4f')]({'attributes':['id',_0x65f6('0x2c')],'where':{'id':_0x585e99['interaction']['UserId']}})[_0x65f6('0x12')](function(_0x2229ae){if(_0x2229ae){_0x585e99[_0x65f6('0x91')][_0x65f6('0xb3')]({'id':0x0,'priority':0x0,'app':_0x65f6('0xb4'),'appdata':_0x2229ae[_0x65f6('0x2c')]+','+(_0x585e99['account']['waitForTheAssignedAgent']||0xa),'interval':_0x65f6('0xb0')});_0x585e99[_0x65f6('0xb5')]=!![];}return respondWithRpcPromise(_0x65f6('0xb6'),_0x65f6('0xb7'),_0x585e99);});}return respondWithRpcPromise(_0x65f6('0xb6'),_0x65f6('0xb7'),_0x585e99);})[_0x65f6('0x12')](function(_0x4146df){respondWithRpcPromise(_0x65f6('0xb8'),_0x65f6('0xb8'),{'event':_0x65f6('0x76'),'message':_0x4146df},client9002);return _0x4146df;})[_0x65f6('0x12')](respondWithResult(_0x11bdf3,null))['catch'](handleError(_0x11bdf3,null));};exports[_0x65f6('0xb9')]=function(_0x3d2328,_0x21a8c9){var _0x101050,_0x3be8bc,_0x385d13;var _0xd00f2f=[];var _0x868a4f={};var _0x2820b3=_0x3d2328[_0x65f6('0xba')]||[];var _0x591fcd=[];var _0x4dfda4;return db[_0x65f6('0x7c')][_0x65f6('0x53')]()['then'](function(_0x1db7e4){if(!_0x1db7e4){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))]('no\x20available\x20attributes');}_0xd00f2f=_['difference'](_[_0x65f6('0x48')](_0x1db7e4),[_0x65f6('0x80'),_0x65f6('0x81'),_0x65f6('0x82'),_0x65f6('0x83')]);if(_0x3d2328[_0x65f6('0x52')]['id']){delete _0x3d2328[_0x65f6('0x52')]['id'];}if(_[_0x65f6('0x6b')](_0x3d2328[_0x65f6('0x52')][_0x65f6('0x84')])){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)[_0x65f6('0xbb')](new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))](_0x65f6('0xbc')));}if(_[_0x65f6('0x6b')](_0x3d2328[_0x65f6('0x52')][_0x65f6('0x52')])||_0x3d2328['body'][_0x65f6('0x52')]===''){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)[_0x65f6('0xbb')](new db[(_0x65f6('0x7d'))]['ValidationError'](_0x65f6('0x85')));}if(_['isNil'](_0x3d2328[_0x65f6('0x52')][_0x65f6('0xbd')])){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)[_0x65f6('0xbb')](new db[(_0x65f6('0x7d'))]['ValidationError'](_0x65f6('0xbe')+_0xd00f2f));}if(!_['includes'](_0xd00f2f,_0x3d2328['body']['mapKeyOffline'])){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)['send'](new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))](_0x65f6('0xbf')+_0xd00f2f));}_0x868a4f[_0x3d2328[_0x65f6('0x52')][_0x65f6('0xbd')]]=_0x3d2328[_0x65f6('0x52')][_0x65f6('0x84')];})[_0x65f6('0x12')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x3d2328[_0x65f6('0x46')]['id']},'include':[{'model':db[_0x65f6('0x8a')],'as':'List'},{'model':db[_0x65f6('0xc0')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x21a8c9,null))[_0x65f6('0x12')](function(_0x74f19d){if(_0x74f19d&&_0x74f19d[_0x65f6('0x8f')]){_0x3be8bc=_0x74f19d;var _0x1050c7=_[_0x65f6('0x9')](_0x3d2328['body'],{'firstName':_0x3d2328[_0x65f6('0x52')]['from'],'phone':_0x3d2328[_0x65f6('0x52')]['from'],'ListId':_0x74f19d['ListId']});_0x1050c7[_0x3d2328[_0x65f6('0x52')][_0x65f6('0xbd')]]=_0x3d2328[_0x65f6('0x52')][_0x65f6('0x84')];return db[_0x65f6('0x7c')][_0x65f6('0xc1')]({'where':_0x868a4f,'defaults':_0x1050c7});}})[_0x65f6('0xab')](function(_0x2ff0f5){if(_0x2ff0f5){_0x385d13=_0x2ff0f5;var _0x504520=fs[_0x65f6('0xc2')](path['join'](config[_0x65f6('0x68')],_0x65f6('0xc3')),_0x65f6('0xc4'));var _0x588b38=ejs[_0x65f6('0xc5')](_0x504520,{'body':_[_0x65f6('0xc6')](_0x3d2328['body'][_0x65f6('0x52')]),'bodyTitle':_0x3be8bc[_0x65f6('0xc7')]});return db[_0x65f6('0xc8')][_0x65f6('0x4b')]({'body':_0x588b38,'plainBody':htmlToText[_0x65f6('0xc9')](_0x588b38),'ContactId':_0x2ff0f5['id'],'ChatWebsiteId':_0x3be8bc['id']});}})['then'](function(_0x428a19){_0x4dfda4=_0x428a19;if(_0x2820b3[_0x65f6('0x37')]){var _0x410442=_0x2820b3['map'](function(_0x4c1149){return{'name':_0x4c1149[_0x65f6('0xca')],'basename':_0x4c1149[_0x65f6('0x60')],'type':_0x4c1149[_0x65f6('0xcb')],'ChatOfflineMessageId':_0x428a19['id']};});_0x591fcd=_0x410442[_0x65f6('0x2f')](_0x3d1df9=>{var _0x5b4033={'filename':_0x3d1df9['name'],'path':path['join'](config[_0x65f6('0x68')],_0x65f6('0xcc'),'files','attachments','offline-chat',_0x3d1df9[_0x65f6('0xcd')])};return _0x5b4033;});if(!_0x3be8bc[_0x65f6('0xce')]){return db[_0x65f6('0xcf')][_0x65f6('0xd0')](function(_0x1be461){return db[_0x65f6('0xd1')][_0x65f6('0xd2')](_0x410442,{'transaction':_0x1be461});});}}})[_0x65f6('0x12')](function(){if(_0x4dfda4){_0x101050=_0x4dfda4;return db[_0x65f6('0xc0')][_0x65f6('0xd3')]({'where':{'active':!![]},'include':[{'model':db[_0x65f6('0xd4')],'as':_0x65f6('0xd5'),'raw':!![]}]});}})[_0x65f6('0x12')](function(_0x62136d){if(_0x62136d&&_0x62136d[_0x65f6('0xd5')]&&_0x3be8bc['forwardOffline']&&_0x3be8bc[_0x65f6('0xd6')]){var _0x1979c2={'tls':{'rejectUnauthorized':![]}};if(_0x62136d[_0x65f6('0xd5')][_0x65f6('0xd7')]){_0x1979c2[_0x65f6('0xd7')]=_0x62136d[_0x65f6('0xd5')]['service'];}else{_0x1979c2[_0x65f6('0xd8')]=_0x62136d[_0x65f6('0xd5')]['host'];_0x1979c2['port']=_0x62136d[_0x65f6('0xd5')]['port'];_0x1979c2['secure']=_0x62136d[_0x65f6('0xd5')][_0x65f6('0xd9')];}if(_0x62136d['Smtp'][_0x65f6('0xda')]){_0x1979c2[_0x65f6('0xdb')]={'user':_0x62136d['Smtp'][_0x65f6('0x4c')],'pass':_0x62136d[_0x65f6('0xd5')][_0x65f6('0xdc')]};}return respondWithRpcPromise(_0x65f6('0xdd'),_0x65f6('0xde'),{'account':_0x1979c2,'message':{'from':util[_0x65f6('0x9f')](_0x65f6('0xdf'),_0x62136d[_0x65f6('0x2c')],_0x62136d[_0x65f6('0xe0')]||_0x62136d['Smtp'][_0x65f6('0x4c')]),'to':_0x3be8bc[_0x65f6('0xd6')],'subject':_0x3be8bc[_0x65f6('0xe1')],'html':_0x101050[_0x65f6('0x52')],'attachments':_0x591fcd}},client9003)[_0x65f6('0x12')](function(){return _0x101050;})[_0x65f6('0x1b')](function(_0x4e4726){console[_0x65f6('0x17')](_0x4e4726);});}})['then'](function(){if(_0x3be8bc&&_0x3be8bc['openNewInteraction']&&_0x3be8bc['MailAccountId']){var _0x3f770a=[];if(_0x2820b3['length']){_0x3f770a=_0x2820b3[_0x65f6('0x2f')](function(_0x408f37){return{'name':_0x408f37[_0x65f6('0xca')],'basename':_0x408f37[_0x65f6('0x60')],'type':_0x408f37[_0x65f6('0xcb')],'ChatOfflineMessageId':_0x4dfda4['id']};});}var _0x355476;if(!_[_0x65f6('0x6b')](_0x3be8bc['subjectOffline'])){var _0x5db63d=_[_0x65f6('0x2f')](_0x3d2328[_0x65f6('0x52')],function(_0x11edd6){return _0x11edd6;});var _0x4bb32e=_[_0x65f6('0xe2')](_0x5db63d)[0x0];var _0x5d8c8e=_[_0x65f6('0xe3')](_0x4bb32e,function(_0x2b1dfc){return _0x2b1dfc;});_0x355476=_0x5d8c8e[0x1][_0x3be8bc[_0x65f6('0xe4')]];}var _0x4b920a={'from':_0x385d13[_0x65f6('0xe0')],'firstName':_0x385d13[_0x65f6('0x99')],'lastName':_0x385d13[_0x65f6('0x9a')],'mapKey':_0x65f6('0xe0'),'message':{'from':_0x385d13['email'],'to':_0x3be8bc['MailAccount'][_0x65f6('0xe0')],'cc':'','subject':_['isNil'](_0x355476)?_0x3be8bc[_0x65f6('0xe1')]:_0x355476,'messageId':'','sentAt':new Date(),'attach':_0x3f770a['length'],'attachments':_0x3f770a,'originChannel':_0x65f6('0xe5'),'ChatWebsiteId':_0x3be8bc['id'],'ChatOfflineMessageId':_0x101050['id'],'originTo':_0x3be8bc[_0x65f6('0xc0')][_0x65f6('0xe0')]},'body':_0x101050['body']};var _0x3225b6={'account':{'id':_0x3be8bc[_0x65f6('0xe6')]},'body':_0x4b920a,'log':_0x65f6('0xe7')};return respondWithRpcPromise(_0x65f6('0xe7'),_0x65f6('0xe8'),_0x3225b6,client9001)[_0x65f6('0x12')](function(){return _0x101050;})[_0x65f6('0x1b')](function(_0x4e40d4){console[_0x65f6('0x17')](_0x4e40d4);});}return;})[_0x65f6('0x12')](function(){if(_0x101050){return _0x101050;}})[_0x65f6('0x12')](respondWithResult(_0x21a8c9,null))[_0x65f6('0x1b')](function(_0x72ac02){console[_0x65f6('0x17')](_0x65f6('0x1b'),_0x72ac02);for(var _0xe52598 of _0x2820b3){var _0x1790e4=path['join'](config[_0x65f6('0x68')],'server',_0x65f6('0xba'),_0x65f6('0xe9'),_0x65f6('0xea'),_0xe52598[_0x65f6('0x60')]);fs_extra[_0x65f6('0xeb')](_0x1790e4)[_0x65f6('0x1b')](function(_0x4684ab){console[_0x65f6('0x17')](_0x65f6('0xec'),_0x1790e4,_0x4684ab);});}});};exports[_0x65f6('0xed')]=function(_0x148993,_0x38e6ff){return db[_0x65f6('0xa6')][_0x65f6('0x4f')]({'where':{'id':_0x148993[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x38e6ff,null))[_0x65f6('0x12')](function(_0x560dbb){if(_0x560dbb){return _0x560dbb[_0x65f6('0xed')](_0x148993[_0x65f6('0x52')]['ids'],_[_0x65f6('0xee')](_0x148993[_0x65f6('0x52')],[_0x65f6('0x5d'),'id'])||{});}})[_0x65f6('0x12')](respondWithResult(_0x38e6ff,null))[_0x65f6('0x1b')](handleError(_0x38e6ff,null));};exports[_0x65f6('0xef')]=function(_0x4adb7a,_0x492c89){var _0x409127={'raw':![],'where':{}};var _0x2c0165={};var _0xd11998={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x65f6('0xd3')]({'where':{'id':_0x4adb7a['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x492c89,null))[_0x65f6('0x12')](function(_0x1c8b2e){if(_0x1c8b2e){_0x2c0165[_0x65f6('0x31')]=_['keys'](db[_0x65f6('0xa6')]['rawAttributes']);_0x2c0165[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x4adb7a[_0x65f6('0x32')]);_0x2c0165['filters']=_[_0x65f6('0x34')](_0x2c0165['model'],_0x2c0165['query']);_0x409127[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x2c0165[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x4adb7a[_0x65f6('0x32')][_0x65f6('0x36')]));_0x409127[_0x65f6('0x35')]=_0x409127[_0x65f6('0x35')][_0x65f6('0x37')]?_0x409127[_0x65f6('0x35')]:_0x2c0165[_0x65f6('0x31')];if(!_0x4adb7a['query'][_0x65f6('0x38')]('nolimit')){_0x409127[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x4adb7a['query'][_0x65f6('0x1e')]);_0x409127[_0x65f6('0x21')]=qs['offset'](_0x4adb7a['query'][_0x65f6('0x21')]);}_0x409127['order']=qs['sort'](_0x4adb7a[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x409127[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x4adb7a[_0x65f6('0x32')],_0x2c0165[_0x65f6('0x33')]));_0x409127[_0x65f6('0x3c')][_0x65f6('0x54')]=_0x1c8b2e['id'];if(_0x4adb7a['query'][_0x65f6('0x3e')]){_0x409127[_0x65f6('0x3c')]=_['merge'](_0x409127[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x409127[_0x65f6('0x35')],function(_0xcf934){var _0x73732f={};_0x73732f[_0xcf934]={'$like':'%'+_0x4adb7a[_0x65f6('0x32')]['filter']+'%'};return _0x73732f;})});}_0x409127=_['merge']({},_0x409127,_0x4adb7a[_0x65f6('0x41')]);return db[_0x65f6('0xa6')][_0x65f6('0x20')]({'where':_0x409127[_0x65f6('0x3c')]})[_0x65f6('0x12')](function(_0x4cee07){_0xd11998[_0x65f6('0x20')]=_0x4cee07;if(_0x4adb7a[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x409127[_0x65f6('0x43')]=[{'model':db[_0x65f6('0x7c')],'as':_0x65f6('0xf0'),'required':![]},{'model':db[_0x65f6('0xb2')],'as':_0x65f6('0xf1'),'attributes':[_0x65f6('0x2c'),_0x65f6('0xf2'),_0x65f6('0xf3')],'required':![]},{'model':db['Tag'],'as':_0x65f6('0xf4'),'attributes':['id',_0x65f6('0x2c'),'color'],'where':_0x4adb7a['query'][_0x65f6('0xf5')]?{'id':_0x4adb7a[_0x65f6('0x32')][_0x65f6('0xf5')]}:undefined,'required':_0x4adb7a['query'][_0x65f6('0xf5')]?!![]:![]}];}return db[_0x65f6('0xa6')][_0x65f6('0x5b')](_0x409127);})[_0x65f6('0x12')](function(_0xf29979){_0xd11998[_0x65f6('0x44')]=_0xf29979;return _0xd11998;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x492c89,_0x409127))['catch'](handleError(_0x492c89,null));};function iftimePromise(_0xacdf06,_0x58f7a8){return respondWithRpcPromise(_0x65f6('0xf6'),_0x65f6('0xf7'),{'command':_0x58f7a8[_0x65f6('0xf8')]?util[_0x65f6('0x9f')](_0x65f6('0xf9'),_0xacdf06[_0x65f6('0xfa')],_0x58f7a8['timezone']):util[_0x65f6('0x9f')]('iftime\x20%s',_0xacdf06[_0x65f6('0xfa')])},client9002)['then'](function(_0x32829e){var _0x5258a4=_0x32829e&&_0x32829e[_0x65f6('0xfb')](_0x65f6('0xfc'))>=0x0?!![]:![];logger[_0x65f6('0x13')](_0x65f6('0xfd'),_0x58f7a8['id'],_0xacdf06['id'],_0xacdf06['interval'],_0x5258a4?_0x65f6('0xfe'):_0x65f6('0xff'),_0x58f7a8[_0x65f6('0xf8')]?_0x58f7a8[_0x65f6('0xf8')]:_0x65f6('0x100'));return _0x5258a4;})[_0x65f6('0x1b')](function(_0xd06566){logger[_0x65f6('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x58f7a8['id'],_0xacdf06['id'],_0xacdf06['interval'],util[_0x65f6('0x101')](_0xd06566,{'showHidden':![],'depth':null}),_0x58f7a8[_0x65f6('0xf8')]?_0x58f7a8[_0x65f6('0xf8')]:_0x65f6('0x100'));return![];});}exports['getSnippet']=function(_0x1a25ae,_0x1e1498){var _0x4c63f9=0x0;var _0x13f4a5=0x0;var _0x4315c1=![];var _0x141d13;var _0x575f14;return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x1a25ae['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x65f6('0x102')],'as':_0x65f6('0x103'),'attributes':['id',_0x65f6('0xfa')],'raw':!![]}]}]})[_0x65f6('0x12')](handleEntityNotFound(_0x1e1498,null))[_0x65f6('0x12')](function(_0x39bea9){if(_0x39bea9){_0x141d13=_0x39bea9;return _0x39bea9[_0x65f6('0x104')]({'raw':!![]});}})[_0x65f6('0x12')](function(_0x270944){if(_0x141d13){if(_0x270944){_0x575f14=_0x270944;}}return require(_0x65f6('0x105'))[_0x65f6('0x6a')]();})[_0x65f6('0x12')](function(_0x2a0aab){if(_0x2a0aab){_0x13f4a5=_0x2a0aab[_0x65f6('0x106')];_0x4315c1=_0x2a0aab[_0x65f6('0x107')];}})[_0x65f6('0x12')](function(){return db[_0x65f6('0xa6')][_0x65f6('0x20')]({'where':{'closed':![]}});})['then'](function(_0x4345af){_0x4c63f9=_0x4345af;if(_0x13f4a5&&_0x4345af>_0x13f4a5){return db[_0x65f6('0x108')]['findOne']({'where':{'id':0x1}})['then'](function(_0x23709a){if(_0x23709a){_0x23709a[_0x65f6('0x109')](_0x65f6('0x10a'));}});}})[_0x65f6('0x12')](function(){if(_0x141d13['Interval']&&_0x141d13['Interval'][_0x65f6('0x103')]){var _0x5dc205=[];for(var _0xd2313b=0x0;_0xd2313b<_0x141d13[_0x65f6('0x102')]['Intervals']['length'];_0xd2313b++){var _0x408e74=_0x141d13[_0x65f6('0x102')][_0x65f6('0x103')][_0xd2313b][_0x65f6('0x27')]({'plain':!![]});_0x5dc205['push'](iftimePromise(_0x408e74,_0x141d13));}return BPromise[_0x65f6('0x10b')](_0x5dc205)['then'](function(_0x34542c){return _[_0x65f6('0x10c')](_0x34542c);});}else{return!![];}})[_0x65f6('0x12')](function(_0x2ab4ac){var _0x4bc08e=fs[_0x65f6('0xc2')](path['join'](config[_0x65f6('0x68')],'server/files/chat/iframe.ejs'),'utf8');var _0x38de54={'remote':_0x141d13['remote'],'query':querystring[_0x65f6('0xa5')](_[_0x65f6('0x3f')](_0x141d13[_0x65f6('0x27')]({'plain':!![]}),{'customerIp':_0x1a25ae[_0x65f6('0x79')][_0x65f6('0x97')]||_0x1a25ae[_0x65f6('0x79')][_0x65f6('0x10d')]||_0x1a25ae[_0x65f6('0x10e')][_0x65f6('0x10f')]||_0x1a25ae['ip'],'referer':_0x1a25ae['headers'][_0x65f6('0x9c')],'openedInteractions':_0x4c63f9,'maxInteractions':_0x13f4a5,'virtual':_0x4315c1[_0x65f6('0x106')],'online':_0x2ab4ac,'custom':_0x4315c1}))[_0x65f6('0x110')](/'/g,'\x5c\x27')};_0x1e1498[_0x65f6('0xbb')](ejs['render'](Mustache[_0x65f6('0xc5')](_0x4bc08e,_0x38de54),{'proactiveActions':_0x575f14,'alignment':_0x141d13[_0x65f6('0x111')],'verticalAlignment':_0x141d13['verticalAlignment'],'div_color':_0x141d13[_0x65f6('0x112')],'labelText':_0x141d13[_0x65f6('0x113')],'text_color':_0x141d13[_0x65f6('0x114')],'button_color':_0x141d13[_0x65f6('0x115')],'background_color':_0x141d13[_0x65f6('0x116')]}));})[_0x65f6('0x1b')](handleError(_0x1e1498,null));};exports[_0x65f6('0x117')]=function(_0x112db7,_0x313634){var _0x1779de=_0x112db7[_0x65f6('0x46')]['id'];var _0x4b1ec2=_0x112db7[_0x65f6('0x52')];var _0x533902=0xc8;var _0x3bee71=null;return db['sequelize'][_0x65f6('0xd0')]({'isolationLevel':db[_0x65f6('0xcf')][_0x65f6('0x118')]['ISOLATION_LEVELS'][_0x65f6('0x119')]},function(_0x34ec6b){return db['ChatWebsite'][_0x65f6('0xd3')]({'where':{'id':_0x1779de},'transaction':_0x34ec6b})[_0x65f6('0x12')](function(_0xff9e69){if(_0xff9e69){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x1779de},'transaction':_0x34ec6b})['then'](function(){var _0x4eec1f=_[_0x65f6('0x2f')](_0x4b1ec2,function(_0x14417a){_0x14417a[_0x65f6('0x54')]=_0x1779de;return _0x14417a;});return db[_0x65f6('0x8d')][_0x65f6('0xd2')](_0x4eec1f,{'transaction':_0x34ec6b});});}else{_0x533902=0x194;_0x3bee71=[];}});})[_0x65f6('0x12')](function(){if(_0x533902!==0x194){return db[_0x65f6('0x8d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1779de},'order':_0x65f6('0x11a')})[_0x65f6('0x12')](function(_0x212333){_0x3bee71=_0x212333;});}})[_0x65f6('0x1b')](function(_0x4dbf35){_0x533902=0x1f4;logger[_0x65f6('0x17')](_0x4dbf35['stack']);if(_0x4dbf35[_0x65f6('0x2c')]){delete _0x4dbf35[_0x65f6('0x2c')];}_0x3bee71=_0x4dbf35;})['finally'](function(){if(_0x3bee71===null){_0x313634['sendStatus'](_0x533902);}else{if(_0x533902===0x1f4){_0x313634[_0x65f6('0x1d')](_0x533902)[_0x65f6('0xbb')](_0x3bee71);}else{_0x313634['status'](_0x533902)['json'](_0x3bee71);}}});};exports[_0x65f6('0x11b')]=function(_0x41ee46,_0xa54e78){var _0x31a57d={};var _0x3177f6={};var _0x142593;var _0x2d8fcc;return db[_0x65f6('0x42')][_0x65f6('0xd3')]({'where':{'id':_0x41ee46[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0xa54e78,null))[_0x65f6('0x12')](function(_0x1556ab){if(_0x1556ab){_0x142593=_0x1556ab;_0x3177f6[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0x8d')]['rawAttributes']);_0x3177f6['query']=_[_0x65f6('0x48')](_0x41ee46[_0x65f6('0x32')]);_0x3177f6[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x3177f6[_0x65f6('0x31')],_0x3177f6[_0x65f6('0x32')]);_0x31a57d[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x3177f6[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x41ee46['query'][_0x65f6('0x36')]));_0x31a57d['attributes']=_0x31a57d['attributes'][_0x65f6('0x37')]?_0x31a57d[_0x65f6('0x35')]:_0x3177f6[_0x65f6('0x31')];_0x31a57d[_0x65f6('0x3a')]=qs['sort'](_0x41ee46[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x31a57d[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x41ee46[_0x65f6('0x32')],_0x3177f6[_0x65f6('0x33')]));if(_0x41ee46[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x31a57d[_0x65f6('0x3c')]=_['merge'](_0x31a57d['where'],{'$or':_[_0x65f6('0x2f')](_0x31a57d[_0x65f6('0x35')],function(_0x457fa8){var _0x15f247={};_0x15f247[_0x457fa8]={'$like':'%'+_0x41ee46[_0x65f6('0x32')][_0x65f6('0x3e')]+'%'};return _0x15f247;})});}_0x31a57d=_[_0x65f6('0x3f')]({},_0x31a57d,_0x41ee46[_0x65f6('0x41')]);return _0x142593['getApplications'](_0x31a57d);}})['then'](function(_0x1ebe7e){if(_0x1ebe7e){_0x2d8fcc=_0x1ebe7e[_0x65f6('0x37')];if(!_0x41ee46['query'][_0x65f6('0x38')](_0x65f6('0x39'))){_0x31a57d[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x41ee46[_0x65f6('0x32')][_0x65f6('0x1e')]);_0x31a57d['offset']=qs[_0x65f6('0x21')](_0x41ee46[_0x65f6('0x32')]['offset']);}return _0x142593['getApplications'](_0x31a57d);}})[_0x65f6('0x12')](function(_0x3743eb){if(_0x3743eb){return _0x3743eb?{'count':_0x2d8fcc,'rows':_0x3743eb}:null;}})[_0x65f6('0x12')](respondWithResult(_0xa54e78,null))[_0x65f6('0x1b')](handleError(_0xa54e78,null));};exports[_0x65f6('0x11c')]=function(_0x3dd349,_0x4c7b0a){return db['chatProactiveAction'][_0x65f6('0x4f')]({'where':{'id':_0x3dd349[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x4c7b0a,null))['then'](function(_0x25684b){if(_0x25684b){return _0x25684b[_0x65f6('0x11c')](_0x3dd349[_0x65f6('0x52')]['ids'],_[_0x65f6('0xee')](_0x3dd349[_0x65f6('0x52')],[_0x65f6('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x4c7b0a,null))[_0x65f6('0x1b')](handleError(_0x4c7b0a,null));};exports[_0x65f6('0x104')]=function(_0x1ad645,_0x3b062b){var _0x2c1a02={};var _0x15bdd2={};var _0x20fbe4;var _0x4316bc;return db[_0x65f6('0x42')][_0x65f6('0xd3')]({'where':{'id':_0x1ad645['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x3b062b,null))['then'](function(_0x2086ce){if(_0x2086ce){_0x20fbe4=_0x2086ce;_0x15bdd2['model']=_['keys'](db[_0x65f6('0x11d')][_0x65f6('0x49')]);_0x15bdd2['query']=_[_0x65f6('0x48')](_0x1ad645[_0x65f6('0x32')]);_0x15bdd2[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x15bdd2[_0x65f6('0x31')],_0x15bdd2['query']);_0x2c1a02['attributes']=_['intersection'](_0x15bdd2[_0x65f6('0x31')],qs['fields'](_0x1ad645[_0x65f6('0x32')][_0x65f6('0x36')]));_0x2c1a02[_0x65f6('0x35')]=_0x2c1a02[_0x65f6('0x35')][_0x65f6('0x37')]?_0x2c1a02[_0x65f6('0x35')]:_0x15bdd2[_0x65f6('0x31')];_0x2c1a02['order']=qs['sort'](_0x1ad645['query'][_0x65f6('0x3b')]);_0x2c1a02[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x1ad645['query'],_0x15bdd2[_0x65f6('0x33')]));if(_0x1ad645['query']['filter']){_0x2c1a02[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x2c1a02['where'],{'$or':_[_0x65f6('0x2f')](_0x2c1a02[_0x65f6('0x35')],function(_0xb4e1c5){var _0x390553={};_0x390553[_0xb4e1c5]={'$like':'%'+_0x1ad645['query']['filter']+'%'};return _0x390553;})});}_0x2c1a02=_[_0x65f6('0x3f')]({},_0x2c1a02,_0x1ad645[_0x65f6('0x41')]);return _0x20fbe4['getProactiveActions'](_0x2c1a02);}})[_0x65f6('0x12')](function(_0x13ecb8){if(_0x13ecb8){_0x4316bc=_0x13ecb8[_0x65f6('0x37')];if(!_0x1ad645[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x2c1a02[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x1ad645[_0x65f6('0x32')]['limit']);_0x2c1a02[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x1ad645[_0x65f6('0x32')][_0x65f6('0x21')]);}return _0x20fbe4['getProactiveActions'](_0x2c1a02);}})['then'](function(_0x2c6cca){if(_0x2c6cca){return _0x2c6cca?{'count':_0x4316bc,'rows':_0x2c6cca}:null;}})['then'](respondWithResult(_0x3b062b,null))[_0x65f6('0x1b')](handleError(_0x3b062b,null));};exports[_0x65f6('0x11e')]=function(_0x3d46d4,_0xf51395){var _0x5b3abc=_0x3d46d4[_0x65f6('0x32')]['online']===_0x65f6('0x11f')?_0x65f6('0x120'):'onlineForm';return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'attributes':['id',_0x5b3abc],'where':{'id':_0x3d46d4[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0xf51395,null))[_0x65f6('0x12')](function(_0x9c768){if(_0x9c768){var _0x5b2cc1=_0x9c768[_0x5b3abc];var _0x62830b=_0x5b2cc1&&_0x5b2cc1['items']?_0x5b2cc1[_0x65f6('0x121')]:[];_0xf51395['send']({'fromKey':_[_0x65f6('0x6b')](_0x5b2cc1[_0x65f6('0x122')])?undefined:_0x5b2cc1['fromKey'],'count':_0x62830b[_0x65f6('0x37')],'rows':_0x62830b});}})[_0x65f6('0x1b')](handleError(_0xf51395,null));};exports['getOfflineMessages']=function(_0x42ad46,_0x4dd517){var _0x2dcf79={'raw':![],'where':{}};var _0x333da7={};var _0x10c466={'count':0x0,'rows':[]};return db[_0x65f6('0x42')][_0x65f6('0xd3')]({'where':{'id':_0x42ad46[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x4dd517,null))[_0x65f6('0x12')](function(_0x1c9d56){if(_0x1c9d56){_0x333da7[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0xc8')][_0x65f6('0x49')]);_0x333da7[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x42ad46[_0x65f6('0x32')]);_0x333da7['filters']=_[_0x65f6('0x34')](_0x333da7[_0x65f6('0x31')],_0x333da7['query']);_0x2dcf79[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x333da7[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x42ad46[_0x65f6('0x32')][_0x65f6('0x36')]));_0x2dcf79[_0x65f6('0x35')]=_0x2dcf79[_0x65f6('0x35')][_0x65f6('0x37')]?_0x2dcf79[_0x65f6('0x35')]:_0x333da7['model'];if(!_0x42ad46['query'][_0x65f6('0x38')](_0x65f6('0x39'))){_0x2dcf79['limit']=qs[_0x65f6('0x1e')](_0x42ad46[_0x65f6('0x32')][_0x65f6('0x1e')]);_0x2dcf79[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x42ad46['query']['offset']);}_0x2dcf79['order']=qs[_0x65f6('0x3b')](_0x42ad46[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x2dcf79[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_['pick'](_0x42ad46[_0x65f6('0x32')],_0x333da7['filters']));_0x2dcf79[_0x65f6('0x3c')][_0x65f6('0x54')]=_0x1c9d56['id'];if(_0x42ad46[_0x65f6('0x32')]['filter']){_0x2dcf79[_0x65f6('0x3c')]=_['merge'](_0x2dcf79[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x2dcf79['attributes'],function(_0x230125){var _0xe75255={};_0xe75255[_0x230125]={'$like':'%'+_0x42ad46['query'][_0x65f6('0x3e')]+'%'};return _0xe75255;})});}_0x2dcf79=_[_0x65f6('0x3f')]({},_0x2dcf79,_0x42ad46[_0x65f6('0x41')]);return db[_0x65f6('0xc8')][_0x65f6('0x20')]({'where':_0x2dcf79['where']})[_0x65f6('0x12')](function(_0x4416b4){_0x10c466['count']=_0x4416b4;if(_0x42ad46[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x2dcf79['include']=[{'all':!![]}];}else{_0x2dcf79['include']=[{'model':db[_0x65f6('0x7c')],'as':'Contact','required':![]},{'model':db[_0x65f6('0xd1')],'as':_0x65f6('0x123'),'required':![]}];}return db[_0x65f6('0xc8')][_0x65f6('0x5b')](_0x2dcf79);})[_0x65f6('0x12')](function(_0x2e36c8){_0x10c466[_0x65f6('0x44')]=_0x2e36c8;return _0x10c466;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x4dd517,_0x2dcf79))[_0x65f6('0x1b')](handleError(_0x4dd517,null));};exports[_0x65f6('0x124')]=function(_0x52556c,_0x4665ec){return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x52556c[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x4665ec,null))[_0x65f6('0x12')](function(_0x57c109){if(_0x57c109){return _0x57c109['addAgents'](_0x52556c[_0x65f6('0x52')][_0x65f6('0x5d')],_[_0x65f6('0xee')](_0x52556c[_0x65f6('0x52')],[_0x65f6('0x5d'),'id'])||{})[_0x65f6('0xab')](function(_0x5052d0){for(var _0x5dcfb7=0x0;_0x5dcfb7<_0x52556c[_0x65f6('0x52')]['ids'][_0x65f6('0x37')];_0x5dcfb7+=0x1){socket[_0x65f6('0x125')](_0x65f6('0x126'),{'UserId':Number(_0x52556c[_0x65f6('0x52')][_0x65f6('0x5d')][_0x5dcfb7]),'ChatWebsiteId':Number(_0x52556c['params']['id'])});}return _0x5052d0;});}})[_0x65f6('0x12')](respondWithResult(_0x4665ec,null))['catch'](handleError(_0x4665ec,null));};exports[_0x65f6('0x127')]=function(_0xab6058,_0x57d25c){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0xab6058[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x57d25c,null))['then'](function(_0x402a5e){if(_0x402a5e){return _0x402a5e[_0x65f6('0x127')](_0xab6058[_0x65f6('0x32')]['ids'])[_0x65f6('0x12')](function(){if(_[_0x65f6('0x128')](_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')])){for(var _0x146686=0x0;_0x146686<_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')][_0x65f6('0x37')];_0x146686+=0x1){socket[_0x65f6('0x125')]('userChatWebsite:remove',{'UserId':Number(_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')][_0x146686]),'ChatWebsiteId':Number(_0xab6058[_0x65f6('0x46')]['id'])});}}else{socket[_0x65f6('0x125')](_0x65f6('0x129'),{'UserId':Number(_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')]),'ChatWebsiteId':Number(_0xab6058[_0x65f6('0x46')]['id'])});}});}})[_0x65f6('0x12')](respondWithStatusCode(_0x57d25c,null))[_0x65f6('0x1b')](handleError(_0x57d25c,null));};exports[_0x65f6('0x12a')]=function(_0x9d31a8,_0x56a917){var _0x5bc949={};var _0xcecebe={};var _0xbf5cba;var _0xfbd390;return db[_0x65f6('0x42')]['findOne']({'where':{'id':_0x9d31a8[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x56a917,null))[_0x65f6('0x12')](function(_0x5bba5b){if(_0x5bba5b){_0xbf5cba=_0x5bba5b;_0xcecebe[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0xb2')][_0x65f6('0x49')]);_0xcecebe[_0x65f6('0x32')]=_['keys'](_0x9d31a8['query']);_0xcecebe['filters']=_[_0x65f6('0x34')](_0xcecebe[_0x65f6('0x31')],_0xcecebe[_0x65f6('0x32')]);_0x5bc949[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0xcecebe[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x36')]));_0x5bc949['attributes']=_0x5bc949[_0x65f6('0x35')][_0x65f6('0x37')]?_0x5bc949['attributes']:_0xcecebe['model'];_0x5bc949[_0x65f6('0x3a')]=qs['sort'](_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x5bc949[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x9d31a8[_0x65f6('0x32')],_0xcecebe[_0x65f6('0x33')]));if(_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x5bc949[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x5bc949[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x5bc949[_0x65f6('0x35')],function(_0x4e5800){var _0x35934d={};_0x35934d[_0x4e5800]={'$like':'%'+_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x3e')]+'%'};return _0x35934d;})});}_0x5bc949=_[_0x65f6('0x3f')]({},_0x5bc949,_0x9d31a8[_0x65f6('0x41')]);return _0xbf5cba[_0x65f6('0x12a')](_0x5bc949);}})['then'](function(_0x309659){if(_0x309659){_0xfbd390=_0x309659['length'];if(!_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x5bc949[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x9d31a8[_0x65f6('0x32')]['limit']);_0x5bc949[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x9d31a8[_0x65f6('0x32')]['offset']);}return _0xbf5cba[_0x65f6('0x12a')](_0x5bc949);}})[_0x65f6('0x12')](function(_0x227065){if(_0x227065){return _0x227065?{'count':_0xfbd390,'rows':_0x227065}:null;}})['then'](respondWithResult(_0x56a917,null))[_0x65f6('0x1b')](handleError(_0x56a917,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 081e806..6bca881 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 _0xd7ce=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','remove','emit'];(function(_0x4a450a,_0x54d42f){var _0x28baf9=function(_0x5cb70a){while(--_0x5cb70a){_0x4a450a['push'](_0x4a450a['shift']());}};_0x28baf9(++_0x54d42f);}(_0xd7ce,0x16b));var _0xed7c=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0xd7ce[_0x5cc51f];return _0x315a2f;};'use strict';var EventEmitter=require(_0xed7c('0x0'));var ChatWebsite=require(_0xed7c('0x1'))['db'][_0xed7c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xed7c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xed7c('0x4')};function emitEvent(_0x5e454c){return function(_0x4a6138,_0x587c5a,_0x17560f){ChatWebsiteEvents[_0xed7c('0x5')](_0x5e454c+':'+_0x4a6138['id'],_0x4a6138);ChatWebsiteEvents[_0xed7c('0x5')](_0x5e454c,_0x4a6138);_0x17560f(null);};}for(var e in events){if(events[_0xed7c('0x6')](e)){var event=events[e];ChatWebsite[_0xed7c('0x7')](e,emitEvent(event));}}module[_0xed7c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x097c=['hook','events','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x86f975,_0x545c42){var _0x438e67=function(_0x576d3f){while(--_0x576d3f){_0x86f975['push'](_0x86f975['shift']());}};_0x438e67(++_0x545c42);}(_0x097c,0x1d5));var _0xc097=function(_0x5ef601,_0x3c626f){_0x5ef601=_0x5ef601-0x0;var _0x4adc2f=_0x097c[_0x5ef601];return _0x4adc2f;};'use strict';var EventEmitter=require(_0xc097('0x0'));var ChatWebsite=require(_0xc097('0x1'))['db'][_0xc097('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc097('0x3'),'afterUpdate':_0xc097('0x4'),'afterDestroy':_0xc097('0x5')};function emitEvent(_0x1b9efd){return function(_0x5aa3c1,_0x265284,_0x4ac03b){ChatWebsiteEvents[_0xc097('0x6')](_0x1b9efd+':'+_0x5aa3c1['id'],_0x5aa3c1);ChatWebsiteEvents[_0xc097('0x6')](_0x1b9efd,_0x5aa3c1);_0x4ac03b(null);};}for(var e in events){if(events[_0xc097('0x7')](e)){var event=events[e];ChatWebsite[_0xc097('0x8')](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 b72f6b3..cd4a3e1 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 _0xae04=['bluebird','request-promise','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment'];(function(_0x35c4ca,_0xb02844){var _0x40df5f=function(_0x15ad59){while(--_0x15ad59){_0x35c4ca['push'](_0x35c4ca['shift']());}};_0x40df5f(++_0xb02844);}(_0xae04,0x1dc));var _0x4ae0=function(_0x2f39cf,_0x3c59ec){_0x2f39cf=_0x2f39cf-0x0;var _0xd0ece8=_0xae04[_0x2f39cf];return _0xd0ece8;};'use strict';var _=require(_0x4ae0('0x0'));var util=require('util');var logger=require(_0x4ae0('0x1'))(_0x4ae0('0x2'));var moment=require(_0x4ae0('0x3'));var BPromise=require(_0x4ae0('0x4'));var rp=require(_0x4ae0('0x5'));var fs=require('fs');var path=require(_0x4ae0('0x6'));var rimraf=require(_0x4ae0('0x7'));var config=require('../../config/environment');var attributes=require(_0x4ae0('0x8'));module['exports']=function(_0x556c5d,_0x5930d5){return _0x556c5d[_0x4ae0('0x9')](_0x4ae0('0xa'),attributes,{'tableName':_0x4ae0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8311=['lodash','../../config/logger','api','bluebird','rimraf','exports','define','ChatWebsite'];(function(_0x202327,_0x2be8c2){var _0x5f0eb3=function(_0x892370){while(--_0x892370){_0x202327['push'](_0x202327['shift']());}};_0x5f0eb3(++_0x2be8c2);}(_0x8311,0x1e0));var _0x1831=function(_0x953b57,_0x11dd4e){_0x953b57=_0x953b57-0x0;var _0x258479=_0x8311[_0x953b57];return _0x258479;};'use strict';var _=require(_0x1831('0x0'));var util=require('util');var logger=require(_0x1831('0x1'))(_0x1831('0x2'));var moment=require('moment');var BPromise=require(_0x1831('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1831('0x4'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x1831('0x5')]=function(_0x5ca161,_0x21f453){return _0x5ca161[_0x1831('0x6')](_0x1831('0x7'),attributes,{'tableName':'chat_websites','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 78e111e..86a9834 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 _0x45a8=['redis','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','http'];(function(_0x2ea69b,_0x34b143){var _0x229d90=function(_0x297059){while(--_0x297059){_0x2ea69b['push'](_0x2ea69b['shift']());}};_0x229d90(++_0x34b143);}(_0x45a8,0xca));var _0x845a=function(_0x3b2919,_0xe974ed){_0x3b2919=_0x3b2919-0x0;var _0x4a7dbf=_0x45a8[_0x3b2919];return _0x4a7dbf;};'use strict';var _=require(_0x845a('0x0'));var util=require(_0x845a('0x1'));var moment=require(_0x845a('0x2'));var BPromise=require(_0x845a('0x3'));var rs=require(_0x845a('0x4'));var fs=require('fs');var Redis=require(_0x845a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x845a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x845a('0x7')]({'port':0x232a});config[_0x845a('0x8')]=_['defaults'](config[_0x845a('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x2b347d,_0x14a4d0,_0x18b06d){return new BPromise(function(_0x2131dc,_0x3b955b){return client[_0x845a('0x9')](_0x2b347d,_0x18b06d)[_0x845a('0xa')](function(_0xa3d9b7){logger['info'](_0x845a('0xb'),_0x14a4d0,_0x845a('0xc'));logger[_0x845a('0xd')](_0x845a('0xe'),_0x14a4d0,_0x845a('0xc'),JSON['stringify'](_0xa3d9b7));if(_0xa3d9b7[_0x845a('0xf')]){if(_0xa3d9b7['error'][_0x845a('0x10')]===0x1f4){logger[_0x845a('0xf')](_0x845a('0xb'),_0x14a4d0,_0xa3d9b7['error'][_0x845a('0x11')]);return _0x3b955b(_0xa3d9b7[_0x845a('0xf')]['message']);}logger[_0x845a('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x14a4d0,_0xa3d9b7[_0x845a('0xf')][_0x845a('0x11')]);return _0x2131dc(_0xa3d9b7['error'][_0x845a('0x11')]);}else{logger[_0x845a('0x12')](_0x845a('0xb'),_0x14a4d0,_0x845a('0xc'));_0x2131dc(_0xa3d9b7[_0x845a('0x13')][_0x845a('0x11')]);}})[_0x845a('0x14')](function(_0x298c77){logger['error'](_0x845a('0xb'),_0x14a4d0,_0x298c77);_0x3b955b(_0x298c77);});});}
\ No newline at end of file
+var _0x5387=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x37e842,_0x298bd2){var _0x404f8d=function(_0x800292){while(--_0x800292){_0x37e842['push'](_0x37e842['shift']());}};_0x404f8d(++_0x298bd2);}(_0x5387,0x83));var _0x7538=function(_0x4b7bd9,_0x5b41cd){_0x4b7bd9=_0x4b7bd9-0x0;var _0x6b4f7f=_0x5387[_0x4b7bd9];return _0x6b4f7f;};'use strict';var _=require(_0x7538('0x0'));var util=require(_0x7538('0x1'));var moment=require(_0x7538('0x2'));var BPromise=require('bluebird');var rs=require(_0x7538('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7538('0x4'))['db'];var utils=require(_0x7538('0x5'));var logger=require(_0x7538('0x6'))(_0x7538('0x7'));var config=require(_0x7538('0x8'));var jayson=require(_0x7538('0x9'));var client=jayson[_0x7538('0xa')][_0x7538('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x7538('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7538('0xd')]));require('./chatWebsite.socket')[_0x7538('0xe')](socket);function respondWithRpcPromise(_0x4eee95,_0x46e04e,_0xb0df32){return new BPromise(function(_0x5d26ac,_0x178724){return client['request'](_0x4eee95,_0xb0df32)[_0x7538('0xf')](function(_0x42a4d2){logger[_0x7538('0x10')](_0x7538('0x11'),_0x46e04e,_0x7538('0x12'));logger[_0x7538('0x13')](_0x7538('0x14'),_0x46e04e,_0x7538('0x12'),JSON[_0x7538('0x15')](_0x42a4d2));if(_0x42a4d2['error']){if(_0x42a4d2['error'][_0x7538('0x16')]===0x1f4){logger[_0x7538('0x17')](_0x7538('0x11'),_0x46e04e,_0x42a4d2[_0x7538('0x17')][_0x7538('0x18')]);return _0x178724(_0x42a4d2[_0x7538('0x17')][_0x7538('0x18')]);}logger['error'](_0x7538('0x11'),_0x46e04e,_0x42a4d2['error'][_0x7538('0x18')]);return _0x5d26ac(_0x42a4d2[_0x7538('0x17')]['message']);}else{logger[_0x7538('0x10')](_0x7538('0x11'),_0x46e04e,_0x7538('0x12'));_0x5d26ac(_0x42a4d2['result'][_0x7538('0x18')]);}})[_0x7538('0x19')](function(_0x12d9df){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x46e04e,_0x12d9df);_0x178724(_0x12d9df);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index be6b04a..6d3127f 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 _0x00b4=['emit','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x00b4,0x11c));var _0x400b=function(_0x161d59,_0x11d2ec){_0x161d59=_0x161d59-0x0;var _0xd33fcd=_0x00b4[_0x161d59];return _0xd33fcd;};'use strict';var ChatWebsiteEvents=require(_0x400b('0x0'));var events=[_0x400b('0x1'),_0x400b('0x2'),_0x400b('0x3')];function createListener(_0x22cf2a,_0x1b9b10){return function(_0x2e33c4){_0x1b9b10[_0x400b('0x4')](_0x22cf2a,_0x2e33c4);};}function removeListener(_0x141a22,_0xcbca7f){return function(){ChatWebsiteEvents['removeListener'](_0x141a22,_0xcbca7f);};}exports[_0x400b('0x5')]=function(_0x487793){for(var _0x2682c0=0x0,_0x211f34=events[_0x400b('0x6')];_0x2682c0<_0x211f34;_0x2682c0++){var _0xb6be39=events[_0x2682c0];var _0x332ccc=createListener(_0x400b('0x7')+_0xb6be39,_0x487793);ChatWebsiteEvents['on'](_0xb6be39,_0x332ccc);}};
\ No newline at end of file
+var _0xa08d=['./chatWebsite.events','save','remove','update','removeListener','register','length','chatWebsite:'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa08d,0x98));var _0xda08=function(_0x50cf15,_0xd90257){_0x50cf15=_0x50cf15-0x0;var _0x1ce688=_0xa08d[_0x50cf15];return _0x1ce688;};'use strict';var ChatWebsiteEvents=require(_0xda08('0x0'));var events=[_0xda08('0x1'),_0xda08('0x2'),_0xda08('0x3')];function createListener(_0x45783a,_0x36fcb7){return function(_0x2044e){_0x36fcb7['emit'](_0x45783a,_0x2044e);};}function removeListener(_0x1333fd,_0x11596c){return function(){ChatWebsiteEvents[_0xda08('0x4')](_0x1333fd,_0x11596c);};}exports[_0xda08('0x5')]=function(_0x406015){for(var _0x53ec75=0x0,_0x422f21=events[_0xda08('0x6')];_0x53ec75<_0x422f21;_0x53ec75++){var _0x1c88f3=events[_0x53ec75];var _0x27fb41=createListener(_0xda08('0x7')+_0x1c88f3,_0x406015);ChatWebsiteEvents['on'](_0x1c88f3,_0x27fb41);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 53463fd..ebd7870 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 _0x020f=['addAvatar','%s-%s','/:id/customer_avatar','file','addCustomerAvatar','addSystemAvatar','/:id/notify','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','/:id/canned_answers','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','server/files/images/logos/','format','originalname','single','join','root','server/files/images/avatars/','now'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x020f,0xf8));var _0xf020=function(_0x591c55,_0x45a0e2){_0x591c55=_0x591c55-0x0;var _0x118d45=_0x020f[_0x591c55];return _0x118d45;};'use strict';var multer=require(_0xf020('0x0'));var util=require(_0xf020('0x1'));var path=require('path');var timeout=require(_0xf020('0x2'));var express=require(_0xf020('0x3'));var router=express['Router']();var fs_extra=require(_0xf020('0x4'));var auth=require(_0xf020('0x5'));var interaction=require(_0xf020('0x6'));var config=require(_0xf020('0x7'));var controller=require(_0xf020('0x8'));router[_0xf020('0x9')]('/',auth[_0xf020('0xa')](),controller['index']);router['get'](_0xf020('0xb'),auth[_0xf020('0xa')](),controller[_0xf020('0xc')]);router[_0xf020('0x9')](_0xf020('0xd'),auth['isAuthenticated'](),controller[_0xf020('0xe')]);router[_0xf020('0x9')](_0xf020('0xf'),auth[_0xf020('0xa')](),controller[_0xf020('0x10')]);router[_0xf020('0x9')]('/:id/canned_answers',auth[_0xf020('0xa')](),controller[_0xf020('0x11')]);router[_0xf020('0x9')](_0xf020('0x12'),controller[_0xf020('0x13')]);router[_0xf020('0x9')](_0xf020('0x14'),controller['getAvatar']);router['get']('/:id/customer_avatar',controller[_0xf020('0x15')]);router['get'](_0xf020('0x16'),controller[_0xf020('0x17')]);router[_0xf020('0x9')](_0xf020('0x18'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xf020('0x9')](_0xf020('0x19'),controller['getSnippet']);router[_0xf020('0x9')]('/:id/applications',auth[_0xf020('0xa')](),controller[_0xf020('0x1a')]);router[_0xf020('0x9')](_0xf020('0x1b'),auth[_0xf020('0xa')](),controller[_0xf020('0x1c')]);router[_0xf020('0x9')](_0xf020('0x1d'),controller[_0xf020('0x1e')]);router['get'](_0xf020('0x1f'),auth[_0xf020('0xa')](),controller[_0xf020('0x20')]);router[_0xf020('0x9')](_0xf020('0x21'),auth['isAuthenticated'](),controller[_0xf020('0x22')]);router[_0xf020('0x23')]('/',auth[_0xf020('0xa')](),controller[_0xf020('0x24')]);router['post']('/:id/dispositions',auth[_0xf020('0xa')](),controller[_0xf020('0x25')]);router[_0xf020('0x23')]('/:id/canned_answers',auth[_0xf020('0xa')](),controller[_0xf020('0x26')]);var upload=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x2deba1,_0x5bd9fa,_0x12f5f3){_0x12f5f3(null,path['join'](config['root'],_0xf020('0x28')));},'filename':function(_0x2003f7,_0x303c28,_0x48a5f7){_0x48a5f7(null,util[_0xf020('0x29')]('%s-%s',Date['now'](),_0x303c28[_0xf020('0x2a')]));}})});router[_0xf020('0x23')](_0xf020('0x12'),upload[_0xf020('0x2b')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44104f,_0x1f87a0,_0x50199d){_0x50199d(null,path[_0xf020('0x2c')](config[_0xf020('0x2d')],_0xf020('0x2e')));},'filename':function(_0x2f6683,_0x506fab,_0x464fe8){_0x464fe8(null,util[_0xf020('0x29')]('%s-%s',Date[_0xf020('0x2f')](),_0x506fab[_0xf020('0x2a')]));}})});router[_0xf020('0x23')](_0xf020('0x14'),upload['single']('file'),controller[_0xf020('0x30')]);var upload=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x365bd0,_0x4dda53,_0x480b14){_0x480b14(null,path['join'](config['root'],_0xf020('0x2e')));},'filename':function(_0x2ca704,_0x1807ed,_0x4b7dd1){_0x4b7dd1(null,util[_0xf020('0x29')](_0xf020('0x31'),Date[_0xf020('0x2f')](),_0x1807ed[_0xf020('0x2a')]));}})});router[_0xf020('0x23')](_0xf020('0x32'),upload[_0xf020('0x2b')](_0xf020('0x33')),controller[_0xf020('0x34')]);var upload=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x1b7283,_0x1694ad,_0x17bf16){_0x17bf16(null,path[_0xf020('0x2c')](config['root'],_0xf020('0x2e')));},'filename':function(_0x476a2d,_0x3601e8,_0x3f50d2){_0x3f50d2(null,util[_0xf020('0x29')](_0xf020('0x31'),Date[_0xf020('0x2f')](),_0x3601e8['originalname']));}})});router[_0xf020('0x23')](_0xf020('0x16'),upload[_0xf020('0x2b')](_0xf020('0x33')),controller[_0xf020('0x35')]);router[_0xf020('0x23')](_0xf020('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x404c29,_0x51f179,_0x5af0fc){const _0x2a7c89=path[_0xf020('0x2c')](config['root'],'server/files',_0xf020('0x37'),_0xf020('0x38'));fs_extra['ensureDir'](_0x2a7c89,function(){_0x5af0fc(null,_0x2a7c89);});},'filename':function(_0x236f37,_0x543ee2,_0x27c910){const _0x2ad216=_0x543ee2[_0xf020('0x2a')][_0xf020('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4f6b30=path[_0xf020('0x3a')](_0x2ad216);const _0x5d6e9b=Date[_0xf020('0x2f')]()+'-'+_0x2ad216[_0xf020('0x39')](_0x4f6b30,'')+_0x4f6b30;_0x27c910(null,_0x5d6e9b);}})});router['post'](_0xf020('0x3b'),offlineUploadMulter[_0xf020('0x3c')](),controller[_0xf020('0x3d')]);router[_0xf020('0x23')](_0xf020('0x18'),auth[_0xf020('0xa')](),controller[_0xf020('0x3e')]);router[_0xf020('0x23')]('/:id/applications',auth[_0xf020('0xa')](),controller[_0xf020('0x3f')]);router[_0xf020('0x23')](_0xf020('0x1b'),auth[_0xf020('0xa')](),controller[_0xf020('0x40')]);router['post'](_0xf020('0x21'),auth['isAuthenticated'](),controller[_0xf020('0x41')]);router[_0xf020('0x42')]('/:id',auth[_0xf020('0xa')](),controller[_0xf020('0x43')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf020('0x44')]);router[_0xf020('0x45')](_0xf020('0xf'),auth[_0xf020('0xa')](),controller[_0xf020('0x46')]);router[_0xf020('0x45')](_0xf020('0x47'),auth[_0xf020('0xa')](),controller['removeAnswers']);router[_0xf020('0x45')]('/:id/users',auth[_0xf020('0xa')](),controller[_0xf020('0x48')]);module[_0xf020('0x49')]=router;
\ No newline at end of file
+var _0x2b49=['./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','getDispositions','/:id/canned_answers','getAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','join','root','%s-%s','now','/:id/logo','single','file','diskStorage','format','addAvatar','server/files/images/avatars/','originalname','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','any','offline','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','put','update','removeDispositions','delete','removeAgents','exports','multer','util','path','express','../../components/auth/service'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0x2b49,0x140));var _0x92b4=function(_0x5505b0,_0x1e74ad){_0x5505b0=_0x5505b0-0x0;var _0x3309a6=_0x2b49[_0x5505b0];return _0x3309a6;};'use strict';var multer=require(_0x92b4('0x0'));var util=require(_0x92b4('0x1'));var path=require(_0x92b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x92b4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x92b4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x92b4('0x5'));router[_0x92b4('0x6')]('/',auth['isAuthenticated'](),controller[_0x92b4('0x7')]);router[_0x92b4('0x6')](_0x92b4('0x8'),auth[_0x92b4('0x9')](),controller[_0x92b4('0xa')]);router[_0x92b4('0x6')](_0x92b4('0xb'),auth[_0x92b4('0x9')](),controller['show']);router[_0x92b4('0x6')]('/:id/dispositions',auth[_0x92b4('0x9')](),controller[_0x92b4('0xc')]);router[_0x92b4('0x6')](_0x92b4('0xd'),auth[_0x92b4('0x9')](),controller['getAnswers']);router['get']('/:id/logo',controller['getLogo']);router[_0x92b4('0x6')]('/:id/avatar',controller[_0x92b4('0xe')]);router[_0x92b4('0x6')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x92b4('0x6')]('/:id/system_avatar',controller[_0x92b4('0xf')]);router[_0x92b4('0x6')](_0x92b4('0x10'),auth[_0x92b4('0x9')](),controller['getInteractions']);router[_0x92b4('0x6')](_0x92b4('0x11'),controller[_0x92b4('0x12')]);router[_0x92b4('0x6')]('/:id/applications',auth[_0x92b4('0x9')](),controller[_0x92b4('0x13')]);router[_0x92b4('0x6')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x92b4('0x14')]);router[_0x92b4('0x6')](_0x92b4('0x15'),controller['getFields']);router[_0x92b4('0x6')](_0x92b4('0x16'),auth['isAuthenticated'](),controller[_0x92b4('0x17')]);router[_0x92b4('0x6')]('/:id/users',auth[_0x92b4('0x9')](),controller[_0x92b4('0x18')]);router[_0x92b4('0x19')]('/',auth['isAuthenticated'](),controller[_0x92b4('0x1a')]);router[_0x92b4('0x19')](_0x92b4('0x1b'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x1c')]);router[_0x92b4('0x19')](_0x92b4('0xd'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xef29c5,_0x4b5b33,_0x468a30){_0x468a30(null,path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],'server/files/images/logos/'));},'filename':function(_0x36dfb2,_0x413d8d,_0x115eb5){_0x115eb5(null,util['format'](_0x92b4('0x20'),Date[_0x92b4('0x21')](),_0x413d8d['originalname']));}})});router[_0x92b4('0x19')](_0x92b4('0x22'),upload[_0x92b4('0x23')](_0x92b4('0x24')),controller['addLogo']);var upload=multer({'storage':multer[_0x92b4('0x25')]({'destination':function(_0x1005ba,_0x2cb143,_0x282369){_0x282369(null,path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],'server/files/images/avatars/'));},'filename':function(_0x569d91,_0x829cbd,_0x3cd6e7){_0x3cd6e7(null,util[_0x92b4('0x26')](_0x92b4('0x20'),Date[_0x92b4('0x21')](),_0x829cbd['originalname']));}})});router[_0x92b4('0x19')]('/:id/avatar',upload[_0x92b4('0x23')]('file'),controller[_0x92b4('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x148c3b,_0x557752,_0x275ec1){_0x275ec1(null,path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],_0x92b4('0x28')));},'filename':function(_0x4997d9,_0x437517,_0x33c0d0){_0x33c0d0(null,util[_0x92b4('0x26')]('%s-%s',Date[_0x92b4('0x21')](),_0x437517[_0x92b4('0x29')]));}})});router[_0x92b4('0x19')](_0x92b4('0x2a'),upload[_0x92b4('0x23')](_0x92b4('0x24')),controller[_0x92b4('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x32bbf7,_0x335159,_0x3d72fe){_0x3d72fe(null,path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],_0x92b4('0x28')));},'filename':function(_0x53df3c,_0x3ecbdc,_0x4e97c3){_0x4e97c3(null,util[_0x92b4('0x26')]('%s-%s',Date['now'](),_0x3ecbdc[_0x92b4('0x29')]));}})});router[_0x92b4('0x19')]('/:id/system_avatar',upload[_0x92b4('0x23')](_0x92b4('0x24')),controller[_0x92b4('0x2c')]);router[_0x92b4('0x19')](_0x92b4('0x2d'),controller[_0x92b4('0x2e')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x26e347,_0xeeb322,_0x5339c7){const _0xf913b0=path[_0x92b4('0x1e')](config[_0x92b4('0x1f')],'server/files',_0x92b4('0x2f'),_0x92b4('0x30'));fs_extra[_0x92b4('0x31')](_0xf913b0,function(){_0x5339c7(null,_0xf913b0);});},'filename':function(_0x1d2694,_0x39abb8,_0x201898){const _0x50c09b=_0x39abb8['originalname'][_0x92b4('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x534c4a=path['extname'](_0x50c09b);const _0x132cf2=Date[_0x92b4('0x21')]()+'-'+_0x50c09b[_0x92b4('0x32')](_0x534c4a,'')+_0x534c4a;_0x201898(null,_0x132cf2);}})});router['post']('/:id/offline',offlineUploadMulter[_0x92b4('0x33')](),controller[_0x92b4('0x34')]);router[_0x92b4('0x19')](_0x92b4('0x10'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x35')]);router['post'](_0x92b4('0x36'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x37')]);router['post'](_0x92b4('0x38'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x39')]);router[_0x92b4('0x19')](_0x92b4('0x3a'),auth['isAuthenticated'](),controller['addAgents']);router[_0x92b4('0x3b')](_0x92b4('0xb'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x3c')]);router['delete'](_0x92b4('0xb'),auth[_0x92b4('0x9')](),controller['destroy']);router['delete'](_0x92b4('0x1b'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x3d')]);router[_0x92b4('0x3e')](_0x92b4('0xd'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x92b4('0x3e')](_0x92b4('0x3a'),auth[_0x92b4('0x9')](),controller[_0x92b4('0x3f')]);module[_0x92b4('0x40')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 3de26b3..bba6c9a 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 _0x40e4=['exports','beaver-logger/server','express','../components/auth/service','app','get','client-side-logger','expressEndpoint','/client-logs','use'];(function(_0xc2dde6,_0x1cccc9){var _0x9fc29c=function(_0x54ba28){while(--_0x54ba28){_0xc2dde6['push'](_0xc2dde6['shift']());}};_0x9fc29c(++_0x1cccc9);}(_0x40e4,0x97));var _0x440e=function(_0xfdb740,_0x14c2da){_0xfdb740=_0xfdb740-0x0;var _0x4a837d=_0x40e4[_0xfdb740];return _0x4a837d;};var beaverLogger=require(_0x440e('0x0'));var express=require(_0x440e('0x1'));var auth=require(_0x440e('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x10a0b8,_0x791745,_0xd0adf4){var _0x59b844=_0x10a0b8[_0x440e('0x3')][_0x440e('0x4')](_0x440e('0x5'));if(!_0x59b844){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x440e('0x6')]({'uri':_0x440e('0x7'),'logger':_0x59b844,'enableCors':!isProduction})(_0x10a0b8,_0x791745,_0xd0adf4);}router[_0x440e('0x8')](auth['isAuthenticated'](),clientSideLogs);module[_0x440e('0x9')]=router;
\ No newline at end of file
+var _0x3e13=['env','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x1c775f,_0x39bf76){var _0xcf5722=function(_0x3350a9){while(--_0x3350a9){_0x1c775f['push'](_0x1c775f['shift']());}};_0xcf5722(++_0x39bf76);}(_0x3e13,0x1a0));var _0x33e1=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x3e13[_0x28aea5];return _0x6a55f9;};var beaverLogger=require(_0x33e1('0x0'));var express=require(_0x33e1('0x1'));var auth=require(_0x33e1('0x2'));var config=require(_0x33e1('0x3'));var router=express['Router']();var isProduction=config[_0x33e1('0x4')]==='production'||![];function clientSideLogs(_0xa8b29d,_0x922afe,_0x28a93b){var _0x23ab35=_0xa8b29d['app'][_0x33e1('0x5')](_0x33e1('0x6'));if(!_0x23ab35){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x33e1('0x7')]({'uri':_0x33e1('0x8'),'logger':_0x23ab35,'enableCors':!isProduction})(_0xa8b29d,_0x922afe,_0x28a93b);}router[_0x33e1('0x9')](auth[_0x33e1('0xa')](),clientSideLogs);module[_0x33e1('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 4adb302..0588c3e 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 _0x41f9=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM'];(function(_0x335ef9,_0x280744){var _0x51ec48=function(_0x204824){while(--_0x204824){_0x335ef9['push'](_0x335ef9['shift']());}};_0x51ec48(++_0x280744);}(_0x41f9,0xe3));var _0x941f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x41f9[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x941f('0x0'));module[_0x941f('0x1')]={'name':{'type':Sequelize[_0x941f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x941f('0x3'),_0x941f('0x4'),_0x941f('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x941f('0x6')](_0x941f('0x7'),_0x941f('0x8'))},'data1':{'type':Sequelize[_0x941f('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x941f('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x941f('0x9')},'data6':{'type':Sequelize[_0x941f('0xa')],'comment':_0x941f('0xb')},'data7':{'type':Sequelize[_0x941f('0xa')],'comment':_0x941f('0xc')}};
\ No newline at end of file
+var _0x9c53=['AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM'];(function(_0x46f193,_0x4f65c9){var _0x50516d=function(_0x172558){while(--_0x172558){_0x46f193['push'](_0x46f193['shift']());}};_0x50516d(++_0x4f65c9);}(_0x9c53,0x13e));var _0x39c5=function(_0x5bdf55,_0x226b50){_0x5bdf55=_0x5bdf55-0x0;var _0x31acff=_0x9c53[_0x5bdf55];return _0x31acff;};'use strict';var Sequelize=require(_0x39c5('0x0'));module[_0x39c5('0x1')]={'name':{'type':Sequelize[_0x39c5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x39c5('0x3')](_0x39c5('0x4'),'Google',_0x39c5('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x39c5('0x3')](_0x39c5('0x6'),_0x39c5('0x7'))},'data1':{'type':Sequelize[_0x39c5('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x39c5('0x2')],'comment':_0x39c5('0x8')},'data3':{'type':Sequelize[_0x39c5('0x2')],'comment':_0x39c5('0x9')},'data4':{'type':Sequelize[_0x39c5('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x39c5('0xa')],'comment':_0x39c5('0xb')},'data6':{'type':Sequelize[_0x39c5('0xa')],'comment':_0x39c5('0xc')},'data7':{'type':Sequelize[_0x39c5('0xa')],'comment':_0x39c5('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index daffa4f..a62fb1b 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 _0x3978=['findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','json','then','destroy','error','name','index','CloudProvider','rawAttributes','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','params','find','catch','body','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize'];(function(_0xe50651,_0x78b476){var _0xc8931c=function(_0x1c2902){while(--_0x1c2902){_0xe50651['push'](_0xe50651['shift']());}};_0xc8931c(++_0x78b476);}(_0x3978,0x6e));var _0x8397=function(_0x101f0d,_0x223697){_0x101f0d=_0x101f0d-0x0;var _0x59aade=_0x3978[_0x101f0d];return _0x59aade;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x8397('0x0'));var encryptor=require(_0x8397('0x1'));var config=require(_0x8397('0x2'));var logger=require(_0x8397('0x3'))(_0x8397('0x4'));var db=require(_0x8397('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x8397('0x6')]=_[_0x8397('0x7')](config[_0x8397('0x6')],{'host':_0x8397('0x8'),'port':0x18eb});var socket=require(_0x8397('0x9'))(new Redis(config[_0x8397('0x6')]));var redis=new Redis(config[_0x8397('0x6')]);function respondWithStatusCode(_0xa2b089,_0x3ae5e4){_0x3ae5e4=_0x3ae5e4||0xcc;return function(_0x7ac31f){if(_0x7ac31f){return _0xa2b089[_0x8397('0xa')](_0x3ae5e4);}return _0xa2b089['status'](_0x3ae5e4)[_0x8397('0xb')]();};}function respondWithResult(_0x5ecc73,_0x36c13a){_0x36c13a=_0x36c13a||0xc8;return function(_0x32fae5){if(_0x32fae5){return _0x5ecc73[_0x8397('0xc')](_0x36c13a)['json'](_0x32fae5);}};}function respondWithFilteredResult(_0x36b24e,_0x2b93c7){return function(_0x343b1f){if(_0x343b1f){var _0x4272b9=typeof _0x2b93c7[_0x8397('0xd')]===_0x8397('0xe')&&typeof _0x2b93c7[_0x8397('0xf')]===_0x8397('0xe');var _0x509d74=_0x343b1f[_0x8397('0x10')];var _0x59f438=_0x4272b9?0x0:_0x2b93c7['offset'];var _0x44f56d=_0x4272b9?_0x343b1f[_0x8397('0x10')]:_0x2b93c7['offset']+_0x2b93c7[_0x8397('0xf')];var _0x5c5bc5;if(_0x44f56d>=_0x509d74){_0x44f56d=_0x509d74;_0x5c5bc5=0xc8;}else{_0x5c5bc5=0xce;}_0x36b24e[_0x8397('0xc')](_0x5c5bc5);return _0x36b24e[_0x8397('0x11')]('Content-Range',_0x59f438+'-'+_0x44f56d+'/'+_0x509d74)[_0x8397('0x12')](_0x343b1f);}return null;};}function saveUpdates(_0x6a9af7){return function(_0x2db637){if(_0x2db637){return _0x2db637['update'](_0x6a9af7)[_0x8397('0x13')](function(_0x25c5ef){return _0x25c5ef;});}return null;};}function removeEntity(_0x33d7b5){return function(_0x2c76ae){if(_0x2c76ae){return _0x2c76ae[_0x8397('0x14')]()[_0x8397('0x13')](function(){_0x33d7b5['status'](0xcc)[_0x8397('0xb')]();});}};}function handleEntityNotFound(_0x137fe0){return function(_0x1c01c1){if(!_0x1c01c1){_0x137fe0[_0x8397('0xa')](0x194);}return _0x1c01c1;};}function handleError(_0x6303f0,_0x25a193){_0x25a193=_0x25a193||0x1f4;return function(_0x5cccd1){logger[_0x8397('0x15')](_0x5cccd1['stack']);if(_0x5cccd1[_0x8397('0x16')]){delete _0x5cccd1['name'];}_0x6303f0[_0x8397('0xc')](_0x25a193)['send'](_0x5cccd1);};}function maskClientSecret(_0x1f5720){return _['padEnd'](_0x1f5720['slice'](0x0,0x3),0x14,'*');}exports[_0x8397('0x17')]=function(_0x3c4633,_0xb50b8c){var _0x257121={},_0xf43617={},_0x27b304={'count':0x0,'rows':[]};var _0xfba76c=_['map'](db[_0x8397('0x18')][_0x8397('0x19')],function(_0x52e9b5){return{'name':_0x52e9b5['fieldName'],'type':_0x52e9b5['type'][_0x8397('0x1a')]};});_0xf43617['model']=_[_0x8397('0x1b')](_0xfba76c,_0x8397('0x16'));_0xf43617['query']=_[_0x8397('0x1c')](_0x3c4633[_0x8397('0x1d')]);_0xf43617['filters']=_[_0x8397('0x1e')](_0xf43617[_0x8397('0x1f')],_0xf43617[_0x8397('0x1d')]);_0x257121[_0x8397('0x20')]=_[_0x8397('0x1e')](_0xf43617[_0x8397('0x1f')],qs[_0x8397('0x21')](_0x3c4633[_0x8397('0x1d')]['fields']));_0x257121['attributes']=_0x257121[_0x8397('0x20')][_0x8397('0x22')]?_0x257121[_0x8397('0x20')]:_0xf43617[_0x8397('0x1f')];if(!_0x3c4633[_0x8397('0x1d')][_0x8397('0x23')](_0x8397('0x24'))){_0x257121[_0x8397('0xf')]=qs['limit'](_0x3c4633[_0x8397('0x1d')]['limit']);_0x257121[_0x8397('0xd')]=qs['offset'](_0x3c4633[_0x8397('0x1d')]['offset']);}_0x257121[_0x8397('0x25')]=qs['sort'](_0x3c4633['query'][_0x8397('0x26')]);_0x257121[_0x8397('0x27')]=qs[_0x8397('0x28')](_[_0x8397('0x29')](_0x3c4633[_0x8397('0x1d')],_0xf43617[_0x8397('0x28')]),_0xfba76c);if(_0x3c4633[_0x8397('0x1d')][_0x8397('0x2a')]){_0x257121[_0x8397('0x27')]=_[_0x8397('0x2b')](_0x257121[_0x8397('0x27')],{'$or':_[_0x8397('0x1b')](_0xfba76c,function(_0x4d0cf9){if(_0x4d0cf9[_0x8397('0x2c')]!==_0x8397('0x2d')){var _0x527022={};_0x527022[_0x4d0cf9['name']]={'$like':'%'+_0x3c4633['query'][_0x8397('0x2a')]+'%'};return _0x527022;}})});}_0x257121=_[_0x8397('0x2b')]({},_0x257121,_0x3c4633[_0x8397('0x2e')]);var _0x3065af={'where':_0x257121[_0x8397('0x27')]};return db[_0x8397('0x18')][_0x8397('0x10')](_0x3065af)[_0x8397('0x13')](function(_0x32006a){_0x27b304[_0x8397('0x10')]=_0x32006a;if(_0x3c4633[_0x8397('0x1d')][_0x8397('0x2f')]){_0x257121[_0x8397('0x30')]=[{'all':!![]}];}return db[_0x8397('0x18')][_0x8397('0x31')](_0x257121);})[_0x8397('0x13')](function(_0x96439b){_0x27b304[_0x8397('0x32')]=_[_0x8397('0x1b')](_0x96439b,function(_0x260285){if(_0x260285[_0x8397('0x33')]===_0x8397('0x34')){var _0x1d5b57=encryptor[_0x8397('0x35')](_0x260285[_0x8397('0x36')]);_0x260285[_0x8397('0x36')]=maskClientSecret(_0x1d5b57);}return _0x260285;});return _0x27b304;})['then'](respondWithFilteredResult(_0xb50b8c,_0x257121))['catch'](handleError(_0xb50b8c,null));};exports['show']=function(_0x3b64d1,_0x2c65ee){var _0x180ece={'raw':!![],'where':{'id':_0x3b64d1[_0x8397('0x37')]['id']}},_0x4e637e={};_0x4e637e[_0x8397('0x1f')]=_[_0x8397('0x1c')](db['CloudProvider'][_0x8397('0x19')]);_0x4e637e[_0x8397('0x1d')]=_[_0x8397('0x1c')](_0x3b64d1[_0x8397('0x1d')]);_0x4e637e[_0x8397('0x28')]=_['intersection'](_0x4e637e['model'],_0x4e637e[_0x8397('0x1d')]);_0x180ece[_0x8397('0x20')]=_[_0x8397('0x1e')](_0x4e637e[_0x8397('0x1f')],qs[_0x8397('0x21')](_0x3b64d1[_0x8397('0x1d')][_0x8397('0x21')]));_0x180ece[_0x8397('0x20')]=_0x180ece[_0x8397('0x20')]['length']?_0x180ece['attributes']:_0x4e637e[_0x8397('0x1f')];if(_0x3b64d1['query'][_0x8397('0x2f')]){_0x180ece[_0x8397('0x30')]=[{'all':!![]}];}_0x180ece=_[_0x8397('0x2b')]({},_0x180ece,_0x3b64d1['options']);return db[_0x8397('0x18')][_0x8397('0x38')](_0x180ece)[_0x8397('0x13')](handleEntityNotFound(_0x2c65ee,null))[_0x8397('0x13')](function(_0x2a138c){if(_0x2a138c[_0x8397('0x33')]==='MicrosoftAzure'){var _0x1d0d26=encryptor['decryptString'](_0x2a138c[_0x8397('0x36')]);_0x2a138c[_0x8397('0x36')]=maskClientSecret(_0x1d0d26);}return _0x2a138c;})[_0x8397('0x13')](respondWithResult(_0x2c65ee,null))[_0x8397('0x39')](handleError(_0x2c65ee,null));};exports['create']=function(_0x13f63a,_0x57ba7c){if(!_0x13f63a[_0x8397('0x3a')][_0x8397('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x13f63a['body'][_0x8397('0x33')])throw new Error(_0x8397('0x3b'));var _0x1bc0c2=db[_0x8397('0x18')][_0x8397('0x19')][_0x8397('0x33')]['values'];if(!_0x1bc0c2[_0x8397('0x3c')](_0x13f63a['body']['service']))throw new Error(_0x8397('0x3d')+_0x1bc0c2[_0x8397('0x3e')](',\x20'));if(_0x13f63a['body']['service']===_0x8397('0x34')&&_0x13f63a['body'][_0x8397('0x36')]){_0x13f63a[_0x8397('0x3a')][_0x8397('0x36')]=encryptor[_0x8397('0x3f')](_0x13f63a[_0x8397('0x3a')]['data3']);}return db[_0x8397('0x18')]['create'](_0x13f63a['body'],{})[_0x8397('0x13')](respondWithResult(_0x57ba7c,0xc9))[_0x8397('0x39')](handleError(_0x57ba7c,null));};exports[_0x8397('0x40')]=function(_0x88ea75,_0x411cbb){if(_0x88ea75[_0x8397('0x3a')]['id']){delete _0x88ea75['body']['id'];}return db[_0x8397('0x18')][_0x8397('0x38')]({'where':{'id':_0x88ea75['params']['id']}})[_0x8397('0x13')](handleEntityNotFound(_0x411cbb,null))[_0x8397('0x13')](function(_0x569418){if(_0x569418['service']==='MicrosoftAzure'&&_0x88ea75['body'][_0x8397('0x36')]){_0x88ea75[_0x8397('0x3a')][_0x8397('0x36')]=encryptor[_0x8397('0x3f')](_0x88ea75[_0x8397('0x3a')]['data3']);}return _0x569418;})[_0x8397('0x13')](saveUpdates(_0x88ea75[_0x8397('0x3a')],null))['then'](respondWithResult(_0x411cbb,null))[_0x8397('0x39')](handleError(_0x411cbb,null));};exports[_0x8397('0x14')]=function(_0x163338,_0xef32a){return db[_0x8397('0x18')][_0x8397('0x38')]({'where':{'id':_0x163338['params']['id']}})[_0x8397('0x13')](handleEntityNotFound(_0xef32a,null))[_0x8397('0x13')](removeEntity(_0xef32a,null))[_0x8397('0x39')](handleError(_0xef32a,null));};exports[_0x8397('0x41')]=function(_0x39437b,_0x4a9b0d){return db['CloudProvider'][_0x8397('0x42')]({'where':{'id':_0x39437b[_0x8397('0x37')]['id']},'raw':!![]})[_0x8397('0x13')](function(_0x50c486){if(!_0x50c486)return _0x4a9b0d[_0x8397('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x50c486,_0x39437b[_0x8397('0x43')]['id'])};})['then'](respondWithResult(_0x4a9b0d,null))[_0x8397('0x39')](handleError(_0x4a9b0d,null));};exports[_0x8397('0x44')]=function(_0x21c0d3,_0x3ec255){var _0x219246=_0x21c0d3[_0x8397('0x3a')];var _0x35e66d;var _0x5c591a;if(_0x219246[_0x8397('0x15')])throw _0x219246;redis[_0x8397('0x45')](_0x219246['state'])[_0x8397('0x13')](function(_0x48467e){if(!_0x48467e)throw new Error(_0x8397('0x46'));_0x35e66d=JSON[_0x8397('0x47')](_0x48467e);var _0x12820a=Buffer[_0x8397('0x48')](_0x219246[_0x8397('0x49')],_0x8397('0x4a'))['toString']('ascii');_0x5c591a=JSON['parse'](_0x12820a);if(!oauth['isValidIdToken'](_0x219246[_0x8397('0x4b')],_0x35e66d[_0x8397('0x4c')]))throw new Error(_0x8397('0x4d'));redis[_0x8397('0x4e')](_0x219246[_0x8397('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x219246['code'],_0x35e66d);})[_0x8397('0x13')](function(_0x3cbf7f){_0x35e66d[_0x8397('0x4f')]=_0x3cbf7f[_0x8397('0x50')];_0x35e66d[_0x8397('0x51')]=_0x3cbf7f[_0x8397('0x52')];return db['CloudProvider']['update']({'data5':_0x35e66d['data5'],'data6':_0x35e66d[_0x8397('0x51')]},{'where':{'id':_0x35e66d['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x35e66d);socket[_0x8397('0x53')](_0x8397('0x54'),{'id':_0x5c591a['id']});return;})[_0x8397('0x13')](respondWithStatusCode(_0x3ec255,null))[_0x8397('0x39')](function(_0x55b474){if(_0x5c591a){socket[_0x8397('0x53')](_0x8397('0x55'),{'id':_0x5c591a['id']});}if(!_0x35e66d){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x55b474);return _0x3ec255[_0x8397('0xc')](0x1f4)['send'](_0x55b474[_0x8397('0x56')]);}logger[_0x8397('0x15')](_0x8397('0x57'),_0x35e66d['id'],_0x55b474);});};
\ No newline at end of file
+var _0x0bbf=['stack','send','padEnd','slice','map','rawAttributes','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','merge','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','end','json','undefined','limit','offset','count','status','Content-Range','then','destroy','error'];(function(_0x4c8f42,_0x3ad051){var _0x138dc3=function(_0x348e07){while(--_0x348e07){_0x4c8f42['push'](_0x4c8f42['shift']());}};_0x138dc3(++_0x3ad051);}(_0x0bbf,0x15c));var _0xf0bb=function(_0xda3db0,_0x50779b){_0xda3db0=_0xda3db0-0x0;var _0x170e71=_0x0bbf[_0xda3db0];return _0x170e71;};'use strict';var _=require(_0xf0bb('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xf0bb('0x1'));var config=require(_0xf0bb('0x2'));var logger=require('../../config/logger')(_0xf0bb('0x3'));var db=require('../../mysqldb')['db'];var oauth=require(_0xf0bb('0x4'));config['redis']=_['defaults'](config[_0xf0bb('0x5')],{'host':_0xf0bb('0x6'),'port':0x18eb});var socket=require(_0xf0bb('0x7'))(new Redis(config['redis']));var redis=new Redis(config[_0xf0bb('0x5')]);function respondWithStatusCode(_0x423658,_0x5a60fc){_0x5a60fc=_0x5a60fc||0xcc;return function(_0x377c34){if(_0x377c34){return _0x423658[_0xf0bb('0x8')](_0x5a60fc);}return _0x423658['status'](_0x5a60fc)[_0xf0bb('0x9')]();};}function respondWithResult(_0x288d4b,_0x44ff8a){_0x44ff8a=_0x44ff8a||0xc8;return function(_0x4994bb){if(_0x4994bb){return _0x288d4b['status'](_0x44ff8a)[_0xf0bb('0xa')](_0x4994bb);}};}function respondWithFilteredResult(_0xf4c8cb,_0x3ce625){return function(_0x16bfde){if(_0x16bfde){var _0x19d16c=typeof _0x3ce625['offset']===_0xf0bb('0xb')&&typeof _0x3ce625[_0xf0bb('0xc')]===_0xf0bb('0xb');var _0x30fa09=_0x16bfde['count'];var _0xbdc440=_0x19d16c?0x0:_0x3ce625[_0xf0bb('0xd')];var _0x4283e5=_0x19d16c?_0x16bfde[_0xf0bb('0xe')]:_0x3ce625[_0xf0bb('0xd')]+_0x3ce625[_0xf0bb('0xc')];var _0x5e295e;if(_0x4283e5>=_0x30fa09){_0x4283e5=_0x30fa09;_0x5e295e=0xc8;}else{_0x5e295e=0xce;}_0xf4c8cb[_0xf0bb('0xf')](_0x5e295e);return _0xf4c8cb['set'](_0xf0bb('0x10'),_0xbdc440+'-'+_0x4283e5+'/'+_0x30fa09)[_0xf0bb('0xa')](_0x16bfde);}return null;};}function saveUpdates(_0x967be3){return function(_0x3e7878){if(_0x3e7878){return _0x3e7878['update'](_0x967be3)[_0xf0bb('0x11')](function(_0x4ce0d7){return _0x4ce0d7;});}return null;};}function removeEntity(_0x433d8a){return function(_0x4362d){if(_0x4362d){return _0x4362d[_0xf0bb('0x12')]()[_0xf0bb('0x11')](function(){_0x433d8a[_0xf0bb('0xf')](0xcc)[_0xf0bb('0x9')]();});}};}function handleEntityNotFound(_0x134c71){return function(_0x131a63){if(!_0x131a63){_0x134c71[_0xf0bb('0x8')](0x194);}return _0x131a63;};}function handleError(_0x171506,_0x5e51c2){_0x5e51c2=_0x5e51c2||0x1f4;return function(_0x20ac0f){logger[_0xf0bb('0x13')](_0x20ac0f[_0xf0bb('0x14')]);if(_0x20ac0f['name']){delete _0x20ac0f['name'];}_0x171506[_0xf0bb('0xf')](_0x5e51c2)[_0xf0bb('0x15')](_0x20ac0f);};}function maskClientSecret(_0x2c436c){return _[_0xf0bb('0x16')](_0x2c436c[_0xf0bb('0x17')](0x0,0x3),0x14,'*');}exports['index']=function(_0x2436c1,_0x3c0365){var _0x574373={},_0x58a58b={},_0x4fe17b={'count':0x0,'rows':[]};var _0x97df3e=_[_0xf0bb('0x18')](db['CloudProvider'][_0xf0bb('0x19')],function(_0x4b0935){return{'name':_0x4b0935['fieldName'],'type':_0x4b0935['type'][_0xf0bb('0x1a')]};});_0x58a58b[_0xf0bb('0x1b')]=_[_0xf0bb('0x18')](_0x97df3e,_0xf0bb('0x1c'));_0x58a58b['query']=_[_0xf0bb('0x1d')](_0x2436c1[_0xf0bb('0x1e')]);_0x58a58b[_0xf0bb('0x1f')]=_[_0xf0bb('0x20')](_0x58a58b[_0xf0bb('0x1b')],_0x58a58b[_0xf0bb('0x1e')]);_0x574373[_0xf0bb('0x21')]=_[_0xf0bb('0x20')](_0x58a58b[_0xf0bb('0x1b')],qs['fields'](_0x2436c1[_0xf0bb('0x1e')][_0xf0bb('0x22')]));_0x574373[_0xf0bb('0x21')]=_0x574373[_0xf0bb('0x21')][_0xf0bb('0x23')]?_0x574373['attributes']:_0x58a58b['model'];if(!_0x2436c1['query'][_0xf0bb('0x24')](_0xf0bb('0x25'))){_0x574373[_0xf0bb('0xc')]=qs[_0xf0bb('0xc')](_0x2436c1['query']['limit']);_0x574373['offset']=qs[_0xf0bb('0xd')](_0x2436c1['query'][_0xf0bb('0xd')]);}_0x574373[_0xf0bb('0x26')]=qs['sort'](_0x2436c1[_0xf0bb('0x1e')]['sort']);_0x574373[_0xf0bb('0x27')]=qs[_0xf0bb('0x1f')](_['pick'](_0x2436c1[_0xf0bb('0x1e')],_0x58a58b['filters']),_0x97df3e);if(_0x2436c1[_0xf0bb('0x1e')][_0xf0bb('0x28')]){_0x574373[_0xf0bb('0x27')]=_['merge'](_0x574373['where'],{'$or':_[_0xf0bb('0x18')](_0x97df3e,function(_0x5d2c71){if(_0x5d2c71[_0xf0bb('0x29')]!==_0xf0bb('0x2a')){var _0x2d36ad={};_0x2d36ad[_0x5d2c71['name']]={'$like':'%'+_0x2436c1[_0xf0bb('0x1e')][_0xf0bb('0x28')]+'%'};return _0x2d36ad;}})});}_0x574373=_['merge']({},_0x574373,_0x2436c1[_0xf0bb('0x2b')]);var _0x360d94={'where':_0x574373[_0xf0bb('0x27')]};return db[_0xf0bb('0x2c')][_0xf0bb('0xe')](_0x360d94)[_0xf0bb('0x11')](function(_0x1d24d6){_0x4fe17b[_0xf0bb('0xe')]=_0x1d24d6;if(_0x2436c1[_0xf0bb('0x1e')][_0xf0bb('0x2d')]){_0x574373[_0xf0bb('0x2e')]=[{'all':!![]}];}return db['CloudProvider'][_0xf0bb('0x2f')](_0x574373);})['then'](function(_0x41f7f9){_0x4fe17b[_0xf0bb('0x30')]=_[_0xf0bb('0x18')](_0x41f7f9,function(_0x286220){if(_0x286220[_0xf0bb('0x31')]==='MicrosoftAzure'){var _0xf14ebd=encryptor[_0xf0bb('0x32')](_0x286220[_0xf0bb('0x33')]);_0x286220[_0xf0bb('0x33')]=maskClientSecret(_0xf14ebd);}return _0x286220;});return _0x4fe17b;})[_0xf0bb('0x11')](respondWithFilteredResult(_0x3c0365,_0x574373))[_0xf0bb('0x34')](handleError(_0x3c0365,null));};exports[_0xf0bb('0x35')]=function(_0x340577,_0x256aaf){var _0x109b00={'raw':!![],'where':{'id':_0x340577[_0xf0bb('0x36')]['id']}},_0x828e6b={};_0x828e6b[_0xf0bb('0x1b')]=_[_0xf0bb('0x1d')](db[_0xf0bb('0x2c')][_0xf0bb('0x19')]);_0x828e6b[_0xf0bb('0x1e')]=_[_0xf0bb('0x1d')](_0x340577[_0xf0bb('0x1e')]);_0x828e6b[_0xf0bb('0x1f')]=_['intersection'](_0x828e6b[_0xf0bb('0x1b')],_0x828e6b[_0xf0bb('0x1e')]);_0x109b00[_0xf0bb('0x21')]=_[_0xf0bb('0x20')](_0x828e6b['model'],qs[_0xf0bb('0x22')](_0x340577[_0xf0bb('0x1e')]['fields']));_0x109b00[_0xf0bb('0x21')]=_0x109b00[_0xf0bb('0x21')][_0xf0bb('0x23')]?_0x109b00['attributes']:_0x828e6b[_0xf0bb('0x1b')];if(_0x340577['query'][_0xf0bb('0x2d')]){_0x109b00['include']=[{'all':!![]}];}_0x109b00=_[_0xf0bb('0x37')]({},_0x109b00,_0x340577['options']);return db[_0xf0bb('0x2c')][_0xf0bb('0x38')](_0x109b00)[_0xf0bb('0x11')](handleEntityNotFound(_0x256aaf,null))[_0xf0bb('0x11')](function(_0x45fa93){if(_0x45fa93['service']===_0xf0bb('0x39')){var _0x3eecea=encryptor[_0xf0bb('0x32')](_0x45fa93[_0xf0bb('0x33')]);_0x45fa93[_0xf0bb('0x33')]=maskClientSecret(_0x3eecea);}return _0x45fa93;})[_0xf0bb('0x11')](respondWithResult(_0x256aaf,null))[_0xf0bb('0x34')](handleError(_0x256aaf,null));};exports[_0xf0bb('0x3a')]=function(_0x836058,_0x44a475){if(!_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x1c')])throw new Error(_0xf0bb('0x3c'));if(!_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x31')])throw new Error(_0xf0bb('0x3d'));var _0x2559ed=db['CloudProvider'][_0xf0bb('0x19')][_0xf0bb('0x31')]['values'];if(!_0x2559ed['includes'](_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x31')]))throw new Error(_0xf0bb('0x3e')+_0x2559ed[_0xf0bb('0x3f')](',\x20'));if(_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x31')]===_0xf0bb('0x39')&&_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x33')]){_0x836058[_0xf0bb('0x3b')][_0xf0bb('0x33')]=encryptor[_0xf0bb('0x40')](_0x836058[_0xf0bb('0x3b')]['data3']);}return db['CloudProvider']['create'](_0x836058[_0xf0bb('0x3b')],{})['then'](respondWithResult(_0x44a475,0xc9))[_0xf0bb('0x34')](handleError(_0x44a475,null));};exports[_0xf0bb('0x41')]=function(_0x3378a9,_0x1a17d4){if(_0x3378a9[_0xf0bb('0x3b')]['id']){delete _0x3378a9[_0xf0bb('0x3b')]['id'];}return db[_0xf0bb('0x2c')][_0xf0bb('0x38')]({'where':{'id':_0x3378a9[_0xf0bb('0x36')]['id']}})['then'](handleEntityNotFound(_0x1a17d4,null))[_0xf0bb('0x11')](function(_0x56db69){if(_0x56db69['service']===_0xf0bb('0x39')&&_0x3378a9[_0xf0bb('0x3b')][_0xf0bb('0x33')]){_0x3378a9[_0xf0bb('0x3b')][_0xf0bb('0x33')]=encryptor[_0xf0bb('0x40')](_0x3378a9[_0xf0bb('0x3b')][_0xf0bb('0x33')]);}return _0x56db69;})['then'](saveUpdates(_0x3378a9['body'],null))[_0xf0bb('0x11')](respondWithResult(_0x1a17d4,null))[_0xf0bb('0x34')](handleError(_0x1a17d4,null));};exports[_0xf0bb('0x12')]=function(_0xecb927,_0x37c869){return db[_0xf0bb('0x2c')][_0xf0bb('0x38')]({'where':{'id':_0xecb927[_0xf0bb('0x36')]['id']}})['then'](handleEntityNotFound(_0x37c869,null))['then'](removeEntity(_0x37c869,null))['catch'](handleError(_0x37c869,null));};exports[_0xf0bb('0x42')]=function(_0xea6269,_0x3a7e7c){return db[_0xf0bb('0x2c')][_0xf0bb('0x43')]({'where':{'id':_0xea6269[_0xf0bb('0x36')]['id']},'raw':!![]})['then'](function(_0x390b28){if(!_0x390b28)return _0x3a7e7c[_0xf0bb('0x8')](0x194);return{'url':oauth[_0xf0bb('0x44')](_0x390b28,_0xea6269[_0xf0bb('0x45')]['id'])};})['then'](respondWithResult(_0x3a7e7c,null))[_0xf0bb('0x34')](handleError(_0x3a7e7c,null));};exports[_0xf0bb('0x46')]=function(_0x2f2957,_0x460d9e){var _0x453617=_0x2f2957[_0xf0bb('0x3b')];var _0x481c1c;var _0x2044b1;if(_0x453617[_0xf0bb('0x13')])throw _0x453617;redis[_0xf0bb('0x47')](_0x453617[_0xf0bb('0x48')])[_0xf0bb('0x11')](function(_0x2fe01e){if(!_0x2fe01e)throw new Error(_0xf0bb('0x49'));_0x481c1c=JSON[_0xf0bb('0x4a')](_0x2fe01e);var _0x547838=Buffer[_0xf0bb('0x4b')](_0x453617['state'],'base64')[_0xf0bb('0x4c')](_0xf0bb('0x4d'));_0x2044b1=JSON[_0xf0bb('0x4a')](_0x547838);if(!oauth['isValidIdToken'](_0x453617['id_token'],_0x481c1c[_0xf0bb('0x4e')]))throw new Error(_0xf0bb('0x4f'));redis['del'](_0x453617[_0xf0bb('0x48')]);return oauth['getOauth2MicrosoftAccessToken'](_0x453617[_0xf0bb('0x50')],_0x481c1c);})[_0xf0bb('0x11')](function(_0x4bb411){_0x481c1c[_0xf0bb('0x51')]=_0x4bb411[_0xf0bb('0x52')];_0x481c1c[_0xf0bb('0x53')]=_0x4bb411[_0xf0bb('0x54')];return db[_0xf0bb('0x2c')]['update']({'data5':_0x481c1c[_0xf0bb('0x51')],'data6':_0x481c1c[_0xf0bb('0x53')]},{'where':{'id':_0x481c1c['id']}});})[_0xf0bb('0x11')](function(){oauth[_0xf0bb('0x55')](_0x481c1c);socket[_0xf0bb('0x56')](_0xf0bb('0x57'),{'id':_0x2044b1['id']});return;})['then'](respondWithStatusCode(_0x460d9e,null))['catch'](function(_0x4e5a2a){if(_0x2044b1){socket[_0xf0bb('0x56')](_0xf0bb('0x58'),{'id':_0x2044b1['id']});}if(!_0x481c1c){logger[_0xf0bb('0x13')](_0xf0bb('0x59'),_0x4e5a2a);return _0x460d9e[_0xf0bb('0xf')](0x1f4)[_0xf0bb('0x15')](_0x4e5a2a[_0xf0bb('0x5a')]);}logger[_0xf0bb('0x13')](_0xf0bb('0x5b'),_0x481c1c['id'],_0x4e5a2a);});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index f25f580..7b5e21f 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 _0x7314=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','lodash','util'];(function(_0x8da7e1,_0x57cd87){var _0x5b670c=function(_0x5cbe9e){while(--_0x5cbe9e){_0x8da7e1['push'](_0x8da7e1['shift']());}};_0x5b670c(++_0x57cd87);}(_0x7314,0x1b6));var _0x4731=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7314[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4731('0x0'));var util=require(_0x4731('0x1'));var logger=require(_0x4731('0x2'))(_0x4731('0x3'));var moment=require('moment');var BPromise=require(_0x4731('0x4'));var rp=require(_0x4731('0x5'));var fs=require('fs');var path=require(_0x4731('0x6'));var rimraf=require(_0x4731('0x7'));var config=require(_0x4731('0x8'));var attributes=require(_0x4731('0x9'));module['exports']=function(_0x5aa514,_0x114c3a){return _0x5aa514['define'](_0x4731('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeff5=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','api','moment'];(function(_0x32529e,_0x3bc08b){var _0x2d2d8c=function(_0x3c5eef){while(--_0x3c5eef){_0x32529e['push'](_0x32529e['shift']());}};_0x2d2d8c(++_0x3bc08b);}(_0xeff5,0xa2));var _0x5eff=function(_0x1be11b,_0x236e70){_0x1be11b=_0x1be11b-0x0;var _0x224847=_0xeff5[_0x1be11b];return _0x224847;};'use strict';var _=require(_0x5eff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5eff('0x1'));var moment=require(_0x5eff('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5eff('0x3'));var rimraf=require(_0x5eff('0x4'));var config=require(_0x5eff('0x5'));var attributes=require(_0x5eff('0x6'));module[_0x5eff('0x7')]=function(_0x2a5187,_0x463c49){return _0x2a5187[_0x5eff('0x8')](_0x5eff('0x9'),attributes,{'tableName':_0x5eff('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 345f06e..dae7818 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 _0x5f2f=['stringify','toString','randomBytes','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','oauth2/','decode','issuer','aud','audience','isAfter','unix','exp','data3','findOne','refresh_token','data6','decryptString','POST','then','data5','update','catch','intervals','CloudProvider','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','code','id_token','from'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x5f2f,0x73));var _0xf5f2=function(_0x383f7f,_0x11b7c2){_0x383f7f=_0x383f7f-0x0;var _0x4e2f71=_0x5f2f[_0x383f7f];return _0x4e2f71;};'use strict';var _=require(_0xf5f2('0x0'));var crypto=require(_0xf5f2('0x1'));var jwt=require(_0xf5f2('0x2'));var moment=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var util=require(_0xf5f2('0x6'));var encryptor=require(_0xf5f2('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xf5f2('0x8'));var schedule=require(_0xf5f2('0x9'));var db=require(_0xf5f2('0xa'))['db'];config[_0xf5f2('0xb')]=_[_0xf5f2('0xc')](config[_0xf5f2('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xf5f2('0xb')]);var MICROSOFT_AUTH_URL=_0xf5f2('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf5f2('0xe'),'profile',_0xf5f2('0xf'),_0xf5f2('0x10'),_0xf5f2('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xf5f2('0x12')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xf5f2('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xf5f2('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4b78cd){var _0x336f6b=_[_0xf5f2('0x15')](AZURE_AUTH_SCOPES[_0x4b78cd[_0xf5f2('0x16')]]);if(_0x4b78cd[_0xf5f2('0x16')]===_0xf5f2('0x17'))_0x336f6b[_0xf5f2('0x18')](_0x4b78cd['data7']+_0xf5f2('0x19'));return _0x336f6b[_0xf5f2('0x1a')]('\x20');}function getAccessTokenScope(_0x269909){if(_0x269909[_0xf5f2('0x16')]===_0xf5f2('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x269909[_0xf5f2('0x16')]===_0xf5f2('0x17'))return _0x269909[_0xf5f2('0x1c')]+_0xf5f2('0x19');}function generateMicrosoftAuthorizationUrl(_0x23e23a,_0x3a9dbb){var _0xdb61b3=MICROSOFT_AUTH_URL[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x23e23a[_0xf5f2('0x1f')]);var _0x20fccd=[_0xf5f2('0x20'),_0xf5f2('0x21')];var _0x3ee69=Buffer[_0xf5f2('0x22')](JSON[_0xf5f2('0x23')]({'id':_0x3a9dbb}))[_0xf5f2('0x24')]('base64');var _0x34706d=crypto[_0xf5f2('0x25')](0x10)['toString']('hex');var _0x2d2805=getAuthorizationScopes(_0x23e23a);var _0x388e6c=[{'key':'client_id','value':_0x23e23a[_0xf5f2('0x26')]},{'key':_0xf5f2('0x27'),'value':encodeURIComponent(_0x20fccd[_0xf5f2('0x1a')]('\x20'))},{'key':_0xf5f2('0x28'),'value':_0x23e23a[_0xf5f2('0x29')]},{'key':'response_mode','value':_0xf5f2('0x2a')},{'key':_0xf5f2('0x2b'),'value':encodeURIComponent(_0x2d2805)},{'key':_0xf5f2('0x2c'),'value':_0x3ee69},{'key':_0xf5f2('0x2d'),'value':_0x34706d},{'key':_0xf5f2('0x2e'),'value':'login'}];var _0x529f07=_0xdb61b3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf5f2('0x15')](_0x388e6c,function(_0x3f79d5){return _0x3f79d5[_0xf5f2('0x2f')]+'='+_0x3f79d5[_0xf5f2('0x30')];})[_0xf5f2('0x1a')]('&');_0x23e23a[_0xf5f2('0x31')]={'issuer':_0xdb61b3[_0xf5f2('0x1d')](_0xf5f2('0x32'),''),'audience':_0x23e23a[_0xf5f2('0x26')],'state':_0x3ee69,'nonce':_0x34706d};redis['set'](_0x3ee69,JSON[_0xf5f2('0x23')](_0x23e23a));return _0x529f07;}function isValidIdToken(_0x102449,_0x375ca8){try{var _0x31bfcb=jwt[_0xf5f2('0x33')](_0x102449,{'complete':!![]});var _0x477604=_0x31bfcb['payload'];if(_0x477604['iss']!==_0x375ca8[_0xf5f2('0x34')])return![];if(_0x477604[_0xf5f2('0x35')]!==_0x375ca8[_0xf5f2('0x36')])return![];if(_0x477604['nonce']!==_0x375ca8['nonce'])return![];if(moment()[_0xf5f2('0x37')](moment[_0xf5f2('0x38')](_0x477604[_0xf5f2('0x39')])))return![];return!![];}catch(_0x153924){throw _0x153924;}}function refreshOauth2MicrosoftAccessToken(_0x1b381e){return Promise['resolve']()['then'](function(){if(_0x1b381e[_0xf5f2('0x3a')])return _0x1b381e;return db['CloudProvider'][_0xf5f2('0x3b')]({'where':{'id':_0x1b381e['id']},'raw':!![]});})['then'](function(_0x45b643){var _0x31087c={'grant_type':_0xf5f2('0x3c'),'refresh_token':_0x45b643[_0xf5f2('0x3d')],'scope':getAccessTokenScope(_0x45b643),'redirect_uri':_0x45b643[_0xf5f2('0x29')],'client_id':_0x45b643[_0xf5f2('0x26')],'client_secret':encryptor[_0xf5f2('0x3e')](_0x45b643[_0xf5f2('0x3a')])};var _0x5ca917={'method':_0xf5f2('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x45b643[_0xf5f2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31087c,'json':!![]};return rp(_0x5ca917);})[_0xf5f2('0x40')](function(_0x27c0e7){_0x1b381e[_0xf5f2('0x41')]=_0x27c0e7['access_token'];_0x1b381e[_0xf5f2('0x3d')]=_0x27c0e7[_0xf5f2('0x3c')];return db['CloudProvider'][_0xf5f2('0x42')]({'data5':_0x1b381e['data5'],'data6':_0x1b381e[_0xf5f2('0x3d')]},{'where':{'id':_0x1b381e['id']}});})[_0xf5f2('0x40')](function(){return _0x1b381e;})[_0xf5f2('0x43')](function(_0x2e3cca){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s',_0x1b381e['id'],_0x2e3cca);});}function getOauth2MicrosoftAccessToken(_0x41088b,_0x46ad4a){var _0x20eb74={'grant_type':'authorization_code','code':_0x41088b,'scope':getAccessTokenScope(_0x46ad4a),'redirect_uri':_0x46ad4a[_0xf5f2('0x29')],'client_id':_0x46ad4a['data1'],'client_secret':encryptor[_0xf5f2('0x3e')](_0x46ad4a['data3'])};var _0x46f464={'method':_0xf5f2('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xf5f2('0x1e'),_0x46ad4a[_0xf5f2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x20eb74,'json':!![]};return rp(_0x46f464);}function startRefreshInterval(_0x5a4441){var _0x35f738=schedule['intervals'];if(_0x35f738[_0x5a4441['id']])clearInterval(_0x35f738[_0x5a4441['id']]);_0x35f738[_0x5a4441['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5a4441['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf5f2('0x44')]=_0x35f738;}function startAllRefreshIntervals(){return db[_0xf5f2('0x45')][_0xf5f2('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf5f2('0x40')](function(_0x2c7f65){var _0xe62b57=_0x2c7f65[_0xf5f2('0x15')](function(_0x4c0ac7){return refreshOauth2MicrosoftAccessToken(_0x4c0ac7)[_0xf5f2('0x40')](function(_0x3b4ea6){startRefreshInterval(_0x3b4ea6);});});return Promise['all'](_0xe62b57);})[_0xf5f2('0x43')](function(_0x3f3895){var _0x71b0e7=_0x3f3895?util[_0xf5f2('0x47')](_0x3f3895,{'showHidden':![],'depth':null}):'';logger[_0xf5f2('0x48')](_0xf5f2('0x49'),_0x71b0e7);});}module[_0xf5f2('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x1261=['toString','randomBytes','data1','response_type','redirect_uri','response_mode','form_post','state','key','value','oauth2Claims','replace','set','stringify','decode','payload','iss','aud','nonce','isAfter','exp','then','data3','CloudProvider','refresh_token','data6','data4','POST','data5','access_token','update','error','decryptString','intervals','bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','id_token'];(function(_0x431bd2,_0x1cdba3){var _0x3c4804=function(_0x5a80ef){while(--_0x5a80ef){_0x431bd2['push'](_0x431bd2['shift']());}};_0x3c4804(++_0x1cdba3);}(_0x1261,0x144));var _0x1126=function(_0x5eaa8a,_0x396d27){_0x5eaa8a=_0x5eaa8a-0x0;var _0x558bc8=_0x1261[_0x5eaa8a];return _0x558bc8;};'use strict';var _=require('lodash');var crypto=require(_0x1126('0x0'));var jwt=require(_0x1126('0x1'));var moment=require(_0x1126('0x2'));var Redis=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var util=require(_0x1126('0x5'));var encryptor=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var logger=require(_0x1126('0x8'))(_0x1126('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x1126('0xa')]=_[_0x1126('0xb')](config['redis'],{'host':_0x1126('0xc'),'port':0x18eb});var redis=new Redis(config[_0x1126('0xa')]);var MICROSOFT_AUTH_URL=_0x1126('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x1126('0xe'),_0x1126('0xf'),'email',_0x1126('0x10'),_0x1126('0x11'),_0x1126('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x1126('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x1126('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x561b93){var _0x15e89b=_[_0x1126('0x14')](AZURE_AUTH_SCOPES[_0x561b93[_0x1126('0x15')]]);if(_0x561b93[_0x1126('0x15')]===_0x1126('0x16'))_0x15e89b[_0x1126('0x17')](_0x561b93[_0x1126('0x18')]+_0x1126('0x19'));return _0x15e89b[_0x1126('0x1a')]('\x20');}function getAccessTokenScope(_0x53a8f0){if(_0x53a8f0['type']===_0x1126('0x1b'))return _0x1126('0x11');if(_0x53a8f0[_0x1126('0x15')]==='Dynamics365')return _0x53a8f0[_0x1126('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x35fe9f,_0x42f379){var _0x257b5f=MICROSOFT_AUTH_URL['replace'](_0x1126('0x1c'),_0x35fe9f[_0x1126('0x1d')]);var _0x4a7b49=['code',_0x1126('0x1e')];var _0x2b2487=Buffer['from'](JSON['stringify']({'id':_0x42f379}))[_0x1126('0x1f')]('base64');var _0x22ed37=crypto[_0x1126('0x20')](0x10)[_0x1126('0x1f')]('hex');var _0x2a08ba=getAuthorizationScopes(_0x35fe9f);var _0x49d209=[{'key':'client_id','value':_0x35fe9f[_0x1126('0x21')]},{'key':_0x1126('0x22'),'value':encodeURIComponent(_0x4a7b49[_0x1126('0x1a')]('\x20'))},{'key':_0x1126('0x23'),'value':_0x35fe9f['data4']},{'key':_0x1126('0x24'),'value':_0x1126('0x25')},{'key':'scope','value':encodeURIComponent(_0x2a08ba)},{'key':_0x1126('0x26'),'value':_0x2b2487},{'key':'nonce','value':_0x22ed37},{'key':'prompt','value':'login'}];var _0x2199d9=_0x257b5f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1126('0x14')](_0x49d209,function(_0x329914){return _0x329914[_0x1126('0x27')]+'='+_0x329914[_0x1126('0x28')];})[_0x1126('0x1a')]('&');_0x35fe9f[_0x1126('0x29')]={'issuer':_0x257b5f[_0x1126('0x2a')]('oauth2/',''),'audience':_0x35fe9f[_0x1126('0x21')],'state':_0x2b2487,'nonce':_0x22ed37};redis[_0x1126('0x2b')](_0x2b2487,JSON[_0x1126('0x2c')](_0x35fe9f));return _0x2199d9;}function isValidIdToken(_0x5ddf63,_0x541bc9){try{var _0xeb7d89=jwt[_0x1126('0x2d')](_0x5ddf63,{'complete':!![]});var _0x55e195=_0xeb7d89[_0x1126('0x2e')];if(_0x55e195[_0x1126('0x2f')]!==_0x541bc9['issuer'])return![];if(_0x55e195[_0x1126('0x30')]!==_0x541bc9['audience'])return![];if(_0x55e195[_0x1126('0x31')]!==_0x541bc9['nonce'])return![];if(moment()[_0x1126('0x32')](moment['unix'](_0x55e195[_0x1126('0x33')])))return![];return!![];}catch(_0x5f2611){throw _0x5f2611;}}function refreshOauth2MicrosoftAccessToken(_0x5252e0){return Promise['resolve']()[_0x1126('0x34')](function(){if(_0x5252e0[_0x1126('0x35')])return _0x5252e0;return db[_0x1126('0x36')]['findOne']({'where':{'id':_0x5252e0['id']},'raw':!![]});})[_0x1126('0x34')](function(_0x226afb){var _0x56f7f8={'grant_type':_0x1126('0x37'),'refresh_token':_0x226afb[_0x1126('0x38')],'scope':getAccessTokenScope(_0x226afb),'redirect_uri':_0x226afb[_0x1126('0x39')],'client_id':_0x226afb[_0x1126('0x21')],'client_secret':encryptor['decryptString'](_0x226afb['data3'])};var _0x2a7edc={'method':_0x1126('0x3a'),'uri':MICROSOFT_AUTH_URL[_0x1126('0x2a')](_0x1126('0x1c'),_0x226afb['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x56f7f8,'json':!![]};return rp(_0x2a7edc);})[_0x1126('0x34')](function(_0x6f4312){_0x5252e0[_0x1126('0x3b')]=_0x6f4312[_0x1126('0x3c')];_0x5252e0[_0x1126('0x38')]=_0x6f4312['refresh_token'];return db[_0x1126('0x36')][_0x1126('0x3d')]({'data5':_0x5252e0[_0x1126('0x3b')],'data6':_0x5252e0[_0x1126('0x38')]},{'where':{'id':_0x5252e0['id']}});})['then'](function(){return _0x5252e0;})['catch'](function(_0x22827a){logger[_0x1126('0x3e')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s',_0x5252e0['id'],_0x22827a);});}function getOauth2MicrosoftAccessToken(_0xde37cf,_0xf3c21b){var _0x11b0f6={'grant_type':'authorization_code','code':_0xde37cf,'scope':getAccessTokenScope(_0xf3c21b),'redirect_uri':_0xf3c21b['data4'],'client_id':_0xf3c21b[_0x1126('0x21')],'client_secret':encryptor[_0x1126('0x3f')](_0xf3c21b[_0x1126('0x35')])};var _0x156554={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x1126('0x2a')]('{TENANT_ID}',_0xf3c21b[_0x1126('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11b0f6,'json':!![]};return rp(_0x156554);}function startRefreshInterval(_0x20e43a){var _0xfa96e0=schedule[_0x1126('0x40')];if(_0xfa96e0[_0x20e43a['id']])clearInterval(_0xfa96e0[_0x20e43a['id']]);_0xfa96e0[_0x20e43a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1126('0x41')](this,{'id':_0x20e43a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xfa96e0;}function startAllRefreshIntervals(){return db[_0x1126('0x36')][_0x1126('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1126('0x34')](function(_0x397e3b){var _0x3469a2=_0x397e3b[_0x1126('0x14')](function(_0x3052f9){return refreshOauth2MicrosoftAccessToken(_0x3052f9)['then'](function(_0x1c8d8a){startRefreshInterval(_0x1c8d8a);});});return Promise[_0x1126('0x43')](_0x3469a2);})[_0x1126('0x44')](function(_0xf3a0bd){var _0xcf0483=_0xf3a0bd?util['inspect'](_0xf3a0bd,{'showHidden':![],'depth':null}):'';logger['error'](_0x1126('0x45'),_0xcf0483);});}module[_0x1126('0x46')]={'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 655da12..4333791 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 _0x6edc=['code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x24348e,_0x360eb9){var _0x41a5b1=function(_0x3ee79b){while(--_0x3ee79b){_0x24348e['push'](_0x24348e['shift']());}};_0x41a5b1(++_0x360eb9);}(_0x6edc,0x138));var _0xc6ed=function(_0x2957d6,_0x363bbb){_0x2957d6=_0x2957d6-0x0;var _0x379052=_0x6edc[_0x2957d6];return _0x379052;};'use strict';var _=require(_0xc6ed('0x0'));var util=require(_0xc6ed('0x1'));var moment=require(_0xc6ed('0x2'));var BPromise=require(_0xc6ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6ed('0x4'))['db'];var utils=require(_0xc6ed('0x5'));var logger=require(_0xc6ed('0x6'))(_0xc6ed('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6ed('0x8'));var client=jayson[_0xc6ed('0x9')][_0xc6ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548a14,_0x274b0d,_0x5a077d){return new BPromise(function(_0xd46c3f,_0x13fed0){return client[_0xc6ed('0xb')](_0x548a14,_0x5a077d)[_0xc6ed('0xc')](function(_0x496e6a){logger[_0xc6ed('0xd')](_0xc6ed('0xe'),_0x274b0d,_0xc6ed('0xf'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x274b0d,_0xc6ed('0xf'),JSON[_0xc6ed('0x10')](_0x496e6a));if(_0x496e6a[_0xc6ed('0x11')]){if(_0x496e6a[_0xc6ed('0x11')][_0xc6ed('0x12')]===0x1f4){logger['error'](_0xc6ed('0xe'),_0x274b0d,_0x496e6a['error'][_0xc6ed('0x13')]);return _0x13fed0(_0x496e6a['error'][_0xc6ed('0x13')]);}logger[_0xc6ed('0x11')](_0xc6ed('0xe'),_0x274b0d,_0x496e6a['error'][_0xc6ed('0x13')]);return _0xd46c3f(_0x496e6a[_0xc6ed('0x11')][_0xc6ed('0x13')]);}else{logger['info'](_0xc6ed('0xe'),_0x274b0d,'request\x20sent');_0xd46c3f(_0x496e6a[_0xc6ed('0x14')][_0xc6ed('0x13')]);}})[_0xc6ed('0x15')](function(_0x5346fe){logger[_0xc6ed('0x11')](_0xc6ed('0xe'),_0x274b0d,_0x5346fe);_0x13fed0(_0x5346fe);});});}
\ No newline at end of file
+var _0xb2f3=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s'];(function(_0x1df1bf,_0x5b3830){var _0x7100e8=function(_0x4b8156){while(--_0x4b8156){_0x1df1bf['push'](_0x1df1bf['shift']());}};_0x7100e8(++_0x5b3830);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xb2f3[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var moment=require(_0x3b2f('0x2'));var BPromise=require(_0x3b2f('0x3'));var rs=require(_0x3b2f('0x4'));var fs=require('fs');var Redis=require(_0x3b2f('0x5'));var db=require(_0x3b2f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b2f('0x7'))(_0x3b2f('0x8'));var config=require(_0x3b2f('0x9'));var jayson=require(_0x3b2f('0xa'));var client=jayson[_0x3b2f('0xb')][_0x3b2f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26719d,_0x4b3632,_0x200ca4){return new BPromise(function(_0x56e425,_0x266ed2){return client[_0x3b2f('0xd')](_0x26719d,_0x200ca4)[_0x3b2f('0xe')](function(_0x25134f){logger['info']('CloudProvider,\x20%s,\x20%s',_0x4b3632,_0x3b2f('0xf'));logger[_0x3b2f('0x10')](_0x3b2f('0x11'),_0x4b3632,_0x3b2f('0xf'),JSON[_0x3b2f('0x12')](_0x25134f));if(_0x25134f[_0x3b2f('0x13')]){if(_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x14')]===0x1f4){logger[_0x3b2f('0x13')](_0x3b2f('0x15'),_0x4b3632,_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x16')]);return _0x266ed2(_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x16')]);}logger[_0x3b2f('0x13')]('CloudProvider,\x20%s,\x20%s',_0x4b3632,_0x25134f[_0x3b2f('0x13')]['message']);return _0x56e425(_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x16')]);}else{logger['info'](_0x3b2f('0x15'),_0x4b3632,'request\x20sent');_0x56e425(_0x25134f[_0x3b2f('0x17')][_0x3b2f('0x16')]);}})[_0x3b2f('0x18')](function(_0xd2b1e9){logger['error']('CloudProvider,\x20%s,\x20%s',_0x4b3632,_0xd2b1e9);_0x266ed2(_0xd2b1e9);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index befffbb..0374c8a 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x1261,0x144));var _0x1126=function(_0x21eb3c,_0x7ce88b){_0x21eb3c=_0x21eb3c-0x0;var _0x4bd2aa=_0x1261[_0x21eb3c];return _0x4bd2aa;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x202d62,_0x479658){var _0x2b5c4c=function(_0x1a9f38){while(--_0x1a9f38){_0x202d62['push'](_0x202d62['shift']());}};_0x2b5c4c(++_0x479658);}(_0xadb5,0xad));var _0x5adb=function(_0x3e4073,_0x40e40e){_0x3e4073=_0x3e4073-0x0;var _0x35bc32=_0xadb5[_0x3e4073];return _0x35bc32;};'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 69744f9..4f0e359 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 _0xb33f=['exports','name','STRING','sequelize'];(function(_0x4bc0de,_0x1089b5){var _0x5db9c3=function(_0x408a55){while(--_0x408a55){_0x4bc0de['push'](_0x4bc0de['shift']());}};_0x5db9c3(++_0x1089b5);}(_0xb33f,0x1cf));var _0xfb33=function(_0x17ff2b,_0x3eb0ca){_0x17ff2b=_0x17ff2b-0x0;var _0x315754=_0xb33f[_0x17ff2b];return _0x315754;};'use strict';var Sequelize=require(_0xfb33('0x0'));module[_0xfb33('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfb33('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xfb33('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfb33('0x3')]},'postalCode':{'type':Sequelize[_0xfb33('0x3')]},'city':{'type':Sequelize[_0xfb33('0x3')]},'country':{'type':Sequelize[_0xfb33('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfb33('0x3')]},'sStreet':{'type':Sequelize[_0xfb33('0x3')]},'sPostalCode':{'type':Sequelize[_0xfb33('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xfb33('0x3')]},'description':{'type':Sequelize[_0xfb33('0x3')]}};
\ No newline at end of file
+var _0x4740=['name','sequelize','exports','STRING'];(function(_0x85ab59,_0x57a06a){var _0x30e227=function(_0x3059aa){while(--_0x3059aa){_0x85ab59['push'](_0x85ab59['shift']());}};_0x30e227(++_0x57a06a);}(_0x4740,0x1b5));var _0x0474=function(_0x3d593e,_0x492981){_0x3d593e=_0x3d593e-0x0;var _0xc519c7=_0x4740[_0x3d593e];return _0xc519c7;};'use strict';var Sequelize=require(_0x0474('0x0'));module[_0x0474('0x1')]={'name':{'type':Sequelize[_0x0474('0x2')],'unique':_0x0474('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0474('0x2')]},'phone':{'type':Sequelize[_0x0474('0x2')]},'fax':{'type':Sequelize[_0x0474('0x2')]},'type':{'type':Sequelize[_0x0474('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0474('0x2')]},'city':{'type':Sequelize[_0x0474('0x2')]},'country':{'type':Sequelize[_0x0474('0x2')]},'email':{'type':Sequelize[_0x0474('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0474('0x2')]},'sStreet':{'type':Sequelize[_0x0474('0x2')]},'sPostalCode':{'type':Sequelize[_0x0474('0x2')]},'sCity':{'type':Sequelize[_0x0474('0x2')]},'sCountry':{'type':Sequelize[_0x0474('0x2')]},'description':{'type':Sequelize[_0x0474('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 8db1420..8bebb28 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 _0x93db=['name','send','CmCompany','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','merge','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','omit','ids','findOne','CmContact','order','pick','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Companies','end','error','stack'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x93db,0xd5));var _0xb93d=function(_0x1ed15d,_0xdfa8bc){_0x1ed15d=_0x1ed15d-0x0;var _0x39d7e4=_0x93db[_0x1ed15d];return _0x39d7e4;};'use strict';var emlformat=require(_0xb93d('0x0'));var rimraf=require(_0xb93d('0x1'));var zipdir=require(_0xb93d('0x2'));var jsonpatch=require(_0xb93d('0x3'));var rp=require(_0xb93d('0x4'));var moment=require(_0xb93d('0x5'));var BPromise=require(_0xb93d('0x6'));var Mustache=require(_0xb93d('0x7'));var util=require(_0xb93d('0x8'));var path=require(_0xb93d('0x9'));var sox=require(_0xb93d('0xa'));var csv=require(_0xb93d('0xb'));var ejs=require(_0xb93d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb93d('0xd'));var squel=require('squel');var crypto=require(_0xb93d('0xe'));var jsforce=require(_0xb93d('0xf'));var deskjs=require(_0xb93d('0x10'));var toCsv=require(_0xb93d('0xb'));var querystring=require(_0xb93d('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb93d('0x12'));var as=require(_0xb93d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb93d('0x14'))(_0xb93d('0x15'));var utils=require('../../config/utils');var config=require(_0xb93d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb93d('0x17'))['db'];function respondWithStatusCode(_0x449a47,_0x515daa){_0x515daa=_0x515daa||0xcc;return function(_0x3b63d8){if(_0x3b63d8){return _0x449a47[_0xb93d('0x18')](_0x515daa);}return _0x449a47[_0xb93d('0x19')](_0x515daa)['end']();};}function respondWithResult(_0x590b6a,_0x25e9c4){_0x25e9c4=_0x25e9c4||0xc8;return function(_0x5a838c){if(_0x5a838c){return _0x590b6a['status'](_0x25e9c4)['json'](_0x5a838c);}};}function respondWithFilteredResult(_0x3b053c,_0x2f27cb){return function(_0xdc6e57){if(_0xdc6e57){var _0x502d32=typeof _0x2f27cb[_0xb93d('0x1a')]===_0xb93d('0x1b')&&typeof _0x2f27cb[_0xb93d('0x1c')]===_0xb93d('0x1b');var _0x28428a=_0xdc6e57[_0xb93d('0x1d')];var _0x16c148=_0x502d32?0x0:_0x2f27cb[_0xb93d('0x1a')];var _0x431ff7=_0x502d32?_0xdc6e57['count']:_0x2f27cb[_0xb93d('0x1a')]+_0x2f27cb['limit'];var _0xcc4654;if(_0x431ff7>=_0x28428a){_0x431ff7=_0x28428a;_0xcc4654=0xc8;}else{_0xcc4654=0xce;}_0x3b053c[_0xb93d('0x19')](_0xcc4654);return _0x3b053c[_0xb93d('0x1e')](_0xb93d('0x1f'),_0x16c148+'-'+_0x431ff7+'/'+_0x28428a)['json'](_0xdc6e57);}return null;};}function patchUpdates(_0x19e309){return function(_0x7285bb){try{jsonpatch[_0xb93d('0x20')](_0x7285bb,_0x19e309,!![]);}catch(_0x1283ee){return BPromise['reject'](_0x1283ee);}return _0x7285bb[_0xb93d('0x21')]();};}function saveUpdates(_0x44b5c0,_0x34522a){return function(_0x3eaf81){if(_0x3eaf81){return _0x3eaf81[_0xb93d('0x22')](_0x44b5c0)[_0xb93d('0x23')](function(_0x4a0be1){return _0x4a0be1;});}return null;};}function removeEntity(_0x5e1199,_0x548c31){return function(_0x5dd27a){if(_0x5dd27a){return _0x5dd27a[_0xb93d('0x24')]()['then'](function(){var _0x12ec52=_0x5dd27a[_0xb93d('0x25')]({'plain':!![]});var _0x313895=_0xb93d('0x26');return db['UserProfileResource'][_0xb93d('0x24')]({'where':{'type':_0x313895,'resourceId':_0x12ec52['id']}})[_0xb93d('0x23')](function(){return _0x5dd27a;});})['then'](function(){_0x5e1199[_0xb93d('0x19')](0xcc)[_0xb93d('0x27')]();});}};}function handleEntityNotFound(_0x2304f0,_0x138e8e){return function(_0x2416ea){if(!_0x2416ea){_0x2304f0[_0xb93d('0x18')](0x194);}return _0x2416ea;};}function handleError(_0x334a4a,_0x4f178a){_0x4f178a=_0x4f178a||0x1f4;return function(_0x344081){logger[_0xb93d('0x28')](_0x344081[_0xb93d('0x29')]);if(_0x344081[_0xb93d('0x2a')]){delete _0x344081[_0xb93d('0x2a')];}_0x334a4a[_0xb93d('0x19')](_0x4f178a)[_0xb93d('0x2b')](_0x344081);};}exports['index']=function(_0x122f08,_0x55a9e3){var _0x54d456={},_0x5c5e41={},_0x4749b7={'count':0x0,'rows':[]};return db[_0xb93d('0x2c')]['describe']()[_0xb93d('0x23')](function(_0x1cf260){_0x5c5e41[_0xb93d('0x2d')]=_[_0xb93d('0x2e')](_0x1cf260);_0x5c5e41['query']=_[_0xb93d('0x2e')](_0x122f08['query']);_0x5c5e41[_0xb93d('0x2f')]=_['intersection'](_0x5c5e41[_0xb93d('0x2d')],_0x5c5e41[_0xb93d('0x30')]);_0x54d456[_0xb93d('0x31')]=_[_0xb93d('0x32')](_0x5c5e41[_0xb93d('0x2d')],qs[_0xb93d('0x33')](_0x122f08[_0xb93d('0x30')]['fields']));_0x54d456[_0xb93d('0x31')]=_0x54d456['attributes'][_0xb93d('0x34')]?_0x54d456['attributes']:_0x5c5e41[_0xb93d('0x2d')];if(!_0x122f08[_0xb93d('0x30')][_0xb93d('0x35')](_0xb93d('0x36'))){_0x54d456['limit']=qs[_0xb93d('0x1c')](_0x122f08[_0xb93d('0x30')]['limit']);_0x54d456[_0xb93d('0x1a')]=qs[_0xb93d('0x1a')](_0x122f08['query'][_0xb93d('0x1a')]);}_0x54d456['order']=qs['sort'](_0x122f08[_0xb93d('0x30')][_0xb93d('0x37')]);_0x54d456[_0xb93d('0x38')]=qs[_0xb93d('0x2f')](_['pick'](_0x122f08[_0xb93d('0x30')],_0x5c5e41[_0xb93d('0x2f')]),_0x1cf260);if(_0x122f08[_0xb93d('0x30')][_0xb93d('0x39')]){_0x54d456[_0xb93d('0x38')]=_['merge'](_0x54d456[_0xb93d('0x38')],{'$or':_[_0xb93d('0x3a')](_0x54d456['attributes'],function(_0x13f4ff){var _0x4e2819={};_0x4e2819[_0x13f4ff]={'$like':'%'+_0x122f08[_0xb93d('0x30')]['filter']+'%'};return _0x4e2819;})});}_0x54d456=_[_0xb93d('0x3b')]({},_0x54d456,_0x122f08['options']);var _0x463771={'where':_0x54d456[_0xb93d('0x38')]};return db[_0xb93d('0x2c')]['count'](_0x463771)[_0xb93d('0x23')](function(_0x1d8c31){_0x4749b7[_0xb93d('0x1d')]=_0x1d8c31;if(_0x122f08['query'][_0xb93d('0x3c')]){_0x54d456[_0xb93d('0x3d')]=[{'all':!![]}];}return db[_0xb93d('0x2c')][_0xb93d('0x3e')](_0x54d456);})[_0xb93d('0x23')](function(_0x215da1){_0x4749b7[_0xb93d('0x3f')]=_0x215da1;return _0x4749b7;})[_0xb93d('0x23')](respondWithFilteredResult(_0x55a9e3,_0x54d456))[_0xb93d('0x40')](handleError(_0x55a9e3,null));})[_0xb93d('0x40')](handleError(_0x55a9e3,null));};exports['show']=function(_0xece3c2,_0x4e4bed){var _0xdc2adc={'raw':![],'where':{'id':_0xece3c2['params']['id']}},_0x199844={};_0x199844[_0xb93d('0x2d')]=_[_0xb93d('0x2e')](db[_0xb93d('0x2c')][_0xb93d('0x41')]);_0x199844[_0xb93d('0x30')]=_[_0xb93d('0x2e')](_0xece3c2[_0xb93d('0x30')]);_0x199844['filters']=_[_0xb93d('0x32')](_0x199844[_0xb93d('0x2d')],_0x199844[_0xb93d('0x30')]);_0xdc2adc[_0xb93d('0x31')]=_[_0xb93d('0x32')](_0x199844[_0xb93d('0x2d')],qs[_0xb93d('0x33')](_0xece3c2['query'][_0xb93d('0x33')]));_0xdc2adc['attributes']=_0xdc2adc[_0xb93d('0x31')][_0xb93d('0x34')]?_0xdc2adc['attributes']:_0x199844[_0xb93d('0x2d')];if(_0xece3c2[_0xb93d('0x30')][_0xb93d('0x3c')]){_0xdc2adc['include']=[{'all':!![]}];}_0xdc2adc=_[_0xb93d('0x3b')]({},_0xdc2adc,_0xece3c2['options']);return db[_0xb93d('0x2c')][_0xb93d('0x42')](_0xdc2adc)[_0xb93d('0x23')](handleEntityNotFound(_0x4e4bed,null))[_0xb93d('0x23')](respondWithResult(_0x4e4bed,null))['catch'](handleError(_0x4e4bed,null));};exports['create']=function(_0x12dc64,_0x50165a){return db[_0xb93d('0x2c')][_0xb93d('0x43')](_0x12dc64[_0xb93d('0x44')],{})[_0xb93d('0x23')](function(_0x5b2aa1){var _0x27ab0e=_0x12dc64['user'][_0xb93d('0x25')]({'plain':!![]});if(!_0x27ab0e)throw new Error(_0xb93d('0x45'));if(_0x27ab0e['role']==='user'){var _0x4ccccd=_0x5b2aa1['get']({'plain':!![]});var _0x308082=_0xb93d('0x26');return db[_0xb93d('0x46')][_0xb93d('0x42')]({'where':{'name':_0x308082,'userProfileId':_0x27ab0e[_0xb93d('0x47')]},'raw':!![]})[_0xb93d('0x23')](function(_0x5d9a4a){if(_0x5d9a4a&&_0x5d9a4a[_0xb93d('0x48')]===0x0){return db[_0xb93d('0x49')][_0xb93d('0x43')]({'name':_0x4ccccd[_0xb93d('0x2a')],'resourceId':_0x4ccccd['id'],'type':_0x5d9a4a[_0xb93d('0x2a')],'sectionId':_0x5d9a4a['id']},{})[_0xb93d('0x23')](function(){return _0x5b2aa1;});}else{return _0x5b2aa1;}})['catch'](function(_0x533736){logger[_0xb93d('0x28')](_0xb93d('0x4a'),_0x533736);throw _0x533736;});}return _0x5b2aa1;})[_0xb93d('0x23')](respondWithResult(_0x50165a,0xc9))[_0xb93d('0x40')](handleError(_0x50165a,null));};exports[_0xb93d('0x22')]=function(_0x4211c3,_0x1fbe94){if(_0x4211c3[_0xb93d('0x44')]['id']){delete _0x4211c3[_0xb93d('0x44')]['id'];}return db['CmCompany'][_0xb93d('0x42')]({'where':{'id':_0x4211c3[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x1fbe94,null))[_0xb93d('0x23')](saveUpdates(_0x4211c3['body'],null))[_0xb93d('0x23')](respondWithResult(_0x1fbe94,null))[_0xb93d('0x40')](handleError(_0x1fbe94,null));};exports[_0xb93d('0x24')]=function(_0x2f9852,_0x3bfbdf){return db[_0xb93d('0x2c')]['find']({'where':{'id':_0x2f9852[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x3bfbdf,null))[_0xb93d('0x23')](removeEntity(_0x3bfbdf,null))[_0xb93d('0x40')](handleError(_0x3bfbdf,null));};exports[_0xb93d('0x4c')]=function(_0x383cc2,_0xab1d5c){return db['CmCompany'][_0xb93d('0x4c')]()['then'](respondWithResult(_0xab1d5c,null))['catch'](handleError(_0xab1d5c,null));};exports[_0xb93d('0x4d')]=function(_0x12004e,_0x310b85,_0x14be66){return db['CmContact']['find']({'where':{'id':_0x12004e[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x310b85,null))[_0xb93d('0x23')](function(_0x2d4f9b){if(_0x2d4f9b){return _0x2d4f9b[_0xb93d('0x4d')](_0x12004e['body']['ids'],_[_0xb93d('0x4e')](_0x12004e[_0xb93d('0x44')],[_0xb93d('0x4f'),'id'])||{});}})[_0xb93d('0x23')](respondWithResult(_0x310b85,null))[_0xb93d('0x40')](handleError(_0x310b85,null));};exports['getContacts']=function(_0x4cdff0,_0x127eb7,_0x5cb8d3){var _0x3a3811={};var _0x55e408={};var _0x59812a;var _0x35c7cb;return db['CmCompany'][_0xb93d('0x50')]({'where':{'id':_0x4cdff0[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x127eb7,null))['then'](function(_0x60a0b5){if(_0x60a0b5){_0x59812a=_0x60a0b5;_0x55e408[_0xb93d('0x2d')]=_[_0xb93d('0x2e')](db[_0xb93d('0x51')][_0xb93d('0x41')]);_0x55e408[_0xb93d('0x30')]=_[_0xb93d('0x2e')](_0x4cdff0['query']);_0x55e408[_0xb93d('0x2f')]=_[_0xb93d('0x32')](_0x55e408[_0xb93d('0x2d')],_0x55e408[_0xb93d('0x30')]);_0x3a3811['attributes']=_[_0xb93d('0x32')](_0x55e408[_0xb93d('0x2d')],qs['fields'](_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x33')]));_0x3a3811['attributes']=_0x3a3811['attributes'][_0xb93d('0x34')]?_0x3a3811['attributes']:_0x55e408[_0xb93d('0x2d')];_0x3a3811[_0xb93d('0x52')]=qs[_0xb93d('0x37')](_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x37')]);_0x3a3811[_0xb93d('0x38')]=qs['filters'](_[_0xb93d('0x53')](_0x4cdff0[_0xb93d('0x30')],_0x55e408[_0xb93d('0x2f')]));if(_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x39')]){_0x3a3811['where']=_[_0xb93d('0x3b')](_0x3a3811[_0xb93d('0x38')],{'$or':_[_0xb93d('0x3a')](_0x3a3811[_0xb93d('0x31')],function(_0x3377dd){var _0x32d2ae={};_0x32d2ae[_0x3377dd]={'$like':'%'+_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x39')]+'%'};return _0x32d2ae;})});}_0x3a3811=_['merge']({},_0x3a3811,_0x4cdff0['options']);return _0x59812a[_0xb93d('0x54')](_0x3a3811);}})[_0xb93d('0x23')](function(_0x966659){if(_0x966659){_0x35c7cb=_0x966659[_0xb93d('0x34')];if(!_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x35')](_0xb93d('0x36'))){_0x3a3811['limit']=qs[_0xb93d('0x1c')](_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x1c')]);_0x3a3811[_0xb93d('0x1a')]=qs['offset'](_0x4cdff0[_0xb93d('0x30')]['offset']);}return _0x59812a[_0xb93d('0x54')](_0x3a3811);}})['then'](function(_0x287a6a){if(_0x287a6a){return _0x287a6a?{'count':_0x35c7cb,'rows':_0x287a6a}:null;}})[_0xb93d('0x23')](respondWithResult(_0x127eb7,null))[_0xb93d('0x40')](handleError(_0x127eb7,null));};
\ No newline at end of file
+var _0x155d=['ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','offset','count','set','Content-Range','json','reject','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','options','includeAll','include','catch','show','params','rawAttributes','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','omit','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x375ff0,_0x536ea9){var _0x18cacd=function(_0x4250e5){while(--_0x4250e5){_0x375ff0['push'](_0x375ff0['shift']());}};_0x18cacd(++_0x536ea9);}(_0x155d,0x98));var _0xd155=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x155d[_0x2b5513];return _0x578fd2;};'use strict';var emlformat=require(_0xd155('0x0'));var rimraf=require(_0xd155('0x1'));var zipdir=require(_0xd155('0x2'));var jsonpatch=require(_0xd155('0x3'));var rp=require(_0xd155('0x4'));var moment=require(_0xd155('0x5'));var BPromise=require(_0xd155('0x6'));var Mustache=require(_0xd155('0x7'));var util=require(_0xd155('0x8'));var path=require(_0xd155('0x9'));var sox=require(_0xd155('0xa'));var csv=require(_0xd155('0xb'));var ejs=require(_0xd155('0xc'));var fs=require('fs');var fs_extra=require(_0xd155('0xd'));var _=require(_0xd155('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd155('0xb'));var querystring=require('querystring');var Papa=require(_0xd155('0xf'));var Redis=require(_0xd155('0x10'));var authService=require(_0xd155('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd155('0x12'));var hardwareService=require(_0xd155('0x13'));var logger=require(_0xd155('0x14'))(_0xd155('0x15'));var utils=require(_0xd155('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd155('0x17'));var db=require(_0xd155('0x18'))['db'];function respondWithStatusCode(_0x5d0c00,_0x5eb898){_0x5eb898=_0x5eb898||0xcc;return function(_0x3ad086){if(_0x3ad086){return _0x5d0c00['sendStatus'](_0x5eb898);}return _0x5d0c00[_0xd155('0x19')](_0x5eb898)['end']();};}function respondWithResult(_0xc1a22,_0x2eb0d0){_0x2eb0d0=_0x2eb0d0||0xc8;return function(_0x15850f){if(_0x15850f){return _0xc1a22['status'](_0x2eb0d0)['json'](_0x15850f);}};}function respondWithFilteredResult(_0xf0897a,_0x176803){return function(_0x213fe1){if(_0x213fe1){var _0x18ebaa=typeof _0x176803['offset']===_0xd155('0x1a')&&typeof _0x176803[_0xd155('0x1b')]==='undefined';var _0x3a5d14=_0x213fe1['count'];var _0x3dddd0=_0x18ebaa?0x0:_0x176803[_0xd155('0x1c')];var _0x1b90cc=_0x18ebaa?_0x213fe1[_0xd155('0x1d')]:_0x176803[_0xd155('0x1c')]+_0x176803[_0xd155('0x1b')];var _0x49baa9;if(_0x1b90cc>=_0x3a5d14){_0x1b90cc=_0x3a5d14;_0x49baa9=0xc8;}else{_0x49baa9=0xce;}_0xf0897a['status'](_0x49baa9);return _0xf0897a[_0xd155('0x1e')](_0xd155('0x1f'),_0x3dddd0+'-'+_0x1b90cc+'/'+_0x3a5d14)[_0xd155('0x20')](_0x213fe1);}return null;};}function patchUpdates(_0x25d803){return function(_0x1da1a1){try{jsonpatch['apply'](_0x1da1a1,_0x25d803,!![]);}catch(_0x1ba74c){return BPromise[_0xd155('0x21')](_0x1ba74c);}return _0x1da1a1['save']();};}function saveUpdates(_0x15f61b,_0x57ddaa){return function(_0x24844b){if(_0x24844b){return _0x24844b[_0xd155('0x22')](_0x15f61b)[_0xd155('0x23')](function(_0x467c48){return _0x467c48;});}return null;};}function removeEntity(_0x5cdcd,_0x2455db){return function(_0x59b592){if(_0x59b592){return _0x59b592[_0xd155('0x24')]()['then'](function(){var _0x2c6a2d=_0x59b592[_0xd155('0x25')]({'plain':!![]});var _0x58b16d=_0xd155('0x26');return db[_0xd155('0x27')][_0xd155('0x24')]({'where':{'type':_0x58b16d,'resourceId':_0x2c6a2d['id']}})['then'](function(){return _0x59b592;});})[_0xd155('0x23')](function(){_0x5cdcd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e81b1,_0x34ecbd){return function(_0xa3ede6){if(!_0xa3ede6){_0x1e81b1[_0xd155('0x28')](0x194);}return _0xa3ede6;};}function handleError(_0x39f722,_0x3508fc){_0x3508fc=_0x3508fc||0x1f4;return function(_0x1551d7){logger[_0xd155('0x29')](_0x1551d7[_0xd155('0x2a')]);if(_0x1551d7['name']){delete _0x1551d7[_0xd155('0x2b')];}_0x39f722[_0xd155('0x19')](_0x3508fc)[_0xd155('0x2c')](_0x1551d7);};}exports[_0xd155('0x2d')]=function(_0x274cc0,_0xc45dc4){var _0x100709={},_0x12d8a6={},_0x345567={'count':0x0,'rows':[]};return db[_0xd155('0x2e')][_0xd155('0x2f')]()['then'](function(_0x33c8ff){_0x12d8a6[_0xd155('0x30')]=_[_0xd155('0x31')](_0x33c8ff);_0x12d8a6[_0xd155('0x32')]=_[_0xd155('0x31')](_0x274cc0['query']);_0x12d8a6['filters']=_[_0xd155('0x33')](_0x12d8a6['model'],_0x12d8a6[_0xd155('0x32')]);_0x100709['attributes']=_[_0xd155('0x33')](_0x12d8a6[_0xd155('0x30')],qs[_0xd155('0x34')](_0x274cc0[_0xd155('0x32')][_0xd155('0x34')]));_0x100709[_0xd155('0x35')]=_0x100709[_0xd155('0x35')]['length']?_0x100709[_0xd155('0x35')]:_0x12d8a6['model'];if(!_0x274cc0[_0xd155('0x32')][_0xd155('0x36')](_0xd155('0x37'))){_0x100709[_0xd155('0x1b')]=qs[_0xd155('0x1b')](_0x274cc0[_0xd155('0x32')][_0xd155('0x1b')]);_0x100709[_0xd155('0x1c')]=qs[_0xd155('0x1c')](_0x274cc0['query'][_0xd155('0x1c')]);}_0x100709[_0xd155('0x38')]=qs[_0xd155('0x39')](_0x274cc0[_0xd155('0x32')][_0xd155('0x39')]);_0x100709['where']=qs[_0xd155('0x3a')](_[_0xd155('0x3b')](_0x274cc0[_0xd155('0x32')],_0x12d8a6[_0xd155('0x3a')]),_0x33c8ff);if(_0x274cc0[_0xd155('0x32')]['filter']){_0x100709[_0xd155('0x3c')]=_[_0xd155('0x3d')](_0x100709[_0xd155('0x3c')],{'$or':_[_0xd155('0x3e')](_0x100709[_0xd155('0x35')],function(_0xe30578){var _0x880d8f={};_0x880d8f[_0xe30578]={'$like':'%'+_0x274cc0[_0xd155('0x32')]['filter']+'%'};return _0x880d8f;})});}_0x100709=_['merge']({},_0x100709,_0x274cc0[_0xd155('0x3f')]);var _0x456337={'where':_0x100709[_0xd155('0x3c')]};return db[_0xd155('0x2e')][_0xd155('0x1d')](_0x456337)[_0xd155('0x23')](function(_0x1051ab){_0x345567['count']=_0x1051ab;if(_0x274cc0[_0xd155('0x32')][_0xd155('0x40')]){_0x100709[_0xd155('0x41')]=[{'all':!![]}];}return db[_0xd155('0x2e')]['findAll'](_0x100709);})['then'](function(_0x2460c7){_0x345567['rows']=_0x2460c7;return _0x345567;})[_0xd155('0x23')](respondWithFilteredResult(_0xc45dc4,_0x100709))[_0xd155('0x42')](handleError(_0xc45dc4,null));})['catch'](handleError(_0xc45dc4,null));};exports[_0xd155('0x43')]=function(_0x1c08f9,_0x828da3){var _0x44ac05={'raw':![],'where':{'id':_0x1c08f9[_0xd155('0x44')]['id']}},_0x287e78={};_0x287e78['model']=_[_0xd155('0x31')](db['CmCompany'][_0xd155('0x45')]);_0x287e78[_0xd155('0x32')]=_[_0xd155('0x31')](_0x1c08f9['query']);_0x287e78[_0xd155('0x3a')]=_[_0xd155('0x33')](_0x287e78[_0xd155('0x30')],_0x287e78[_0xd155('0x32')]);_0x44ac05[_0xd155('0x35')]=_[_0xd155('0x33')](_0x287e78[_0xd155('0x30')],qs[_0xd155('0x34')](_0x1c08f9[_0xd155('0x32')][_0xd155('0x34')]));_0x44ac05[_0xd155('0x35')]=_0x44ac05['attributes'][_0xd155('0x46')]?_0x44ac05['attributes']:_0x287e78[_0xd155('0x30')];if(_0x1c08f9['query'][_0xd155('0x40')]){_0x44ac05['include']=[{'all':!![]}];}_0x44ac05=_['merge']({},_0x44ac05,_0x1c08f9[_0xd155('0x3f')]);return db[_0xd155('0x2e')][_0xd155('0x47')](_0x44ac05)[_0xd155('0x23')](handleEntityNotFound(_0x828da3,null))[_0xd155('0x23')](respondWithResult(_0x828da3,null))[_0xd155('0x42')](handleError(_0x828da3,null));};exports['create']=function(_0x634956,_0x20b32e){return db[_0xd155('0x2e')]['create'](_0x634956[_0xd155('0x48')],{})['then'](function(_0x7c9d07){var _0x6d44eb=_0x634956[_0xd155('0x49')]['get']({'plain':!![]});if(!_0x6d44eb)throw new Error(_0xd155('0x4a'));if(_0x6d44eb[_0xd155('0x4b')]===_0xd155('0x49')){var _0x4e7983=_0x7c9d07[_0xd155('0x25')]({'plain':!![]});var _0x1f762b='Companies';return db[_0xd155('0x4c')][_0xd155('0x47')]({'where':{'name':_0x1f762b,'userProfileId':_0x6d44eb['userProfileId']},'raw':!![]})[_0xd155('0x23')](function(_0xcf7801){if(_0xcf7801&&_0xcf7801['autoAssociation']===0x0){return db[_0xd155('0x27')][_0xd155('0x4d')]({'name':_0x4e7983[_0xd155('0x2b')],'resourceId':_0x4e7983['id'],'type':_0xcf7801[_0xd155('0x2b')],'sectionId':_0xcf7801['id']},{})[_0xd155('0x23')](function(){return _0x7c9d07;});}else{return _0x7c9d07;}})[_0xd155('0x42')](function(_0x1deb6e){logger[_0xd155('0x29')](_0xd155('0x4e'),_0x1deb6e);throw _0x1deb6e;});}return _0x7c9d07;})[_0xd155('0x23')](respondWithResult(_0x20b32e,0xc9))[_0xd155('0x42')](handleError(_0x20b32e,null));};exports['update']=function(_0x4cee01,_0x25a881){if(_0x4cee01[_0xd155('0x48')]['id']){delete _0x4cee01['body']['id'];}return db[_0xd155('0x2e')][_0xd155('0x47')]({'where':{'id':_0x4cee01[_0xd155('0x44')]['id']}})[_0xd155('0x23')](handleEntityNotFound(_0x25a881,null))[_0xd155('0x23')](saveUpdates(_0x4cee01[_0xd155('0x48')],null))[_0xd155('0x23')](respondWithResult(_0x25a881,null))[_0xd155('0x42')](handleError(_0x25a881,null));};exports['destroy']=function(_0x572db8,_0x23247e){return db[_0xd155('0x2e')][_0xd155('0x47')]({'where':{'id':_0x572db8[_0xd155('0x44')]['id']}})[_0xd155('0x23')](handleEntityNotFound(_0x23247e,null))['then'](removeEntity(_0x23247e,null))[_0xd155('0x42')](handleError(_0x23247e,null));};exports[_0xd155('0x2f')]=function(_0x43bbea,_0xdefcdf){return db[_0xd155('0x2e')][_0xd155('0x2f')]()[_0xd155('0x23')](respondWithResult(_0xdefcdf,null))[_0xd155('0x42')](handleError(_0xdefcdf,null));};exports['addContacts']=function(_0x5da505,_0x187b05,_0x706a4b){return db[_0xd155('0x4f')][_0xd155('0x47')]({'where':{'id':_0x5da505[_0xd155('0x44')]['id']}})[_0xd155('0x23')](handleEntityNotFound(_0x187b05,null))['then'](function(_0x27c133){if(_0x27c133){return _0x27c133['addContacts'](_0x5da505['body']['ids'],_[_0xd155('0x50')](_0x5da505[_0xd155('0x48')],['ids','id'])||{});}})[_0xd155('0x23')](respondWithResult(_0x187b05,null))[_0xd155('0x42')](handleError(_0x187b05,null));};exports['getContacts']=function(_0xcba774,_0x4fa19a,_0x400bb0){var _0x4988e9={};var _0x37a72a={};var _0x25e7cc;var _0x448ae7;return db[_0xd155('0x2e')]['findOne']({'where':{'id':_0xcba774[_0xd155('0x44')]['id']}})[_0xd155('0x23')](handleEntityNotFound(_0x4fa19a,null))[_0xd155('0x23')](function(_0x1a53e4){if(_0x1a53e4){_0x25e7cc=_0x1a53e4;_0x37a72a[_0xd155('0x30')]=_[_0xd155('0x31')](db[_0xd155('0x4f')]['rawAttributes']);_0x37a72a[_0xd155('0x32')]=_['keys'](_0xcba774[_0xd155('0x32')]);_0x37a72a[_0xd155('0x3a')]=_['intersection'](_0x37a72a['model'],_0x37a72a['query']);_0x4988e9[_0xd155('0x35')]=_['intersection'](_0x37a72a['model'],qs[_0xd155('0x34')](_0xcba774[_0xd155('0x32')][_0xd155('0x34')]));_0x4988e9[_0xd155('0x35')]=_0x4988e9[_0xd155('0x35')][_0xd155('0x46')]?_0x4988e9[_0xd155('0x35')]:_0x37a72a[_0xd155('0x30')];_0x4988e9['order']=qs['sort'](_0xcba774['query'][_0xd155('0x39')]);_0x4988e9[_0xd155('0x3c')]=qs[_0xd155('0x3a')](_[_0xd155('0x3b')](_0xcba774[_0xd155('0x32')],_0x37a72a['filters']));if(_0xcba774[_0xd155('0x32')]['filter']){_0x4988e9[_0xd155('0x3c')]=_[_0xd155('0x3d')](_0x4988e9[_0xd155('0x3c')],{'$or':_[_0xd155('0x3e')](_0x4988e9[_0xd155('0x35')],function(_0x5f0dd1){var _0x1eaeb0={};_0x1eaeb0[_0x5f0dd1]={'$like':'%'+_0xcba774[_0xd155('0x32')][_0xd155('0x51')]+'%'};return _0x1eaeb0;})});}_0x4988e9=_[_0xd155('0x3d')]({},_0x4988e9,_0xcba774[_0xd155('0x3f')]);return _0x25e7cc['getContacts'](_0x4988e9);}})['then'](function(_0x1d571a){if(_0x1d571a){_0x448ae7=_0x1d571a[_0xd155('0x46')];if(!_0xcba774[_0xd155('0x32')][_0xd155('0x36')]('nolimit')){_0x4988e9[_0xd155('0x1b')]=qs[_0xd155('0x1b')](_0xcba774[_0xd155('0x32')]['limit']);_0x4988e9[_0xd155('0x1c')]=qs[_0xd155('0x1c')](_0xcba774[_0xd155('0x32')][_0xd155('0x1c')]);}return _0x25e7cc['getContacts'](_0x4988e9);}})[_0xd155('0x23')](function(_0x10e1c8){if(_0x10e1c8){return _0x10e1c8?{'count':_0x448ae7,'rows':_0x10e1c8}:null;}})[_0xd155('0x23')](respondWithResult(_0x4fa19a,null))[_0xd155('0x42')](handleError(_0x4fa19a,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 278cb99..2e4f6b1 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 _0x0f97=['bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','api','moment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0f97,0x164));var _0x70f9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0f97[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var logger=require('../../config/logger')(_0x70f9('0x2'));var moment=require(_0x70f9('0x3'));var BPromise=require(_0x70f9('0x4'));var rp=require(_0x70f9('0x5'));var fs=require('fs');var path=require(_0x70f9('0x6'));var rimraf=require('rimraf');var config=require(_0x70f9('0x7'));var attributes=require(_0x70f9('0x8'));module['exports']=function(_0x3c98d1,_0x144366){return _0x3c98d1[_0x70f9('0x9')](_0x70f9('0xa'),attributes,{'tableName':_0x70f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a11=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','../../config/logger','api'];(function(_0x1ae6f8,_0x1526ad){var _0x49f3db=function(_0x4bc9e1){while(--_0x4bc9e1){_0x1ae6f8['push'](_0x1ae6f8['shift']());}};_0x49f3db(++_0x1526ad);}(_0x1a11,0x99));var _0x11a1=function(_0xae0da9,_0x1cbd8f){_0xae0da9=_0xae0da9-0x0;var _0x1b0b3c=_0x1a11[_0xae0da9];return _0x1b0b3c;};'use strict';var _=require(_0x11a1('0x0'));var util=require('util');var logger=require(_0x11a1('0x1'))(_0x11a1('0x2'));var moment=require('moment');var BPromise=require(_0x11a1('0x3'));var rp=require(_0x11a1('0x4'));var fs=require('fs');var path=require(_0x11a1('0x5'));var rimraf=require(_0x11a1('0x6'));var config=require(_0x11a1('0x7'));var attributes=require(_0x11a1('0x8'));module['exports']=function(_0xa9781d,_0x5655a6){return _0xa9781d[_0x11a1('0x9')](_0x11a1('0xa'),attributes,{'tableName':_0x11a1('0xb'),'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 bd24b73..a96abe5 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 _0xa3a5=['error','code','CmCompany,\x20%s,\x20%s','message','result','catch','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xa3a5,0x126));var _0x5a3a=function(_0x53dcbd,_0x1250b4){_0x53dcbd=_0x53dcbd-0x0;var _0x484902=_0xa3a5[_0x53dcbd];return _0x484902;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a3a('0x0'));var fs=require('fs');var Redis=require(_0x5a3a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a3a('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x5a3a('0x3'));var jayson=require(_0x5a3a('0x4'));var client=jayson[_0x5a3a('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f1117,_0x7804ba,_0x38122e){return new BPromise(function(_0x59dd9a,_0xbe2975){return client['request'](_0x1f1117,_0x38122e)[_0x5a3a('0x6')](function(_0x4673a5){logger[_0x5a3a('0x7')]('CmCompany,\x20%s,\x20%s',_0x7804ba,_0x5a3a('0x8'));logger[_0x5a3a('0x9')](_0x5a3a('0xa'),_0x7804ba,'request\x20sent',JSON[_0x5a3a('0xb')](_0x4673a5));if(_0x4673a5[_0x5a3a('0xc')]){if(_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xd')]===0x1f4){logger[_0x5a3a('0xc')](_0x5a3a('0xe'),_0x7804ba,_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xf')]);return _0xbe2975(_0x4673a5[_0x5a3a('0xc')]['message']);}logger['error'](_0x5a3a('0xe'),_0x7804ba,_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xf')]);return _0x59dd9a(_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xf')]);}else{logger[_0x5a3a('0x7')](_0x5a3a('0xe'),_0x7804ba,'request\x20sent');_0x59dd9a(_0x4673a5[_0x5a3a('0x10')][_0x5a3a('0xf')]);}})[_0x5a3a('0x11')](function(_0xd56772){logger[_0x5a3a('0xc')](_0x5a3a('0xe'),_0x7804ba,_0xd56772);_0xbe2975(_0xd56772);});});}
\ No newline at end of file
+var _0x9e3c=['client','http','request','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x21fdfd,_0x56409b){var _0x47c238=function(_0x9812ff){while(--_0x9812ff){_0x21fdfd['push'](_0x21fdfd['shift']());}};_0x47c238(++_0x56409b);}(_0x9e3c,0x14d));var _0xc9e3=function(_0x59d48a,_0x3a79f6){_0x59d48a=_0x59d48a-0x0;var _0x3572ab=_0x9e3c[_0x59d48a];return _0x3572ab;};'use strict';var _=require(_0xc9e3('0x0'));var util=require('util');var moment=require(_0xc9e3('0x1'));var BPromise=require(_0xc9e3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9e3('0x3'))['db'];var utils=require(_0xc9e3('0x4'));var logger=require(_0xc9e3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc9e3('0x6'));var client=jayson[_0xc9e3('0x7')][_0xc9e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xddba98,_0x18a37a,_0x480585){return new BPromise(function(_0x36ab8a,_0x241ef1){return client[_0xc9e3('0x9')](_0xddba98,_0x480585)['then'](function(_0x4597f9){logger['info'](_0xc9e3('0xa'),_0x18a37a,'request\x20sent');logger[_0xc9e3('0xb')](_0xc9e3('0xc'),_0x18a37a,_0xc9e3('0xd'),JSON[_0xc9e3('0xe')](_0x4597f9));if(_0x4597f9[_0xc9e3('0xf')]){if(_0x4597f9['error'][_0xc9e3('0x10')]===0x1f4){logger[_0xc9e3('0xf')](_0xc9e3('0xa'),_0x18a37a,_0x4597f9[_0xc9e3('0xf')][_0xc9e3('0x11')]);return _0x241ef1(_0x4597f9[_0xc9e3('0xf')][_0xc9e3('0x11')]);}logger['error'](_0xc9e3('0xa'),_0x18a37a,_0x4597f9[_0xc9e3('0xf')][_0xc9e3('0x11')]);return _0x36ab8a(_0x4597f9['error'][_0xc9e3('0x11')]);}else{logger[_0xc9e3('0x12')]('CmCompany,\x20%s,\x20%s',_0x18a37a,_0xc9e3('0xd'));_0x36ab8a(_0x4597f9[_0xc9e3('0x13')][_0xc9e3('0x11')]);}})['catch'](function(_0x36e0ce){logger[_0xc9e3('0xf')](_0xc9e3('0xa'),_0x18a37a,_0x36e0ce);_0x241ef1(_0x36e0ce);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 4bf9f8f..e8647bf 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 _0x93c2=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','describe','/:id','show','/:id/contacts','post','create','put','update','delete','destroy'];(function(_0x259556,_0x488aca){var _0x5009de=function(_0x280287){while(--_0x280287){_0x259556['push'](_0x259556['shift']());}};_0x5009de(++_0x488aca);}(_0x93c2,0x15a));var _0x293c=function(_0x1ba2b7,_0x10a4d3){_0x1ba2b7=_0x1ba2b7-0x0;var _0x13d403=_0x93c2[_0x1ba2b7];return _0x13d403;};'use strict';var multer=require('multer');var util=require(_0x293c('0x0'));var path=require(_0x293c('0x1'));var timeout=require(_0x293c('0x2'));var express=require(_0x293c('0x3'));var router=express[_0x293c('0x4')]();var fs_extra=require(_0x293c('0x5'));var auth=require(_0x293c('0x6'));var interaction=require(_0x293c('0x7'));var config=require(_0x293c('0x8'));var controller=require(_0x293c('0x9'));router[_0x293c('0xa')]('/',auth[_0x293c('0xb')](),controller['index']);router[_0x293c('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x293c('0xc')]);router[_0x293c('0xa')](_0x293c('0xd'),auth[_0x293c('0xb')](),controller[_0x293c('0xe')]);router['get'](_0x293c('0xf'),auth[_0x293c('0xb')](),controller['getContacts']);router[_0x293c('0x10')]('/',auth['isAuthenticated'](),controller[_0x293c('0x11')]);router[_0x293c('0x10')](_0x293c('0xf'),auth[_0x293c('0xb')](),controller['addContacts']);router[_0x293c('0x12')](_0x293c('0xd'),auth[_0x293c('0xb')](),controller[_0x293c('0x13')]);router[_0x293c('0x14')]('/:id',auth[_0x293c('0xb')](),controller[_0x293c('0x15')]);module[_0x293c('0x16')]=router;
\ No newline at end of file
+var _0xf971=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','create','post'];(function(_0x54df94,_0x53fcca){var _0xfafbfd=function(_0x52a0eb){while(--_0x52a0eb){_0x54df94['push'](_0x54df94['shift']());}};_0xfafbfd(++_0x53fcca);}(_0xf971,0x7c));var _0x1f97=function(_0x2b7a87,_0x552c05){_0x2b7a87=_0x2b7a87-0x0;var _0x29446f=_0xf971[_0x2b7a87];return _0x29446f;};'use strict';var multer=require(_0x1f97('0x0'));var util=require(_0x1f97('0x1'));var path=require(_0x1f97('0x2'));var timeout=require(_0x1f97('0x3'));var express=require(_0x1f97('0x4'));var router=express[_0x1f97('0x5')]();var fs_extra=require(_0x1f97('0x6'));var auth=require(_0x1f97('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1f97('0x8'));var controller=require(_0x1f97('0x9'));router[_0x1f97('0xa')]('/',auth[_0x1f97('0xb')](),controller['index']);router[_0x1f97('0xa')](_0x1f97('0xc'),auth[_0x1f97('0xb')](),controller[_0x1f97('0xd')]);router[_0x1f97('0xa')](_0x1f97('0xe'),auth[_0x1f97('0xb')](),controller[_0x1f97('0xf')]);router[_0x1f97('0xa')](_0x1f97('0x10'),auth[_0x1f97('0xb')](),controller[_0x1f97('0x11')]);router['post']('/',auth[_0x1f97('0xb')](),controller[_0x1f97('0x12')]);router[_0x1f97('0x13')](_0x1f97('0x10'),auth[_0x1f97('0xb')](),controller['addContacts']);router[_0x1f97('0x14')](_0x1f97('0xe'),auth['isAuthenticated'](),controller[_0x1f97('0x15')]);router['delete'](_0x1f97('0xe'),auth[_0x1f97('0xb')](),controller[_0x1f97('0x16')]);module[_0x1f97('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 276f695..3bc6561 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 _0x2032=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x2032,0xd9));var _0x2203=function(_0x4e3c92,_0x353fa4){_0x4e3c92=_0x4e3c92-0x0;var _0x455d28=_0x2032[_0x4e3c92];return _0x455d28;};'use strict';var _=require('lodash');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'firstName':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2203('0x2')]},'postalCode':{'type':Sequelize[_0x2203('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2203('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize[_0x2203('0x3')]},'phone':{'type':Sequelize[_0x2203('0x2')]},'mobile':{'type':Sequelize[_0x2203('0x2')]},'fax':{'type':Sequelize[_0x2203('0x2')]},'email':{'type':Sequelize[_0x2203('0x2')]},'url':{'type':Sequelize[_0x2203('0x2')]},'facebook':{'type':Sequelize[_0x2203('0x2')]},'fb_data':{'type':Sequelize[_0x2203('0x2')]},'twitter':{'type':Sequelize[_0x2203('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2203('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x2203('0x2')]},'telegram':{'type':Sequelize[_0x2203('0x2')]},'UserId':{'type':Sequelize[_0x2203('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2203('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2203('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2203('0x4')]}};
\ No newline at end of file
+var _0x2032=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2032,0xd9));var _0x2203=function(_0xeaa812,_0x5417de){_0xeaa812=_0xeaa812-0x0;var _0x5bc621=_0x2032[_0xeaa812];return _0x5bc621;};'use strict';var _=require('lodash');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'firstName':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2203('0x2')]},'postalCode':{'type':Sequelize[_0x2203('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2203('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize[_0x2203('0x3')]},'phone':{'type':Sequelize[_0x2203('0x2')]},'mobile':{'type':Sequelize[_0x2203('0x2')]},'fax':{'type':Sequelize[_0x2203('0x2')]},'email':{'type':Sequelize[_0x2203('0x2')]},'url':{'type':Sequelize[_0x2203('0x2')]},'facebook':{'type':Sequelize[_0x2203('0x2')]},'fb_data':{'type':Sequelize[_0x2203('0x2')]},'twitter':{'type':Sequelize[_0x2203('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2203('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x2203('0x2')]},'telegram':{'type':Sequelize[_0x2203('0x2')]},'UserId':{'type':Sequelize[_0x2203('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2203('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2203('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2203('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 6de0674..03a2556 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 _0x5855=['pid','exit','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','parse','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','starttime','endtime','duration','note','userDisposition','userThirdDisposition','UserId','fullname','createdAt','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','mail','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','slice','moment','bluebird','util','path','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','count','limit','then','end','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','findOne','cf_','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','field','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','Tag','forEach','union','uc.UserId\x20=\x20?','value','fieldType','datetime','castTo','DATE','buildExpression','start','filter','isNil','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','group','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','conditions','User','getLists','c.ListId\x20IS\x20NULL','map','sequelize','keyBy','merge','c.id','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','toString','Tags','rows','find','params','catch','columnName','findAll','displayName','alias','custom','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','ReportAgentPreview','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','utcOffset','timezones','each','duplicates','$or','findOrCreate','color','$and','CmCustomField','omit','format','pickBy','cf_%d','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','rawAttributes','pick','options','setTags','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','upload','meta','import','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0x5855,0x151));var _0x5585=function(_0x56e711,_0x5917c8){_0x56e711=_0x56e711-0x0;var _0x1cf38f=_0x5855[_0x56e711];return _0x1cf38f;};'use strict';var moment=require(_0x5585('0x0'));var BPromise=require(_0x5585('0x1'));var util=require(_0x5585('0x2'));var path=require(_0x5585('0x3'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require(_0x5585('0x4'));var Redis=require(_0x5585('0x5'));var qs=require(_0x5585('0x6'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x5585('0x7'))(_0x5585('0x8'));var config=require('../../config/environment');var shared=require(_0x5585('0x9'));var db=require(_0x5585('0xa'))['db'];config[_0x5585('0xb')]=_['defaults'](config[_0x5585('0xb')],{'host':_0x5585('0xc'),'port':0x18eb});var socket=require(_0x5585('0xd'))(new Redis(config[_0x5585('0xb')]));require(_0x5585('0xe'))[_0x5585('0xf')](socket);function respondWithResult(_0x559d97,_0x3f130e){_0x3f130e=_0x3f130e||0xc8;return function(_0x3de2d9){if(_0x3de2d9){return _0x559d97[_0x5585('0x10')](_0x3f130e)[_0x5585('0x11')](_0x3de2d9);}};}function respondWithFilteredResult(_0x21e001,_0x263250){return function(_0x11c462){if(_0x11c462){var _0x326d64=typeof _0x263250[_0x5585('0x12')]===_0x5585('0x13')&&typeof _0x263250['limit']==='undefined';var _0x4c15b1=_0x11c462[_0x5585('0x14')];var _0x45517c=_0x326d64?0x0:_0x263250['offset'];var _0x2b60a9=_0x326d64?_0x11c462[_0x5585('0x14')]:_0x263250[_0x5585('0x12')]+_0x263250[_0x5585('0x15')];var _0x105a7d;if(_0x2b60a9>=_0x4c15b1){_0x2b60a9=_0x4c15b1;_0x105a7d=0xc8;}else{_0x105a7d=0xce;}_0x21e001[_0x5585('0x10')](_0x105a7d);return _0x21e001['set']('Content-Range',_0x45517c+'-'+_0x2b60a9+'/'+_0x4c15b1)[_0x5585('0x11')](_0x11c462);}return null;};}function saveUpdates(_0x4c778a){return function(_0x4c84a4){if(_0x4c84a4){return _0x4c84a4['update'](_0x4c778a)[_0x5585('0x16')](function(_0x310efe){return _0x310efe;});}return null;};}function removeEntity(_0x88fb85){return function(_0x49744c){if(_0x49744c){return _0x49744c['destroy']()[_0x5585('0x16')](function(){_0x88fb85[_0x5585('0x10')](0xcc)[_0x5585('0x17')]();});}};}function handleEntityNotFound(_0x20e501){return function(_0xff21bc){if(!_0xff21bc){_0x20e501['sendStatus'](0x194);}return _0xff21bc;};}function handleError(_0x2fcf90,_0x5f614f){_0x5f614f=_0x5f614f||0x1f4;return function(_0x34e9db){logger[_0x5585('0x18')](_0x34e9db[_0x5585('0x19')]);if(_0x34e9db['name']){delete _0x34e9db[_0x5585('0x1a')];}_0x2fcf90[_0x5585('0x10')](_0x5f614f)[_0x5585('0x1b')](_0x34e9db);};}exports[_0x5585('0x1c')]=function(_0x34b5e7,_0x3e9a70){var _0x5f1685={},_0x1bc378={},_0xec6964={'count':0x0,'rows':[]};return db[_0x5585('0x1d')][_0x5585('0x1e')]()[_0x5585('0x16')](function(_0x37aaf6){var _0x3d43f6=[];for(var _0x2ea739=0x0;_0x2ea739
','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','outlook365','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','path','util','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','name','substring','indexOf','split','slice','join','Anonymous','length'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9319,0xee));var _0x9931=function(_0x58e86c,_0x54691f){_0x58e86c=_0x58e86c-0x0;var _0x6720d7=_0x9319[_0x58e86c];return _0x6720d7;};'use strict';var _=require(_0x9931('0x0'));var moment=require(_0x9931('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x9931('0x2'));var util=require(_0x9931('0x3'));var tnef=require(_0x9931('0x4'));var logger=require('../../../config/logger')(_0x9931('0x5'));var config=require(_0x9931('0x6'));function getAddress(_0xd26ac){var _0x365376=_[_0x9931('0x7')](_0xd26ac[_0x9931('0x8')]);return _0x365376&&_0x365376[_0x9931('0x9')]?_0x365376[_0x9931('0x9')]:_0x9931('0xa')+random[_0x9931('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x438221){var _0x3a7331=_['head'](_0x438221[_0x9931('0x8')]);if(_0x3a7331&&_0x3a7331[_0x9931('0xc')]){if(_0x3a7331[_0x9931('0xc')]==_0x3a7331[_0x9931('0x9')]){return _0x3a7331[_0x9931('0xc')][_0x9931('0xd')](0x0,_0x3a7331[_0x9931('0xc')][_0x9931('0xe')]('@'));}var _0x17538e=_0x3a7331[_0x9931('0xc')][_0x9931('0xf')](/\s+/);return _0x17538e['length']>0x1?_0x17538e[_0x9931('0x10')](0x0,-0x1)[_0x9931('0x11')]('\x20'):_0x3a7331[_0x9931('0xc')];}return _0x9931('0x12');}function getLastName(_0x34fe86){var _0x5b78ac=_['head'](_0x34fe86['value']);if(_0x5b78ac&&_0x5b78ac[_0x9931('0xc')]){var _0x47314d=_0x5b78ac[_0x9931('0xc')][_0x9931('0xf')](/\s+/);return _0x47314d[_0x9931('0x13')]>0x1?_0x47314d[_0x9931('0x14')]():'';}return'';}function getMails(_0x53bb4c,_0x210802){var _0x78d5b3='';for(var _0x522a25=0x0;_0x522a25<_0x210802['value'][_0x9931('0x13')];_0x522a25+=0x1){if(_0x210802[_0x9931('0x8')][_0x522a25][_0x9931('0x9')]!==_0x53bb4c){if(!_['isEmpty'](_0x78d5b3)){_0x78d5b3+=',';}_0x78d5b3+=_0x210802[_0x9931('0x8')][_0x522a25]['name']||_0x210802['value'][_0x522a25][_0x9931('0x9')]||'';_0x78d5b3+='\x20<';_0x78d5b3+=_0x210802[_0x9931('0x8')][_0x522a25][_0x9931('0x9')]?_0x210802['value'][_0x522a25][_0x9931('0x9')]:_0x9931('0xa')+random['generate'](0x6)+_0x9931('0x15');_0x78d5b3+='>';}}return _0x78d5b3;}function parseEmail(_0x1b6dd7,_0x529094,_0x4fb464){if(_0x529094[_0x9931('0x16')]){var _0x215cfb=/