From: support
Date: Thu, 4 May 2023 14:00:29 +0000 (+0000)
Subject: Built motion from commit cb845558.|2.6.34
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22%7B%7Blicense.openchannel?a=commitdiff_plain;h=89c416240d5d7894f59ffb8a088ab852f4944e14;p=motion2.git
Built motion from commit cb845558.|2.6.34
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index eff039b..5d791a1 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.33",
+ "version": "2.6.34",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-05-04T13:23:07.638Z",
+ "time": "2023-05-04T13:51:21.691Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 3702cb0..94a4a6e 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.33",
+ "version": "2.6.34",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-05-04T13:23:07.638Z",
+ "time": "2023-05-04T13:51:21.691Z",
"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 8f3b435..41e6a5f 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 _0xaf50=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot'];(function(_0x208e19,_0x2696aa){var _0x42f5eb=function(_0x3e1644){while(--_0x3e1644){_0x208e19['push'](_0x208e19['shift']());}};_0x42f5eb(++_0x2696aa);}(_0xaf50,0x186));var _0x0af5=function(_0x24373c,_0x88fa8e){_0x24373c=_0x24373c-0x0;var _0x15ef73=_0xaf50[_0x24373c];return _0x15ef73;};'use strict';var Sequelize=require('sequelize');module[_0x0af5('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3de0ad){return this[_0x0af5('0x1')](_0x0af5('0x2'));}},'action':{'type':Sequelize[_0x0af5('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0af5('0x4'),_0x0af5('0x5'),_0x0af5('0x6'),_0x0af5('0x7'),_0x0af5('0x8'),'browser',_0x0af5('0x9'),'script']],'msg':_0x0af5('0xa')}},'comment':_0x0af5('0xa')},'data1':{'type':Sequelize[_0x0af5('0x3')](0x1000),'comment':_0x0af5('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x0af5('0xc')},'data3':{'type':Sequelize[_0x0af5('0x3')](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[_0x0af5('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x0af5('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x0af5('0x3')],'comments':_0x0af5('0xd')},'data7':{'type':Sequelize[_0x0af5('0xe')],'comments':_0x0af5('0xf')}};
\ No newline at end of file
+var _0x8e7b=['STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','VIRTUAL','action','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x2e29ea,_0x32c951){var _0x1cb268=function(_0x4e707f){while(--_0x4e707f){_0x2e29ea['push'](_0x2e29ea['shift']());}};_0x1cb268(++_0x32c951);}(_0x8e7b,0x184));var _0xb8e7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8e7b[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xb8e7('0x0'));module['exports']={'name':{'type':Sequelize[_0xb8e7('0x1')],'get':function(_0x11ffde){return this['getDataValue'](_0xb8e7('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xb8e7('0x3'),_0xb8e7('0x4'),_0xb8e7('0x5'),_0xb8e7('0x6'),_0xb8e7('0x7'),'browser',_0xb8e7('0x8'),_0xb8e7('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb8e7('0xa')},'data1':{'type':Sequelize[_0xb8e7('0xb')](0x1000),'comment':_0xb8e7('0xc')},'data2':{'type':Sequelize[_0xb8e7('0xb')](0x1000),'comment':_0xb8e7('0xd')},'data3':{'type':Sequelize[_0xb8e7('0xb')](0x1000),'comment':_0xb8e7('0xe')},'data4':{'type':Sequelize[_0xb8e7('0xb')](0x1000),'comments':_0xb8e7('0xf')},'data5':{'type':Sequelize[_0xb8e7('0xb')](0x1000),'comments':_0xb8e7('0x10')},'data6':{'type':Sequelize[_0xb8e7('0xb')],'comments':_0xb8e7('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0xb8e7('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 9a0edba..2b4c167 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 _0xda24=['../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','update','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api'];(function(_0x14db0a,_0xea5e2c){var _0x1eae4d=function(_0x395612){while(--_0x395612){_0x14db0a['push'](_0x14db0a['shift']());}};_0x1eae4d(++_0xea5e2c);}(_0xda24,0x1ac));var _0x4da2=function(_0x5e5ad9,_0x18845f){_0x5e5ad9=_0x5e5ad9-0x0;var _0x396036=_0xda24[_0x5e5ad9];return _0x396036;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4da2('0x0'));var zipdir=require(_0x4da2('0x1'));var jsonpatch=require(_0x4da2('0x2'));var rp=require(_0x4da2('0x3'));var moment=require(_0x4da2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4da2('0x5'));var util=require(_0x4da2('0x6'));var path=require('path');var sox=require(_0x4da2('0x7'));var csv=require(_0x4da2('0x8'));var ejs=require(_0x4da2('0x9'));var fs=require('fs');var fs_extra=require(_0x4da2('0xa'));var _=require(_0x4da2('0xb'));var squel=require(_0x4da2('0xc'));var crypto=require(_0x4da2('0xd'));var jsforce=require(_0x4da2('0xe'));var deskjs=require(_0x4da2('0xf'));var toCsv=require(_0x4da2('0x8'));var querystring=require(_0x4da2('0x10'));var Papa=require(_0x4da2('0x11'));var Redis=require(_0x4da2('0x12'));var authService=require(_0x4da2('0x13'));var qs=require(_0x4da2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4da2('0x15'));var utils=require(_0x4da2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2547e7,_0xe653fa){_0xe653fa=_0xe653fa||0xcc;return function(_0x5955a5){if(_0x5955a5){return _0x2547e7[_0x4da2('0x17')](_0xe653fa);}return _0x2547e7[_0x4da2('0x18')](_0xe653fa)[_0x4da2('0x19')]();};}function respondWithResult(_0x50c848,_0x487144){_0x487144=_0x487144||0xc8;return function(_0x4168c5){if(_0x4168c5){return _0x50c848[_0x4da2('0x18')](_0x487144)[_0x4da2('0x1a')](_0x4168c5);}};}function respondWithFilteredResult(_0x453ac0,_0x4aedf1){return function(_0x878eb0){if(_0x878eb0){var _0x3ec2e7=typeof _0x4aedf1[_0x4da2('0x1b')]===_0x4da2('0x1c')&&typeof _0x4aedf1[_0x4da2('0x1d')]===_0x4da2('0x1c');var _0x6024cc=_0x878eb0[_0x4da2('0x1e')];var _0x53c7ae=_0x3ec2e7?0x0:_0x4aedf1[_0x4da2('0x1b')];var _0x3bd46f=_0x3ec2e7?_0x878eb0[_0x4da2('0x1e')]:_0x4aedf1[_0x4da2('0x1b')]+_0x4aedf1['limit'];var _0x2e21e5;if(_0x3bd46f>=_0x6024cc){_0x3bd46f=_0x6024cc;_0x2e21e5=0xc8;}else{_0x2e21e5=0xce;}_0x453ac0[_0x4da2('0x18')](_0x2e21e5);return _0x453ac0[_0x4da2('0x1f')](_0x4da2('0x20'),_0x53c7ae+'-'+_0x3bd46f+'/'+_0x6024cc)['json'](_0x878eb0);}return null;};}function patchUpdates(_0x1e329f){return function(_0x649f7a){try{jsonpatch['apply'](_0x649f7a,_0x1e329f,!![]);}catch(_0x51db90){return BPromise['reject'](_0x51db90);}return _0x649f7a[_0x4da2('0x21')]();};}function saveUpdates(_0x1d3dfa,_0x52ef96){return function(_0x47ec2d){if(_0x47ec2d){return _0x47ec2d['update'](_0x1d3dfa)[_0x4da2('0x22')](function(_0x3563ae){return _0x3563ae;});}return null;};}function removeEntity(_0x40f5ad,_0x18c754){return function(_0x1888de){if(_0x1888de){return _0x1888de[_0x4da2('0x23')]()[_0x4da2('0x22')](function(){_0x40f5ad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2672fb,_0x59442e){return function(_0x279c8b){if(!_0x279c8b){_0x2672fb[_0x4da2('0x17')](0x194);}return _0x279c8b;};}function handleError(_0x157335,_0x1dff39){_0x1dff39=_0x1dff39||0x1f4;return function(_0x330670){logger[_0x4da2('0x24')](_0x330670[_0x4da2('0x25')]);if(_0x330670[_0x4da2('0x26')]){delete _0x330670[_0x4da2('0x26')];}_0x157335['status'](_0x1dff39)['send'](_0x330670);};}exports[_0x4da2('0x27')]=function(_0x53edf2,_0x1345b6){if(_0x53edf2[_0x4da2('0x28')]['id']){delete _0x53edf2[_0x4da2('0x28')]['id'];}return db[_0x4da2('0x29')][_0x4da2('0x2a')]({'where':{'id':_0x53edf2[_0x4da2('0x2b')]['id']}})[_0x4da2('0x22')](handleEntityNotFound(_0x1345b6,null))[_0x4da2('0x22')](saveUpdates(_0x53edf2[_0x4da2('0x28')],null))[_0x4da2('0x22')](respondWithResult(_0x1345b6,null))[_0x4da2('0x2c')](handleError(_0x1345b6,null));};exports[_0x4da2('0x23')]=function(_0x2eb25e,_0x24de9b){return db[_0x4da2('0x29')]['find']({'where':{'id':_0x2eb25e[_0x4da2('0x2b')]['id']}})[_0x4da2('0x22')](handleEntityNotFound(_0x24de9b,null))[_0x4da2('0x22')](removeEntity(_0x24de9b,null))[_0x4da2('0x2c')](handleError(_0x24de9b,null));};
\ No newline at end of file
+var _0xf3f1=['bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','update','body','Action','find','catch','params','eml-format','zip-dir','request-promise','moment'];(function(_0x448422,_0x362248){var _0xcc0afd=function(_0x576b07){while(--_0x576b07){_0x448422['push'](_0x448422['shift']());}};_0xcc0afd(++_0x362248);}(_0xf3f1,0x1e6));var _0x1f3f=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xf3f1[_0x599e60];return _0x468e19;};'use strict';var emlformat=require(_0x1f3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f3f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f3f('0x2'));var moment=require(_0x1f3f('0x3'));var BPromise=require(_0x1f3f('0x4'));var Mustache=require(_0x1f3f('0x5'));var util=require('util');var path=require(_0x1f3f('0x6'));var sox=require(_0x1f3f('0x7'));var csv=require(_0x1f3f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f3f('0x9'));var _=require(_0x1f3f('0xa'));var squel=require(_0x1f3f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1f3f('0xc'));var toCsv=require(_0x1f3f('0x8'));var querystring=require(_0x1f3f('0xd'));var Papa=require('papaparse');var Redis=require(_0x1f3f('0xe'));var authService=require(_0x1f3f('0xf'));var qs=require(_0x1f3f('0x10'));var as=require(_0x1f3f('0x11'));var hardwareService=require(_0x1f3f('0x12'));var logger=require('../../config/logger')(_0x1f3f('0x13'));var utils=require(_0x1f3f('0x14'));var config=require(_0x1f3f('0x15'));var licenseUtil=require(_0x1f3f('0x16'));var db=require(_0x1f3f('0x17'))['db'];function respondWithStatusCode(_0xfc8a0,_0x2cfd54){_0x2cfd54=_0x2cfd54||0xcc;return function(_0x334cbd){if(_0x334cbd){return _0xfc8a0[_0x1f3f('0x18')](_0x2cfd54);}return _0xfc8a0[_0x1f3f('0x19')](_0x2cfd54)[_0x1f3f('0x1a')]();};}function respondWithResult(_0xf9aff1,_0x47a9f9){_0x47a9f9=_0x47a9f9||0xc8;return function(_0x5e141f){if(_0x5e141f){return _0xf9aff1['status'](_0x47a9f9)['json'](_0x5e141f);}};}function respondWithFilteredResult(_0x595c15,_0x5e4d3a){return function(_0x1faa1f){if(_0x1faa1f){var _0x369917=typeof _0x5e4d3a[_0x1f3f('0x1b')]==='undefined'&&typeof _0x5e4d3a['limit']===_0x1f3f('0x1c');var _0x809eae=_0x1faa1f[_0x1f3f('0x1d')];var _0x409228=_0x369917?0x0:_0x5e4d3a['offset'];var _0x309290=_0x369917?_0x1faa1f[_0x1f3f('0x1d')]:_0x5e4d3a[_0x1f3f('0x1b')]+_0x5e4d3a[_0x1f3f('0x1e')];var _0x189cbc;if(_0x309290>=_0x809eae){_0x309290=_0x809eae;_0x189cbc=0xc8;}else{_0x189cbc=0xce;}_0x595c15['status'](_0x189cbc);return _0x595c15[_0x1f3f('0x1f')](_0x1f3f('0x20'),_0x409228+'-'+_0x309290+'/'+_0x809eae)[_0x1f3f('0x21')](_0x1faa1f);}return null;};}function patchUpdates(_0x5001d2){return function(_0x22bea2){try{jsonpatch[_0x1f3f('0x22')](_0x22bea2,_0x5001d2,!![]);}catch(_0x473af2){return BPromise[_0x1f3f('0x23')](_0x473af2);}return _0x22bea2[_0x1f3f('0x24')]();};}function saveUpdates(_0x3ac3bb,_0x5ad64c){return function(_0x286b00){if(_0x286b00){return _0x286b00['update'](_0x3ac3bb)[_0x1f3f('0x25')](function(_0x1ae0ce){return _0x1ae0ce;});}return null;};}function removeEntity(_0x171061,_0x3734a8){return function(_0x3a1222){if(_0x3a1222){return _0x3a1222[_0x1f3f('0x26')]()[_0x1f3f('0x25')](function(){_0x171061['status'](0xcc)[_0x1f3f('0x1a')]();});}};}function handleEntityNotFound(_0x140ed5,_0x3db37f){return function(_0x280284){if(!_0x280284){_0x140ed5['sendStatus'](0x194);}return _0x280284;};}function handleError(_0x4f39cb,_0x366a6b){_0x366a6b=_0x366a6b||0x1f4;return function(_0x4a9da4){logger[_0x1f3f('0x27')](_0x4a9da4[_0x1f3f('0x28')]);if(_0x4a9da4[_0x1f3f('0x29')]){delete _0x4a9da4[_0x1f3f('0x29')];}_0x4f39cb[_0x1f3f('0x19')](_0x366a6b)[_0x1f3f('0x2a')](_0x4a9da4);};}exports[_0x1f3f('0x2b')]=function(_0x6f571c,_0x31313c){if(_0x6f571c[_0x1f3f('0x2c')]['id']){delete _0x6f571c[_0x1f3f('0x2c')]['id'];}return db[_0x1f3f('0x2d')][_0x1f3f('0x2e')]({'where':{'id':_0x6f571c['params']['id']}})['then'](handleEntityNotFound(_0x31313c,null))[_0x1f3f('0x25')](saveUpdates(_0x6f571c['body'],null))[_0x1f3f('0x25')](respondWithResult(_0x31313c,null))[_0x1f3f('0x2f')](handleError(_0x31313c,null));};exports[_0x1f3f('0x26')]=function(_0x1bf5df,_0x3ce664){return db[_0x1f3f('0x2d')][_0x1f3f('0x2e')]({'where':{'id':_0x1bf5df[_0x1f3f('0x30')]['id']}})[_0x1f3f('0x25')](handleEntityNotFound(_0x3ce664,null))[_0x1f3f('0x25')](removeEntity(_0x3ce664,null))['catch'](handleError(_0x3ce664,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 1f0c5a9..3b613c9 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 _0x9ec1=['../../config/logger','api','request-promise','rimraf','../../config/environment','./action.attributes','Action','lodash'];(function(_0x1875cf,_0x1c26e5){var _0x133ea2=function(_0x502bea){while(--_0x502bea){_0x1875cf['push'](_0x1875cf['shift']());}};_0x133ea2(++_0x1c26e5);}(_0x9ec1,0xe7));var _0x19ec=function(_0x2ae2cd,_0xb42c96){_0x2ae2cd=_0x2ae2cd-0x0;var _0xc52725=_0x9ec1[_0x2ae2cd];return _0xc52725;};'use strict';var _=require(_0x19ec('0x0'));var util=require('util');var logger=require(_0x19ec('0x1'))(_0x19ec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x19ec('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19ec('0x4'));var config=require(_0x19ec('0x5'));var attributes=require(_0x19ec('0x6'));module['exports']=function(_0x1035ba,_0xba0219){return _0x1035ba['define'](_0x19ec('0x7'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x38b5=['request-promise','path','rimraf','../../config/environment','exports','tools_actions','lodash','util','../../config/logger','api','moment'];(function(_0x4869b9,_0x391996){var _0x5a31cc=function(_0x8c7069){while(--_0x8c7069){_0x4869b9['push'](_0x4869b9['shift']());}};_0x5a31cc(++_0x391996);}(_0x38b5,0x124));var _0x538b=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0x38b5[_0x2c6810];return _0x213881;};'use strict';var _=require(_0x538b('0x0'));var util=require(_0x538b('0x1'));var logger=require(_0x538b('0x2'))(_0x538b('0x3'));var moment=require(_0x538b('0x4'));var BPromise=require('bluebird');var rp=require(_0x538b('0x5'));var fs=require('fs');var path=require(_0x538b('0x6'));var rimraf=require(_0x538b('0x7'));var config=require(_0x538b('0x8'));var attributes=require('./action.attributes');module[_0x538b('0x9')]=function(_0x36b43d,_0x2983ad){return _0x36b43d['define']('Action',attributes,{'tableName':_0x538b('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 d8eac64..d65dde9 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2a0c8f,_0x512b1a){var _0x2bdadc=function(_0x605443){while(--_0x605443){_0x2a0c8f['push'](_0x2a0c8f['shift']());}};_0x2bdadc(++_0x512b1a);}(_0x326f,0xd1));var _0xf326=function(_0x22e3a8,_0x2eb8e8){_0x22e3a8=_0x22e3a8-0x0;var _0x56e9b4=_0x326f[_0x22e3a8];return _0x56e9b4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
+var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x181736,_0x2ab7cf){var _0x150207=function(_0x117808){while(--_0x117808){_0x181736['push'](_0x181736['shift']());}};_0x150207(++_0x2ab7cf);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x86527a,_0x2787c6){_0x86527a=_0x86527a-0x0;var _0x2f14b6=_0x7fbe[_0x86527a];return _0x2f14b6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 39a4301..dd20330 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 _0xca25=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','isAuthenticated','destroy','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xca25,0x14f));var _0x5ca2=function(_0x3c6c1b,_0x82a1e4){_0x3c6c1b=_0x3c6c1b-0x0;var _0x15170e=_0xca25[_0x3c6c1b];return _0x15170e;};'use strict';var multer=require(_0x5ca2('0x0'));var util=require('util');var path=require(_0x5ca2('0x1'));var timeout=require(_0x5ca2('0x2'));var express=require(_0x5ca2('0x3'));var router=express[_0x5ca2('0x4')]();var fs_extra=require(_0x5ca2('0x5'));var auth=require(_0x5ca2('0x6'));var interaction=require(_0x5ca2('0x7'));var config=require(_0x5ca2('0x8'));var controller=require(_0x5ca2('0x9'));router[_0x5ca2('0xa')](_0x5ca2('0xb'),auth['isAuthenticated'](),controller[_0x5ca2('0xc')]);router['delete']('/:id',auth[_0x5ca2('0xd')](),controller[_0x5ca2('0xe')]);module[_0x5ca2('0xf')]=router;
\ No newline at end of file
+var _0xe222=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','isAuthenticated','update','/:id','exports'];(function(_0x1caf05,_0x4a597a){var _0x4d38fc=function(_0x81de01){while(--_0x81de01){_0x1caf05['push'](_0x1caf05['shift']());}};_0x4d38fc(++_0x4a597a);}(_0xe222,0x168));var _0x2e22=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0xe222[_0x36bf88];return _0x332914;};'use strict';var multer=require(_0x2e22('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2e22('0x1'));var express=require('express');var router=express[_0x2e22('0x2')]();var fs_extra=require(_0x2e22('0x3'));var auth=require(_0x2e22('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2e22('0x5'));var controller=require(_0x2e22('0x6'));router[_0x2e22('0x7')]('/:id',auth[_0x2e22('0x8')](),controller[_0x2e22('0x9')]);router['delete'](_0x2e22('0xa'),auth[_0x2e22('0x8')](),controller['destroy']);module[_0x2e22('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index d9d573a..cc16c1d 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 _0xda19=['exports','STRING','TEXT'];(function(_0x124fb0,_0x4addf2){var _0x2265d6=function(_0xd03631){while(--_0xd03631){_0x124fb0['push'](_0x124fb0['shift']());}};_0x2265d6(++_0x4addf2);}(_0xda19,0xd5));var _0x9da1=function(_0x5b25f1,_0x21d1ee){_0x5b25f1=_0x5b25f1-0x0;var _0x5a269f=_0xda19[_0x5b25f1];return _0x5a269f;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x435d28,_0xcfe3ae){var _0x4d0132=function(_0x27a5ab){while(--_0x27a5ab){_0x435d28['push'](_0x435d28['shift']());}};_0x4d0132(++_0xcfe3ae);}(_0xd8fb,0x99));var _0xbd8f=function(_0x438cdf,_0x39b2a1){_0x438cdf=_0x438cdf-0x0;var _0x236c4d=_0xd8fb[_0x438cdf];return _0x236c4d;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f7ada88..236ca21 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 _0x6890=['body','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','MAX(%s)','AVG(%s)','DATE(%s)','IS\x20EMPTY','getFields','from','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','join','../../components/export/','savename','countTable','COUNT(*)','run','clone','SELECT','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','findAll','rows','catch','params','length','include','find','create','user','get','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x5b7ef6,_0x3e5212){var _0x27d038=function(_0x3db34e){while(--_0x3db34e){_0x5b7ef6['push'](_0x5b7ef6['shift']());}};_0x27d038(++_0x3e5212);}(_0x6890,0xf7));var _0x0689=function(_0x3482da,_0x347b50){_0x3482da=_0x3482da-0x0;var _0x27adfe=_0x6890[_0x3482da];return _0x27adfe;};'use strict';var emlformat=require(_0x0689('0x0'));var rimraf=require(_0x0689('0x1'));var zipdir=require(_0x0689('0x2'));var jsonpatch=require(_0x0689('0x3'));var rp=require('request-promise');var moment=require(_0x0689('0x4'));var BPromise=require(_0x0689('0x5'));var Mustache=require(_0x0689('0x6'));var util=require(_0x0689('0x7'));var path=require('path');var sox=require(_0x0689('0x8'));var csv=require(_0x0689('0x9'));var ejs=require(_0x0689('0xa'));var fs=require('fs');var fs_extra=require(_0x0689('0xb'));var _=require(_0x0689('0xc'));var squel=require(_0x0689('0xd'));var crypto=require(_0x0689('0xe'));var jsforce=require(_0x0689('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0689('0x9'));var querystring=require(_0x0689('0x10'));var Papa=require(_0x0689('0x11'));var Redis=require(_0x0689('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0689('0x13'));var as=require(_0x0689('0x14'));var hardwareService=require(_0x0689('0x15'));var logger=require('../../config/logger')(_0x0689('0x16'));var utils=require(_0x0689('0x17'));var config=require(_0x0689('0x18'));var licenseUtil=require(_0x0689('0x19'));var db=require(_0x0689('0x1a'))['db'];var dbH=require(_0x0689('0x1a'))[_0x0689('0x1b')];function respondWithStatusCode(_0x51b527,_0x17bef7){_0x17bef7=_0x17bef7||0xcc;return function(_0x491cbb){if(_0x491cbb){return _0x51b527[_0x0689('0x1c')](_0x17bef7);}return _0x51b527[_0x0689('0x1d')](_0x17bef7)[_0x0689('0x1e')]();};}function respondWithResult(_0x3ffc37,_0x433d17){_0x433d17=_0x433d17||0xc8;return function(_0x49a1d5){if(_0x49a1d5){return _0x3ffc37[_0x0689('0x1d')](_0x433d17)[_0x0689('0x1f')](_0x49a1d5);}};}function respondWithFilteredResult(_0x14eed3,_0x1d1de6){return function(_0x48f2f1){if(_0x48f2f1){var _0x391897=typeof _0x1d1de6[_0x0689('0x20')]===_0x0689('0x21')&&typeof _0x1d1de6[_0x0689('0x22')]==='undefined';var _0x25a124=_0x48f2f1['count'];var _0x376b66=_0x391897?0x0:_0x1d1de6[_0x0689('0x20')];var _0x87b6a0=_0x391897?_0x48f2f1[_0x0689('0x23')]:_0x1d1de6[_0x0689('0x20')]+_0x1d1de6['limit'];var _0x258e63;if(_0x87b6a0>=_0x25a124){_0x87b6a0=_0x25a124;_0x258e63=0xc8;}else{_0x258e63=0xce;}_0x14eed3[_0x0689('0x1d')](_0x258e63);return _0x14eed3['set'](_0x0689('0x24'),_0x376b66+'-'+_0x87b6a0+'/'+_0x25a124)[_0x0689('0x1f')](_0x48f2f1);}return null;};}function patchUpdates(_0x2431ab){return function(_0x11b668){try{jsonpatch[_0x0689('0x25')](_0x11b668,_0x2431ab,!![]);}catch(_0x11623d){return BPromise[_0x0689('0x26')](_0x11623d);}return _0x11b668['save']();};}function saveUpdates(_0x414a5f,_0x341978){return function(_0x58846f){if(_0x58846f){return _0x58846f[_0x0689('0x27')](_0x414a5f)['then'](function(_0x25765c){return _0x25765c;});}return null;};}function removeEntity(_0x3926d8,_0x3c648f){return function(_0x73113e){if(_0x73113e){return _0x73113e[_0x0689('0x28')]()[_0x0689('0x29')](function(){var _0x3e5c95=_0x73113e['get']({'plain':!![]});var _0x4bdf11=_0x0689('0x2a');return db[_0x0689('0x2b')][_0x0689('0x28')]({'where':{'type':_0x4bdf11,'resourceId':_0x3e5c95['id']}})[_0x0689('0x29')](function(){return _0x73113e;});})[_0x0689('0x29')](function(){_0x3926d8[_0x0689('0x1d')](0xcc)[_0x0689('0x1e')]();});}};}function handleEntityNotFound(_0x16f459,_0x47c840){return function(_0x34a21f){if(!_0x34a21f){_0x16f459['sendStatus'](0x194);}return _0x34a21f;};}function handleError(_0x5381f7,_0x4acef0){_0x4acef0=_0x4acef0||0x1f4;return function(_0x417b9e){logger[_0x0689('0x2c')](_0x417b9e[_0x0689('0x2d')]);if(_0x417b9e[_0x0689('0x2e')]){delete _0x417b9e[_0x0689('0x2e')];}_0x5381f7[_0x0689('0x1d')](_0x4acef0)[_0x0689('0x2f')](_0x417b9e);};}exports[_0x0689('0x30')]=function(_0x4a7be4,_0x1e2208){var _0x436327={},_0xa8a557={},_0x5a4e0a={'count':0x0,'rows':[]};var _0x3dbe57=_[_0x0689('0x31')](db['AnalyticCustomReport'][_0x0689('0x32')],function(_0x23cca4){return{'name':_0x23cca4[_0x0689('0x33')],'type':_0x23cca4[_0x0689('0x34')][_0x0689('0x35')]};});_0xa8a557[_0x0689('0x36')]=_[_0x0689('0x31')](_0x3dbe57,_0x0689('0x2e'));_0xa8a557[_0x0689('0x37')]=_[_0x0689('0x38')](_0x4a7be4[_0x0689('0x37')]);_0xa8a557['filters']=_[_0x0689('0x39')](_0xa8a557[_0x0689('0x36')],_0xa8a557[_0x0689('0x37')]);_0x436327[_0x0689('0x3a')]=_[_0x0689('0x39')](_0xa8a557[_0x0689('0x36')],qs[_0x0689('0x3b')](_0x4a7be4[_0x0689('0x37')][_0x0689('0x3b')]));_0x436327[_0x0689('0x3a')]=_0x436327[_0x0689('0x3a')]['length']?_0x436327[_0x0689('0x3a')]:_0xa8a557[_0x0689('0x36')];if(!_0x4a7be4['query'][_0x0689('0x3c')](_0x0689('0x3d'))){_0x436327[_0x0689('0x22')]=qs[_0x0689('0x22')](_0x4a7be4[_0x0689('0x37')][_0x0689('0x22')]);_0x436327['offset']=qs[_0x0689('0x20')](_0x4a7be4[_0x0689('0x37')][_0x0689('0x20')]);}_0x436327['order']=qs[_0x0689('0x3e')](_0x4a7be4[_0x0689('0x37')][_0x0689('0x3e')]);_0x436327['where']=qs[_0x0689('0x3f')](_[_0x0689('0x40')](_0x4a7be4[_0x0689('0x37')],_0xa8a557['filters']),_0x3dbe57);if(_0x4a7be4[_0x0689('0x37')][_0x0689('0x41')]){_0x436327[_0x0689('0x42')]=_[_0x0689('0x43')](_0x436327[_0x0689('0x42')],{'$or':_['map'](_0x3dbe57,function(_0x32e27c){if(_0x32e27c[_0x0689('0x34')]!==_0x0689('0x44')){var _0xac3ddb={};_0xac3ddb[_0x32e27c[_0x0689('0x2e')]]={'$like':'%'+_0x4a7be4[_0x0689('0x37')][_0x0689('0x41')]+'%'};return _0xac3ddb;}})});}_0x436327=_[_0x0689('0x43')]({},_0x436327,_0x4a7be4[_0x0689('0x45')]);var _0x6f56b0={'where':_0x436327[_0x0689('0x42')]};return db[_0x0689('0x46')][_0x0689('0x23')](_0x6f56b0)[_0x0689('0x29')](function(_0xd7116d){_0x5a4e0a['count']=_0xd7116d;if(_0x4a7be4['query'][_0x0689('0x47')]){_0x436327['include']=[{'all':!![]}];}return db[_0x0689('0x46')][_0x0689('0x48')](_0x436327);})['then'](function(_0x1ece44){_0x5a4e0a[_0x0689('0x49')]=_0x1ece44;return _0x5a4e0a;})[_0x0689('0x29')](respondWithFilteredResult(_0x1e2208,_0x436327))[_0x0689('0x4a')](handleError(_0x1e2208,null));};exports['show']=function(_0x116897,_0x108267){var _0x4bf869={'raw':![],'where':{'id':_0x116897[_0x0689('0x4b')]['id']}},_0x56990c={};_0x56990c[_0x0689('0x36')]=_[_0x0689('0x38')](db[_0x0689('0x46')]['rawAttributes']);_0x56990c[_0x0689('0x37')]=_[_0x0689('0x38')](_0x116897[_0x0689('0x37')]);_0x56990c[_0x0689('0x3f')]=_['intersection'](_0x56990c[_0x0689('0x36')],_0x56990c['query']);_0x4bf869[_0x0689('0x3a')]=_[_0x0689('0x39')](_0x56990c[_0x0689('0x36')],qs[_0x0689('0x3b')](_0x116897[_0x0689('0x37')][_0x0689('0x3b')]));_0x4bf869['attributes']=_0x4bf869[_0x0689('0x3a')][_0x0689('0x4c')]?_0x4bf869['attributes']:_0x56990c[_0x0689('0x36')];if(_0x116897['query'][_0x0689('0x47')]){_0x4bf869[_0x0689('0x4d')]=[{'all':!![]}];}_0x4bf869=_[_0x0689('0x43')]({},_0x4bf869,_0x116897['options']);return db[_0x0689('0x46')][_0x0689('0x4e')](_0x4bf869)[_0x0689('0x29')](handleEntityNotFound(_0x108267,null))[_0x0689('0x29')](respondWithResult(_0x108267,null))['catch'](handleError(_0x108267,null));};exports[_0x0689('0x4f')]=function(_0x2c36bf,_0x200195){return db[_0x0689('0x46')][_0x0689('0x4f')](_0x2c36bf['body'],{})[_0x0689('0x29')](function(_0x3d2c64){var _0x456f36=_0x2c36bf[_0x0689('0x50')][_0x0689('0x51')]({'plain':!![]});if(!_0x456f36)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x456f36[_0x0689('0x52')]===_0x0689('0x50')){var _0x1808a3=_0x3d2c64[_0x0689('0x51')]({'plain':!![]});var _0x2ee3e5=_0x0689('0x53');return db[_0x0689('0x54')][_0x0689('0x4e')]({'where':{'name':_0x2ee3e5,'userProfileId':_0x456f36[_0x0689('0x55')]},'raw':!![]})[_0x0689('0x29')](function(_0x9155af){if(_0x9155af&&_0x9155af['autoAssociation']===0x0){return db[_0x0689('0x2b')]['create']({'name':_0x1808a3[_0x0689('0x2e')],'resourceId':_0x1808a3['id'],'type':'CustomReports','sectionId':_0x9155af['id']},{})[_0x0689('0x29')](function(){return _0x3d2c64;});}else{return _0x3d2c64;}})['catch'](function(_0x34a7eb){logger['error'](_0x0689('0x56'),_0x34a7eb);throw _0x34a7eb;});}return _0x3d2c64;})[_0x0689('0x29')](respondWithResult(_0x200195,0xc9))[_0x0689('0x4a')](handleError(_0x200195,null));};exports[_0x0689('0x27')]=function(_0x2fb8fa,_0xf666c7){if(_0x2fb8fa[_0x0689('0x57')]['id']){delete _0x2fb8fa['body']['id'];}return db['AnalyticCustomReport'][_0x0689('0x4e')]({'where':{'id':_0x2fb8fa[_0x0689('0x4b')]['id']}})[_0x0689('0x29')](handleEntityNotFound(_0xf666c7,null))[_0x0689('0x29')](saveUpdates(_0x2fb8fa[_0x0689('0x57')],null))[_0x0689('0x29')](respondWithResult(_0xf666c7,null))[_0x0689('0x4a')](handleError(_0xf666c7,null));};exports[_0x0689('0x28')]=function(_0x42543b,_0x3ca834){return db['AnalyticCustomReport'][_0x0689('0x4e')]({'where':{'id':_0x42543b[_0x0689('0x4b')]['id']}})[_0x0689('0x29')](handleEntityNotFound(_0x3ca834,null))['then'](removeEntity(_0x3ca834,null))[_0x0689('0x4a')](handleError(_0x3ca834,null));};exports['preview']=function(_0x8412ed,_0x3caec0){var _0x5a7884=0xa;var _0x196a1d=['join',_0x0689('0x58'),_0x0689('0x59'),_0x0689('0x5a')];var _0xb66604={'SUM':_0x0689('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0689('0x5c'),'MAX':'MAX(%s)','MIN':_0x0689('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0689('0x5e'),'GROUP_CONCAT ASC':_0x0689('0x5f'),'GROUP_CONCAT DESC':_0x0689('0x60')};var _0x4b4723={'SEC_TO_TIME':_0x0689('0x61'),'DATE':'DATE(%s)','HOUR':_0x0689('0x62'),'ROUND':_0x0689('0x63'),'UNIX_TIMESTAMP':_0x0689('0x64')};var _0x3e3f32=function(_0x6a5f5a){return!_[_0x0689('0x65')]([_0x0689('0x66'),_0x0689('0x67'),'IS\x20EMPTY',_0x0689('0x68')],_0x6a5f5a);};var _0x5489eb=function(_0x3db2c1){if(!_0x3db2c1||!_0x3db2c1[_0x0689('0x69')][_0x0689('0x4c')]){return'';}for(var _0x58b3eb='(',_0x90ca1f=0x0;_0x90ca1f<_0x3db2c1['rules']['length'];_0x90ca1f+=0x1){_0x90ca1f>0x0&&(_0x58b3eb+='\x20'+_0x3db2c1[_0x0689('0x6a')]+'\x20');_0x58b3eb+=_0x3db2c1[_0x0689('0x69')][_0x90ca1f][_0x0689('0x6b')]?_0x5489eb(_0x3db2c1['rules'][_0x90ca1f][_0x0689('0x6b')]):_0x3db2c1['rules'][_0x90ca1f][_0x0689('0x6c')]+'\x20'+_0x3db2c1[_0x0689('0x69')][_0x90ca1f][_0x0689('0x6d')]+(_0x3e3f32(_0x3db2c1[_0x0689('0x69')][_0x90ca1f][_0x0689('0x6d')])?'\x20'+_0x3db2c1[_0x0689('0x69')][_0x90ca1f][_0x0689('0x6e')]:'');}return _0x58b3eb+')';};var _0x56cad={'where':{'id':_0x8412ed[_0x0689('0x4b')]['id']}},_0x9bddef,_0x4492e5,_0x58bd66,_0x210fe9,_0x3439a8;_0x56cad=_[_0x0689('0x43')]({},_0x56cad,_0x8412ed['options']);return db[_0x0689('0x46')][_0x0689('0x4e')](_0x56cad)['then'](function(_0xa55db9){if(_0xa55db9){_0x9bddef=_0xa55db9;return _0xa55db9['getFields']();}return null;})['then'](function(_0x4b070b){if(_0x4b070b){if(!_0x4b070b[_0x0689('0x4c')]){throw new db['Sequelize'][(_0x0689('0x6f'))](_0x0689('0x70'),0x193);}_0x4492e5=_0x4b070b;return db[_0x0689('0x71')][_0x0689('0x48')]({'raw':!![]});}return null;})[_0x0689('0x29')](function(_0x3e8a69){if(_0x3e8a69){_0x58bd66=_[_0x0689('0x72')](_0x3e8a69,'id');var _0x2c0694;var _0x93d21e=squel[_0x0689('0x73')]();_0x93d21e['from'](_0x9bddef[_0x0689('0x74')]);for(var _0x23de56=0x0;_0x23de56<_0x4492e5[_0x0689('0x4c')];_0x23de56+=0x1){_0x2c0694=_0x4492e5[_0x23de56]['MetricId']?_0x58bd66[_0x4492e5[_0x23de56][_0x0689('0x75')]][_0x0689('0x76')]:_0x4492e5[_0x23de56][_0x0689('0x6c')];_0x2c0694=_0x4492e5[_0x23de56][_0x0689('0x77')]?_['replace'](_0xb66604[_0x4492e5[_0x23de56]['function']],'%s',_0x2c0694):_0x2c0694;_0x2c0694=_0x4492e5[_0x23de56][_0x0689('0x78')]?_[_0x0689('0x79')](_0x4b4723[_0x4492e5[_0x23de56][_0x0689('0x78')]],'%s',_0x2c0694):_0x2c0694;if(_0x4492e5[_0x23de56][_0x0689('0x7a')]){_0x93d21e['group'](_0x2c0694);}_0x4492e5[_0x23de56][_0x0689('0x7b')]&&_0x93d21e[_0x0689('0x7c')](_0x2c0694,_0x4492e5[_0x23de56][_0x0689('0x7b')]===_0x0689('0x7d')?![]:!![]);_0x93d21e[_0x0689('0x6c')](_0x2c0694,_0x4492e5[_0x23de56][_0x0689('0x7e')]||_0x2c0694);}if(_0x9bddef['joins']){_0x9bddef[_0x0689('0x7f')]=JSON[_0x0689('0x80')](_0x9bddef[_0x0689('0x7f')]);for(var _0x46eff7=0x0;_0x46eff7<_0x9bddef['joins'][_0x0689('0x4c')];_0x46eff7+=0x1){if(_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x34')]&&_[_0x0689('0x65')](_0x196a1d,_0x9bddef['joins'][_0x46eff7][_0x0689('0x34')])&&_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x81')]&&_0x9bddef[_0x0689('0x7f')][_0x46eff7]['foreignTable']&&_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x82')]){_0x93d21e[_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x34')]](_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x83')],null,util[_0x0689('0x78')](_0x0689('0x84'),_0x9bddef[_0x0689('0x74')],_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x81')],_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x83')],_0x9bddef['joins'][_0x46eff7]['foreignKey']));}}}if(_0x9bddef['conditions']){_0x9bddef[_0x0689('0x85')]=JSON[_0x0689('0x80')](_0x9bddef['conditions']);_0x93d21e['where'](_0x5489eb(_0x9bddef[_0x0689('0x85')][_0x0689('0x6b')]));}_0x3439a8=_0x93d21e['clone']();_0x93d21e[_0x0689('0x22')](_0x5a7884);_0x93d21e[_0x0689('0x20')](0x0);logger[_0x0689('0x86')](_0x0689('0x87'),_0x93d21e[_0x0689('0x88')]());return dbH[_0x0689('0x89')][_0x0689('0x37')](_0x93d21e[_0x0689('0x88')](),{'type':dbH['sequelize'][_0x0689('0x8a')]['SELECT']});}})[_0x0689('0x29')](respondWithResult(_0x3caec0,null))[_0x0689('0x4a')](handleError(_0x3caec0,null));};function runReport(_0x2c68d7,_0x39ffcb,_0x30af2c){var _0x1823f5=_0x39ffcb[_0x0689('0x2e')];var _0x369bb3=0xa;var _0x108596=['join',_0x0689('0x58'),'right_join',_0x0689('0x5a')];var _0x1a368e={'SUM':_0x0689('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0689('0x5c'),'MAX':_0x0689('0x8b'),'MIN':_0x0689('0x5d'),'AVG':_0x0689('0x8c'),'GROUP_CONCAT':_0x0689('0x5e'),'GROUP_CONCAT ASC':_0x0689('0x5f'),'GROUP_CONCAT DESC':_0x0689('0x60')};var _0x5d4245={'SEC_TO_TIME':_0x0689('0x61'),'DATE':_0x0689('0x8d'),'HOUR':_0x0689('0x62'),'ROUND':_0x0689('0x63'),'UNIX_TIMESTAMP':_0x0689('0x64')};var _0x230388=function(_0x3fcf08){return!_['includes']([_0x0689('0x66'),_0x0689('0x67'),_0x0689('0x8e'),_0x0689('0x68')],_0x3fcf08);};var _0x1932d9=function(_0x12fb77){if(!_0x12fb77||!_0x12fb77['rules'][_0x0689('0x4c')]){return'';}for(var _0x13995d='(',_0x2d8285=0x0;_0x2d8285<_0x12fb77[_0x0689('0x69')][_0x0689('0x4c')];_0x2d8285+=0x1){_0x2d8285>0x0&&(_0x13995d+='\x20'+_0x12fb77['operator']+'\x20');_0x13995d+=_0x12fb77[_0x0689('0x69')][_0x2d8285]['group']?_0x1932d9(_0x12fb77[_0x0689('0x69')][_0x2d8285][_0x0689('0x6b')]):_0x12fb77[_0x0689('0x69')][_0x2d8285]['field']+'\x20'+_0x12fb77[_0x0689('0x69')][_0x2d8285]['condition']+(_0x230388(_0x12fb77[_0x0689('0x69')][_0x2d8285]['condition'])?'\x20'+_0x12fb77['rules'][_0x2d8285][_0x0689('0x6e')]:'');}return _0x13995d+')';};var _0x55a112={'where':{'id':_0x2c68d7['id']}},_0x5dc22c,_0x4a5f01,_0x180184,_0x2f7678,_0x39ff2f;_0x55a112=_['merge']({},_0x55a112,_0x30af2c);return db[_0x0689('0x46')][_0x0689('0x4e')](_0x55a112)[_0x0689('0x29')](function(_0x4f264a){if(_0x4f264a){_0x5dc22c=_0x4f264a;return _0x4f264a[_0x0689('0x8f')]();}return null;})['then'](function(_0x366c61){if(_0x366c61){if(!_0x366c61[_0x0689('0x4c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x0689('0x70'),0x193);}_0x4a5f01=_0x366c61;return db[_0x0689('0x71')][_0x0689('0x48')]({'raw':!![]});}return null;})[_0x0689('0x29')](function(_0x44ea35){if(_0x44ea35){_0x180184=_[_0x0689('0x72')](_0x44ea35,'id');var _0x342404;var _0x6331dc=squel[_0x0689('0x73')]();_0x6331dc[_0x0689('0x90')](_0x5dc22c[_0x0689('0x74')]);for(var _0x10d9a6=0x0;_0x10d9a6<_0x4a5f01[_0x0689('0x4c')];_0x10d9a6+=0x1){_0x342404=_0x4a5f01[_0x10d9a6][_0x0689('0x75')]?_0x180184[_0x4a5f01[_0x10d9a6][_0x0689('0x75')]][_0x0689('0x76')]:_0x4a5f01[_0x10d9a6][_0x0689('0x6c')];_0x342404=_0x4a5f01[_0x10d9a6][_0x0689('0x77')]?_[_0x0689('0x79')](_0x1a368e[_0x4a5f01[_0x10d9a6]['function']],'%s',_0x342404):_0x342404;_0x342404=_0x4a5f01[_0x10d9a6][_0x0689('0x78')]?_['replace'](_0x5d4245[_0x4a5f01[_0x10d9a6][_0x0689('0x78')]],'%s',_0x342404):_0x342404;if(_0x4a5f01[_0x10d9a6][_0x0689('0x7a')]){_0x6331dc[_0x0689('0x6b')](_0x342404);}_0x4a5f01[_0x10d9a6][_0x0689('0x7b')]&&_0x6331dc[_0x0689('0x7c')](_0x342404,_0x4a5f01[_0x10d9a6][_0x0689('0x7b')]===_0x0689('0x7d')?![]:!![]);_0x6331dc[_0x0689('0x6c')](_0x342404,_0x4a5f01[_0x10d9a6][_0x0689('0x7e')]||_0x342404);}if(_0x5dc22c[_0x0689('0x7f')]){_0x5dc22c[_0x0689('0x7f')]=JSON['parse'](_0x5dc22c[_0x0689('0x7f')]);for(var _0x4c77fd=0x0;_0x4c77fd<_0x5dc22c['joins'][_0x0689('0x4c')];_0x4c77fd+=0x1){if(_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x34')]&&_['includes'](_0x108596,_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x34')])&&_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x81')]&&_0x5dc22c[_0x0689('0x7f')][_0x4c77fd]['foreignTable']&&_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x82')]){_0x6331dc[_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x34')]](_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x83')],null,util[_0x0689('0x78')](_0x0689('0x84'),_0x5dc22c[_0x0689('0x74')],_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x81')],_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x83')],_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x82')]));}}}if(_0x5dc22c[_0x0689('0x85')]){_0x5dc22c['conditions']=JSON[_0x0689('0x80')](_0x5dc22c[_0x0689('0x85')]);_0x6331dc[_0x0689('0x42')](_0x1932d9(_0x5dc22c['conditions']['group']));}_0x39ff2f=_0x6331dc['clone']();_0x6331dc[_0x0689('0x22')](_0x369bb3);_0x6331dc[_0x0689('0x20')](0x0);return;}})[_0x0689('0x29')](function(){if(_0x39ffcb[_0x0689('0x91')]===_0x0689('0x92')){return null;}var _0x5f4fc0=_['merge'](_0x39ffcb,{'name':_0x39ffcb[_0x0689('0x93')]||_0x39ffcb[_0x0689('0x2e')]||_0x5dc22c[_0x0689('0x2e')],'basename':_0x1823f5,'savename':util[_0x0689('0x78')](_0x0689('0x94'),_0x39ffcb['name']||_0x5dc22c[_0x0689('0x2e')],require(_0x0689('0x95'))[_0x0689('0x96')](0x4),_0x39ffcb['output']||'csv'),'reportId':_0x5dc22c['id'],'reportType':_0x0689('0x97')});return db[_0x0689('0x98')][_0x0689('0x4f')](_0x5f4fc0,{'raw':!![]});})[_0x0689('0x29')](function(_0x4f20fe){if(_0x5dc22c[_0x0689('0x74')]==='cdr'){_0x39ff2f[_0x0689('0x42')](_0x5dc22c[_0x0689('0x74')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x39ffcb[_0x0689('0x99')],_0x39ffcb[_0x0689('0x9a')]);}else{_0x39ff2f[_0x0689('0x42')](_0x5dc22c[_0x0689('0x74')]+_0x0689('0x9b'),_0x39ffcb[_0x0689('0x99')],_0x39ffcb[_0x0689('0x9a')]);}if(_0x4f20fe){logger[_0x0689('0x9c')](_0x0689('0x9d'),_0x39ff2f[_0x0689('0x88')]());require(_0x0689('0x9e'))['fork'](path[_0x0689('0x9f')](__dirname,_0x0689('0xa0'),_0x4f20fe['output']),[_0x4f20fe['id'],_0x39ff2f[_0x0689('0x88')](),path[_0x0689('0x9f')](__dirname,'../../files/reports',_0x4f20fe[_0x0689('0xa1')]),_0x1823f5]);return _0x4f20fe;}else{var _0x4d3847=squel['select']();_0x4d3847[_0x0689('0x90')]('('+_0x39ff2f['toString']()+')',_0x0689('0xa2'));_0x4d3847['field'](_0x0689('0xa3'),'count');_0x39ff2f['limit'](_0x39ffcb['limit']||_0x369bb3);_0x39ff2f[_0x0689('0x20')](_0x39ffcb['offset']||0x0);return dbH[_0x0689('0x89')][_0x0689('0x37')](_0x4d3847[_0x0689('0x88')](),{'type':dbH[_0x0689('0x89')][_0x0689('0x8a')]['SELECT']})['then'](function(_0x2c263b){if(!_0x2c263b[_0x0689('0x4c')]){_0x2f7678=0x0;}else{_0x2f7678=_0x2c263b[0x0][_0x0689('0x23')]||0x0;}return dbH[_0x0689('0x89')]['query'](_0x39ff2f['toString'](),{'type':dbH['sequelize'][_0x0689('0x8a')]['SELECT']});})[_0x0689('0x29')](function(_0x5914dc){return{'rows':_0x5914dc||[],'count':_0x2f7678};});}});}exports[_0x0689('0xa4')]=function(_0x1c17a5,_0x57009f){return runReport(_0x1c17a5['params'],_0x1c17a5[_0x0689('0x37')],_0x1c17a5[_0x0689('0x45')])[_0x0689('0x29')](respondWithResult(_0x57009f,null))[_0x0689('0x4a')](handleError(_0x57009f,null));};exports['runReport']=runReport;exports[_0x0689('0x37')]=function(_0x3d3333,_0x4dd34){var _0x459b51=0xa;var _0x505499=[_0x0689('0x9f'),_0x0689('0x58'),'right_join',_0x0689('0x5a')];var _0x203e84={'SUM':_0x0689('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0689('0x5c'),'MAX':_0x0689('0x8b'),'MIN':_0x0689('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0689('0x5e'),'GROUP_CONCAT ASC':_0x0689('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xef506b={'SEC_TO_TIME':_0x0689('0x61'),'DATE':_0x0689('0x8d'),'HOUR':_0x0689('0x62'),'ROUND':_0x0689('0x63'),'UNIX_TIMESTAMP':_0x0689('0x64')};var _0x12d0a6=function(_0x44e7d0){return!_['includes']([_0x0689('0x66'),_0x0689('0x67'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x44e7d0);};var _0x4702b8=function(_0x333441){if(!_0x333441||!_0x333441[_0x0689('0x69')][_0x0689('0x4c')]){return'';}for(var _0x5d7128='(',_0x29c2ac=0x0;_0x29c2ac<_0x333441[_0x0689('0x69')][_0x0689('0x4c')];_0x29c2ac+=0x1){_0x29c2ac>0x0&&(_0x5d7128+='\x20'+_0x333441[_0x0689('0x6a')]+'\x20');_0x5d7128+=_0x333441['rules'][_0x29c2ac][_0x0689('0x6b')]?_0x4702b8(_0x333441[_0x0689('0x69')][_0x29c2ac][_0x0689('0x6b')]):_0x333441[_0x0689('0x69')][_0x29c2ac][_0x0689('0x6c')]+'\x20'+_0x333441[_0x0689('0x69')][_0x29c2ac][_0x0689('0x6d')]+(_0x12d0a6(_0x333441[_0x0689('0x69')][_0x29c2ac][_0x0689('0x6d')])?'\x20'+_0x333441[_0x0689('0x69')][_0x29c2ac]['value']:'');}return _0x5d7128+')';};var _0x47d1c6={'where':{'id':_0x3d3333[_0x0689('0x4b')]['id']}},_0x5d70b8,_0x290f1a,_0xda2413,_0x86943a,_0x2619e2;_0x47d1c6=_['merge']({},_0x47d1c6,_0x3d3333[_0x0689('0x45')]);return db[_0x0689('0x46')]['find'](_0x47d1c6)[_0x0689('0x29')](function(_0x57b80f){if(_0x57b80f){_0x5d70b8=_0x57b80f;return _0x57b80f['getFields']();}return null;})[_0x0689('0x29')](function(_0x1a8e34){if(_0x1a8e34){if(!_0x1a8e34[_0x0689('0x4c')]){throw new db['Sequelize'][(_0x0689('0x6f'))](_0x0689('0x70'),0x193);}_0x290f1a=_0x1a8e34;return db[_0x0689('0x71')][_0x0689('0x48')]({'raw':!![]});}return null;})[_0x0689('0x29')](function(_0x3fd0fe){if(_0x3fd0fe){_0xda2413=_[_0x0689('0x72')](_0x3fd0fe,'id');var _0x1121fb;var _0xbebfe5=squel[_0x0689('0x73')]();_0xbebfe5[_0x0689('0x90')](_0x5d70b8[_0x0689('0x74')]);for(var _0x13f589=0x0;_0x13f589<_0x290f1a['length'];_0x13f589+=0x1){_0x1121fb=_0x290f1a[_0x13f589][_0x0689('0x75')]?_0xda2413[_0x290f1a[_0x13f589]['MetricId']][_0x0689('0x76')]:_0x290f1a[_0x13f589][_0x0689('0x6c')];_0x1121fb=_0x290f1a[_0x13f589]['function']?_[_0x0689('0x79')](_0x203e84[_0x290f1a[_0x13f589][_0x0689('0x77')]],'%s',_0x1121fb):_0x1121fb;_0x1121fb=_0x290f1a[_0x13f589][_0x0689('0x78')]?_[_0x0689('0x79')](_0xef506b[_0x290f1a[_0x13f589]['format']],'%s',_0x1121fb):_0x1121fb;if(_0x290f1a[_0x13f589]['groupBy']){_0xbebfe5['group'](_0x1121fb);}_0x290f1a[_0x13f589][_0x0689('0x7b')]&&_0xbebfe5[_0x0689('0x7c')](_0x1121fb,_0x290f1a[_0x13f589][_0x0689('0x7b')]===_0x0689('0x7d')?![]:!![]);_0xbebfe5[_0x0689('0x6c')](_0x1121fb,_0x290f1a[_0x13f589][_0x0689('0x7e')]||_0x1121fb);}if(_0x5d70b8[_0x0689('0x7f')]){_0x5d70b8[_0x0689('0x7f')]=JSON[_0x0689('0x80')](_0x5d70b8[_0x0689('0x7f')]);for(var _0x1e95cb=0x0;_0x1e95cb<_0x5d70b8[_0x0689('0x7f')]['length'];_0x1e95cb+=0x1){if(_0x5d70b8['joins'][_0x1e95cb][_0x0689('0x34')]&&_[_0x0689('0x65')](_0x505499,_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x34')])&&_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x81')]&&_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x83')]&&_0x5d70b8[_0x0689('0x7f')][_0x1e95cb]['foreignKey']){_0xbebfe5[_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x34')]](_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x83')],null,util[_0x0689('0x78')](_0x0689('0x84'),_0x5d70b8[_0x0689('0x74')],_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x81')],_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x83')],_0x5d70b8['joins'][_0x1e95cb][_0x0689('0x82')]));}}}if(_0x5d70b8[_0x0689('0x85')]){_0x5d70b8[_0x0689('0x85')]=JSON[_0x0689('0x80')](_0x5d70b8[_0x0689('0x85')]);_0xbebfe5['where'](_0x4702b8(_0x5d70b8[_0x0689('0x85')][_0x0689('0x6b')]));}_0x2619e2=_0xbebfe5[_0x0689('0xa5')]();_0xbebfe5[_0x0689('0x22')](_0x459b51);_0xbebfe5['offset'](0x0);logger['debug'](_0x0689('0x87'),_0xbebfe5[_0x0689('0x88')]());return dbH[_0x0689('0x89')][_0x0689('0x37')](_0xbebfe5[_0x0689('0x88')](),{'type':dbH[_0x0689('0x89')][_0x0689('0x8a')][_0x0689('0xa6')]});}})[_0x0689('0x29')](function(){return{'sql':_0x2619e2['toString']()};})['then'](respondWithResult(_0x4dd34,null))[_0x0689('0x4a')](handleError(_0x4dd34,null));};
\ No newline at end of file
+var _0x516a=['toString','sequelize','SELECT','left_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','operator','keyBy','select','from','parentKey','clone','output','web','fullPath','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','savename','countTable','COUNT(*)','QueryTypes','run','runReport','getFields','eml-format','rimraf','request-promise','moment','bluebird','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','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','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','CustomReports','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','catch','show','params','intersection','includeAll','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','preview','join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%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\x20EMPTY','IS\x20NOT\x20EMPTY','rules','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','table','MetricId','metric','function','format','replace','groupBy','group','orderBy','DESC','alias','joins','parse','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','debug','Limited\x20Query:'];(function(_0x566180,_0x341806){var _0xbdc228=function(_0x2d1ec2){while(--_0x2d1ec2){_0x566180['push'](_0x566180['shift']());}};_0xbdc228(++_0x341806);}(_0x516a,0xc8));var _0xa516=function(_0x57211b,_0x41ccef){_0x57211b=_0x57211b-0x0;var _0x457b58=_0x516a[_0x57211b];return _0x457b58;};'use strict';var emlformat=require(_0xa516('0x0'));var rimraf=require(_0xa516('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa516('0x2'));var moment=require(_0xa516('0x3'));var BPromise=require(_0xa516('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa516('0x5'));var sox=require(_0xa516('0x6'));var csv=require('to-csv');var ejs=require(_0xa516('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa516('0x8'));var squel=require('squel');var crypto=require(_0xa516('0x9'));var jsforce=require(_0xa516('0xa'));var deskjs=require(_0xa516('0xb'));var toCsv=require(_0xa516('0xc'));var querystring=require('querystring');var Papa=require(_0xa516('0xd'));var Redis=require(_0xa516('0xe'));var authService=require(_0xa516('0xf'));var qs=require(_0xa516('0x10'));var as=require(_0xa516('0x11'));var hardwareService=require(_0xa516('0x12'));var logger=require(_0xa516('0x13'))('api');var utils=require(_0xa516('0x14'));var config=require(_0xa516('0x15'));var licenseUtil=require(_0xa516('0x16'));var db=require(_0xa516('0x17'))['db'];var dbH=require(_0xa516('0x17'))['dbH'];function respondWithStatusCode(_0x1c0c43,_0x12be07){_0x12be07=_0x12be07||0xcc;return function(_0x278920){if(_0x278920){return _0x1c0c43[_0xa516('0x18')](_0x12be07);}return _0x1c0c43[_0xa516('0x19')](_0x12be07)['end']();};}function respondWithResult(_0x4f3a33,_0x25e651){_0x25e651=_0x25e651||0xc8;return function(_0x53d273){if(_0x53d273){return _0x4f3a33['status'](_0x25e651)[_0xa516('0x1a')](_0x53d273);}};}function respondWithFilteredResult(_0x42debc,_0xfb5197){return function(_0x3ba1e2){if(_0x3ba1e2){var _0xe1bc58=typeof _0xfb5197[_0xa516('0x1b')]===_0xa516('0x1c')&&typeof _0xfb5197[_0xa516('0x1d')]===_0xa516('0x1c');var _0x47fd14=_0x3ba1e2[_0xa516('0x1e')];var _0x79d1cc=_0xe1bc58?0x0:_0xfb5197[_0xa516('0x1b')];var _0x587ac9=_0xe1bc58?_0x3ba1e2['count']:_0xfb5197[_0xa516('0x1b')]+_0xfb5197[_0xa516('0x1d')];var _0x62107;if(_0x587ac9>=_0x47fd14){_0x587ac9=_0x47fd14;_0x62107=0xc8;}else{_0x62107=0xce;}_0x42debc[_0xa516('0x19')](_0x62107);return _0x42debc['set'](_0xa516('0x1f'),_0x79d1cc+'-'+_0x587ac9+'/'+_0x47fd14)[_0xa516('0x1a')](_0x3ba1e2);}return null;};}function patchUpdates(_0x45b240){return function(_0x68fbe7){try{jsonpatch[_0xa516('0x20')](_0x68fbe7,_0x45b240,!![]);}catch(_0x35dae6){return BPromise[_0xa516('0x21')](_0x35dae6);}return _0x68fbe7[_0xa516('0x22')]();};}function saveUpdates(_0x1ffe5f,_0x277600){return function(_0x379231){if(_0x379231){return _0x379231['update'](_0x1ffe5f)[_0xa516('0x23')](function(_0x95f496){return _0x95f496;});}return null;};}function removeEntity(_0xfa4b76,_0x2d9be6){return function(_0x7802dc){if(_0x7802dc){return _0x7802dc[_0xa516('0x24')]()[_0xa516('0x23')](function(){var _0x5e450a=_0x7802dc[_0xa516('0x25')]({'plain':!![]});var _0x32a37=_0xa516('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x32a37,'resourceId':_0x5e450a['id']}})['then'](function(){return _0x7802dc;});})[_0xa516('0x23')](function(){_0xfa4b76[_0xa516('0x19')](0xcc)[_0xa516('0x27')]();});}};}function handleEntityNotFound(_0x22534f,_0xf37ea9){return function(_0x22837e){if(!_0x22837e){_0x22534f['sendStatus'](0x194);}return _0x22837e;};}function handleError(_0x397104,_0xca3c83){_0xca3c83=_0xca3c83||0x1f4;return function(_0x190cf0){logger[_0xa516('0x28')](_0x190cf0[_0xa516('0x29')]);if(_0x190cf0[_0xa516('0x2a')]){delete _0x190cf0[_0xa516('0x2a')];}_0x397104[_0xa516('0x19')](_0xca3c83)[_0xa516('0x2b')](_0x190cf0);};}exports[_0xa516('0x2c')]=function(_0x274f0b,_0x2f0c0e){var _0x334242={},_0x3d00e6={},_0x74a78f={'count':0x0,'rows':[]};var _0x5a438f=_[_0xa516('0x2d')](db[_0xa516('0x2e')][_0xa516('0x2f')],function(_0x3fd4ec){return{'name':_0x3fd4ec['fieldName'],'type':_0x3fd4ec[_0xa516('0x30')][_0xa516('0x31')]};});_0x3d00e6[_0xa516('0x32')]=_[_0xa516('0x2d')](_0x5a438f,'name');_0x3d00e6[_0xa516('0x33')]=_[_0xa516('0x34')](_0x274f0b['query']);_0x3d00e6[_0xa516('0x35')]=_['intersection'](_0x3d00e6[_0xa516('0x32')],_0x3d00e6[_0xa516('0x33')]);_0x334242[_0xa516('0x36')]=_['intersection'](_0x3d00e6[_0xa516('0x32')],qs['fields'](_0x274f0b['query'][_0xa516('0x37')]));_0x334242[_0xa516('0x36')]=_0x334242[_0xa516('0x36')][_0xa516('0x38')]?_0x334242[_0xa516('0x36')]:_0x3d00e6[_0xa516('0x32')];if(!_0x274f0b[_0xa516('0x33')][_0xa516('0x39')](_0xa516('0x3a'))){_0x334242[_0xa516('0x1d')]=qs[_0xa516('0x1d')](_0x274f0b[_0xa516('0x33')][_0xa516('0x1d')]);_0x334242['offset']=qs[_0xa516('0x1b')](_0x274f0b[_0xa516('0x33')]['offset']);}_0x334242[_0xa516('0x3b')]=qs[_0xa516('0x3c')](_0x274f0b[_0xa516('0x33')][_0xa516('0x3c')]);_0x334242['where']=qs['filters'](_[_0xa516('0x3d')](_0x274f0b['query'],_0x3d00e6['filters']),_0x5a438f);if(_0x274f0b['query'][_0xa516('0x3e')]){_0x334242['where']=_[_0xa516('0x3f')](_0x334242[_0xa516('0x40')],{'$or':_[_0xa516('0x2d')](_0x5a438f,function(_0x4152b0){if(_0x4152b0['type']!==_0xa516('0x41')){var _0x387cba={};_0x387cba[_0x4152b0[_0xa516('0x2a')]]={'$like':'%'+_0x274f0b[_0xa516('0x33')][_0xa516('0x3e')]+'%'};return _0x387cba;}})});}_0x334242=_[_0xa516('0x3f')]({},_0x334242,_0x274f0b[_0xa516('0x42')]);var _0xe43565={'where':_0x334242['where']};return db[_0xa516('0x2e')]['count'](_0xe43565)[_0xa516('0x23')](function(_0x2d5064){_0x74a78f[_0xa516('0x1e')]=_0x2d5064;if(_0x274f0b[_0xa516('0x33')]['includeAll']){_0x334242[_0xa516('0x43')]=[{'all':!![]}];}return db[_0xa516('0x2e')][_0xa516('0x44')](_0x334242);})[_0xa516('0x23')](function(_0xab09d){_0x74a78f['rows']=_0xab09d;return _0x74a78f;})[_0xa516('0x23')](respondWithFilteredResult(_0x2f0c0e,_0x334242))[_0xa516('0x45')](handleError(_0x2f0c0e,null));};exports[_0xa516('0x46')]=function(_0x48c9d5,_0x2d4201){var _0x481e66={'raw':![],'where':{'id':_0x48c9d5[_0xa516('0x47')]['id']}},_0x3b6eb1={};_0x3b6eb1[_0xa516('0x32')]=_[_0xa516('0x34')](db['AnalyticCustomReport'][_0xa516('0x2f')]);_0x3b6eb1['query']=_[_0xa516('0x34')](_0x48c9d5[_0xa516('0x33')]);_0x3b6eb1[_0xa516('0x35')]=_[_0xa516('0x48')](_0x3b6eb1[_0xa516('0x32')],_0x3b6eb1['query']);_0x481e66[_0xa516('0x36')]=_['intersection'](_0x3b6eb1[_0xa516('0x32')],qs['fields'](_0x48c9d5[_0xa516('0x33')][_0xa516('0x37')]));_0x481e66[_0xa516('0x36')]=_0x481e66[_0xa516('0x36')]['length']?_0x481e66[_0xa516('0x36')]:_0x3b6eb1[_0xa516('0x32')];if(_0x48c9d5[_0xa516('0x33')][_0xa516('0x49')]){_0x481e66['include']=[{'all':!![]}];}_0x481e66=_['merge']({},_0x481e66,_0x48c9d5[_0xa516('0x42')]);return db['AnalyticCustomReport'][_0xa516('0x4a')](_0x481e66)[_0xa516('0x23')](handleEntityNotFound(_0x2d4201,null))[_0xa516('0x23')](respondWithResult(_0x2d4201,null))[_0xa516('0x45')](handleError(_0x2d4201,null));};exports[_0xa516('0x4b')]=function(_0x549de5,_0x265ffd){return db['AnalyticCustomReport'][_0xa516('0x4b')](_0x549de5[_0xa516('0x4c')],{})[_0xa516('0x23')](function(_0x391980){var _0x59008c=_0x549de5[_0xa516('0x4d')][_0xa516('0x25')]({'plain':!![]});if(!_0x59008c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59008c[_0xa516('0x4e')]===_0xa516('0x4d')){var _0x4df298=_0x391980['get']({'plain':!![]});var _0x2c49b3=_0xa516('0x4f');return db[_0xa516('0x50')][_0xa516('0x4a')]({'where':{'name':_0x2c49b3,'userProfileId':_0x59008c[_0xa516('0x51')]},'raw':!![]})['then'](function(_0x10eefc){if(_0x10eefc&&_0x10eefc[_0xa516('0x52')]===0x0){return db[_0xa516('0x53')]['create']({'name':_0x4df298[_0xa516('0x2a')],'resourceId':_0x4df298['id'],'type':_0xa516('0x26'),'sectionId':_0x10eefc['id']},{})[_0xa516('0x23')](function(){return _0x391980;});}else{return _0x391980;}})[_0xa516('0x45')](function(_0x487d5a){logger[_0xa516('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x487d5a);throw _0x487d5a;});}return _0x391980;})[_0xa516('0x23')](respondWithResult(_0x265ffd,0xc9))['catch'](handleError(_0x265ffd,null));};exports[_0xa516('0x54')]=function(_0x4d2413,_0x2ac017){if(_0x4d2413[_0xa516('0x4c')]['id']){delete _0x4d2413['body']['id'];}return db[_0xa516('0x2e')][_0xa516('0x4a')]({'where':{'id':_0x4d2413['params']['id']}})[_0xa516('0x23')](handleEntityNotFound(_0x2ac017,null))[_0xa516('0x23')](saveUpdates(_0x4d2413['body'],null))['then'](respondWithResult(_0x2ac017,null))[_0xa516('0x45')](handleError(_0x2ac017,null));};exports[_0xa516('0x24')]=function(_0x541a46,_0x3f1340){return db['AnalyticCustomReport'][_0xa516('0x4a')]({'where':{'id':_0x541a46[_0xa516('0x47')]['id']}})[_0xa516('0x23')](handleEntityNotFound(_0x3f1340,null))[_0xa516('0x23')](removeEntity(_0x3f1340,null))[_0xa516('0x45')](handleError(_0x3f1340,null));};exports[_0xa516('0x55')]=function(_0x3c1951,_0x4a3ad4){var _0x14b187=0xa;var _0x11d824=[_0xa516('0x56'),'left_join',_0xa516('0x57'),_0xa516('0x58')];var _0x59f100={'SUM':'SUM(%s)','COUNT':_0xa516('0x59'),'COUNT DISTINCT':_0xa516('0x5a'),'MAX':_0xa516('0x5b'),'MIN':_0xa516('0x5c'),'AVG':_0xa516('0x5d'),'GROUP_CONCAT':_0xa516('0x5e'),'GROUP_CONCAT ASC':_0xa516('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2bde14={'SEC_TO_TIME':_0xa516('0x60'),'DATE':_0xa516('0x61'),'HOUR':_0xa516('0x62'),'ROUND':_0xa516('0x63'),'UNIX_TIMESTAMP':_0xa516('0x64')};var _0x3f74b7=function(_0x3ddc10){return!_[_0xa516('0x65')]([_0xa516('0x66'),_0xa516('0x67'),_0xa516('0x68'),_0xa516('0x69')],_0x3ddc10);};var _0x321b63=function(_0x1e29d7){if(!_0x1e29d7||!_0x1e29d7[_0xa516('0x6a')]['length']){return'';}for(var _0x502a3b='(',_0x1fac8f=0x0;_0x1fac8f<_0x1e29d7[_0xa516('0x6a')][_0xa516('0x38')];_0x1fac8f+=0x1){_0x1fac8f>0x0&&(_0x502a3b+='\x20'+_0x1e29d7['operator']+'\x20');_0x502a3b+=_0x1e29d7[_0xa516('0x6a')][_0x1fac8f]['group']?_0x321b63(_0x1e29d7[_0xa516('0x6a')][_0x1fac8f]['group']):_0x1e29d7[_0xa516('0x6a')][_0x1fac8f][_0xa516('0x6b')]+'\x20'+_0x1e29d7[_0xa516('0x6a')][_0x1fac8f][_0xa516('0x6c')]+(_0x3f74b7(_0x1e29d7[_0xa516('0x6a')][_0x1fac8f][_0xa516('0x6c')])?'\x20'+_0x1e29d7[_0xa516('0x6a')][_0x1fac8f][_0xa516('0x6d')]:'');}return _0x502a3b+')';};var _0x3bebfa={'where':{'id':_0x3c1951[_0xa516('0x47')]['id']}},_0x5396b8,_0x19fe18,_0x11e598,_0x100c82,_0x28754f;_0x3bebfa=_['merge']({},_0x3bebfa,_0x3c1951[_0xa516('0x42')]);return db[_0xa516('0x2e')][_0xa516('0x4a')](_0x3bebfa)['then'](function(_0x3d5346){if(_0x3d5346){_0x5396b8=_0x3d5346;return _0x3d5346['getFields']();}return null;})[_0xa516('0x23')](function(_0x22d56c){if(_0x22d56c){if(!_0x22d56c[_0xa516('0x38')]){throw new db['Sequelize'][(_0xa516('0x6e'))](_0xa516('0x6f'),0x193);}_0x19fe18=_0x22d56c;return db[_0xa516('0x70')][_0xa516('0x44')]({'raw':!![]});}return null;})[_0xa516('0x23')](function(_0x9a7174){if(_0x9a7174){_0x11e598=_['keyBy'](_0x9a7174,'id');var _0x34f6a7;var _0x2f978a=squel['select']();_0x2f978a['from'](_0x5396b8[_0xa516('0x71')]);for(var _0x3fa5a2=0x0;_0x3fa5a2<_0x19fe18[_0xa516('0x38')];_0x3fa5a2+=0x1){_0x34f6a7=_0x19fe18[_0x3fa5a2][_0xa516('0x72')]?_0x11e598[_0x19fe18[_0x3fa5a2]['MetricId']][_0xa516('0x73')]:_0x19fe18[_0x3fa5a2][_0xa516('0x6b')];_0x34f6a7=_0x19fe18[_0x3fa5a2]['function']?_['replace'](_0x59f100[_0x19fe18[_0x3fa5a2][_0xa516('0x74')]],'%s',_0x34f6a7):_0x34f6a7;_0x34f6a7=_0x19fe18[_0x3fa5a2][_0xa516('0x75')]?_[_0xa516('0x76')](_0x2bde14[_0x19fe18[_0x3fa5a2]['format']],'%s',_0x34f6a7):_0x34f6a7;if(_0x19fe18[_0x3fa5a2][_0xa516('0x77')]){_0x2f978a[_0xa516('0x78')](_0x34f6a7);}_0x19fe18[_0x3fa5a2][_0xa516('0x79')]&&_0x2f978a['order'](_0x34f6a7,_0x19fe18[_0x3fa5a2][_0xa516('0x79')]===_0xa516('0x7a')?![]:!![]);_0x2f978a['field'](_0x34f6a7,_0x19fe18[_0x3fa5a2][_0xa516('0x7b')]||_0x34f6a7);}if(_0x5396b8[_0xa516('0x7c')]){_0x5396b8[_0xa516('0x7c')]=JSON[_0xa516('0x7d')](_0x5396b8[_0xa516('0x7c')]);for(var _0x18f2ba=0x0;_0x18f2ba<_0x5396b8[_0xa516('0x7c')][_0xa516('0x38')];_0x18f2ba+=0x1){if(_0x5396b8[_0xa516('0x7c')][_0x18f2ba][_0xa516('0x30')]&&_[_0xa516('0x65')](_0x11d824,_0x5396b8[_0xa516('0x7c')][_0x18f2ba][_0xa516('0x30')])&&_0x5396b8[_0xa516('0x7c')][_0x18f2ba]['parentKey']&&_0x5396b8[_0xa516('0x7c')][_0x18f2ba]['foreignTable']&&_0x5396b8[_0xa516('0x7c')][_0x18f2ba][_0xa516('0x7e')]){_0x2f978a[_0x5396b8[_0xa516('0x7c')][_0x18f2ba][_0xa516('0x30')]](_0x5396b8[_0xa516('0x7c')][_0x18f2ba]['foreignTable'],null,util[_0xa516('0x75')](_0xa516('0x7f'),_0x5396b8[_0xa516('0x71')],_0x5396b8[_0xa516('0x7c')][_0x18f2ba]['parentKey'],_0x5396b8['joins'][_0x18f2ba][_0xa516('0x80')],_0x5396b8['joins'][_0x18f2ba]['foreignKey']));}}}if(_0x5396b8[_0xa516('0x81')]){_0x5396b8[_0xa516('0x81')]=JSON[_0xa516('0x7d')](_0x5396b8['conditions']);_0x2f978a[_0xa516('0x40')](_0x321b63(_0x5396b8['conditions'][_0xa516('0x78')]));}_0x28754f=_0x2f978a['clone']();_0x2f978a[_0xa516('0x1d')](_0x14b187);_0x2f978a[_0xa516('0x1b')](0x0);logger[_0xa516('0x82')](_0xa516('0x83'),_0x2f978a[_0xa516('0x84')]());return dbH[_0xa516('0x85')]['query'](_0x2f978a['toString'](),{'type':dbH[_0xa516('0x85')]['QueryTypes'][_0xa516('0x86')]});}})[_0xa516('0x23')](respondWithResult(_0x4a3ad4,null))[_0xa516('0x45')](handleError(_0x4a3ad4,null));};function runReport(_0x5788e1,_0x360e25,_0x45cf6e){var _0x5cb4d=_0x360e25['name'];var _0x2dc04f=0xa;var _0x3ec37b=['join',_0xa516('0x87'),'right_join','cross_join'];var _0x59384a={'SUM':_0xa516('0x88'),'COUNT':_0xa516('0x59'),'COUNT DISTINCT':_0xa516('0x5a'),'MAX':_0xa516('0x5b'),'MIN':_0xa516('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa516('0x5e'),'GROUP_CONCAT ASC':_0xa516('0x5f'),'GROUP_CONCAT DESC':_0xa516('0x89')};var _0x26f40d={'SEC_TO_TIME':_0xa516('0x60'),'DATE':'DATE(%s)','HOUR':_0xa516('0x62'),'ROUND':_0xa516('0x63'),'UNIX_TIMESTAMP':_0xa516('0x64')};var _0x500d79=function(_0x3f5911){return!_[_0xa516('0x65')]([_0xa516('0x66'),_0xa516('0x67'),_0xa516('0x68'),_0xa516('0x69')],_0x3f5911);};var _0x25e1cd=function(_0x137c34){if(!_0x137c34||!_0x137c34[_0xa516('0x6a')]['length']){return'';}for(var _0xc44083='(',_0x106d63=0x0;_0x106d63<_0x137c34[_0xa516('0x6a')][_0xa516('0x38')];_0x106d63+=0x1){_0x106d63>0x0&&(_0xc44083+='\x20'+_0x137c34[_0xa516('0x8a')]+'\x20');_0xc44083+=_0x137c34[_0xa516('0x6a')][_0x106d63]['group']?_0x25e1cd(_0x137c34[_0xa516('0x6a')][_0x106d63][_0xa516('0x78')]):_0x137c34['rules'][_0x106d63]['field']+'\x20'+_0x137c34[_0xa516('0x6a')][_0x106d63][_0xa516('0x6c')]+(_0x500d79(_0x137c34['rules'][_0x106d63][_0xa516('0x6c')])?'\x20'+_0x137c34['rules'][_0x106d63][_0xa516('0x6d')]:'');}return _0xc44083+')';};var _0x28cc3c={'where':{'id':_0x5788e1['id']}},_0xb23dce,_0x5662cc,_0x256765,_0x43cc8e,_0x1cad4e;_0x28cc3c=_[_0xa516('0x3f')]({},_0x28cc3c,_0x45cf6e);return db[_0xa516('0x2e')][_0xa516('0x4a')](_0x28cc3c)[_0xa516('0x23')](function(_0x5eed33){if(_0x5eed33){_0xb23dce=_0x5eed33;return _0x5eed33['getFields']();}return null;})[_0xa516('0x23')](function(_0xaafb95){if(_0xaafb95){if(!_0xaafb95[_0xa516('0x38')]){throw new db['Sequelize'][(_0xa516('0x6e'))](_0xa516('0x6f'),0x193);}_0x5662cc=_0xaafb95;return db[_0xa516('0x70')]['findAll']({'raw':!![]});}return null;})[_0xa516('0x23')](function(_0x951bc3){if(_0x951bc3){_0x256765=_[_0xa516('0x8b')](_0x951bc3,'id');var _0x80be84;var _0x522753=squel[_0xa516('0x8c')]();_0x522753[_0xa516('0x8d')](_0xb23dce[_0xa516('0x71')]);for(var _0x236582=0x0;_0x236582<_0x5662cc[_0xa516('0x38')];_0x236582+=0x1){_0x80be84=_0x5662cc[_0x236582]['MetricId']?_0x256765[_0x5662cc[_0x236582][_0xa516('0x72')]][_0xa516('0x73')]:_0x5662cc[_0x236582][_0xa516('0x6b')];_0x80be84=_0x5662cc[_0x236582][_0xa516('0x74')]?_['replace'](_0x59384a[_0x5662cc[_0x236582][_0xa516('0x74')]],'%s',_0x80be84):_0x80be84;_0x80be84=_0x5662cc[_0x236582][_0xa516('0x75')]?_[_0xa516('0x76')](_0x26f40d[_0x5662cc[_0x236582][_0xa516('0x75')]],'%s',_0x80be84):_0x80be84;if(_0x5662cc[_0x236582]['groupBy']){_0x522753['group'](_0x80be84);}_0x5662cc[_0x236582][_0xa516('0x79')]&&_0x522753['order'](_0x80be84,_0x5662cc[_0x236582][_0xa516('0x79')]===_0xa516('0x7a')?![]:!![]);_0x522753['field'](_0x80be84,_0x5662cc[_0x236582][_0xa516('0x7b')]||_0x80be84);}if(_0xb23dce[_0xa516('0x7c')]){_0xb23dce[_0xa516('0x7c')]=JSON[_0xa516('0x7d')](_0xb23dce[_0xa516('0x7c')]);for(var _0x138265=0x0;_0x138265<_0xb23dce['joins'][_0xa516('0x38')];_0x138265+=0x1){if(_0xb23dce['joins'][_0x138265][_0xa516('0x30')]&&_[_0xa516('0x65')](_0x3ec37b,_0xb23dce['joins'][_0x138265][_0xa516('0x30')])&&_0xb23dce['joins'][_0x138265][_0xa516('0x8e')]&&_0xb23dce[_0xa516('0x7c')][_0x138265]['foreignTable']&&_0xb23dce[_0xa516('0x7c')][_0x138265][_0xa516('0x7e')]){_0x522753[_0xb23dce['joins'][_0x138265][_0xa516('0x30')]](_0xb23dce[_0xa516('0x7c')][_0x138265]['foreignTable'],null,util[_0xa516('0x75')]('%s.%s\x20=\x20%s.%s',_0xb23dce['table'],_0xb23dce[_0xa516('0x7c')][_0x138265]['parentKey'],_0xb23dce[_0xa516('0x7c')][_0x138265][_0xa516('0x80')],_0xb23dce[_0xa516('0x7c')][_0x138265][_0xa516('0x7e')]));}}}if(_0xb23dce[_0xa516('0x81')]){_0xb23dce[_0xa516('0x81')]=JSON['parse'](_0xb23dce['conditions']);_0x522753['where'](_0x25e1cd(_0xb23dce[_0xa516('0x81')][_0xa516('0x78')]));}_0x1cad4e=_0x522753[_0xa516('0x8f')]();_0x522753['limit'](_0x2dc04f);_0x522753[_0xa516('0x1b')](0x0);return;}})[_0xa516('0x23')](function(){if(_0x360e25[_0xa516('0x90')]===_0xa516('0x91')){return null;}var _0x5e87ba=_[_0xa516('0x3f')](_0x360e25,{'name':_0x360e25[_0xa516('0x92')]||_0x360e25['name']||_0xb23dce[_0xa516('0x2a')],'basename':_0x5cb4d,'savename':util[_0xa516('0x75')](_0xa516('0x93'),_0x360e25[_0xa516('0x2a')]||_0xb23dce[_0xa516('0x2a')],require(_0xa516('0x94'))['generate'](0x4),_0x360e25['output']||_0xa516('0x95')),'reportId':_0xb23dce['id'],'reportType':'custom'});return db[_0xa516('0x96')][_0xa516('0x4b')](_0x5e87ba,{'raw':!![]});})[_0xa516('0x23')](function(_0x33775d){if(_0xb23dce[_0xa516('0x71')]===_0xa516('0x97')){_0x1cad4e['where'](_0xb23dce[_0xa516('0x71')]+_0xa516('0x98'),_0x360e25[_0xa516('0x99')],_0x360e25[_0xa516('0x9a')]);}else{_0x1cad4e[_0xa516('0x40')](_0xb23dce[_0xa516('0x71')]+_0xa516('0x9b'),_0x360e25[_0xa516('0x99')],_0x360e25[_0xa516('0x9a')]);}if(_0x33775d){logger['info'](_0xa516('0x9c'),_0x1cad4e[_0xa516('0x84')]());require('child_process')[_0xa516('0x9d')](path[_0xa516('0x56')](__dirname,_0xa516('0x9e'),_0x33775d[_0xa516('0x90')]),[_0x33775d['id'],_0x1cad4e[_0xa516('0x84')](),path[_0xa516('0x56')](__dirname,'../../files/reports',_0x33775d[_0xa516('0x9f')]),_0x5cb4d]);return _0x33775d;}else{var _0x5beba4=squel['select']();_0x5beba4['from']('('+_0x1cad4e[_0xa516('0x84')]()+')',_0xa516('0xa0'));_0x5beba4[_0xa516('0x6b')](_0xa516('0xa1'),_0xa516('0x1e'));_0x1cad4e[_0xa516('0x1d')](_0x360e25[_0xa516('0x1d')]||_0x2dc04f);_0x1cad4e[_0xa516('0x1b')](_0x360e25['offset']||0x0);return dbH[_0xa516('0x85')][_0xa516('0x33')](_0x5beba4[_0xa516('0x84')](),{'type':dbH[_0xa516('0x85')][_0xa516('0xa2')][_0xa516('0x86')]})[_0xa516('0x23')](function(_0x54c327){if(!_0x54c327[_0xa516('0x38')]){_0x43cc8e=0x0;}else{_0x43cc8e=_0x54c327[0x0][_0xa516('0x1e')]||0x0;}return dbH[_0xa516('0x85')][_0xa516('0x33')](_0x1cad4e[_0xa516('0x84')](),{'type':dbH['sequelize'][_0xa516('0xa2')][_0xa516('0x86')]});})[_0xa516('0x23')](function(_0x554dcf){return{'rows':_0x554dcf||[],'count':_0x43cc8e};});}});}exports[_0xa516('0xa3')]=function(_0x168934,_0x5bccfe){return runReport(_0x168934[_0xa516('0x47')],_0x168934[_0xa516('0x33')],_0x168934['options'])[_0xa516('0x23')](respondWithResult(_0x5bccfe,null))[_0xa516('0x45')](handleError(_0x5bccfe,null));};exports[_0xa516('0xa4')]=runReport;exports['query']=function(_0x3e0c50,_0x220819){var _0x1c9290=0xa;var _0x5cc70f=[_0xa516('0x56'),_0xa516('0x87'),'right_join',_0xa516('0x58')];var _0x4e70d8={'SUM':_0xa516('0x88'),'COUNT':_0xa516('0x59'),'COUNT DISTINCT':_0xa516('0x5a'),'MAX':_0xa516('0x5b'),'MIN':_0xa516('0x5c'),'AVG':_0xa516('0x5d'),'GROUP_CONCAT':_0xa516('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa516('0x89')};var _0x469bf1={'SEC_TO_TIME':_0xa516('0x60'),'DATE':_0xa516('0x61'),'HOUR':_0xa516('0x62'),'ROUND':_0xa516('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x30fcc=function(_0x505fba){return!_[_0xa516('0x65')]([_0xa516('0x66'),_0xa516('0x67'),_0xa516('0x68'),_0xa516('0x69')],_0x505fba);};var _0x32eba8=function(_0x3e8fb5){if(!_0x3e8fb5||!_0x3e8fb5[_0xa516('0x6a')]['length']){return'';}for(var _0x4c7e37='(',_0x2c956c=0x0;_0x2c956c<_0x3e8fb5['rules'][_0xa516('0x38')];_0x2c956c+=0x1){_0x2c956c>0x0&&(_0x4c7e37+='\x20'+_0x3e8fb5['operator']+'\x20');_0x4c7e37+=_0x3e8fb5[_0xa516('0x6a')][_0x2c956c][_0xa516('0x78')]?_0x32eba8(_0x3e8fb5[_0xa516('0x6a')][_0x2c956c]['group']):_0x3e8fb5[_0xa516('0x6a')][_0x2c956c][_0xa516('0x6b')]+'\x20'+_0x3e8fb5[_0xa516('0x6a')][_0x2c956c][_0xa516('0x6c')]+(_0x30fcc(_0x3e8fb5[_0xa516('0x6a')][_0x2c956c][_0xa516('0x6c')])?'\x20'+_0x3e8fb5[_0xa516('0x6a')][_0x2c956c]['value']:'');}return _0x4c7e37+')';};var _0x227238={'where':{'id':_0x3e0c50['params']['id']}},_0x2af564,_0x4721ae,_0x25a02f,_0x5476c4,_0x4ce0ae;_0x227238=_[_0xa516('0x3f')]({},_0x227238,_0x3e0c50[_0xa516('0x42')]);return db[_0xa516('0x2e')][_0xa516('0x4a')](_0x227238)['then'](function(_0x1ef523){if(_0x1ef523){_0x2af564=_0x1ef523;return _0x1ef523[_0xa516('0xa5')]();}return null;})[_0xa516('0x23')](function(_0x27b5f1){if(_0x27b5f1){if(!_0x27b5f1[_0xa516('0x38')]){throw new db['Sequelize'][(_0xa516('0x6e'))](_0xa516('0x6f'),0x193);}_0x4721ae=_0x27b5f1;return db[_0xa516('0x70')]['findAll']({'raw':!![]});}return null;})[_0xa516('0x23')](function(_0x328df8){if(_0x328df8){_0x25a02f=_['keyBy'](_0x328df8,'id');var _0x453369;var _0x203aad=squel[_0xa516('0x8c')]();_0x203aad['from'](_0x2af564[_0xa516('0x71')]);for(var _0x12eb2e=0x0;_0x12eb2e<_0x4721ae[_0xa516('0x38')];_0x12eb2e+=0x1){_0x453369=_0x4721ae[_0x12eb2e][_0xa516('0x72')]?_0x25a02f[_0x4721ae[_0x12eb2e][_0xa516('0x72')]][_0xa516('0x73')]:_0x4721ae[_0x12eb2e][_0xa516('0x6b')];_0x453369=_0x4721ae[_0x12eb2e][_0xa516('0x74')]?_['replace'](_0x4e70d8[_0x4721ae[_0x12eb2e][_0xa516('0x74')]],'%s',_0x453369):_0x453369;_0x453369=_0x4721ae[_0x12eb2e][_0xa516('0x75')]?_[_0xa516('0x76')](_0x469bf1[_0x4721ae[_0x12eb2e]['format']],'%s',_0x453369):_0x453369;if(_0x4721ae[_0x12eb2e][_0xa516('0x77')]){_0x203aad[_0xa516('0x78')](_0x453369);}_0x4721ae[_0x12eb2e][_0xa516('0x79')]&&_0x203aad[_0xa516('0x3b')](_0x453369,_0x4721ae[_0x12eb2e][_0xa516('0x79')]===_0xa516('0x7a')?![]:!![]);_0x203aad[_0xa516('0x6b')](_0x453369,_0x4721ae[_0x12eb2e][_0xa516('0x7b')]||_0x453369);}if(_0x2af564['joins']){_0x2af564[_0xa516('0x7c')]=JSON[_0xa516('0x7d')](_0x2af564[_0xa516('0x7c')]);for(var _0x3d6f9b=0x0;_0x3d6f9b<_0x2af564[_0xa516('0x7c')]['length'];_0x3d6f9b+=0x1){if(_0x2af564[_0xa516('0x7c')][_0x3d6f9b][_0xa516('0x30')]&&_['includes'](_0x5cc70f,_0x2af564[_0xa516('0x7c')][_0x3d6f9b][_0xa516('0x30')])&&_0x2af564[_0xa516('0x7c')][_0x3d6f9b]['parentKey']&&_0x2af564[_0xa516('0x7c')][_0x3d6f9b]['foreignTable']&&_0x2af564[_0xa516('0x7c')][_0x3d6f9b][_0xa516('0x7e')]){_0x203aad[_0x2af564[_0xa516('0x7c')][_0x3d6f9b][_0xa516('0x30')]](_0x2af564[_0xa516('0x7c')][_0x3d6f9b][_0xa516('0x80')],null,util[_0xa516('0x75')]('%s.%s\x20=\x20%s.%s',_0x2af564['table'],_0x2af564['joins'][_0x3d6f9b][_0xa516('0x8e')],_0x2af564[_0xa516('0x7c')][_0x3d6f9b][_0xa516('0x80')],_0x2af564[_0xa516('0x7c')][_0x3d6f9b][_0xa516('0x7e')]));}}}if(_0x2af564[_0xa516('0x81')]){_0x2af564[_0xa516('0x81')]=JSON[_0xa516('0x7d')](_0x2af564[_0xa516('0x81')]);_0x203aad[_0xa516('0x40')](_0x32eba8(_0x2af564['conditions']['group']));}_0x4ce0ae=_0x203aad['clone']();_0x203aad[_0xa516('0x1d')](_0x1c9290);_0x203aad[_0xa516('0x1b')](0x0);logger['debug'](_0xa516('0x83'),_0x203aad[_0xa516('0x84')]());return dbH['sequelize']['query'](_0x203aad['toString'](),{'type':dbH[_0xa516('0x85')]['QueryTypes'][_0xa516('0x86')]});}})[_0xa516('0x23')](function(){return{'sql':_0x4ce0ae[_0xa516('0x84')]()};})[_0xa516('0x23')](respondWithResult(_0x220819,null))[_0xa516('0x45')](handleError(_0x220819,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index f41ab07..95f7a57 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 _0xa72b=['request-promise','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment'];(function(_0x40030f,_0x97cd95){var _0x31d4c5=function(_0xe9eef1){while(--_0xe9eef1){_0x40030f['push'](_0x40030f['shift']());}};_0x31d4c5(++_0x97cd95);}(_0xa72b,0xce));var _0xba72=function(_0x1f5763,_0x3ed2c8){_0x1f5763=_0x1f5763-0x0;var _0x221aa4=_0xa72b[_0x1f5763];return _0x221aa4;};'use strict';var _=require(_0xba72('0x0'));var util=require(_0xba72('0x1'));var logger=require('../../config/logger')(_0xba72('0x2'));var moment=require(_0xba72('0x3'));var BPromise=require('bluebird');var rp=require(_0xba72('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xba72('0x5'));var attributes=require(_0xba72('0x6'));module['exports']=function(_0x179bf3,_0x342769){return _0x179bf3[_0xba72('0x7')](_0xba72('0x8'),attributes,{'tableName':_0xba72('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x240e=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x479215,_0x575606){var _0x4608a4=function(_0x1d20f8){while(--_0x1d20f8){_0x479215['push'](_0x479215['shift']());}};_0x4608a4(++_0x575606);}(_0x240e,0x18f));var _0xe240=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x240e[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xe240('0x0'));var util=require(_0xe240('0x1'));var logger=require(_0xe240('0x2'))(_0xe240('0x3'));var moment=require(_0xe240('0x4'));var BPromise=require(_0xe240('0x5'));var rp=require(_0xe240('0x6'));var fs=require('fs');var path=require(_0xe240('0x7'));var rimraf=require(_0xe240('0x8'));var config=require(_0xe240('0x9'));var attributes=require(_0xe240('0xa'));module[_0xe240('0xb')]=function(_0x30f120,_0x1205db){return _0x30f120[_0xe240('0xc')](_0xe240('0xd'),attributes,{'tableName':_0xe240('0xe'),'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 3f55c0a..288ef8f 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 _0x5add=['../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4f5b11,_0x41741e){var _0x2ec258=function(_0x523247){while(--_0x523247){_0x4f5b11['push'](_0x4f5b11['shift']());}};_0x2ec258(++_0x41741e);}(_0x5add,0x1e8));var _0xd5ad=function(_0x634b8e,_0x4840e9){_0x634b8e=_0x634b8e-0x0;var _0x35f155=_0x5add[_0x634b8e];return _0x35f155;};'use strict';var _=require(_0xd5ad('0x0'));var util=require('util');var moment=require(_0xd5ad('0x1'));var BPromise=require(_0xd5ad('0x2'));var rs=require(_0xd5ad('0x3'));var fs=require('fs');var Redis=require(_0xd5ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5ad('0x5'));var logger=require(_0xd5ad('0x6'))(_0xd5ad('0x7'));var config=require('../../config/environment');var jayson=require(_0xd5ad('0x8'));var client=jayson[_0xd5ad('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38f717,_0x5c33c8,_0x171f16){return new BPromise(function(_0xf3796d,_0x4903a8){return client[_0xd5ad('0xa')](_0x38f717,_0x171f16)[_0xd5ad('0xb')](function(_0x2eb269){logger[_0xd5ad('0xc')](_0xd5ad('0xd'),_0x5c33c8,_0xd5ad('0xe'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5c33c8,_0xd5ad('0xe'),JSON[_0xd5ad('0xf')](_0x2eb269));if(_0x2eb269[_0xd5ad('0x10')]){if(_0x2eb269[_0xd5ad('0x10')][_0xd5ad('0x11')]===0x1f4){logger[_0xd5ad('0x10')](_0xd5ad('0xd'),_0x5c33c8,_0x2eb269['error']['message']);return _0x4903a8(_0x2eb269[_0xd5ad('0x10')][_0xd5ad('0x12')]);}logger[_0xd5ad('0x10')](_0xd5ad('0xd'),_0x5c33c8,_0x2eb269[_0xd5ad('0x10')][_0xd5ad('0x12')]);return _0xf3796d(_0x2eb269[_0xd5ad('0x10')][_0xd5ad('0x12')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x5c33c8,_0xd5ad('0xe'));_0xf3796d(_0x2eb269['result'][_0xd5ad('0x12')]);}})['catch'](function(_0x2ca78d){logger[_0xd5ad('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5c33c8,_0x2ca78d);_0x4903a8(_0x2ca78d);});});}
\ No newline at end of file
+var _0x9892=['client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x1d3b9d,_0xdd459c){var _0x5caef6=function(_0x43283b){while(--_0x43283b){_0x1d3b9d['push'](_0x1d3b9d['shift']());}};_0x5caef6(++_0xdd459c);}(_0x9892,0xfd));var _0x2989=function(_0x431361,_0x7457e1){_0x431361=_0x431361-0x0;var _0x5d6f96=_0x9892[_0x431361];return _0x5d6f96;};'use strict';var _=require('lodash');var util=require(_0x2989('0x0'));var moment=require(_0x2989('0x1'));var BPromise=require(_0x2989('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2989('0x3'))['db'];var utils=require(_0x2989('0x4'));var logger=require('../../config/logger')(_0x2989('0x5'));var config=require('../../config/environment');var jayson=require(_0x2989('0x6'));var client=jayson[_0x2989('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41bd6e,_0x46228c,_0x1bfc7f){return new BPromise(function(_0x283f6a,_0x57d568){return client[_0x2989('0x8')](_0x41bd6e,_0x1bfc7f)[_0x2989('0x9')](function(_0x53156e){logger[_0x2989('0xa')](_0x2989('0xb'),_0x46228c,_0x2989('0xc'));logger[_0x2989('0xd')](_0x2989('0xe'),_0x46228c,'request\x20sent',JSON[_0x2989('0xf')](_0x53156e));if(_0x53156e[_0x2989('0x10')]){if(_0x53156e[_0x2989('0x10')][_0x2989('0x11')]===0x1f4){logger[_0x2989('0x10')](_0x2989('0xb'),_0x46228c,_0x53156e[_0x2989('0x10')]['message']);return _0x57d568(_0x53156e[_0x2989('0x10')][_0x2989('0x12')]);}logger[_0x2989('0x10')](_0x2989('0xb'),_0x46228c,_0x53156e[_0x2989('0x10')][_0x2989('0x12')]);return _0x283f6a(_0x53156e[_0x2989('0x10')][_0x2989('0x12')]);}else{logger[_0x2989('0xa')](_0x2989('0xb'),_0x46228c,_0x2989('0xc'));_0x283f6a(_0x53156e['result'][_0x2989('0x12')]);}})[_0x2989('0x13')](function(_0x45c2c6){logger['error'](_0x2989('0xb'),_0x46228c,_0x45c2c6);_0x57d568(_0x45c2c6);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index eeabd2d..f9c1f5d 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 _0xa092=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','delete','destroy'];(function(_0x1cb0dc,_0x264c1d){var _0x42db69=function(_0x503cf7){while(--_0x503cf7){_0x1cb0dc['push'](_0x1cb0dc['shift']());}};_0x42db69(++_0x264c1d);}(_0xa092,0x79));var _0x2a09=function(_0x1b1365,_0x205568){_0x1b1365=_0x1b1365-0x0;var _0x5edfd8=_0xa092[_0x1b1365];return _0x5edfd8;};'use strict';var multer=require('multer');var util=require(_0x2a09('0x0'));var path=require(_0x2a09('0x1'));var timeout=require(_0x2a09('0x2'));var express=require(_0x2a09('0x3'));var router=express[_0x2a09('0x4')]();var fs_extra=require(_0x2a09('0x5'));var auth=require(_0x2a09('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2a09('0x7'));var controller=require(_0x2a09('0x8'));router[_0x2a09('0x9')]('/',auth[_0x2a09('0xa')](),controller[_0x2a09('0xb')]);router[_0x2a09('0x9')](_0x2a09('0xc'),auth[_0x2a09('0xa')](),controller[_0x2a09('0xd')]);router[_0x2a09('0x9')](_0x2a09('0xe'),auth[_0x2a09('0xa')](),controller[_0x2a09('0xf')]);router[_0x2a09('0x9')](_0x2a09('0x10'),auth[_0x2a09('0xa')](),controller[_0x2a09('0x11')]);router[_0x2a09('0x9')](_0x2a09('0x12'),auth['isAuthenticated'](),controller[_0x2a09('0x13')]);router[_0x2a09('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x2a09('0xc'),auth[_0x2a09('0xa')](),controller['update']);router[_0x2a09('0x15')]('/:id',auth[_0x2a09('0xa')](),controller[_0x2a09('0x16')]);module[_0x2a09('0x17')]=router;
\ No newline at end of file
+var _0x7b34=['fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0x7b34,0x194));var _0x47b3=function(_0x38d78f,_0x4d4d40){_0x38d78f=_0x38d78f-0x0;var _0x13afad=_0x7b34[_0x38d78f];return _0x13afad;};'use strict';var multer=require(_0x47b3('0x0'));var util=require(_0x47b3('0x1'));var path=require(_0x47b3('0x2'));var timeout=require('connect-timeout');var express=require(_0x47b3('0x3'));var router=express['Router']();var fs_extra=require(_0x47b3('0x4'));var auth=require(_0x47b3('0x5'));var interaction=require(_0x47b3('0x6'));var config=require('../../config/environment');var controller=require(_0x47b3('0x7'));router[_0x47b3('0x8')]('/',auth[_0x47b3('0x9')](),controller[_0x47b3('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x47b3('0xb')]);router[_0x47b3('0x8')](_0x47b3('0xc'),auth[_0x47b3('0x9')](),controller['preview']);router[_0x47b3('0x8')](_0x47b3('0xd'),auth[_0x47b3('0x9')](),controller[_0x47b3('0xe')]);router[_0x47b3('0x8')](_0x47b3('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x47b3('0x10')]('/',auth[_0x47b3('0x9')](),controller[_0x47b3('0x11')]);router[_0x47b3('0x12')]('/:id',auth[_0x47b3('0x9')](),controller[_0x47b3('0x13')]);router[_0x47b3('0x14')](_0x47b3('0x15'),auth[_0x47b3('0x9')](),controller[_0x47b3('0x16')]);module[_0x47b3('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 63b5f33..31f4bab 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 _0x24ca=['sequelize','STRING','TEXT'];(function(_0x27999e,_0x1cbbd2){var _0x19498d=function(_0x2bd9ab){while(--_0x2bd9ab){_0x27999e['push'](_0x27999e['shift']());}};_0x19498d(++_0x1cbbd2);}(_0x24ca,0x1bc));var _0xa24c=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0x24ca[_0x22431e];return _0xd978e9;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
+var _0x7fbe=['STRING','TEXT'];(function(_0x4421b5,_0x13d0f6){var _0x26cca3=function(_0x295016){while(--_0x295016){_0x4421b5['push'](_0x4421b5['shift']());}};_0x26cca3(++_0x13d0f6);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x12e1fa,_0x2da3b8){_0x12e1fa=_0x12e1fa-0x0;var _0x498b71=_0x7fbe[_0x12e1fa];return _0x498b71;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 30db908..a3a6015 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 _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x3d7562,_0x36eb1e){var _0x276c53=function(_0x376feb){while(--_0x376feb){_0x3d7562['push'](_0x3d7562['shift']());}};_0x276c53(++_0x36eb1e);}(_0x53ec,0x192));var _0xc53e=function(_0x641f18,_0x2919e8){_0x641f18=_0x641f18-0x0;var _0x16eefe=_0x53ec[_0x641f18];return _0x16eefe;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
+var _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x4cd57d,_0x4fa3f9){var _0xb0430a=function(_0x452f0c){while(--_0x452f0c){_0x4cd57d['push'](_0x4cd57d['shift']());}};_0xb0430a(++_0x4fa3f9);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x3176e2,_0x272935){_0x3176e2=_0x3176e2-0x0;var _0x4622bf=_0x3f8a[_0x3176e2];return _0x4622bf;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 599306f..f1cedd8 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 _0xe14f=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x503641,_0x33a3cf){var _0x17757d=function(_0xc2ba4e){while(--_0xc2ba4e){_0x503641['push'](_0x503641['shift']());}};_0x17757d(++_0x33a3cf);}(_0xe14f,0x160));var _0xfe14=function(_0x517da2,_0x3be777){_0x517da2=_0x517da2-0x0;var _0x2c1acc=_0xe14f[_0x517da2];return _0x2c1acc;};'use strict';var _=require(_0xfe14('0x0'));var util=require(_0xfe14('0x1'));var logger=require(_0xfe14('0x2'))(_0xfe14('0x3'));var moment=require(_0xfe14('0x4'));var BPromise=require('bluebird');var rp=require(_0xfe14('0x5'));var fs=require('fs');var path=require(_0xfe14('0x6'));var rimraf=require('rimraf');var config=require(_0xfe14('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0xca5420,_0x38c228){return _0xca5420[_0xfe14('0x8')](_0xfe14('0x9'),attributes,{'tableName':_0xfe14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4373=['exports','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x2bcd32,_0x225451){var _0x26b77d=function(_0x5e4548){while(--_0x5e4548){_0x2bcd32['push'](_0x2bcd32['shift']());}};_0x26b77d(++_0x225451);}(_0x4373,0x1b1));var _0x3437=function(_0x20f11f,_0x2eb43f){_0x20f11f=_0x20f11f-0x0;var _0x37afdf=_0x4373[_0x20f11f];return _0x37afdf;};'use strict';var _=require(_0x3437('0x0'));var util=require('util');var logger=require(_0x3437('0x1'))(_0x3437('0x2'));var moment=require('moment');var BPromise=require(_0x3437('0x3'));var rp=require(_0x3437('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3437('0x5'));var attributes=require(_0x3437('0x6'));module[_0x3437('0x7')]=function(_0x10f679,_0x489ec0){return _0x10f679['define'](_0x3437('0x8'),attributes,{'tableName':_0x3437('0x9'),'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 65e1463..c0dd936 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 _0x96d7=['http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x355103,_0x4a0357){var _0x85c59f=function(_0x4fa6ec){while(--_0x4fa6ec){_0x355103['push'](_0x355103['shift']());}};_0x85c59f(++_0x4a0357);}(_0x96d7,0x97));var _0x796d=function(_0x46e9f8,_0x890cc9){_0x46e9f8=_0x46e9f8-0x0;var _0x70660b=_0x96d7[_0x46e9f8];return _0x70660b;};'use strict';var _=require(_0x796d('0x0'));var util=require(_0x796d('0x1'));var moment=require('moment');var BPromise=require(_0x796d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x796d('0x3'));var db=require(_0x796d('0x4'))['db'];var utils=require(_0x796d('0x5'));var logger=require(_0x796d('0x6'))(_0x796d('0x7'));var config=require(_0x796d('0x8'));var jayson=require(_0x796d('0x9'));var client=jayson['client'][_0x796d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33ca77,_0x4de054,_0x29d977){return new BPromise(function(_0x39cb8a,_0x176880){return client[_0x796d('0xb')](_0x33ca77,_0x29d977)[_0x796d('0xc')](function(_0x526f87){logger[_0x796d('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4de054,_0x796d('0xe'));logger[_0x796d('0xf')](_0x796d('0x10'),_0x4de054,_0x796d('0xe'),JSON[_0x796d('0x11')](_0x526f87));if(_0x526f87[_0x796d('0x12')]){if(_0x526f87[_0x796d('0x12')][_0x796d('0x13')]===0x1f4){logger[_0x796d('0x12')](_0x796d('0x14'),_0x4de054,_0x526f87[_0x796d('0x12')][_0x796d('0x15')]);return _0x176880(_0x526f87[_0x796d('0x12')]['message']);}logger[_0x796d('0x12')](_0x796d('0x14'),_0x4de054,_0x526f87[_0x796d('0x12')][_0x796d('0x15')]);return _0x39cb8a(_0x526f87[_0x796d('0x12')]['message']);}else{logger[_0x796d('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4de054,_0x796d('0xe'));_0x39cb8a(_0x526f87['result'][_0x796d('0x15')]);}})[_0x796d('0x16')](function(_0xb61624){logger[_0x796d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4de054,_0xb61624);_0x176880(_0xb61624);});});}
\ No newline at end of file
+var _0xcc6f=['rpc','jayson/promise','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x57a53b,_0x11494e){var _0x29e81c=function(_0x24c522){while(--_0x24c522){_0x57a53b['push'](_0x57a53b['shift']());}};_0x29e81c(++_0x11494e);}(_0xcc6f,0x89));var _0xfcc6=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xcc6f[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xfcc6('0x0'));var util=require('util');var moment=require(_0xfcc6('0x1'));var BPromise=require(_0xfcc6('0x2'));var rs=require(_0xfcc6('0x3'));var fs=require('fs');var Redis=require(_0xfcc6('0x4'));var db=require(_0xfcc6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcc6('0x6'))(_0xfcc6('0x7'));var config=require('../../config/environment');var jayson=require(_0xfcc6('0x8'));var client=jayson[_0xfcc6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x556ce2,_0x378bbd,_0x1750a9){return new BPromise(function(_0x2f3f7d,_0x2ce601){return client[_0xfcc6('0xa')](_0x556ce2,_0x1750a9)['then'](function(_0x178b37){logger[_0xfcc6('0xb')](_0xfcc6('0xc'),_0x378bbd,_0xfcc6('0xd'));logger[_0xfcc6('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x378bbd,_0xfcc6('0xd'),JSON['stringify'](_0x178b37));if(_0x178b37[_0xfcc6('0xf')]){if(_0x178b37[_0xfcc6('0xf')]['code']===0x1f4){logger['error'](_0xfcc6('0xc'),_0x378bbd,_0x178b37[_0xfcc6('0xf')]['message']);return _0x2ce601(_0x178b37['error']['message']);}logger[_0xfcc6('0xf')](_0xfcc6('0xc'),_0x378bbd,_0x178b37[_0xfcc6('0xf')][_0xfcc6('0x10')]);return _0x2f3f7d(_0x178b37[_0xfcc6('0xf')][_0xfcc6('0x10')]);}else{logger[_0xfcc6('0xb')](_0xfcc6('0xc'),_0x378bbd,'request\x20sent');_0x2f3f7d(_0x178b37['result'][_0xfcc6('0x10')]);}})[_0xfcc6('0x11')](function(_0xcbf166){logger[_0xfcc6('0xf')](_0xfcc6('0xc'),_0x378bbd,_0xcbf166);_0x2ce601(_0xcbf166);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 4674dc6..049fe1a 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 _0x242e=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','index','get','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','create','put','/:id','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x425a95,_0x2743b6){var _0x270c10=function(_0x5a18ed){while(--_0x5a18ed){_0x425a95['push'](_0x425a95['shift']());}};_0x270c10(++_0x2743b6);}(_0x242e,0x12f));var _0xe242=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x242e[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xe242('0x0'));var util=require('util');var path=require(_0xe242('0x1'));var timeout=require(_0xe242('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe242('0x3'));var auth=require(_0xe242('0x4'));var interaction=require(_0xe242('0x5'));var config=require(_0xe242('0x6'));var controller=require(_0xe242('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe242('0x8')]);router[_0xe242('0x9')]('/:id',auth[_0xe242('0xa')](),controller[_0xe242('0xb')]);router[_0xe242('0x9')](_0xe242('0xc'),auth[_0xe242('0xa')](),controller['preview']);router[_0xe242('0x9')](_0xe242('0xd'),auth[_0xe242('0xa')](),controller[_0xe242('0xe')]);router[_0xe242('0x9')](_0xe242('0xf'),auth[_0xe242('0xa')](),controller[_0xe242('0x10')]);router['post']('/',auth[_0xe242('0xa')](),controller[_0xe242('0x11')]);router[_0xe242('0x12')](_0xe242('0x13'),auth[_0xe242('0xa')](),controller['update']);router[_0xe242('0x14')](_0xe242('0x13'),auth[_0xe242('0xa')](),controller[_0xe242('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x061c=['/:id/run','run','query','create','delete','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','/:id','show','get','preview'];(function(_0x327cb7,_0x4b7f1d){var _0x405388=function(_0x384b02){while(--_0x384b02){_0x327cb7['push'](_0x327cb7['shift']());}};_0x405388(++_0x4b7f1d);}(_0x061c,0x1d0));var _0xc061=function(_0x869e93,_0x189df2){_0x869e93=_0x869e93-0x0;var _0x1077ff=_0x061c[_0x869e93];return _0x1077ff;};'use strict';var multer=require('multer');var util=require(_0xc061('0x0'));var path=require('path');var timeout=require(_0xc061('0x1'));var express=require(_0xc061('0x2'));var router=express['Router']();var fs_extra=require(_0xc061('0x3'));var auth=require(_0xc061('0x4'));var interaction=require(_0xc061('0x5'));var config=require('../../config/environment');var controller=require(_0xc061('0x6'));router['get']('/',auth[_0xc061('0x7')](),controller['index']);router['get'](_0xc061('0x8'),auth['isAuthenticated'](),controller[_0xc061('0x9')]);router[_0xc061('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0xc061('0xb')]);router[_0xc061('0xa')](_0xc061('0xc'),auth[_0xc061('0x7')](),controller[_0xc061('0xd')]);router[_0xc061('0xa')]('/:id/query',auth['isAuthenticated'](),controller[_0xc061('0xe')]);router['post']('/',auth[_0xc061('0x7')](),controller[_0xc061('0xf')]);router['put'](_0xc061('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xc061('0x10')](_0xc061('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 0126f7b..2eb8f56 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 _0xe278=['pdf','xlsx','DATE','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0xe3e0af,_0x4564ed){var _0x4828e9=function(_0x55c7a7){while(--_0x55c7a7){_0xe3e0af['push'](_0xe3e0af['shift']());}};_0x4828e9(++_0x4564ed);}(_0xe278,0x156));var _0x8e27=function(_0x4c4287,_0x3ab735){_0x4c4287=_0x4c4287-0x0;var _0x561a27=_0xe278[_0x4c4287];return _0x561a27;};'use strict';var Sequelize=require(_0x8e27('0x0'));var moment=require(_0x8e27('0x1'));module[_0x8e27('0x2')]={'name':{'type':Sequelize[_0x8e27('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8e27('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8e27('0x4')](_0x8e27('0x5'),_0x8e27('0x6'),_0x8e27('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x8e27('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8e27('0x8')]},'endDate':{'type':Sequelize[_0x8e27('0x8')]},'status':{'type':Sequelize[_0x8e27('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x8e27('0x4')](_0x8e27('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x8e27('0x9')},'reportId':{'type':Sequelize[_0x8e27('0xa')](0xb)[_0x8e27('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xcfd6=['exports','STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual','INTEGER','UNSIGNED','moment'];(function(_0x3f7b1f,_0x54880d){var _0x151f98=function(_0x3b5fd0){while(--_0x3b5fd0){_0x3f7b1f['push'](_0x3f7b1f['shift']());}};_0x151f98(++_0x54880d);}(_0xcfd6,0x12b));var _0x6cfd=function(_0x3df41b,_0x2a9150){_0x3df41b=_0x3df41b-0x0;var _0x1add52=_0xcfd6[_0x3df41b];return _0x1add52;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6cfd('0x0'));module[_0x6cfd('0x1')]={'name':{'type':Sequelize[_0x6cfd('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x6cfd('0x3'),_0x6cfd('0x4'),_0x6cfd('0x5')),'allowNull':![],'defaultValue':_0x6cfd('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x6cfd('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x6cfd('0x7')},'type':{'type':Sequelize[_0x6cfd('0x8')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x6cfd('0x9')},'reportId':{'type':Sequelize[_0x6cfd('0xa')](0xb)[_0x6cfd('0xb')]},'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 f2aecbe..8df2c1e 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 _0xb806=['path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','include','findAll','catch','show','params','keys','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x517fa8,_0x3adce0){var _0x5409f4=function(_0x501e80){while(--_0x501e80){_0x517fa8['push'](_0x517fa8['shift']());}};_0x5409f4(++_0x3adce0);}(_0xb806,0x1e7));var _0x6b80=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xb806[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0x6b80('0x0'));var rimraf=require(_0x6b80('0x1'));var zipdir=require(_0x6b80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b80('0x3'));var moment=require(_0x6b80('0x4'));var BPromise=require(_0x6b80('0x5'));var Mustache=require(_0x6b80('0x6'));var util=require(_0x6b80('0x7'));var path=require(_0x6b80('0x8'));var sox=require(_0x6b80('0x9'));var csv=require('to-csv');var ejs=require(_0x6b80('0xa'));var fs=require('fs');var fs_extra=require(_0x6b80('0xb'));var _=require('lodash');var squel=require(_0x6b80('0xc'));var crypto=require(_0x6b80('0xd'));var jsforce=require(_0x6b80('0xe'));var deskjs=require(_0x6b80('0xf'));var toCsv=require(_0x6b80('0x10'));var querystring=require(_0x6b80('0x11'));var Papa=require('papaparse');var Redis=require(_0x6b80('0x12'));var authService=require(_0x6b80('0x13'));var qs=require(_0x6b80('0x14'));var as=require(_0x6b80('0x15'));var hardwareService=require(_0x6b80('0x16'));var logger=require(_0x6b80('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x6b80('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b80('0x19'))['db'];function respondWithStatusCode(_0x5d4acc,_0x24ba8b){_0x24ba8b=_0x24ba8b||0xcc;return function(_0xa2ff66){if(_0xa2ff66){return _0x5d4acc[_0x6b80('0x1a')](_0x24ba8b);}return _0x5d4acc[_0x6b80('0x1b')](_0x24ba8b)[_0x6b80('0x1c')]();};}function respondWithResult(_0x29aa5e,_0x3d0714){_0x3d0714=_0x3d0714||0xc8;return function(_0x2fbc14){if(_0x2fbc14){return _0x29aa5e[_0x6b80('0x1b')](_0x3d0714)[_0x6b80('0x1d')](_0x2fbc14);}};}function respondWithFilteredResult(_0xe7bb1c,_0x2b935f){return function(_0x520a5a){if(_0x520a5a){var _0x100504=typeof _0x2b935f[_0x6b80('0x1e')]===_0x6b80('0x1f')&&typeof _0x2b935f['limit']===_0x6b80('0x1f');var _0x1779ed=_0x520a5a[_0x6b80('0x20')];var _0x2c0bda=_0x100504?0x0:_0x2b935f['offset'];var _0x568fc0=_0x100504?_0x520a5a[_0x6b80('0x20')]:_0x2b935f[_0x6b80('0x1e')]+_0x2b935f[_0x6b80('0x21')];var _0x1b8a80;if(_0x568fc0>=_0x1779ed){_0x568fc0=_0x1779ed;_0x1b8a80=0xc8;}else{_0x1b8a80=0xce;}_0xe7bb1c[_0x6b80('0x1b')](_0x1b8a80);return _0xe7bb1c[_0x6b80('0x22')](_0x6b80('0x23'),_0x2c0bda+'-'+_0x568fc0+'/'+_0x1779ed)[_0x6b80('0x1d')](_0x520a5a);}return null;};}function patchUpdates(_0x326f10){return function(_0x409663){try{jsonpatch[_0x6b80('0x24')](_0x409663,_0x326f10,!![]);}catch(_0x103f62){return BPromise[_0x6b80('0x25')](_0x103f62);}return _0x409663[_0x6b80('0x26')]();};}function saveUpdates(_0x2d0086,_0x4b31a4){return function(_0x12045c){if(_0x12045c){return _0x12045c[_0x6b80('0x27')](_0x2d0086)[_0x6b80('0x28')](function(_0x4eae3a){return _0x4eae3a;});}return null;};}function removeEntity(_0x50637e,_0x46e3a0){return function(_0x47d59e){if(_0x47d59e){return _0x47d59e[_0x6b80('0x29')]()[_0x6b80('0x28')](function(){var _0x21b694=_0x47d59e[_0x6b80('0x2a')]({'plain':!![]});var _0x3f85df=_0x6b80('0x2b');return db[_0x6b80('0x2c')]['destroy']({'where':{'type':_0x3f85df,'resourceId':_0x21b694['id']}})[_0x6b80('0x28')](function(){return _0x47d59e;});})[_0x6b80('0x28')](function(){_0x50637e['status'](0xcc)[_0x6b80('0x1c')]();});}};}function handleEntityNotFound(_0x1e066d,_0x21f2ee){return function(_0x471809){if(!_0x471809){_0x1e066d[_0x6b80('0x1a')](0x194);}return _0x471809;};}function handleError(_0x5aa160,_0x41d737){_0x41d737=_0x41d737||0x1f4;return function(_0x3d6724){logger[_0x6b80('0x2d')](_0x3d6724[_0x6b80('0x2e')]);if(_0x3d6724[_0x6b80('0x2f')]){delete _0x3d6724[_0x6b80('0x2f')];}_0x5aa160[_0x6b80('0x1b')](_0x41d737)[_0x6b80('0x30')](_0x3d6724);};}exports['index']=function(_0x3932c7,_0x2e4859){var _0x4364b5={},_0x2f205b={},_0x4785ed={'count':0x0,'rows':[]};var _0x18143d=_[_0x6b80('0x31')](db['AnalyticExtractedReport'][_0x6b80('0x32')],function(_0x275a6f){return{'name':_0x275a6f[_0x6b80('0x33')],'type':_0x275a6f[_0x6b80('0x34')]['key']};});_0x2f205b['model']=_[_0x6b80('0x31')](_0x18143d,_0x6b80('0x2f'));_0x2f205b[_0x6b80('0x35')]=_['keys'](_0x3932c7[_0x6b80('0x35')]);_0x2f205b[_0x6b80('0x36')]=_[_0x6b80('0x37')](_0x2f205b[_0x6b80('0x38')],_0x2f205b[_0x6b80('0x35')]);_0x4364b5[_0x6b80('0x39')]=_['intersection'](_0x2f205b[_0x6b80('0x38')],qs[_0x6b80('0x3a')](_0x3932c7['query']['fields']));_0x4364b5[_0x6b80('0x39')]=_0x4364b5[_0x6b80('0x39')]['length']?_0x4364b5[_0x6b80('0x39')]:_0x2f205b[_0x6b80('0x38')];if(!_0x3932c7[_0x6b80('0x35')][_0x6b80('0x3b')](_0x6b80('0x3c'))){_0x4364b5[_0x6b80('0x21')]=qs[_0x6b80('0x21')](_0x3932c7[_0x6b80('0x35')]['limit']);_0x4364b5[_0x6b80('0x1e')]=qs[_0x6b80('0x1e')](_0x3932c7[_0x6b80('0x35')][_0x6b80('0x1e')]);}_0x4364b5[_0x6b80('0x3d')]=qs['sort'](_0x3932c7['query'][_0x6b80('0x3e')]);_0x4364b5[_0x6b80('0x3f')]=qs[_0x6b80('0x36')](_[_0x6b80('0x40')](_0x3932c7[_0x6b80('0x35')],_0x2f205b[_0x6b80('0x36')]),_0x18143d);if(_0x3932c7[_0x6b80('0x35')][_0x6b80('0x41')]){_0x4364b5[_0x6b80('0x3f')]=_[_0x6b80('0x42')](_0x4364b5[_0x6b80('0x3f')],{'$or':_['map'](_0x18143d,function(_0x27b768){if(_0x27b768[_0x6b80('0x34')]!==_0x6b80('0x43')){var _0x2d82bb={};_0x2d82bb[_0x27b768[_0x6b80('0x2f')]]={'$like':'%'+_0x3932c7[_0x6b80('0x35')][_0x6b80('0x41')]+'%'};return _0x2d82bb;}})});}_0x4364b5=_[_0x6b80('0x42')]({},_0x4364b5,_0x3932c7[_0x6b80('0x44')]);var _0x631fc0={'where':_0x4364b5['where']};return db[_0x6b80('0x45')][_0x6b80('0x20')](_0x631fc0)[_0x6b80('0x28')](function(_0x1065da){_0x4785ed[_0x6b80('0x20')]=_0x1065da;if(_0x3932c7[_0x6b80('0x35')]['includeAll']){_0x4364b5[_0x6b80('0x46')]=[{'all':!![]}];}return db[_0x6b80('0x45')][_0x6b80('0x47')](_0x4364b5);})[_0x6b80('0x28')](function(_0x435471){_0x4785ed['rows']=_0x435471;return _0x4785ed;})[_0x6b80('0x28')](respondWithFilteredResult(_0x2e4859,_0x4364b5))[_0x6b80('0x48')](handleError(_0x2e4859,null));};exports[_0x6b80('0x49')]=function(_0x58e11f,_0x1e1cb0){var _0x777d11={'raw':!![],'where':{'id':_0x58e11f[_0x6b80('0x4a')]['id']}},_0x47894b={};_0x47894b[_0x6b80('0x38')]=_['keys'](db[_0x6b80('0x45')]['rawAttributes']);_0x47894b['query']=_[_0x6b80('0x4b')](_0x58e11f[_0x6b80('0x35')]);_0x47894b[_0x6b80('0x36')]=_['intersection'](_0x47894b[_0x6b80('0x38')],_0x47894b[_0x6b80('0x35')]);_0x777d11[_0x6b80('0x39')]=_[_0x6b80('0x37')](_0x47894b[_0x6b80('0x38')],qs[_0x6b80('0x3a')](_0x58e11f[_0x6b80('0x35')][_0x6b80('0x3a')]));_0x777d11[_0x6b80('0x39')]=_0x777d11[_0x6b80('0x39')][_0x6b80('0x4c')]?_0x777d11[_0x6b80('0x39')]:_0x47894b['model'];if(_0x58e11f[_0x6b80('0x35')][_0x6b80('0x4d')]){_0x777d11[_0x6b80('0x46')]=[{'all':!![]}];}_0x777d11=_[_0x6b80('0x42')]({},_0x777d11,_0x58e11f[_0x6b80('0x44')]);return db['AnalyticExtractedReport'][_0x6b80('0x4e')](_0x777d11)[_0x6b80('0x28')](handleEntityNotFound(_0x1e1cb0,null))[_0x6b80('0x28')](respondWithResult(_0x1e1cb0,null))[_0x6b80('0x48')](handleError(_0x1e1cb0,null));};exports[_0x6b80('0x4f')]=function(_0x1dba91,_0x1ee506){return db[_0x6b80('0x45')][_0x6b80('0x4f')](_0x1dba91['body'],{})[_0x6b80('0x28')](function(_0x40069b){var _0x12e10c=_0x1dba91[_0x6b80('0x50')][_0x6b80('0x2a')]({'plain':!![]});if(!_0x12e10c)throw new Error(_0x6b80('0x51'));if(_0x12e10c['role']===_0x6b80('0x50')){var _0x5edd98=_0x40069b[_0x6b80('0x2a')]({'plain':!![]});var _0x236c81=_0x6b80('0x2b');return db[_0x6b80('0x52')][_0x6b80('0x4e')]({'where':{'name':_0x236c81,'userProfileId':_0x12e10c[_0x6b80('0x53')]},'raw':!![]})[_0x6b80('0x28')](function(_0x4aa8b1){if(_0x4aa8b1&&_0x4aa8b1[_0x6b80('0x54')]===0x0){return db[_0x6b80('0x2c')][_0x6b80('0x4f')]({'name':_0x5edd98[_0x6b80('0x2f')],'resourceId':_0x5edd98['id'],'type':_0x4aa8b1[_0x6b80('0x2f')],'sectionId':_0x4aa8b1['id']},{})['then'](function(){return _0x40069b;});}else{return _0x40069b;}})['catch'](function(_0x162399){logger['error'](_0x6b80('0x55'),_0x162399);throw _0x162399;});}return _0x40069b;})[_0x6b80('0x28')](respondWithResult(_0x1ee506,0xc9))[_0x6b80('0x48')](handleError(_0x1ee506,null));};exports[_0x6b80('0x27')]=function(_0x55f499,_0x391405){if(_0x55f499[_0x6b80('0x56')]['id']){delete _0x55f499[_0x6b80('0x56')]['id'];}return db[_0x6b80('0x45')]['find']({'where':{'id':_0x55f499[_0x6b80('0x4a')]['id']}})[_0x6b80('0x28')](handleEntityNotFound(_0x391405,null))['then'](saveUpdates(_0x55f499[_0x6b80('0x56')],null))[_0x6b80('0x28')](respondWithResult(_0x391405,null))[_0x6b80('0x48')](handleError(_0x391405,null));};exports['destroy']=function(_0x3f19ea,_0x36ac28){return db[_0x6b80('0x45')][_0x6b80('0x4e')]({'where':{'id':_0x3f19ea[_0x6b80('0x4a')]['id']}})['then'](handleEntityNotFound(_0x36ac28,null))[_0x6b80('0x28')](removeEntity(_0x36ac28,null))[_0x6b80('0x48')](handleError(_0x36ac28,null));};exports['download']=function(_0xa9806b,_0x27ad1d,_0x3b43d8){return db[_0x6b80('0x45')][_0x6b80('0x4e')]({'where':{'id':_0xa9806b[_0x6b80('0x4a')]['id']},'attributes':['name',_0x6b80('0x57'),_0x6b80('0x58'),_0x6b80('0x59')],'raw':!![]})['then'](handleEntityNotFound(_0x27ad1d,null))[_0x6b80('0x28')](function(_0x413c9b){if(_0x413c9b){if(!fs['existsSync'](path[_0x6b80('0x5a')](config[_0x6b80('0x5b')],_0x6b80('0x5c'),_0x413c9b['savename']))){throw new db[(_0x6b80('0x5d'))][(_0x6b80('0x5e'))](_0x6b80('0x5f'));}if(_0xa9806b[_0x6b80('0x35')][_0x6b80('0x60')]){return _0x27ad1d['sendStatus'](0xc8);}return _0x27ad1d['download'](path[_0x6b80('0x5a')](config[_0x6b80('0x5b')],_0x6b80('0x5c'),_0x413c9b['savename']),util['format'](_0x6b80('0x61'),_0x413c9b['basename']||_0x413c9b[_0x6b80('0x2f')],_0x413c9b[_0x6b80('0x59')][_0x6b80('0x62')]()));}})[_0x6b80('0x48')](handleError(_0x27ad1d,null));};
\ No newline at end of file
+var _0xed14=['exists','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','offset','Content-Range','json','apply','reject','then','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','catch','show','params','include','find','create','body','get','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed14,0x179));var _0x4ed1=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xed14[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require(_0x4ed1('0x0'));var rimraf=require(_0x4ed1('0x1'));var zipdir=require(_0x4ed1('0x2'));var jsonpatch=require(_0x4ed1('0x3'));var rp=require(_0x4ed1('0x4'));var moment=require(_0x4ed1('0x5'));var BPromise=require(_0x4ed1('0x6'));var Mustache=require(_0x4ed1('0x7'));var util=require(_0x4ed1('0x8'));var path=require(_0x4ed1('0x9'));var sox=require(_0x4ed1('0xa'));var csv=require(_0x4ed1('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ed1('0xc'));var _=require(_0x4ed1('0xd'));var squel=require(_0x4ed1('0xe'));var crypto=require(_0x4ed1('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4ed1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4ed1('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4ed1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ed1('0x13'))('api');var utils=require(_0x4ed1('0x14'));var config=require(_0x4ed1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5adc,_0x5438f9){_0x5438f9=_0x5438f9||0xcc;return function(_0x4066d2){if(_0x4066d2){return _0x1e5adc[_0x4ed1('0x16')](_0x5438f9);}return _0x1e5adc[_0x4ed1('0x17')](_0x5438f9)[_0x4ed1('0x18')]();};}function respondWithResult(_0x421184,_0x2bdc06){_0x2bdc06=_0x2bdc06||0xc8;return function(_0x5c7a35){if(_0x5c7a35){return _0x421184[_0x4ed1('0x17')](_0x2bdc06)['json'](_0x5c7a35);}};}function respondWithFilteredResult(_0x19f025,_0x355fe9){return function(_0x455f64){if(_0x455f64){var _0x15a605=typeof _0x355fe9['offset']===_0x4ed1('0x19')&&typeof _0x355fe9[_0x4ed1('0x1a')]===_0x4ed1('0x19');var _0x27b7eb=_0x455f64['count'];var _0x38750a=_0x15a605?0x0:_0x355fe9['offset'];var _0x52a746=_0x15a605?_0x455f64['count']:_0x355fe9[_0x4ed1('0x1b')]+_0x355fe9[_0x4ed1('0x1a')];var _0x1ddc96;if(_0x52a746>=_0x27b7eb){_0x52a746=_0x27b7eb;_0x1ddc96=0xc8;}else{_0x1ddc96=0xce;}_0x19f025[_0x4ed1('0x17')](_0x1ddc96);return _0x19f025['set'](_0x4ed1('0x1c'),_0x38750a+'-'+_0x52a746+'/'+_0x27b7eb)[_0x4ed1('0x1d')](_0x455f64);}return null;};}function patchUpdates(_0x225f04){return function(_0x27fac6){try{jsonpatch[_0x4ed1('0x1e')](_0x27fac6,_0x225f04,!![]);}catch(_0x4df3ee){return BPromise[_0x4ed1('0x1f')](_0x4df3ee);}return _0x27fac6['save']();};}function saveUpdates(_0x2b7247,_0x126ad4){return function(_0x2ad172){if(_0x2ad172){return _0x2ad172['update'](_0x2b7247)[_0x4ed1('0x20')](function(_0x281cfa){return _0x281cfa;});}return null;};}function removeEntity(_0xdc9bc7,_0x364418){return function(_0x2de3b9){if(_0x2de3b9){return _0x2de3b9['destroy']()[_0x4ed1('0x20')](function(){var _0x445a41=_0x2de3b9['get']({'plain':!![]});var _0x4e5a7c=_0x4ed1('0x21');return db[_0x4ed1('0x22')][_0x4ed1('0x23')]({'where':{'type':_0x4e5a7c,'resourceId':_0x445a41['id']}})['then'](function(){return _0x2de3b9;});})[_0x4ed1('0x20')](function(){_0xdc9bc7[_0x4ed1('0x17')](0xcc)[_0x4ed1('0x18')]();});}};}function handleEntityNotFound(_0xf5cbb1,_0x523ada){return function(_0x155ef8){if(!_0x155ef8){_0xf5cbb1[_0x4ed1('0x16')](0x194);}return _0x155ef8;};}function handleError(_0x32eca1,_0x38172c){_0x38172c=_0x38172c||0x1f4;return function(_0x52557a){logger['error'](_0x52557a[_0x4ed1('0x24')]);if(_0x52557a['name']){delete _0x52557a[_0x4ed1('0x25')];}_0x32eca1['status'](_0x38172c)[_0x4ed1('0x26')](_0x52557a);};}exports[_0x4ed1('0x27')]=function(_0x2fcbd8,_0x2b06c0){var _0x577312={},_0x1e50e5={},_0x22c875={'count':0x0,'rows':[]};var _0x2126d1=_[_0x4ed1('0x28')](db[_0x4ed1('0x29')][_0x4ed1('0x2a')],function(_0x8a754c){return{'name':_0x8a754c[_0x4ed1('0x2b')],'type':_0x8a754c[_0x4ed1('0x2c')][_0x4ed1('0x2d')]};});_0x1e50e5['model']=_[_0x4ed1('0x28')](_0x2126d1,_0x4ed1('0x25'));_0x1e50e5['query']=_[_0x4ed1('0x2e')](_0x2fcbd8[_0x4ed1('0x2f')]);_0x1e50e5[_0x4ed1('0x30')]=_['intersection'](_0x1e50e5[_0x4ed1('0x31')],_0x1e50e5['query']);_0x577312[_0x4ed1('0x32')]=_[_0x4ed1('0x33')](_0x1e50e5[_0x4ed1('0x31')],qs[_0x4ed1('0x34')](_0x2fcbd8[_0x4ed1('0x2f')][_0x4ed1('0x34')]));_0x577312[_0x4ed1('0x32')]=_0x577312['attributes'][_0x4ed1('0x35')]?_0x577312[_0x4ed1('0x32')]:_0x1e50e5['model'];if(!_0x2fcbd8[_0x4ed1('0x2f')]['hasOwnProperty'](_0x4ed1('0x36'))){_0x577312['limit']=qs['limit'](_0x2fcbd8['query']['limit']);_0x577312[_0x4ed1('0x1b')]=qs[_0x4ed1('0x1b')](_0x2fcbd8[_0x4ed1('0x2f')][_0x4ed1('0x1b')]);}_0x577312[_0x4ed1('0x37')]=qs[_0x4ed1('0x38')](_0x2fcbd8[_0x4ed1('0x2f')][_0x4ed1('0x38')]);_0x577312[_0x4ed1('0x39')]=qs[_0x4ed1('0x30')](_[_0x4ed1('0x3a')](_0x2fcbd8['query'],_0x1e50e5[_0x4ed1('0x30')]),_0x2126d1);if(_0x2fcbd8[_0x4ed1('0x2f')]['filter']){_0x577312[_0x4ed1('0x39')]=_['merge'](_0x577312[_0x4ed1('0x39')],{'$or':_['map'](_0x2126d1,function(_0x345df5){if(_0x345df5['type']!=='VIRTUAL'){var _0x34358a={};_0x34358a[_0x345df5[_0x4ed1('0x25')]]={'$like':'%'+_0x2fcbd8['query'][_0x4ed1('0x3b')]+'%'};return _0x34358a;}})});}_0x577312=_[_0x4ed1('0x3c')]({},_0x577312,_0x2fcbd8[_0x4ed1('0x3d')]);var _0x554ba6={'where':_0x577312[_0x4ed1('0x39')]};return db[_0x4ed1('0x29')]['count'](_0x554ba6)['then'](function(_0x344186){_0x22c875[_0x4ed1('0x3e')]=_0x344186;if(_0x2fcbd8['query'][_0x4ed1('0x3f')]){_0x577312['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x4ed1('0x40')](_0x577312);})[_0x4ed1('0x20')](function(_0x408352){_0x22c875['rows']=_0x408352;return _0x22c875;})[_0x4ed1('0x20')](respondWithFilteredResult(_0x2b06c0,_0x577312))[_0x4ed1('0x41')](handleError(_0x2b06c0,null));};exports[_0x4ed1('0x42')]=function(_0x549435,_0xb80d39){var _0x2c2c79={'raw':!![],'where':{'id':_0x549435[_0x4ed1('0x43')]['id']}},_0x1022ff={};_0x1022ff['model']=_[_0x4ed1('0x2e')](db['AnalyticExtractedReport'][_0x4ed1('0x2a')]);_0x1022ff[_0x4ed1('0x2f')]=_[_0x4ed1('0x2e')](_0x549435[_0x4ed1('0x2f')]);_0x1022ff[_0x4ed1('0x30')]=_[_0x4ed1('0x33')](_0x1022ff[_0x4ed1('0x31')],_0x1022ff['query']);_0x2c2c79[_0x4ed1('0x32')]=_['intersection'](_0x1022ff[_0x4ed1('0x31')],qs['fields'](_0x549435[_0x4ed1('0x2f')]['fields']));_0x2c2c79[_0x4ed1('0x32')]=_0x2c2c79[_0x4ed1('0x32')][_0x4ed1('0x35')]?_0x2c2c79[_0x4ed1('0x32')]:_0x1022ff[_0x4ed1('0x31')];if(_0x549435[_0x4ed1('0x2f')]['includeAll']){_0x2c2c79[_0x4ed1('0x44')]=[{'all':!![]}];}_0x2c2c79=_['merge']({},_0x2c2c79,_0x549435[_0x4ed1('0x3d')]);return db['AnalyticExtractedReport'][_0x4ed1('0x45')](_0x2c2c79)[_0x4ed1('0x20')](handleEntityNotFound(_0xb80d39,null))[_0x4ed1('0x20')](respondWithResult(_0xb80d39,null))[_0x4ed1('0x41')](handleError(_0xb80d39,null));};exports[_0x4ed1('0x46')]=function(_0x26c441,_0xede30){return db[_0x4ed1('0x29')][_0x4ed1('0x46')](_0x26c441[_0x4ed1('0x47')],{})['then'](function(_0x369930){var _0x3cb159=_0x26c441['user'][_0x4ed1('0x48')]({'plain':!![]});if(!_0x3cb159)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cb159[_0x4ed1('0x49')]==='user'){var _0x3094af=_0x369930[_0x4ed1('0x48')]({'plain':!![]});var _0x29672a=_0x4ed1('0x21');return db['UserProfileSection'][_0x4ed1('0x45')]({'where':{'name':_0x29672a,'userProfileId':_0x3cb159[_0x4ed1('0x4a')]},'raw':!![]})[_0x4ed1('0x20')](function(_0x15aa86){if(_0x15aa86&&_0x15aa86[_0x4ed1('0x4b')]===0x0){return db[_0x4ed1('0x22')]['create']({'name':_0x3094af['name'],'resourceId':_0x3094af['id'],'type':_0x15aa86[_0x4ed1('0x25')],'sectionId':_0x15aa86['id']},{})[_0x4ed1('0x20')](function(){return _0x369930;});}else{return _0x369930;}})[_0x4ed1('0x41')](function(_0x1a8210){logger[_0x4ed1('0x4c')](_0x4ed1('0x4d'),_0x1a8210);throw _0x1a8210;});}return _0x369930;})[_0x4ed1('0x20')](respondWithResult(_0xede30,0xc9))[_0x4ed1('0x41')](handleError(_0xede30,null));};exports[_0x4ed1('0x4e')]=function(_0x24358e,_0x21fd36){if(_0x24358e[_0x4ed1('0x47')]['id']){delete _0x24358e['body']['id'];}return db[_0x4ed1('0x29')]['find']({'where':{'id':_0x24358e[_0x4ed1('0x43')]['id']}})[_0x4ed1('0x20')](handleEntityNotFound(_0x21fd36,null))[_0x4ed1('0x20')](saveUpdates(_0x24358e[_0x4ed1('0x47')],null))[_0x4ed1('0x20')](respondWithResult(_0x21fd36,null))[_0x4ed1('0x41')](handleError(_0x21fd36,null));};exports[_0x4ed1('0x23')]=function(_0x108836,_0x3e8b09){return db[_0x4ed1('0x29')][_0x4ed1('0x45')]({'where':{'id':_0x108836[_0x4ed1('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e8b09,null))[_0x4ed1('0x20')](removeEntity(_0x3e8b09,null))[_0x4ed1('0x41')](handleError(_0x3e8b09,null));};exports[_0x4ed1('0x4f')]=function(_0x38b09b,_0x34153c,_0x3f9270){return db[_0x4ed1('0x29')][_0x4ed1('0x45')]({'where':{'id':_0x38b09b[_0x4ed1('0x43')]['id']},'attributes':[_0x4ed1('0x25'),_0x4ed1('0x50'),_0x4ed1('0x51'),'output'],'raw':!![]})[_0x4ed1('0x20')](handleEntityNotFound(_0x34153c,null))[_0x4ed1('0x20')](function(_0x3aad30){if(_0x3aad30){if(!fs[_0x4ed1('0x52')](path[_0x4ed1('0x53')](config[_0x4ed1('0x54')],'server/files/reports',_0x3aad30[_0x4ed1('0x51')]))){throw new db[(_0x4ed1('0x55'))][(_0x4ed1('0x56'))](_0x4ed1('0x57'));}if(_0x38b09b[_0x4ed1('0x2f')][_0x4ed1('0x58')]){return _0x34153c['sendStatus'](0xc8);}return _0x34153c[_0x4ed1('0x4f')](path[_0x4ed1('0x53')](config[_0x4ed1('0x54')],'server/files/reports',_0x3aad30[_0x4ed1('0x51')]),util[_0x4ed1('0x59')](_0x4ed1('0x5a'),_0x3aad30[_0x4ed1('0x50')]||_0x3aad30['name'],_0x3aad30[_0x4ed1('0x5b')][_0x4ed1('0x5c')]()));}})['catch'](handleError(_0x34153c,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index c680b5f..20bbde4 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 _0xcb57=['api','moment','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0xcb57,0x148));var _0x7cb5=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xcb57[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x7cb5('0x0'));var util=require('util');var logger=require(_0x7cb5('0x1'))(_0x7cb5('0x2'));var moment=require(_0x7cb5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cb5('0x4'));var rimraf=require(_0x7cb5('0x5'));var config=require('../../config/environment');var attributes=require(_0x7cb5('0x6'));module[_0x7cb5('0x7')]=function(_0x145556,_0x364005){return _0x145556[_0x7cb5('0x8')](_0x7cb5('0x9'),attributes,{'tableName':_0x7cb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2767=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','../../config/logger','api','moment','request-promise'];(function(_0x283365,_0x704c4d){var _0x178caf=function(_0x165e54){while(--_0x165e54){_0x283365['push'](_0x283365['shift']());}};_0x178caf(++_0x704c4d);}(_0x2767,0x16f));var _0x7276=function(_0x44fc24,_0xdbbe3f){_0x44fc24=_0x44fc24-0x0;var _0x8f9756=_0x2767[_0x44fc24];return _0x8f9756;};'use strict';var _=require(_0x7276('0x0'));var util=require('util');var logger=require(_0x7276('0x1'))(_0x7276('0x2'));var moment=require(_0x7276('0x3'));var BPromise=require('bluebird');var rp=require(_0x7276('0x4'));var fs=require('fs');var path=require(_0x7276('0x5'));var rimraf=require(_0x7276('0x6'));var config=require(_0x7276('0x7'));var attributes=require(_0x7276('0x8'));module[_0x7276('0x9')]=function(_0xf8b21c,_0x5edaf3){return _0xf8b21c[_0x7276('0xa')](_0x7276('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index bd2c982..eb4a3f6 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 _0x61c7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird'];(function(_0x51ee4b,_0x1a1bed){var _0x57904d=function(_0x34602){while(--_0x34602){_0x51ee4b['push'](_0x51ee4b['shift']());}};_0x57904d(++_0x1a1bed);}(_0x61c7,0x127));var _0x761c=function(_0x2edb70,_0x12a185){_0x2edb70=_0x2edb70-0x0;var _0x36ebd4=_0x61c7[_0x2edb70];return _0x36ebd4;};'use strict';var _=require(_0x761c('0x0'));var util=require(_0x761c('0x1'));var moment=require(_0x761c('0x2'));var BPromise=require(_0x761c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x761c('0x4'));var db=require(_0x761c('0x5'))['db'];var utils=require(_0x761c('0x6'));var logger=require(_0x761c('0x7'))(_0x761c('0x8'));var config=require(_0x761c('0x9'));var jayson=require(_0x761c('0xa'));var client=jayson[_0x761c('0xb')][_0x761c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12db27,_0x46d11e,_0x534de7){return new BPromise(function(_0x3211b7,_0x399d57){return client[_0x761c('0xd')](_0x12db27,_0x534de7)['then'](function(_0x47f1f6){logger[_0x761c('0xe')](_0x761c('0xf'),_0x46d11e,'request\x20sent');logger[_0x761c('0x10')](_0x761c('0x11'),_0x46d11e,_0x761c('0x12'),JSON[_0x761c('0x13')](_0x47f1f6));if(_0x47f1f6[_0x761c('0x14')]){if(_0x47f1f6[_0x761c('0x14')][_0x761c('0x15')]===0x1f4){logger[_0x761c('0x14')](_0x761c('0xf'),_0x46d11e,_0x47f1f6[_0x761c('0x14')][_0x761c('0x16')]);return _0x399d57(_0x47f1f6[_0x761c('0x14')][_0x761c('0x16')]);}logger[_0x761c('0x14')](_0x761c('0xf'),_0x46d11e,_0x47f1f6[_0x761c('0x14')][_0x761c('0x16')]);return _0x3211b7(_0x47f1f6[_0x761c('0x14')][_0x761c('0x16')]);}else{logger[_0x761c('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x46d11e,'request\x20sent');_0x3211b7(_0x47f1f6['result'][_0x761c('0x16')]);}})['catch'](function(_0x3e19ed){logger['error'](_0x761c('0xf'),_0x46d11e,_0x3e19ed);_0x399d57(_0x3e19ed);});});}
\ No newline at end of file
+var _0x8d41=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x30352d,_0x4b4384){var _0x44e00a=function(_0x502aac){while(--_0x502aac){_0x30352d['push'](_0x30352d['shift']());}};_0x44e00a(++_0x4b4384);}(_0x8d41,0x12c));var _0x18d4=function(_0x477491,_0x5ca700){_0x477491=_0x477491-0x0;var _0xac6aec=_0x8d41[_0x477491];return _0xac6aec;};'use strict';var _=require(_0x18d4('0x0'));var util=require(_0x18d4('0x1'));var moment=require(_0x18d4('0x2'));var BPromise=require(_0x18d4('0x3'));var rs=require(_0x18d4('0x4'));var fs=require('fs');var Redis=require(_0x18d4('0x5'));var db=require(_0x18d4('0x6'))['db'];var utils=require(_0x18d4('0x7'));var logger=require(_0x18d4('0x8'))(_0x18d4('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x18d4('0xa')][_0x18d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20275f,_0x1e1961,_0x81d9bf){return new BPromise(function(_0x1b0f97,_0x108508){return client[_0x18d4('0xc')](_0x20275f,_0x81d9bf)['then'](function(_0x3d3876){logger['info'](_0x18d4('0xd'),_0x1e1961,'request\x20sent');logger[_0x18d4('0xe')](_0x18d4('0xf'),_0x1e1961,'request\x20sent',JSON['stringify'](_0x3d3876));if(_0x3d3876['error']){if(_0x3d3876[_0x18d4('0x10')][_0x18d4('0x11')]===0x1f4){logger[_0x18d4('0x10')](_0x18d4('0xd'),_0x1e1961,_0x3d3876[_0x18d4('0x10')][_0x18d4('0x12')]);return _0x108508(_0x3d3876['error'][_0x18d4('0x12')]);}logger[_0x18d4('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e1961,_0x3d3876[_0x18d4('0x10')]['message']);return _0x1b0f97(_0x3d3876['error'][_0x18d4('0x12')]);}else{logger[_0x18d4('0x13')](_0x18d4('0xd'),_0x1e1961,'request\x20sent');_0x1b0f97(_0x3d3876['result'][_0x18d4('0x12')]);}})['catch'](function(_0x596e52){logger['error'](_0x18d4('0xd'),_0x1e1961,_0x596e52);_0x108508(_0x596e52);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index d7989c8..7195926 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 _0x6880=['index','/:id','show','get','/:id/download','download','post','create','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x2bb5b3,_0x29373f){var _0x1e0d91=function(_0x5bcb7d){while(--_0x5bcb7d){_0x2bb5b3['push'](_0x2bb5b3['shift']());}};_0x1e0d91(++_0x29373f);}(_0x6880,0x8a));var _0x0688=function(_0x5adc07,_0x326d9e){_0x5adc07=_0x5adc07-0x0;var _0x4e677e=_0x6880[_0x5adc07];return _0x4e677e;};'use strict';var multer=require('multer');var util=require(_0x0688('0x0'));var path=require(_0x0688('0x1'));var timeout=require(_0x0688('0x2'));var express=require(_0x0688('0x3'));var router=express['Router']();var fs_extra=require(_0x0688('0x4'));var auth=require(_0x0688('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0688('0x6'));var controller=require(_0x0688('0x7'));router['get']('/',auth[_0x0688('0x8')](),controller[_0x0688('0x9')]);router['get'](_0x0688('0xa'),auth['isAuthenticated'](),controller[_0x0688('0xb')]);router[_0x0688('0xc')](_0x0688('0xd'),auth['isAuthenticated'](),controller[_0x0688('0xe')]);router[_0x0688('0xf')]('/',auth['isAuthenticated'](),controller[_0x0688('0x10')]);router[_0x0688('0x11')](_0x0688('0xa'),auth['isAuthenticated'](),controller[_0x0688('0x12')]);router['delete'](_0x0688('0xa'),auth['isAuthenticated'](),controller[_0x0688('0x13')]);module[_0x0688('0x14')]=router;
\ No newline at end of file
+var _0x8c13=['update','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','download','post','create'];(function(_0x5f2acc,_0x47fcfd){var _0x1ec79c=function(_0xe1d16b){while(--_0xe1d16b){_0x5f2acc['push'](_0x5f2acc['shift']());}};_0x1ec79c(++_0x47fcfd);}(_0x8c13,0x1b2));var _0x38c1=function(_0x2d3edb,_0x152d90){_0x2d3edb=_0x2d3edb-0x0;var _0x5d0722=_0x8c13[_0x2d3edb];return _0x5d0722;};'use strict';var multer=require(_0x38c1('0x0'));var util=require(_0x38c1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38c1('0x2'));var router=express['Router']();var fs_extra=require(_0x38c1('0x3'));var auth=require(_0x38c1('0x4'));var interaction=require(_0x38c1('0x5'));var config=require(_0x38c1('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x38c1('0x7')]('/',auth[_0x38c1('0x8')](),controller[_0x38c1('0x9')]);router[_0x38c1('0x7')](_0x38c1('0xa'),auth[_0x38c1('0x8')](),controller['show']);router[_0x38c1('0x7')]('/:id/download',auth[_0x38c1('0x8')](),controller[_0x38c1('0xb')]);router[_0x38c1('0xc')]('/',auth[_0x38c1('0x8')](),controller[_0x38c1('0xd')]);router['put'](_0x38c1('0xa'),auth['isAuthenticated'](),controller[_0x38c1('0xe')]);router['delete'](_0x38c1('0xa'),auth[_0x38c1('0x8')](),controller[_0x38c1('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 9b783ad..1e9943a 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 _0xd560=['BOOLEAN','STRING'];(function(_0x5a7242,_0x5bc9e7){var _0x15d862=function(_0x30ea0a){while(--_0x30ea0a){_0x5a7242['push'](_0x5a7242['shift']());}};_0x15d862(++_0x5bc9e7);}(_0xd560,0x69));var _0x0d56=function(_0x34105a,_0xb17783){_0x34105a=_0x34105a-0x0;var _0x3c53f9=_0xd560[_0x34105a];return _0x3c53f9;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x0d56('0x0')]},'function':{'type':Sequelize[_0x0d56('0x0')]},'format':{'type':Sequelize[_0x0d56('0x0')]},'groupBy':{'type':Sequelize[_0x0d56('0x1')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x0d56('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb093=['exports','STRING','BOOLEAN'];(function(_0x1b5966,_0x4aaf1a){var _0x47b1a1=function(_0x279d99){while(--_0x279d99){_0x1b5966['push'](_0x1b5966['shift']());}};_0x47b1a1(++_0x4aaf1a);}(_0xb093,0x135));var _0x3b09=function(_0x3cba26,_0x10e31){_0x3cba26=_0x3cba26-0x0;var _0x36f3a8=_0xb093[_0x3cba26];return _0x36f3a8;};'use strict';var Sequelize=require('sequelize');module[_0x3b09('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x3b09('0x1')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x3b09('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3b09('0x1')]},'custom':{'type':Sequelize[_0x3b09('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index ba30db7..2f1cb41 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 _0x5d6c=['mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','Content-Range','json','apply','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','filter','merge','VIRTUAL','options','where','AnalyticFieldReport','include','findAll','rows','show','params','length','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x458ff5,_0x3584f1){var _0x535703=function(_0x5a961e){while(--_0x5a961e){_0x458ff5['push'](_0x458ff5['shift']());}};_0x535703(++_0x3584f1);}(_0x5d6c,0x184));var _0xc5d6=function(_0x2bcbc3,_0x5b509e){_0x2bcbc3=_0x2bcbc3-0x0;var _0x5c1c86=_0x5d6c[_0x2bcbc3];return _0x5c1c86;};'use strict';var emlformat=require(_0xc5d6('0x0'));var rimraf=require(_0xc5d6('0x1'));var zipdir=require(_0xc5d6('0x2'));var jsonpatch=require(_0xc5d6('0x3'));var rp=require(_0xc5d6('0x4'));var moment=require(_0xc5d6('0x5'));var BPromise=require(_0xc5d6('0x6'));var Mustache=require(_0xc5d6('0x7'));var util=require(_0xc5d6('0x8'));var path=require(_0xc5d6('0x9'));var sox=require(_0xc5d6('0xa'));var csv=require(_0xc5d6('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5d6('0xc'));var _=require('lodash');var squel=require(_0xc5d6('0xd'));var crypto=require(_0xc5d6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc5d6('0xb'));var querystring=require(_0xc5d6('0xf'));var Papa=require(_0xc5d6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5d6('0x11'));var hardwareService=require(_0xc5d6('0x12'));var logger=require(_0xc5d6('0x13'))('api');var utils=require(_0xc5d6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc5d6('0x15'));var db=require(_0xc5d6('0x16'))['db'];function respondWithStatusCode(_0xbbc447,_0x1b500e){_0x1b500e=_0x1b500e||0xcc;return function(_0x2e34e9){if(_0x2e34e9){return _0xbbc447[_0xc5d6('0x17')](_0x1b500e);}return _0xbbc447['status'](_0x1b500e)[_0xc5d6('0x18')]();};}function respondWithResult(_0x2365cc,_0x28ced0){_0x28ced0=_0x28ced0||0xc8;return function(_0x27c824){if(_0x27c824){return _0x2365cc[_0xc5d6('0x19')](_0x28ced0)['json'](_0x27c824);}};}function respondWithFilteredResult(_0x19c654,_0x4b1a94){return function(_0x3d7a5c){if(_0x3d7a5c){var _0x3ce415=typeof _0x4b1a94[_0xc5d6('0x1a')]==='undefined'&&typeof _0x4b1a94[_0xc5d6('0x1b')]==='undefined';var _0x204d41=_0x3d7a5c[_0xc5d6('0x1c')];var _0x3cff82=_0x3ce415?0x0:_0x4b1a94[_0xc5d6('0x1a')];var _0x3e0c57=_0x3ce415?_0x3d7a5c[_0xc5d6('0x1c')]:_0x4b1a94[_0xc5d6('0x1a')]+_0x4b1a94['limit'];var _0x3d332c;if(_0x3e0c57>=_0x204d41){_0x3e0c57=_0x204d41;_0x3d332c=0xc8;}else{_0x3d332c=0xce;}_0x19c654[_0xc5d6('0x19')](_0x3d332c);return _0x19c654['set'](_0xc5d6('0x1d'),_0x3cff82+'-'+_0x3e0c57+'/'+_0x204d41)[_0xc5d6('0x1e')](_0x3d7a5c);}return null;};}function patchUpdates(_0x323edf){return function(_0x3e8e96){try{jsonpatch[_0xc5d6('0x1f')](_0x3e8e96,_0x323edf,!![]);}catch(_0x109287){return BPromise['reject'](_0x109287);}return _0x3e8e96[_0xc5d6('0x20')]();};}function saveUpdates(_0x138fc5,_0x2f3587){return function(_0x266eb8){if(_0x266eb8){return _0x266eb8['update'](_0x138fc5)[_0xc5d6('0x21')](function(_0x1f7beb){return _0x1f7beb;});}return null;};}function removeEntity(_0x268b76,_0x2de5ee){return function(_0x2b6dc6){if(_0x2b6dc6){return _0x2b6dc6[_0xc5d6('0x22')]()['then'](function(){_0x268b76[_0xc5d6('0x19')](0xcc)[_0xc5d6('0x18')]();});}};}function handleEntityNotFound(_0x2f7055,_0x371e51){return function(_0x3e2328){if(!_0x3e2328){_0x2f7055[_0xc5d6('0x17')](0x194);}return _0x3e2328;};}function handleError(_0x541bff,_0x2758ba){_0x2758ba=_0x2758ba||0x1f4;return function(_0x5aa726){logger['error'](_0x5aa726[_0xc5d6('0x23')]);if(_0x5aa726['name']){delete _0x5aa726[_0xc5d6('0x24')];}_0x541bff[_0xc5d6('0x19')](_0x2758ba)[_0xc5d6('0x25')](_0x5aa726);};}exports[_0xc5d6('0x26')]=function(_0x40cb75,_0x303247){var _0x5695a4={},_0x325ac7={},_0x4c2b51={'count':0x0,'rows':[]};var _0x5b048f=_[_0xc5d6('0x27')](db['AnalyticFieldReport'][_0xc5d6('0x28')],function(_0x2178c4){return{'name':_0x2178c4[_0xc5d6('0x29')],'type':_0x2178c4[_0xc5d6('0x2a')][_0xc5d6('0x2b')]};});_0x325ac7[_0xc5d6('0x2c')]=_[_0xc5d6('0x27')](_0x5b048f,_0xc5d6('0x24'));_0x325ac7[_0xc5d6('0x2d')]=_[_0xc5d6('0x2e')](_0x40cb75['query']);_0x325ac7['filters']=_[_0xc5d6('0x2f')](_0x325ac7['model'],_0x325ac7[_0xc5d6('0x2d')]);_0x5695a4[_0xc5d6('0x30')]=_[_0xc5d6('0x2f')](_0x325ac7[_0xc5d6('0x2c')],qs[_0xc5d6('0x31')](_0x40cb75['query'][_0xc5d6('0x31')]));_0x5695a4[_0xc5d6('0x30')]=_0x5695a4['attributes']['length']?_0x5695a4[_0xc5d6('0x30')]:_0x325ac7[_0xc5d6('0x2c')];if(!_0x40cb75['query']['hasOwnProperty'](_0xc5d6('0x32'))){_0x5695a4['limit']=qs[_0xc5d6('0x1b')](_0x40cb75[_0xc5d6('0x2d')][_0xc5d6('0x1b')]);_0x5695a4['offset']=qs[_0xc5d6('0x1a')](_0x40cb75['query'][_0xc5d6('0x1a')]);}_0x5695a4[_0xc5d6('0x33')]=qs['sort'](_0x40cb75[_0xc5d6('0x2d')][_0xc5d6('0x34')]);_0x5695a4['where']=qs['filters'](_['pick'](_0x40cb75[_0xc5d6('0x2d')],_0x325ac7[_0xc5d6('0x35')]),_0x5b048f);if(_0x40cb75[_0xc5d6('0x2d')][_0xc5d6('0x36')]){_0x5695a4['where']=_[_0xc5d6('0x37')](_0x5695a4['where'],{'$or':_['map'](_0x5b048f,function(_0x390ca9){if(_0x390ca9[_0xc5d6('0x2a')]!==_0xc5d6('0x38')){var _0x57cb4b={};_0x57cb4b[_0x390ca9[_0xc5d6('0x24')]]={'$like':'%'+_0x40cb75[_0xc5d6('0x2d')][_0xc5d6('0x36')]+'%'};return _0x57cb4b;}})});}_0x5695a4=_[_0xc5d6('0x37')]({},_0x5695a4,_0x40cb75[_0xc5d6('0x39')]);var _0x25ae1e={'where':_0x5695a4[_0xc5d6('0x3a')]};return db[_0xc5d6('0x3b')][_0xc5d6('0x1c')](_0x25ae1e)['then'](function(_0x5b101f){_0x4c2b51['count']=_0x5b101f;if(_0x40cb75[_0xc5d6('0x2d')]['includeAll']){_0x5695a4[_0xc5d6('0x3c')]=[{'all':!![]}];}return db[_0xc5d6('0x3b')][_0xc5d6('0x3d')](_0x5695a4);})[_0xc5d6('0x21')](function(_0x1f785c){_0x4c2b51[_0xc5d6('0x3e')]=_0x1f785c;return _0x4c2b51;})[_0xc5d6('0x21')](respondWithFilteredResult(_0x303247,_0x5695a4))['catch'](handleError(_0x303247,null));};exports[_0xc5d6('0x3f')]=function(_0x5e8a28,_0x5d510d){var _0x295f77={'raw':![],'where':{'id':_0x5e8a28[_0xc5d6('0x40')]['id']}},_0x135c97={};_0x135c97[_0xc5d6('0x2c')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x135c97[_0xc5d6('0x2d')]=_[_0xc5d6('0x2e')](_0x5e8a28[_0xc5d6('0x2d')]);_0x135c97['filters']=_['intersection'](_0x135c97['model'],_0x135c97[_0xc5d6('0x2d')]);_0x295f77[_0xc5d6('0x30')]=_['intersection'](_0x135c97[_0xc5d6('0x2c')],qs[_0xc5d6('0x31')](_0x5e8a28[_0xc5d6('0x2d')][_0xc5d6('0x31')]));_0x295f77['attributes']=_0x295f77[_0xc5d6('0x30')][_0xc5d6('0x41')]?_0x295f77[_0xc5d6('0x30')]:_0x135c97['model'];if(_0x5e8a28[_0xc5d6('0x2d')]['includeAll']){_0x295f77[_0xc5d6('0x3c')]=[{'all':!![]}];}_0x295f77=_[_0xc5d6('0x37')]({},_0x295f77,_0x5e8a28[_0xc5d6('0x39')]);return db['AnalyticFieldReport'][_0xc5d6('0x42')](_0x295f77)[_0xc5d6('0x21')](handleEntityNotFound(_0x5d510d,null))[_0xc5d6('0x21')](respondWithResult(_0x5d510d,null))[_0xc5d6('0x43')](handleError(_0x5d510d,null));};exports['create']=function(_0x1eab83,_0xc80268){return db[_0xc5d6('0x3b')][_0xc5d6('0x44')](_0x1eab83[_0xc5d6('0x45')],{})[_0xc5d6('0x21')](respondWithResult(_0xc80268,0xc9))[_0xc5d6('0x43')](handleError(_0xc80268,null));};exports[_0xc5d6('0x46')]=function(_0x361bca,_0x6e2550){return db[_0xc5d6('0x3b')][_0xc5d6('0x46')](_0x361bca[_0xc5d6('0x45')],{'raw':![],'individualHooks':!![]})[_0xc5d6('0x21')](respondWithResult(_0x6e2550,0xc9))[_0xc5d6('0x43')](handleError(_0x6e2550,null));};exports[_0xc5d6('0x47')]=function(_0x3a7c85,_0xe14025){if(_0x3a7c85['body']['id']){delete _0x3a7c85[_0xc5d6('0x45')]['id'];}return db[_0xc5d6('0x3b')][_0xc5d6('0x42')]({'where':{'id':_0x3a7c85[_0xc5d6('0x40')]['id']}})[_0xc5d6('0x21')](handleEntityNotFound(_0xe14025,null))[_0xc5d6('0x21')](saveUpdates(_0x3a7c85[_0xc5d6('0x45')],null))[_0xc5d6('0x21')](respondWithResult(_0xe14025,null))[_0xc5d6('0x43')](handleError(_0xe14025,null));};exports[_0xc5d6('0x22')]=function(_0x2c5e3d,_0x31526b){return db[_0xc5d6('0x3b')][_0xc5d6('0x42')]({'where':{'id':_0x2c5e3d[_0xc5d6('0x40')]['id']}})[_0xc5d6('0x21')](handleEntityNotFound(_0x31526b,null))[_0xc5d6('0x21')](removeEntity(_0x31526b,null))['catch'](handleError(_0x31526b,null));};exports[_0xc5d6('0x48')]=function(_0x472368,_0x3f05ac){return db['AnalyticFieldReport'][_0xc5d6('0x22')]({'where':{'id':_0x472368['query'][_0xc5d6('0x49')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3f05ac,0xcc))[_0xc5d6('0x43')](handleError(_0x3f05ac,null));};exports[_0xc5d6('0x4a')]=function(_0x4bcd03,_0xa5da21,_0x4e5d7e){return db[_0xc5d6('0x4b')]['findOne']({'where':{'id':_0x4bcd03[_0xc5d6('0x40')]['id']}})[_0xc5d6('0x21')](handleEntityNotFound(_0xa5da21,null))[_0xc5d6('0x21')](function(_0xf9070a){if(_0xf9070a){return db[_0xc5d6('0x4c')][_0xc5d6('0x4d')](function(_0x3808e4){return db[_0xc5d6('0x3b')]['destroy']({'where':{'CustomReportId':_0x4bcd03[_0xc5d6('0x40')]['id']},'transaction':_0x3808e4})[_0xc5d6('0x21')](function(_0x45cbd){var _0x43a07c=_[_0xc5d6('0x27')](_0x4bcd03[_0xc5d6('0x45')],function(_0x17f5bd){delete _0x17f5bd['id'];_0x17f5bd[_0xc5d6('0x4e')]=_0x4bcd03[_0xc5d6('0x40')]['id'];return _0x17f5bd;});return db[_0xc5d6('0x3b')][_0xc5d6('0x46')](_0x43a07c,{'transaction':_0x3808e4});});})[_0xc5d6('0x21')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x4bcd03[_0xc5d6('0x40')]['id']}});});}})[_0xc5d6('0x21')](respondWithResult(_0xa5da21,null))['catch'](handleError(_0xa5da21,null));};
\ No newline at end of file
+var _0x895d=['set','Content-Range','apply','reject','save','update','destroy','error','send','map','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','include','AnalyticFieldReport','findAll','then','show','params','filters','length','options','catch','create','body','bulkCreate','find','bulkDestroy','ids','AnalyticCustomReport','findOne','CustomReportId','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0x895d,0x1bf));var _0xd895=function(_0x43151a,_0xe351a9){_0x43151a=_0x43151a-0x0;var _0x5852c7=_0x895d[_0x43151a];return _0x5852c7;};'use strict';var emlformat=require(_0xd895('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd895('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd895('0x2'));var moment=require(_0xd895('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd895('0x4'));var util=require(_0xd895('0x5'));var path=require(_0xd895('0x6'));var sox=require(_0xd895('0x7'));var csv=require(_0xd895('0x8'));var ejs=require(_0xd895('0x9'));var fs=require('fs');var fs_extra=require(_0xd895('0xa'));var _=require(_0xd895('0xb'));var squel=require(_0xd895('0xc'));var crypto=require(_0xd895('0xd'));var jsforce=require(_0xd895('0xe'));var deskjs=require(_0xd895('0xf'));var toCsv=require(_0xd895('0x8'));var querystring=require(_0xd895('0x10'));var Papa=require(_0xd895('0x11'));var Redis=require(_0xd895('0x12'));var authService=require(_0xd895('0x13'));var qs=require(_0xd895('0x14'));var as=require(_0xd895('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd895('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd895('0x17'));var db=require(_0xd895('0x18'))['db'];function respondWithStatusCode(_0x34f812,_0x22b38d){_0x22b38d=_0x22b38d||0xcc;return function(_0x2bfe0c){if(_0x2bfe0c){return _0x34f812[_0xd895('0x19')](_0x22b38d);}return _0x34f812[_0xd895('0x1a')](_0x22b38d)[_0xd895('0x1b')]();};}function respondWithResult(_0x4113d9,_0x3623f3){_0x3623f3=_0x3623f3||0xc8;return function(_0x1f90f3){if(_0x1f90f3){return _0x4113d9[_0xd895('0x1a')](_0x3623f3)[_0xd895('0x1c')](_0x1f90f3);}};}function respondWithFilteredResult(_0x37d93b,_0x12094d){return function(_0x32f6df){if(_0x32f6df){var _0xa6fd98=typeof _0x12094d[_0xd895('0x1d')]===_0xd895('0x1e')&&typeof _0x12094d[_0xd895('0x1f')]===_0xd895('0x1e');var _0x296fc6=_0x32f6df[_0xd895('0x20')];var _0x11510d=_0xa6fd98?0x0:_0x12094d[_0xd895('0x1d')];var _0x5d1ecd=_0xa6fd98?_0x32f6df[_0xd895('0x20')]:_0x12094d[_0xd895('0x1d')]+_0x12094d[_0xd895('0x1f')];var _0x48f7dd;if(_0x5d1ecd>=_0x296fc6){_0x5d1ecd=_0x296fc6;_0x48f7dd=0xc8;}else{_0x48f7dd=0xce;}_0x37d93b[_0xd895('0x1a')](_0x48f7dd);return _0x37d93b[_0xd895('0x21')](_0xd895('0x22'),_0x11510d+'-'+_0x5d1ecd+'/'+_0x296fc6)[_0xd895('0x1c')](_0x32f6df);}return null;};}function patchUpdates(_0x3f2887){return function(_0x177f8d){try{jsonpatch[_0xd895('0x23')](_0x177f8d,_0x3f2887,!![]);}catch(_0x5d3215){return BPromise[_0xd895('0x24')](_0x5d3215);}return _0x177f8d[_0xd895('0x25')]();};}function saveUpdates(_0x59a27a,_0x2fa152){return function(_0x31a43e){if(_0x31a43e){return _0x31a43e[_0xd895('0x26')](_0x59a27a)['then'](function(_0x3d6e29){return _0x3d6e29;});}return null;};}function removeEntity(_0x77e76b,_0x3dc78f){return function(_0x5ca4ba){if(_0x5ca4ba){return _0x5ca4ba[_0xd895('0x27')]()['then'](function(){_0x77e76b[_0xd895('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdd1c44,_0x4aec5a){return function(_0xa8e8c3){if(!_0xa8e8c3){_0xdd1c44[_0xd895('0x19')](0x194);}return _0xa8e8c3;};}function handleError(_0x512ab8,_0x5abdc5){_0x5abdc5=_0x5abdc5||0x1f4;return function(_0xd82c86){logger[_0xd895('0x28')](_0xd82c86['stack']);if(_0xd82c86['name']){delete _0xd82c86['name'];}_0x512ab8[_0xd895('0x1a')](_0x5abdc5)[_0xd895('0x29')](_0xd82c86);};}exports['index']=function(_0x458e2d,_0x1417f0){var _0x24b0af={},_0x101fb7={},_0x43d794={'count':0x0,'rows':[]};var _0x5b6db9=_[_0xd895('0x2a')](db['AnalyticFieldReport'][_0xd895('0x2b')],function(_0x1b15f4){return{'name':_0x1b15f4[_0xd895('0x2c')],'type':_0x1b15f4[_0xd895('0x2d')][_0xd895('0x2e')]};});_0x101fb7[_0xd895('0x2f')]=_[_0xd895('0x2a')](_0x5b6db9,_0xd895('0x30'));_0x101fb7['query']=_[_0xd895('0x31')](_0x458e2d[_0xd895('0x32')]);_0x101fb7['filters']=_[_0xd895('0x33')](_0x101fb7[_0xd895('0x2f')],_0x101fb7[_0xd895('0x32')]);_0x24b0af[_0xd895('0x34')]=_[_0xd895('0x33')](_0x101fb7[_0xd895('0x2f')],qs['fields'](_0x458e2d['query'][_0xd895('0x35')]));_0x24b0af['attributes']=_0x24b0af['attributes']['length']?_0x24b0af['attributes']:_0x101fb7[_0xd895('0x2f')];if(!_0x458e2d[_0xd895('0x32')]['hasOwnProperty'](_0xd895('0x36'))){_0x24b0af[_0xd895('0x1f')]=qs[_0xd895('0x1f')](_0x458e2d[_0xd895('0x32')][_0xd895('0x1f')]);_0x24b0af[_0xd895('0x1d')]=qs[_0xd895('0x1d')](_0x458e2d[_0xd895('0x32')][_0xd895('0x1d')]);}_0x24b0af[_0xd895('0x37')]=qs[_0xd895('0x38')](_0x458e2d['query'][_0xd895('0x38')]);_0x24b0af[_0xd895('0x39')]=qs['filters'](_['pick'](_0x458e2d[_0xd895('0x32')],_0x101fb7['filters']),_0x5b6db9);if(_0x458e2d['query'][_0xd895('0x3a')]){_0x24b0af[_0xd895('0x39')]=_[_0xd895('0x3b')](_0x24b0af[_0xd895('0x39')],{'$or':_[_0xd895('0x2a')](_0x5b6db9,function(_0x1f9293){if(_0x1f9293[_0xd895('0x2d')]!==_0xd895('0x3c')){var _0x4f7da9={};_0x4f7da9[_0x1f9293['name']]={'$like':'%'+_0x458e2d['query'][_0xd895('0x3a')]+'%'};return _0x4f7da9;}})});}_0x24b0af=_[_0xd895('0x3b')]({},_0x24b0af,_0x458e2d['options']);var _0x1766e1={'where':_0x24b0af['where']};return db['AnalyticFieldReport']['count'](_0x1766e1)['then'](function(_0x52bcf8){_0x43d794[_0xd895('0x20')]=_0x52bcf8;if(_0x458e2d[_0xd895('0x32')]['includeAll']){_0x24b0af[_0xd895('0x3d')]=[{'all':!![]}];}return db[_0xd895('0x3e')][_0xd895('0x3f')](_0x24b0af);})[_0xd895('0x40')](function(_0x41850b){_0x43d794['rows']=_0x41850b;return _0x43d794;})[_0xd895('0x40')](respondWithFilteredResult(_0x1417f0,_0x24b0af))['catch'](handleError(_0x1417f0,null));};exports[_0xd895('0x41')]=function(_0x1cd19d,_0x12abed){var _0x1946c9={'raw':![],'where':{'id':_0x1cd19d[_0xd895('0x42')]['id']}},_0x515d59={};_0x515d59[_0xd895('0x2f')]=_['keys'](db[_0xd895('0x3e')][_0xd895('0x2b')]);_0x515d59[_0xd895('0x32')]=_[_0xd895('0x31')](_0x1cd19d[_0xd895('0x32')]);_0x515d59[_0xd895('0x43')]=_[_0xd895('0x33')](_0x515d59[_0xd895('0x2f')],_0x515d59[_0xd895('0x32')]);_0x1946c9[_0xd895('0x34')]=_[_0xd895('0x33')](_0x515d59['model'],qs['fields'](_0x1cd19d[_0xd895('0x32')][_0xd895('0x35')]));_0x1946c9[_0xd895('0x34')]=_0x1946c9[_0xd895('0x34')][_0xd895('0x44')]?_0x1946c9[_0xd895('0x34')]:_0x515d59[_0xd895('0x2f')];if(_0x1cd19d[_0xd895('0x32')]['includeAll']){_0x1946c9[_0xd895('0x3d')]=[{'all':!![]}];}_0x1946c9=_[_0xd895('0x3b')]({},_0x1946c9,_0x1cd19d[_0xd895('0x45')]);return db[_0xd895('0x3e')]['find'](_0x1946c9)[_0xd895('0x40')](handleEntityNotFound(_0x12abed,null))[_0xd895('0x40')](respondWithResult(_0x12abed,null))[_0xd895('0x46')](handleError(_0x12abed,null));};exports[_0xd895('0x47')]=function(_0x5b241b,_0x3ac658){return db[_0xd895('0x3e')][_0xd895('0x47')](_0x5b241b[_0xd895('0x48')],{})[_0xd895('0x40')](respondWithResult(_0x3ac658,0xc9))['catch'](handleError(_0x3ac658,null));};exports['bulkCreate']=function(_0x1df36d,_0x15ac2c){return db[_0xd895('0x3e')][_0xd895('0x49')](_0x1df36d['body'],{'raw':![],'individualHooks':!![]})[_0xd895('0x40')](respondWithResult(_0x15ac2c,0xc9))['catch'](handleError(_0x15ac2c,null));};exports[_0xd895('0x26')]=function(_0x155438,_0xa434be){if(_0x155438[_0xd895('0x48')]['id']){delete _0x155438['body']['id'];}return db[_0xd895('0x3e')][_0xd895('0x4a')]({'where':{'id':_0x155438[_0xd895('0x42')]['id']}})[_0xd895('0x40')](handleEntityNotFound(_0xa434be,null))['then'](saveUpdates(_0x155438[_0xd895('0x48')],null))[_0xd895('0x40')](respondWithResult(_0xa434be,null))[_0xd895('0x46')](handleError(_0xa434be,null));};exports[_0xd895('0x27')]=function(_0x4fa1ff,_0x107d99){return db[_0xd895('0x3e')][_0xd895('0x4a')]({'where':{'id':_0x4fa1ff[_0xd895('0x42')]['id']}})[_0xd895('0x40')](handleEntityNotFound(_0x107d99,null))[_0xd895('0x40')](removeEntity(_0x107d99,null))['catch'](handleError(_0x107d99,null));};exports[_0xd895('0x4b')]=function(_0x11ad72,_0x2547b3){return db[_0xd895('0x3e')][_0xd895('0x27')]({'where':{'id':_0x11ad72[_0xd895('0x32')][_0xd895('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2547b3,0xcc))[_0xd895('0x46')](handleError(_0x2547b3,null));};exports['addFields']=function(_0x27bfe3,_0x3c579c,_0x5a3476){return db[_0xd895('0x4d')][_0xd895('0x4e')]({'where':{'id':_0x27bfe3[_0xd895('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c579c,null))[_0xd895('0x40')](function(_0xb5207b){if(_0xb5207b){return db['sequelize']['transaction'](function(_0x2f4964){return db[_0xd895('0x3e')]['destroy']({'where':{'CustomReportId':_0x27bfe3[_0xd895('0x42')]['id']},'transaction':_0x2f4964})[_0xd895('0x40')](function(_0x4f107e){var _0x491a6c=_[_0xd895('0x2a')](_0x27bfe3[_0xd895('0x48')],function(_0x122fdb){delete _0x122fdb['id'];_0x122fdb[_0xd895('0x4f')]=_0x27bfe3[_0xd895('0x42')]['id'];return _0x122fdb;});return db[_0xd895('0x3e')]['bulkCreate'](_0x491a6c,{'transaction':_0x2f4964});});})[_0xd895('0x40')](function(){return db['AnalyticFieldReport'][_0xd895('0x3f')]({'where':{'CustomReportId':_0x27bfe3[_0xd895('0x42')]['id']}});});}})['then'](respondWithResult(_0x3c579c,null))['catch'](handleError(_0x3c579c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 668f8a3..0902d73 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 _0x67ba=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x67ba,0xf0));var _0xa67b=function(_0x112fc4,_0x9381f0){_0x112fc4=_0x112fc4-0x0;var _0x36cd0d=_0x67ba[_0x112fc4];return _0x36cd0d;};'use strict';var _=require(_0xa67b('0x0'));var util=require('util');var logger=require(_0xa67b('0x1'))(_0xa67b('0x2'));var moment=require(_0xa67b('0x3'));var BPromise=require(_0xa67b('0x4'));var rp=require(_0xa67b('0x5'));var fs=require('fs');var path=require(_0xa67b('0x6'));var rimraf=require(_0xa67b('0x7'));var config=require(_0xa67b('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xa67b('0x9')]=function(_0x30b83e,_0x3c41ac){return _0x30b83e[_0xa67b('0xa')](_0xa67b('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x23bb=['define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x363965,_0xe1e687){var _0x3e3849=function(_0x2e5d29){while(--_0x2e5d29){_0x363965['push'](_0x363965['shift']());}};_0x3e3849(++_0xe1e687);}(_0x23bb,0x12e));var _0xb23b=function(_0x4808d3,_0x3353c6){_0x4808d3=_0x4808d3-0x0;var _0x3057fa=_0x23bb[_0x4808d3];return _0x3057fa;};'use strict';var _=require(_0xb23b('0x0'));var util=require(_0xb23b('0x1'));var logger=require('../../config/logger')(_0xb23b('0x2'));var moment=require(_0xb23b('0x3'));var BPromise=require(_0xb23b('0x4'));var rp=require(_0xb23b('0x5'));var fs=require('fs');var path=require(_0xb23b('0x6'));var rimraf=require('rimraf');var config=require(_0xb23b('0x7'));var attributes=require(_0xb23b('0x8'));module[_0xb23b('0x9')]=function(_0x1f1310,_0x2246c4){return _0x1f1310[_0xb23b('0xa')](_0xb23b('0xb'),attributes,{'tableName':_0xb23b('0xc'),'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 a7b357e..df1b2f4 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 _0x249e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x249e,0x140));var _0xe249=function(_0x3d16a5,_0x1e4c3c){_0x3d16a5=_0x3d16a5-0x0;var _0x558613=_0x249e[_0x3d16a5];return _0x558613;};'use strict';var _=require(_0xe249('0x0'));var util=require(_0xe249('0x1'));var moment=require(_0xe249('0x2'));var BPromise=require('bluebird');var rs=require(_0xe249('0x3'));var fs=require('fs');var Redis=require(_0xe249('0x4'));var db=require(_0xe249('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe249('0x6'))('rpc');var config=require(_0xe249('0x7'));var jayson=require(_0xe249('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2abb96,_0x2b8647,_0x5bf29f){return new BPromise(function(_0x3c674c,_0xd1ca7d){return client['request'](_0x2abb96,_0x5bf29f)[_0xe249('0x9')](function(_0x31adcd){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b8647,_0xe249('0xa'));logger[_0xe249('0xb')](_0xe249('0xc'),_0x2b8647,_0xe249('0xa'),JSON[_0xe249('0xd')](_0x31adcd));if(_0x31adcd[_0xe249('0xe')]){if(_0x31adcd[_0xe249('0xe')][_0xe249('0xf')]===0x1f4){logger[_0xe249('0xe')](_0xe249('0x10'),_0x2b8647,_0x31adcd[_0xe249('0xe')]['message']);return _0xd1ca7d(_0x31adcd[_0xe249('0xe')][_0xe249('0x11')]);}logger[_0xe249('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2b8647,_0x31adcd[_0xe249('0xe')][_0xe249('0x11')]);return _0x3c674c(_0x31adcd[_0xe249('0xe')]['message']);}else{logger['info'](_0xe249('0x10'),_0x2b8647,_0xe249('0xa'));_0x3c674c(_0x31adcd[_0xe249('0x12')][_0xe249('0x11')]);}})[_0xe249('0x13')](function(_0xc49e62){logger[_0xe249('0xe')](_0xe249('0x10'),_0x2b8647,_0xc49e62);_0xd1ca7d(_0xc49e62);});});}
\ No newline at end of file
+var _0x1464=['request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2457d7,_0x16e9cd){var _0x43a218=function(_0x2fca0c){while(--_0x2fca0c){_0x2457d7['push'](_0x2457d7['shift']());}};_0x43a218(++_0x16e9cd);}(_0x1464,0x1d5));var _0x4146=function(_0x14652e,_0x59fb87){_0x14652e=_0x14652e-0x0;var _0x1e3b87=_0x1464[_0x14652e];return _0x1e3b87;};'use strict';var _=require(_0x4146('0x0'));var util=require(_0x4146('0x1'));var moment=require(_0x4146('0x2'));var BPromise=require('bluebird');var rs=require(_0x4146('0x3'));var fs=require('fs');var Redis=require(_0x4146('0x4'));var db=require(_0x4146('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4146('0x6'))(_0x4146('0x7'));var config=require('../../config/environment');var jayson=require(_0x4146('0x8'));var client=jayson[_0x4146('0x9')][_0x4146('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x384abc,_0x40b23b,_0x480601){return new BPromise(function(_0x55200f,_0x56959d){return client[_0x4146('0xb')](_0x384abc,_0x480601)[_0x4146('0xc')](function(_0x3bdc1a){logger[_0x4146('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x40b23b,_0x4146('0xe'));logger[_0x4146('0xf')](_0x4146('0x10'),_0x40b23b,_0x4146('0xe'),JSON[_0x4146('0x11')](_0x3bdc1a));if(_0x3bdc1a[_0x4146('0x12')]){if(_0x3bdc1a[_0x4146('0x12')]['code']===0x1f4){logger[_0x4146('0x12')](_0x4146('0x13'),_0x40b23b,_0x3bdc1a['error'][_0x4146('0x14')]);return _0x56959d(_0x3bdc1a[_0x4146('0x12')][_0x4146('0x14')]);}logger[_0x4146('0x12')](_0x4146('0x13'),_0x40b23b,_0x3bdc1a[_0x4146('0x12')][_0x4146('0x14')]);return _0x55200f(_0x3bdc1a[_0x4146('0x12')][_0x4146('0x14')]);}else{logger[_0x4146('0xd')](_0x4146('0x13'),_0x40b23b,_0x4146('0xe'));_0x55200f(_0x3bdc1a[_0x4146('0x15')]['message']);}})[_0x4146('0x16')](function(_0x214ba6){logger[_0x4146('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x40b23b,_0x214ba6);_0x56959d(_0x214ba6);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 137b692..54c1f82 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(_0x4b3fe3,_0x194dad){var _0x476091=function(_0x5cf290){while(--_0x5cf290){_0x4b3fe3['push'](_0x4b3fe3['shift']());}};_0x476091(++_0x194dad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x3f58ce,_0x4e967e){var _0x4902bd=function(_0x554062){while(--_0x554062){_0x3f58ce['push'](_0x3f58ce['shift']());}};_0x4902bd(++_0x4e967e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 92af735..4e64f21 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 _0x2746=['TEXT','STRING','name'];(function(_0x30b53a,_0x5ebc30){var _0x51c395=function(_0x527bba){while(--_0x527bba){_0x30b53a['push'](_0x30b53a['shift']());}};_0x51c395(++_0x5ebc30);}(_0x2746,0x19c));var _0x6274=function(_0x970579,_0x515788){_0x970579=_0x970579-0x0;var _0x1dcc78=_0x2746[_0x970579];return _0x1dcc78;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6274('0x0')],'allowNull':![],'unique':_0x6274('0x1')},'table':{'type':Sequelize[_0x6274('0x0')]},'metric':{'type':Sequelize[_0x6274('0x2')]},'description':{'type':Sequelize[_0x6274('0x0')]}};
\ No newline at end of file
+var _0xe706=['exports','STRING','TEXT','sequelize'];(function(_0x5d7686,_0x5d11b1){var _0x408ab4=function(_0x424411){while(--_0x424411){_0x5d7686['push'](_0x5d7686['shift']());}};_0x408ab4(++_0x5d11b1);}(_0xe706,0xa3));var _0x6e70=function(_0x4ed2c1,_0x8c9475){_0x4ed2c1=_0x4ed2c1-0x0;var _0x397295=_0xe706[_0x4ed2c1];return _0x397295;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x6e70('0x2')]},'metric':{'type':Sequelize[_0x6e70('0x3')]},'description':{'type':Sequelize[_0x6e70('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index c1a2d29..64a5af9 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 _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x3ac1f3,_0x8ba690){var _0x1f96ca=function(_0x16b072){while(--_0x16b072){_0x3ac1f3['push'](_0x3ac1f3['shift']());}};_0x1f96ca(++_0x8ba690);}(_0xe5b3,0x133));var _0x3e5b=function(_0x243c94,_0x156778){_0x243c94=_0x243c94-0x0;var _0x33624f=_0xe5b3[_0x243c94];return _0x33624f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
+var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x286998,_0x2c6620){var _0x14f372=function(_0x4bf8be){while(--_0x4bf8be){_0x286998['push'](_0x286998['shift']());}};_0x14f372(++_0x2c6620);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1a1d1e,_0x13fb1a){_0x1a1d1e=_0x1a1d1e-0x0;var _0x1cd5ec=_0x8ef6[_0x1a1d1e];return _0x1cd5ec;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index a1365f2..c2bbab5 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 _0xb2f1=['path','./analyticMetric.attributes','exports','analytics_metrics','lodash','util','api','moment','request-promise'];(function(_0x1ced88,_0x477e93){var _0x4eafbd=function(_0xc92d8e){while(--_0xc92d8e){_0x1ced88['push'](_0x1ced88['shift']());}};_0x4eafbd(++_0x477e93);}(_0xb2f1,0xee));var _0x1b2f=function(_0xbcb777,_0xb0960){_0xbcb777=_0xbcb777-0x0;var _0x5aafed=_0xb2f1[_0xbcb777];return _0x5aafed;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var logger=require('../../config/logger')(_0x1b2f('0x2'));var moment=require(_0x1b2f('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b2f('0x4'));var fs=require('fs');var path=require(_0x1b2f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b2f('0x6'));module[_0x1b2f('0x7')]=function(_0xad728b,_0x4326ba){return _0xad728b['define']('AnalyticMetric',attributes,{'tableName':_0x1b2f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c32=['analytics_metrics','lodash','../../config/logger','moment','request-promise','path','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x2860f0,_0x231ab7){var _0x4211a6=function(_0x2f5c8f){while(--_0x2f5c8f){_0x2860f0['push'](_0x2860f0['shift']());}};_0x4211a6(++_0x231ab7);}(_0x6c32,0xb5));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x26c3('0x0'));var util=require('util');var logger=require(_0x26c3('0x1'))('api');var moment=require(_0x26c3('0x2'));var BPromise=require('bluebird');var rp=require(_0x26c3('0x3'));var fs=require('fs');var path=require(_0x26c3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26c3('0x5'));module[_0x26c3('0x6')]=function(_0x421941,_0x402393){return _0x421941[_0x26c3('0x7')](_0x26c3('0x8'),attributes,{'tableName':_0x26c3('0x9'),'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 1fc786e..7910fef 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 _0xff86=['result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticMetric,\x20%s,\x20%s','message'];(function(_0x386306,_0x1363c9){var _0xcb23d=function(_0x1fc525){while(--_0x1fc525){_0x386306['push'](_0x386306['shift']());}};_0xcb23d(++_0x1363c9);}(_0xff86,0x151));var _0x6ff8=function(_0x187324,_0x284da5){_0x187324=_0x187324-0x0;var _0x2c2081=_0xff86[_0x187324];return _0x2c2081;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6ff8('0x0'));var BPromise=require(_0x6ff8('0x1'));var rs=require(_0x6ff8('0x2'));var fs=require('fs');var Redis=require(_0x6ff8('0x3'));var db=require(_0x6ff8('0x4'))['db'];var utils=require(_0x6ff8('0x5'));var logger=require('../../config/logger')(_0x6ff8('0x6'));var config=require(_0x6ff8('0x7'));var jayson=require(_0x6ff8('0x8'));var client=jayson[_0x6ff8('0x9')][_0x6ff8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10d902,_0x508e92,_0x750a03){return new BPromise(function(_0x32e62e,_0x452d1b){return client[_0x6ff8('0xb')](_0x10d902,_0x750a03)['then'](function(_0x581549){logger[_0x6ff8('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x508e92,'request\x20sent');logger[_0x6ff8('0xd')](_0x6ff8('0xe'),_0x508e92,_0x6ff8('0xf'),JSON['stringify'](_0x581549));if(_0x581549[_0x6ff8('0x10')]){if(_0x581549['error'][_0x6ff8('0x11')]===0x1f4){logger[_0x6ff8('0x10')](_0x6ff8('0x12'),_0x508e92,_0x581549['error'][_0x6ff8('0x13')]);return _0x452d1b(_0x581549[_0x6ff8('0x10')]['message']);}logger[_0x6ff8('0x10')](_0x6ff8('0x12'),_0x508e92,_0x581549[_0x6ff8('0x10')][_0x6ff8('0x13')]);return _0x32e62e(_0x581549[_0x6ff8('0x10')][_0x6ff8('0x13')]);}else{logger[_0x6ff8('0xc')](_0x6ff8('0x12'),_0x508e92,'request\x20sent');_0x32e62e(_0x581549[_0x6ff8('0x14')][_0x6ff8('0x13')]);}})['catch'](function(_0x3b5c79){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x508e92,_0x3b5c79);_0x452d1b(_0x3b5c79);});});}
\ No newline at end of file
+var _0x5937=['AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x5937,0xb8));var _0x7593=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5937[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x7593('0x0'));var moment=require(_0x7593('0x1'));var BPromise=require(_0x7593('0x2'));var rs=require(_0x7593('0x3'));var fs=require('fs');var Redis=require(_0x7593('0x4'));var db=require(_0x7593('0x5'))['db'];var utils=require(_0x7593('0x6'));var logger=require(_0x7593('0x7'))(_0x7593('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xec3eee,_0x5a63b7,_0x17427a){return new BPromise(function(_0x16601e,_0x3de2f0){return client[_0x7593('0x9')](_0xec3eee,_0x17427a)[_0x7593('0xa')](function(_0x51e04d){logger[_0x7593('0xb')](_0x7593('0xc'),_0x5a63b7,'request\x20sent');logger[_0x7593('0xd')](_0x7593('0xe'),_0x5a63b7,_0x7593('0xf'),JSON[_0x7593('0x10')](_0x51e04d));if(_0x51e04d['error']){if(_0x51e04d[_0x7593('0x11')][_0x7593('0x12')]===0x1f4){logger[_0x7593('0x11')](_0x7593('0xc'),_0x5a63b7,_0x51e04d[_0x7593('0x11')][_0x7593('0x13')]);return _0x3de2f0(_0x51e04d[_0x7593('0x11')][_0x7593('0x13')]);}logger[_0x7593('0x11')](_0x7593('0xc'),_0x5a63b7,_0x51e04d[_0x7593('0x11')][_0x7593('0x13')]);return _0x16601e(_0x51e04d['error'][_0x7593('0x13')]);}else{logger[_0x7593('0xb')](_0x7593('0xc'),_0x5a63b7,_0x7593('0xf'));_0x16601e(_0x51e04d[_0x7593('0x14')][_0x7593('0x13')]);}})[_0x7593('0x15')](function(_0x1875bf){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x5a63b7,_0x1875bf);_0x3de2f0(_0x1875bf);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 61f1b91..df42cbf 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 _0x1dcc=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','put','update'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x34e0db,_0x6be33b){_0x34e0db=_0x34e0db-0x0;var _0x1202d8=_0x1dcc[_0x34e0db];return _0x1202d8;};'use strict';var multer=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var path=require(_0xc1dc('0x2'));var timeout=require(_0xc1dc('0x3'));var express=require('express');var router=express[_0xc1dc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1dc('0x5'));var interaction=require(_0xc1dc('0x6'));var config=require(_0xc1dc('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x9')]);router[_0xc1dc('0xa')]('/:id',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xb')]);router['post']('/',auth[_0xc1dc('0x8')](),controller['create']);router[_0xc1dc('0xc')]('/:id',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xd')]);router[_0xc1dc('0xe')](_0xc1dc('0xf'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x10')]);module[_0xc1dc('0x11')]=router;
\ No newline at end of file
+var _0x3dd6=['update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','index','get','/:id','post','create','put'];(function(_0x578e17,_0x5ca701){var _0x3d439f=function(_0x23ab8b){while(--_0x23ab8b){_0x578e17['push'](_0x578e17['shift']());}};_0x3d439f(++_0x5ca701);}(_0x3dd6,0xcf));var _0x63dd=function(_0x366655,_0x4d032){_0x366655=_0x366655-0x0;var _0x11e076=_0x3dd6[_0x366655];return _0x11e076;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x63dd('0x0'));var express=require(_0x63dd('0x1'));var router=express[_0x63dd('0x2')]();var fs_extra=require(_0x63dd('0x3'));var auth=require(_0x63dd('0x4'));var interaction=require(_0x63dd('0x5'));var config=require('../../config/environment');var controller=require(_0x63dd('0x6'));router['get']('/',auth[_0x63dd('0x7')](),controller[_0x63dd('0x8')]);router[_0x63dd('0x9')](_0x63dd('0xa'),auth[_0x63dd('0x7')](),controller['show']);router[_0x63dd('0xb')]('/',auth[_0x63dd('0x7')](),controller[_0x63dd('0xc')]);router[_0x63dd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x63dd('0xe')]);router[_0x63dd('0xf')](_0x63dd('0xa'),auth[_0x63dd('0x7')](),controller[_0x63dd('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index f05079c..6cb042f 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 _0x8835=['exports','TEXT'];(function(_0x3ab4c8,_0x1e05a4){var _0x59f1e2=function(_0x51afc0){while(--_0x51afc0){_0x3ab4c8['push'](_0x3ab4c8['shift']());}};_0x59f1e2(++_0x1e05a4);}(_0x8835,0xc0));var _0x5883=function(_0xdfa37a,_0x5ac389){_0xdfa37a=_0xdfa37a-0x0;var _0x440926=_0x8835[_0xdfa37a];return _0x440926;};'use strict';var Sequelize=require('sequelize');module[_0x5883('0x0')]={'tree':{'type':Sequelize[_0x5883('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x582f=['TEXT','sequelize'];(function(_0x49d802,_0x37c287){var _0x23ce8b=function(_0x1d19e7){while(--_0x1d19e7){_0x49d802['push'](_0x49d802['shift']());}};_0x23ce8b(++_0x37c287);}(_0x582f,0x7f));var _0xf582=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0x582f[_0x242a4f];return _0x122117;};'use strict';var Sequelize=require(_0xf582('0x0'));module['exports']={'tree':{'type':Sequelize[_0xf582('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 320f80f..f39628f 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 _0x94b3=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index','AnalyticTreeReport','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','params','keys','include','create','body','find','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x94b3,0x1f2));var _0x394b=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x94b3[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x394b('0x0'));var rp=require(_0x394b('0x1'));var moment=require(_0x394b('0x2'));var BPromise=require(_0x394b('0x3'));var Mustache=require(_0x394b('0x4'));var util=require(_0x394b('0x5'));var path=require(_0x394b('0x6'));var sox=require(_0x394b('0x7'));var csv=require(_0x394b('0x8'));var ejs=require(_0x394b('0x9'));var fs=require('fs');var fs_extra=require(_0x394b('0xa'));var _=require(_0x394b('0xb'));var squel=require(_0x394b('0xc'));var crypto=require(_0x394b('0xd'));var jsforce=require(_0x394b('0xe'));var deskjs=require(_0x394b('0xf'));var toCsv=require(_0x394b('0x8'));var querystring=require('querystring');var Papa=require(_0x394b('0x10'));var Redis=require(_0x394b('0x11'));var authService=require(_0x394b('0x12'));var qs=require(_0x394b('0x13'));var as=require(_0x394b('0x14'));var hardwareService=require(_0x394b('0x15'));var logger=require('../../config/logger')(_0x394b('0x16'));var utils=require('../../config/utils');var config=require(_0x394b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13832b,_0x5de9cf){_0x5de9cf=_0x5de9cf||0xcc;return function(_0x206429){if(_0x206429){return _0x13832b['sendStatus'](_0x5de9cf);}return _0x13832b[_0x394b('0x18')](_0x5de9cf)['end']();};}function respondWithResult(_0x582bc2,_0x29ed86){_0x29ed86=_0x29ed86||0xc8;return function(_0x3ec1d1){if(_0x3ec1d1){return _0x582bc2[_0x394b('0x18')](_0x29ed86)[_0x394b('0x19')](_0x3ec1d1);}};}function respondWithFilteredResult(_0x37d056,_0x50a984){return function(_0x4dc0e9){if(_0x4dc0e9){var _0x4dd99f=typeof _0x50a984[_0x394b('0x1a')]===_0x394b('0x1b')&&typeof _0x50a984['limit']==='undefined';var _0x5cbb7a=_0x4dc0e9[_0x394b('0x1c')];var _0x26f694=_0x4dd99f?0x0:_0x50a984[_0x394b('0x1a')];var _0x1e2fa2=_0x4dd99f?_0x4dc0e9['count']:_0x50a984[_0x394b('0x1a')]+_0x50a984[_0x394b('0x1d')];var _0x578062;if(_0x1e2fa2>=_0x5cbb7a){_0x1e2fa2=_0x5cbb7a;_0x578062=0xc8;}else{_0x578062=0xce;}_0x37d056[_0x394b('0x18')](_0x578062);return _0x37d056['set'](_0x394b('0x1e'),_0x26f694+'-'+_0x1e2fa2+'/'+_0x5cbb7a)[_0x394b('0x19')](_0x4dc0e9);}return null;};}function patchUpdates(_0x148ab3){return function(_0x13ba7c){try{jsonpatch[_0x394b('0x1f')](_0x13ba7c,_0x148ab3,!![]);}catch(_0x56db78){return BPromise[_0x394b('0x20')](_0x56db78);}return _0x13ba7c['save']();};}function saveUpdates(_0x32bd6a,_0x15e91c){return function(_0x22cbf2){if(_0x22cbf2){return _0x22cbf2[_0x394b('0x21')](_0x32bd6a)['then'](function(_0x1a8b3b){return _0x1a8b3b;});}return null;};}function removeEntity(_0x2c434b,_0xf336fa){return function(_0x2d3770){if(_0x2d3770){return _0x2d3770[_0x394b('0x22')]()[_0x394b('0x23')](function(){_0x2c434b[_0x394b('0x18')](0xcc)[_0x394b('0x24')]();});}};}function handleEntityNotFound(_0x13d66f,_0x4f78ca){return function(_0x2a2e94){if(!_0x2a2e94){_0x13d66f['sendStatus'](0x194);}return _0x2a2e94;};}function handleError(_0x5699da,_0x4c9272){_0x4c9272=_0x4c9272||0x1f4;return function(_0x4282a7){logger[_0x394b('0x25')](_0x4282a7[_0x394b('0x26')]);if(_0x4282a7[_0x394b('0x27')]){delete _0x4282a7['name'];}_0x5699da[_0x394b('0x18')](_0x4c9272)[_0x394b('0x28')](_0x4282a7);};}exports[_0x394b('0x29')]=function(_0x19212a,_0x2c5bcd){var _0x556396={},_0x3223b3={},_0x3b06ab={'count':0x0,'rows':[]};var _0x353160=_['map'](db[_0x394b('0x2a')]['rawAttributes'],function(_0x8de99d){return{'name':_0x8de99d[_0x394b('0x2b')],'type':_0x8de99d[_0x394b('0x2c')]['key']};});_0x3223b3[_0x394b('0x2d')]=_[_0x394b('0x2e')](_0x353160,_0x394b('0x27'));_0x3223b3['query']=_['keys'](_0x19212a[_0x394b('0x2f')]);_0x3223b3[_0x394b('0x30')]=_[_0x394b('0x31')](_0x3223b3[_0x394b('0x2d')],_0x3223b3[_0x394b('0x2f')]);_0x556396[_0x394b('0x32')]=_[_0x394b('0x31')](_0x3223b3['model'],qs['fields'](_0x19212a[_0x394b('0x2f')][_0x394b('0x33')]));_0x556396['attributes']=_0x556396[_0x394b('0x32')][_0x394b('0x34')]?_0x556396[_0x394b('0x32')]:_0x3223b3['model'];if(!_0x19212a[_0x394b('0x2f')][_0x394b('0x35')](_0x394b('0x36'))){_0x556396[_0x394b('0x1d')]=qs[_0x394b('0x1d')](_0x19212a['query']['limit']);_0x556396[_0x394b('0x1a')]=qs['offset'](_0x19212a['query'][_0x394b('0x1a')]);}_0x556396[_0x394b('0x37')]=qs[_0x394b('0x38')](_0x19212a['query'][_0x394b('0x38')]);_0x556396[_0x394b('0x39')]=qs[_0x394b('0x30')](_[_0x394b('0x3a')](_0x19212a['query'],_0x3223b3[_0x394b('0x30')]),_0x353160);if(_0x19212a[_0x394b('0x2f')][_0x394b('0x3b')]){_0x556396[_0x394b('0x39')]=_['merge'](_0x556396['where'],{'$or':_[_0x394b('0x2e')](_0x353160,function(_0x5cfe5b){if(_0x5cfe5b[_0x394b('0x2c')]!==_0x394b('0x3c')){var _0x297a7e={};_0x297a7e[_0x5cfe5b['name']]={'$like':'%'+_0x19212a[_0x394b('0x2f')][_0x394b('0x3b')]+'%'};return _0x297a7e;}})});}_0x556396=_[_0x394b('0x3d')]({},_0x556396,_0x19212a[_0x394b('0x3e')]);var _0x2c4eca={'where':_0x556396[_0x394b('0x39')]};return db[_0x394b('0x2a')]['count'](_0x2c4eca)[_0x394b('0x23')](function(_0x1eaf33){_0x3b06ab['count']=_0x1eaf33;if(_0x19212a['query'][_0x394b('0x3f')]){_0x556396['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x394b('0x40')](_0x556396);})[_0x394b('0x23')](function(_0x3f714f){_0x3b06ab['rows']=_0x3f714f;return _0x3b06ab;})[_0x394b('0x23')](respondWithFilteredResult(_0x2c5bcd,_0x556396))[_0x394b('0x41')](handleError(_0x2c5bcd,null));};exports['show']=function(_0xeb489b,_0x41c992){var _0x11b43e={'raw':!![],'where':{'id':_0xeb489b[_0x394b('0x42')]['id']}},_0x23b3bb={};_0x23b3bb['model']=_[_0x394b('0x43')](db[_0x394b('0x2a')]['rawAttributes']);_0x23b3bb[_0x394b('0x2f')]=_[_0x394b('0x43')](_0xeb489b[_0x394b('0x2f')]);_0x23b3bb['filters']=_['intersection'](_0x23b3bb[_0x394b('0x2d')],_0x23b3bb['query']);_0x11b43e[_0x394b('0x32')]=_[_0x394b('0x31')](_0x23b3bb['model'],qs[_0x394b('0x33')](_0xeb489b['query']['fields']));_0x11b43e[_0x394b('0x32')]=_0x11b43e[_0x394b('0x32')][_0x394b('0x34')]?_0x11b43e[_0x394b('0x32')]:_0x23b3bb[_0x394b('0x2d')];if(_0xeb489b['query'][_0x394b('0x3f')]){_0x11b43e[_0x394b('0x44')]=[{'all':!![]}];}_0x11b43e=_[_0x394b('0x3d')]({},_0x11b43e,_0xeb489b[_0x394b('0x3e')]);return db[_0x394b('0x2a')]['find'](_0x11b43e)[_0x394b('0x23')](handleEntityNotFound(_0x41c992,null))[_0x394b('0x23')](respondWithResult(_0x41c992,null))['catch'](handleError(_0x41c992,null));};exports['create']=function(_0x23162f,_0x244086){return db[_0x394b('0x2a')][_0x394b('0x45')](_0x23162f[_0x394b('0x46')],{})[_0x394b('0x23')](respondWithResult(_0x244086,0xc9))[_0x394b('0x41')](handleError(_0x244086,null));};exports[_0x394b('0x21')]=function(_0x121932,_0x4c84f3){if(_0x121932[_0x394b('0x46')]['id']){delete _0x121932['body']['id'];}return db[_0x394b('0x2a')][_0x394b('0x47')]({'where':{'id':_0x121932[_0x394b('0x42')]['id']}})[_0x394b('0x23')](handleEntityNotFound(_0x4c84f3,null))[_0x394b('0x23')](saveUpdates(_0x121932['body'],null))[_0x394b('0x23')](respondWithResult(_0x4c84f3,null))[_0x394b('0x41')](handleError(_0x4c84f3,null));};exports[_0x394b('0x22')]=function(_0xa6d49,_0x3fdcdb){return db[_0x394b('0x2a')][_0x394b('0x47')]({'where':{'id':_0xa6d49[_0x394b('0x42')]['id']}})[_0x394b('0x23')](handleEntityNotFound(_0x3fdcdb,null))[_0x394b('0x23')](removeEntity(_0x3fdcdb,null))[_0x394b('0x41')](handleError(_0x3fdcdb,null));};
\ No newline at end of file
+var _0xf835=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','sort','where','pick','filters','merge','options','includeAll','include','catch','length','create','body','destroy','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x4404c5,_0x3d9f5c){var _0x30f6c7=function(_0x4e3ee2){while(--_0x4e3ee2){_0x4404c5['push'](_0x4404c5['shift']());}};_0x30f6c7(++_0x3d9f5c);}(_0xf835,0x10c));var _0x5f83=function(_0x2df3fe,_0x34e7dc){_0x2df3fe=_0x2df3fe-0x0;var _0x2cce43=_0xf835[_0x2df3fe];return _0x2cce43;};'use strict';var emlformat=require(_0x5f83('0x0'));var rimraf=require(_0x5f83('0x1'));var zipdir=require(_0x5f83('0x2'));var jsonpatch=require(_0x5f83('0x3'));var rp=require(_0x5f83('0x4'));var moment=require(_0x5f83('0x5'));var BPromise=require(_0x5f83('0x6'));var Mustache=require('mustache');var util=require(_0x5f83('0x7'));var path=require('path');var sox=require(_0x5f83('0x8'));var csv=require(_0x5f83('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f83('0xa'));var _=require(_0x5f83('0xb'));var squel=require(_0x5f83('0xc'));var crypto=require(_0x5f83('0xd'));var jsforce=require(_0x5f83('0xe'));var deskjs=require(_0x5f83('0xf'));var toCsv=require(_0x5f83('0x9'));var querystring=require(_0x5f83('0x10'));var Papa=require(_0x5f83('0x11'));var Redis=require(_0x5f83('0x12'));var authService=require(_0x5f83('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5f83('0x14'));var hardwareService=require(_0x5f83('0x15'));var logger=require('../../config/logger')(_0x5f83('0x16'));var utils=require(_0x5f83('0x17'));var config=require(_0x5f83('0x18'));var licenseUtil=require(_0x5f83('0x19'));var db=require(_0x5f83('0x1a'))['db'];function respondWithStatusCode(_0x3951a0,_0xa9a0e3){_0xa9a0e3=_0xa9a0e3||0xcc;return function(_0x4efc10){if(_0x4efc10){return _0x3951a0[_0x5f83('0x1b')](_0xa9a0e3);}return _0x3951a0[_0x5f83('0x1c')](_0xa9a0e3)['end']();};}function respondWithResult(_0x10fa7e,_0x188390){_0x188390=_0x188390||0xc8;return function(_0x42ead7){if(_0x42ead7){return _0x10fa7e[_0x5f83('0x1c')](_0x188390)[_0x5f83('0x1d')](_0x42ead7);}};}function respondWithFilteredResult(_0x103c0f,_0xc12775){return function(_0x495aaf){if(_0x495aaf){var _0x1e3880=typeof _0xc12775[_0x5f83('0x1e')]===_0x5f83('0x1f')&&typeof _0xc12775['limit']==='undefined';var _0xee690a=_0x495aaf[_0x5f83('0x20')];var _0xfbc23b=_0x1e3880?0x0:_0xc12775['offset'];var _0x2da228=_0x1e3880?_0x495aaf[_0x5f83('0x20')]:_0xc12775['offset']+_0xc12775['limit'];var _0x594e0a;if(_0x2da228>=_0xee690a){_0x2da228=_0xee690a;_0x594e0a=0xc8;}else{_0x594e0a=0xce;}_0x103c0f['status'](_0x594e0a);return _0x103c0f[_0x5f83('0x21')](_0x5f83('0x22'),_0xfbc23b+'-'+_0x2da228+'/'+_0xee690a)[_0x5f83('0x1d')](_0x495aaf);}return null;};}function patchUpdates(_0x2615ee){return function(_0x5672aa){try{jsonpatch[_0x5f83('0x23')](_0x5672aa,_0x2615ee,!![]);}catch(_0x40fe26){return BPromise[_0x5f83('0x24')](_0x40fe26);}return _0x5672aa[_0x5f83('0x25')]();};}function saveUpdates(_0x5042ca,_0x534415){return function(_0x5cd3e6){if(_0x5cd3e6){return _0x5cd3e6[_0x5f83('0x26')](_0x5042ca)[_0x5f83('0x27')](function(_0x208381){return _0x208381;});}return null;};}function removeEntity(_0x111ac7,_0x21af22){return function(_0x103192){if(_0x103192){return _0x103192['destroy']()[_0x5f83('0x27')](function(){_0x111ac7[_0x5f83('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x189c31,_0x29bdf8){return function(_0x1ec460){if(!_0x1ec460){_0x189c31['sendStatus'](0x194);}return _0x1ec460;};}function handleError(_0x155283,_0x535d37){_0x535d37=_0x535d37||0x1f4;return function(_0x3949e5){logger[_0x5f83('0x28')](_0x3949e5[_0x5f83('0x29')]);if(_0x3949e5['name']){delete _0x3949e5[_0x5f83('0x2a')];}_0x155283[_0x5f83('0x1c')](_0x535d37)[_0x5f83('0x2b')](_0x3949e5);};}exports[_0x5f83('0x2c')]=function(_0x1ba57d,_0x5e73cc){var _0x199eb8={},_0x14954e={},_0x38e777={'count':0x0,'rows':[]};var _0x20db99=_['map'](db[_0x5f83('0x2d')][_0x5f83('0x2e')],function(_0x23a663){return{'name':_0x23a663[_0x5f83('0x2f')],'type':_0x23a663[_0x5f83('0x30')][_0x5f83('0x31')]};});_0x14954e[_0x5f83('0x32')]=_['map'](_0x20db99,'name');_0x14954e[_0x5f83('0x33')]=_[_0x5f83('0x34')](_0x1ba57d[_0x5f83('0x33')]);_0x14954e['filters']=_[_0x5f83('0x35')](_0x14954e[_0x5f83('0x32')],_0x14954e[_0x5f83('0x33')]);_0x199eb8[_0x5f83('0x36')]=_[_0x5f83('0x35')](_0x14954e[_0x5f83('0x32')],qs['fields'](_0x1ba57d['query'][_0x5f83('0x37')]));_0x199eb8[_0x5f83('0x36')]=_0x199eb8[_0x5f83('0x36')]['length']?_0x199eb8[_0x5f83('0x36')]:_0x14954e[_0x5f83('0x32')];if(!_0x1ba57d[_0x5f83('0x33')]['hasOwnProperty'](_0x5f83('0x38'))){_0x199eb8['limit']=qs[_0x5f83('0x39')](_0x1ba57d['query'][_0x5f83('0x39')]);_0x199eb8[_0x5f83('0x1e')]=qs[_0x5f83('0x1e')](_0x1ba57d['query']['offset']);}_0x199eb8['order']=qs[_0x5f83('0x3a')](_0x1ba57d[_0x5f83('0x33')][_0x5f83('0x3a')]);_0x199eb8[_0x5f83('0x3b')]=qs['filters'](_[_0x5f83('0x3c')](_0x1ba57d['query'],_0x14954e[_0x5f83('0x3d')]),_0x20db99);if(_0x1ba57d[_0x5f83('0x33')]['filter']){_0x199eb8[_0x5f83('0x3b')]=_['merge'](_0x199eb8[_0x5f83('0x3b')],{'$or':_['map'](_0x20db99,function(_0x1cc312){if(_0x1cc312[_0x5f83('0x30')]!=='VIRTUAL'){var _0x575213={};_0x575213[_0x1cc312[_0x5f83('0x2a')]]={'$like':'%'+_0x1ba57d['query']['filter']+'%'};return _0x575213;}})});}_0x199eb8=_[_0x5f83('0x3e')]({},_0x199eb8,_0x1ba57d[_0x5f83('0x3f')]);var _0x2e9401={'where':_0x199eb8[_0x5f83('0x3b')]};return db['AnalyticTreeReport'][_0x5f83('0x20')](_0x2e9401)['then'](function(_0x2e09b1){_0x38e777[_0x5f83('0x20')]=_0x2e09b1;if(_0x1ba57d[_0x5f83('0x33')][_0x5f83('0x40')]){_0x199eb8[_0x5f83('0x41')]=[{'all':!![]}];}return db[_0x5f83('0x2d')]['findAll'](_0x199eb8);})[_0x5f83('0x27')](function(_0x18cf98){_0x38e777['rows']=_0x18cf98;return _0x38e777;})[_0x5f83('0x27')](respondWithFilteredResult(_0x5e73cc,_0x199eb8))[_0x5f83('0x42')](handleError(_0x5e73cc,null));};exports['show']=function(_0x5c0445,_0x268206){var _0x337029={'raw':!![],'where':{'id':_0x5c0445['params']['id']}},_0x1d539e={};_0x1d539e['model']=_[_0x5f83('0x34')](db['AnalyticTreeReport'][_0x5f83('0x2e')]);_0x1d539e[_0x5f83('0x33')]=_['keys'](_0x5c0445[_0x5f83('0x33')]);_0x1d539e[_0x5f83('0x3d')]=_[_0x5f83('0x35')](_0x1d539e['model'],_0x1d539e[_0x5f83('0x33')]);_0x337029['attributes']=_[_0x5f83('0x35')](_0x1d539e[_0x5f83('0x32')],qs[_0x5f83('0x37')](_0x5c0445[_0x5f83('0x33')][_0x5f83('0x37')]));_0x337029[_0x5f83('0x36')]=_0x337029['attributes'][_0x5f83('0x43')]?_0x337029[_0x5f83('0x36')]:_0x1d539e[_0x5f83('0x32')];if(_0x5c0445[_0x5f83('0x33')]['includeAll']){_0x337029[_0x5f83('0x41')]=[{'all':!![]}];}_0x337029=_[_0x5f83('0x3e')]({},_0x337029,_0x5c0445[_0x5f83('0x3f')]);return db['AnalyticTreeReport']['find'](_0x337029)[_0x5f83('0x27')](handleEntityNotFound(_0x268206,null))[_0x5f83('0x27')](respondWithResult(_0x268206,null))['catch'](handleError(_0x268206,null));};exports[_0x5f83('0x44')]=function(_0x45f365,_0x2bc60d){return db[_0x5f83('0x2d')][_0x5f83('0x44')](_0x45f365[_0x5f83('0x45')],{})['then'](respondWithResult(_0x2bc60d,0xc9))[_0x5f83('0x42')](handleError(_0x2bc60d,null));};exports['update']=function(_0x579889,_0x155e49){if(_0x579889[_0x5f83('0x45')]['id']){delete _0x579889[_0x5f83('0x45')]['id'];}return db[_0x5f83('0x2d')]['find']({'where':{'id':_0x579889['params']['id']}})[_0x5f83('0x27')](handleEntityNotFound(_0x155e49,null))[_0x5f83('0x27')](saveUpdates(_0x579889[_0x5f83('0x45')],null))[_0x5f83('0x27')](respondWithResult(_0x155e49,null))[_0x5f83('0x42')](handleError(_0x155e49,null));};exports[_0x5f83('0x46')]=function(_0x3f64b0,_0x25ab36){return db[_0x5f83('0x2d')][_0x5f83('0x47')]({'where':{'id':_0x3f64b0[_0x5f83('0x48')]['id']}})['then'](handleEntityNotFound(_0x25ab36,null))[_0x5f83('0x27')](removeEntity(_0x25ab36,null))[_0x5f83('0x42')](handleError(_0x25ab36,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 2c88be3..480f2a4 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 _0x3831=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x108a63,_0x350742){var _0x4d4254=function(_0x1427de){while(--_0x1427de){_0x108a63['push'](_0x108a63['shift']());}};_0x4d4254(++_0x350742);}(_0x3831,0xc3));var _0x1383=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x3831[_0x45ee03];return _0x13d535;};'use strict';var _=require(_0x1383('0x0'));var util=require(_0x1383('0x1'));var logger=require(_0x1383('0x2'))(_0x1383('0x3'));var moment=require(_0x1383('0x4'));var BPromise=require(_0x1383('0x5'));var rp=require(_0x1383('0x6'));var fs=require('fs');var path=require(_0x1383('0x7'));var rimraf=require(_0x1383('0x8'));var config=require(_0x1383('0x9'));var attributes=require(_0x1383('0xa'));module[_0x1383('0xb')]=function(_0x1d9c52,_0x586289){return _0x1d9c52[_0x1383('0xc')](_0x1383('0xd'),attributes,{'tableName':_0x1383('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5135=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0xd56445,_0x2b8bd1){var _0xf1feda=function(_0x5c43a2){while(--_0x5c43a2){_0xd56445['push'](_0xd56445['shift']());}};_0xf1feda(++_0x2b8bd1);}(_0x5135,0x1c2));var _0x5513=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x5135[_0x3c2a69];return _0x596bc8;};'use strict';var _=require('lodash');var util=require(_0x5513('0x0'));var logger=require(_0x5513('0x1'))('api');var moment=require(_0x5513('0x2'));var BPromise=require(_0x5513('0x3'));var rp=require(_0x5513('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5513('0x5'));var config=require(_0x5513('0x6'));var attributes=require(_0x5513('0x7'));module[_0x5513('0x8')]=function(_0xca9440,_0x11f23e){return _0xca9440[_0x5513('0x9')](_0x5513('0xa'),attributes,{'tableName':_0x5513('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index ecde24c..8ffbbb5 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x558a6b,_0x43532e){var _0x35e4c2=function(_0x40a747){while(--_0x40a747){_0x558a6b['push'](_0x558a6b['shift']());}};_0x35e4c2(++_0x43532e);}(_0x1261,0x144));var _0x1126=function(_0x28089e,_0x530f8a){_0x28089e=_0x28089e-0x0;var _0x46a73c=_0x1261[_0x28089e];return _0x46a73c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x232ff7,_0x32573f){var _0x6c5f43=function(_0x44ef8f){while(--_0x44ef8f){_0x232ff7['push'](_0x232ff7['shift']());}};_0x6c5f43(++_0x32573f);}(_0x1261,0x144));var _0x1126=function(_0x27b0c4,_0xaf6d02){_0x27b0c4=_0x27b0c4-0x0;var _0xcb87b2=_0x1261[_0x27b0c4];return _0xcb87b2;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 74d00c3..01b7e49 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 _0xe781=['destroy','exports','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x8a22de,_0x1fbd75){var _0x273eea=function(_0x55a01d){while(--_0x55a01d){_0x8a22de['push'](_0x8a22de['shift']());}};_0x273eea(++_0x1fbd75);}(_0xe781,0x1e8));var _0x1e78=function(_0x277b05,_0x2dc697){_0x277b05=_0x277b05-0x0;var _0x5bc781=_0xe781[_0x277b05];return _0x5bc781;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1e78('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e78('0x1'));var auth=require(_0x1e78('0x2'));var interaction=require(_0x1e78('0x3'));var config=require(_0x1e78('0x4'));var controller=require(_0x1e78('0x5'));router[_0x1e78('0x6')]('/',auth[_0x1e78('0x7')](),controller[_0x1e78('0x8')]);router['get'](_0x1e78('0x9'),auth[_0x1e78('0x7')](),controller[_0x1e78('0xa')]);router[_0x1e78('0xb')]('/',auth['isAuthenticated'](),controller[_0x1e78('0xc')]);router[_0x1e78('0xd')]('/:id',auth[_0x1e78('0x7')](),controller[_0x1e78('0xe')]);router[_0x1e78('0xf')](_0x1e78('0x9'),auth[_0x1e78('0x7')](),controller[_0x1e78('0x10')]);module[_0x1e78('0x11')]=router;
\ No newline at end of file
+var _0x2c42=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5d8d5f,_0x1adf93){var _0x10be5c=function(_0x6866bb){while(--_0x6866bb){_0x5d8d5f['push'](_0x5d8d5f['shift']());}};_0x10be5c(++_0x1adf93);}(_0x2c42,0x1a2));var _0x22c4=function(_0x24d15e,_0x242fa4){_0x24d15e=_0x24d15e-0x0;var _0x9dcd72=_0x2c42[_0x24d15e];return _0x9dcd72;};'use strict';var multer=require('multer');var util=require(_0x22c4('0x0'));var path=require(_0x22c4('0x1'));var timeout=require(_0x22c4('0x2'));var express=require(_0x22c4('0x3'));var router=express[_0x22c4('0x4')]();var fs_extra=require(_0x22c4('0x5'));var auth=require(_0x22c4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x22c4('0x7'));router[_0x22c4('0x8')]('/',auth[_0x22c4('0x9')](),controller[_0x22c4('0xa')]);router[_0x22c4('0x8')](_0x22c4('0xb'),auth[_0x22c4('0x9')](),controller[_0x22c4('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x22c4('0xd')]);router[_0x22c4('0xe')](_0x22c4('0xb'),auth[_0x22c4('0x9')](),controller[_0x22c4('0xf')]);router[_0x22c4('0x10')](_0x22c4('0xb'),auth[_0x22c4('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 1cb888f..f938cb6 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 _0x1f63=['exports','STRING','sequelize'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x1f63,0x7a));var _0x31f6=function(_0x57f602,_0x1efb27){_0x57f602=_0x57f602-0x0;var _0x1fb86a=_0x1f63[_0x57f602];return _0x1fb86a;};'use strict';var Sequelize=require(_0x31f6('0x0'));module[_0x31f6('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x31f6('0x2')]},'type':{'type':Sequelize[_0x31f6('0x2')]}};
\ No newline at end of file
+var _0xbc17=['STRING','sequelize','exports'];(function(_0x3d12d6,_0x3bb5a9){var _0x42e3fe=function(_0x2ed66c){while(--_0x2ed66c){_0x3d12d6['push'](_0x3d12d6['shift']());}};_0x42e3fe(++_0x3bb5a9);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x2a0fc4,_0x2eaf74){_0x2a0fc4=_0x2a0fc4-0x0;var _0x531d00=_0xbc17[_0x2a0fc4];return _0x531d00;};'use strict';var Sequelize=require(_0x7bc1('0x0'));module[_0x7bc1('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x7bc1('0x2')]},'type':{'type':Sequelize[_0x7bc1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index efc04c1..0e138a8 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 _0xbc70=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','catch','show','keys','find','clone','params','get','omit','updatedAt','body','createdAt','create','destroy','originalname','basename','file','filename','type','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x150de7,_0x3e1c6b){var _0x3c2a16=function(_0x11324a){while(--_0x11324a){_0x150de7['push'](_0x150de7['shift']());}};_0x3c2a16(++_0x3e1c6b);}(_0xbc70,0x168));var _0x0bc7=function(_0x110338,_0x2b36f8){_0x110338=_0x110338-0x0;var _0x16bdcb=_0xbc70[_0x110338];return _0x16bdcb;};'use strict';var emlformat=require(_0x0bc7('0x0'));var rimraf=require(_0x0bc7('0x1'));var zipdir=require(_0x0bc7('0x2'));var jsonpatch=require(_0x0bc7('0x3'));var rp=require(_0x0bc7('0x4'));var moment=require(_0x0bc7('0x5'));var BPromise=require(_0x0bc7('0x6'));var Mustache=require(_0x0bc7('0x7'));var util=require(_0x0bc7('0x8'));var path=require(_0x0bc7('0x9'));var sox=require('sox');var csv=require(_0x0bc7('0xa'));var ejs=require(_0x0bc7('0xb'));var fs=require('fs');var fs_extra=require(_0x0bc7('0xc'));var _=require('lodash');var squel=require(_0x0bc7('0xd'));var crypto=require(_0x0bc7('0xe'));var jsforce=require(_0x0bc7('0xf'));var deskjs=require(_0x0bc7('0x10'));var toCsv=require(_0x0bc7('0xa'));var querystring=require(_0x0bc7('0x11'));var Papa=require(_0x0bc7('0x12'));var Redis=require(_0x0bc7('0x13'));var authService=require(_0x0bc7('0x14'));var qs=require(_0x0bc7('0x15'));var as=require(_0x0bc7('0x16'));var hardwareService=require(_0x0bc7('0x17'));var logger=require('../../config/logger')(_0x0bc7('0x18'));var utils=require(_0x0bc7('0x19'));var config=require(_0x0bc7('0x1a'));var licenseUtil=require(_0x0bc7('0x1b'));var db=require(_0x0bc7('0x1c'))['db'];function respondWithStatusCode(_0x435f19,_0x4cd51e){_0x4cd51e=_0x4cd51e||0xcc;return function(_0x42583b){if(_0x42583b){return _0x435f19['sendStatus'](_0x4cd51e);}return _0x435f19[_0x0bc7('0x1d')](_0x4cd51e)[_0x0bc7('0x1e')]();};}function respondWithResult(_0x2d4b1d,_0x191222){_0x191222=_0x191222||0xc8;return function(_0x49c66b){if(_0x49c66b){return _0x2d4b1d[_0x0bc7('0x1d')](_0x191222)[_0x0bc7('0x1f')](_0x49c66b);}};}function respondWithFilteredResult(_0x43daeb,_0x40bac2){return function(_0x53030d){if(_0x53030d){var _0x12c674=typeof _0x40bac2[_0x0bc7('0x20')]===_0x0bc7('0x21')&&typeof _0x40bac2[_0x0bc7('0x22')]===_0x0bc7('0x21');var _0x4260ce=_0x53030d[_0x0bc7('0x23')];var _0x4341e2=_0x12c674?0x0:_0x40bac2[_0x0bc7('0x20')];var _0x17dddb=_0x12c674?_0x53030d[_0x0bc7('0x23')]:_0x40bac2[_0x0bc7('0x20')]+_0x40bac2[_0x0bc7('0x22')];var _0x32b026;if(_0x17dddb>=_0x4260ce){_0x17dddb=_0x4260ce;_0x32b026=0xc8;}else{_0x32b026=0xce;}_0x43daeb['status'](_0x32b026);return _0x43daeb['set'](_0x0bc7('0x24'),_0x4341e2+'-'+_0x17dddb+'/'+_0x4260ce)['json'](_0x53030d);}return null;};}function patchUpdates(_0x37d90c){return function(_0x25f071){try{jsonpatch['apply'](_0x25f071,_0x37d90c,!![]);}catch(_0x2b56d4){return BPromise[_0x0bc7('0x25')](_0x2b56d4);}return _0x25f071[_0x0bc7('0x26')]();};}function saveUpdates(_0x3ee70f,_0x5690ba){return function(_0x4fa5d0){if(_0x4fa5d0){return _0x4fa5d0[_0x0bc7('0x27')](_0x3ee70f)[_0x0bc7('0x28')](function(_0x19839d){return _0x19839d;});}return null;};}function removeEntity(_0x59b92b,_0x213d0f){return function(_0x1a7fe5){if(_0x1a7fe5){return _0x1a7fe5['destroy']()['then'](function(){_0x59b92b[_0x0bc7('0x1d')](0xcc)[_0x0bc7('0x1e')]();});}};}function handleEntityNotFound(_0x2a2225,_0x5a17dc){return function(_0x5180bc){if(!_0x5180bc){_0x2a2225[_0x0bc7('0x29')](0x194);}return _0x5180bc;};}function handleError(_0x34ab06,_0x54bdab){_0x54bdab=_0x54bdab||0x1f4;return function(_0x397389){logger['error'](_0x397389[_0x0bc7('0x2a')]);if(_0x397389[_0x0bc7('0x2b')]){delete _0x397389[_0x0bc7('0x2b')];}_0x34ab06[_0x0bc7('0x1d')](_0x54bdab)[_0x0bc7('0x2c')](_0x397389);};}exports['index']=function(_0x223a32,_0x308ee3){var _0x391b94={},_0x4910fb={},_0xd71ee8={'count':0x0,'rows':[]};var _0x5a64c1=_[_0x0bc7('0x2d')](db['Attachment'][_0x0bc7('0x2e')],function(_0x2ec7ce){return{'name':_0x2ec7ce[_0x0bc7('0x2f')],'type':_0x2ec7ce['type'][_0x0bc7('0x30')]};});_0x4910fb[_0x0bc7('0x31')]=_[_0x0bc7('0x2d')](_0x5a64c1,'name');_0x4910fb[_0x0bc7('0x32')]=_['keys'](_0x223a32['query']);_0x4910fb[_0x0bc7('0x33')]=_[_0x0bc7('0x34')](_0x4910fb[_0x0bc7('0x31')],_0x4910fb[_0x0bc7('0x32')]);_0x391b94['attributes']=_[_0x0bc7('0x34')](_0x4910fb[_0x0bc7('0x31')],qs[_0x0bc7('0x35')](_0x223a32[_0x0bc7('0x32')]['fields']));_0x391b94['attributes']=_0x391b94[_0x0bc7('0x36')][_0x0bc7('0x37')]?_0x391b94[_0x0bc7('0x36')]:_0x4910fb[_0x0bc7('0x31')];if(!_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x38')]('nolimit')){_0x391b94[_0x0bc7('0x22')]=qs['limit'](_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x22')]);_0x391b94[_0x0bc7('0x20')]=qs[_0x0bc7('0x20')](_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x20')]);}_0x391b94[_0x0bc7('0x39')]=qs[_0x0bc7('0x3a')](_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x3a')]);_0x391b94[_0x0bc7('0x3b')]=qs[_0x0bc7('0x33')](_[_0x0bc7('0x3c')](_0x223a32[_0x0bc7('0x32')],_0x4910fb[_0x0bc7('0x33')]),_0x5a64c1);if(_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x3d')]){_0x391b94['where']=_[_0x0bc7('0x3e')](_0x391b94['where'],{'$or':_['map'](_0x5a64c1,function(_0x38cf0d){if(_0x38cf0d['type']!==_0x0bc7('0x3f')){var _0x4b7a74={};_0x4b7a74[_0x38cf0d[_0x0bc7('0x2b')]]={'$like':'%'+_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x3d')]+'%'};return _0x4b7a74;}})});}_0x391b94=_[_0x0bc7('0x3e')]({},_0x391b94,_0x223a32[_0x0bc7('0x40')]);var _0x4d10f2={'where':_0x391b94[_0x0bc7('0x3b')]};return db[_0x0bc7('0x41')]['count'](_0x4d10f2)[_0x0bc7('0x28')](function(_0x86ba75){_0xd71ee8[_0x0bc7('0x23')]=_0x86ba75;if(_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x42')]){_0x391b94[_0x0bc7('0x43')]=[{'all':!![]}];}return db[_0x0bc7('0x41')][_0x0bc7('0x44')](_0x391b94);})[_0x0bc7('0x28')](function(_0x265925){_0xd71ee8[_0x0bc7('0x45')]=_0x265925;return _0xd71ee8;})[_0x0bc7('0x28')](respondWithFilteredResult(_0x308ee3,_0x391b94))[_0x0bc7('0x46')](handleError(_0x308ee3,null));};exports[_0x0bc7('0x47')]=function(_0x42541f,_0x5d71f0){var _0x5b29cd={'raw':!![],'where':{'id':_0x42541f['params']['id']}},_0x1b7930={};_0x1b7930['model']=_[_0x0bc7('0x48')](db['Attachment'][_0x0bc7('0x2e')]);_0x1b7930['query']=_['keys'](_0x42541f['query']);_0x1b7930[_0x0bc7('0x33')]=_[_0x0bc7('0x34')](_0x1b7930[_0x0bc7('0x31')],_0x1b7930[_0x0bc7('0x32')]);_0x5b29cd[_0x0bc7('0x36')]=_[_0x0bc7('0x34')](_0x1b7930[_0x0bc7('0x31')],qs[_0x0bc7('0x35')](_0x42541f['query']['fields']));_0x5b29cd[_0x0bc7('0x36')]=_0x5b29cd[_0x0bc7('0x36')]['length']?_0x5b29cd[_0x0bc7('0x36')]:_0x1b7930[_0x0bc7('0x31')];if(_0x42541f[_0x0bc7('0x32')]['includeAll']){_0x5b29cd[_0x0bc7('0x43')]=[{'all':!![]}];}_0x5b29cd=_[_0x0bc7('0x3e')]({},_0x5b29cd,_0x42541f[_0x0bc7('0x40')]);return db[_0x0bc7('0x41')][_0x0bc7('0x49')](_0x5b29cd)[_0x0bc7('0x28')](handleEntityNotFound(_0x5d71f0,null))['then'](respondWithResult(_0x5d71f0,null))[_0x0bc7('0x46')](handleError(_0x5d71f0,null));};exports[_0x0bc7('0x4a')]=function(_0x486f32,_0x50cd85){var _0x29506d={'where':{'id':_0x486f32[_0x0bc7('0x4b')]['id']}},_0x440b10={};_0x440b10[_0x0bc7('0x31')]=_[_0x0bc7('0x48')](db[_0x0bc7('0x41')]['rawAttributes']);_0x29506d[_0x0bc7('0x36')]=_[_0x0bc7('0x34')](_0x440b10[_0x0bc7('0x31')],qs['fields'](_0x486f32['query'][_0x0bc7('0x35')]));_0x29506d[_0x0bc7('0x36')]=_0x29506d['attributes'][_0x0bc7('0x37')]?_0x29506d[_0x0bc7('0x36')]:_0x440b10[_0x0bc7('0x31')];if(_0x486f32[_0x0bc7('0x32')][_0x0bc7('0x42')]){_0x29506d['include']=[{'all':!![]}];}_0x29506d=_[_0x0bc7('0x3e')]({},_0x29506d,_0x486f32[_0x0bc7('0x40')]);return db[_0x0bc7('0x41')][_0x0bc7('0x49')](_0x29506d)[_0x0bc7('0x28')](handleEntityNotFound(_0x50cd85,null))['then'](function(_0x3427ad){if(_0x3427ad){var _0x3ae442=_0x3427ad[_0x0bc7('0x4c')]({'plain':!![]});_0x3ae442=qs[_0x0bc7('0x4d')](_0x3ae442,['id','createdAt',_0x0bc7('0x4e')]);_0x486f32['body']=_[_0x0bc7('0x4d')](_0x486f32[_0x0bc7('0x4f')],['id',_0x0bc7('0x50'),_0x0bc7('0x4e')]);return db[_0x0bc7('0x41')][_0x0bc7('0x51')](_['merge'](_0x3ae442,_0x486f32[_0x0bc7('0x4f')]),{'include':_0x486f32[_0x0bc7('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x0bc7('0x28')](respondWithResult(_0x50cd85,0xc9))[_0x0bc7('0x46')](handleError(_0x50cd85,null));};exports[_0x0bc7('0x27')]=function(_0x15ab16,_0x3c85d9){if(_0x15ab16['body']['id']){delete _0x15ab16[_0x0bc7('0x4f')]['id'];}return db['Attachment'][_0x0bc7('0x49')]({'where':{'id':_0x15ab16[_0x0bc7('0x4b')]['id']}})[_0x0bc7('0x28')](handleEntityNotFound(_0x3c85d9,null))['then'](saveUpdates(_0x15ab16[_0x0bc7('0x4f')],null))['then'](respondWithResult(_0x3c85d9,null))[_0x0bc7('0x46')](handleError(_0x3c85d9,null));};exports[_0x0bc7('0x52')]=function(_0x49f8fc,_0x585ed0){return db[_0x0bc7('0x41')][_0x0bc7('0x49')]({'where':{'id':_0x49f8fc[_0x0bc7('0x4b')]['id']}})[_0x0bc7('0x28')](handleEntityNotFound(_0x585ed0,null))[_0x0bc7('0x28')](removeEntity(_0x585ed0,null))[_0x0bc7('0x46')](handleError(_0x585ed0,null));};exports[_0x0bc7('0x51')]=function(_0x30db02,_0x4ce7fb,_0x466322){_0x30db02[_0x0bc7('0x4f')][_0x0bc7('0x2b')]=_0x30db02['file'][_0x0bc7('0x53')];_0x30db02['body'][_0x0bc7('0x54')]=_0x30db02[_0x0bc7('0x55')][_0x0bc7('0x56')];_0x30db02['body'][_0x0bc7('0x57')]=_0x30db02['file'][_0x0bc7('0x58')];return db[_0x0bc7('0x41')][_0x0bc7('0x51')](_0x30db02[_0x0bc7('0x4f')])[_0x0bc7('0x28')](respondWithResult(_0x4ce7fb,0xc9))[_0x0bc7('0x46')](handleError(_0x4ce7fb,null));};exports[_0x0bc7('0x59')]=function(_0x443f67,_0x43ba9a,_0x79d23f){return db[_0x0bc7('0x41')][_0x0bc7('0x5a')]({'where':{'id':_0x443f67[_0x0bc7('0x4b')]['id']},'raw':!![]})[_0x0bc7('0x28')](handleEntityNotFound(_0x43ba9a,null))[_0x0bc7('0x28')](function(_0x510bf5){if(_0x510bf5){var _0x29904e=_0x510bf5[_0x0bc7('0x5b')]!==null;var _0x1a02d4=path['join'](config[_0x0bc7('0x5c')],_0x0bc7('0x5d'));if(_0x29904e){_0x1a02d4=path[_0x0bc7('0x5e')](_0x1a02d4,_0x0bc7('0x5f'));}var _0x14ce39=path[_0x0bc7('0x5e')](_0x1a02d4,_0x510bf5[_0x0bc7('0x54')]);return _0x43ba9a[_0x0bc7('0x59')](_0x14ce39);}})[_0x0bc7('0x46')](handleError(_0x43ba9a,null));};
\ No newline at end of file
+var _0xd5d6=['status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','destroy','stack','name','index','map','Attachment','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','findOne','ChatOfflineMessageId','join','server/files/attachments/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xd5d6,0x1e5));var _0x6d5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5d6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6d5d('0x0'));var rimraf=require(_0x6d5d('0x1'));var zipdir=require(_0x6d5d('0x2'));var jsonpatch=require(_0x6d5d('0x3'));var rp=require(_0x6d5d('0x4'));var moment=require(_0x6d5d('0x5'));var BPromise=require(_0x6d5d('0x6'));var Mustache=require(_0x6d5d('0x7'));var util=require(_0x6d5d('0x8'));var path=require(_0x6d5d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d5d('0xa'));var _=require('lodash');var squel=require(_0x6d5d('0xb'));var crypto=require(_0x6d5d('0xc'));var jsforce=require(_0x6d5d('0xd'));var deskjs=require(_0x6d5d('0xe'));var toCsv=require(_0x6d5d('0xf'));var querystring=require('querystring');var Papa=require(_0x6d5d('0x10'));var Redis=require(_0x6d5d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6d5d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d5d('0x13'))(_0x6d5d('0x14'));var utils=require('../../config/utils');var config=require(_0x6d5d('0x15'));var licenseUtil=require(_0x6d5d('0x16'));var db=require(_0x6d5d('0x17'))['db'];function respondWithStatusCode(_0x408d84,_0x4222f7){_0x4222f7=_0x4222f7||0xcc;return function(_0x202c62){if(_0x202c62){return _0x408d84[_0x6d5d('0x18')](_0x4222f7);}return _0x408d84[_0x6d5d('0x19')](_0x4222f7)[_0x6d5d('0x1a')]();};}function respondWithResult(_0x14c82f,_0x28bb06){_0x28bb06=_0x28bb06||0xc8;return function(_0x4d22da){if(_0x4d22da){return _0x14c82f[_0x6d5d('0x19')](_0x28bb06)['json'](_0x4d22da);}};}function respondWithFilteredResult(_0x4fcc83,_0x4bcb32){return function(_0x545366){if(_0x545366){var _0x3a32bb=typeof _0x4bcb32['offset']===_0x6d5d('0x1b')&&typeof _0x4bcb32[_0x6d5d('0x1c')]===_0x6d5d('0x1b');var _0x30904a=_0x545366[_0x6d5d('0x1d')];var _0x457a3d=_0x3a32bb?0x0:_0x4bcb32[_0x6d5d('0x1e')];var _0x5d63b4=_0x3a32bb?_0x545366[_0x6d5d('0x1d')]:_0x4bcb32[_0x6d5d('0x1e')]+_0x4bcb32[_0x6d5d('0x1c')];var _0x373708;if(_0x5d63b4>=_0x30904a){_0x5d63b4=_0x30904a;_0x373708=0xc8;}else{_0x373708=0xce;}_0x4fcc83[_0x6d5d('0x19')](_0x373708);return _0x4fcc83['set'](_0x6d5d('0x1f'),_0x457a3d+'-'+_0x5d63b4+'/'+_0x30904a)[_0x6d5d('0x20')](_0x545366);}return null;};}function patchUpdates(_0x4977b8){return function(_0x4d5c39){try{jsonpatch[_0x6d5d('0x21')](_0x4d5c39,_0x4977b8,!![]);}catch(_0x48a50b){return BPromise[_0x6d5d('0x22')](_0x48a50b);}return _0x4d5c39['save']();};}function saveUpdates(_0x3775f8,_0x5a3065){return function(_0x944058){if(_0x944058){return _0x944058[_0x6d5d('0x23')](_0x3775f8)[_0x6d5d('0x24')](function(_0x405515){return _0x405515;});}return null;};}function removeEntity(_0x1e6a01,_0x3f41e6){return function(_0x1c91fc){if(_0x1c91fc){return _0x1c91fc[_0x6d5d('0x25')]()[_0x6d5d('0x24')](function(){_0x1e6a01[_0x6d5d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49aa67,_0x558e7d){return function(_0x4b1630){if(!_0x4b1630){_0x49aa67['sendStatus'](0x194);}return _0x4b1630;};}function handleError(_0x3d1e16,_0x14f8d9){_0x14f8d9=_0x14f8d9||0x1f4;return function(_0x16f72a){logger['error'](_0x16f72a[_0x6d5d('0x26')]);if(_0x16f72a[_0x6d5d('0x27')]){delete _0x16f72a[_0x6d5d('0x27')];}_0x3d1e16['status'](_0x14f8d9)['send'](_0x16f72a);};}exports[_0x6d5d('0x28')]=function(_0x53e4c,_0xd6d23){var _0x365925={},_0x2a0779={},_0x260f23={'count':0x0,'rows':[]};var _0x11be03=_[_0x6d5d('0x29')](db[_0x6d5d('0x2a')][_0x6d5d('0x2b')],function(_0x26b1b1){return{'name':_0x26b1b1[_0x6d5d('0x2c')],'type':_0x26b1b1['type'][_0x6d5d('0x2d')]};});_0x2a0779['model']=_[_0x6d5d('0x29')](_0x11be03,_0x6d5d('0x27'));_0x2a0779[_0x6d5d('0x2e')]=_[_0x6d5d('0x2f')](_0x53e4c['query']);_0x2a0779[_0x6d5d('0x30')]=_[_0x6d5d('0x31')](_0x2a0779[_0x6d5d('0x32')],_0x2a0779[_0x6d5d('0x2e')]);_0x365925[_0x6d5d('0x33')]=_['intersection'](_0x2a0779[_0x6d5d('0x32')],qs[_0x6d5d('0x34')](_0x53e4c[_0x6d5d('0x2e')][_0x6d5d('0x34')]));_0x365925[_0x6d5d('0x33')]=_0x365925[_0x6d5d('0x33')][_0x6d5d('0x35')]?_0x365925[_0x6d5d('0x33')]:_0x2a0779[_0x6d5d('0x32')];if(!_0x53e4c[_0x6d5d('0x2e')]['hasOwnProperty'](_0x6d5d('0x36'))){_0x365925['limit']=qs[_0x6d5d('0x1c')](_0x53e4c[_0x6d5d('0x2e')]['limit']);_0x365925[_0x6d5d('0x1e')]=qs['offset'](_0x53e4c[_0x6d5d('0x2e')][_0x6d5d('0x1e')]);}_0x365925[_0x6d5d('0x37')]=qs['sort'](_0x53e4c[_0x6d5d('0x2e')][_0x6d5d('0x38')]);_0x365925[_0x6d5d('0x39')]=qs['filters'](_['pick'](_0x53e4c[_0x6d5d('0x2e')],_0x2a0779[_0x6d5d('0x30')]),_0x11be03);if(_0x53e4c['query']['filter']){_0x365925[_0x6d5d('0x39')]=_[_0x6d5d('0x3a')](_0x365925[_0x6d5d('0x39')],{'$or':_[_0x6d5d('0x29')](_0x11be03,function(_0x4a2b23){if(_0x4a2b23[_0x6d5d('0x3b')]!==_0x6d5d('0x3c')){var _0x5ebf69={};_0x5ebf69[_0x4a2b23[_0x6d5d('0x27')]]={'$like':'%'+_0x53e4c['query'][_0x6d5d('0x3d')]+'%'};return _0x5ebf69;}})});}_0x365925=_[_0x6d5d('0x3a')]({},_0x365925,_0x53e4c[_0x6d5d('0x3e')]);var _0xc131e5={'where':_0x365925['where']};return db[_0x6d5d('0x2a')]['count'](_0xc131e5)[_0x6d5d('0x24')](function(_0x31356c){_0x260f23[_0x6d5d('0x1d')]=_0x31356c;if(_0x53e4c[_0x6d5d('0x2e')][_0x6d5d('0x3f')]){_0x365925[_0x6d5d('0x40')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x365925);})[_0x6d5d('0x24')](function(_0x1b28f4){_0x260f23[_0x6d5d('0x41')]=_0x1b28f4;return _0x260f23;})[_0x6d5d('0x24')](respondWithFilteredResult(_0xd6d23,_0x365925))[_0x6d5d('0x42')](handleError(_0xd6d23,null));};exports[_0x6d5d('0x43')]=function(_0x10aa5d,_0x45297a){var _0x353c3f={'raw':!![],'where':{'id':_0x10aa5d[_0x6d5d('0x44')]['id']}},_0x485d68={};_0x485d68[_0x6d5d('0x32')]=_[_0x6d5d('0x2f')](db[_0x6d5d('0x2a')]['rawAttributes']);_0x485d68['query']=_[_0x6d5d('0x2f')](_0x10aa5d[_0x6d5d('0x2e')]);_0x485d68['filters']=_[_0x6d5d('0x31')](_0x485d68[_0x6d5d('0x32')],_0x485d68['query']);_0x353c3f[_0x6d5d('0x33')]=_[_0x6d5d('0x31')](_0x485d68['model'],qs['fields'](_0x10aa5d[_0x6d5d('0x2e')][_0x6d5d('0x34')]));_0x353c3f[_0x6d5d('0x33')]=_0x353c3f['attributes']['length']?_0x353c3f[_0x6d5d('0x33')]:_0x485d68['model'];if(_0x10aa5d[_0x6d5d('0x2e')]['includeAll']){_0x353c3f[_0x6d5d('0x40')]=[{'all':!![]}];}_0x353c3f=_[_0x6d5d('0x3a')]({},_0x353c3f,_0x10aa5d['options']);return db[_0x6d5d('0x2a')][_0x6d5d('0x45')](_0x353c3f)[_0x6d5d('0x24')](handleEntityNotFound(_0x45297a,null))['then'](respondWithResult(_0x45297a,null))[_0x6d5d('0x42')](handleError(_0x45297a,null));};exports['clone']=function(_0x3e598b,_0x275e3d){var _0x3f730f={'where':{'id':_0x3e598b[_0x6d5d('0x44')]['id']}},_0x430223={};_0x430223[_0x6d5d('0x32')]=_[_0x6d5d('0x2f')](db['Attachment'][_0x6d5d('0x2b')]);_0x3f730f[_0x6d5d('0x33')]=_[_0x6d5d('0x31')](_0x430223[_0x6d5d('0x32')],qs[_0x6d5d('0x34')](_0x3e598b[_0x6d5d('0x2e')][_0x6d5d('0x34')]));_0x3f730f[_0x6d5d('0x33')]=_0x3f730f[_0x6d5d('0x33')][_0x6d5d('0x35')]?_0x3f730f[_0x6d5d('0x33')]:_0x430223[_0x6d5d('0x32')];if(_0x3e598b[_0x6d5d('0x2e')][_0x6d5d('0x3f')]){_0x3f730f[_0x6d5d('0x40')]=[{'all':!![]}];}_0x3f730f=_[_0x6d5d('0x3a')]({},_0x3f730f,_0x3e598b[_0x6d5d('0x3e')]);return db[_0x6d5d('0x2a')][_0x6d5d('0x45')](_0x3f730f)['then'](handleEntityNotFound(_0x275e3d,null))['then'](function(_0x2b5b9e){if(_0x2b5b9e){var _0x1533f1=_0x2b5b9e[_0x6d5d('0x46')]({'plain':!![]});_0x1533f1=qs[_0x6d5d('0x47')](_0x1533f1,['id',_0x6d5d('0x48'),_0x6d5d('0x49')]);_0x3e598b['body']=_[_0x6d5d('0x47')](_0x3e598b['body'],['id','createdAt',_0x6d5d('0x49')]);return db[_0x6d5d('0x2a')]['create'](_[_0x6d5d('0x3a')](_0x1533f1,_0x3e598b[_0x6d5d('0x4a')]),{'include':_0x3e598b[_0x6d5d('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x6d5d('0x24')](respondWithResult(_0x275e3d,0xc9))[_0x6d5d('0x42')](handleError(_0x275e3d,null));};exports[_0x6d5d('0x23')]=function(_0xe58b6b,_0x4996ed){if(_0xe58b6b[_0x6d5d('0x4a')]['id']){delete _0xe58b6b[_0x6d5d('0x4a')]['id'];}return db[_0x6d5d('0x2a')]['find']({'where':{'id':_0xe58b6b[_0x6d5d('0x44')]['id']}})[_0x6d5d('0x24')](handleEntityNotFound(_0x4996ed,null))[_0x6d5d('0x24')](saveUpdates(_0xe58b6b[_0x6d5d('0x4a')],null))[_0x6d5d('0x24')](respondWithResult(_0x4996ed,null))[_0x6d5d('0x42')](handleError(_0x4996ed,null));};exports['destroy']=function(_0x41c8b8,_0x4b01b7){return db['Attachment'][_0x6d5d('0x45')]({'where':{'id':_0x41c8b8[_0x6d5d('0x44')]['id']}})[_0x6d5d('0x24')](handleEntityNotFound(_0x4b01b7,null))[_0x6d5d('0x24')](removeEntity(_0x4b01b7,null))['catch'](handleError(_0x4b01b7,null));};exports[_0x6d5d('0x4b')]=function(_0x3716c0,_0x59a091,_0x3f200c){_0x3716c0[_0x6d5d('0x4a')][_0x6d5d('0x27')]=_0x3716c0[_0x6d5d('0x4c')][_0x6d5d('0x4d')];_0x3716c0[_0x6d5d('0x4a')][_0x6d5d('0x4e')]=_0x3716c0[_0x6d5d('0x4c')]['filename'];_0x3716c0[_0x6d5d('0x4a')][_0x6d5d('0x3b')]=_0x3716c0['file'][_0x6d5d('0x4f')];return db[_0x6d5d('0x2a')]['create'](_0x3716c0[_0x6d5d('0x4a')])[_0x6d5d('0x24')](respondWithResult(_0x59a091,0xc9))[_0x6d5d('0x42')](handleError(_0x59a091,null));};exports['download']=function(_0x8f9f08,_0x33a0d3,_0xf5b90){return db[_0x6d5d('0x2a')][_0x6d5d('0x50')]({'where':{'id':_0x8f9f08[_0x6d5d('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33a0d3,null))['then'](function(_0x57aa9a){if(_0x57aa9a){var _0x7d6c30=_0x57aa9a[_0x6d5d('0x51')]!==null;var _0x5ebbb7=path[_0x6d5d('0x52')](config['root'],_0x6d5d('0x53'));if(_0x7d6c30){_0x5ebbb7=path[_0x6d5d('0x52')](_0x5ebbb7,'offline-chat/');}var _0x33f5a3=path[_0x6d5d('0x52')](_0x5ebbb7,_0x57aa9a['basename']);return _0x33a0d3[_0x6d5d('0x54')](_0x33f5a3);}})[_0x6d5d('0x42')](handleError(_0x33a0d3,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 21ed8eb..7b51271 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 _0xdb3c=['moment','bluebird','path','rimraf','../../config/environment','exports','Attachment','attachments','lodash','util','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb3c,0x1e1));var _0xcdb3=function(_0x22ea49,_0x4a785c){_0x22ea49=_0x22ea49-0x0;var _0x580ac8=_0xdb3c[_0x22ea49];return _0x580ac8;};'use strict';var _=require(_0xcdb3('0x0'));var util=require(_0xcdb3('0x1'));var logger=require('../../config/logger')(_0xcdb3('0x2'));var moment=require(_0xcdb3('0x3'));var BPromise=require(_0xcdb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdb3('0x5'));var rimraf=require(_0xcdb3('0x6'));var config=require(_0xcdb3('0x7'));var attributes=require('./attachment.attributes');module[_0xcdb3('0x8')]=function(_0x3efe3a,_0x1d7408){return _0x3efe3a['define'](_0xcdb3('0x9'),attributes,{'tableName':_0xcdb3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ab2=['request-promise','path','rimraf','../../config/environment','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x2b8b4d,_0x833705){var _0x38150e=function(_0x484130){while(--_0x484130){_0x2b8b4d['push'](_0x2b8b4d['shift']());}};_0x38150e(++_0x833705);}(_0x8ab2,0x174));var _0x28ab=function(_0x1d87f3,_0x4c5748){_0x1d87f3=_0x1d87f3-0x0;var _0x58ecce=_0x8ab2[_0x1d87f3];return _0x58ecce;};'use strict';var _=require(_0x28ab('0x0'));var util=require(_0x28ab('0x1'));var logger=require(_0x28ab('0x2'))(_0x28ab('0x3'));var moment=require(_0x28ab('0x4'));var BPromise=require('bluebird');var rp=require(_0x28ab('0x5'));var fs=require('fs');var path=require(_0x28ab('0x6'));var rimraf=require(_0x28ab('0x7'));var config=require(_0x28ab('0x8'));var attributes=require('./attachment.attributes');module[_0x28ab('0x9')]=function(_0xdbbc6f,_0x387583){return _0xdbbc6f[_0x28ab('0xa')](_0x28ab('0xb'),attributes,{'tableName':_0x28ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 9fc134d..e888d10 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 _0x49e9=['request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5a633a,_0x4e8830){var _0x4a9df=function(_0x1a6732){while(--_0x1a6732){_0x5a633a['push'](_0x5a633a['shift']());}};_0x4a9df(++_0x4e8830);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var moment=require('moment');var BPromise=require(_0x949e('0x2'));var rs=require(_0x949e('0x3'));var fs=require('fs');var Redis=require(_0x949e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x949e('0x5'))('rpc');var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f649,_0x16c669,_0xfc4f8a){return new BPromise(function(_0x34ee57,_0x40d442){return client[_0x949e('0x9')](_0x17f649,_0xfc4f8a)[_0x949e('0xa')](function(_0x56e31d){logger[_0x949e('0xb')]('Attachment,\x20%s,\x20%s',_0x16c669,_0x949e('0xc'));logger[_0x949e('0xd')](_0x949e('0xe'),_0x16c669,'request\x20sent',JSON[_0x949e('0xf')](_0x56e31d));if(_0x56e31d[_0x949e('0x10')]){if(_0x56e31d[_0x949e('0x10')][_0x949e('0x11')]===0x1f4){logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x40d442(_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);}logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x34ee57(_0x56e31d[_0x949e('0x10')]['message']);}else{logger[_0x949e('0xb')](_0x949e('0x12'),_0x16c669,_0x949e('0xc'));_0x34ee57(_0x56e31d[_0x949e('0x14')]['message']);}})[_0x949e('0x15')](function(_0x441b80){logger['error'](_0x949e('0x12'),_0x16c669,_0x441b80);_0x40d442(_0x441b80);});});}exports[_0x949e('0x16')]=function(_0x43498d){var _0x868913=this;return new Promise(function(_0x20333c,_0x5caac9){return db[_0x949e('0x17')][_0x949e('0x18')](_0x43498d[_0x949e('0x19')],{'raw':_0x43498d[_0x949e('0x1a')]?_0x43498d[_0x949e('0x1a')][_0x949e('0x1b')]===undefined?!![]:![]:!![]})[_0x949e('0xa')](function(_0x2f21bd){logger[_0x949e('0xb')](_0x949e('0x16'),_0x43498d);logger[_0x949e('0xd')](_0x949e('0x16'),_0x43498d,JSON[_0x949e('0xf')](_0x2f21bd));_0x20333c(_0x2f21bd);})[_0x949e('0x15')](function(_0x199d53){logger[_0x949e('0x10')]('CreateAttachment',_0x199d53[_0x949e('0x13')],_0x43498d);_0x5caac9(_0x868913[_0x949e('0x10')](0x1f4,_0x199d53['message']));});});};
\ No newline at end of file
+var _0x0834=['message','result','catch','create','options','raw','CreateAttachment','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1dfcea,_0x59c299){var _0x19a567=function(_0x2dead0){while(--_0x2dead0){_0x1dfcea['push'](_0x1dfcea['shift']());}};_0x19a567(++_0x59c299);}(_0x0834,0x18e));var _0x4083=function(_0x2fb37d,_0x5ac84d){_0x2fb37d=_0x2fb37d-0x0;var _0x287bd9=_0x0834[_0x2fb37d];return _0x287bd9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4083('0x0'));var BPromise=require(_0x4083('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4083('0x2'));var logger=require(_0x4083('0x3'))('rpc');var config=require(_0x4083('0x4'));var jayson=require(_0x4083('0x5'));var client=jayson['client'][_0x4083('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a54,_0x31c7ef,_0x26ed53){return new BPromise(function(_0x2c42bb,_0x1d56dd){return client[_0x4083('0x7')](_0x5c5a54,_0x26ed53)[_0x4083('0x8')](function(_0x3cee37){logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));logger[_0x4083('0xc')](_0x4083('0xd'),_0x31c7ef,_0x4083('0xb'),JSON[_0x4083('0xe')](_0x3cee37));if(_0x3cee37[_0x4083('0xf')]){if(_0x3cee37['error']['code']===0x1f4){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x3cee37['error'][_0x4083('0x10')]);return _0x1d56dd(_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x31c7ef,_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);return _0x2c42bb(_0x3cee37['error'][_0x4083('0x10')]);}else{logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));_0x2c42bb(_0x3cee37[_0x4083('0x11')]['message']);}})[_0x4083('0x12')](function(_0x10cadd){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x10cadd);_0x1d56dd(_0x10cadd);});});}exports['CreateAttachment']=function(_0x4e7d59){var _0x4d6089=this;return new Promise(function(_0xafda0c,_0x53d525){return db['Attachment'][_0x4083('0x13')](_0x4e7d59['body'],{'raw':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59[_0x4083('0x14')][_0x4083('0x15')]===undefined?!![]:![]:!![]})[_0x4083('0x8')](function(_0x4b32e9){logger[_0x4083('0x9')]('CreateAttachment',_0x4e7d59);logger[_0x4083('0xc')](_0x4083('0x16'),_0x4e7d59,JSON[_0x4083('0xe')](_0x4b32e9));_0xafda0c(_0x4b32e9);})[_0x4083('0x12')](function(_0x5d7461){logger[_0x4083('0xf')]('CreateAttachment',_0x5d7461[_0x4083('0x10')],_0x4e7d59);_0x53d525(_0x4d6089[_0x4083('0xf')](0x1f4,_0x5d7461['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index c97805c..da60488 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x0b0e,0x187));var _0xe0b0=function(_0x384d39,_0xf060fc){_0x384d39=_0x384d39-0x0;var _0x13bf22=_0x0b0e[_0x384d39];return _0x13bf22;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x37edd7,_0xd238e6){var _0x1b83b5=function(_0x1b8122){while(--_0x1b8122){_0x37edd7['push'](_0x37edd7['shift']());}};_0x1b83b5(++_0xd238e6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x44ab72,_0xf815c8){_0x44ab72=_0x44ab72-0x0;var _0x3e3476=_0x5f2f[_0x44ab72];return _0x3e3476;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 4594775..5704107 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 _0xf324=['blocked','online','user','agent','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','url','domain','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled'];(function(_0x206971,_0x49148c){var _0x39fce2=function(_0x4776a9){while(--_0x4776a9){_0x206971['push'](_0x206971['shift']());}};_0x39fce2(++_0x49148c);}(_0xf324,0xa6));var _0x4f32=function(_0x769fd9,_0x1d699e){_0x769fd9=_0x769fd9-0x0;var _0x1202b6=_0xf324[_0x769fd9];return _0x1202b6;};'use strict';var passport=require(_0x4f32('0x0'));var LocalStrategy=require(_0x4f32('0x1'))[_0x4f32('0x2')];var moment=require(_0x4f32('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x4f32('0x4'));var util=require(_0x4f32('0x5'));var db=require(_0x4f32('0x6'))['db'];var authService=require(_0x4f32('0x7'));var utils=require(_0x4f32('0x8'));var config=require(_0x4f32('0x9'));var logger=require(_0x4f32('0xa'))('api');function isActiveDirectoryConfigured(_0x5051e2){var _0x238d8a=![];if(typeof _0x5051e2[_0x4f32('0xb')]!==_0x4f32('0xc')){_0x238d8a=_0x5051e2[_0x4f32('0xb')]['baseDN']&&_0x5051e2[_0x4f32('0xb')][_0x4f32('0xd')]&&_0x5051e2[_0x4f32('0xb')][_0x4f32('0xe')];}return _0x238d8a;}function adAuthenticate(_0x1c1faf,_0x27c803,_0x13dc39){return new BPromise(function(_0x24d01c,_0x2a3e88){try{var _0x491cf0=new ActiveDirectory(_0x1c1faf);_0x491cf0['authenticate'](_0x27c803,_0x13dc39,function(_0x44f4d3,_0xaf3917){if(_0x44f4d3){logger['error'](_0x4f32('0xf'),_0x27c803,util[_0x4f32('0x10')](_0x44f4d3,{'showHidden':![],'depth':null}));_0x2a3e88(_0x4f32('0x11'));}else if(!_0xaf3917){logger[_0x4f32('0x12')](_0x4f32('0x13'),_0x27c803);_0x2a3e88(_0x4f32('0x11'));}else{_0x24d01c(_0xaf3917);}});}catch(_0x3c6daf){_0x2a3e88(_0x3c6daf);}});}function ActiveDirectoryAuthenticate(_0x25aad3,_0xda352a,_0x48a827,_0x194ad4){var _0x1bc483,_0x192461;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x4f32('0x14'),_0xda352a);return _0x194ad4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x4f32('0x15')][_0x4f32('0x16')]({'where':{'id':0x1},'attributes':[_0x4f32('0x17'),'blockDuration'],'raw':!![]})[_0x4f32('0x18')](function(_0x5ceba9){_0x1bc483=_0x5ceba9;if(!_0x1bc483[_0x4f32('0x17')]){logger[_0x4f32('0x12')](_0x4f32('0x19'),_0xda352a);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x25aad3[_0x4f32('0x16')]({'attributes':['id',_0x4f32('0x1a'),'password',_0x4f32('0x1b'),_0x4f32('0x1c'),_0x4f32('0x1d'),_0x4f32('0x1e'),'blockedAt',_0x4f32('0x1f')],'where':{'name':_0xda352a,'role':{'$or':['admin',_0x4f32('0x20'),_0x4f32('0x21')]},'adSsoEnabled':!![]}});})[_0x4f32('0x18')](function(_0x4ce898){if(!_0x4ce898||_0x4ce898&&_0x4ce898[_0x4f32('0x1a')]!==_0xda352a){throw new Error(_0x4f32('0x11'));}_0x192461=_0x4ce898;var _0x62be60=_0x192461['name']+'@'+config[_0x4f32('0xb')][_0x4f32('0xe')];return adAuthenticate(config[_0x4f32('0xb')],_0x62be60,_0x48a827);})['then'](function(_0x21b023){if(_0x192461[_0x4f32('0x1d')]){throw new Error(_0x4f32('0x11'));}if(_0x1bc483[_0x4f32('0x22')]>0x0){if(_0x192461[_0x4f32('0x1e')]){if(moment(_0x192461[_0x4f32('0x23')])[_0x4f32('0x24')](_0x1bc483[_0x4f32('0x22')],_0x4f32('0x25'))>moment()){throw new Error(_0x4f32('0x11'));}return utils[_0x4f32('0x26')](_0x192461,0x0,![],null)[_0x4f32('0x18')](function(){return utils['getLicense'](_0x192461);})['then'](function(){return _0x194ad4(null,_0x192461);});}else{return utils[_0x4f32('0x27')](_0x192461)[_0x4f32('0x18')](function(){return _0x194ad4(null,_0x192461);});}}else{return utils[_0x4f32('0x27')](_0x192461)[_0x4f32('0x18')](function(){return _0x194ad4(null,_0x192461);});}})[_0x4f32('0x28')](function(_0x302017){return _0x194ad4(null,![],_0x302017);});}function handleError(_0x31fcb5,_0x2fc04a,_0x357c25){return _0x31fcb5[_0x4f32('0x29')](_0x2fc04a||0x1f4)[_0x4f32('0x2a')]({'message':_0x357c25?_0x357c25[_0x4f32('0x2b')]||_0x357c25:''});}exports[_0x4f32('0x2c')]=function(_0x490698,_0x2c9666,_0x4f8242){passport['authenticate'](_0x4f32('0x2d'),function(_0x82c280,_0x16e0f1,_0x420c80){var _0x5c1669=_0x82c280||_0x420c80;if(_0x5c1669){return handleError(_0x2c9666,0x191,_0x5c1669);}if(!_0x16e0f1){return handleError(_0x2c9666,0x194,{'message':_0x4f32('0x2e')});}else{var _0x37af02={'payload':{'id':_0x16e0f1['id'],'role':_0x16e0f1[_0x4f32('0x1c')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x37af02)['then'](function(_0x30da38){_0x2c9666[_0x4f32('0x2f')]({'id':_0x16e0f1['id'],'token':_0x30da38,'statusCall':'','isAlreadyLogged':_0x16e0f1['online']});});}})(_0x490698,_0x2c9666,_0x4f8242);};passport['use'](_0x4f32('0x2d'),new LocalStrategy({'usernameField':_0x4f32('0x1a'),'passwordField':'password'},function(_0x2ca8e2,_0x17b0ec,_0x3d657e){return ActiveDirectoryAuthenticate(db[_0x4f32('0x30')],_0x2ca8e2,_0x17b0ec,_0x3d657e);}));
\ No newline at end of file
+var _0x377e=['blocked','blockedAt','online','user','agent','domain','disabled','add','minutes','getLicense','catch','status','send','login','ad-login','signToken','json','use','User','passport','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role'];(function(_0x443cef,_0x2cd289){var _0x147c47=function(_0x56c979){while(--_0x56c979){_0x443cef['push'](_0x443cef['shift']());}};_0x147c47(++_0x2cd289);}(_0x377e,0x1e9));var _0xe377=function(_0x212950,_0x412c4a){_0x212950=_0x212950-0x0;var _0x1eb5d6=_0x377e[_0x212950];return _0x1eb5d6;};'use strict';var passport=require(_0xe377('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0xe377('0x1'));var BPromise=require(_0xe377('0x2'));var util=require(_0xe377('0x3'));var db=require(_0xe377('0x4'))['db'];var authService=require(_0xe377('0x5'));var utils=require(_0xe377('0x6'));var config=require(_0xe377('0x7'));var logger=require(_0xe377('0x8'))(_0xe377('0x9'));function isActiveDirectoryConfigured(_0x2cc42a){var _0x4c26ac=![];if(typeof _0x2cc42a[_0xe377('0xa')]!=='undefined'){_0x4c26ac=_0x2cc42a[_0xe377('0xa')][_0xe377('0xb')]&&_0x2cc42a['activedirectory']['url']&&_0x2cc42a[_0xe377('0xa')]['domain'];}return _0x4c26ac;}function adAuthenticate(_0x71745,_0x2c4ea2,_0x5cd665){return new BPromise(function(_0x541cf0,_0xa1e50){try{var _0x3e6a9c=new ActiveDirectory(_0x71745);_0x3e6a9c[_0xe377('0xc')](_0x2c4ea2,_0x5cd665,function(_0x2bdf60,_0x1abf8a){if(_0x2bdf60){logger[_0xe377('0xd')]('Error\x20authenticate\x20%s:\x20%s',_0x2c4ea2,util[_0xe377('0xe')](_0x2bdf60,{'showHidden':![],'depth':null}));_0xa1e50(_0xe377('0xf'));}else if(!_0x1abf8a){logger[_0xe377('0xd')](_0xe377('0x10'),_0x2c4ea2);_0xa1e50(_0xe377('0xf'));}else{_0x541cf0(_0x1abf8a);}});}catch(_0x376552){_0xa1e50(_0x376552);}});}function ActiveDirectoryAuthenticate(_0x13ee31,_0x260108,_0x521100,_0x5aeb2b){var _0x30e073,_0x3f15d9;if(!isActiveDirectoryConfigured(config)){logger[_0xe377('0xd')](_0xe377('0x11'),_0x260108);return _0x5aeb2b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xe377('0x12')][_0xe377('0x13')]({'where':{'id':0x1},'attributes':[_0xe377('0x14'),_0xe377('0x15')],'raw':!![]})[_0xe377('0x16')](function(_0x52d066){_0x30e073=_0x52d066;if(!_0x30e073[_0xe377('0x14')]){logger[_0xe377('0xd')](_0xe377('0x17'),_0x260108);throw new Error(_0xe377('0xf'));}return _0x13ee31[_0xe377('0x13')]({'attributes':['id',_0xe377('0x18'),_0xe377('0x19'),_0xe377('0x1a'),_0xe377('0x1b'),'disabled',_0xe377('0x1c'),_0xe377('0x1d'),_0xe377('0x1e')],'where':{'name':_0x260108,'role':{'$or':['admin',_0xe377('0x1f'),_0xe377('0x20')]},'adSsoEnabled':!![]}});})[_0xe377('0x16')](function(_0x5243b1){if(!_0x5243b1||_0x5243b1&&_0x5243b1[_0xe377('0x18')]!==_0x260108){throw new Error(_0xe377('0xf'));}_0x3f15d9=_0x5243b1;var _0x5d8014=_0x3f15d9[_0xe377('0x18')]+'@'+config[_0xe377('0xa')][_0xe377('0x21')];return adAuthenticate(config[_0xe377('0xa')],_0x5d8014,_0x521100);})['then'](function(_0x199c8a){if(_0x3f15d9[_0xe377('0x22')]){throw new Error(_0xe377('0xf'));}if(_0x30e073[_0xe377('0x15')]>0x0){if(_0x3f15d9[_0xe377('0x1c')]){if(moment(_0x3f15d9[_0xe377('0x1d')])[_0xe377('0x23')](_0x30e073[_0xe377('0x15')],_0xe377('0x24'))>moment()){throw new Error(_0xe377('0xf'));}return utils['clearBlockUser'](_0x3f15d9,0x0,![],null)[_0xe377('0x16')](function(){return utils[_0xe377('0x25')](_0x3f15d9);})['then'](function(){return _0x5aeb2b(null,_0x3f15d9);});}else{return utils[_0xe377('0x25')](_0x3f15d9)['then'](function(){return _0x5aeb2b(null,_0x3f15d9);});}}else{return utils[_0xe377('0x25')](_0x3f15d9)[_0xe377('0x16')](function(){return _0x5aeb2b(null,_0x3f15d9);});}})[_0xe377('0x26')](function(_0x2dde1c){return _0x5aeb2b(null,![],_0x2dde1c);});}function handleError(_0x5d23ea,_0xc19885,_0xbd5fc3){return _0x5d23ea[_0xe377('0x27')](_0xc19885||0x1f4)[_0xe377('0x28')]({'message':_0xbd5fc3?_0xbd5fc3['message']||_0xbd5fc3:''});}exports[_0xe377('0x29')]=function(_0x47bed2,_0xb9417d,_0x2f2e41){passport['authenticate'](_0xe377('0x2a'),function(_0x4b4c9a,_0x5c6146,_0x43dcb3){var _0x5122cd=_0x4b4c9a||_0x43dcb3;if(_0x5122cd){return handleError(_0xb9417d,0x191,_0x5122cd);}if(!_0x5c6146){return handleError(_0xb9417d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x569e8b={'payload':{'id':_0x5c6146['id'],'role':_0x5c6146[_0xe377('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xe377('0x2b')](_0x569e8b)[_0xe377('0x16')](function(_0x4c2e03){_0xb9417d[_0xe377('0x2c')]({'id':_0x5c6146['id'],'token':_0x4c2e03,'statusCall':'','isAlreadyLogged':_0x5c6146['online']});});}})(_0x47bed2,_0xb9417d,_0x2f2e41);};passport[_0xe377('0x2d')](_0xe377('0x2a'),new LocalStrategy({'usernameField':_0xe377('0x18'),'passwordField':_0xe377('0x19')},function(_0x2ddad3,_0x4f80fd,_0xab9188){return ActiveDirectoryAuthenticate(db[_0xe377('0x2e')],_0x2ddad3,_0x4f80fd,_0xab9188);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 0e2555d..f807e9f 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 _0x95dc=['login','exports','express','./authActiveDirectory.controller'];(function(_0x4ceb9d,_0x5d172c){var _0x4b35f7=function(_0x316c9a){while(--_0x316c9a){_0x4ceb9d['push'](_0x4ceb9d['shift']());}};_0x4b35f7(++_0x5d172c);}(_0x95dc,0x8a));var _0xc95d=function(_0x1e1f45,_0x24bda0){_0x1e1f45=_0x1e1f45-0x0;var _0x4df2b7=_0x95dc[_0x1e1f45];return _0x4df2b7;};'use strict';var express=require(_0xc95d('0x0'));var router=express['Router']();var controller=require(_0xc95d('0x1'));router['post']('/',controller[_0xc95d('0x2')]);module[_0xc95d('0x3')]=router;
\ No newline at end of file
+var _0xc763=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x692d3d,_0x36c9df){var _0x180d0a=function(_0x48b4e3){while(--_0x48b4e3){_0x692d3d['push'](_0x692d3d['shift']());}};_0x180d0a(++_0x36c9df);}(_0xc763,0xdb));var _0x3c76=function(_0xc69ffc,_0x6c5b2c){_0xc69ffc=_0xc69ffc-0x0;var _0x68bbf5=_0xc763[_0xc69ffc];return _0x68bbf5;};'use strict';var express=require(_0x3c76('0x0'));var router=express[_0x3c76('0x1')]();var controller=require(_0x3c76('0x2'));router[_0x3c76('0x3')]('/',controller[_0x3c76('0x4')]);module[_0x3c76('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 e07a5ba..cec3d11 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(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x7a54,0x106));var _0x47a5=function(_0x39182c,_0x2810a3){_0x39182c=_0x39182c-0x0;var _0x2dedcd=_0x7a54[_0x39182c];return _0x2dedcd;};'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(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x7a54,0x106));var _0x47a5=function(_0x57bc53,_0x1cdaa6){_0x57bc53=_0x57bc53-0x0;var _0x120c3b=_0x7a54[_0x57bc53];return _0x120c3b;};'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 f6e79d4..dd7a7f1 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 _0x151d=['callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','login','get','/callback'];(function(_0x3d9732,_0x3d37cd){var _0x13f6b1=function(_0xb1a2de){while(--_0xb1a2de){_0x3d9732['push'](_0x3d9732['shift']());}};_0x13f6b1(++_0x3d37cd);}(_0x151d,0x1e7));var _0xd151=function(_0x776d43,_0x15a958){_0x776d43=_0x776d43-0x0;var _0x10fce5=_0x151d[_0x776d43];return _0x10fce5;};'use strict';var express=require(_0xd151('0x0'));var passport=require(_0xd151('0x1'));var router=express[_0xd151('0x2')]();var controller=require(_0xd151('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0xd151('0x4'));router['get']('/',controller[_0xd151('0x5')]);router[_0xd151('0x6')](_0xd151('0x7'),controller[_0xd151('0x8')],authService[_0xd151('0x9')],userController[_0xd151('0x5')],authService['setTokenCookie']);module[_0xd151('0xa')]=router;
\ No newline at end of file
+var _0x02a0=['isMiddleware','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x468120,_0x3a5007){var _0x12e1c6=function(_0x23aad4){while(--_0x23aad4){_0x468120['push'](_0x468120['shift']());}};_0x12e1c6(++_0x3a5007);}(_0x02a0,0x1db));var _0x002a=function(_0x1d6d2f,_0x4f0757){_0x1d6d2f=_0x1d6d2f-0x0;var _0x4fc3ee=_0x02a0[_0x1d6d2f];return _0x4fc3ee;};'use strict';var express=require(_0x002a('0x0'));var passport=require(_0x002a('0x1'));var router=express[_0x002a('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x002a('0x3'));var authService=require(_0x002a('0x4'));router[_0x002a('0x5')]('/',controller[_0x002a('0x6')]);router['get'](_0x002a('0x7'),controller[_0x002a('0x8')],authService[_0x002a('0x9')],userController[_0x002a('0x6')],authService['setTokenCookie']);module[_0x002a('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 247e177..c87b75e 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 _0x1270=['signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','disabled','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockedAt','minutes','clearBlockUser','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1270,0x1b4));var _0x0127=function(_0x5a0cd1,_0x3f524f){_0x5a0cd1=_0x5a0cd1-0x0;var _0x2d1564=_0x1270[_0x5a0cd1];return _0x2d1564;};'use strict';var util=require('util');var passport=require(_0x0127('0x0'));var LocalStrategy=require(_0x0127('0x1'))[_0x0127('0x2')];var jayson=require(_0x0127('0x3'));var _=require(_0x0127('0x4'));var rs=require(_0x0127('0x5'));var moment=require('moment');var db=require(_0x0127('0x6'))['db'];var authService=require(_0x0127('0x7'));var utils=require(_0x0127('0x8'));var client=jayson['client'][_0x0127('0x9')]({'port':0x232b});function localAuthenticate(_0x35bf63,_0x351b23,_0x4f3608,_0x308183){var _0x291989,_0x4d0b29;return db[_0x0127('0xa')][_0x0127('0xb')]({'where':{'id':0x1},'attributes':[_0x0127('0xc'),_0x0127('0xd')],'raw':!![]})['then'](function(_0x393d74){_0x291989=_0x393d74;return _0x35bf63[_0x0127('0xb')]({'attributes':['id',_0x0127('0xe'),_0x0127('0xf'),'salt','role',_0x0127('0x10'),'blocked','blockedAt',_0x0127('0x11')],'where':{'name':_0x351b23,'role':{'$or':[_0x0127('0x12'),_0x0127('0x13'),_0x0127('0x14')]}}});})[_0x0127('0x15')](function(_0x3ded0d){if(!_0x3ded0d||_0x3ded0d&&_0x3ded0d['name']!==_0x351b23){throw new Error(_0x0127('0x16'));}else{_0x4d0b29=_0x3ded0d;return _0x4d0b29;}})[_0x0127('0x15')](function(){_0x4d0b29[_0x0127('0x17')](_0x4f3608,function(_0x3f633a,_0x31e56c){var _0x5c2f7d=_0x4d0b29[_0x0127('0x11')]+0x1;if(_0x3f633a){return _0x308183(_0x3f633a);}else if(!_0x31e56c){if(_0x4d0b29['disabled']){return _0x308183(null,![],{'message':_0x0127('0x16')});}else if(_0x291989[_0x0127('0xc')]>0x0){if(_0x4d0b29[_0x0127('0x18')]){if(_0x291989[_0x0127('0xd')]>0x0){if(moment(_0x4d0b29[_0x0127('0x19')])['add'](_0x291989[_0x0127('0xd')],_0x0127('0x1a'))>moment()){return _0x308183(null,![],{'message':_0x0127('0x16')});}else{return utils[_0x0127('0x1b')](_0x4d0b29,_0x5c2f7d,![],null)[_0x0127('0x15')](function(){return _0x308183(null,![],{'message':_0x0127('0x16')});});}}else{return _0x308183(null,![],{'message':_0x0127('0x16')});}}else{if(_0x5c2f7d>=_0x291989['allowedLoginAttempts']){return utils[_0x0127('0x1b')](_0x4d0b29,0x0,!![],moment())['then'](function(){return _0x308183(null,![],{'message':_0x0127('0x16')});});}else{return utils[_0x0127('0x1b')](_0x4d0b29,_0x5c2f7d,![],null)[_0x0127('0x15')](function(){return _0x308183(null,![],{'message':_0x0127('0x16')});});}}}else{return _0x308183(null,![],{'message':_0x0127('0x16')});}}else{if(_0x4d0b29[_0x0127('0x10')]){return _0x308183(null,![],{'message':_0x0127('0x16')});}else if(_0x291989[_0x0127('0xc')]>0x0){if(_0x4d0b29[_0x0127('0x18')]){if(_0x291989['blockDuration']>0x0){if(moment(_0x4d0b29[_0x0127('0x19')])[_0x0127('0x1c')](_0x291989[_0x0127('0xd')],'minutes')>moment()){return _0x308183(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0127('0x1b')](_0x4d0b29,0x0,![],null)[_0x0127('0x15')](function(){return utils['getLicense'](_0x4d0b29);})[_0x0127('0x15')](function(){return _0x308183(null,_0x4d0b29);});}}else{return _0x308183(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0127('0x1b')](_0x4d0b29,0x0,![],null)[_0x0127('0x15')](function(){return utils[_0x0127('0x1d')](_0x4d0b29);})[_0x0127('0x15')](function(){return _0x308183(null,_0x4d0b29);})['catch'](function(_0x2b2450){return _0x308183(null,![],_0x2b2450);});}}else{if(_0x4d0b29['blocked']){return _0x308183(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x4d0b29)[_0x0127('0x15')](function(){return _0x308183(null,_0x4d0b29);});}}}});})[_0x0127('0x1e')](function(_0x3042be){return _0x308183(null,![],_0x3042be);});}function sendServiceMail(_0x55dd87){return db['MailAccount'][_0x0127('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x0127('0xe'),_0x0127('0x20')],'include':[{'model':db[_0x0127('0x21')],'as':_0x0127('0x22'),'include':[{'model':db[_0x0127('0x23')],'as':_0x0127('0x23')}]}]})[_0x0127('0x15')](function(_0x46c199){if(!_0x46c199){throw new Error(_0x0127('0x24'));}var _0x506f0d=_0x46c199['getSmtpOptions']();var _0x51118e={'account':_0x506f0d,'message':_[_0x0127('0x25')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x46c199[_0x0127('0xe')],_0x46c199['email']||_0x46c199[_0x0127('0x22')][_0x0127('0x13')])},_0x55dd87)};return client['request'](_0x0127('0x26'),_0x51118e);})[_0x0127('0x15')](function(_0xf2ebfd){if(_0xf2ebfd[_0x0127('0x27')]){throw new Error(util[_0x0127('0x28')](_0x0127('0x29'),_0xf2ebfd['error'][_0x0127('0x2a')]||JSON[_0x0127('0x2b')](_0xf2ebfd[_0x0127('0x27')])));}return!![];});}function handleError(_0x439030,_0x5d26a1,_0x42866b){return _0x439030[_0x0127('0x2c')](_0x5d26a1||0x1f4)[_0x0127('0x2d')]({'message':_0x42866b?_0x42866b[_0x0127('0x2a')]||_0x42866b:''});}exports[_0x0127('0x2e')]=function(_0x1b9771,_0x190f32,_0x307dfc){passport[_0x0127('0x17')](_0x0127('0x2f'),function(_0x370fac,_0x1bffd7,_0x124f28){var _0x294a35=_0x370fac||_0x124f28;if(_0x294a35){return handleError(_0x190f32,0x191,_0x294a35);}if(!_0x1bffd7){return handleError(_0x190f32,0x194,{'message':_0x0127('0x30')});}else{var _0x5933a1={'payload':{'id':_0x1bffd7['id'],'role':_0x1bffd7[_0x0127('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x0127('0x32')](_0x5933a1)[_0x0127('0x15')](function(_0x279d68){_0x190f32[_0x0127('0x33')]({'id':_0x1bffd7['id'],'token':_0x279d68,'statusCall':'','isAlreadyLogged':_0x1bffd7['online']});});}})(_0x1b9771,_0x190f32,_0x307dfc);};exports[_0x0127('0x34')]=function(_0x4ffaf3,_0xe97016){if(!_0x4ffaf3[_0x0127('0x35')][_0x0127('0x20')]){return handleError(_0xe97016,0x1f4,{'message':_0x0127('0x36')});}var _0x4f6fc3=rs[_0x0127('0x37')]();_0x4ffaf3[_0x0127('0x35')][_0x0127('0x20')]=_0x4ffaf3[_0x0127('0x35')]['email'][_0x0127('0x38')]()[_0x0127('0x39')]();var _0x3ece2c;return db[_0x0127('0xa')][_0x0127('0xb')]({'where':{'id':0x1},'attributes':[_0x0127('0xc'),_0x0127('0xd')],'raw':!![]})[_0x0127('0x15')](function(_0x22286d){_0x3ece2c=_0x22286d;return db[_0x0127('0x3a')][_0x0127('0x1f')]({'where':{'email':_0x4ffaf3[_0x0127('0x35')]['email']}});})[_0x0127('0x15')](function(_0xcf51c2){if(!_0xcf51c2){throw new Error(_0x0127('0x3b'));}if(_0xcf51c2['disabled']){throw new Error(_0x0127('0x3c'));}if(_0xcf51c2['blocked']){if(moment(_0xcf51c2['blockedAt'])[_0x0127('0x1c')](_0x3ece2c['blockDuration'],_0x0127('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xcf51c2[_0x0127('0x18')]=![];_0xcf51c2[_0x0127('0x19')]=null;}}_0xcf51c2[_0x0127('0x3d')]=_0x4f6fc3;_0xcf51c2[_0x0127('0x3e')]=Date[_0x0127('0x3f')]()+0x36ee80;return _0xcf51c2[_0x0127('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x4ffaf3['body']['email'],'subject':_0x0127('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x0127('0x42')+_0x0127('0x43')+_0x4ffaf3[_0x0127('0x44')]['host']+_0x0127('0x45')+_0x4f6fc3+'\x0a\x0a'+_0x0127('0x46')});})[_0x0127('0x15')](function(){_0xe97016['status'](0xc8)[_0x0127('0x2d')]({'message':_0x0127('0x47')});})[_0x0127('0x1e')](function(_0x472e2b){return handleError(_0xe97016,0x1f4,_0x472e2b);});};exports[_0x0127('0x48')]=function(_0x5754da,_0x305c9d){return db[_0x0127('0x3a')][_0x0127('0x1f')]({'where':{'resetPasswordToken':_0x5754da[_0x0127('0x49')][_0x0127('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x0127('0x3f')]()}}})[_0x0127('0x15')](function(_0x44fff7){if(!_0x44fff7){throw new Error(_0x0127('0x4b'));}return db[_0x0127('0xa')][_0x0127('0xb')]({'attributes':['id',_0x0127('0x4c'),_0x0127('0x4d'),_0x0127('0x4e')]})[_0x0127('0x15')](function(_0x580603){if(_0x580603['securePassword'])authService['validatePasswordPattern'](_0x5754da['body'][_0x0127('0xf')]);if(!_0x580603[_0x0127('0x4d')]||!_0x44fff7[_0x0127('0x4f')])return _0x44fff7;authService['validatePasswordHistory'](_0x5754da[_0x0127('0x35')][_0x0127('0xf')],_0x44fff7[_0x0127('0x4f')],_0x580603['passwordHistoryLimit']);return _0x44fff7;})['then'](function(){_0x44fff7[_0x0127('0xf')]=_0x5754da[_0x0127('0x35')][_0x0127('0xf')];_0x44fff7[_0x0127('0x3d')]=null;_0x44fff7['resetPasswordExpires']=null;return _0x44fff7['save']();});})[_0x0127('0x15')](function(){_0x305c9d[_0x0127('0x2c')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x0127('0x1e')](function(_0x4fdf1d){return handleError(_0x305c9d,0x1f4,_0x4fdf1d);});};passport[_0x0127('0x50')](_0x0127('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x0127('0xf')},function(_0x13d023,_0x265ad1,_0x75c844){return localAuthenticate(db['User'],_0x13d023,_0x265ad1,_0x75c844);}));
\ No newline at end of file
+var _0x0c69=['jayson/promise','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','findOne','blockDuration','then','name','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','allowedLoginAttempts','add','getLicense','catch','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','email','SendMail','error','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','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','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport','passport-local'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c69,0x96));var _0x90c6=function(_0x57d961,_0xd0800b){_0x57d961=_0x57d961-0x0;var _0x2ee280=_0x0c69[_0x57d961];return _0x2ee280;};'use strict';var util=require('util');var passport=require(_0x90c6('0x0'));var LocalStrategy=require(_0x90c6('0x1'))['Strategy'];var jayson=require(_0x90c6('0x2'));var _=require(_0x90c6('0x3'));var rs=require(_0x90c6('0x4'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x90c6('0x5'));var utils=require(_0x90c6('0x6'));var client=jayson[_0x90c6('0x7')][_0x90c6('0x8')]({'port':0x232b});function localAuthenticate(_0x3742a0,_0x23d36d,_0x55b607,_0x19e782){var _0xba9bd7,_0x2b7fad;return db['Setting'][_0x90c6('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x90c6('0xa')],'raw':!![]})[_0x90c6('0xb')](function(_0x489658){_0xba9bd7=_0x489658;return _0x3742a0[_0x90c6('0x9')]({'attributes':['id',_0x90c6('0xc'),'password','salt',_0x90c6('0xd'),_0x90c6('0xe'),_0x90c6('0xf'),_0x90c6('0x10'),_0x90c6('0x11')],'where':{'name':_0x23d36d,'role':{'$or':[_0x90c6('0x12'),_0x90c6('0x13'),_0x90c6('0x14')]}}});})[_0x90c6('0xb')](function(_0x5f2b5a){if(!_0x5f2b5a||_0x5f2b5a&&_0x5f2b5a[_0x90c6('0xc')]!==_0x23d36d){throw new Error(_0x90c6('0x15'));}else{_0x2b7fad=_0x5f2b5a;return _0x2b7fad;}})[_0x90c6('0xb')](function(){_0x2b7fad[_0x90c6('0x16')](_0x55b607,function(_0x12796f,_0xdfe19d){var _0x1cee74=_0x2b7fad[_0x90c6('0x11')]+0x1;if(_0x12796f){return _0x19e782(_0x12796f);}else if(!_0xdfe19d){if(_0x2b7fad[_0x90c6('0xe')]){return _0x19e782(null,![],{'message':_0x90c6('0x15')});}else if(_0xba9bd7['allowedLoginAttempts']>0x0){if(_0x2b7fad[_0x90c6('0xf')]){if(_0xba9bd7[_0x90c6('0xa')]>0x0){if(moment(_0x2b7fad[_0x90c6('0x10')])['add'](_0xba9bd7[_0x90c6('0xa')],_0x90c6('0x17'))>moment()){return _0x19e782(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x90c6('0x18')](_0x2b7fad,_0x1cee74,![],null)[_0x90c6('0xb')](function(){return _0x19e782(null,![],{'message':_0x90c6('0x15')});});}}else{return _0x19e782(null,![],{'message':_0x90c6('0x15')});}}else{if(_0x1cee74>=_0xba9bd7[_0x90c6('0x19')]){return utils['clearBlockUser'](_0x2b7fad,0x0,!![],moment())[_0x90c6('0xb')](function(){return _0x19e782(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x90c6('0x18')](_0x2b7fad,_0x1cee74,![],null)[_0x90c6('0xb')](function(){return _0x19e782(null,![],{'message':_0x90c6('0x15')});});}}}else{return _0x19e782(null,![],{'message':_0x90c6('0x15')});}}else{if(_0x2b7fad[_0x90c6('0xe')]){return _0x19e782(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xba9bd7[_0x90c6('0x19')]>0x0){if(_0x2b7fad[_0x90c6('0xf')]){if(_0xba9bd7[_0x90c6('0xa')]>0x0){if(moment(_0x2b7fad[_0x90c6('0x10')])[_0x90c6('0x1a')](_0xba9bd7[_0x90c6('0xa')],_0x90c6('0x17'))>moment()){return _0x19e782(null,![],{'message':_0x90c6('0x15')});}else{return utils['clearBlockUser'](_0x2b7fad,0x0,![],null)['then'](function(){return utils[_0x90c6('0x1b')](_0x2b7fad);})[_0x90c6('0xb')](function(){return _0x19e782(null,_0x2b7fad);});}}else{return _0x19e782(null,![],{'message':_0x90c6('0x15')});}}else{return utils[_0x90c6('0x18')](_0x2b7fad,0x0,![],null)[_0x90c6('0xb')](function(){return utils[_0x90c6('0x1b')](_0x2b7fad);})[_0x90c6('0xb')](function(){return _0x19e782(null,_0x2b7fad);})['catch'](function(_0x41a62b){return _0x19e782(null,![],_0x41a62b);});}}else{if(_0x2b7fad[_0x90c6('0xf')]){return _0x19e782(null,![],{'message':_0x90c6('0x15')});}else{return utils[_0x90c6('0x1b')](_0x2b7fad)[_0x90c6('0xb')](function(){return _0x19e782(null,_0x2b7fad);});}}}});})[_0x90c6('0x1c')](function(_0x1f160a){return _0x19e782(null,![],_0x1f160a);});}function sendServiceMail(_0x1dfe89){return db['MailAccount'][_0x90c6('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x90c6('0xc'),'email'],'include':[{'model':db[_0x90c6('0x1e')],'as':_0x90c6('0x1f'),'include':[{'model':db['CloudProvider'],'as':_0x90c6('0x20')}]}]})[_0x90c6('0xb')](function(_0x25cf54){if(!_0x25cf54){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x2388df=_0x25cf54[_0x90c6('0x21')]();var _0x23bded={'account':_0x2388df,'message':_[_0x90c6('0x22')]({'from':util[_0x90c6('0x23')]('\x22%s\x22\x20<%s>',_0x25cf54[_0x90c6('0xc')],_0x25cf54[_0x90c6('0x24')]||_0x25cf54[_0x90c6('0x1f')]['user'])},_0x1dfe89)};return client['request'](_0x90c6('0x25'),_0x23bded);})['then'](function(_0x3bbe07){if(_0x3bbe07[_0x90c6('0x26')]){throw new Error(util[_0x90c6('0x23')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3bbe07[_0x90c6('0x26')]['message']||JSON['stringify'](_0x3bbe07[_0x90c6('0x26')])));}return!![];});}function handleError(_0x3d93bc,_0x1610c5,_0x2f2045){return _0x3d93bc[_0x90c6('0x27')](_0x1610c5||0x1f4)[_0x90c6('0x28')]({'message':_0x2f2045?_0x2f2045[_0x90c6('0x29')]||_0x2f2045:''});}exports[_0x90c6('0x2a')]=function(_0x3dd65d,_0x34cc23,_0x50724f){passport[_0x90c6('0x16')](_0x90c6('0x2b'),function(_0x4387b4,_0x26e64b,_0x4d51aa){var _0x5cc64b=_0x4387b4||_0x4d51aa;if(_0x5cc64b){return handleError(_0x34cc23,0x191,_0x5cc64b);}if(!_0x26e64b){return handleError(_0x34cc23,0x194,{'message':_0x90c6('0x2c')});}else{var _0x37d5bf={'payload':{'id':_0x26e64b['id'],'role':_0x26e64b['role']},'options':{'expiresIn':0x15180}};return authService[_0x90c6('0x2d')](_0x37d5bf)[_0x90c6('0xb')](function(_0x1d6162){_0x34cc23[_0x90c6('0x2e')]({'id':_0x26e64b['id'],'token':_0x1d6162,'statusCall':'','isAlreadyLogged':_0x26e64b[_0x90c6('0x2f')]});});}})(_0x3dd65d,_0x34cc23,_0x50724f);};exports['forgot']=function(_0x3c47d1,_0x4d00d1){if(!_0x3c47d1['body'][_0x90c6('0x24')]){return handleError(_0x4d00d1,0x1f4,{'message':_0x90c6('0x30')});}var _0x234273=rs[_0x90c6('0x31')]();_0x3c47d1[_0x90c6('0x32')][_0x90c6('0x24')]=_0x3c47d1[_0x90c6('0x32')][_0x90c6('0x24')]['trim']()[_0x90c6('0x33')]();var _0x233a06;return db[_0x90c6('0x34')][_0x90c6('0x9')]({'where':{'id':0x1},'attributes':[_0x90c6('0x19'),_0x90c6('0xa')],'raw':!![]})[_0x90c6('0xb')](function(_0x5df7cc){_0x233a06=_0x5df7cc;return db[_0x90c6('0x35')][_0x90c6('0x1d')]({'where':{'email':_0x3c47d1[_0x90c6('0x32')][_0x90c6('0x24')]}});})[_0x90c6('0xb')](function(_0x220480){if(!_0x220480){throw new Error(_0x90c6('0x36'));}if(_0x220480[_0x90c6('0xe')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x220480['blocked']){if(moment(_0x220480['blockedAt'])['add'](_0x233a06[_0x90c6('0xa')],_0x90c6('0x17'))>moment()){throw new Error(_0x90c6('0x37'));}else{_0x220480['blocked']=![];_0x220480[_0x90c6('0x10')]=null;}}_0x220480[_0x90c6('0x38')]=_0x234273;_0x220480[_0x90c6('0x39')]=Date[_0x90c6('0x3a')]()+0x36ee80;return _0x220480[_0x90c6('0x3b')]();})['then'](function(){return sendServiceMail({'to':_0x3c47d1[_0x90c6('0x32')]['email'],'subject':_0x90c6('0x3c'),'text':_0x90c6('0x3d')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x3c47d1[_0x90c6('0x3e')][_0x90c6('0x3f')]+'/reset/'+_0x234273+'\x0a\x0a'+_0x90c6('0x40')});})[_0x90c6('0xb')](function(){_0x4d00d1[_0x90c6('0x27')](0xc8)[_0x90c6('0x28')]({'message':_0x90c6('0x41')});})[_0x90c6('0x1c')](function(_0x7a2e75){return handleError(_0x4d00d1,0x1f4,_0x7a2e75);});};exports['reset']=function(_0x4cc720,_0x61eb21){return db[_0x90c6('0x35')][_0x90c6('0x1d')]({'where':{'resetPasswordToken':_0x4cc720[_0x90c6('0x42')][_0x90c6('0x43')],'resetPasswordExpires':{'$gt':Date[_0x90c6('0x3a')]()}}})[_0x90c6('0xb')](function(_0x1bb5be){if(!_0x1bb5be){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x90c6('0x34')][_0x90c6('0x9')]({'attributes':['id','securePassword',_0x90c6('0x44'),_0x90c6('0x45')]})['then'](function(_0x2e741a){if(_0x2e741a[_0x90c6('0x46')])authService['validatePasswordPattern'](_0x4cc720[_0x90c6('0x32')][_0x90c6('0x47')]);if(!_0x2e741a[_0x90c6('0x44')]||!_0x1bb5be[_0x90c6('0x48')])return _0x1bb5be;authService[_0x90c6('0x49')](_0x4cc720[_0x90c6('0x32')][_0x90c6('0x47')],_0x1bb5be[_0x90c6('0x48')],_0x2e741a[_0x90c6('0x45')]);return _0x1bb5be;})[_0x90c6('0xb')](function(){_0x1bb5be[_0x90c6('0x47')]=_0x4cc720[_0x90c6('0x32')]['password'];_0x1bb5be[_0x90c6('0x38')]=null;_0x1bb5be[_0x90c6('0x39')]=null;return _0x1bb5be[_0x90c6('0x3b')]();});})[_0x90c6('0xb')](function(){_0x61eb21[_0x90c6('0x27')](0xc8)['send']({'message':_0x90c6('0x4a')});})['catch'](function(_0x52eab6){return handleError(_0x61eb21,0x1f4,_0x52eab6);});};passport[_0x90c6('0x4b')](_0x90c6('0x2b'),new LocalStrategy({'usernameField':_0x90c6('0xc'),'passwordField':'password'},function(_0x50332b,_0xa00e3b,_0x13575b){return localAuthenticate(db['User'],_0x50332b,_0xa00e3b,_0x13575b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 0d54a41..b3896a2 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 _0xbf4b=['post','login','forgot','express','Router','./authLocal.controller'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbf4b,0xe1));var _0xbbf4=function(_0xf9e76,_0x2e6b9a){_0xf9e76=_0xf9e76-0x0;var _0x119a9b=_0xbf4b[_0xf9e76];return _0x119a9b;};'use strict';var express=require(_0xbbf4('0x0'));var router=express[_0xbbf4('0x1')]();var controller=require(_0xbbf4('0x2'));router[_0xbbf4('0x3')]('/',controller[_0xbbf4('0x4')]);router[_0xbbf4('0x3')]('/forgot',controller[_0xbbf4('0x5')]);router[_0xbbf4('0x3')]('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0x1d2a=['express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset'];(function(_0x8494aa,_0x4ce41e){var _0x42053b=function(_0x1b26d2){while(--_0x1b26d2){_0x8494aa['push'](_0x8494aa['shift']());}};_0x42053b(++_0x4ce41e);}(_0x1d2a,0x130));var _0xa1d2=function(_0x46f8d4,_0x10a90a){_0x46f8d4=_0x46f8d4-0x0;var _0x11dde7=_0x1d2a[_0x46f8d4];return _0x11dde7;};'use strict';var express=require(_0xa1d2('0x0'));var router=express['Router']();var controller=require(_0xa1d2('0x1'));router[_0xa1d2('0x2')]('/',controller[_0xa1d2('0x3')]);router[_0xa1d2('0x2')](_0xa1d2('0x4'),controller[_0xa1d2('0x5')]);router['post'](_0xa1d2('0x6'),controller[_0xa1d2('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 5ab52a4..6ea37ce 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 _0x0ce6=['INTEGER','exports','STRING'];(function(_0x434969,_0x3ef4fe){var _0xac29d7=function(_0x30ef6c){while(--_0x30ef6c){_0x434969['push'](_0x434969['shift']());}};_0xac29d7(++_0x3ef4fe);}(_0x0ce6,0x100));var _0x60ce=function(_0x272e68,_0x49f8c4){_0x272e68=_0x272e68-0x0;var _0x532fc7=_0x0ce6[_0x272e68];return _0x532fc7;};'use strict';var Sequelize=require('sequelize');module[_0x60ce('0x0')]={'name':{'type':Sequelize[_0x60ce('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x60ce('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x60ce('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x667b=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x475e33,_0x42824a){var _0x318871=function(_0x54394c){while(--_0x54394c){_0x475e33['push'](_0x475e33['shift']());}};_0x318871(++_0x42824a);}(_0x667b,0x1da));var _0xb667=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0x667b[_0xf48cce];return _0x2a5c38;};'use strict';var Sequelize=require('sequelize');module[_0xb667('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb667('0x1')]},'status':{'type':Sequelize[_0xb667('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb667('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 b285e56..e5b01ee 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 _0x2787=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','end','sendStatus','stack','name','map','Automation','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','fields','find','create','body','update','addConditions','omit','ids','getConditions','Condition','nolimit','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x2787,0x18a));var _0x7278=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2787[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7278('0x0'));var rimraf=require(_0x7278('0x1'));var zipdir=require(_0x7278('0x2'));var jsonpatch=require(_0x7278('0x3'));var rp=require('request-promise');var moment=require(_0x7278('0x4'));var BPromise=require(_0x7278('0x5'));var Mustache=require(_0x7278('0x6'));var util=require('util');var path=require(_0x7278('0x7'));var sox=require(_0x7278('0x8'));var csv=require(_0x7278('0x9'));var ejs=require(_0x7278('0xa'));var fs=require('fs');var fs_extra=require(_0x7278('0xb'));var _=require(_0x7278('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7278('0xd'));var deskjs=require(_0x7278('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7278('0xf'));var Papa=require(_0x7278('0x10'));var Redis=require(_0x7278('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7278('0x12'));var as=require(_0x7278('0x13'));var hardwareService=require(_0x7278('0x14'));var logger=require('../../config/logger')(_0x7278('0x15'));var utils=require('../../config/utils');var config=require(_0x7278('0x16'));var licenseUtil=require(_0x7278('0x17'));var db=require(_0x7278('0x18'))['db'];function respondWithStatusCode(_0x404b51,_0x424548){_0x424548=_0x424548||0xcc;return function(_0x4788a4){if(_0x4788a4){return _0x404b51['sendStatus'](_0x424548);}return _0x404b51[_0x7278('0x19')](_0x424548)['end']();};}function respondWithResult(_0x21b9ea,_0x4c431b){_0x4c431b=_0x4c431b||0xc8;return function(_0x4b5356){if(_0x4b5356){return _0x21b9ea[_0x7278('0x19')](_0x4c431b)[_0x7278('0x1a')](_0x4b5356);}};}function respondWithFilteredResult(_0x3c10ae,_0x44f6b8){return function(_0x3c55c9){if(_0x3c55c9){var _0x368641=typeof _0x44f6b8['offset']===_0x7278('0x1b')&&typeof _0x44f6b8[_0x7278('0x1c')]===_0x7278('0x1b');var _0x5283f4=_0x3c55c9[_0x7278('0x1d')];var _0x919d62=_0x368641?0x0:_0x44f6b8['offset'];var _0x4188ff=_0x368641?_0x3c55c9[_0x7278('0x1d')]:_0x44f6b8[_0x7278('0x1e')]+_0x44f6b8[_0x7278('0x1c')];var _0x5d7b85;if(_0x4188ff>=_0x5283f4){_0x4188ff=_0x5283f4;_0x5d7b85=0xc8;}else{_0x5d7b85=0xce;}_0x3c10ae[_0x7278('0x19')](_0x5d7b85);return _0x3c10ae[_0x7278('0x1f')](_0x7278('0x20'),_0x919d62+'-'+_0x4188ff+'/'+_0x5283f4)[_0x7278('0x1a')](_0x3c55c9);}return null;};}function patchUpdates(_0x258853){return function(_0x595b6b){try{jsonpatch[_0x7278('0x21')](_0x595b6b,_0x258853,!![]);}catch(_0x380a35){return BPromise[_0x7278('0x22')](_0x380a35);}return _0x595b6b[_0x7278('0x23')]();};}function saveUpdates(_0x4fc0d4,_0x3ea92a){return function(_0x4289eb){if(_0x4289eb){return _0x4289eb['update'](_0x4fc0d4)['then'](function(_0x4daa96){return _0x4daa96;});}return null;};}function removeEntity(_0x982ae2,_0x9f3a3a){return function(_0x31be59){if(_0x31be59){return _0x31be59[_0x7278('0x24')]()['then'](function(){_0x982ae2[_0x7278('0x19')](0xcc)[_0x7278('0x25')]();});}};}function handleEntityNotFound(_0x57bcb1,_0x2f6804){return function(_0x1f9213){if(!_0x1f9213){_0x57bcb1[_0x7278('0x26')](0x194);}return _0x1f9213;};}function handleError(_0x13ffc4,_0x161a9f){_0x161a9f=_0x161a9f||0x1f4;return function(_0x2c3403){logger['error'](_0x2c3403[_0x7278('0x27')]);if(_0x2c3403[_0x7278('0x28')]){delete _0x2c3403['name'];}_0x13ffc4[_0x7278('0x19')](_0x161a9f)['send'](_0x2c3403);};}exports['index']=function(_0x4309b6,_0x10f11d){var _0x32f534={},_0x2e94bd={},_0x1cca94={'count':0x0,'rows':[]};var _0x2d0b18=_[_0x7278('0x29')](db[_0x7278('0x2a')][_0x7278('0x2b')],function(_0x10604e){return{'name':_0x10604e[_0x7278('0x2c')],'type':_0x10604e['type']['key']};});_0x2e94bd[_0x7278('0x2d')]=_[_0x7278('0x29')](_0x2d0b18,'name');_0x2e94bd[_0x7278('0x2e')]=_[_0x7278('0x2f')](_0x4309b6[_0x7278('0x2e')]);_0x2e94bd[_0x7278('0x30')]=_[_0x7278('0x31')](_0x2e94bd[_0x7278('0x2d')],_0x2e94bd['query']);_0x32f534['attributes']=_['intersection'](_0x2e94bd[_0x7278('0x2d')],qs['fields'](_0x4309b6[_0x7278('0x2e')]['fields']));_0x32f534[_0x7278('0x32')]=_0x32f534[_0x7278('0x32')][_0x7278('0x33')]?_0x32f534['attributes']:_0x2e94bd['model'];if(!_0x4309b6['query'][_0x7278('0x34')]('nolimit')){_0x32f534[_0x7278('0x1c')]=qs[_0x7278('0x1c')](_0x4309b6[_0x7278('0x2e')][_0x7278('0x1c')]);_0x32f534[_0x7278('0x1e')]=qs[_0x7278('0x1e')](_0x4309b6[_0x7278('0x2e')][_0x7278('0x1e')]);}_0x32f534[_0x7278('0x35')]=qs[_0x7278('0x36')](_0x4309b6[_0x7278('0x2e')][_0x7278('0x36')]);_0x32f534[_0x7278('0x37')]=qs[_0x7278('0x30')](_[_0x7278('0x38')](_0x4309b6[_0x7278('0x2e')],_0x2e94bd['filters']),_0x2d0b18);if(_0x4309b6['query'][_0x7278('0x39')]){_0x32f534[_0x7278('0x37')]=_[_0x7278('0x3a')](_0x32f534[_0x7278('0x37')],{'$or':_['map'](_0x2d0b18,function(_0x3f6621){if(_0x3f6621[_0x7278('0x3b')]!==_0x7278('0x3c')){var _0x530a92={};_0x530a92[_0x3f6621['name']]={'$like':'%'+_0x4309b6[_0x7278('0x2e')]['filter']+'%'};return _0x530a92;}})});}_0x32f534=_[_0x7278('0x3a')]({},_0x32f534,_0x4309b6[_0x7278('0x3d')]);var _0x4250dc={'where':_0x32f534[_0x7278('0x37')]};return db[_0x7278('0x2a')][_0x7278('0x1d')](_0x4250dc)[_0x7278('0x3e')](function(_0x2b5e26){_0x1cca94['count']=_0x2b5e26;if(_0x4309b6[_0x7278('0x2e')][_0x7278('0x3f')]){_0x32f534[_0x7278('0x40')]=[{'all':!![]}];}return db[_0x7278('0x2a')][_0x7278('0x41')](_0x32f534);})[_0x7278('0x3e')](function(_0xfa247a){_0x1cca94[_0x7278('0x42')]=_0xfa247a;return _0x1cca94;})['then'](respondWithFilteredResult(_0x10f11d,_0x32f534))[_0x7278('0x43')](handleError(_0x10f11d,null));};exports['show']=function(_0x363aca,_0x4caea1){var _0x58d882={'raw':![],'where':{'id':_0x363aca[_0x7278('0x44')]['id']}},_0x202faa={};_0x202faa[_0x7278('0x2d')]=_[_0x7278('0x2f')](db['Automation'][_0x7278('0x2b')]);_0x202faa[_0x7278('0x2e')]=_[_0x7278('0x2f')](_0x363aca[_0x7278('0x2e')]);_0x202faa[_0x7278('0x30')]=_[_0x7278('0x31')](_0x202faa[_0x7278('0x2d')],_0x202faa[_0x7278('0x2e')]);_0x58d882[_0x7278('0x32')]=_[_0x7278('0x31')](_0x202faa[_0x7278('0x2d')],qs[_0x7278('0x45')](_0x363aca[_0x7278('0x2e')][_0x7278('0x45')]));_0x58d882[_0x7278('0x32')]=_0x58d882['attributes'][_0x7278('0x33')]?_0x58d882[_0x7278('0x32')]:_0x202faa[_0x7278('0x2d')];if(_0x363aca[_0x7278('0x2e')][_0x7278('0x3f')]){_0x58d882['include']=[{'all':!![]}];}_0x58d882=_[_0x7278('0x3a')]({},_0x58d882,_0x363aca[_0x7278('0x3d')]);return db[_0x7278('0x2a')][_0x7278('0x46')](_0x58d882)['then'](handleEntityNotFound(_0x4caea1,null))[_0x7278('0x3e')](respondWithResult(_0x4caea1,null))[_0x7278('0x43')](handleError(_0x4caea1,null));};exports[_0x7278('0x47')]=function(_0x226a41,_0x2a50da){return db[_0x7278('0x2a')][_0x7278('0x47')](_0x226a41[_0x7278('0x48')],{})[_0x7278('0x3e')](respondWithResult(_0x2a50da,0xc9))['catch'](handleError(_0x2a50da,null));};exports[_0x7278('0x49')]=function(_0x515457,_0x2aaee5){if(_0x515457[_0x7278('0x48')]['id']){delete _0x515457['body']['id'];}return db[_0x7278('0x2a')][_0x7278('0x46')]({'where':{'id':_0x515457['params']['id']}})[_0x7278('0x3e')](handleEntityNotFound(_0x2aaee5,null))['then'](saveUpdates(_0x515457['body'],null))[_0x7278('0x3e')](respondWithResult(_0x2aaee5,null))['catch'](handleError(_0x2aaee5,null));};exports['destroy']=function(_0x1b3655,_0x146f9a){return db[_0x7278('0x2a')]['find']({'where':{'id':_0x1b3655[_0x7278('0x44')]['id']}})['then'](handleEntityNotFound(_0x146f9a,null))[_0x7278('0x3e')](removeEntity(_0x146f9a,null))[_0x7278('0x43')](handleError(_0x146f9a,null));};exports[_0x7278('0x4a')]=function(_0xf62cfe,_0x2c011b,_0x373af0){return db['Condition'][_0x7278('0x46')]({'where':{'id':_0xf62cfe['params']['id']}})[_0x7278('0x3e')](handleEntityNotFound(_0x2c011b,null))['then'](function(_0xe480c2){if(_0xe480c2){return _0xe480c2[_0x7278('0x4a')](_0xf62cfe[_0x7278('0x48')]['ids'],_[_0x7278('0x4b')](_0xf62cfe[_0x7278('0x48')],[_0x7278('0x4c'),'id'])||{});}})[_0x7278('0x3e')](respondWithResult(_0x2c011b,null))[_0x7278('0x43')](handleError(_0x2c011b,null));};exports[_0x7278('0x4d')]=function(_0x16913c,_0x339501,_0x59f7a4){var _0x2f85ca={};var _0x1ba7b4={};var _0xf93bc7;var _0x310ad3;return db[_0x7278('0x2a')]['findOne']({'where':{'id':_0x16913c[_0x7278('0x44')]['id']}})[_0x7278('0x3e')](handleEntityNotFound(_0x339501,null))['then'](function(_0x28b84e){if(_0x28b84e){_0xf93bc7=_0x28b84e;_0x1ba7b4[_0x7278('0x2d')]=_[_0x7278('0x2f')](db[_0x7278('0x4e')]['rawAttributes']);_0x1ba7b4['query']=_[_0x7278('0x2f')](_0x16913c['query']);_0x1ba7b4[_0x7278('0x30')]=_[_0x7278('0x31')](_0x1ba7b4[_0x7278('0x2d')],_0x1ba7b4['query']);_0x2f85ca[_0x7278('0x32')]=_[_0x7278('0x31')](_0x1ba7b4['model'],qs[_0x7278('0x45')](_0x16913c[_0x7278('0x2e')][_0x7278('0x45')]));_0x2f85ca[_0x7278('0x32')]=_0x2f85ca[_0x7278('0x32')][_0x7278('0x33')]?_0x2f85ca[_0x7278('0x32')]:_0x1ba7b4[_0x7278('0x2d')];_0x2f85ca[_0x7278('0x35')]=qs[_0x7278('0x36')](_0x16913c[_0x7278('0x2e')][_0x7278('0x36')]);_0x2f85ca[_0x7278('0x37')]=qs[_0x7278('0x30')](_[_0x7278('0x38')](_0x16913c['query'],_0x1ba7b4[_0x7278('0x30')]));if(_0x16913c[_0x7278('0x2e')][_0x7278('0x39')]){_0x2f85ca['where']=_[_0x7278('0x3a')](_0x2f85ca[_0x7278('0x37')],{'$or':_[_0x7278('0x29')](_0x2f85ca[_0x7278('0x32')],function(_0xabe7e9){var _0x3c22e4={};_0x3c22e4[_0xabe7e9]={'$like':'%'+_0x16913c[_0x7278('0x2e')][_0x7278('0x39')]+'%'};return _0x3c22e4;})});}_0x2f85ca=_[_0x7278('0x3a')]({},_0x2f85ca,_0x16913c['options']);return _0xf93bc7['getConditions'](_0x2f85ca);}})['then'](function(_0x358486){if(_0x358486){_0x310ad3=_0x358486[_0x7278('0x33')];if(!_0x16913c[_0x7278('0x2e')]['hasOwnProperty'](_0x7278('0x4f'))){_0x2f85ca[_0x7278('0x1c')]=qs[_0x7278('0x1c')](_0x16913c['query']['limit']);_0x2f85ca[_0x7278('0x1e')]=qs[_0x7278('0x1e')](_0x16913c['query'][_0x7278('0x1e')]);}return _0xf93bc7[_0x7278('0x4d')](_0x2f85ca);}})[_0x7278('0x3e')](function(_0xf1945){if(_0xf1945){return _0xf1945?{'count':_0x310ad3,'rows':_0xf1945}:null;}})['then'](respondWithResult(_0x339501,null))[_0x7278('0x43')](handleError(_0x339501,null));};exports[_0x7278('0x50')]=function(_0x2bc5b1,_0x1cc45e,_0x30e527){return db[_0x7278('0x51')][_0x7278('0x46')]({'where':{'id':_0x2bc5b1[_0x7278('0x44')]['id']}})[_0x7278('0x3e')](handleEntityNotFound(_0x1cc45e,null))[_0x7278('0x3e')](function(_0x41b79d){if(_0x41b79d){return _0x41b79d[_0x7278('0x50')](_0x2bc5b1[_0x7278('0x48')][_0x7278('0x4c')],_[_0x7278('0x4b')](_0x2bc5b1[_0x7278('0x48')],[_0x7278('0x4c'),'id'])||{});}})[_0x7278('0x3e')](respondWithResult(_0x1cc45e,null))[_0x7278('0x43')](handleError(_0x1cc45e,null));};exports[_0x7278('0x52')]=function(_0x5318ac,_0x1fc564,_0x24bb5a){var _0x32cf55={};var _0x4999fe={};var _0x34695e;var _0x18c740;return db[_0x7278('0x2a')][_0x7278('0x53')]({'where':{'id':_0x5318ac[_0x7278('0x44')]['id']}})['then'](handleEntityNotFound(_0x1fc564,null))[_0x7278('0x3e')](function(_0x2c1217){if(_0x2c1217){_0x34695e=_0x2c1217;_0x4999fe[_0x7278('0x2d')]=_['keys'](db[_0x7278('0x51')]['rawAttributes']);_0x4999fe['query']=_['keys'](_0x5318ac[_0x7278('0x2e')]);_0x4999fe[_0x7278('0x30')]=_[_0x7278('0x31')](_0x4999fe['model'],_0x4999fe[_0x7278('0x2e')]);_0x32cf55['attributes']=_[_0x7278('0x31')](_0x4999fe[_0x7278('0x2d')],qs[_0x7278('0x45')](_0x5318ac[_0x7278('0x2e')][_0x7278('0x45')]));_0x32cf55[_0x7278('0x32')]=_0x32cf55[_0x7278('0x32')][_0x7278('0x33')]?_0x32cf55[_0x7278('0x32')]:_0x4999fe['model'];_0x32cf55['order']=qs[_0x7278('0x36')](_0x5318ac[_0x7278('0x2e')][_0x7278('0x36')]);_0x32cf55[_0x7278('0x37')]=qs[_0x7278('0x30')](_['pick'](_0x5318ac[_0x7278('0x2e')],_0x4999fe[_0x7278('0x30')]));if(_0x5318ac[_0x7278('0x2e')][_0x7278('0x39')]){_0x32cf55[_0x7278('0x37')]=_['merge'](_0x32cf55['where'],{'$or':_[_0x7278('0x29')](_0x32cf55['attributes'],function(_0x58ec93){var _0x1a4d63={};_0x1a4d63[_0x58ec93]={'$like':'%'+_0x5318ac[_0x7278('0x2e')][_0x7278('0x39')]+'%'};return _0x1a4d63;})});}_0x32cf55=_[_0x7278('0x3a')]({},_0x32cf55,_0x5318ac[_0x7278('0x3d')]);return _0x34695e[_0x7278('0x52')](_0x32cf55);}})[_0x7278('0x3e')](function(_0x5ab7af){if(_0x5ab7af){_0x18c740=_0x5ab7af['length'];if(!_0x5318ac['query'][_0x7278('0x34')](_0x7278('0x4f'))){_0x32cf55[_0x7278('0x1c')]=qs[_0x7278('0x1c')](_0x5318ac[_0x7278('0x2e')]['limit']);_0x32cf55[_0x7278('0x1e')]=qs[_0x7278('0x1e')](_0x5318ac[_0x7278('0x2e')][_0x7278('0x1e')]);}return _0x34695e['getActions'](_0x32cf55);}})[_0x7278('0x3e')](function(_0x3d6693){if(_0x3d6693){return _0x3d6693?{'count':_0x18c740,'rows':_0x3d6693}:null;}})[_0x7278('0x3e')](respondWithResult(_0x1fc564,null))[_0x7278('0x43')](handleError(_0x1fc564,null));};
\ No newline at end of file
+var _0x29b2=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','Automation','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','options','find','create','body','params','addConditions','Condition','ids','findOne','getConditions','addActions','Action','omit','getActions','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x29b2,0x19e));var _0x229b=function(_0x364263,_0x544cfe){_0x364263=_0x364263-0x0;var _0x3d6507=_0x29b2[_0x364263];return _0x3d6507;};'use strict';var emlformat=require(_0x229b('0x0'));var rimraf=require(_0x229b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x229b('0x2'));var rp=require(_0x229b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x229b('0x4'));var util=require('util');var path=require(_0x229b('0x5'));var sox=require(_0x229b('0x6'));var csv=require('to-csv');var ejs=require(_0x229b('0x7'));var fs=require('fs');var fs_extra=require(_0x229b('0x8'));var _=require(_0x229b('0x9'));var squel=require(_0x229b('0xa'));var crypto=require(_0x229b('0xb'));var jsforce=require(_0x229b('0xc'));var deskjs=require(_0x229b('0xd'));var toCsv=require(_0x229b('0xe'));var querystring=require(_0x229b('0xf'));var Papa=require(_0x229b('0x10'));var Redis=require(_0x229b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x229b('0x12'));var as=require(_0x229b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x229b('0x14'));var utils=require('../../config/utils');var config=require(_0x229b('0x15'));var licenseUtil=require(_0x229b('0x16'));var db=require(_0x229b('0x17'))['db'];function respondWithStatusCode(_0x39638f,_0x42fa8c){_0x42fa8c=_0x42fa8c||0xcc;return function(_0x20c127){if(_0x20c127){return _0x39638f[_0x229b('0x18')](_0x42fa8c);}return _0x39638f[_0x229b('0x19')](_0x42fa8c)[_0x229b('0x1a')]();};}function respondWithResult(_0x2eaeb9,_0x2b1f46){_0x2b1f46=_0x2b1f46||0xc8;return function(_0x29e4d4){if(_0x29e4d4){return _0x2eaeb9[_0x229b('0x19')](_0x2b1f46)[_0x229b('0x1b')](_0x29e4d4);}};}function respondWithFilteredResult(_0x3a0e51,_0x4b6365){return function(_0x114266){if(_0x114266){var _0x5c0bde=typeof _0x4b6365[_0x229b('0x1c')]===_0x229b('0x1d')&&typeof _0x4b6365[_0x229b('0x1e')]===_0x229b('0x1d');var _0x59ae7e=_0x114266[_0x229b('0x1f')];var _0x31966c=_0x5c0bde?0x0:_0x4b6365[_0x229b('0x1c')];var _0x34e557=_0x5c0bde?_0x114266[_0x229b('0x1f')]:_0x4b6365['offset']+_0x4b6365['limit'];var _0xb2a928;if(_0x34e557>=_0x59ae7e){_0x34e557=_0x59ae7e;_0xb2a928=0xc8;}else{_0xb2a928=0xce;}_0x3a0e51[_0x229b('0x19')](_0xb2a928);return _0x3a0e51[_0x229b('0x20')](_0x229b('0x21'),_0x31966c+'-'+_0x34e557+'/'+_0x59ae7e)[_0x229b('0x1b')](_0x114266);}return null;};}function patchUpdates(_0x39198a){return function(_0x5bd2b8){try{jsonpatch[_0x229b('0x22')](_0x5bd2b8,_0x39198a,!![]);}catch(_0x15f32d){return BPromise[_0x229b('0x23')](_0x15f32d);}return _0x5bd2b8[_0x229b('0x24')]();};}function saveUpdates(_0x5d20ce,_0xcb4ace){return function(_0x4ae4c3){if(_0x4ae4c3){return _0x4ae4c3[_0x229b('0x25')](_0x5d20ce)[_0x229b('0x26')](function(_0x583c62){return _0x583c62;});}return null;};}function removeEntity(_0x5594c9,_0x182512){return function(_0x406303){if(_0x406303){return _0x406303[_0x229b('0x27')]()['then'](function(){_0x5594c9['status'](0xcc)[_0x229b('0x1a')]();});}};}function handleEntityNotFound(_0x1cf53d,_0x3ee803){return function(_0x53bc6b){if(!_0x53bc6b){_0x1cf53d[_0x229b('0x18')](0x194);}return _0x53bc6b;};}function handleError(_0x36dda9,_0x27baca){_0x27baca=_0x27baca||0x1f4;return function(_0x2bc97e){logger['error'](_0x2bc97e['stack']);if(_0x2bc97e[_0x229b('0x28')]){delete _0x2bc97e[_0x229b('0x28')];}_0x36dda9[_0x229b('0x19')](_0x27baca)[_0x229b('0x29')](_0x2bc97e);};}exports[_0x229b('0x2a')]=function(_0x4a8dc2,_0x516e0d){var _0x5cdeae={},_0x1b3f03={},_0x4af3b1={'count':0x0,'rows':[]};var _0x518d5f=_[_0x229b('0x2b')](db['Automation']['rawAttributes'],function(_0x23b553){return{'name':_0x23b553[_0x229b('0x2c')],'type':_0x23b553['type'][_0x229b('0x2d')]};});_0x1b3f03[_0x229b('0x2e')]=_[_0x229b('0x2b')](_0x518d5f,_0x229b('0x28'));_0x1b3f03[_0x229b('0x2f')]=_['keys'](_0x4a8dc2[_0x229b('0x2f')]);_0x1b3f03[_0x229b('0x30')]=_[_0x229b('0x31')](_0x1b3f03[_0x229b('0x2e')],_0x1b3f03[_0x229b('0x2f')]);_0x5cdeae[_0x229b('0x32')]=_[_0x229b('0x31')](_0x1b3f03['model'],qs[_0x229b('0x33')](_0x4a8dc2['query'][_0x229b('0x33')]));_0x5cdeae[_0x229b('0x32')]=_0x5cdeae['attributes'][_0x229b('0x34')]?_0x5cdeae['attributes']:_0x1b3f03['model'];if(!_0x4a8dc2['query'][_0x229b('0x35')](_0x229b('0x36'))){_0x5cdeae[_0x229b('0x1e')]=qs['limit'](_0x4a8dc2[_0x229b('0x2f')][_0x229b('0x1e')]);_0x5cdeae[_0x229b('0x1c')]=qs[_0x229b('0x1c')](_0x4a8dc2[_0x229b('0x2f')][_0x229b('0x1c')]);}_0x5cdeae[_0x229b('0x37')]=qs[_0x229b('0x38')](_0x4a8dc2[_0x229b('0x2f')][_0x229b('0x38')]);_0x5cdeae[_0x229b('0x39')]=qs[_0x229b('0x30')](_[_0x229b('0x3a')](_0x4a8dc2['query'],_0x1b3f03[_0x229b('0x30')]),_0x518d5f);if(_0x4a8dc2[_0x229b('0x2f')][_0x229b('0x3b')]){_0x5cdeae[_0x229b('0x39')]=_[_0x229b('0x3c')](_0x5cdeae[_0x229b('0x39')],{'$or':_[_0x229b('0x2b')](_0x518d5f,function(_0x37a45d){if(_0x37a45d[_0x229b('0x3d')]!==_0x229b('0x3e')){var _0x37eef5={};_0x37eef5[_0x37a45d[_0x229b('0x28')]]={'$like':'%'+_0x4a8dc2['query'][_0x229b('0x3b')]+'%'};return _0x37eef5;}})});}_0x5cdeae=_[_0x229b('0x3c')]({},_0x5cdeae,_0x4a8dc2['options']);var _0x2ba36e={'where':_0x5cdeae[_0x229b('0x39')]};return db[_0x229b('0x3f')]['count'](_0x2ba36e)[_0x229b('0x26')](function(_0x60a1fd){_0x4af3b1[_0x229b('0x1f')]=_0x60a1fd;if(_0x4a8dc2[_0x229b('0x2f')]['includeAll']){_0x5cdeae[_0x229b('0x40')]=[{'all':!![]}];}return db[_0x229b('0x3f')][_0x229b('0x41')](_0x5cdeae);})[_0x229b('0x26')](function(_0x58df5e){_0x4af3b1[_0x229b('0x42')]=_0x58df5e;return _0x4af3b1;})[_0x229b('0x26')](respondWithFilteredResult(_0x516e0d,_0x5cdeae))[_0x229b('0x43')](handleError(_0x516e0d,null));};exports[_0x229b('0x44')]=function(_0x42a1af,_0x1e65fc){var _0xc13249={'raw':![],'where':{'id':_0x42a1af['params']['id']}},_0x96aa5e={};_0x96aa5e[_0x229b('0x2e')]=_[_0x229b('0x45')](db['Automation'][_0x229b('0x46')]);_0x96aa5e[_0x229b('0x2f')]=_[_0x229b('0x45')](_0x42a1af['query']);_0x96aa5e['filters']=_[_0x229b('0x31')](_0x96aa5e['model'],_0x96aa5e['query']);_0xc13249['attributes']=_[_0x229b('0x31')](_0x96aa5e[_0x229b('0x2e')],qs['fields'](_0x42a1af[_0x229b('0x2f')][_0x229b('0x33')]));_0xc13249[_0x229b('0x32')]=_0xc13249[_0x229b('0x32')][_0x229b('0x34')]?_0xc13249[_0x229b('0x32')]:_0x96aa5e['model'];if(_0x42a1af[_0x229b('0x2f')][_0x229b('0x47')]){_0xc13249['include']=[{'all':!![]}];}_0xc13249=_[_0x229b('0x3c')]({},_0xc13249,_0x42a1af[_0x229b('0x48')]);return db[_0x229b('0x3f')][_0x229b('0x49')](_0xc13249)['then'](handleEntityNotFound(_0x1e65fc,null))[_0x229b('0x26')](respondWithResult(_0x1e65fc,null))[_0x229b('0x43')](handleError(_0x1e65fc,null));};exports[_0x229b('0x4a')]=function(_0x349d1a,_0x3d81e3){return db[_0x229b('0x3f')][_0x229b('0x4a')](_0x349d1a[_0x229b('0x4b')],{})[_0x229b('0x26')](respondWithResult(_0x3d81e3,0xc9))[_0x229b('0x43')](handleError(_0x3d81e3,null));};exports['update']=function(_0x17c075,_0x46ba29){if(_0x17c075['body']['id']){delete _0x17c075['body']['id'];}return db['Automation'][_0x229b('0x49')]({'where':{'id':_0x17c075[_0x229b('0x4c')]['id']}})[_0x229b('0x26')](handleEntityNotFound(_0x46ba29,null))[_0x229b('0x26')](saveUpdates(_0x17c075[_0x229b('0x4b')],null))[_0x229b('0x26')](respondWithResult(_0x46ba29,null))[_0x229b('0x43')](handleError(_0x46ba29,null));};exports[_0x229b('0x27')]=function(_0xbc66c1,_0xbe91c){return db[_0x229b('0x3f')][_0x229b('0x49')]({'where':{'id':_0xbc66c1[_0x229b('0x4c')]['id']}})[_0x229b('0x26')](handleEntityNotFound(_0xbe91c,null))['then'](removeEntity(_0xbe91c,null))[_0x229b('0x43')](handleError(_0xbe91c,null));};exports[_0x229b('0x4d')]=function(_0x1259c1,_0x2267bb,_0x581f50){return db[_0x229b('0x4e')][_0x229b('0x49')]({'where':{'id':_0x1259c1[_0x229b('0x4c')]['id']}})[_0x229b('0x26')](handleEntityNotFound(_0x2267bb,null))[_0x229b('0x26')](function(_0x58638b){if(_0x58638b){return _0x58638b['addConditions'](_0x1259c1[_0x229b('0x4b')][_0x229b('0x4f')],_['omit'](_0x1259c1[_0x229b('0x4b')],[_0x229b('0x4f'),'id'])||{});}})[_0x229b('0x26')](respondWithResult(_0x2267bb,null))['catch'](handleError(_0x2267bb,null));};exports['getConditions']=function(_0x4d1e69,_0x42b915,_0x5e7d1f){var _0x582d5f={};var _0x277259={};var _0x3cf0b9;var _0x2bf0ea;return db[_0x229b('0x3f')][_0x229b('0x50')]({'where':{'id':_0x4d1e69[_0x229b('0x4c')]['id']}})[_0x229b('0x26')](handleEntityNotFound(_0x42b915,null))[_0x229b('0x26')](function(_0xa8ef63){if(_0xa8ef63){_0x3cf0b9=_0xa8ef63;_0x277259['model']=_[_0x229b('0x45')](db[_0x229b('0x4e')][_0x229b('0x46')]);_0x277259[_0x229b('0x2f')]=_[_0x229b('0x45')](_0x4d1e69['query']);_0x277259[_0x229b('0x30')]=_[_0x229b('0x31')](_0x277259[_0x229b('0x2e')],_0x277259[_0x229b('0x2f')]);_0x582d5f['attributes']=_[_0x229b('0x31')](_0x277259[_0x229b('0x2e')],qs['fields'](_0x4d1e69[_0x229b('0x2f')][_0x229b('0x33')]));_0x582d5f[_0x229b('0x32')]=_0x582d5f[_0x229b('0x32')][_0x229b('0x34')]?_0x582d5f['attributes']:_0x277259['model'];_0x582d5f[_0x229b('0x37')]=qs[_0x229b('0x38')](_0x4d1e69[_0x229b('0x2f')][_0x229b('0x38')]);_0x582d5f['where']=qs[_0x229b('0x30')](_['pick'](_0x4d1e69[_0x229b('0x2f')],_0x277259[_0x229b('0x30')]));if(_0x4d1e69[_0x229b('0x2f')][_0x229b('0x3b')]){_0x582d5f[_0x229b('0x39')]=_[_0x229b('0x3c')](_0x582d5f[_0x229b('0x39')],{'$or':_[_0x229b('0x2b')](_0x582d5f[_0x229b('0x32')],function(_0x4bf0af){var _0x431578={};_0x431578[_0x4bf0af]={'$like':'%'+_0x4d1e69[_0x229b('0x2f')][_0x229b('0x3b')]+'%'};return _0x431578;})});}_0x582d5f=_['merge']({},_0x582d5f,_0x4d1e69[_0x229b('0x48')]);return _0x3cf0b9[_0x229b('0x51')](_0x582d5f);}})[_0x229b('0x26')](function(_0x7ee599){if(_0x7ee599){_0x2bf0ea=_0x7ee599[_0x229b('0x34')];if(!_0x4d1e69[_0x229b('0x2f')][_0x229b('0x35')]('nolimit')){_0x582d5f[_0x229b('0x1e')]=qs[_0x229b('0x1e')](_0x4d1e69[_0x229b('0x2f')][_0x229b('0x1e')]);_0x582d5f[_0x229b('0x1c')]=qs[_0x229b('0x1c')](_0x4d1e69[_0x229b('0x2f')]['offset']);}return _0x3cf0b9[_0x229b('0x51')](_0x582d5f);}})[_0x229b('0x26')](function(_0x34e19f){if(_0x34e19f){return _0x34e19f?{'count':_0x2bf0ea,'rows':_0x34e19f}:null;}})[_0x229b('0x26')](respondWithResult(_0x42b915,null))[_0x229b('0x43')](handleError(_0x42b915,null));};exports[_0x229b('0x52')]=function(_0x24ea80,_0x335336,_0x2f9873){return db[_0x229b('0x53')]['find']({'where':{'id':_0x24ea80[_0x229b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x335336,null))[_0x229b('0x26')](function(_0x476620){if(_0x476620){return _0x476620[_0x229b('0x52')](_0x24ea80[_0x229b('0x4b')]['ids'],_[_0x229b('0x54')](_0x24ea80[_0x229b('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x335336,null))['catch'](handleError(_0x335336,null));};exports[_0x229b('0x55')]=function(_0xa70203,_0x43aff9,_0x2f7074){var _0x1af3d8={};var _0x43124f={};var _0x5cfc65;var _0xa449b3;return db[_0x229b('0x3f')][_0x229b('0x50')]({'where':{'id':_0xa70203[_0x229b('0x4c')]['id']}})[_0x229b('0x26')](handleEntityNotFound(_0x43aff9,null))[_0x229b('0x26')](function(_0x156546){if(_0x156546){_0x5cfc65=_0x156546;_0x43124f[_0x229b('0x2e')]=_[_0x229b('0x45')](db[_0x229b('0x53')]['rawAttributes']);_0x43124f[_0x229b('0x2f')]=_[_0x229b('0x45')](_0xa70203[_0x229b('0x2f')]);_0x43124f[_0x229b('0x30')]=_[_0x229b('0x31')](_0x43124f['model'],_0x43124f[_0x229b('0x2f')]);_0x1af3d8[_0x229b('0x32')]=_[_0x229b('0x31')](_0x43124f['model'],qs[_0x229b('0x33')](_0xa70203[_0x229b('0x2f')][_0x229b('0x33')]));_0x1af3d8['attributes']=_0x1af3d8['attributes'][_0x229b('0x34')]?_0x1af3d8[_0x229b('0x32')]:_0x43124f[_0x229b('0x2e')];_0x1af3d8['order']=qs[_0x229b('0x38')](_0xa70203[_0x229b('0x2f')]['sort']);_0x1af3d8[_0x229b('0x39')]=qs[_0x229b('0x30')](_[_0x229b('0x3a')](_0xa70203[_0x229b('0x2f')],_0x43124f['filters']));if(_0xa70203[_0x229b('0x2f')]['filter']){_0x1af3d8[_0x229b('0x39')]=_[_0x229b('0x3c')](_0x1af3d8[_0x229b('0x39')],{'$or':_[_0x229b('0x2b')](_0x1af3d8['attributes'],function(_0xb4c9af){var _0x2b422c={};_0x2b422c[_0xb4c9af]={'$like':'%'+_0xa70203[_0x229b('0x2f')][_0x229b('0x3b')]+'%'};return _0x2b422c;})});}_0x1af3d8=_[_0x229b('0x3c')]({},_0x1af3d8,_0xa70203[_0x229b('0x48')]);return _0x5cfc65['getActions'](_0x1af3d8);}})[_0x229b('0x26')](function(_0x19b663){if(_0x19b663){_0xa449b3=_0x19b663[_0x229b('0x34')];if(!_0xa70203[_0x229b('0x2f')][_0x229b('0x35')](_0x229b('0x36'))){_0x1af3d8['limit']=qs[_0x229b('0x1e')](_0xa70203[_0x229b('0x2f')][_0x229b('0x1e')]);_0x1af3d8[_0x229b('0x1c')]=qs['offset'](_0xa70203[_0x229b('0x2f')][_0x229b('0x1c')]);}return _0x5cfc65[_0x229b('0x55')](_0x1af3d8);}})[_0x229b('0x26')](function(_0x2c8421){if(_0x2c8421){return _0x2c8421?{'count':_0xa449b3,'rows':_0x2c8421}:null;}})[_0x229b('0x26')](respondWithResult(_0x43aff9,null))[_0x229b('0x43')](handleError(_0x43aff9,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 57c2682..d6fe67b 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 _0xb37a=['exports','define','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes'];(function(_0x35bf7c,_0x3b27bc){var _0x2c9413=function(_0x547185){while(--_0x547185){_0x35bf7c['push'](_0x35bf7c['shift']());}};_0x2c9413(++_0x3b27bc);}(_0xb37a,0x12f));var _0xab37=function(_0x2a8811,_0x281afa){_0x2a8811=_0x2a8811-0x0;var _0x312324=_0xb37a[_0x2a8811];return _0x312324;};'use strict';var _=require(_0xab37('0x0'));var util=require(_0xab37('0x1'));var logger=require('../../config/logger')(_0xab37('0x2'));var moment=require(_0xab37('0x3'));var BPromise=require(_0xab37('0x4'));var rp=require(_0xab37('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab37('0x6'));var config=require(_0xab37('0x7'));var attributes=require(_0xab37('0x8'));module[_0xab37('0x9')]=function(_0x212896,_0x1e3df6){return _0x212896[_0xab37('0xa')](_0xab37('0xb'),attributes,{'tableName':_0xab37('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc7de=['./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc7de,0x1e0));var _0xec7d=function(_0x3fbeef,_0x2840b4){_0x3fbeef=_0x3fbeef-0x0;var _0x14ec1f=_0xc7de[_0x3fbeef];return _0x14ec1f;};'use strict';var _=require(_0xec7d('0x0'));var util=require(_0xec7d('0x1'));var logger=require(_0xec7d('0x2'))(_0xec7d('0x3'));var moment=require(_0xec7d('0x4'));var BPromise=require(_0xec7d('0x5'));var rp=require(_0xec7d('0x6'));var fs=require('fs');var path=require(_0xec7d('0x7'));var rimraf=require(_0xec7d('0x8'));var config=require(_0xec7d('0x9'));var attributes=require(_0xec7d('0xa'));module['exports']=function(_0x59d46c,_0x44d04d){return _0x59d46c[_0xec7d('0xb')](_0xec7d('0xc'),attributes,{'tableName':_0xec7d('0xd'),'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 f4341be..99444a7 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 _0x866a=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x278e39,_0x379ba4){var _0x211e88=function(_0x38bdfa){while(--_0x38bdfa){_0x278e39['push'](_0x278e39['shift']());}};_0x211e88(++_0x379ba4);}(_0x866a,0x156));var _0xa866=function(_0x1b3a9e,_0x3b6e29){_0x1b3a9e=_0x1b3a9e-0x0;var _0x53cdc2=_0x866a[_0x1b3a9e];return _0x53cdc2;};'use strict';var _=require('lodash');var util=require(_0xa866('0x0'));var moment=require(_0xa866('0x1'));var BPromise=require(_0xa866('0x2'));var rs=require(_0xa866('0x3'));var fs=require('fs');var Redis=require(_0xa866('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa866('0x5'));var logger=require(_0xa866('0x6'))(_0xa866('0x7'));var config=require('../../config/environment');var jayson=require(_0xa866('0x8'));var client=jayson[_0xa866('0x9')][_0xa866('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288582,_0x3d1380,_0x2c7278){return new BPromise(function(_0x41a92a,_0x208625){return client[_0xa866('0xb')](_0x288582,_0x2c7278)[_0xa866('0xc')](function(_0x525ce6){logger[_0xa866('0xd')](_0xa866('0xe'),_0x3d1380,_0xa866('0xf'));logger['debug'](_0xa866('0x10'),_0x3d1380,_0xa866('0xf'),JSON[_0xa866('0x11')](_0x525ce6));if(_0x525ce6[_0xa866('0x12')]){if(_0x525ce6[_0xa866('0x12')][_0xa866('0x13')]===0x1f4){logger['error'](_0xa866('0xe'),_0x3d1380,_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);return _0x208625(_0x525ce6[_0xa866('0x12')]['message']);}logger[_0xa866('0x12')]('Automation,\x20%s,\x20%s',_0x3d1380,_0x525ce6[_0xa866('0x12')]['message']);return _0x41a92a(_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);}else{logger[_0xa866('0xd')]('Automation,\x20%s,\x20%s',_0x3d1380,_0xa866('0xf'));_0x41a92a(_0x525ce6[_0xa866('0x15')][_0xa866('0x14')]);}})[_0xa866('0x16')](function(_0x1e2211){logger[_0xa866('0x12')](_0xa866('0xe'),_0x3d1380,_0x1e2211);_0x208625(_0x1e2211);});});}
\ No newline at end of file
+var _0xc274=['../../config/logger','rpc','jayson/promise','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5b188c,_0x27afc5){var _0x38c26f=function(_0x1b900){while(--_0x1b900){_0x5b188c['push'](_0x5b188c['shift']());}};_0x38c26f(++_0x27afc5);}(_0xc274,0x151));var _0x4c27=function(_0x4be050,_0x58bb8c){_0x4be050=_0x4be050-0x0;var _0x3d95cc=_0xc274[_0x4be050];return _0x3d95cc;};'use strict';var _=require('lodash');var util=require(_0x4c27('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c27('0x1'));var fs=require('fs');var Redis=require(_0x4c27('0x2'));var db=require(_0x4c27('0x3'))['db'];var utils=require(_0x4c27('0x4'));var logger=require(_0x4c27('0x5'))(_0x4c27('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c27('0x7'));var client=jayson['client'][_0x4c27('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18fd2c,_0x38de2d,_0x5f5058){return new BPromise(function(_0x478a91,_0x36daa2){return client['request'](_0x18fd2c,_0x5f5058)[_0x4c27('0x9')](function(_0x2a0c76){logger[_0x4c27('0xa')](_0x4c27('0xb'),_0x38de2d,_0x4c27('0xc'));logger['debug'](_0x4c27('0xd'),_0x38de2d,_0x4c27('0xc'),JSON[_0x4c27('0xe')](_0x2a0c76));if(_0x2a0c76[_0x4c27('0xf')]){if(_0x2a0c76['error']['code']===0x1f4){logger[_0x4c27('0xf')](_0x4c27('0xb'),_0x38de2d,_0x2a0c76['error']['message']);return _0x36daa2(_0x2a0c76[_0x4c27('0xf')][_0x4c27('0x10')]);}logger[_0x4c27('0xf')]('Automation,\x20%s,\x20%s',_0x38de2d,_0x2a0c76[_0x4c27('0xf')][_0x4c27('0x10')]);return _0x478a91(_0x2a0c76[_0x4c27('0xf')]['message']);}else{logger[_0x4c27('0xa')]('Automation,\x20%s,\x20%s',_0x38de2d,'request\x20sent');_0x478a91(_0x2a0c76[_0x4c27('0x11')][_0x4c27('0x10')]);}})[_0x4c27('0x12')](function(_0x4762ad){logger['error'](_0x4c27('0xb'),_0x38de2d,_0x4762ad);_0x36daa2(_0x4762ad);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index dbdb30f..da5dbf2 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 _0xd730=['get','/:id/actions','post','create','/:id/conditions','addConditions','addActions','put','update','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','/:id','show'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0xd730,0xfd));var _0x0d73=function(_0x26a846,_0x261438){_0x26a846=_0x26a846-0x0;var _0x286a31=_0xd730[_0x26a846];return _0x286a31;};'use strict';var multer=require('multer');var util=require(_0x0d73('0x0'));var path=require('path');var timeout=require(_0x0d73('0x1'));var express=require('express');var router=express[_0x0d73('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0d73('0x3'));var interaction=require(_0x0d73('0x4'));var config=require(_0x0d73('0x5'));var controller=require(_0x0d73('0x6'));router['get']('/',auth[_0x0d73('0x7')](),controller[_0x0d73('0x8')]);router['get'](_0x0d73('0x9'),auth['isAuthenticated'](),controller[_0x0d73('0xa')]);router['get']('/:id/conditions',auth[_0x0d73('0x7')](),controller['getConditions']);router[_0x0d73('0xb')](_0x0d73('0xc'),auth[_0x0d73('0x7')](),controller['getActions']);router[_0x0d73('0xd')]('/',auth['isAuthenticated'](),controller[_0x0d73('0xe')]);router[_0x0d73('0xd')](_0x0d73('0xf'),auth[_0x0d73('0x7')](),controller[_0x0d73('0x10')]);router[_0x0d73('0xd')](_0x0d73('0xc'),auth[_0x0d73('0x7')](),controller[_0x0d73('0x11')]);router[_0x0d73('0x12')](_0x0d73('0x9'),auth[_0x0d73('0x7')](),controller[_0x0d73('0x13')]);router['delete'](_0x0d73('0x9'),auth[_0x0d73('0x7')](),controller[_0x0d73('0x14')]);module[_0x0d73('0x15')]=router;
\ No newline at end of file
+var _0x3e8e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./automation.controller','get','isAuthenticated','index','/:id','show','getConditions','/:id/actions','getActions','post','create','addActions','update','delete','destroy','util','path'];(function(_0x546e5d,_0x3abae2){var _0x3a8a61=function(_0xfd68ff){while(--_0xfd68ff){_0x546e5d['push'](_0x546e5d['shift']());}};_0x3a8a61(++_0x3abae2);}(_0x3e8e,0x106));var _0xe3e8=function(_0x17df88,_0x2d8962){_0x17df88=_0x17df88-0x0;var _0x2bdca9=_0x3e8e[_0x17df88];return _0x2bdca9;};'use strict';var multer=require('multer');var util=require(_0xe3e8('0x0'));var path=require(_0xe3e8('0x1'));var timeout=require(_0xe3e8('0x2'));var express=require(_0xe3e8('0x3'));var router=express[_0xe3e8('0x4')]();var fs_extra=require(_0xe3e8('0x5'));var auth=require(_0xe3e8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe3e8('0x7'));router[_0xe3e8('0x8')]('/',auth[_0xe3e8('0x9')](),controller[_0xe3e8('0xa')]);router[_0xe3e8('0x8')](_0xe3e8('0xb'),auth['isAuthenticated'](),controller[_0xe3e8('0xc')]);router['get']('/:id/conditions',auth[_0xe3e8('0x9')](),controller[_0xe3e8('0xd')]);router['get'](_0xe3e8('0xe'),auth[_0xe3e8('0x9')](),controller[_0xe3e8('0xf')]);router[_0xe3e8('0x10')]('/',auth[_0xe3e8('0x9')](),controller[_0xe3e8('0x11')]);router[_0xe3e8('0x10')]('/:id/conditions',auth[_0xe3e8('0x9')](),controller['addConditions']);router[_0xe3e8('0x10')](_0xe3e8('0xe'),auth['isAuthenticated'](),controller[_0xe3e8('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe3e8('0x13')]);router[_0xe3e8('0x14')](_0xe3e8('0xb'),auth[_0xe3e8('0x9')](),controller[_0xe3e8('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e44c451..6128feb 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 _0x1071=['Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen'];(function(_0xb113d7,_0x2fc306){var _0xd5a08d=function(_0x873634){while(--_0x873634){_0xb113d7['push'](_0xb113d7['shift']());}};_0xd5a08d(++_0x2fc306);}(_0x1071,0xde));var _0x1107=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1071[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x1107('0x0')]={'name':{'type':Sequelize[_0x1107('0x1')],'unique':_0x1107('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1107('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x1107('0x4')},'description':{'type':Sequelize[_0x1107('0x1')]},'active':{'type':Sequelize[_0x1107('0x5')],'defaultValue':0x0,'comment':_0x1107('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1107('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1107('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1107('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1107('0x9')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'defaultValue':0x3,'comment':_0x1107('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1107('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1107('0x1')],'defaultValue':_0x1107('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x1107('0x3')](_0x1107('0xf'),_0x1107('0x10'),_0x1107('0x11')),'defaultValue':_0x1107('0xf')},'dialAMDActive':{'type':Sequelize[_0x1107('0x5')],'defaultValue':0x0,'comment':_0x1107('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x1107('0x9')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1107('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x1107('0x9')](0x9)[_0x1107('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1107('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1107('0x9')](0x9)[_0x1107('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1107('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1107('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x1107('0x9')](0x9)[_0x1107('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1107('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1107('0x9')](0x9)[_0x1107('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1107('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1107('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1107('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1107('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1107('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1107('0x3')](_0x1107('0x1b'),_0x1107('0x1c')),'defaultValue':_0x1107('0x1b')},'dialPrefix':{'type':Sequelize[_0x1107('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1107('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1107('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1107('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x27')}};
\ No newline at end of file
+var _0x1126=['Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0x1126,0x177));var _0x6112=function(_0x1722bf,_0x2fa7f4){_0x1722bf=_0x1722bf-0x0;var _0x58c607=_0x1126[_0x1722bf];return _0x58c607;};'use strict';var Sequelize=require(_0x6112('0x0'));module[_0x6112('0x1')]={'name':{'type':Sequelize[_0x6112('0x2')],'unique':_0x6112('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6112('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x6112('0x5')},'description':{'type':Sequelize[_0x6112('0x2')]},'active':{'type':Sequelize[_0x6112('0x6')],'defaultValue':0x0,'comment':_0x6112('0x7')},'limitCalls':{'type':Sequelize[_0x6112('0x8')](0x4)[_0x6112('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6112('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6112('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x6112('0x8')](0x3)[_0x6112('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6112('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6112('0x8')](0x3)[_0x6112('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6112('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6112('0x8')](0x5)[_0x6112('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x6112('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x6112('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6112('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6112('0x8')](0x3)[_0x6112('0x9')],'defaultValue':0x3,'comment':_0x6112('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6112('0x8')](0x5)[_0x6112('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x6112('0x8')](0x3)[_0x6112('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6112('0xf')},'dialTimezone':{'type':Sequelize[_0x6112('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x6112('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x6112('0x11'),_0x6112('0x12'),_0x6112('0x13')),'defaultValue':_0x6112('0x11')},'dialAMDActive':{'type':Sequelize[_0x6112('0x6')],'defaultValue':0x0,'comment':_0x6112('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6112('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6112('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x6112('0x8')](0x9)[_0x6112('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6112('0x8')](0x9)[_0x6112('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6112('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x6112('0x8')](0x9)[_0x6112('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6112('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6112('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6112('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6112('0x8')](0x9)[_0x6112('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6112('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6112('0x8')](0x5)[_0x6112('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6112('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6112('0x8')](0x9)[_0x6112('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x6112('0x4')]('DESC',_0x6112('0x1b')),'defaultValue':_0x6112('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6112('0x8')](0x3)[_0x6112('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6112('0x1d')},'dialCutDigit':{'type':Sequelize[_0x6112('0x8')](0x3)[_0x6112('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6112('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6112('0x8')](0x3)[_0x6112('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6112('0x8')](0x5)[_0x6112('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6112('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6112('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x6112('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6112('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6112('0x8')](0x3)[_0x6112('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6112('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6112('0x8')](0x5)[_0x6112('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6112('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6112('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6112('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6112('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6112('0x8')](0x3)[_0x6112('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6112('0x8')](0x5)[_0x6112('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6112('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index bbe467c..f68fd0f 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 _0x58c4=['field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','CampaignId\x20=\x20?','cm_hopper_additional_phones','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','options','Campaign','rows','catch','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','userProfileId','error','includeAll','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','nolimit','order','pick','findAll','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x58c4,0x135));var _0x458c=function(_0x32eb00,_0x428dc0){_0x32eb00=_0x32eb00-0x0;var _0x4447ce=_0x58c4[_0x32eb00];return _0x4447ce;};'use strict';var emlformat=require(_0x458c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x458c('0x1'));var jsonpatch=require(_0x458c('0x2'));var rp=require(_0x458c('0x3'));var moment=require(_0x458c('0x4'));var BPromise=require(_0x458c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x458c('0x6'));var sox=require(_0x458c('0x7'));var csv=require(_0x458c('0x8'));var ejs=require(_0x458c('0x9'));var fs=require('fs');var fs_extra=require(_0x458c('0xa'));var _=require(_0x458c('0xb'));var squel=require(_0x458c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x458c('0xd'));var toCsv=require(_0x458c('0x8'));var querystring=require(_0x458c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x458c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x458c('0x10'))(_0x458c('0x11'));var utils=require(_0x458c('0x12'));var config=require(_0x458c('0x13'));var licenseUtil=require(_0x458c('0x14'));var db=require(_0x458c('0x15'))['db'];function respondWithStatusCode(_0xdbfe9e,_0x5ea16d){_0x5ea16d=_0x5ea16d||0xcc;return function(_0x13249c){if(_0x13249c){return _0xdbfe9e[_0x458c('0x16')](_0x5ea16d);}return _0xdbfe9e['status'](_0x5ea16d)[_0x458c('0x17')]();};}function respondWithResult(_0x385e15,_0x4dd1bb){_0x4dd1bb=_0x4dd1bb||0xc8;return function(_0x4096fb){if(_0x4096fb){return _0x385e15[_0x458c('0x18')](_0x4dd1bb)[_0x458c('0x19')](_0x4096fb);}};}function respondWithFilteredResult(_0x4ab110,_0x4d85bf){return function(_0x586048){if(_0x586048){var _0x54cc0c=typeof _0x4d85bf['offset']==='undefined'&&typeof _0x4d85bf[_0x458c('0x1a')]==='undefined';var _0x108b97=_0x586048[_0x458c('0x1b')];var _0x2aac1b=_0x54cc0c?0x0:_0x4d85bf['offset'];var _0x52674a=_0x54cc0c?_0x586048[_0x458c('0x1b')]:_0x4d85bf[_0x458c('0x1c')]+_0x4d85bf[_0x458c('0x1a')];var _0x484804;if(_0x52674a>=_0x108b97){_0x52674a=_0x108b97;_0x484804=0xc8;}else{_0x484804=0xce;}_0x4ab110[_0x458c('0x18')](_0x484804);return _0x4ab110[_0x458c('0x1d')](_0x458c('0x1e'),_0x2aac1b+'-'+_0x52674a+'/'+_0x108b97)['json'](_0x586048);}return null;};}function patchUpdates(_0x7b4338){return function(_0x1e88ee){try{jsonpatch[_0x458c('0x1f')](_0x1e88ee,_0x7b4338,!![]);}catch(_0x13fcd6){return BPromise[_0x458c('0x20')](_0x13fcd6);}return _0x1e88ee[_0x458c('0x21')]();};}function saveUpdates(_0x1adc6b,_0x5d325d){return function(_0x4f0ac){if(_0x4f0ac){return _0x4f0ac['update'](_0x1adc6b)[_0x458c('0x22')](function(_0x24da99){return _0x24da99;});}return null;};}function removeEntity(_0x4e0572,_0x311496){return function(_0x55c116){if(_0x55c116){return _0x55c116[_0x458c('0x23')]()[_0x458c('0x22')](function(){var _0x2039fc=_0x55c116[_0x458c('0x24')]({'plain':!![]});var _0x26d037='IvrCampaigns';return db[_0x458c('0x25')][_0x458c('0x23')]({'where':{'type':_0x26d037,'resourceId':_0x2039fc['id']}})[_0x458c('0x22')](function(){return _0x55c116;});})[_0x458c('0x22')](function(){_0x4e0572[_0x458c('0x18')](0xcc)[_0x458c('0x17')]();});}};}function handleEntityNotFound(_0xb3135e,_0x125eff){return function(_0x33ec76){if(!_0x33ec76){_0xb3135e[_0x458c('0x16')](0x194);}return _0x33ec76;};}function handleError(_0x4841ba,_0x2403fd){_0x2403fd=_0x2403fd||0x1f4;return function(_0x25a965){logger['error'](_0x25a965['stack']);if(_0x25a965[_0x458c('0x26')]){delete _0x25a965[_0x458c('0x26')];}_0x4841ba[_0x458c('0x18')](_0x2403fd)[_0x458c('0x27')](_0x25a965);};}exports[_0x458c('0x28')]=function(_0x579630,_0x360fd0){var _0x43093e={},_0xf7a600={},_0x485faa={'count':0x0,'rows':[]};var _0x4b1de4=_['map'](db['Campaign'][_0x458c('0x29')],function(_0x12f4f0){return{'name':_0x12f4f0[_0x458c('0x2a')],'type':_0x12f4f0['type'][_0x458c('0x2b')]};});_0xf7a600['model']=_[_0x458c('0x2c')](_0x4b1de4,'name');_0xf7a600[_0x458c('0x2d')]=_[_0x458c('0x2e')](_0x579630[_0x458c('0x2d')]);_0xf7a600[_0x458c('0x2f')]=_[_0x458c('0x30')](_0xf7a600[_0x458c('0x31')],_0xf7a600[_0x458c('0x2d')]);_0x43093e[_0x458c('0x32')]=_['intersection'](_0xf7a600['model'],qs[_0x458c('0x33')](_0x579630[_0x458c('0x2d')][_0x458c('0x33')]));_0x43093e['attributes']=_0x43093e[_0x458c('0x32')]['length']?_0x43093e[_0x458c('0x32')]:_0xf7a600[_0x458c('0x31')];if(!_0x579630['query'][_0x458c('0x34')]('nolimit')){_0x43093e[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x579630['query'][_0x458c('0x1a')]);_0x43093e[_0x458c('0x1c')]=qs['offset'](_0x579630[_0x458c('0x2d')]['offset']);}_0x43093e['order']=qs[_0x458c('0x35')](_0x579630[_0x458c('0x2d')][_0x458c('0x35')]);_0x43093e[_0x458c('0x36')]=qs[_0x458c('0x2f')](_['pick'](_0x579630[_0x458c('0x2d')],_0xf7a600[_0x458c('0x2f')]),_0x4b1de4);if(_0x579630[_0x458c('0x2d')][_0x458c('0x37')]){_0x43093e['where']=_[_0x458c('0x38')](_0x43093e[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x4b1de4,function(_0x2125ad){if(_0x2125ad['type']!=='VIRTUAL'){var _0x31066b={};_0x31066b[_0x2125ad[_0x458c('0x26')]]={'$like':'%'+_0x579630['query'][_0x458c('0x37')]+'%'};return _0x31066b;}})});}_0x43093e=_[_0x458c('0x38')]({},_0x43093e,_0x579630[_0x458c('0x39')]);var _0x1e1aa3={'where':_0x43093e[_0x458c('0x36')]};return db[_0x458c('0x3a')]['count'](_0x1e1aa3)[_0x458c('0x22')](function(_0x1992b0){_0x485faa['count']=_0x1992b0;if(_0x579630[_0x458c('0x2d')]['includeAll']){_0x43093e['include']=[{'all':!![]}];}return db['Campaign']['findAll'](_0x43093e);})['then'](function(_0x2e9ebd){_0x485faa[_0x458c('0x3b')]=_0x2e9ebd;return _0x485faa;})[_0x458c('0x22')](respondWithFilteredResult(_0x360fd0,_0x43093e))[_0x458c('0x3c')](handleError(_0x360fd0,null));};exports['show']=function(_0x3b856c,_0x237348){var _0x25ca5c={'raw':![],'where':{'id':_0x3b856c[_0x458c('0x3d')]['id']}},_0x2ce446={};_0x2ce446['model']=_[_0x458c('0x2e')](db['Campaign'][_0x458c('0x29')]);_0x2ce446[_0x458c('0x2d')]=_[_0x458c('0x2e')](_0x3b856c['query']);_0x2ce446[_0x458c('0x2f')]=_[_0x458c('0x30')](_0x2ce446[_0x458c('0x31')],_0x2ce446[_0x458c('0x2d')]);_0x25ca5c[_0x458c('0x32')]=_['intersection'](_0x2ce446['model'],qs[_0x458c('0x33')](_0x3b856c[_0x458c('0x2d')][_0x458c('0x33')]));_0x25ca5c[_0x458c('0x32')]=_0x25ca5c[_0x458c('0x32')][_0x458c('0x3e')]?_0x25ca5c[_0x458c('0x32')]:_0x2ce446[_0x458c('0x31')];if(_0x3b856c[_0x458c('0x2d')]['includeAll']){_0x25ca5c[_0x458c('0x3f')]=[{'all':!![]}];}_0x25ca5c=_[_0x458c('0x38')]({},_0x25ca5c,_0x3b856c[_0x458c('0x39')]);return db[_0x458c('0x3a')][_0x458c('0x40')](_0x25ca5c)[_0x458c('0x22')](handleEntityNotFound(_0x237348,null))['then'](respondWithResult(_0x237348,null))['catch'](handleError(_0x237348,null));};exports['create']=function(_0x365903,_0x45f949){return db['Campaign'][_0x458c('0x41')](_0x365903[_0x458c('0x42')],{})[_0x458c('0x22')](function(_0x3637bd){var _0x5bc35c=_0x365903['user'][_0x458c('0x24')]({'plain':!![]});if(!_0x5bc35c)throw new Error(_0x458c('0x43'));if(_0x5bc35c[_0x458c('0x44')]===_0x458c('0x45')){var _0x3cee04=_0x3637bd['get']({'plain':!![]});var _0x36a25e=_0x458c('0x46');return db['UserProfileSection']['find']({'where':{'name':_0x36a25e,'userProfileId':_0x5bc35c[_0x458c('0x47')]},'raw':!![]})[_0x458c('0x22')](function(_0x30f82e){if(_0x30f82e&&_0x30f82e['autoAssociation']===0x0){return db['UserProfileResource'][_0x458c('0x41')]({'name':_0x3cee04[_0x458c('0x26')],'resourceId':_0x3cee04['id'],'type':_0x30f82e[_0x458c('0x26')],'sectionId':_0x30f82e['id']},{})[_0x458c('0x22')](function(){return _0x3637bd;});}else{return _0x3637bd;}})[_0x458c('0x3c')](function(_0x3a0105){logger[_0x458c('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a0105);throw _0x3a0105;});}return _0x3637bd;})[_0x458c('0x22')](respondWithResult(_0x45f949,0xc9))[_0x458c('0x3c')](handleError(_0x45f949,null));};exports['clone']=function(_0x4f8b67,_0x28eef2){var _0x66760={'where':{'id':_0x4f8b67[_0x458c('0x3d')]['id']}},_0x30d7ec={};_0x30d7ec[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x3a')]['rawAttributes']);_0x66760[_0x458c('0x32')]=_['intersection'](_0x30d7ec[_0x458c('0x31')],qs['fields'](_0x4f8b67[_0x458c('0x2d')][_0x458c('0x33')]));_0x66760[_0x458c('0x32')]=_0x66760['attributes']['length']?_0x66760[_0x458c('0x32')]:_0x30d7ec[_0x458c('0x31')];if(_0x4f8b67[_0x458c('0x2d')][_0x458c('0x49')]){_0x66760[_0x458c('0x3f')]=[{'all':!![]}];}_0x66760=_[_0x458c('0x38')]({},_0x66760,_0x4f8b67['options']);return db['Campaign'][_0x458c('0x40')](_0x66760)[_0x458c('0x22')](handleEntityNotFound(_0x28eef2,null))[_0x458c('0x22')](function(_0xc99888){if(_0xc99888){var _0x57311c=_0xc99888[_0x458c('0x24')]({'plain':!![]});_0x57311c=qs[_0x458c('0x4a')](_0x57311c,['id',_0x458c('0x4b'),'updatedAt']);_0x4f8b67['body']=_[_0x458c('0x4a')](_0x4f8b67[_0x458c('0x42')],['id','createdAt',_0x458c('0x4c')]);return db['Campaign'][_0x458c('0x41')](_['merge'](_0x57311c,_0x4f8b67['body']),{'include':_0x4f8b67['query'][_0x458c('0x49')]?[{'all':!![]}]:undefined})[_0x458c('0x22')](function(_0x3ce854){var _0x35d6f1=_0x4f8b67[_0x458c('0x45')][_0x458c('0x24')]({'plain':!![]});if(!_0x35d6f1)throw new Error(_0x458c('0x43'));if(_0x35d6f1[_0x458c('0x44')]===_0x458c('0x45')){var _0x3e183e=_0x3ce854[_0x458c('0x24')]({'plain':!![]});var _0x569099=_0x458c('0x46');return db[_0x458c('0x4d')][_0x458c('0x40')]({'where':{'name':_0x569099,'userProfileId':_0x35d6f1['userProfileId']},'raw':!![]})[_0x458c('0x22')](function(_0x3fec3c){if(_0x3fec3c&&_0x3fec3c[_0x458c('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x3e183e[_0x458c('0x26')],'resourceId':_0x3e183e['id'],'type':_0x3fec3c['name'],'sectionId':_0x3fec3c['id']},{})[_0x458c('0x22')](function(){return _0x3ce854;});}else{return _0x3ce854;}})[_0x458c('0x3c')](function(_0x51248c){logger['error'](_0x458c('0x4f'),_0x51248c);throw _0x51248c;});}return _0x3ce854;});}})[_0x458c('0x22')](respondWithResult(_0x28eef2,0xc9))[_0x458c('0x3c')](handleError(_0x28eef2,null));};exports[_0x458c('0x50')]=function(_0x26a68d,_0x5b746c){if(_0x26a68d['body']['id']){delete _0x26a68d['body']['id'];}return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x26a68d[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x5b746c,null))['then'](saveUpdates(_0x26a68d[_0x458c('0x42')],null))[_0x458c('0x22')](respondWithResult(_0x5b746c,null))[_0x458c('0x3c')](handleError(_0x5b746c,null));};exports[_0x458c('0x23')]=function(_0x53c4e0,_0x290a65){return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x53c4e0[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x290a65,null))[_0x458c('0x22')](removeEntity(_0x290a65,null))[_0x458c('0x3c')](handleError(_0x290a65,null));};exports['getHoppers']=function(_0x2b8a61,_0x212dba,_0x3b9df2){var _0x1a2123={'raw':!![],'where':{}};var _0xb07f74={};var _0x52025c={'count':0x0,'rows':[]};return db[_0x458c('0x3a')][_0x458c('0x51')]({'where':{'id':_0x2b8a61[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x212dba,null))['then'](function(_0x282c5e){if(_0x282c5e){_0xb07f74[_0x458c('0x31')]=_['keys'](db[_0x458c('0x52')]['rawAttributes']);_0xb07f74[_0x458c('0x2d')]=_['keys'](_0x2b8a61[_0x458c('0x2d')]);_0xb07f74['filters']=_[_0x458c('0x30')](_0xb07f74[_0x458c('0x31')],_0xb07f74[_0x458c('0x2d')]);_0x1a2123[_0x458c('0x32')]=_[_0x458c('0x30')](_0xb07f74[_0x458c('0x31')],qs[_0x458c('0x33')](_0x2b8a61[_0x458c('0x2d')][_0x458c('0x33')]));_0x1a2123['attributes']=_0x1a2123[_0x458c('0x32')][_0x458c('0x3e')]?_0x1a2123[_0x458c('0x32')]:_0xb07f74[_0x458c('0x31')];if(!_0x2b8a61[_0x458c('0x2d')][_0x458c('0x34')](_0x458c('0x53'))){_0x1a2123[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x2b8a61[_0x458c('0x2d')][_0x458c('0x1a')]);_0x1a2123[_0x458c('0x1c')]=qs['offset'](_0x2b8a61[_0x458c('0x2d')][_0x458c('0x1c')]);}_0x1a2123[_0x458c('0x54')]=qs[_0x458c('0x35')](_0x2b8a61[_0x458c('0x2d')]['sort']);_0x1a2123['where']=qs[_0x458c('0x2f')](_[_0x458c('0x55')](_0x2b8a61[_0x458c('0x2d')],_0xb07f74['filters']));_0x1a2123[_0x458c('0x36')]['CampaignId']=_0x282c5e['id'];if(_0x2b8a61[_0x458c('0x2d')][_0x458c('0x37')]){_0x1a2123[_0x458c('0x36')]=_[_0x458c('0x38')](_0x1a2123[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x1a2123[_0x458c('0x32')],function(_0x4ddece){var _0x348535={};_0x348535[_0x4ddece]={'$like':'%'+_0x2b8a61[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x348535;})});}_0x1a2123=_['merge']({},_0x1a2123,_0x2b8a61[_0x458c('0x39')]);return db[_0x458c('0x52')][_0x458c('0x1b')]({'where':_0x1a2123[_0x458c('0x36')]})['then'](function(_0x2b7f63){_0x52025c[_0x458c('0x1b')]=_0x2b7f63;if(_0x2b8a61[_0x458c('0x2d')][_0x458c('0x49')]){_0x1a2123[_0x458c('0x3f')]=[{'all':!![]}];}return db[_0x458c('0x52')][_0x458c('0x56')](_0x1a2123);})[_0x458c('0x22')](function(_0x1471c1){_0x52025c[_0x458c('0x3b')]=_0x1471c1;return _0x52025c;});}})[_0x458c('0x22')](respondWithFilteredResult(_0x212dba,_0x1a2123))['catch'](handleError(_0x212dba,null));};exports['getHopperHistories']=function(_0x9b0359,_0x23070a,_0x24837d){var _0x55bd9e={'raw':!![],'where':{}};var _0x24856e={};var _0x1f0aa3={'count':0x0,'rows':[]};return db[_0x458c('0x3a')][_0x458c('0x51')]({'where':{'id':_0x9b0359['params']['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x23070a,null))[_0x458c('0x22')](function(_0x4ff8cb){if(_0x4ff8cb){_0x24856e[_0x458c('0x31')]=_[_0x458c('0x2e')](db['CmHopperHistory'][_0x458c('0x29')]);_0x24856e[_0x458c('0x2d')]=_[_0x458c('0x2e')](_0x9b0359['query']);_0x24856e['filters']=_[_0x458c('0x30')](_0x24856e[_0x458c('0x31')],_0x24856e['query']);_0x55bd9e['attributes']=_[_0x458c('0x30')](_0x24856e[_0x458c('0x31')],qs[_0x458c('0x33')](_0x9b0359['query']['fields']));_0x55bd9e[_0x458c('0x32')]=_0x55bd9e[_0x458c('0x32')]['length']?_0x55bd9e[_0x458c('0x32')]:_0x24856e[_0x458c('0x31')];if(!_0x9b0359[_0x458c('0x2d')][_0x458c('0x34')]('nolimit')){_0x55bd9e[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x9b0359[_0x458c('0x2d')][_0x458c('0x1a')]);_0x55bd9e[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0x9b0359[_0x458c('0x2d')][_0x458c('0x1c')]);}_0x55bd9e['order']=qs[_0x458c('0x35')](_0x9b0359[_0x458c('0x2d')]['sort']);_0x55bd9e['where']=qs[_0x458c('0x2f')](_['pick'](_0x9b0359[_0x458c('0x2d')],_0x24856e['filters']));_0x55bd9e[_0x458c('0x36')][_0x458c('0x57')]=_0x4ff8cb['id'];if(_0x9b0359[_0x458c('0x2d')][_0x458c('0x37')]){_0x55bd9e[_0x458c('0x36')]=_[_0x458c('0x38')](_0x55bd9e[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x55bd9e[_0x458c('0x32')],function(_0x2a0105){var _0x4b5dbd={};_0x4b5dbd[_0x2a0105]={'$like':'%'+_0x9b0359[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x4b5dbd;})});}_0x55bd9e=_[_0x458c('0x38')]({},_0x55bd9e,_0x9b0359[_0x458c('0x39')]);return db[_0x458c('0x58')]['count']({'where':_0x55bd9e['where']})['then'](function(_0x1b7b07){_0x1f0aa3['count']=_0x1b7b07;if(_0x9b0359[_0x458c('0x2d')]['includeAll']){_0x55bd9e[_0x458c('0x3f')]=[{'all':!![]}];}return db[_0x458c('0x58')][_0x458c('0x56')](_0x55bd9e);})[_0x458c('0x22')](function(_0x140f29){_0x1f0aa3[_0x458c('0x3b')]=_0x140f29;return _0x1f0aa3;});}})[_0x458c('0x22')](respondWithFilteredResult(_0x23070a,_0x55bd9e))[_0x458c('0x3c')](handleError(_0x23070a,null));};exports[_0x458c('0x59')]=function(_0x5cfbc5,_0x400d44,_0x5143b3){var _0x2c70c3={'raw':!![],'where':{}};var _0x2a4e96={};var _0x5297a9={'count':0x0,'rows':[]};return db[_0x458c('0x3a')][_0x458c('0x51')]({'where':{'id':_0x5cfbc5[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x400d44,null))['then'](function(_0x3af8dc){if(_0x3af8dc){_0x2a4e96[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x5a')][_0x458c('0x29')]);_0x2a4e96[_0x458c('0x2d')]=_['keys'](_0x5cfbc5[_0x458c('0x2d')]);_0x2a4e96[_0x458c('0x2f')]=_[_0x458c('0x30')](_0x2a4e96[_0x458c('0x31')],_0x2a4e96[_0x458c('0x2d')]);_0x2c70c3[_0x458c('0x32')]=_['intersection'](_0x2a4e96[_0x458c('0x31')],qs[_0x458c('0x33')](_0x5cfbc5['query']['fields']));_0x2c70c3[_0x458c('0x32')]=_0x2c70c3[_0x458c('0x32')]['length']?_0x2c70c3[_0x458c('0x32')]:_0x2a4e96[_0x458c('0x31')];if(!_0x5cfbc5['query'][_0x458c('0x34')](_0x458c('0x53'))){_0x2c70c3['limit']=qs[_0x458c('0x1a')](_0x5cfbc5[_0x458c('0x2d')][_0x458c('0x1a')]);_0x2c70c3[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0x5cfbc5[_0x458c('0x2d')][_0x458c('0x1c')]);}_0x2c70c3['order']=qs[_0x458c('0x35')](_0x5cfbc5[_0x458c('0x2d')]['sort']);_0x2c70c3['where']=qs[_0x458c('0x2f')](_['pick'](_0x5cfbc5['query'],_0x2a4e96[_0x458c('0x2f')]));_0x2c70c3[_0x458c('0x36')]['CampaignId']=_0x3af8dc['id'];if(_0x5cfbc5[_0x458c('0x2d')]['filter']){_0x2c70c3[_0x458c('0x36')]=_[_0x458c('0x38')](_0x2c70c3[_0x458c('0x36')],{'$or':_['map'](_0x2c70c3['attributes'],function(_0x2dd9c2){var _0x31fc1c={};_0x31fc1c[_0x2dd9c2]={'$like':'%'+_0x5cfbc5[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x31fc1c;})});}_0x2c70c3=_['merge']({},_0x2c70c3,_0x5cfbc5[_0x458c('0x39')]);return db[_0x458c('0x5a')][_0x458c('0x1b')]({'where':_0x2c70c3[_0x458c('0x36')]})[_0x458c('0x22')](function(_0x5ba396){_0x5297a9[_0x458c('0x1b')]=_0x5ba396;if(_0x5cfbc5['query']['includeAll']){_0x2c70c3[_0x458c('0x3f')]=[{'all':!![]}];}return db[_0x458c('0x5a')][_0x458c('0x56')](_0x2c70c3);})['then'](function(_0x8b4e9d){_0x5297a9[_0x458c('0x3b')]=_0x8b4e9d;return _0x5297a9;});}})['then'](respondWithFilteredResult(_0x400d44,_0x2c70c3))['catch'](handleError(_0x400d44,null));};exports[_0x458c('0x5b')]=function(_0x184494,_0x456a61,_0x2f679c){var _0x4c8d43={'raw':!![],'where':{}};var _0x5a6fcd={};var _0x1c7023={'count':0x0,'rows':[]};return db[_0x458c('0x3a')][_0x458c('0x51')]({'where':{'id':_0x184494[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x456a61,null))[_0x458c('0x22')](function(_0x57d2db){if(_0x57d2db){_0x5a6fcd[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x5c')][_0x458c('0x29')]);_0x5a6fcd[_0x458c('0x2d')]=_['keys'](_0x184494[_0x458c('0x2d')]);_0x5a6fcd['filters']=_[_0x458c('0x30')](_0x5a6fcd[_0x458c('0x31')],_0x5a6fcd[_0x458c('0x2d')]);_0x4c8d43[_0x458c('0x32')]=_[_0x458c('0x30')](_0x5a6fcd[_0x458c('0x31')],qs[_0x458c('0x33')](_0x184494[_0x458c('0x2d')]['fields']));_0x4c8d43[_0x458c('0x32')]=_0x4c8d43['attributes'][_0x458c('0x3e')]?_0x4c8d43[_0x458c('0x32')]:_0x5a6fcd[_0x458c('0x31')];if(!_0x184494[_0x458c('0x2d')][_0x458c('0x34')]('nolimit')){_0x4c8d43[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x184494[_0x458c('0x2d')][_0x458c('0x1a')]);_0x4c8d43[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0x184494[_0x458c('0x2d')][_0x458c('0x1c')]);}_0x4c8d43[_0x458c('0x54')]=qs[_0x458c('0x35')](_0x184494[_0x458c('0x2d')][_0x458c('0x35')]);_0x4c8d43['where']=qs['filters'](_[_0x458c('0x55')](_0x184494[_0x458c('0x2d')],_0x5a6fcd['filters']));_0x4c8d43[_0x458c('0x36')][_0x458c('0x57')]=_0x57d2db['id'];if(_0x184494[_0x458c('0x2d')][_0x458c('0x37')]){_0x4c8d43['where']=_[_0x458c('0x38')](_0x4c8d43[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x4c8d43[_0x458c('0x32')],function(_0x532758){var _0x389ed0={};_0x389ed0[_0x532758]={'$like':'%'+_0x184494[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x389ed0;})});}_0x4c8d43=_[_0x458c('0x38')]({},_0x4c8d43,_0x184494[_0x458c('0x39')]);return db['CmHopperBlack'][_0x458c('0x1b')]({'where':_0x4c8d43[_0x458c('0x36')]})[_0x458c('0x22')](function(_0x4dd870){_0x1c7023['count']=_0x4dd870;if(_0x184494['query'][_0x458c('0x49')]){_0x4c8d43[_0x458c('0x3f')]=[{'all':!![]}];}return db[_0x458c('0x5c')][_0x458c('0x56')](_0x4c8d43);})[_0x458c('0x22')](function(_0xadcbc1){_0x1c7023[_0x458c('0x3b')]=_0xadcbc1;return _0x1c7023;});}})[_0x458c('0x22')](respondWithFilteredResult(_0x456a61,_0x4c8d43))[_0x458c('0x3c')](handleError(_0x456a61,null));};exports[_0x458c('0x5d')]=function(_0xd3e523,_0x3efc5c,_0x5c17f4){var _0x227fc5={};var _0x2e4bc4={};var _0x2c5822;var _0x1c3b95;return db[_0x458c('0x3a')]['findOne']({'where':{'id':_0xd3e523[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x3efc5c,null))[_0x458c('0x22')](function(_0x51d4e1){if(_0x51d4e1){_0x2c5822=_0x51d4e1;_0x2e4bc4[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x5e')][_0x458c('0x29')]);_0x2e4bc4['query']=_[_0x458c('0x2e')](_0xd3e523['query']);_0x2e4bc4[_0x458c('0x2f')]=_[_0x458c('0x30')](_0x2e4bc4['model'],_0x2e4bc4[_0x458c('0x2d')]);_0x227fc5[_0x458c('0x32')]=_[_0x458c('0x30')](_0x2e4bc4['model'],qs['fields'](_0xd3e523[_0x458c('0x2d')][_0x458c('0x33')]));_0x227fc5[_0x458c('0x32')]=_0x227fc5['attributes'][_0x458c('0x3e')]?_0x227fc5[_0x458c('0x32')]:_0x2e4bc4[_0x458c('0x31')];_0x227fc5[_0x458c('0x54')]=qs['sort'](_0xd3e523['query'][_0x458c('0x35')]);_0x227fc5[_0x458c('0x36')]=qs[_0x458c('0x2f')](_[_0x458c('0x55')](_0xd3e523[_0x458c('0x2d')],_0x2e4bc4[_0x458c('0x2f')]));if(_0xd3e523['query'][_0x458c('0x37')]){_0x227fc5[_0x458c('0x36')]=_[_0x458c('0x38')](_0x227fc5[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x227fc5[_0x458c('0x32')],function(_0x98206f){var _0x2955ef={};_0x2955ef[_0x98206f]={'$like':'%'+_0xd3e523[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x2955ef;})});}_0x227fc5=_[_0x458c('0x38')]({},_0x227fc5,_0xd3e523['options']);return _0x2c5822[_0x458c('0x5d')](_0x227fc5);}})['then'](function(_0x5664b6){if(_0x5664b6){_0x1c3b95=_0x5664b6['length'];if(!_0xd3e523[_0x458c('0x2d')][_0x458c('0x34')](_0x458c('0x53'))){_0x227fc5[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0xd3e523['query'][_0x458c('0x1a')]);_0x227fc5[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0xd3e523[_0x458c('0x2d')][_0x458c('0x1c')]);}return _0x2c5822[_0x458c('0x5d')](_0x227fc5);}})[_0x458c('0x22')](function(_0x478a51){if(_0x478a51){return _0x478a51?{'count':_0x1c3b95,'rows':_0x478a51}:null;}})[_0x458c('0x22')](respondWithResult(_0x3efc5c,null))[_0x458c('0x3c')](handleError(_0x3efc5c,null));};exports[_0x458c('0x5f')]=function(_0x3e7910,_0x14336c,_0x4765eb){var _0x386b1a,_0x518898;var _0x4a895d=[];var _0x31087c=moment()[_0x458c('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x3e7910['params']['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x14336c,null))[_0x458c('0x22')](function(_0x21269d){if(_0x21269d){_0x518898=_0x21269d;return _0x21269d[_0x458c('0x5f')](_0x3e7910[_0x458c('0x42')][_0x458c('0x61')],_[_0x458c('0x4a')](_0x3e7910[_0x458c('0x42')],[_0x458c('0x61'),'id'])||{});}return null;})[_0x458c('0x62')](function(_0xef131e){var _0x46ad33;var _0x529e04;_0x386b1a=_0xef131e||[];var _0x3d03fa=[];if(_0xef131e){for(var _0x200187=0x0;_0x200187<_0xef131e['length'];_0x200187+=0x1){var _0x563921=_0xef131e[_0x200187]['get']({'plain':!![]});_0x518898[_0x458c('0x63')]=_0x3e7910[_0x458c('0x42')][_0x458c('0x63')]?_0x3e7910['body'][_0x458c('0x63')]:_0x518898[_0x458c('0x63')];switch(_0x518898[_0x458c('0x63')]){case _0x458c('0x64'):_0x46ad33=squel[_0x458c('0x65')]()['into'](_0x458c('0x66'))[_0x458c('0x67')]([_0x458c('0x68'),_0x458c('0x69'),_0x458c('0x6a'),_0x458c('0x6b'),_0x458c('0x57'),_0x458c('0x4b'),_0x458c('0x4c')],squel['select']()[_0x458c('0x6c')](_0x458c('0x68'),'phone')['field'](_0x458c('0x6d'),_0x458c('0x69'))[_0x458c('0x6c')]('id',_0x458c('0x6a'))[_0x458c('0x6c')](_0x563921[_0x458c('0x6e')][_0x458c('0x6f')](),_0x458c('0x6b'))['field'](_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')](),_0x458c('0x57'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4b'))[_0x458c('0x6c')]('\x27'+_0x31087c+'\x27',_0x458c('0x4c'))[_0x458c('0x70')](_0x458c('0x71'))[_0x458c('0x36')](_0x458c('0x72'))['where'](_0x458c('0x73'),_0x563921['CmListId']['toString']())[_0x458c('0x36')](_0x458c('0x74'))[_0x458c('0x36')](_0x458c('0x75'),squel[_0x458c('0x76')]()[_0x458c('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x458c('0x70')](_0x458c('0x77'))['where']('CampaignId\x20=\x20?',_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')]()))[_0x458c('0x36')](_0x458c('0x75'),squel[_0x458c('0x76')]()['field'](_0x458c('0x78'))[_0x458c('0x70')](_0x458c('0x66'))['where']('CampaignId\x20=\x20?',_0x3e7910[_0x458c('0x3d')]['id']['toString']())))[_0x458c('0x6f')]();break;case _0x458c('0x79'):_0x46ad33=squel[_0x458c('0x65')]()[_0x458c('0x7a')](_0x458c('0x66'))[_0x458c('0x67')]([_0x458c('0x68'),_0x458c('0x69'),'ContactId',_0x458c('0x6b'),_0x458c('0x57'),'createdAt','updatedAt'],squel['select']()['field'](_0x458c('0x68'),_0x458c('0x68'))['field'](_0x458c('0x6d'),_0x458c('0x69'))[_0x458c('0x6c')]('id',_0x458c('0x6a'))[_0x458c('0x6c')](_0x563921[_0x458c('0x6e')]['toString'](),'ListId')[_0x458c('0x6c')](_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')](),'CampaignId')[_0x458c('0x6c')]('\x27'+_0x31087c+'\x27',_0x458c('0x4b'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4c'))[_0x458c('0x70')]('cm_contacts')['where'](_0x458c('0x72'))[_0x458c('0x36')]('ListId\x20=\x20?',_0x563921[_0x458c('0x6e')][_0x458c('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x458c('0x36')](_0x458c('0x75'),squel[_0x458c('0x76')]()[_0x458c('0x6c')](_0x458c('0x78'))['from'](_0x458c('0x66'))[_0x458c('0x36')](_0x458c('0x7b'),_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')]())))[_0x458c('0x6f')]();break;default:_0x46ad33=squel[_0x458c('0x65')]()['into']('cm_hopper')[_0x458c('0x67')]([_0x458c('0x68'),_0x458c('0x69'),_0x458c('0x6a'),'ListId','CampaignId',_0x458c('0x4b'),_0x458c('0x4c')],squel[_0x458c('0x76')]()[_0x458c('0x6c')](_0x458c('0x68'),_0x458c('0x68'))[_0x458c('0x6c')](_0x458c('0x6d'),_0x458c('0x69'))[_0x458c('0x6c')]('id','ContactId')[_0x458c('0x6c')](_0x563921[_0x458c('0x6e')][_0x458c('0x6f')](),'ListId')[_0x458c('0x6c')](_0x3e7910['params']['id'][_0x458c('0x6f')](),_0x458c('0x57'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4b'))[_0x458c('0x6c')]('\x27'+_0x31087c+'\x27',_0x458c('0x4c'))[_0x458c('0x70')](_0x458c('0x71'))[_0x458c('0x36')]('deletedAt\x20IS\x20NULL')[_0x458c('0x36')](_0x458c('0x73'),_0x563921[_0x458c('0x6e')]['toString']())[_0x458c('0x36')](_0x458c('0x74')))[_0x458c('0x6f')]();}_0x529e04=squel['insert']()['into'](_0x458c('0x7c'))['fromQuery'](['cmHopperId',_0x458c('0x69'),_0x458c('0x68'),_0x458c('0x7d'),_0x458c('0x4b'),_0x458c('0x4c')],squel[_0x458c('0x76')]()[_0x458c('0x6c')]('h.id','id')[_0x458c('0x6c')](_0x458c('0x6d'),'scheduledAt')[_0x458c('0x6c')](_0x458c('0x7e'),_0x458c('0x68'))['field']('ci.OrderBY',_0x458c('0x7d'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4b'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4c'))[_0x458c('0x70')](_0x458c('0x7f'),'ci')['join'](_0x458c('0x66'),'h',_0x458c('0x80'))[_0x458c('0x36')]('h.ListId\x20=\x20?',_0x563921[_0x458c('0x6e')]['toString']())['where']('h.CampaignId=?',_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')]())[_0x458c('0x36')](_0x458c('0x81'),_0x31087c))[_0x458c('0x6f')]();_0x3d03fa[_0x458c('0x82')](db[_0x458c('0x83')]['query'](_0x46ad33));_0x4a895d['push'](db['sequelize'][_0x458c('0x2d')](_0x529e04));}return BPromise[_0x458c('0x84')](_0x3d03fa);}})[_0x458c('0x22')](function(){return BPromise[_0x458c('0x84')](_0x4a895d);})['then'](function(){return _0x386b1a;})[_0x458c('0x22')](respondWithResult(_0x14336c,null))[_0x458c('0x3c')](handleError(_0x14336c,null));};exports['removeLists']=function(_0x3029c2,_0x5414a4,_0x2fa7b3){return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x3029c2[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x5414a4,null))[_0x458c('0x22')](function(_0x4cf5d5){if(_0x4cf5d5){return _0x4cf5d5[_0x458c('0x85')](_0x3029c2['query'][_0x458c('0x61')]);}})['then'](function(_0xba9d38){if(_0xba9d38){return db[_0x458c('0x52')][_0x458c('0x23')]({'where':{'ListId':_0x3029c2['query']['ids'],'CampaignId':_0x3029c2[_0x458c('0x3d')]['id']}})['then'](function(){return _0xba9d38;});}})[_0x458c('0x22')](respondWithStatusCode(_0x5414a4,null))['catch'](handleError(_0x5414a4,null));};exports['getBlackLists']=function(_0x496fed,_0x4f6924,_0x31f215){var _0x42067f={};var _0x140bca={};var _0x2386a8;var _0x438edd;return db['Campaign'][_0x458c('0x51')]({'where':{'id':_0x496fed[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x4f6924,null))['then'](function(_0x3320fc){if(_0x3320fc){_0x2386a8=_0x3320fc;_0x140bca[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x5e')][_0x458c('0x29')]);_0x140bca[_0x458c('0x2d')]=_[_0x458c('0x2e')](_0x496fed[_0x458c('0x2d')]);_0x140bca[_0x458c('0x2f')]=_[_0x458c('0x30')](_0x140bca['model'],_0x140bca[_0x458c('0x2d')]);_0x42067f[_0x458c('0x32')]=_[_0x458c('0x30')](_0x140bca[_0x458c('0x31')],qs[_0x458c('0x33')](_0x496fed['query'][_0x458c('0x33')]));_0x42067f[_0x458c('0x32')]=_0x42067f[_0x458c('0x32')][_0x458c('0x3e')]?_0x42067f['attributes']:_0x140bca['model'];_0x42067f['order']=qs[_0x458c('0x35')](_0x496fed[_0x458c('0x2d')][_0x458c('0x35')]);_0x42067f['where']=qs[_0x458c('0x2f')](_[_0x458c('0x55')](_0x496fed['query'],_0x140bca[_0x458c('0x2f')]));if(_0x496fed['query'][_0x458c('0x37')]){_0x42067f[_0x458c('0x36')]=_['merge'](_0x42067f[_0x458c('0x36')],{'$or':_['map'](_0x42067f['attributes'],function(_0x13fcff){var _0x55fcf7={};_0x55fcf7[_0x13fcff]={'$like':'%'+_0x496fed['query'][_0x458c('0x37')]+'%'};return _0x55fcf7;})});}_0x42067f=_[_0x458c('0x38')]({},_0x42067f,_0x496fed['options']);return _0x2386a8[_0x458c('0x86')](_0x42067f);}})[_0x458c('0x22')](function(_0x8914b){if(_0x8914b){_0x438edd=_0x8914b['length'];if(!_0x496fed['query'][_0x458c('0x34')]('nolimit')){_0x42067f[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x496fed[_0x458c('0x2d')]['limit']);_0x42067f[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0x496fed[_0x458c('0x2d')][_0x458c('0x1c')]);}return _0x2386a8['getBlackLists'](_0x42067f);}})[_0x458c('0x22')](function(_0x574380){if(_0x574380){return _0x574380?{'count':_0x438edd,'rows':_0x574380}:null;}})[_0x458c('0x22')](respondWithResult(_0x4f6924,null))[_0x458c('0x3c')](handleError(_0x4f6924,null));};exports[_0x458c('0x87')]=function(_0x5b9701,_0x59bc3a,_0x1244d1){var _0x4ff89f,_0x4f009b;var _0x576ba1=[];var _0x4ccdd6=moment()[_0x458c('0x60')](_0x458c('0x88'));return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x5b9701[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x59bc3a,null))[_0x458c('0x22')](function(_0xd0ab84){if(_0xd0ab84){_0x4f009b=_0xd0ab84;return _0xd0ab84[_0x458c('0x87')](_0x5b9701[_0x458c('0x42')]['ids'],_['omit'](_0x5b9701[_0x458c('0x42')],[_0x458c('0x61'),'id'])||{});}return null;})['spread'](function(_0x4a88fd){var _0x39a128;var _0x429ba2;_0x4ff89f=_0x4a88fd||[];var _0x5e06dd=[];if(_0x4a88fd){for(var _0x146162=0x0;_0x146162<_0x4a88fd[_0x458c('0x3e')];_0x146162+=0x1){var _0x4c45df=_0x4a88fd[_0x146162][_0x458c('0x24')]({'plain':!![]});_0x39a128=squel['insert']()[_0x458c('0x7a')](_0x458c('0x89'))[_0x458c('0x67')](['phone','ContactId',_0x458c('0x6b'),_0x458c('0x57'),_0x458c('0x4b'),_0x458c('0x4c')],squel[_0x458c('0x76')]()['field']('phone',_0x458c('0x68'))[_0x458c('0x6c')]('id',_0x458c('0x6a'))[_0x458c('0x6c')](_0x4c45df[_0x458c('0x6e')]['toString'](),'ListId')['field'](_0x5b9701[_0x458c('0x3d')]['id'][_0x458c('0x6f')](),_0x458c('0x57'))[_0x458c('0x6c')](_0x458c('0x6d'),'createdAt')['field']('NOW()',_0x458c('0x4c'))[_0x458c('0x70')](_0x458c('0x71'))[_0x458c('0x36')](_0x458c('0x72'))['where'](_0x458c('0x73'),_0x4c45df['CmListId'][_0x458c('0x6f')]())[_0x458c('0x36')](_0x458c('0x74')))['toString']();_0x5e06dd[_0x458c('0x82')](db['sequelize'][_0x458c('0x2d')](_0x39a128));}return BPromise[_0x458c('0x84')](_0x5e06dd);}})['then'](function(){return _0x4ff89f;})[_0x458c('0x22')](respondWithResult(_0x59bc3a,null))[_0x458c('0x3c')](handleError(_0x59bc3a,null));};exports['removeBlackLists']=function(_0x45d7bc,_0xbf348,_0x11c432){return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x45d7bc[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0xbf348,null))[_0x458c('0x22')](function(_0x43dc50){if(_0x43dc50){return _0x43dc50[_0x458c('0x8a')](_0x45d7bc[_0x458c('0x2d')][_0x458c('0x61')]);}})[_0x458c('0x22')](function(_0x561ee0){if(_0x561ee0){return db[_0x458c('0x5c')][_0x458c('0x23')]({'where':{'ListId':_0x45d7bc['query']['ids'],'CampaignId':_0x45d7bc[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](function(){return _0x561ee0;});}})['then'](respondWithStatusCode(_0xbf348,null))[_0x458c('0x3c')](handleError(_0xbf348,null));};
\ No newline at end of file
+var _0x1477=['h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','options','where','Campaign','includeAll','include','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','clone','find','omit','createdAt','updatedAt','user','getHoppers','CmHopper','findAll','getHopperHistories','findOne','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','ContactId','into','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?'];(function(_0x5a3a60,_0x3c3ad5){var _0xe5ea9=function(_0x1dd2f0){while(--_0x1dd2f0){_0x5a3a60['push'](_0x5a3a60['shift']());}};_0xe5ea9(++_0x3c3ad5);}(_0x1477,0x122));var _0x7147=function(_0x5b8357,_0x16b012){_0x5b8357=_0x5b8357-0x0;var _0x5c63c7=_0x1477[_0x5b8357];return _0x5c63c7;};'use strict';var emlformat=require(_0x7147('0x0'));var rimraf=require(_0x7147('0x1'));var zipdir=require(_0x7147('0x2'));var jsonpatch=require(_0x7147('0x3'));var rp=require(_0x7147('0x4'));var moment=require('moment');var BPromise=require(_0x7147('0x5'));var Mustache=require(_0x7147('0x6'));var util=require('util');var path=require(_0x7147('0x7'));var sox=require(_0x7147('0x8'));var csv=require(_0x7147('0x9'));var ejs=require(_0x7147('0xa'));var fs=require('fs');var fs_extra=require(_0x7147('0xb'));var _=require(_0x7147('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7147('0x9'));var querystring=require(_0x7147('0xd'));var Papa=require('papaparse');var Redis=require(_0x7147('0xe'));var authService=require(_0x7147('0xf'));var qs=require(_0x7147('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7147('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7147('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7147('0x13'));var db=require(_0x7147('0x14'))['db'];function respondWithStatusCode(_0x50e05e,_0x495512){_0x495512=_0x495512||0xcc;return function(_0x24d58b){if(_0x24d58b){return _0x50e05e[_0x7147('0x15')](_0x495512);}return _0x50e05e[_0x7147('0x16')](_0x495512)[_0x7147('0x17')]();};}function respondWithResult(_0xd4156b,_0x4ded34){_0x4ded34=_0x4ded34||0xc8;return function(_0xe1a401){if(_0xe1a401){return _0xd4156b[_0x7147('0x16')](_0x4ded34)[_0x7147('0x18')](_0xe1a401);}};}function respondWithFilteredResult(_0xd3fabf,_0x36a6a7){return function(_0x40d373){if(_0x40d373){var _0x32fdc9=typeof _0x36a6a7['offset']===_0x7147('0x19')&&typeof _0x36a6a7[_0x7147('0x1a')]===_0x7147('0x19');var _0x517bf9=_0x40d373[_0x7147('0x1b')];var _0x4ae0d3=_0x32fdc9?0x0:_0x36a6a7['offset'];var _0x10b987=_0x32fdc9?_0x40d373[_0x7147('0x1b')]:_0x36a6a7[_0x7147('0x1c')]+_0x36a6a7[_0x7147('0x1a')];var _0x272229;if(_0x10b987>=_0x517bf9){_0x10b987=_0x517bf9;_0x272229=0xc8;}else{_0x272229=0xce;}_0xd3fabf[_0x7147('0x16')](_0x272229);return _0xd3fabf[_0x7147('0x1d')]('Content-Range',_0x4ae0d3+'-'+_0x10b987+'/'+_0x517bf9)[_0x7147('0x18')](_0x40d373);}return null;};}function patchUpdates(_0x43a9a3){return function(_0x58ed61){try{jsonpatch[_0x7147('0x1e')](_0x58ed61,_0x43a9a3,!![]);}catch(_0xb7a297){return BPromise[_0x7147('0x1f')](_0xb7a297);}return _0x58ed61[_0x7147('0x20')]();};}function saveUpdates(_0x2f19a3,_0x37acfa){return function(_0x12b2a0){if(_0x12b2a0){return _0x12b2a0['update'](_0x2f19a3)[_0x7147('0x21')](function(_0x2cc01b){return _0x2cc01b;});}return null;};}function removeEntity(_0x1a4048,_0x169dd9){return function(_0x12cdcc){if(_0x12cdcc){return _0x12cdcc[_0x7147('0x22')]()[_0x7147('0x21')](function(){var _0x2b8e0a=_0x12cdcc[_0x7147('0x23')]({'plain':!![]});var _0x5ecc40=_0x7147('0x24');return db[_0x7147('0x25')][_0x7147('0x22')]({'where':{'type':_0x5ecc40,'resourceId':_0x2b8e0a['id']}})['then'](function(){return _0x12cdcc;});})[_0x7147('0x21')](function(){_0x1a4048[_0x7147('0x16')](0xcc)[_0x7147('0x17')]();});}};}function handleEntityNotFound(_0x215617,_0x37a9ac){return function(_0x129328){if(!_0x129328){_0x215617[_0x7147('0x15')](0x194);}return _0x129328;};}function handleError(_0x4f6ca4,_0x189384){_0x189384=_0x189384||0x1f4;return function(_0x574a43){logger[_0x7147('0x26')](_0x574a43[_0x7147('0x27')]);if(_0x574a43[_0x7147('0x28')]){delete _0x574a43[_0x7147('0x28')];}_0x4f6ca4[_0x7147('0x16')](_0x189384)[_0x7147('0x29')](_0x574a43);};}exports[_0x7147('0x2a')]=function(_0x2d968c,_0x39dd79){var _0x3d5a4a={},_0x18a79c={},_0x16fd8f={'count':0x0,'rows':[]};var _0x464487=_['map'](db['Campaign'][_0x7147('0x2b')],function(_0x4db8a0){return{'name':_0x4db8a0[_0x7147('0x2c')],'type':_0x4db8a0[_0x7147('0x2d')][_0x7147('0x2e')]};});_0x18a79c[_0x7147('0x2f')]=_[_0x7147('0x30')](_0x464487,_0x7147('0x28'));_0x18a79c[_0x7147('0x31')]=_[_0x7147('0x32')](_0x2d968c[_0x7147('0x31')]);_0x18a79c['filters']=_[_0x7147('0x33')](_0x18a79c[_0x7147('0x2f')],_0x18a79c[_0x7147('0x31')]);_0x3d5a4a[_0x7147('0x34')]=_['intersection'](_0x18a79c[_0x7147('0x2f')],qs[_0x7147('0x35')](_0x2d968c['query'][_0x7147('0x35')]));_0x3d5a4a['attributes']=_0x3d5a4a[_0x7147('0x34')][_0x7147('0x36')]?_0x3d5a4a['attributes']:_0x18a79c[_0x7147('0x2f')];if(!_0x2d968c[_0x7147('0x31')][_0x7147('0x37')](_0x7147('0x38'))){_0x3d5a4a['limit']=qs[_0x7147('0x1a')](_0x2d968c[_0x7147('0x31')][_0x7147('0x1a')]);_0x3d5a4a[_0x7147('0x1c')]=qs[_0x7147('0x1c')](_0x2d968c[_0x7147('0x31')]['offset']);}_0x3d5a4a[_0x7147('0x39')]=qs[_0x7147('0x3a')](_0x2d968c[_0x7147('0x31')][_0x7147('0x3a')]);_0x3d5a4a['where']=qs[_0x7147('0x3b')](_[_0x7147('0x3c')](_0x2d968c['query'],_0x18a79c['filters']),_0x464487);if(_0x2d968c['query'][_0x7147('0x3d')]){_0x3d5a4a['where']=_[_0x7147('0x3e')](_0x3d5a4a['where'],{'$or':_[_0x7147('0x30')](_0x464487,function(_0x2ffddf){if(_0x2ffddf[_0x7147('0x2d')]!=='VIRTUAL'){var _0x4d9c6b={};_0x4d9c6b[_0x2ffddf[_0x7147('0x28')]]={'$like':'%'+_0x2d968c[_0x7147('0x31')][_0x7147('0x3d')]+'%'};return _0x4d9c6b;}})});}_0x3d5a4a=_[_0x7147('0x3e')]({},_0x3d5a4a,_0x2d968c[_0x7147('0x3f')]);var _0x122a07={'where':_0x3d5a4a[_0x7147('0x40')]};return db[_0x7147('0x41')]['count'](_0x122a07)['then'](function(_0x45cc0a){_0x16fd8f['count']=_0x45cc0a;if(_0x2d968c[_0x7147('0x31')][_0x7147('0x42')]){_0x3d5a4a[_0x7147('0x43')]=[{'all':!![]}];}return db[_0x7147('0x41')]['findAll'](_0x3d5a4a);})[_0x7147('0x21')](function(_0x355245){_0x16fd8f[_0x7147('0x44')]=_0x355245;return _0x16fd8f;})[_0x7147('0x21')](respondWithFilteredResult(_0x39dd79,_0x3d5a4a))[_0x7147('0x45')](handleError(_0x39dd79,null));};exports[_0x7147('0x46')]=function(_0x16f0e9,_0x15326){var _0xe3851b={'raw':![],'where':{'id':_0x16f0e9[_0x7147('0x47')]['id']}},_0x12c37b={};_0x12c37b['model']=_[_0x7147('0x32')](db[_0x7147('0x41')][_0x7147('0x2b')]);_0x12c37b[_0x7147('0x31')]=_[_0x7147('0x32')](_0x16f0e9['query']);_0x12c37b[_0x7147('0x3b')]=_[_0x7147('0x33')](_0x12c37b['model'],_0x12c37b[_0x7147('0x31')]);_0xe3851b['attributes']=_[_0x7147('0x33')](_0x12c37b[_0x7147('0x2f')],qs[_0x7147('0x35')](_0x16f0e9[_0x7147('0x31')][_0x7147('0x35')]));_0xe3851b[_0x7147('0x34')]=_0xe3851b[_0x7147('0x34')][_0x7147('0x36')]?_0xe3851b[_0x7147('0x34')]:_0x12c37b[_0x7147('0x2f')];if(_0x16f0e9[_0x7147('0x31')][_0x7147('0x42')]){_0xe3851b['include']=[{'all':!![]}];}_0xe3851b=_[_0x7147('0x3e')]({},_0xe3851b,_0x16f0e9[_0x7147('0x3f')]);return db[_0x7147('0x41')]['find'](_0xe3851b)[_0x7147('0x21')](handleEntityNotFound(_0x15326,null))[_0x7147('0x21')](respondWithResult(_0x15326,null))[_0x7147('0x45')](handleError(_0x15326,null));};exports[_0x7147('0x48')]=function(_0x4c163f,_0x4f37bf){return db[_0x7147('0x41')][_0x7147('0x48')](_0x4c163f[_0x7147('0x49')],{})['then'](function(_0x5709c1){var _0x825217=_0x4c163f['user'][_0x7147('0x23')]({'plain':!![]});if(!_0x825217)throw new Error(_0x7147('0x4a'));if(_0x825217['role']==='user'){var _0x5d204b=_0x5709c1[_0x7147('0x23')]({'plain':!![]});var _0x1df3ba=_0x7147('0x24');return db[_0x7147('0x4b')]['find']({'where':{'name':_0x1df3ba,'userProfileId':_0x825217[_0x7147('0x4c')]},'raw':!![]})['then'](function(_0x1d4f8f){if(_0x1d4f8f&&_0x1d4f8f[_0x7147('0x4d')]===0x0){return db[_0x7147('0x25')]['create']({'name':_0x5d204b[_0x7147('0x28')],'resourceId':_0x5d204b['id'],'type':_0x1d4f8f[_0x7147('0x28')],'sectionId':_0x1d4f8f['id']},{})['then'](function(){return _0x5709c1;});}else{return _0x5709c1;}})[_0x7147('0x45')](function(_0x40a5d9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40a5d9);throw _0x40a5d9;});}return _0x5709c1;})[_0x7147('0x21')](respondWithResult(_0x4f37bf,0xc9))['catch'](handleError(_0x4f37bf,null));};exports[_0x7147('0x4e')]=function(_0x2aed53,_0x5a70d8){var _0x51dab1={'where':{'id':_0x2aed53[_0x7147('0x47')]['id']}},_0x15cc7c={};_0x15cc7c[_0x7147('0x2f')]=_[_0x7147('0x32')](db['Campaign'][_0x7147('0x2b')]);_0x51dab1[_0x7147('0x34')]=_['intersection'](_0x15cc7c[_0x7147('0x2f')],qs['fields'](_0x2aed53[_0x7147('0x31')]['fields']));_0x51dab1[_0x7147('0x34')]=_0x51dab1[_0x7147('0x34')][_0x7147('0x36')]?_0x51dab1['attributes']:_0x15cc7c['model'];if(_0x2aed53[_0x7147('0x31')][_0x7147('0x42')]){_0x51dab1['include']=[{'all':!![]}];}_0x51dab1=_['merge']({},_0x51dab1,_0x2aed53['options']);return db[_0x7147('0x41')][_0x7147('0x4f')](_0x51dab1)[_0x7147('0x21')](handleEntityNotFound(_0x5a70d8,null))[_0x7147('0x21')](function(_0x505a22){if(_0x505a22){var _0x9f0dfa=_0x505a22['get']({'plain':!![]});_0x9f0dfa=qs[_0x7147('0x50')](_0x9f0dfa,['id',_0x7147('0x51'),_0x7147('0x52')]);_0x2aed53[_0x7147('0x49')]=_['omit'](_0x2aed53[_0x7147('0x49')],['id',_0x7147('0x51'),_0x7147('0x52')]);return db[_0x7147('0x41')][_0x7147('0x48')](_[_0x7147('0x3e')](_0x9f0dfa,_0x2aed53[_0x7147('0x49')]),{'include':_0x2aed53[_0x7147('0x31')][_0x7147('0x42')]?[{'all':!![]}]:undefined})[_0x7147('0x21')](function(_0x540bfa){var _0x4aa4e8=_0x2aed53[_0x7147('0x53')][_0x7147('0x23')]({'plain':!![]});if(!_0x4aa4e8)throw new Error(_0x7147('0x4a'));if(_0x4aa4e8['role']===_0x7147('0x53')){var _0x488bc7=_0x540bfa[_0x7147('0x23')]({'plain':!![]});var _0x1add4a=_0x7147('0x24');return db[_0x7147('0x4b')][_0x7147('0x4f')]({'where':{'name':_0x1add4a,'userProfileId':_0x4aa4e8[_0x7147('0x4c')]},'raw':!![]})[_0x7147('0x21')](function(_0xcebce9){if(_0xcebce9&&_0xcebce9[_0x7147('0x4d')]===0x0){return db[_0x7147('0x25')]['create']({'name':_0x488bc7[_0x7147('0x28')],'resourceId':_0x488bc7['id'],'type':_0xcebce9[_0x7147('0x28')],'sectionId':_0xcebce9['id']},{})[_0x7147('0x21')](function(){return _0x540bfa;});}else{return _0x540bfa;}})[_0x7147('0x45')](function(_0x160b14){logger[_0x7147('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x160b14);throw _0x160b14;});}return _0x540bfa;});}})[_0x7147('0x21')](respondWithResult(_0x5a70d8,0xc9))[_0x7147('0x45')](handleError(_0x5a70d8,null));};exports['update']=function(_0x1316d6,_0x341ed0){if(_0x1316d6[_0x7147('0x49')]['id']){delete _0x1316d6['body']['id'];}return db[_0x7147('0x41')]['find']({'where':{'id':_0x1316d6[_0x7147('0x47')]['id']}})[_0x7147('0x21')](handleEntityNotFound(_0x341ed0,null))['then'](saveUpdates(_0x1316d6[_0x7147('0x49')],null))[_0x7147('0x21')](respondWithResult(_0x341ed0,null))[_0x7147('0x45')](handleError(_0x341ed0,null));};exports[_0x7147('0x22')]=function(_0x5d7ade,_0xddcac8){return db[_0x7147('0x41')]['find']({'where':{'id':_0x5d7ade[_0x7147('0x47')]['id']}})[_0x7147('0x21')](handleEntityNotFound(_0xddcac8,null))[_0x7147('0x21')](removeEntity(_0xddcac8,null))[_0x7147('0x45')](handleError(_0xddcac8,null));};exports[_0x7147('0x54')]=function(_0x33ff8b,_0x539c19,_0x2f6bb8){var _0x535c79={'raw':!![],'where':{}};var _0x5249a6={};var _0x32df3f={'count':0x0,'rows':[]};return db[_0x7147('0x41')]['findOne']({'where':{'id':_0x33ff8b[_0x7147('0x47')]['id']}})['then'](handleEntityNotFound(_0x539c19,null))['then'](function(_0x4a6721){if(_0x4a6721){_0x5249a6[_0x7147('0x2f')]=_[_0x7147('0x32')](db[_0x7147('0x55')][_0x7147('0x2b')]);_0x5249a6[_0x7147('0x31')]=_[_0x7147('0x32')](_0x33ff8b[_0x7147('0x31')]);_0x5249a6['filters']=_[_0x7147('0x33')](_0x5249a6[_0x7147('0x2f')],_0x5249a6[_0x7147('0x31')]);_0x535c79[_0x7147('0x34')]=_['intersection'](_0x5249a6['model'],qs[_0x7147('0x35')](_0x33ff8b['query'][_0x7147('0x35')]));_0x535c79[_0x7147('0x34')]=_0x535c79[_0x7147('0x34')][_0x7147('0x36')]?_0x535c79[_0x7147('0x34')]:_0x5249a6[_0x7147('0x2f')];if(!_0x33ff8b[_0x7147('0x31')][_0x7147('0x37')]('nolimit')){_0x535c79[_0x7147('0x1a')]=qs['limit'](_0x33ff8b[_0x7147('0x31')]['limit']);_0x535c79['offset']=qs[_0x7147('0x1c')](_0x33ff8b[_0x7147('0x31')][_0x7147('0x1c')]);}_0x535c79[_0x7147('0x39')]=qs[_0x7147('0x3a')](_0x33ff8b[_0x7147('0x31')][_0x7147('0x3a')]);_0x535c79[_0x7147('0x40')]=qs[_0x7147('0x3b')](_[_0x7147('0x3c')](_0x33ff8b['query'],_0x5249a6[_0x7147('0x3b')]));_0x535c79[_0x7147('0x40')]['CampaignId']=_0x4a6721['id'];if(_0x33ff8b[_0x7147('0x31')]['filter']){_0x535c79[_0x7147('0x40')]=_[_0x7147('0x3e')](_0x535c79[_0x7147('0x40')],{'$or':_[_0x7147('0x30')](_0x535c79['attributes'],function(_0x41c29b){var _0x148420={};_0x148420[_0x41c29b]={'$like':'%'+_0x33ff8b['query'][_0x7147('0x3d')]+'%'};return _0x148420;})});}_0x535c79=_[_0x7147('0x3e')]({},_0x535c79,_0x33ff8b[_0x7147('0x3f')]);return db['CmHopper'][_0x7147('0x1b')]({'where':_0x535c79[_0x7147('0x40')]})[_0x7147('0x21')](function(_0x4c1df0){_0x32df3f[_0x7147('0x1b')]=_0x4c1df0;if(_0x33ff8b[_0x7147('0x31')][_0x7147('0x42')]){_0x535c79['include']=[{'all':!![]}];}return db[_0x7147('0x55')][_0x7147('0x56')](_0x535c79);})[_0x7147('0x21')](function(_0x247d73){_0x32df3f[_0x7147('0x44')]=_0x247d73;return _0x32df3f;});}})[_0x7147('0x21')](respondWithFilteredResult(_0x539c19,_0x535c79))[_0x7147('0x45')](handleError(_0x539c19,null));};exports[_0x7147('0x57')]=function(_0xcd081a,_0x1dd167,_0x104ab1){var _0x52334e={'raw':!![],'where':{}};var _0x1bbd0c={};var _0x1fe851={'count':0x0,'rows':[]};return db[_0x7147('0x41')][_0x7147('0x58')]({'where':{'id':_0xcd081a[_0x7147('0x47')]['id']}})[_0x7147('0x21')](handleEntityNotFound(_0x1dd167,null))[_0x7147('0x21')](function(_0x263f6a){if(_0x263f6a){_0x1bbd0c['model']=_[_0x7147('0x32')](db['CmHopperHistory'][_0x7147('0x2b')]);_0x1bbd0c[_0x7147('0x31')]=_[_0x7147('0x32')](_0xcd081a[_0x7147('0x31')]);_0x1bbd0c[_0x7147('0x3b')]=_[_0x7147('0x33')](_0x1bbd0c[_0x7147('0x2f')],_0x1bbd0c[_0x7147('0x31')]);_0x52334e[_0x7147('0x34')]=_[_0x7147('0x33')](_0x1bbd0c[_0x7147('0x2f')],qs[_0x7147('0x35')](_0xcd081a[_0x7147('0x31')][_0x7147('0x35')]));_0x52334e[_0x7147('0x34')]=_0x52334e[_0x7147('0x34')][_0x7147('0x36')]?_0x52334e[_0x7147('0x34')]:_0x1bbd0c[_0x7147('0x2f')];if(!_0xcd081a[_0x7147('0x31')][_0x7147('0x37')](_0x7147('0x38'))){_0x52334e[_0x7147('0x1a')]=qs['limit'](_0xcd081a[_0x7147('0x31')][_0x7147('0x1a')]);_0x52334e['offset']=qs[_0x7147('0x1c')](_0xcd081a[_0x7147('0x31')][_0x7147('0x1c')]);}_0x52334e[_0x7147('0x39')]=qs[_0x7147('0x3a')](_0xcd081a[_0x7147('0x31')]['sort']);_0x52334e['where']=qs[_0x7147('0x3b')](_[_0x7147('0x3c')](_0xcd081a[_0x7147('0x31')],_0x1bbd0c[_0x7147('0x3b')]));_0x52334e[_0x7147('0x40')][_0x7147('0x59')]=_0x263f6a['id'];if(_0xcd081a['query'][_0x7147('0x3d')]){_0x52334e[_0x7147('0x40')]=_[_0x7147('0x3e')](_0x52334e[_0x7147('0x40')],{'$or':_[_0x7147('0x30')](_0x52334e[_0x7147('0x34')],function(_0x5b5658){var _0x20cb31={};_0x20cb31[_0x5b5658]={'$like':'%'+_0xcd081a[_0x7147('0x31')][_0x7147('0x3d')]+'%'};return _0x20cb31;})});}_0x52334e=_['merge']({},_0x52334e,_0xcd081a[_0x7147('0x3f')]);return db['CmHopperHistory'][_0x7147('0x1b')]({'where':_0x52334e[_0x7147('0x40')]})[_0x7147('0x21')](function(_0x55933d){_0x1fe851[_0x7147('0x1b')]=_0x55933d;if(_0xcd081a[_0x7147('0x31')][_0x7147('0x42')]){_0x52334e[_0x7147('0x43')]=[{'all':!![]}];}return db[_0x7147('0x5a')][_0x7147('0x56')](_0x52334e);})[_0x7147('0x21')](function(_0x2e952e){_0x1fe851[_0x7147('0x44')]=_0x2e952e;return _0x1fe851;});}})[_0x7147('0x21')](respondWithFilteredResult(_0x1dd167,_0x52334e))[_0x7147('0x45')](handleError(_0x1dd167,null));};exports[_0x7147('0x5b')]=function(_0x44af2c,_0x31e776,_0x4966c9){var _0x36cd3d={'raw':!![],'where':{}};var _0x454d1b={};var _0x5c83ce={'count':0x0,'rows':[]};return db['Campaign'][_0x7147('0x58')]({'where':{'id':_0x44af2c[_0x7147('0x47')]['id']}})[_0x7147('0x21')](handleEntityNotFound(_0x31e776,null))[_0x7147('0x21')](function(_0x590dd0){if(_0x590dd0){_0x454d1b[_0x7147('0x2f')]=_[_0x7147('0x32')](db[_0x7147('0x5c')]['rawAttributes']);_0x454d1b[_0x7147('0x31')]=_['keys'](_0x44af2c[_0x7147('0x31')]);_0x454d1b['filters']=_[_0x7147('0x33')](_0x454d1b[_0x7147('0x2f')],_0x454d1b['query']);_0x36cd3d[_0x7147('0x34')]=_[_0x7147('0x33')](_0x454d1b[_0x7147('0x2f')],qs[_0x7147('0x35')](_0x44af2c[_0x7147('0x31')][_0x7147('0x35')]));_0x36cd3d[_0x7147('0x34')]=_0x36cd3d[_0x7147('0x34')][_0x7147('0x36')]?_0x36cd3d[_0x7147('0x34')]:_0x454d1b['model'];if(!_0x44af2c[_0x7147('0x31')]['hasOwnProperty'](_0x7147('0x38'))){_0x36cd3d['limit']=qs[_0x7147('0x1a')](_0x44af2c[_0x7147('0x31')]['limit']);_0x36cd3d['offset']=qs[_0x7147('0x1c')](_0x44af2c['query'][_0x7147('0x1c')]);}_0x36cd3d[_0x7147('0x39')]=qs[_0x7147('0x3a')](_0x44af2c[_0x7147('0x31')]['sort']);_0x36cd3d['where']=qs[_0x7147('0x3b')](_[_0x7147('0x3c')](_0x44af2c[_0x7147('0x31')],_0x454d1b[_0x7147('0x3b')]));_0x36cd3d[_0x7147('0x40')][_0x7147('0x59')]=_0x590dd0['id'];if(_0x44af2c[_0x7147('0x31')][_0x7147('0x3d')]){_0x36cd3d[_0x7147('0x40')]=_['merge'](_0x36cd3d['where'],{'$or':_['map'](_0x36cd3d[_0x7147('0x34')],function(_0x4caa58){var _0x133cff={};_0x133cff[_0x4caa58]={'$like':'%'+_0x44af2c[_0x7147('0x31')]['filter']+'%'};return _0x133cff;})});}_0x36cd3d=_[_0x7147('0x3e')]({},_0x36cd3d,_0x44af2c[_0x7147('0x3f')]);return db[_0x7147('0x5c')][_0x7147('0x1b')]({'where':_0x36cd3d[_0x7147('0x40')]})[_0x7147('0x21')](function(_0x21beaa){_0x5c83ce[_0x7147('0x1b')]=_0x21beaa;if(_0x44af2c[_0x7147('0x31')][_0x7147('0x42')]){_0x36cd3d[_0x7147('0x43')]=[{'all':!![]}];}return db[_0x7147('0x5c')][_0x7147('0x56')](_0x36cd3d);})[_0x7147('0x21')](function(_0x56109d){_0x5c83ce[_0x7147('0x44')]=_0x56109d;return _0x5c83ce;});}})[_0x7147('0x21')](respondWithFilteredResult(_0x31e776,_0x36cd3d))[_0x7147('0x45')](handleError(_0x31e776,null));};exports[_0x7147('0x5d')]=function(_0x406111,_0x48d254,_0x28b50a){var _0x24ec6f={'raw':!![],'where':{}};var _0x47b2aa={};var _0x1a1949={'count':0x0,'rows':[]};return db[_0x7147('0x41')]['findOne']({'where':{'id':_0x406111[_0x7147('0x47')]['id']}})[_0x7147('0x21')](handleEntityNotFound(_0x48d254,null))[_0x7147('0x21')](function(_0x4383bd){if(_0x4383bd){_0x47b2aa[_0x7147('0x2f')]=_[_0x7147('0x32')](db['CmHopperBlack'][_0x7147('0x2b')]);_0x47b2aa[_0x7147('0x31')]=_['keys'](_0x406111[_0x7147('0x31')]);_0x47b2aa[_0x7147('0x3b')]=_[_0x7147('0x33')](_0x47b2aa[_0x7147('0x2f')],_0x47b2aa['query']);_0x24ec6f[_0x7147('0x34')]=_[_0x7147('0x33')](_0x47b2aa[_0x7147('0x2f')],qs[_0x7147('0x35')](_0x406111[_0x7147('0x31')][_0x7147('0x35')]));_0x24ec6f[_0x7147('0x34')]=_0x24ec6f[_0x7147('0x34')][_0x7147('0x36')]?_0x24ec6f[_0x7147('0x34')]:_0x47b2aa[_0x7147('0x2f')];if(!_0x406111[_0x7147('0x31')]['hasOwnProperty'](_0x7147('0x38'))){_0x24ec6f[_0x7147('0x1a')]=qs[_0x7147('0x1a')](_0x406111['query']['limit']);_0x24ec6f[_0x7147('0x1c')]=qs['offset'](_0x406111[_0x7147('0x31')]['offset']);}_0x24ec6f[_0x7147('0x39')]=qs['sort'](_0x406111[_0x7147('0x31')]['sort']);_0x24ec6f['where']=qs[_0x7147('0x3b')](_[_0x7147('0x3c')](_0x406111[_0x7147('0x31')],_0x47b2aa['filters']));_0x24ec6f[_0x7147('0x40')][_0x7147('0x59')]=_0x4383bd['id'];if(_0x406111[_0x7147('0x31')][_0x7147('0x3d')]){_0x24ec6f['where']=_['merge'](_0x24ec6f['where'],{'$or':_[_0x7147('0x30')](_0x24ec6f[_0x7147('0x34')],function(_0x1b4e46){var _0x2b32ba={};_0x2b32ba[_0x1b4e46]={'$like':'%'+_0x406111[_0x7147('0x31')][_0x7147('0x3d')]+'%'};return _0x2b32ba;})});}_0x24ec6f=_[_0x7147('0x3e')]({},_0x24ec6f,_0x406111[_0x7147('0x3f')]);return db[_0x7147('0x5e')][_0x7147('0x1b')]({'where':_0x24ec6f[_0x7147('0x40')]})[_0x7147('0x21')](function(_0x36dda){_0x1a1949[_0x7147('0x1b')]=_0x36dda;if(_0x406111[_0x7147('0x31')][_0x7147('0x42')]){_0x24ec6f[_0x7147('0x43')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x7147('0x56')](_0x24ec6f);})[_0x7147('0x21')](function(_0x1152f1){_0x1a1949[_0x7147('0x44')]=_0x1152f1;return _0x1a1949;});}})[_0x7147('0x21')](respondWithFilteredResult(_0x48d254,_0x24ec6f))['catch'](handleError(_0x48d254,null));};exports[_0x7147('0x5f')]=function(_0x3bbe6b,_0xf9a6b3,_0x27ead3){var _0x48c03a={};var _0x55c8ff={};var _0x4a32f6;var _0xe374da;return db['Campaign'][_0x7147('0x58')]({'where':{'id':_0x3bbe6b[_0x7147('0x47')]['id']}})[_0x7147('0x21')](handleEntityNotFound(_0xf9a6b3,null))[_0x7147('0x21')](function(_0x247440){if(_0x247440){_0x4a32f6=_0x247440;_0x55c8ff[_0x7147('0x2f')]=_[_0x7147('0x32')](db[_0x7147('0x60')]['rawAttributes']);_0x55c8ff[_0x7147('0x31')]=_[_0x7147('0x32')](_0x3bbe6b[_0x7147('0x31')]);_0x55c8ff[_0x7147('0x3b')]=_[_0x7147('0x33')](_0x55c8ff['model'],_0x55c8ff['query']);_0x48c03a[_0x7147('0x34')]=_['intersection'](_0x55c8ff[_0x7147('0x2f')],qs[_0x7147('0x35')](_0x3bbe6b[_0x7147('0x31')][_0x7147('0x35')]));_0x48c03a[_0x7147('0x34')]=_0x48c03a['attributes']['length']?_0x48c03a['attributes']:_0x55c8ff['model'];_0x48c03a['order']=qs[_0x7147('0x3a')](_0x3bbe6b['query'][_0x7147('0x3a')]);_0x48c03a['where']=qs[_0x7147('0x3b')](_[_0x7147('0x3c')](_0x3bbe6b[_0x7147('0x31')],_0x55c8ff[_0x7147('0x3b')]));if(_0x3bbe6b['query'][_0x7147('0x3d')]){_0x48c03a[_0x7147('0x40')]=_[_0x7147('0x3e')](_0x48c03a['where'],{'$or':_[_0x7147('0x30')](_0x48c03a[_0x7147('0x34')],function(_0x20f344){var _0x4d5b51={};_0x4d5b51[_0x20f344]={'$like':'%'+_0x3bbe6b[_0x7147('0x31')][_0x7147('0x3d')]+'%'};return _0x4d5b51;})});}_0x48c03a=_[_0x7147('0x3e')]({},_0x48c03a,_0x3bbe6b['options']);return _0x4a32f6['getLists'](_0x48c03a);}})[_0x7147('0x21')](function(_0x381ef7){if(_0x381ef7){_0xe374da=_0x381ef7[_0x7147('0x36')];if(!_0x3bbe6b['query'][_0x7147('0x37')](_0x7147('0x38'))){_0x48c03a['limit']=qs[_0x7147('0x1a')](_0x3bbe6b['query']['limit']);_0x48c03a[_0x7147('0x1c')]=qs[_0x7147('0x1c')](_0x3bbe6b[_0x7147('0x31')][_0x7147('0x1c')]);}return _0x4a32f6[_0x7147('0x5f')](_0x48c03a);}})[_0x7147('0x21')](function(_0x57c24f){if(_0x57c24f){return _0x57c24f?{'count':_0xe374da,'rows':_0x57c24f}:null;}})[_0x7147('0x21')](respondWithResult(_0xf9a6b3,null))[_0x7147('0x45')](handleError(_0xf9a6b3,null));};exports[_0x7147('0x61')]=function(_0x236c71,_0x5707b1,_0x2c89c6){var _0x53b2e6,_0x5425de;var _0x5deffa=[];var _0x1feb73=moment()[_0x7147('0x62')](_0x7147('0x63'));return db['Campaign'][_0x7147('0x4f')]({'where':{'id':_0x236c71['params']['id']}})['then'](handleEntityNotFound(_0x5707b1,null))[_0x7147('0x21')](function(_0x1d7052){if(_0x1d7052){_0x5425de=_0x1d7052;return _0x1d7052[_0x7147('0x61')](_0x236c71[_0x7147('0x49')][_0x7147('0x64')],_['omit'](_0x236c71[_0x7147('0x49')],[_0x7147('0x64'),'id'])||{});}return null;})['spread'](function(_0x2cf7fb){var _0xd91b27;var _0xeb9c37;_0x53b2e6=_0x2cf7fb||[];var _0x32f861=[];if(_0x2cf7fb){for(var _0x2fd2ba=0x0;_0x2fd2ba<_0x2cf7fb['length'];_0x2fd2ba+=0x1){var _0x1f9b34=_0x2cf7fb[_0x2fd2ba][_0x7147('0x23')]({'plain':!![]});_0x5425de[_0x7147('0x65')]=_0x236c71['body'][_0x7147('0x65')]?_0x236c71['body']['dialCheckDuplicateType']:_0x5425de[_0x7147('0x65')];switch(_0x5425de['dialCheckDuplicateType']){case'always':_0xd91b27=squel[_0x7147('0x66')]()['into'](_0x7147('0x67'))[_0x7147('0x68')]([_0x7147('0x69'),'scheduledAt','ContactId',_0x7147('0x6a'),_0x7147('0x59'),_0x7147('0x51'),_0x7147('0x52')],squel[_0x7147('0x6b')]()[_0x7147('0x6c')](_0x7147('0x69'),'phone')[_0x7147('0x6c')](_0x7147('0x6d'),'scheduledAt')['field']('id','ContactId')[_0x7147('0x6c')](_0x1f9b34['CmListId'][_0x7147('0x6e')](),_0x7147('0x6a'))[_0x7147('0x6c')](_0x236c71[_0x7147('0x47')]['id'][_0x7147('0x6e')](),'CampaignId')[_0x7147('0x6c')]('\x27'+_0x1feb73+'\x27',_0x7147('0x51'))[_0x7147('0x6c')]('\x27'+_0x1feb73+'\x27',_0x7147('0x52'))[_0x7147('0x6f')](_0x7147('0x70'))[_0x7147('0x40')](_0x7147('0x71'))[_0x7147('0x40')](_0x7147('0x72'),_0x1f9b34[_0x7147('0x73')][_0x7147('0x6e')]())[_0x7147('0x40')](_0x7147('0x74'))[_0x7147('0x40')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7147('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x7147('0x6f')](_0x7147('0x75'))['where'](_0x7147('0x76'),_0x236c71['params']['id']['toString']()))[_0x7147('0x40')](_0x7147('0x77'),squel[_0x7147('0x6b')]()[_0x7147('0x6c')](_0x7147('0x78'))[_0x7147('0x6f')](_0x7147('0x67'))[_0x7147('0x40')]('CampaignId\x20=\x20?',_0x236c71[_0x7147('0x47')]['id'][_0x7147('0x6e')]())))[_0x7147('0x6e')]();break;case _0x7147('0x79'):_0xd91b27=squel[_0x7147('0x66')]()['into'](_0x7147('0x67'))[_0x7147('0x68')]([_0x7147('0x69'),_0x7147('0x7a'),_0x7147('0x7b'),'ListId',_0x7147('0x59'),_0x7147('0x51'),_0x7147('0x52')],squel[_0x7147('0x6b')]()[_0x7147('0x6c')](_0x7147('0x69'),_0x7147('0x69'))[_0x7147('0x6c')]('NOW()',_0x7147('0x7a'))[_0x7147('0x6c')]('id',_0x7147('0x7b'))[_0x7147('0x6c')](_0x1f9b34['CmListId'][_0x7147('0x6e')](),_0x7147('0x6a'))[_0x7147('0x6c')](_0x236c71['params']['id']['toString'](),_0x7147('0x59'))[_0x7147('0x6c')]('\x27'+_0x1feb73+'\x27',_0x7147('0x51'))[_0x7147('0x6c')]('\x27'+_0x1feb73+'\x27',_0x7147('0x52'))[_0x7147('0x6f')](_0x7147('0x70'))[_0x7147('0x40')](_0x7147('0x71'))[_0x7147('0x40')]('ListId\x20=\x20?',_0x1f9b34[_0x7147('0x73')][_0x7147('0x6e')]())['where'](_0x7147('0x74'))[_0x7147('0x40')](_0x7147('0x77'),squel[_0x7147('0x6b')]()[_0x7147('0x6c')](_0x7147('0x78'))[_0x7147('0x6f')](_0x7147('0x67'))[_0x7147('0x40')](_0x7147('0x76'),_0x236c71[_0x7147('0x47')]['id'][_0x7147('0x6e')]())))[_0x7147('0x6e')]();break;default:_0xd91b27=squel['insert']()[_0x7147('0x7c')](_0x7147('0x67'))[_0x7147('0x68')]([_0x7147('0x69'),'scheduledAt',_0x7147('0x7b'),_0x7147('0x6a'),'CampaignId',_0x7147('0x51'),_0x7147('0x52')],squel[_0x7147('0x6b')]()[_0x7147('0x6c')](_0x7147('0x69'),_0x7147('0x69'))[_0x7147('0x6c')](_0x7147('0x6d'),_0x7147('0x7a'))['field']('id',_0x7147('0x7b'))[_0x7147('0x6c')](_0x1f9b34[_0x7147('0x73')][_0x7147('0x6e')](),'ListId')[_0x7147('0x6c')](_0x236c71[_0x7147('0x47')]['id']['toString'](),_0x7147('0x59'))['field']('\x27'+_0x1feb73+'\x27','createdAt')[_0x7147('0x6c')]('\x27'+_0x1feb73+'\x27','updatedAt')[_0x7147('0x6f')](_0x7147('0x70'))[_0x7147('0x40')](_0x7147('0x71'))[_0x7147('0x40')](_0x7147('0x72'),_0x1f9b34[_0x7147('0x73')]['toString']())[_0x7147('0x40')](_0x7147('0x74')))[_0x7147('0x6e')]();}_0xeb9c37=squel[_0x7147('0x66')]()[_0x7147('0x7c')](_0x7147('0x7d'))['fromQuery']([_0x7147('0x7e'),'scheduledAt','phone','OrderBy',_0x7147('0x51'),_0x7147('0x52')],squel[_0x7147('0x6b')]()[_0x7147('0x6c')](_0x7147('0x7f'),'id')[_0x7147('0x6c')](_0x7147('0x6d'),_0x7147('0x7a'))[_0x7147('0x6c')](_0x7147('0x80'),_0x7147('0x69'))['field']('ci.OrderBY','OrderBy')[_0x7147('0x6c')]('\x27'+_0x1feb73+'\x27',_0x7147('0x51'))['field']('\x27'+_0x1feb73+'\x27',_0x7147('0x52'))[_0x7147('0x6f')](_0x7147('0x81'),'ci')[_0x7147('0x82')](_0x7147('0x67'),'h',_0x7147('0x83'))[_0x7147('0x40')](_0x7147('0x84'),_0x1f9b34[_0x7147('0x73')]['toString']())[_0x7147('0x40')](_0x7147('0x85'),_0x236c71[_0x7147('0x47')]['id'][_0x7147('0x6e')]())['where']('h.createdAt\x20=\x20?',_0x1feb73))[_0x7147('0x6e')]();_0x32f861[_0x7147('0x86')](db[_0x7147('0x87')]['query'](_0xd91b27));_0x5deffa['push'](db[_0x7147('0x87')][_0x7147('0x31')](_0xeb9c37));}return BPromise[_0x7147('0x88')](_0x32f861);}})['then'](function(){return BPromise['all'](_0x5deffa);})['then'](function(){return _0x53b2e6;})['then'](respondWithResult(_0x5707b1,null))['catch'](handleError(_0x5707b1,null));};exports['removeLists']=function(_0x41111f,_0xfd3593,_0x2b2488){return db['Campaign'][_0x7147('0x4f')]({'where':{'id':_0x41111f['params']['id']}})[_0x7147('0x21')](handleEntityNotFound(_0xfd3593,null))[_0x7147('0x21')](function(_0x4d947a){if(_0x4d947a){return _0x4d947a[_0x7147('0x89')](_0x41111f[_0x7147('0x31')]['ids']);}})[_0x7147('0x21')](function(_0x1e6dd9){if(_0x1e6dd9){return db[_0x7147('0x55')][_0x7147('0x22')]({'where':{'ListId':_0x41111f[_0x7147('0x31')]['ids'],'CampaignId':_0x41111f['params']['id']}})[_0x7147('0x21')](function(){return _0x1e6dd9;});}})[_0x7147('0x21')](respondWithStatusCode(_0xfd3593,null))[_0x7147('0x45')](handleError(_0xfd3593,null));};exports['getBlackLists']=function(_0x5649e6,_0x5941a8,_0x4454ab){var _0x54309c={};var _0x51f28c={};var _0x5debdc;var _0x1fbff9;return db[_0x7147('0x41')][_0x7147('0x58')]({'where':{'id':_0x5649e6['params']['id']}})[_0x7147('0x21')](handleEntityNotFound(_0x5941a8,null))[_0x7147('0x21')](function(_0x4fb58f){if(_0x4fb58f){_0x5debdc=_0x4fb58f;_0x51f28c[_0x7147('0x2f')]=_['keys'](db[_0x7147('0x60')]['rawAttributes']);_0x51f28c[_0x7147('0x31')]=_[_0x7147('0x32')](_0x5649e6[_0x7147('0x31')]);_0x51f28c[_0x7147('0x3b')]=_[_0x7147('0x33')](_0x51f28c[_0x7147('0x2f')],_0x51f28c['query']);_0x54309c[_0x7147('0x34')]=_[_0x7147('0x33')](_0x51f28c[_0x7147('0x2f')],qs['fields'](_0x5649e6['query']['fields']));_0x54309c[_0x7147('0x34')]=_0x54309c[_0x7147('0x34')]['length']?_0x54309c[_0x7147('0x34')]:_0x51f28c[_0x7147('0x2f')];_0x54309c[_0x7147('0x39')]=qs['sort'](_0x5649e6[_0x7147('0x31')]['sort']);_0x54309c['where']=qs[_0x7147('0x3b')](_[_0x7147('0x3c')](_0x5649e6['query'],_0x51f28c[_0x7147('0x3b')]));if(_0x5649e6[_0x7147('0x31')][_0x7147('0x3d')]){_0x54309c[_0x7147('0x40')]=_['merge'](_0x54309c[_0x7147('0x40')],{'$or':_[_0x7147('0x30')](_0x54309c[_0x7147('0x34')],function(_0xb3496d){var _0x3def56={};_0x3def56[_0xb3496d]={'$like':'%'+_0x5649e6[_0x7147('0x31')][_0x7147('0x3d')]+'%'};return _0x3def56;})});}_0x54309c=_['merge']({},_0x54309c,_0x5649e6[_0x7147('0x3f')]);return _0x5debdc[_0x7147('0x8a')](_0x54309c);}})['then'](function(_0x28fb05){if(_0x28fb05){_0x1fbff9=_0x28fb05[_0x7147('0x36')];if(!_0x5649e6[_0x7147('0x31')]['hasOwnProperty'](_0x7147('0x38'))){_0x54309c[_0x7147('0x1a')]=qs['limit'](_0x5649e6[_0x7147('0x31')][_0x7147('0x1a')]);_0x54309c[_0x7147('0x1c')]=qs[_0x7147('0x1c')](_0x5649e6['query'][_0x7147('0x1c')]);}return _0x5debdc[_0x7147('0x8a')](_0x54309c);}})[_0x7147('0x21')](function(_0x3922f4){if(_0x3922f4){return _0x3922f4?{'count':_0x1fbff9,'rows':_0x3922f4}:null;}})[_0x7147('0x21')](respondWithResult(_0x5941a8,null))['catch'](handleError(_0x5941a8,null));};exports[_0x7147('0x8b')]=function(_0x2eb2db,_0x3ba24f,_0x44dd79){var _0x4684c2,_0x349031;var _0x3f3f7d=[];var _0x370da0=moment()[_0x7147('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x7147('0x41')]['find']({'where':{'id':_0x2eb2db[_0x7147('0x47')]['id']}})[_0x7147('0x21')](handleEntityNotFound(_0x3ba24f,null))[_0x7147('0x21')](function(_0x60ed4d){if(_0x60ed4d){_0x349031=_0x60ed4d;return _0x60ed4d[_0x7147('0x8b')](_0x2eb2db[_0x7147('0x49')][_0x7147('0x64')],_['omit'](_0x2eb2db[_0x7147('0x49')],['ids','id'])||{});}return null;})[_0x7147('0x8c')](function(_0x43063c){var _0x452e8f;var _0x3e6f89;_0x4684c2=_0x43063c||[];var _0x441242=[];if(_0x43063c){for(var _0x478b55=0x0;_0x478b55<_0x43063c[_0x7147('0x36')];_0x478b55+=0x1){var _0x1855ad=_0x43063c[_0x478b55]['get']({'plain':!![]});_0x452e8f=squel['insert']()[_0x7147('0x7c')]('cm_hopper_black')[_0x7147('0x68')](['phone',_0x7147('0x7b'),_0x7147('0x6a'),_0x7147('0x59'),'createdAt','updatedAt'],squel['select']()[_0x7147('0x6c')]('phone',_0x7147('0x69'))[_0x7147('0x6c')]('id',_0x7147('0x7b'))[_0x7147('0x6c')](_0x1855ad[_0x7147('0x73')][_0x7147('0x6e')](),_0x7147('0x6a'))[_0x7147('0x6c')](_0x2eb2db[_0x7147('0x47')]['id'][_0x7147('0x6e')](),_0x7147('0x59'))[_0x7147('0x6c')](_0x7147('0x6d'),_0x7147('0x51'))[_0x7147('0x6c')](_0x7147('0x6d'),_0x7147('0x52'))[_0x7147('0x6f')](_0x7147('0x70'))['where']('deletedAt\x20IS\x20NULL')[_0x7147('0x40')]('ListId\x20=\x20?',_0x1855ad[_0x7147('0x73')][_0x7147('0x6e')]())[_0x7147('0x40')](_0x7147('0x74')))['toString']();_0x441242['push'](db[_0x7147('0x87')][_0x7147('0x31')](_0x452e8f));}return BPromise[_0x7147('0x88')](_0x441242);}})['then'](function(){return _0x4684c2;})[_0x7147('0x21')](respondWithResult(_0x3ba24f,null))[_0x7147('0x45')](handleError(_0x3ba24f,null));};exports['removeBlackLists']=function(_0x41814c,_0x5e5738,_0x259cb0){return db[_0x7147('0x41')][_0x7147('0x4f')]({'where':{'id':_0x41814c['params']['id']}})['then'](handleEntityNotFound(_0x5e5738,null))[_0x7147('0x21')](function(_0x18ad42){if(_0x18ad42){return _0x18ad42['removeBlackLists'](_0x41814c[_0x7147('0x31')]['ids']);}})[_0x7147('0x21')](function(_0x375f1d){if(_0x375f1d){return db[_0x7147('0x5e')][_0x7147('0x22')]({'where':{'ListId':_0x41814c[_0x7147('0x31')][_0x7147('0x64')],'CampaignId':_0x41814c['params']['id']}})['then'](function(){return _0x375f1d;});}})['then'](respondWithStatusCode(_0x5e5738,null))['catch'](handleError(_0x5e5738,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 378243e..19d90fe 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9957,0x93));var _0x7995=function(_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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4b727f,_0x47e390){var _0xe51025=function(_0x36cb55){while(--_0x36cb55){_0x4b727f['push'](_0x4b727f['shift']());}};_0xe51025(++_0x47e390);}(_0x7a54,0x106));var _0x47a5=function(_0x86a861,_0x131f18){_0x86a861=_0x86a861-0x0;var _0x3e4199=_0x7a54[_0x86a861];return _0x3e4199;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index dfb82ab..944fcd0 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 _0xf6fb=['map','model','debug','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','attributes','limit','include'];(function(_0x271b53,_0x48386e){var _0x8660ef=function(_0x3f8886){while(--_0x3f8886){_0x271b53['push'](_0x271b53['shift']());}};_0x8660ef(++_0x48386e);}(_0xf6fb,0x111));var _0xbf6f=function(_0x3d62c4,_0x134b8c){_0x3d62c4=_0x3d62c4-0x0;var _0x114fef=_0xf6fb[_0x3d62c4];return _0x114fef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf6f('0x0'));var BPromise=require(_0xbf6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf6f('0x2'));var db=require(_0xbf6f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf6f('0x4'))('rpc');var config=require(_0xbf6f('0x5'));var jayson=require(_0xbf6f('0x6'));var client=jayson[_0xbf6f('0x7')][_0xbf6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d8ecf,_0x26bc7b,_0x9d0c63){return new BPromise(function(_0x43d56b,_0x5948cf){return client[_0xbf6f('0x9')](_0x3d8ecf,_0x9d0c63)[_0xbf6f('0xa')](function(_0x2ac2f8){logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,'request\x20sent');logger['debug'](_0xbf6f('0xd'),_0x26bc7b,_0xbf6f('0xe'),JSON[_0xbf6f('0xf')](_0x2ac2f8));if(_0x2ac2f8['error']){if(_0x2ac2f8[_0xbf6f('0x10')]['code']===0x1f4){logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')]['message']);return _0x5948cf(_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);}logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);return _0x43d56b(_0x2ac2f8['error'][_0xbf6f('0x11')]);}else{logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,_0xbf6f('0xe'));_0x43d56b(_0x2ac2f8[_0xbf6f('0x12')][_0xbf6f('0x11')]);}})[_0xbf6f('0x13')](function(_0x586f33){logger['error'](_0xbf6f('0xc'),_0x26bc7b,_0x586f33);_0x5948cf(_0x586f33);});});}exports[_0xbf6f('0x14')]=function(_0x21b485){var _0x4b3c33=this;return new Promise(function(_0x56b4da,_0x2a0537){return db[_0xbf6f('0x15')][_0xbf6f('0x16')]({'raw':_0x21b485[_0xbf6f('0x17')]?_0x21b485[_0xbf6f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x21b485['options']?_0x21b485[_0xbf6f('0x17')]['where']||null:null,'attributes':_0x21b485[_0xbf6f('0x17')]?_0x21b485[_0xbf6f('0x17')][_0xbf6f('0x18')]||null:null,'limit':_0x21b485['options']?_0x21b485[_0xbf6f('0x17')][_0xbf6f('0x19')]||null:null,'include':_0x21b485[_0xbf6f('0x17')]?_0x21b485['options'][_0xbf6f('0x1a')]?_['map'](_0x21b485[_0xbf6f('0x17')][_0xbf6f('0x1a')],function(_0xba4b6a){return{'model':db[_0xba4b6a['model']],'as':_0xba4b6a['as'],'attributes':_0xba4b6a[_0xbf6f('0x18')],'include':_0xba4b6a[_0xbf6f('0x1a')]?_[_0xbf6f('0x1b')](_0xba4b6a[_0xbf6f('0x1a')],function(_0x44d47f){return{'model':db[_0x44d47f[_0xbf6f('0x1c')]],'as':_0x44d47f['as'],'attributes':_0x44d47f['attributes'],'include':_0x44d47f[_0xbf6f('0x1a')]?_[_0xbf6f('0x1b')](_0x44d47f['include'],function(_0x506302){return{'model':db[_0x506302['model']],'as':_0x506302['as'],'attributes':_0x506302[_0xbf6f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3588c0){logger[_0xbf6f('0xb')](_0xbf6f('0x14'),_0x21b485);logger[_0xbf6f('0x1d')](_0xbf6f('0x14'),_0x21b485,JSON[_0xbf6f('0xf')](_0x3588c0));_0x56b4da(_0x3588c0);})[_0xbf6f('0x13')](function(_0x58c120){logger['error'](_0xbf6f('0x14'),_0x58c120[_0xbf6f('0x11')],_0x21b485);_0x2a0537(_0x4b3c33['error'](0x1f4,_0x58c120[_0xbf6f('0x11')]));});});};
\ No newline at end of file
+var _0xad95=['Campaign','findAll','options','attributes','limit','include','map','model','lodash','util','moment','ioredis','../../mysqldb','rpc','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetCampaign'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xad95,0x70));var _0x5ad9=function(_0x33c6ce,_0x1702ff){_0x33c6ce=_0x33c6ce-0x0;var _0x3420fd=_0xad95[_0x33c6ce];return _0x3420fd;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var moment=require(_0x5ad9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ad9('0x3'));var db=require(_0x5ad9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ad9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bef4e,_0x117fde,_0x2a0915){return new BPromise(function(_0x3d937a,_0x404b33){return client['request'](_0x2bef4e,_0x2a0915)[_0x5ad9('0x6')](function(_0x4fdb7b){logger['info'](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));logger[_0x5ad9('0x9')]('Campaign,\x20%s,\x20%s,\x20%s',_0x117fde,_0x5ad9('0x8'),JSON[_0x5ad9('0xa')](_0x4fdb7b));if(_0x4fdb7b['error']){if(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xc')]===0x1f4){logger[_0x5ad9('0xb')](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);return _0x404b33(_0x4fdb7b['error']['message']);}logger['error'](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')]['message']);return _0x3d937a(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);}else{logger[_0x5ad9('0xe')](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));_0x3d937a(_0x4fdb7b[_0x5ad9('0xf')][_0x5ad9('0xd')]);}})[_0x5ad9('0x10')](function(_0x36e61f){logger[_0x5ad9('0xb')]('Campaign,\x20%s,\x20%s',_0x117fde,_0x36e61f);_0x404b33(_0x36e61f);});});}exports[_0x5ad9('0x11')]=function(_0x54f392){var _0x3d1c8f=this;return new Promise(function(_0x28682f,_0xe4171b){return db[_0x5ad9('0x12')][_0x5ad9('0x13')]({'raw':_0x54f392[_0x5ad9('0x14')]?_0x54f392[_0x5ad9('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x54f392[_0x5ad9('0x14')]?_0x54f392['options']['where']||null:null,'attributes':_0x54f392[_0x5ad9('0x14')]?_0x54f392['options'][_0x5ad9('0x15')]||null:null,'limit':_0x54f392[_0x5ad9('0x14')]?_0x54f392[_0x5ad9('0x14')][_0x5ad9('0x16')]||null:null,'include':_0x54f392[_0x5ad9('0x14')]?_0x54f392['options'][_0x5ad9('0x17')]?_['map'](_0x54f392[_0x5ad9('0x14')]['include'],function(_0x570d3c){return{'model':db[_0x570d3c['model']],'as':_0x570d3c['as'],'attributes':_0x570d3c[_0x5ad9('0x15')],'include':_0x570d3c[_0x5ad9('0x17')]?_[_0x5ad9('0x18')](_0x570d3c[_0x5ad9('0x17')],function(_0x1252e6){return{'model':db[_0x1252e6[_0x5ad9('0x19')]],'as':_0x1252e6['as'],'attributes':_0x1252e6[_0x5ad9('0x15')],'include':_0x1252e6['include']?_['map'](_0x1252e6[_0x5ad9('0x17')],function(_0x4f3889){return{'model':db[_0x4f3889[_0x5ad9('0x19')]],'as':_0x4f3889['as'],'attributes':_0x4f3889['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ad9('0x6')](function(_0x55a0e4){logger['info'](_0x5ad9('0x11'),_0x54f392);logger[_0x5ad9('0x9')]('GetCampaign',_0x54f392,JSON['stringify'](_0x55a0e4));_0x28682f(_0x55a0e4);})[_0x5ad9('0x10')](function(_0x129804){logger[_0x5ad9('0xb')](_0x5ad9('0x11'),_0x129804[_0x5ad9('0xd')],_0x54f392);_0xe4171b(_0x3d1c8f[_0x5ad9('0xb')](0x1f4,_0x129804['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 43d9e87..ac5b56c 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 _0xf07a=['connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x2d2029,_0x30582b){var _0x575839=function(_0x5ed7de){while(--_0x5ed7de){_0x2d2029['push'](_0x2d2029['shift']());}};_0x575839(++_0x30582b);}(_0xf07a,0x86));var _0xaf07=function(_0x11fe8d,_0x19aba4){_0x11fe8d=_0x11fe8d-0x0;var _0x356099=_0xf07a[_0x11fe8d];return _0x356099;};'use strict';var multer=require(_0xaf07('0x0'));var util=require(_0xaf07('0x1'));var path=require('path');var timeout=require(_0xaf07('0x2'));var express=require(_0xaf07('0x3'));var router=express[_0xaf07('0x4')]();var fs_extra=require(_0xaf07('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf07('0x6'));var controller=require('./campaign.controller');router[_0xaf07('0x7')]('/',auth['isAuthenticated'](),controller[_0xaf07('0x8')]);router['get'](_0xaf07('0x9'),auth[_0xaf07('0xa')](),controller[_0xaf07('0xb')]);router[_0xaf07('0x7')](_0xaf07('0xc'),auth[_0xaf07('0xa')](),controller['getHoppers']);router[_0xaf07('0x7')](_0xaf07('0xd'),auth[_0xaf07('0xa')](),controller[_0xaf07('0xe')]);router[_0xaf07('0x7')]('/:id/hopper_finals',auth[_0xaf07('0xa')](),controller[_0xaf07('0xf')]);router[_0xaf07('0x7')](_0xaf07('0x10'),auth[_0xaf07('0xa')](),controller[_0xaf07('0x11')]);router['get']('/:id/lists',auth[_0xaf07('0xa')](),controller[_0xaf07('0x12')]);router['get']('/:id/blacklists',auth[_0xaf07('0xa')](),controller[_0xaf07('0x13')]);router[_0xaf07('0x14')]('/',auth[_0xaf07('0xa')](),controller[_0xaf07('0x15')]);router[_0xaf07('0x14')]('/:id/clone',auth[_0xaf07('0xa')](),controller[_0xaf07('0x16')]);router[_0xaf07('0x14')](_0xaf07('0x17'),auth['isAuthenticated'](),controller[_0xaf07('0x18')]);router['post'](_0xaf07('0x19'),auth['isAuthenticated'](),controller[_0xaf07('0x1a')]);router[_0xaf07('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xaf07('0x1c')]);router[_0xaf07('0x1d')](_0xaf07('0x9'),auth[_0xaf07('0xa')](),controller[_0xaf07('0x1e')]);router[_0xaf07('0x1d')](_0xaf07('0x17'),auth[_0xaf07('0xa')](),controller[_0xaf07('0x1f')]);router[_0xaf07('0x1d')](_0xaf07('0x19'),auth[_0xaf07('0xa')](),controller[_0xaf07('0x20')]);module[_0xaf07('0x21')]=router;
\ No newline at end of file
+var _0xc9df=['destroy','removeLists','removeBlackLists','util','path','connect-timeout','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','addBlackLists','put','delete'];(function(_0x5f5b5c,_0x529e05){var _0x5339c0=function(_0x4d9cb5){while(--_0x4d9cb5){_0x5f5b5c['push'](_0x5f5b5c['shift']());}};_0x5339c0(++_0x529e05);}(_0xc9df,0x121));var _0xfc9d=function(_0x447952,_0x575c24){_0x447952=_0x447952-0x0;var _0x42f54f=_0xc9df[_0x447952];return _0x42f54f;};'use strict';var multer=require('multer');var util=require(_0xfc9d('0x0'));var path=require(_0xfc9d('0x1'));var timeout=require(_0xfc9d('0x2'));var express=require('express');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('../../config/environment');var controller=require('./campaign.controller');router[_0xfc9d('0x3')]('/',auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x5')]);router[_0xfc9d('0x3')](_0xfc9d('0x6'),auth[_0xfc9d('0x4')](),controller['show']);router[_0xfc9d('0x3')](_0xfc9d('0x7'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x8')]);router[_0xfc9d('0x3')](_0xfc9d('0x9'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0xa')]);router[_0xfc9d('0x3')](_0xfc9d('0xb'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0xc')]);router[_0xfc9d('0x3')](_0xfc9d('0xd'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0xe')]);router['get'](_0xfc9d('0xf'),auth['isAuthenticated'](),controller[_0xfc9d('0x10')]);router['get'](_0xfc9d('0x11'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x12')]);router[_0xfc9d('0x13')]('/',auth[_0xfc9d('0x4')](),controller['create']);router[_0xfc9d('0x13')]('/:id/clone',auth[_0xfc9d('0x4')](),controller['clone']);router[_0xfc9d('0x13')](_0xfc9d('0xf'),auth[_0xfc9d('0x4')](),controller['addLists']);router['post'](_0xfc9d('0x11'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x14')]);router[_0xfc9d('0x15')](_0xfc9d('0x6'),auth[_0xfc9d('0x4')](),controller['update']);router[_0xfc9d('0x16')]('/:id',auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x17')]);router[_0xfc9d('0x16')]('/:id/lists',auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x18')]);router[_0xfc9d('0x16')](_0xfc9d('0x11'),auth[_0xfc9d('0x4')](),controller[_0xfc9d('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index c9765fa..89f0c76 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 _0x1a31=['exports','STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x15fef7,_0xbc02c5){var _0x13bb57=function(_0x488ce0){while(--_0x488ce0){_0x15fef7['push'](_0x15fef7['shift']());}};_0x13bb57(++_0xbc02c5);}(_0x1a31,0x16f));var _0x11a3=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x1a31[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0x11a3('0x0'));module[_0x11a3('0x1')]={'key':{'type':Sequelize[_0x11a3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x11a3('0x3')],'length':_0x11a3('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x11a3('0x5')],'get':function(){return this[_0x11a3('0x6')](_0x11a3('0x7'));}}};
\ No newline at end of file
+var _0xc6bf=['VIRTUAL','getDataValue','sequelize','STRING','TEXT','medium'];(function(_0x5b64e5,_0x54b8ec){var _0x2b3f81=function(_0x47aaae){while(--_0x47aaae){_0x5b64e5['push'](_0x5b64e5['shift']());}};_0x2b3f81(++_0x54b8ec);}(_0xc6bf,0x1be));var _0xfc6b=function(_0x18e875,_0x54fff7){_0x18e875=_0x18e875-0x0;var _0x1643c6=_0xc6bf[_0x18e875];return _0x1643c6;};'use strict';var Sequelize=require(_0xfc6b('0x0'));module['exports']={'key':{'type':Sequelize[_0xfc6b('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xfc6b('0x2')],'length':_0xfc6b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xfc6b('0x4')],'get':function(){return this[_0xfc6b('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 13869f1..ada9185 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 _0xb875=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x180b9b,_0x2121e2){var _0x1dae04=function(_0xbe5c27){while(--_0xbe5c27){_0x180b9b['push'](_0x180b9b['shift']());}};_0x1dae04(++_0x2121e2);}(_0xb875,0xf4));var _0x5b87=function(_0x4be53d,_0x1f1c6e){_0x4be53d=_0x4be53d-0x0;var _0x1ae3dd=_0xb875[_0x4be53d];return _0x1ae3dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5b87('0x0'));var jsonpatch=require(_0x5b87('0x1'));var rp=require('request-promise');var moment=require(_0x5b87('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5b87('0x3'));var util=require(_0x5b87('0x4'));var path=require('path');var sox=require(_0x5b87('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b87('0x6'));var _=require(_0x5b87('0x7'));var squel=require(_0x5b87('0x8'));var crypto=require('crypto');var jsforce=require(_0x5b87('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x5b87('0xa'));var querystring=require(_0x5b87('0xb'));var Papa=require(_0x5b87('0xc'));var Redis=require(_0x5b87('0xd'));var authService=require(_0x5b87('0xe'));var qs=require(_0x5b87('0xf'));var as=require(_0x5b87('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b87('0x11'))(_0x5b87('0x12'));var utils=require('../../config/utils');var config=require(_0x5b87('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b87('0x14'))['db'];function respondWithStatusCode(_0x384d77,_0x203279){_0x203279=_0x203279||0xcc;return function(_0x58638f){if(_0x58638f){return _0x384d77[_0x5b87('0x15')](_0x203279);}return _0x384d77['status'](_0x203279)['end']();};}function respondWithResult(_0x38750a,_0xcd3bc0){_0xcd3bc0=_0xcd3bc0||0xc8;return function(_0xb6d39d){if(_0xb6d39d){return _0x38750a[_0x5b87('0x16')](_0xcd3bc0)[_0x5b87('0x17')](_0xb6d39d);}};}function respondWithFilteredResult(_0x10f9d4,_0x328fb1){return function(_0x2c6032){if(_0x2c6032){var _0x563b1c=typeof _0x328fb1[_0x5b87('0x18')]===_0x5b87('0x19')&&typeof _0x328fb1[_0x5b87('0x1a')]===_0x5b87('0x19');var _0x558d0a=_0x2c6032[_0x5b87('0x1b')];var _0x475804=_0x563b1c?0x0:_0x328fb1[_0x5b87('0x18')];var _0x2af69d=_0x563b1c?_0x2c6032['count']:_0x328fb1[_0x5b87('0x18')]+_0x328fb1[_0x5b87('0x1a')];var _0x42a8c6;if(_0x2af69d>=_0x558d0a){_0x2af69d=_0x558d0a;_0x42a8c6=0xc8;}else{_0x42a8c6=0xce;}_0x10f9d4[_0x5b87('0x16')](_0x42a8c6);return _0x10f9d4['set'](_0x5b87('0x1c'),_0x475804+'-'+_0x2af69d+'/'+_0x558d0a)['json'](_0x2c6032);}return null;};}function patchUpdates(_0x581a2f){return function(_0x4ae8d5){try{jsonpatch[_0x5b87('0x1d')](_0x4ae8d5,_0x581a2f,!![]);}catch(_0x417deb){return BPromise[_0x5b87('0x1e')](_0x417deb);}return _0x4ae8d5[_0x5b87('0x1f')]();};}function saveUpdates(_0x493814,_0x14dc58){return function(_0x10e4cc){if(_0x10e4cc){return _0x10e4cc['update'](_0x493814)[_0x5b87('0x20')](function(_0x5d6d72){return _0x5d6d72;});}return null;};}function removeEntity(_0xf3d360,_0x75fcb9){return function(_0x129b40){if(_0x129b40){return _0x129b40[_0x5b87('0x21')]()[_0x5b87('0x20')](function(){var _0x488986=_0x129b40[_0x5b87('0x22')]({'plain':!![]});var _0x1170b8=_0x5b87('0x23');return db[_0x5b87('0x24')][_0x5b87('0x21')]({'where':{'type':_0x1170b8,'resourceId':_0x488986['id']}})[_0x5b87('0x20')](function(){return _0x129b40;});})[_0x5b87('0x20')](function(){_0xf3d360[_0x5b87('0x16')](0xcc)[_0x5b87('0x25')]();});}};}function handleEntityNotFound(_0x524ad8,_0x3c3c65){return function(_0x3e3616){if(!_0x3e3616){_0x524ad8[_0x5b87('0x15')](0x194);}return _0x3e3616;};}function handleError(_0x3c1095,_0x181615){_0x181615=_0x181615||0x1f4;return function(_0x31b619){logger[_0x5b87('0x26')](_0x31b619['stack']);if(_0x31b619['name']){delete _0x31b619[_0x5b87('0x27')];}_0x3c1095[_0x5b87('0x16')](_0x181615)[_0x5b87('0x28')](_0x31b619);};}exports[_0x5b87('0x29')]=function(_0x5d46de,_0x474c91){var _0x39d825={},_0x17a1bb={},_0x4c519a={'count':0x0,'rows':[]};var _0x3a63df=_[_0x5b87('0x2a')](db[_0x5b87('0x2b')]['rawAttributes'],function(_0x375d37){return{'name':_0x375d37[_0x5b87('0x2c')],'type':_0x375d37[_0x5b87('0x2d')][_0x5b87('0x2e')]};});_0x17a1bb[_0x5b87('0x2f')]=_['map'](_0x3a63df,_0x5b87('0x27'));_0x17a1bb[_0x5b87('0x30')]=_['keys'](_0x5d46de[_0x5b87('0x30')]);_0x17a1bb[_0x5b87('0x31')]=_[_0x5b87('0x32')](_0x17a1bb[_0x5b87('0x2f')],_0x17a1bb[_0x5b87('0x30')]);_0x39d825['attributes']=_[_0x5b87('0x32')](_0x17a1bb[_0x5b87('0x2f')],qs[_0x5b87('0x33')](_0x5d46de[_0x5b87('0x30')][_0x5b87('0x33')]));_0x39d825[_0x5b87('0x34')]=_0x39d825[_0x5b87('0x34')]['length']?_0x39d825[_0x5b87('0x34')]:_0x17a1bb[_0x5b87('0x2f')];if(!_0x5d46de[_0x5b87('0x30')]['hasOwnProperty'](_0x5b87('0x35'))){_0x39d825[_0x5b87('0x1a')]=qs[_0x5b87('0x1a')](_0x5d46de[_0x5b87('0x30')][_0x5b87('0x1a')]);_0x39d825['offset']=qs[_0x5b87('0x18')](_0x5d46de[_0x5b87('0x30')][_0x5b87('0x18')]);}_0x39d825[_0x5b87('0x36')]=qs[_0x5b87('0x37')](_0x5d46de['query']['sort']);_0x39d825[_0x5b87('0x38')]=qs[_0x5b87('0x31')](_[_0x5b87('0x39')](_0x5d46de['query'],_0x17a1bb[_0x5b87('0x31')]),_0x3a63df);if(_0x5d46de[_0x5b87('0x30')][_0x5b87('0x3a')]){_0x39d825[_0x5b87('0x38')]=_[_0x5b87('0x3b')](_0x39d825[_0x5b87('0x38')],{'$or':[{'key':{'$like':'%'+_0x5d46de[_0x5b87('0x30')][_0x5b87('0x3a')]+'%'}},{'value':{'$like':'%'+_0x5d46de[_0x5b87('0x30')][_0x5b87('0x3a')]+'%'}}]});}_0x39d825=_['merge']({},_0x39d825,_0x5d46de['options']);var _0x405833={'where':_0x39d825[_0x5b87('0x38')]};return db[_0x5b87('0x2b')][_0x5b87('0x1b')](_0x405833)['then'](function(_0x420950){_0x4c519a['count']=_0x420950;if(_0x5d46de['query'][_0x5b87('0x3c')]){_0x39d825[_0x5b87('0x3d')]=[{'all':!![]}];}return db[_0x5b87('0x2b')][_0x5b87('0x3e')](_0x39d825);})[_0x5b87('0x20')](function(_0x152d5e){_0x4c519a[_0x5b87('0x3f')]=_0x152d5e;return _0x4c519a;})['then'](respondWithFilteredResult(_0x474c91,_0x39d825))[_0x5b87('0x40')](handleError(_0x474c91,null));};exports[_0x5b87('0x41')]=function(_0x5b0bc2,_0x1c8e57){var _0x361bcd={'raw':!![],'where':{'id':_0x5b0bc2[_0x5b87('0x42')]['id']}},_0x2f7c94={};_0x2f7c94[_0x5b87('0x2f')]=_['keys'](db[_0x5b87('0x2b')][_0x5b87('0x43')]);_0x2f7c94['query']=_['keys'](_0x5b0bc2['query']);_0x2f7c94[_0x5b87('0x31')]=_[_0x5b87('0x32')](_0x2f7c94['model'],_0x2f7c94[_0x5b87('0x30')]);_0x361bcd['attributes']=_[_0x5b87('0x32')](_0x2f7c94[_0x5b87('0x2f')],qs['fields'](_0x5b0bc2[_0x5b87('0x30')]['fields']));_0x361bcd['attributes']=_0x361bcd['attributes'][_0x5b87('0x44')]?_0x361bcd[_0x5b87('0x34')]:_0x2f7c94['model'];if(_0x5b0bc2['query'][_0x5b87('0x3c')]){_0x361bcd[_0x5b87('0x3d')]=[{'all':!![]}];}_0x361bcd=_['merge']({},_0x361bcd,_0x5b0bc2[_0x5b87('0x45')]);return db['CannedAnswer'][_0x5b87('0x46')](_0x361bcd)['then'](handleEntityNotFound(_0x1c8e57,null))[_0x5b87('0x20')](respondWithResult(_0x1c8e57,null))[_0x5b87('0x40')](handleError(_0x1c8e57,null));};exports[_0x5b87('0x47')]=function(_0x297371,_0x1bd417){if(_0x297371[_0x5b87('0x48')]['id']){delete _0x297371[_0x5b87('0x48')]['id'];}return db['CannedAnswer'][_0x5b87('0x46')]({'where':{'id':_0x297371['params']['id']}})[_0x5b87('0x20')](handleEntityNotFound(_0x1bd417,null))[_0x5b87('0x20')](saveUpdates(_0x297371[_0x5b87('0x48')],null))['then'](respondWithResult(_0x1bd417,null))[_0x5b87('0x40')](handleError(_0x1bd417,null));};exports['destroy']=function(_0x3a0791,_0x2f9197){return db[_0x5b87('0x2b')]['find']({'where':{'id':_0x3a0791[_0x5b87('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f9197,null))[_0x5b87('0x20')](removeEntity(_0x2f9197,null))['catch'](handleError(_0x2f9197,null));};exports[_0x5b87('0x49')]=function(_0x3da522,_0x2ffb55){var _0x3b6b6b={'key':_0x3da522[_0x5b87('0x48')][_0x5b87('0x2e')]};if(_0x3da522[_0x5b87('0x48')][_0x5b87('0x4a')]){_0x3b6b6b[_0x5b87('0x4a')]=_0x3da522[_0x5b87('0x48')][_0x5b87('0x4a')];}else if(_0x3da522[_0x5b87('0x48')][_0x5b87('0x4b')]){_0x3b6b6b[_0x5b87('0x4b')]=_0x3da522['body']['SmsAccountId'];}else if(_0x3da522[_0x5b87('0x48')][_0x5b87('0x4c')]){_0x3b6b6b[_0x5b87('0x4c')]=_0x3da522[_0x5b87('0x48')]['OpenchannelAccountId'];}else if(_0x3da522[_0x5b87('0x48')][_0x5b87('0x4d')]){_0x3b6b6b[_0x5b87('0x4d')]=_0x3da522['body'][_0x5b87('0x4d')];}return db[_0x5b87('0x2b')][_0x5b87('0x46')]({'where':_0x3b6b6b})[_0x5b87('0x20')](function(_0x23ae71){if(_0x23ae71){throw new db[(_0x5b87('0x4e'))][(_0x5b87('0x4f'))](_0x5b87('0x50'));}return db['CannedAnswer'][_0x5b87('0x49')](_0x3da522[_0x5b87('0x48')]);})['then'](function(_0x533d13){var _0xe45281=_0x3da522[_0x5b87('0x51')][_0x5b87('0x22')]({'plain':!![]});if(!_0xe45281)throw new Error(_0x5b87('0x52'));if(_0xe45281[_0x5b87('0x53')]===_0x5b87('0x51')){var _0x3d563b=_0x533d13[_0x5b87('0x22')]({'plain':!![]});return db[_0x5b87('0x54')][_0x5b87('0x46')]({'where':{'name':_0x5b87('0x23'),'userProfileId':_0xe45281[_0x5b87('0x55')]},'raw':!![]})['then'](function(_0x23fe18){if(_0x23fe18&&_0x23fe18[_0x5b87('0x56')]===0x0){return db[_0x5b87('0x24')][_0x5b87('0x49')]({'name':_0x3d563b['name'],'resourceId':_0x3d563b['id'],'type':_0x23fe18[_0x5b87('0x27')],'sectionId':_0x23fe18['id']},{})[_0x5b87('0x20')](function(){return _0x533d13;});}else{return _0x533d13;}})[_0x5b87('0x40')](function(_0x12e2d7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12e2d7);throw _0x12e2d7;});}return _0x533d13;})[_0x5b87('0x20')](respondWithResult(_0x2ffb55,0xc9))[_0x5b87('0x40')](handleError(_0x2ffb55,null));};
\ No newline at end of file
+var _0x2699=['zip-dir','request-promise','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','save','update','then','destroy','get','CannedAnswers','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','CannedAnswer','findAll','rows','catch','show','includeAll','include','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf'];(function(_0x40b63e,_0x41fb03){var _0x594acd=function(_0x5f145e){while(--_0x5f145e){_0x40b63e['push'](_0x40b63e['shift']());}};_0x594acd(++_0x41fb03);}(_0x2699,0xaf));var _0x9269=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x2699[_0x47e549];return _0x251374;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9269('0x0'));var zipdir=require(_0x9269('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9269('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9269('0x3'));var util=require('util');var path=require(_0x9269('0x4'));var sox=require('sox');var csv=require(_0x9269('0x5'));var ejs=require(_0x9269('0x6'));var fs=require('fs');var fs_extra=require(_0x9269('0x7'));var _=require('lodash');var squel=require(_0x9269('0x8'));var crypto=require(_0x9269('0x9'));var jsforce=require(_0x9269('0xa'));var deskjs=require(_0x9269('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9269('0xc'));var Papa=require(_0x9269('0xd'));var Redis=require(_0x9269('0xe'));var authService=require(_0x9269('0xf'));var qs=require(_0x9269('0x10'));var as=require(_0x9269('0x11'));var hardwareService=require(_0x9269('0x12'));var logger=require(_0x9269('0x13'))(_0x9269('0x14'));var utils=require('../../config/utils');var config=require(_0x9269('0x15'));var licenseUtil=require(_0x9269('0x16'));var db=require(_0x9269('0x17'))['db'];function respondWithStatusCode(_0x320b2a,_0x1c5531){_0x1c5531=_0x1c5531||0xcc;return function(_0x24731c){if(_0x24731c){return _0x320b2a[_0x9269('0x18')](_0x1c5531);}return _0x320b2a[_0x9269('0x19')](_0x1c5531)['end']();};}function respondWithResult(_0x30817d,_0x1405b3){_0x1405b3=_0x1405b3||0xc8;return function(_0xa67c1d){if(_0xa67c1d){return _0x30817d[_0x9269('0x19')](_0x1405b3)[_0x9269('0x1a')](_0xa67c1d);}};}function respondWithFilteredResult(_0x35ce65,_0x38c417){return function(_0xafaa5a){if(_0xafaa5a){var _0x59d90e=typeof _0x38c417[_0x9269('0x1b')]==='undefined'&&typeof _0x38c417[_0x9269('0x1c')]===_0x9269('0x1d');var _0x4ec8ec=_0xafaa5a[_0x9269('0x1e')];var _0x124b52=_0x59d90e?0x0:_0x38c417['offset'];var _0x36a892=_0x59d90e?_0xafaa5a['count']:_0x38c417['offset']+_0x38c417[_0x9269('0x1c')];var _0x17a88a;if(_0x36a892>=_0x4ec8ec){_0x36a892=_0x4ec8ec;_0x17a88a=0xc8;}else{_0x17a88a=0xce;}_0x35ce65[_0x9269('0x19')](_0x17a88a);return _0x35ce65['set'](_0x9269('0x1f'),_0x124b52+'-'+_0x36a892+'/'+_0x4ec8ec)[_0x9269('0x1a')](_0xafaa5a);}return null;};}function patchUpdates(_0x181b0e){return function(_0x49d888){try{jsonpatch['apply'](_0x49d888,_0x181b0e,!![]);}catch(_0x1fb588){return BPromise['reject'](_0x1fb588);}return _0x49d888[_0x9269('0x20')]();};}function saveUpdates(_0x1be64c,_0x24bcc6){return function(_0x4c7d7b){if(_0x4c7d7b){return _0x4c7d7b[_0x9269('0x21')](_0x1be64c)[_0x9269('0x22')](function(_0x5e87f5){return _0x5e87f5;});}return null;};}function removeEntity(_0x32b3b9,_0x40ca87){return function(_0x447644){if(_0x447644){return _0x447644[_0x9269('0x23')]()[_0x9269('0x22')](function(){var _0x20f9e9=_0x447644[_0x9269('0x24')]({'plain':!![]});var _0x41d981=_0x9269('0x25');return db['UserProfileResource'][_0x9269('0x23')]({'where':{'type':_0x41d981,'resourceId':_0x20f9e9['id']}})[_0x9269('0x22')](function(){return _0x447644;});})['then'](function(){_0x32b3b9[_0x9269('0x19')](0xcc)[_0x9269('0x26')]();});}};}function handleEntityNotFound(_0x47a683,_0x2bb107){return function(_0x50b546){if(!_0x50b546){_0x47a683[_0x9269('0x18')](0x194);}return _0x50b546;};}function handleError(_0xb42618,_0x1580a6){_0x1580a6=_0x1580a6||0x1f4;return function(_0x4c6950){logger[_0x9269('0x27')](_0x4c6950[_0x9269('0x28')]);if(_0x4c6950[_0x9269('0x29')]){delete _0x4c6950[_0x9269('0x29')];}_0xb42618[_0x9269('0x19')](_0x1580a6)[_0x9269('0x2a')](_0x4c6950);};}exports[_0x9269('0x2b')]=function(_0x31fbfa,_0x291985){var _0x5ac6d5={},_0x263a34={},_0x137858={'count':0x0,'rows':[]};var _0x4f2ca1=_[_0x9269('0x2c')](db['CannedAnswer'][_0x9269('0x2d')],function(_0x1ae3c0){return{'name':_0x1ae3c0[_0x9269('0x2e')],'type':_0x1ae3c0['type'][_0x9269('0x2f')]};});_0x263a34[_0x9269('0x30')]=_['map'](_0x4f2ca1,_0x9269('0x29'));_0x263a34[_0x9269('0x31')]=_[_0x9269('0x32')](_0x31fbfa[_0x9269('0x31')]);_0x263a34[_0x9269('0x33')]=_[_0x9269('0x34')](_0x263a34['model'],_0x263a34['query']);_0x5ac6d5[_0x9269('0x35')]=_[_0x9269('0x34')](_0x263a34[_0x9269('0x30')],qs['fields'](_0x31fbfa[_0x9269('0x31')][_0x9269('0x36')]));_0x5ac6d5[_0x9269('0x35')]=_0x5ac6d5[_0x9269('0x35')][_0x9269('0x37')]?_0x5ac6d5[_0x9269('0x35')]:_0x263a34[_0x9269('0x30')];if(!_0x31fbfa[_0x9269('0x31')][_0x9269('0x38')](_0x9269('0x39'))){_0x5ac6d5[_0x9269('0x1c')]=qs[_0x9269('0x1c')](_0x31fbfa[_0x9269('0x31')][_0x9269('0x1c')]);_0x5ac6d5[_0x9269('0x1b')]=qs[_0x9269('0x1b')](_0x31fbfa[_0x9269('0x31')][_0x9269('0x1b')]);}_0x5ac6d5[_0x9269('0x3a')]=qs['sort'](_0x31fbfa[_0x9269('0x31')][_0x9269('0x3b')]);_0x5ac6d5[_0x9269('0x3c')]=qs[_0x9269('0x33')](_[_0x9269('0x3d')](_0x31fbfa[_0x9269('0x31')],_0x263a34[_0x9269('0x33')]),_0x4f2ca1);if(_0x31fbfa[_0x9269('0x31')]['filter']){_0x5ac6d5[_0x9269('0x3c')]=_[_0x9269('0x3e')](_0x5ac6d5[_0x9269('0x3c')],{'$or':[{'key':{'$like':'%'+_0x31fbfa[_0x9269('0x31')][_0x9269('0x3f')]+'%'}},{'value':{'$like':'%'+_0x31fbfa[_0x9269('0x31')][_0x9269('0x3f')]+'%'}}]});}_0x5ac6d5=_[_0x9269('0x3e')]({},_0x5ac6d5,_0x31fbfa[_0x9269('0x40')]);var _0x26661a={'where':_0x5ac6d5['where']};return db[_0x9269('0x41')][_0x9269('0x1e')](_0x26661a)[_0x9269('0x22')](function(_0x501b6a){_0x137858['count']=_0x501b6a;if(_0x31fbfa['query']['includeAll']){_0x5ac6d5['include']=[{'all':!![]}];}return db[_0x9269('0x41')][_0x9269('0x42')](_0x5ac6d5);})[_0x9269('0x22')](function(_0x499d48){_0x137858[_0x9269('0x43')]=_0x499d48;return _0x137858;})['then'](respondWithFilteredResult(_0x291985,_0x5ac6d5))[_0x9269('0x44')](handleError(_0x291985,null));};exports[_0x9269('0x45')]=function(_0x4e11f8,_0x146bfe){var _0xd5c11a={'raw':!![],'where':{'id':_0x4e11f8['params']['id']}},_0x59906c={};_0x59906c[_0x9269('0x30')]=_[_0x9269('0x32')](db['CannedAnswer'][_0x9269('0x2d')]);_0x59906c[_0x9269('0x31')]=_[_0x9269('0x32')](_0x4e11f8[_0x9269('0x31')]);_0x59906c['filters']=_[_0x9269('0x34')](_0x59906c[_0x9269('0x30')],_0x59906c[_0x9269('0x31')]);_0xd5c11a[_0x9269('0x35')]=_['intersection'](_0x59906c[_0x9269('0x30')],qs[_0x9269('0x36')](_0x4e11f8[_0x9269('0x31')][_0x9269('0x36')]));_0xd5c11a[_0x9269('0x35')]=_0xd5c11a[_0x9269('0x35')][_0x9269('0x37')]?_0xd5c11a['attributes']:_0x59906c[_0x9269('0x30')];if(_0x4e11f8[_0x9269('0x31')][_0x9269('0x46')]){_0xd5c11a[_0x9269('0x47')]=[{'all':!![]}];}_0xd5c11a=_[_0x9269('0x3e')]({},_0xd5c11a,_0x4e11f8['options']);return db[_0x9269('0x41')]['find'](_0xd5c11a)[_0x9269('0x22')](handleEntityNotFound(_0x146bfe,null))[_0x9269('0x22')](respondWithResult(_0x146bfe,null))[_0x9269('0x44')](handleError(_0x146bfe,null));};exports[_0x9269('0x21')]=function(_0xa2df60,_0x218584){if(_0xa2df60['body']['id']){delete _0xa2df60[_0x9269('0x48')]['id'];}return db['CannedAnswer'][_0x9269('0x49')]({'where':{'id':_0xa2df60[_0x9269('0x4a')]['id']}})[_0x9269('0x22')](handleEntityNotFound(_0x218584,null))[_0x9269('0x22')](saveUpdates(_0xa2df60[_0x9269('0x48')],null))[_0x9269('0x22')](respondWithResult(_0x218584,null))['catch'](handleError(_0x218584,null));};exports['destroy']=function(_0xd3341f,_0x35caa9){return db[_0x9269('0x41')]['find']({'where':{'id':_0xd3341f['params']['id']}})[_0x9269('0x22')](handleEntityNotFound(_0x35caa9,null))[_0x9269('0x22')](removeEntity(_0x35caa9,null))[_0x9269('0x44')](handleError(_0x35caa9,null));};exports[_0x9269('0x4b')]=function(_0x328dd4,_0x304a83){var _0xe48fae={'key':_0x328dd4[_0x9269('0x48')][_0x9269('0x2f')]};if(_0x328dd4[_0x9269('0x48')][_0x9269('0x4c')]){_0xe48fae[_0x9269('0x4c')]=_0x328dd4[_0x9269('0x48')][_0x9269('0x4c')];}else if(_0x328dd4[_0x9269('0x48')][_0x9269('0x4d')]){_0xe48fae[_0x9269('0x4d')]=_0x328dd4['body'][_0x9269('0x4d')];}else if(_0x328dd4['body'][_0x9269('0x4e')]){_0xe48fae[_0x9269('0x4e')]=_0x328dd4[_0x9269('0x48')][_0x9269('0x4e')];}else if(_0x328dd4['body']['ChatWebsiteId']){_0xe48fae[_0x9269('0x4f')]=_0x328dd4[_0x9269('0x48')]['ChatWebsiteId'];}return db[_0x9269('0x41')]['find']({'where':_0xe48fae})['then'](function(_0x3f048d){if(_0x3f048d){throw new db[(_0x9269('0x50'))]['ValidationError'](_0x9269('0x51'));}return db[_0x9269('0x41')][_0x9269('0x4b')](_0x328dd4[_0x9269('0x48')]);})['then'](function(_0x1ab02b){var _0x5062e9=_0x328dd4[_0x9269('0x52')]['get']({'plain':!![]});if(!_0x5062e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5062e9[_0x9269('0x53')]===_0x9269('0x52')){var _0x2303c1=_0x1ab02b[_0x9269('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x9269('0x49')]({'where':{'name':_0x9269('0x25'),'userProfileId':_0x5062e9[_0x9269('0x54')]},'raw':!![]})['then'](function(_0x5015c9){if(_0x5015c9&&_0x5015c9[_0x9269('0x55')]===0x0){return db[_0x9269('0x56')][_0x9269('0x4b')]({'name':_0x2303c1[_0x9269('0x29')],'resourceId':_0x2303c1['id'],'type':_0x5015c9[_0x9269('0x29')],'sectionId':_0x5015c9['id']},{})['then'](function(){return _0x1ab02b;});}else{return _0x1ab02b;}})[_0x9269('0x44')](function(_0x21291b){logger[_0x9269('0x27')](_0x9269('0x57'),_0x21291b);throw _0x21291b;});}return _0x1ab02b;})[_0x9269('0x22')](respondWithResult(_0x304a83,0xc9))[_0x9269('0x44')](handleError(_0x304a83,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index b17230f..a89cc9f 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 _0x7728=['define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x17953f,_0x115870){var _0x4e3a07=function(_0x482004){while(--_0x482004){_0x17953f['push'](_0x17953f['shift']());}};_0x4e3a07(++_0x115870);}(_0x7728,0xd5));var _0x8772=function(_0x2f8000,_0x37c02b){_0x2f8000=_0x2f8000-0x0;var _0x25cfee=_0x7728[_0x2f8000];return _0x25cfee;};'use strict';var _=require('lodash');var util=require(_0x8772('0x0'));var logger=require(_0x8772('0x1'))(_0x8772('0x2'));var moment=require(_0x8772('0x3'));var BPromise=require(_0x8772('0x4'));var rp=require(_0x8772('0x5'));var fs=require('fs');var path=require(_0x8772('0x6'));var rimraf=require(_0x8772('0x7'));var config=require(_0x8772('0x8'));var attributes=require(_0x8772('0x9'));module[_0x8772('0xa')]=function(_0x1897a2,_0x1b10e8){return _0x1897a2[_0x8772('0xb')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8772('0xc'),'collate':_0x8772('0xd')});};
\ No newline at end of file
+var _0x685f=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x32e520,_0x1c109c){var _0x536dab=function(_0x1e253f){while(--_0x1e253f){_0x32e520['push'](_0x32e520['shift']());}};_0x536dab(++_0x1c109c);}(_0x685f,0xc7));var _0xf685=function(_0x4fcf41,_0x979bd7){_0x4fcf41=_0x4fcf41-0x0;var _0x5ebe15=_0x685f[_0x4fcf41];return _0x5ebe15;};'use strict';var _=require(_0xf685('0x0'));var util=require('util');var logger=require(_0xf685('0x1'))(_0xf685('0x2'));var moment=require(_0xf685('0x3'));var BPromise=require(_0xf685('0x4'));var rp=require(_0xf685('0x5'));var fs=require('fs');var path=require(_0xf685('0x6'));var rimraf=require(_0xf685('0x7'));var config=require(_0xf685('0x8'));var attributes=require(_0xf685('0x9'));module[_0xf685('0xa')]=function(_0x3594aa,_0x2ca7d8){return _0x3594aa[_0xf685('0xb')](_0xf685('0xc'),attributes,{'tableName':_0xf685('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf685('0xe'),'collate':_0xf685('0xf')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 8fc2cf7..ed876d2 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(_0x26a6c7,_0x3a9b26){var _0xbbb3c2=function(_0x3eaf2d){while(--_0x3eaf2d){_0x26a6c7['push'](_0x26a6c7['shift']());}};_0xbbb3c2(++_0x3a9b26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17e71a,_0x363028){var _0x33d55d=function(_0x3a3c9d){while(--_0x3a3c9d){_0x17e71a['push'](_0x17e71a['shift']());}};_0x33d55d(++_0x363028);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 f1060f1..18f83ea 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 _0x8cf0=['isAuthenticated','index','show','post','create','put','/:id','delete','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x205abb,_0x130e47){var _0x390baa=function(_0x309536){while(--_0x309536){_0x205abb['push'](_0x205abb['shift']());}};_0x390baa(++_0x130e47);}(_0x8cf0,0x1a7));var _0x08cf=function(_0x4f6e90,_0x1f15e0){_0x4f6e90=_0x4f6e90-0x0;var _0x11cc0c=_0x8cf0[_0x4f6e90];return _0x11cc0c;};'use strict';var multer=require(_0x08cf('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x08cf('0x1'));var router=express[_0x08cf('0x2')]();var fs_extra=require(_0x08cf('0x3'));var auth=require(_0x08cf('0x4'));var interaction=require(_0x08cf('0x5'));var config=require(_0x08cf('0x6'));var controller=require(_0x08cf('0x7'));router[_0x08cf('0x8')]('/',auth[_0x08cf('0x9')](),controller[_0x08cf('0xa')]);router['get']('/:id',auth[_0x08cf('0x9')](),controller[_0x08cf('0xb')]);router[_0x08cf('0xc')]('/',auth[_0x08cf('0x9')](),controller[_0x08cf('0xd')]);router[_0x08cf('0xe')](_0x08cf('0xf'),auth[_0x08cf('0x9')](),controller['update']);router[_0x08cf('0x10')](_0x08cf('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x08cf('0x11')]=router;
\ No newline at end of file
+var _0x3c70=['path','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','post','put','update','destroy','exports','util'];(function(_0x217f77,_0x2b17ed){var _0x43d08d=function(_0x2d6ada){while(--_0x2d6ada){_0x217f77['push'](_0x217f77['shift']());}};_0x43d08d(++_0x2b17ed);}(_0x3c70,0x1df));var _0x03c7=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x3c70[_0x38a7ac];return _0x53061a;};'use strict';var multer=require('multer');var util=require(_0x03c7('0x0'));var path=require(_0x03c7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x03c7('0x2')]();var fs_extra=require(_0x03c7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x03c7('0x4'));var config=require(_0x03c7('0x5'));var controller=require(_0x03c7('0x6'));router[_0x03c7('0x7')]('/',auth[_0x03c7('0x8')](),controller['index']);router[_0x03c7('0x7')](_0x03c7('0x9'),auth[_0x03c7('0x8')](),controller['show']);router[_0x03c7('0xa')]('/',auth[_0x03c7('0x8')](),controller['create']);router[_0x03c7('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x03c7('0xc')]);router['delete'](_0x03c7('0x9'),auth['isAuthenticated'](),controller[_0x03c7('0xd')]);module[_0x03c7('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index e191e2a..5dd6847 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 _0x3cb3=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x2273ad,_0x4effd6){var _0x3f6622=function(_0x5d8df9){while(--_0x5d8df9){_0x2273ad['push'](_0x2273ad['shift']());}};_0x3f6622(++_0x4effd6);}(_0x3cb3,0x156));var _0x33cb=function(_0x872e48,_0x21c55f){_0x872e48=_0x872e48-0x0;var _0x4cb0ff=_0x3cb3[_0x872e48];return _0x4cb0ff;};'use strict';var Sequelize=require(_0x33cb('0x0'));module[_0x33cb('0x1')]={'calldate':{'type':Sequelize[_0x33cb('0x2')],'allowNull':![],'defaultValue':_0x33cb('0x3')},'clid':{'type':Sequelize[_0x33cb('0x4')]},'src':{'type':Sequelize[_0x33cb('0x4')]},'dst':{'type':Sequelize[_0x33cb('0x4')]},'dcontext':{'type':Sequelize[_0x33cb('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x33cb('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x33cb('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x33cb('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x33cb('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x33cb('0x4')]},'linkedid':{'type':Sequelize[_0x33cb('0x4')]},'sequence':{'type':Sequelize[_0x33cb('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x33cb('0x4')]},'tag':{'type':Sequelize[_0x33cb('0x4')]}};
\ No newline at end of file
+var _0xae75=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0xae75,0x1a8));var _0x5ae7=function(_0xd8c413,_0x5249d1){_0xd8c413=_0xd8c413-0x0;var _0x1e08ab=_0xae75[_0xd8c413];return _0x1e08ab;};'use strict';var Sequelize=require(_0x5ae7('0x0'));module[_0x5ae7('0x1')]={'calldate':{'type':Sequelize[_0x5ae7('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x5ae7('0x3')]},'src':{'type':Sequelize[_0x5ae7('0x3')]},'dst':{'type':Sequelize[_0x5ae7('0x3')]},'dcontext':{'type':Sequelize[_0x5ae7('0x3')]},'channel':{'type':Sequelize[_0x5ae7('0x3')]},'dstchannel':{'type':Sequelize[_0x5ae7('0x3')]},'lastapp':{'type':Sequelize[_0x5ae7('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x5ae7('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5ae7('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x5ae7('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5ae7('0x3')]},'userfield':{'type':Sequelize[_0x5ae7('0x3')]},'uniqueid':{'type':Sequelize[_0x5ae7('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x5ae7('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 63a1b5c..6d8e14c 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 _0xca9e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','fields','find','create','body','describe','eml-format','rimraf'];(function(_0x3db102,_0x281787){var _0x3be7da=function(_0x3ca143){while(--_0x3ca143){_0x3db102['push'](_0x3db102['shift']());}};_0x3be7da(++_0x281787);}(_0xca9e,0x136));var _0xeca9=function(_0x3d99d8,_0x32e0c5){_0x3d99d8=_0x3d99d8-0x0;var _0x46f0b1=_0xca9e[_0x3d99d8];return _0x46f0b1;};'use strict';var emlformat=require(_0xeca9('0x0'));var rimraf=require(_0xeca9('0x1'));var zipdir=require(_0xeca9('0x2'));var jsonpatch=require(_0xeca9('0x3'));var rp=require(_0xeca9('0x4'));var moment=require(_0xeca9('0x5'));var BPromise=require(_0xeca9('0x6'));var Mustache=require(_0xeca9('0x7'));var util=require(_0xeca9('0x8'));var path=require(_0xeca9('0x9'));var sox=require(_0xeca9('0xa'));var csv=require(_0xeca9('0xb'));var ejs=require(_0xeca9('0xc'));var fs=require('fs');var fs_extra=require(_0xeca9('0xd'));var _=require('lodash');var squel=require(_0xeca9('0xe'));var crypto=require(_0xeca9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeca9('0xb'));var querystring=require(_0xeca9('0x10'));var Papa=require(_0xeca9('0x11'));var Redis=require('ioredis');var authService=require(_0xeca9('0x12'));var qs=require(_0xeca9('0x13'));var as=require(_0xeca9('0x14'));var hardwareService=require(_0xeca9('0x15'));var logger=require(_0xeca9('0x16'))(_0xeca9('0x17'));var utils=require('../../config/utils');var config=require(_0xeca9('0x18'));var licenseUtil=require(_0xeca9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27ca6f,_0x4b2ae1){_0x4b2ae1=_0x4b2ae1||0xcc;return function(_0x3c6cc7){if(_0x3c6cc7){return _0x27ca6f[_0xeca9('0x1a')](_0x4b2ae1);}return _0x27ca6f['status'](_0x4b2ae1)[_0xeca9('0x1b')]();};}function respondWithResult(_0x384ae2,_0x1ba9e9){_0x1ba9e9=_0x1ba9e9||0xc8;return function(_0x4d65ee){if(_0x4d65ee){return _0x384ae2[_0xeca9('0x1c')](_0x1ba9e9)[_0xeca9('0x1d')](_0x4d65ee);}};}function respondWithFilteredResult(_0x910814,_0x6e9fd4){return function(_0x551393){if(_0x551393){var _0x520411=typeof _0x6e9fd4[_0xeca9('0x1e')]===_0xeca9('0x1f')&&typeof _0x6e9fd4['limit']===_0xeca9('0x1f');var _0x11bf78=_0x551393['count'];var _0x517060=_0x520411?0x0:_0x6e9fd4['offset'];var _0x132008=_0x520411?_0x551393[_0xeca9('0x20')]:_0x6e9fd4[_0xeca9('0x1e')]+_0x6e9fd4['limit'];var _0xf1ef9f;if(_0x132008>=_0x11bf78){_0x132008=_0x11bf78;_0xf1ef9f=0xc8;}else{_0xf1ef9f=0xce;}_0x910814['status'](_0xf1ef9f);return _0x910814['set'](_0xeca9('0x21'),_0x517060+'-'+_0x132008+'/'+_0x11bf78)['json'](_0x551393);}return null;};}function patchUpdates(_0x31720b){return function(_0x1c4dd6){try{jsonpatch['apply'](_0x1c4dd6,_0x31720b,!![]);}catch(_0x5a2cca){return BPromise[_0xeca9('0x22')](_0x5a2cca);}return _0x1c4dd6['save']();};}function saveUpdates(_0x3647ed,_0x5279d0){return function(_0x3a3608){if(_0x3a3608){return _0x3a3608[_0xeca9('0x23')](_0x3647ed)[_0xeca9('0x24')](function(_0x5c3495){return _0x5c3495;});}return null;};}function removeEntity(_0x3fcfb8,_0x466883){return function(_0x515e63){if(_0x515e63){return _0x515e63[_0xeca9('0x25')]()[_0xeca9('0x24')](function(){_0x3fcfb8[_0xeca9('0x1c')](0xcc)[_0xeca9('0x1b')]();});}};}function handleEntityNotFound(_0x498f4a,_0x32699b){return function(_0x57e190){if(!_0x57e190){_0x498f4a[_0xeca9('0x1a')](0x194);}return _0x57e190;};}function handleError(_0x251ce4,_0x1702fb){_0x1702fb=_0x1702fb||0x1f4;return function(_0x3e41df){logger[_0xeca9('0x26')](_0x3e41df[_0xeca9('0x27')]);if(_0x3e41df[_0xeca9('0x28')]){delete _0x3e41df[_0xeca9('0x28')];}_0x251ce4[_0xeca9('0x1c')](_0x1702fb)[_0xeca9('0x29')](_0x3e41df);};}exports[_0xeca9('0x2a')]=function(_0x3b0aab,_0x424f7b){var _0x1436d0={},_0x8d9a8d={},_0x4910a3={'count':0x0,'rows':[]};var _0x4db3e2=_['map'](db[_0xeca9('0x2b')]['rawAttributes'],function(_0x2ca943){return{'name':_0x2ca943[_0xeca9('0x2c')],'type':_0x2ca943[_0xeca9('0x2d')][_0xeca9('0x2e')]};});_0x8d9a8d[_0xeca9('0x2f')]=_[_0xeca9('0x30')](_0x4db3e2,'name');_0x8d9a8d[_0xeca9('0x31')]=_['keys'](_0x3b0aab[_0xeca9('0x31')]);_0x8d9a8d[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x8d9a8d['model'],_0x8d9a8d[_0xeca9('0x31')]);_0x1436d0[_0xeca9('0x34')]=_[_0xeca9('0x33')](_0x8d9a8d[_0xeca9('0x2f')],qs['fields'](_0x3b0aab[_0xeca9('0x31')]['fields']));_0x1436d0[_0xeca9('0x34')]=_0x1436d0[_0xeca9('0x34')][_0xeca9('0x35')]?_0x1436d0[_0xeca9('0x34')]:_0x8d9a8d[_0xeca9('0x2f')];if(!_0x3b0aab[_0xeca9('0x31')]['hasOwnProperty'](_0xeca9('0x36'))){_0x1436d0[_0xeca9('0x37')]=qs[_0xeca9('0x37')](_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x37')]);_0x1436d0[_0xeca9('0x1e')]=qs[_0xeca9('0x1e')](_0x3b0aab['query'][_0xeca9('0x1e')]);}_0x1436d0[_0xeca9('0x38')]=qs[_0xeca9('0x39')](_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x39')]);_0x1436d0[_0xeca9('0x3a')]=qs['filters'](_[_0xeca9('0x3b')](_0x3b0aab['query'],_0x8d9a8d[_0xeca9('0x32')]),_0x4db3e2);if(_0x3b0aab['query'][_0xeca9('0x3c')]){_0x1436d0[_0xeca9('0x3a')]=_['merge'](_0x1436d0[_0xeca9('0x3a')],{'$or':_['map'](_0x4db3e2,function(_0x2a249b){if(_0x2a249b['type']!==_0xeca9('0x3d')){var _0x5aa0b1={};_0x5aa0b1[_0x2a249b[_0xeca9('0x28')]]={'$like':'%'+_0x3b0aab[_0xeca9('0x31')]['filter']+'%'};return _0x5aa0b1;}})});}_0x1436d0=_[_0xeca9('0x3e')]({},_0x1436d0,_0x3b0aab[_0xeca9('0x3f')]);var _0x4e8080={'where':_0x1436d0[_0xeca9('0x3a')]};return db[_0xeca9('0x2b')][_0xeca9('0x20')](_0x4e8080)[_0xeca9('0x24')](function(_0xb1f2fc){_0x4910a3[_0xeca9('0x20')]=_0xb1f2fc;if(_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x40')]){_0x1436d0[_0xeca9('0x41')]=[{'all':!![]}];}return db['Cdr'][_0xeca9('0x42')](_0x1436d0);})[_0xeca9('0x24')](function(_0x15ef4e){_0x4910a3[_0xeca9('0x43')]=_0x15ef4e;return _0x4910a3;})[_0xeca9('0x24')](respondWithFilteredResult(_0x424f7b,_0x1436d0))[_0xeca9('0x44')](handleError(_0x424f7b,null));};exports[_0xeca9('0x45')]=function(_0x5cb0d1,_0x1d3338){var _0x388943={'raw':!![],'where':{'id':_0x5cb0d1[_0xeca9('0x46')]['id']}},_0x188ebc={};_0x188ebc[_0xeca9('0x2f')]=_['keys'](db[_0xeca9('0x2b')][_0xeca9('0x47')]);_0x188ebc[_0xeca9('0x31')]=_[_0xeca9('0x48')](_0x5cb0d1['query']);_0x188ebc[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x188ebc['model'],_0x188ebc[_0xeca9('0x31')]);_0x388943[_0xeca9('0x34')]=_[_0xeca9('0x33')](_0x188ebc[_0xeca9('0x2f')],qs[_0xeca9('0x49')](_0x5cb0d1[_0xeca9('0x31')][_0xeca9('0x49')]));_0x388943[_0xeca9('0x34')]=_0x388943[_0xeca9('0x34')][_0xeca9('0x35')]?_0x388943[_0xeca9('0x34')]:_0x188ebc[_0xeca9('0x2f')];if(_0x5cb0d1[_0xeca9('0x31')][_0xeca9('0x40')]){_0x388943[_0xeca9('0x41')]=[{'all':!![]}];}_0x388943=_['merge']({},_0x388943,_0x5cb0d1[_0xeca9('0x3f')]);return db[_0xeca9('0x2b')][_0xeca9('0x4a')](_0x388943)[_0xeca9('0x24')](handleEntityNotFound(_0x1d3338,null))['then'](respondWithResult(_0x1d3338,null))[_0xeca9('0x44')](handleError(_0x1d3338,null));};exports[_0xeca9('0x4b')]=function(_0x548fab,_0x5e6dc2){return db[_0xeca9('0x2b')][_0xeca9('0x4b')](_0x548fab[_0xeca9('0x4c')],{})[_0xeca9('0x24')](respondWithResult(_0x5e6dc2,0xc9))['catch'](handleError(_0x5e6dc2,null));};exports[_0xeca9('0x23')]=function(_0xa4faf9,_0x346c62){if(_0xa4faf9[_0xeca9('0x4c')]['id']){delete _0xa4faf9[_0xeca9('0x4c')]['id'];}return db[_0xeca9('0x2b')][_0xeca9('0x4a')]({'where':{'id':_0xa4faf9[_0xeca9('0x46')]['id']}})[_0xeca9('0x24')](handleEntityNotFound(_0x346c62,null))['then'](saveUpdates(_0xa4faf9['body'],null))[_0xeca9('0x24')](respondWithResult(_0x346c62,null))[_0xeca9('0x44')](handleError(_0x346c62,null));};exports['destroy']=function(_0x283d2d,_0x315f54){return db[_0xeca9('0x2b')][_0xeca9('0x4a')]({'where':{'id':_0x283d2d[_0xeca9('0x46')]['id']}})[_0xeca9('0x24')](handleEntityNotFound(_0x315f54,null))[_0xeca9('0x24')](removeEntity(_0x315f54,null))[_0xeca9('0x44')](handleError(_0x315f54,null));};exports[_0xeca9('0x4d')]=function(_0x56a212,_0x5cd84d){return db['Cdr']['describe']()[_0xeca9('0x24')](respondWithResult(_0x5cd84d,null))['catch'](handleError(_0x5cd84d,null));};
\ No newline at end of file
+var _0x5ad3=['destroy','error','stack','name','index','map','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','Cdr','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then'];(function(_0x5cba92,_0x250215){var _0x11f9a9=function(_0x39a311){while(--_0x39a311){_0x5cba92['push'](_0x5cba92['shift']());}};_0x11f9a9(++_0x250215);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x2ef252,_0x1993fe){_0x2ef252=_0x2ef252-0x0;var _0x1139ca=_0x5ad3[_0x2ef252];return _0x1139ca;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={},_0x2c82f1={},_0x481803={'count':0x0,'rows':[]};var _0x571ad6=_[_0x35ad('0x29')](db['Cdr'][_0x35ad('0x2a')],function(_0x4ccaea){return{'name':_0x4ccaea['fieldName'],'type':_0x4ccaea['type']['key']};});_0x2c82f1[_0x35ad('0x2b')]=_['map'](_0x571ad6,'name');_0x2c82f1[_0x35ad('0x2c')]=_['keys'](_0x11da54[_0x35ad('0x2c')]);_0x2c82f1['filters']=_[_0x35ad('0x2d')](_0x2c82f1['model'],_0x2c82f1[_0x35ad('0x2c')]);_0x34b8b9['attributes']=_[_0x35ad('0x2d')](_0x2c82f1[_0x35ad('0x2b')],qs[_0x35ad('0x2e')](_0x11da54['query'][_0x35ad('0x2e')]));_0x34b8b9[_0x35ad('0x2f')]=_0x34b8b9[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x34b8b9[_0x35ad('0x2f')]:_0x2c82f1['model'];if(!_0x11da54['query'][_0x35ad('0x31')](_0x35ad('0x32'))){_0x34b8b9[_0x35ad('0x1d')]=qs[_0x35ad('0x1d')](_0x11da54['query'][_0x35ad('0x1d')]);_0x34b8b9[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x11da54[_0x35ad('0x2c')][_0x35ad('0x1a')]);}_0x34b8b9[_0x35ad('0x33')]=qs['sort'](_0x11da54['query'][_0x35ad('0x34')]);_0x34b8b9[_0x35ad('0x35')]=qs[_0x35ad('0x36')](_[_0x35ad('0x37')](_0x11da54[_0x35ad('0x2c')],_0x2c82f1[_0x35ad('0x36')]),_0x571ad6);if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]){_0x34b8b9[_0x35ad('0x35')]=_['merge'](_0x34b8b9[_0x35ad('0x35')],{'$or':_['map'](_0x571ad6,function(_0x25e63e){if(_0x25e63e[_0x35ad('0x39')]!==_0x35ad('0x3a')){var _0x38d1c9={};_0x38d1c9[_0x25e63e[_0x35ad('0x27')]]={'$like':'%'+_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]+'%'};return _0x38d1c9;}})});}_0x34b8b9=_[_0x35ad('0x3b')]({},_0x34b8b9,_0x11da54[_0x35ad('0x3c')]);var _0x5dd327={'where':_0x34b8b9[_0x35ad('0x35')]};return db[_0x35ad('0x3d')][_0x35ad('0x1c')](_0x5dd327)['then'](function(_0x19d82d){_0x481803[_0x35ad('0x1c')]=_0x19d82d;if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x34b8b9[_0x35ad('0x3f')]=[{'all':!![]}];}return db[_0x35ad('0x3d')][_0x35ad('0x40')](_0x34b8b9);})[_0x35ad('0x23')](function(_0x11de09){_0x481803[_0x35ad('0x41')]=_0x11de09;return _0x481803;})[_0x35ad('0x23')](respondWithFilteredResult(_0x2f8b3,_0x34b8b9))['catch'](handleError(_0x2f8b3,null));};exports[_0x35ad('0x42')]=function(_0x4edc2b,_0x3de722){var _0x3b80c0={'raw':!![],'where':{'id':_0x4edc2b[_0x35ad('0x43')]['id']}},_0x3df623={};_0x3df623[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db[_0x35ad('0x3d')][_0x35ad('0x2a')]);_0x3df623[_0x35ad('0x2c')]=_['keys'](_0x4edc2b[_0x35ad('0x2c')]);_0x3df623[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],_0x3df623[_0x35ad('0x2c')]);_0x3b80c0['attributes']=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],qs['fields'](_0x4edc2b['query'][_0x35ad('0x2e')]));_0x3b80c0[_0x35ad('0x2f')]=_0x3b80c0[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x3b80c0['attributes']:_0x3df623[_0x35ad('0x2b')];if(_0x4edc2b[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x3b80c0[_0x35ad('0x3f')]=[{'all':!![]}];}_0x3b80c0=_[_0x35ad('0x3b')]({},_0x3b80c0,_0x4edc2b[_0x35ad('0x3c')]);return db[_0x35ad('0x3d')]['find'](_0x3b80c0)[_0x35ad('0x23')](handleEntityNotFound(_0x3de722,null))[_0x35ad('0x23')](respondWithResult(_0x3de722,null))[_0x35ad('0x45')](handleError(_0x3de722,null));};exports['create']=function(_0x5e3f96,_0x5644c4){return db[_0x35ad('0x3d')][_0x35ad('0x46')](_0x5e3f96[_0x35ad('0x47')],{})[_0x35ad('0x23')](respondWithResult(_0x5644c4,0xc9))['catch'](handleError(_0x5644c4,null));};exports[_0x35ad('0x22')]=function(_0x46c462,_0x3583ca){if(_0x46c462[_0x35ad('0x47')]['id']){delete _0x46c462[_0x35ad('0x47')]['id'];}return db[_0x35ad('0x3d')]['find']({'where':{'id':_0x46c462['params']['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x3583ca,null))[_0x35ad('0x23')](saveUpdates(_0x46c462['body'],null))['then'](respondWithResult(_0x3583ca,null))[_0x35ad('0x45')](handleError(_0x3583ca,null));};exports[_0x35ad('0x24')]=function(_0x196ebd,_0x5c7dbd){return db['Cdr'][_0x35ad('0x48')]({'where':{'id':_0x196ebd[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x5c7dbd,null))['then'](removeEntity(_0x5c7dbd,null))[_0x35ad('0x45')](handleError(_0x5c7dbd,null));};exports[_0x35ad('0x49')]=function(_0x34061c,_0x467887){return db[_0x35ad('0x3d')][_0x35ad('0x49')]()['then'](respondWithResult(_0x467887,null))[_0x35ad('0x45')](handleError(_0x467887,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 662f6e6..12fd3ea 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4b84df,_0x21d1ce){var _0x4d31fe=function(_0xbf78dc){while(--_0xbf78dc){_0x4b84df['push'](_0x4b84df['shift']());}};_0x4d31fe(++_0x21d1ce);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x586336,_0xa94667){var _0xbf3686=function(_0x21ffc3){while(--_0x21ffc3){_0x586336['push'](_0x586336['shift']());}};_0xbf3686(++_0xa94667);}(_0x7a54,0x106));var _0x47a5=function(_0x55d611,_0x3dcec5){_0x55d611=_0x55d611-0x0;var _0x54c460=_0x7a54[_0x55d611];return _0x54c460;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 3392427..3cde704 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 _0x7732=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Cdr,\x20%s,\x20%s'];(function(_0x10aec2,_0x1b346f){var _0x5b69ab=function(_0xe8505a){while(--_0xe8505a){_0x10aec2['push'](_0x10aec2['shift']());}};_0x5b69ab(++_0x1b346f);}(_0x7732,0x173));var _0x2773=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x7732[_0x595013];return _0x2a29e3;};'use strict';var _=require(_0x2773('0x0'));var util=require('util');var moment=require(_0x2773('0x1'));var BPromise=require(_0x2773('0x2'));var rs=require(_0x2773('0x3'));var fs=require('fs');var Redis=require(_0x2773('0x4'));var db=require(_0x2773('0x5'))['db'];var utils=require(_0x2773('0x6'));var logger=require('../../config/logger')(_0x2773('0x7'));var config=require(_0x2773('0x8'));var jayson=require(_0x2773('0x9'));var client=jayson['client'][_0x2773('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x440dac,_0xd3e2b9,_0x1134c7){return new BPromise(function(_0x2bb392,_0x5c8256){return client[_0x2773('0xb')](_0x440dac,_0x1134c7)[_0x2773('0xc')](function(_0x211ae5){logger[_0x2773('0xd')]('Cdr,\x20%s,\x20%s',_0xd3e2b9,'request\x20sent');logger[_0x2773('0xe')](_0x2773('0xf'),_0xd3e2b9,_0x2773('0x10'),JSON['stringify'](_0x211ae5));if(_0x211ae5['error']){if(_0x211ae5[_0x2773('0x11')][_0x2773('0x12')]===0x1f4){logger['error'](_0x2773('0x13'),_0xd3e2b9,_0x211ae5[_0x2773('0x11')][_0x2773('0x14')]);return _0x5c8256(_0x211ae5[_0x2773('0x11')][_0x2773('0x14')]);}logger[_0x2773('0x11')](_0x2773('0x13'),_0xd3e2b9,_0x211ae5[_0x2773('0x11')][_0x2773('0x14')]);return _0x2bb392(_0x211ae5[_0x2773('0x11')][_0x2773('0x14')]);}else{logger[_0x2773('0xd')]('Cdr,\x20%s,\x20%s',_0xd3e2b9,'request\x20sent');_0x2bb392(_0x211ae5[_0x2773('0x15')][_0x2773('0x14')]);}})[_0x2773('0x16')](function(_0x1f5ce3){logger[_0x2773('0x11')](_0x2773('0x13'),_0xd3e2b9,_0x1f5ce3);_0x5c8256(_0x1f5ce3);});});}
\ No newline at end of file
+var _0x93d7=['../../config/logger','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x452217,_0x1cc6bb){var _0xdf3b73=function(_0x89c60b){while(--_0x89c60b){_0x452217['push'](_0x452217['shift']());}};_0xdf3b73(++_0x1cc6bb);}(_0x93d7,0x1da));var _0x793d=function(_0x4ce159,_0x2179be){_0x4ce159=_0x4ce159-0x0;var _0x526517=_0x93d7[_0x4ce159];return _0x526517;};'use strict';var _=require(_0x793d('0x0'));var util=require(_0x793d('0x1'));var moment=require(_0x793d('0x2'));var BPromise=require('bluebird');var rs=require(_0x793d('0x3'));var fs=require('fs');var Redis=require(_0x793d('0x4'));var db=require(_0x793d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x793d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x793d('0x7'));var client=jayson['client'][_0x793d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21bebd,_0x912746,_0x1c9dca){return new BPromise(function(_0x467fdd,_0x42792e){return client[_0x793d('0x9')](_0x21bebd,_0x1c9dca)[_0x793d('0xa')](function(_0x516d4a){logger[_0x793d('0xb')](_0x793d('0xc'),_0x912746,'request\x20sent');logger['debug'](_0x793d('0xd'),_0x912746,_0x793d('0xe'),JSON['stringify'](_0x516d4a));if(_0x516d4a[_0x793d('0xf')]){if(_0x516d4a[_0x793d('0xf')][_0x793d('0x10')]===0x1f4){logger[_0x793d('0xf')](_0x793d('0xc'),_0x912746,_0x516d4a[_0x793d('0xf')][_0x793d('0x11')]);return _0x42792e(_0x516d4a[_0x793d('0xf')][_0x793d('0x11')]);}logger['error'](_0x793d('0xc'),_0x912746,_0x516d4a[_0x793d('0xf')][_0x793d('0x11')]);return _0x467fdd(_0x516d4a[_0x793d('0xf')][_0x793d('0x11')]);}else{logger['info'](_0x793d('0xc'),_0x912746,_0x793d('0xe'));_0x467fdd(_0x516d4a[_0x793d('0x12')][_0x793d('0x11')]);}})[_0x793d('0x13')](function(_0x31f617){logger[_0x793d('0xf')](_0x793d('0xc'),_0x912746,_0x31f617);_0x42792e(_0x31f617);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 39399ec..ff53b9a 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xc3f3bd,_0x20b7f5){var _0x27d0bd=function(_0x2d0977){while(--_0x2d0977){_0xc3f3bd['push'](_0xc3f3bd['shift']());}};_0x27d0bd(++_0x20b7f5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index f050dec..549ea4e 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 _0x1bf0=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1bf0,0x116));var _0x01bf=function(_0x248c1e,_0x3468f6){_0x248c1e=_0x248c1e-0x0;var _0x330688=_0x1bf0[_0x248c1e];return _0x330688;};'use strict';var Sequelize=require(_0x01bf('0x0'));module[_0x01bf('0x1')]={'priority':{'type':Sequelize[_0x01bf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x01bf('0x3')],'allowNull':![],'defaultValue':_0x01bf('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x01bf('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x01bf('0x5')}};
\ No newline at end of file
+var _0x9320=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x566168,_0x4c39af){var _0x4e1f7a=function(_0x5ec3ee){while(--_0x5ec3ee){_0x566168['push'](_0x566168['shift']());}};_0x4e1f7a(++_0x4c39af);}(_0x9320,0x72));var _0x0932=function(_0x3af017,_0x6b7516){_0x3af017=_0x3af017-0x0;var _0x104228=_0x9320[_0x3af017];return _0x104228;};'use strict';var Sequelize=require(_0x0932('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0932('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0932('0x2')],'allowNull':![],'defaultValue':_0x0932('0x3')},'appdata':{'type':Sequelize[_0x0932('0x4')]()},'description':{'type':Sequelize[_0x0932('0x2')]},'interval':{'type':Sequelize[_0x0932('0x2')],'defaultValue':_0x0932('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 10f6be2..9128f7c 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 _0x7229=['zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','params','keys','ChatApplication','query','filters','intersection','model','fields','attributes','length','include','merge','options','find','catch','body','eml-format','rimraf'];(function(_0x1f07a8,_0x407446){var _0x23cabd=function(_0x357c38){while(--_0x357c38){_0x1f07a8['push'](_0x1f07a8['shift']());}};_0x23cabd(++_0x407446);}(_0x7229,0x76));var _0x9722=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7229[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x9722('0x0'));var rimraf=require(_0x9722('0x1'));var zipdir=require(_0x9722('0x2'));var jsonpatch=require(_0x9722('0x3'));var rp=require(_0x9722('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9722('0x5'));var util=require(_0x9722('0x6'));var path=require(_0x9722('0x7'));var sox=require(_0x9722('0x8'));var csv=require(_0x9722('0x9'));var ejs=require(_0x9722('0xa'));var fs=require('fs');var fs_extra=require(_0x9722('0xb'));var _=require('lodash');var squel=require(_0x9722('0xc'));var crypto=require('crypto');var jsforce=require(_0x9722('0xd'));var deskjs=require(_0x9722('0xe'));var toCsv=require(_0x9722('0x9'));var querystring=require(_0x9722('0xf'));var Papa=require(_0x9722('0x10'));var Redis=require(_0x9722('0x11'));var authService=require(_0x9722('0x12'));var qs=require(_0x9722('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9722('0x14'))(_0x9722('0x15'));var utils=require(_0x9722('0x16'));var config=require(_0x9722('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9722('0x18'))['db'];function respondWithStatusCode(_0x32fd25,_0x11942f){_0x11942f=_0x11942f||0xcc;return function(_0x124bfc){if(_0x124bfc){return _0x32fd25['sendStatus'](_0x11942f);}return _0x32fd25[_0x9722('0x19')](_0x11942f)[_0x9722('0x1a')]();};}function respondWithResult(_0x256348,_0x248bdf){_0x248bdf=_0x248bdf||0xc8;return function(_0x2f1c3b){if(_0x2f1c3b){return _0x256348['status'](_0x248bdf)[_0x9722('0x1b')](_0x2f1c3b);}};}function respondWithFilteredResult(_0x203db5,_0x2f2f96){return function(_0x482ad4){if(_0x482ad4){var _0xc802f7=typeof _0x2f2f96[_0x9722('0x1c')]==='undefined'&&typeof _0x2f2f96[_0x9722('0x1d')]===_0x9722('0x1e');var _0x38e179=_0x482ad4['count'];var _0x43b3fa=_0xc802f7?0x0:_0x2f2f96[_0x9722('0x1c')];var _0x38112a=_0xc802f7?_0x482ad4[_0x9722('0x1f')]:_0x2f2f96[_0x9722('0x1c')]+_0x2f2f96[_0x9722('0x1d')];var _0x2481f5;if(_0x38112a>=_0x38e179){_0x38112a=_0x38e179;_0x2481f5=0xc8;}else{_0x2481f5=0xce;}_0x203db5[_0x9722('0x19')](_0x2481f5);return _0x203db5[_0x9722('0x20')](_0x9722('0x21'),_0x43b3fa+'-'+_0x38112a+'/'+_0x38e179)[_0x9722('0x1b')](_0x482ad4);}return null;};}function patchUpdates(_0x23e9d0){return function(_0x451ce8){try{jsonpatch[_0x9722('0x22')](_0x451ce8,_0x23e9d0,!![]);}catch(_0x3b094d){return BPromise[_0x9722('0x23')](_0x3b094d);}return _0x451ce8['save']();};}function saveUpdates(_0x22a3e2,_0x3ab4d4){return function(_0x3abf4b){if(_0x3abf4b){return _0x3abf4b[_0x9722('0x24')](_0x22a3e2)[_0x9722('0x25')](function(_0x392d59){return _0x392d59;});}return null;};}function removeEntity(_0x4aeea7,_0x73c303){return function(_0x1aff40){if(_0x1aff40){return _0x1aff40[_0x9722('0x26')]()[_0x9722('0x25')](function(){_0x4aeea7[_0x9722('0x19')](0xcc)[_0x9722('0x1a')]();});}};}function handleEntityNotFound(_0x3b3ce9,_0x1f2ad8){return function(_0x4aab4e){if(!_0x4aab4e){_0x3b3ce9[_0x9722('0x27')](0x194);}return _0x4aab4e;};}function handleError(_0x5bf6f2,_0x141c7d){_0x141c7d=_0x141c7d||0x1f4;return function(_0x19a7b6){logger[_0x9722('0x28')](_0x19a7b6[_0x9722('0x29')]);if(_0x19a7b6[_0x9722('0x2a')]){delete _0x19a7b6[_0x9722('0x2a')];}_0x5bf6f2[_0x9722('0x19')](_0x141c7d)[_0x9722('0x2b')](_0x19a7b6);};}exports['show']=function(_0x19ffa8,_0x4805be){var _0x568ddc={'raw':!![],'where':{'id':_0x19ffa8[_0x9722('0x2c')]['id']}},_0x18fa43={};_0x18fa43['model']=_[_0x9722('0x2d')](db[_0x9722('0x2e')]['rawAttributes']);_0x18fa43['query']=_[_0x9722('0x2d')](_0x19ffa8[_0x9722('0x2f')]);_0x18fa43[_0x9722('0x30')]=_[_0x9722('0x31')](_0x18fa43[_0x9722('0x32')],_0x18fa43[_0x9722('0x2f')]);_0x568ddc['attributes']=_[_0x9722('0x31')](_0x18fa43[_0x9722('0x32')],qs[_0x9722('0x33')](_0x19ffa8[_0x9722('0x2f')]['fields']));_0x568ddc[_0x9722('0x34')]=_0x568ddc[_0x9722('0x34')][_0x9722('0x35')]?_0x568ddc['attributes']:_0x18fa43['model'];if(_0x19ffa8[_0x9722('0x2f')]['includeAll']){_0x568ddc[_0x9722('0x36')]=[{'all':!![]}];}_0x568ddc=_[_0x9722('0x37')]({},_0x568ddc,_0x19ffa8[_0x9722('0x38')]);return db[_0x9722('0x2e')][_0x9722('0x39')](_0x568ddc)[_0x9722('0x25')](handleEntityNotFound(_0x4805be,null))[_0x9722('0x25')](respondWithResult(_0x4805be,null))[_0x9722('0x3a')](handleError(_0x4805be,null));};exports[_0x9722('0x24')]=function(_0x463dd8,_0x427244){if(_0x463dd8[_0x9722('0x3b')]['id']){delete _0x463dd8['body']['id'];}return db['ChatApplication'][_0x9722('0x39')]({'where':{'id':_0x463dd8[_0x9722('0x2c')]['id']}})[_0x9722('0x25')](handleEntityNotFound(_0x427244,null))[_0x9722('0x25')](saveUpdates(_0x463dd8[_0x9722('0x3b')],null))[_0x9722('0x25')](respondWithResult(_0x427244,null))[_0x9722('0x3a')](handleError(_0x427244,null));};exports[_0x9722('0x26')]=function(_0x519368,_0x44b9f4){return db['ChatApplication']['find']({'where':{'id':_0x519368[_0x9722('0x2c')]['id']}})[_0x9722('0x25')](handleEntityNotFound(_0x44b9f4,null))[_0x9722('0x25')](removeEntity(_0x44b9f4,null))['catch'](handleError(_0x44b9f4,null));};
\ No newline at end of file
+var _0x3d15=['squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','catch','update','body','find','params','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x3d15,0x127));var _0x53d1=function(_0x3d9dc2,_0x4d0f69){_0x3d9dc2=_0x3d9dc2-0x0;var _0x9f75a0=_0x3d15[_0x3d9dc2];return _0x9f75a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53d1('0x0'));var zipdir=require(_0x53d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53d1('0x2'));var moment=require(_0x53d1('0x3'));var BPromise=require(_0x53d1('0x4'));var Mustache=require('mustache');var util=require(_0x53d1('0x5'));var path=require(_0x53d1('0x6'));var sox=require(_0x53d1('0x7'));var csv=require('to-csv');var ejs=require(_0x53d1('0x8'));var fs=require('fs');var fs_extra=require(_0x53d1('0x9'));var _=require('lodash');var squel=require(_0x53d1('0xa'));var crypto=require(_0x53d1('0xb'));var jsforce=require(_0x53d1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x53d1('0xd'));var querystring=require(_0x53d1('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x53d1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x53d1('0x10'));var hardwareService=require(_0x53d1('0x11'));var logger=require(_0x53d1('0x12'))(_0x53d1('0x13'));var utils=require(_0x53d1('0x14'));var config=require(_0x53d1('0x15'));var licenseUtil=require(_0x53d1('0x16'));var db=require(_0x53d1('0x17'))['db'];function respondWithStatusCode(_0x518ed8,_0x28fd72){_0x28fd72=_0x28fd72||0xcc;return function(_0x4467db){if(_0x4467db){return _0x518ed8[_0x53d1('0x18')](_0x28fd72);}return _0x518ed8[_0x53d1('0x19')](_0x28fd72)[_0x53d1('0x1a')]();};}function respondWithResult(_0xc2dba9,_0x17ccb5){_0x17ccb5=_0x17ccb5||0xc8;return function(_0x4fd437){if(_0x4fd437){return _0xc2dba9[_0x53d1('0x19')](_0x17ccb5)[_0x53d1('0x1b')](_0x4fd437);}};}function respondWithFilteredResult(_0x11d41c,_0xcb529b){return function(_0x1b94f3){if(_0x1b94f3){var _0x5a1de3=typeof _0xcb529b[_0x53d1('0x1c')]===_0x53d1('0x1d')&&typeof _0xcb529b[_0x53d1('0x1e')]==='undefined';var _0x8de663=_0x1b94f3[_0x53d1('0x1f')];var _0x280900=_0x5a1de3?0x0:_0xcb529b[_0x53d1('0x1c')];var _0x2e9e96=_0x5a1de3?_0x1b94f3[_0x53d1('0x1f')]:_0xcb529b[_0x53d1('0x1c')]+_0xcb529b[_0x53d1('0x1e')];var _0x52095a;if(_0x2e9e96>=_0x8de663){_0x2e9e96=_0x8de663;_0x52095a=0xc8;}else{_0x52095a=0xce;}_0x11d41c[_0x53d1('0x19')](_0x52095a);return _0x11d41c[_0x53d1('0x20')](_0x53d1('0x21'),_0x280900+'-'+_0x2e9e96+'/'+_0x8de663)[_0x53d1('0x1b')](_0x1b94f3);}return null;};}function patchUpdates(_0x5e5a56){return function(_0x21cffe){try{jsonpatch[_0x53d1('0x22')](_0x21cffe,_0x5e5a56,!![]);}catch(_0x25323b){return BPromise[_0x53d1('0x23')](_0x25323b);}return _0x21cffe[_0x53d1('0x24')]();};}function saveUpdates(_0x503a8e,_0x60aee1){return function(_0x4ed348){if(_0x4ed348){return _0x4ed348['update'](_0x503a8e)[_0x53d1('0x25')](function(_0x57afd8){return _0x57afd8;});}return null;};}function removeEntity(_0x31adde,_0x56c15f){return function(_0x567f46){if(_0x567f46){return _0x567f46[_0x53d1('0x26')]()['then'](function(){_0x31adde['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd304d2,_0x1fbf33){return function(_0x5eaf29){if(!_0x5eaf29){_0xd304d2[_0x53d1('0x18')](0x194);}return _0x5eaf29;};}function handleError(_0x10275c,_0x4ae83b){_0x4ae83b=_0x4ae83b||0x1f4;return function(_0x465698){logger[_0x53d1('0x27')](_0x465698[_0x53d1('0x28')]);if(_0x465698[_0x53d1('0x29')]){delete _0x465698[_0x53d1('0x29')];}_0x10275c[_0x53d1('0x19')](_0x4ae83b)['send'](_0x465698);};}exports[_0x53d1('0x2a')]=function(_0x25e54d,_0x2f7609){var _0x81c56b={'raw':!![],'where':{'id':_0x25e54d['params']['id']}},_0x421306={};_0x421306[_0x53d1('0x2b')]=_[_0x53d1('0x2c')](db[_0x53d1('0x2d')][_0x53d1('0x2e')]);_0x421306[_0x53d1('0x2f')]=_[_0x53d1('0x2c')](_0x25e54d[_0x53d1('0x2f')]);_0x421306[_0x53d1('0x30')]=_[_0x53d1('0x31')](_0x421306['model'],_0x421306[_0x53d1('0x2f')]);_0x81c56b[_0x53d1('0x32')]=_[_0x53d1('0x31')](_0x421306[_0x53d1('0x2b')],qs['fields'](_0x25e54d[_0x53d1('0x2f')][_0x53d1('0x33')]));_0x81c56b[_0x53d1('0x32')]=_0x81c56b['attributes'][_0x53d1('0x34')]?_0x81c56b[_0x53d1('0x32')]:_0x421306[_0x53d1('0x2b')];if(_0x25e54d[_0x53d1('0x2f')][_0x53d1('0x35')]){_0x81c56b[_0x53d1('0x36')]=[{'all':!![]}];}_0x81c56b=_[_0x53d1('0x37')]({},_0x81c56b,_0x25e54d['options']);return db[_0x53d1('0x2d')]['find'](_0x81c56b)[_0x53d1('0x25')](handleEntityNotFound(_0x2f7609,null))[_0x53d1('0x25')](respondWithResult(_0x2f7609,null))[_0x53d1('0x38')](handleError(_0x2f7609,null));};exports[_0x53d1('0x39')]=function(_0x163eb6,_0x529213){if(_0x163eb6['body']['id']){delete _0x163eb6[_0x53d1('0x3a')]['id'];}return db['ChatApplication'][_0x53d1('0x3b')]({'where':{'id':_0x163eb6[_0x53d1('0x3c')]['id']}})['then'](handleEntityNotFound(_0x529213,null))['then'](saveUpdates(_0x163eb6[_0x53d1('0x3a')],null))[_0x53d1('0x25')](respondWithResult(_0x529213,null))[_0x53d1('0x38')](handleError(_0x529213,null));};exports[_0x53d1('0x26')]=function(_0x32f304,_0x1685ab){return db['ChatApplication']['find']({'where':{'id':_0x32f304['params']['id']}})['then'](handleEntityNotFound(_0x1685ab,null))[_0x53d1('0x25')](removeEntity(_0x1685ab,null))[_0x53d1('0x38')](handleError(_0x1685ab,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9fca96e..df49ae3 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 _0xdb6e=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','lodash'];(function(_0x2ae255,_0x41e53a){var _0x43e3f8=function(_0x1943ff){while(--_0x1943ff){_0x2ae255['push'](_0x2ae255['shift']());}};_0x43e3f8(++_0x41e53a);}(_0xdb6e,0x179));var _0xedb6=function(_0x54f072,_0x39e1fd){_0x54f072=_0x54f072-0x0;var _0x42e317=_0xdb6e[_0x54f072];return _0x42e317;};'use strict';var _=require(_0xedb6('0x0'));var util=require(_0xedb6('0x1'));var logger=require(_0xedb6('0x2'))(_0xedb6('0x3'));var moment=require(_0xedb6('0x4'));var BPromise=require(_0xedb6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedb6('0x6'));var rimraf=require(_0xedb6('0x7'));var config=require(_0xedb6('0x8'));var attributes=require(_0xedb6('0x9'));module[_0xedb6('0xa')]=function(_0x30de0d,_0x35f987){return _0x30de0d['define'](_0xedb6('0xb'),attributes,{'tableName':_0xedb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedb6('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x190a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x368247,_0x30870d){var _0x35547b=function(_0x3c1b2b){while(--_0x3c1b2b){_0x368247['push'](_0x368247['shift']());}};_0x35547b(++_0x30870d);}(_0x190a,0x1ea));var _0xa190=function(_0x5ea0b2,_0x288293){_0x5ea0b2=_0x5ea0b2-0x0;var _0x1d27f8=_0x190a[_0x5ea0b2];return _0x1d27f8;};'use strict';var _=require(_0xa190('0x0'));var util=require(_0xa190('0x1'));var logger=require(_0xa190('0x2'))(_0xa190('0x3'));var moment=require(_0xa190('0x4'));var BPromise=require(_0xa190('0x5'));var rp=require(_0xa190('0x6'));var fs=require('fs');var path=require(_0xa190('0x7'));var rimraf=require(_0xa190('0x8'));var config=require('../../config/environment');var attributes=require(_0xa190('0x9'));module['exports']=function(_0x230098,_0x2207f2){return _0x230098['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa190('0xa'),'collate':_0xa190('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 39a8af2..c601ba8 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 _0x4142=['stringify','error','code','message','ChatApplication,\x20%s,\x20%s','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4142,0x1f4));var _0x2414=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4142[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2414('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2414('0x1'));var db=require(_0x2414('0x2'))['db'];var utils=require(_0x2414('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x2414('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2414('0x5')][_0x2414('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x58895f,_0x321050,_0x50c5ad){return new BPromise(function(_0x43a54f,_0x36e886){return client[_0x2414('0x7')](_0x58895f,_0x50c5ad)[_0x2414('0x8')](function(_0x3d6b06){logger[_0x2414('0x9')]('ChatApplication,\x20%s,\x20%s',_0x321050,_0x2414('0xa'));logger[_0x2414('0xb')](_0x2414('0xc'),_0x321050,'request\x20sent',JSON[_0x2414('0xd')](_0x3d6b06));if(_0x3d6b06[_0x2414('0xe')]){if(_0x3d6b06[_0x2414('0xe')][_0x2414('0xf')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x321050,_0x3d6b06[_0x2414('0xe')][_0x2414('0x10')]);return _0x36e886(_0x3d6b06[_0x2414('0xe')]['message']);}logger[_0x2414('0xe')]('ChatApplication,\x20%s,\x20%s',_0x321050,_0x3d6b06[_0x2414('0xe')]['message']);return _0x43a54f(_0x3d6b06['error'][_0x2414('0x10')]);}else{logger[_0x2414('0x9')](_0x2414('0x11'),_0x321050,'request\x20sent');_0x43a54f(_0x3d6b06['result']['message']);}})[_0x2414('0x12')](function(_0x8cca88){logger['error'](_0x2414('0x11'),_0x321050,_0x8cca88);_0x36e886(_0x8cca88);});});}
\ No newline at end of file
+var _0xcef8=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','lodash'];(function(_0x25a09c,_0x544c01){var _0x4d8538=function(_0x1ae38d){while(--_0x1ae38d){_0x25a09c['push'](_0x25a09c['shift']());}};_0x4d8538(++_0x544c01);}(_0xcef8,0x7d));var _0x8cef=function(_0x148cd4,_0x3bb783){_0x148cd4=_0x148cd4-0x0;var _0x1b8338=_0xcef8[_0x148cd4];return _0x1b8338;};'use strict';var _=require(_0x8cef('0x0'));var util=require(_0x8cef('0x1'));var moment=require(_0x8cef('0x2'));var BPromise=require(_0x8cef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8cef('0x4'));var logger=require(_0x8cef('0x5'))(_0x8cef('0x6'));var config=require(_0x8cef('0x7'));var jayson=require(_0x8cef('0x8'));var client=jayson[_0x8cef('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ca929,_0x228694,_0xbe529d){return new BPromise(function(_0x2f2999,_0x40d5cd){return client[_0x8cef('0xa')](_0x2ca929,_0xbe529d)['then'](function(_0x2ce131){logger[_0x8cef('0xb')](_0x8cef('0xc'),_0x228694,'request\x20sent');logger['debug'](_0x8cef('0xd'),_0x228694,'request\x20sent',JSON['stringify'](_0x2ce131));if(_0x2ce131['error']){if(_0x2ce131[_0x8cef('0xe')]['code']===0x1f4){logger[_0x8cef('0xe')](_0x8cef('0xc'),_0x228694,_0x2ce131['error']['message']);return _0x40d5cd(_0x2ce131[_0x8cef('0xe')][_0x8cef('0xf')]);}logger[_0x8cef('0xe')]('ChatApplication,\x20%s,\x20%s',_0x228694,_0x2ce131[_0x8cef('0xe')]['message']);return _0x2f2999(_0x2ce131[_0x8cef('0xe')]['message']);}else{logger[_0x8cef('0xb')](_0x8cef('0xc'),_0x228694,_0x8cef('0x10'));_0x2f2999(_0x2ce131[_0x8cef('0x11')]['message']);}})['catch'](function(_0x106efa){logger[_0x8cef('0xe')](_0x8cef('0xc'),_0x228694,_0x106efa);_0x40d5cd(_0x106efa);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index dd3f83f..e2fbb69 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 _0x33b5=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0x33b5,0x1e1));var _0x533b=function(_0x4d57a6,_0x4555ec){_0x4d57a6=_0x4d57a6-0x0;var _0x250376=_0x33b5[_0x4d57a6];return _0x250376;};'use strict';var multer=require(_0x533b('0x0'));var util=require(_0x533b('0x1'));var path=require(_0x533b('0x2'));var timeout=require(_0x533b('0x3'));var express=require(_0x533b('0x4'));var router=express[_0x533b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x533b('0x6'));var interaction=require(_0x533b('0x7'));var config=require('../../config/environment');var controller=require(_0x533b('0x8'));router[_0x533b('0x9')](_0x533b('0xa'),auth[_0x533b('0xb')](),controller['show']);router[_0x533b('0xc')](_0x533b('0xa'),auth['isAuthenticated'](),controller[_0x533b('0xd')]);router[_0x533b('0xe')](_0x533b('0xa'),auth[_0x533b('0xb')](),controller[_0x533b('0xf')]);module[_0x533b('0x10')]=router;
\ No newline at end of file
+var _0x2761=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x5d1044,_0x18f656){var _0x3cd90e=function(_0x3c40be){while(--_0x3c40be){_0x5d1044['push'](_0x5d1044['shift']());}};_0x3cd90e(++_0x18f656);}(_0x2761,0xa2));var _0x1276=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2761[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x1276('0x0'));var util=require(_0x1276('0x1'));var path=require(_0x1276('0x2'));var timeout=require(_0x1276('0x3'));var express=require('express');var router=express[_0x1276('0x4')]();var fs_extra=require(_0x1276('0x5'));var auth=require(_0x1276('0x6'));var interaction=require(_0x1276('0x7'));var config=require(_0x1276('0x8'));var controller=require(_0x1276('0x9'));router[_0x1276('0xa')](_0x1276('0xb'),auth[_0x1276('0xc')](),controller[_0x1276('0xd')]);router[_0x1276('0xe')](_0x1276('0xb'),auth[_0x1276('0xc')](),controller[_0x1276('0xf')]);router[_0x1276('0x10')]('/:id',auth[_0x1276('0xc')](),controller[_0x1276('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4101069..78e0aac 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 _0x6fb2=['sequelize','exports','STRING'];(function(_0x1dabba,_0xde90f7){var _0x368044=function(_0x4404d3){while(--_0x4404d3){_0x1dabba['push'](_0x1dabba['shift']());}};_0x368044(++_0xde90f7);}(_0x6fb2,0x1ef));var _0x26fb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6fb2[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x26fb('0x0'));module[_0x26fb('0x1')]={'name':{'type':Sequelize[_0x26fb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x26fb('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6f8e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3f2c8e,_0x4248d3){var _0x214b7d=function(_0x43117f){while(--_0x43117f){_0x3f2c8e['push'](_0x3f2c8e['shift']());}};_0x214b7d(++_0x4248d3);}(_0x6f8e,0x15a));var _0xe6f8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f8e[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xe6f8('0x0'));module[_0xe6f8('0x1')]={'name':{'type':Sequelize[_0xe6f8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xe6f8('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 72ea61e..2bf2ef7 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 _0xee72=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','name','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','then','rows','catch','show','params','keys','includeAll','include','options','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','ChatGroupId','getMessages','length','$gte','split','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x51f1e7,_0x175572){var _0x2956bd=function(_0x3cd085){while(--_0x3cd085){_0x51f1e7['push'](_0x51f1e7['shift']());}};_0x2956bd(++_0x175572);}(_0xee72,0x1c6));var _0x2ee7=function(_0xe6f10a,_0x3ecd25){_0xe6f10a=_0xe6f10a-0x0;var _0x132c5f=_0xee72[_0xe6f10a];return _0x132c5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ee7('0x0'));var zipdir=require(_0x2ee7('0x1'));var jsonpatch=require(_0x2ee7('0x2'));var rp=require(_0x2ee7('0x3'));var moment=require('moment');var BPromise=require(_0x2ee7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2ee7('0x5'));var csv=require(_0x2ee7('0x6'));var ejs=require(_0x2ee7('0x7'));var fs=require('fs');var fs_extra=require(_0x2ee7('0x8'));var _=require(_0x2ee7('0x9'));var squel=require('squel');var crypto=require(_0x2ee7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2ee7('0xb'));var toCsv=require(_0x2ee7('0x6'));var querystring=require(_0x2ee7('0xc'));var Papa=require(_0x2ee7('0xd'));var Redis=require(_0x2ee7('0xe'));var authService=require(_0x2ee7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2ee7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ee7('0x11'))(_0x2ee7('0x12'));var utils=require(_0x2ee7('0x13'));var config=require(_0x2ee7('0x14'));var licenseUtil=require(_0x2ee7('0x15'));var db=require(_0x2ee7('0x16'))['db'];config[_0x2ee7('0x17')]=_[_0x2ee7('0x18')](config[_0x2ee7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ee7('0x19'))(new Redis(config[_0x2ee7('0x17')]));require(_0x2ee7('0x1a'))[_0x2ee7('0x1b')](socket);function respondWithStatusCode(_0x320a83,_0x22c4fb){_0x22c4fb=_0x22c4fb||0xcc;return function(_0x19f03f){if(_0x19f03f){return _0x320a83[_0x2ee7('0x1c')](_0x22c4fb);}return _0x320a83[_0x2ee7('0x1d')](_0x22c4fb)[_0x2ee7('0x1e')]();};}function respondWithResult(_0x44c043,_0x3b8b37){_0x3b8b37=_0x3b8b37||0xc8;return function(_0x4f817a){if(_0x4f817a){return _0x44c043['status'](_0x3b8b37)[_0x2ee7('0x1f')](_0x4f817a);}};}function respondWithFilteredResult(_0xc8eab9,_0x23b21d){return function(_0x21e53f){if(_0x21e53f){var _0x240bbb=typeof _0x23b21d['offset']===_0x2ee7('0x20')&&typeof _0x23b21d[_0x2ee7('0x21')]===_0x2ee7('0x20');var _0x1cb9ef=_0x21e53f[_0x2ee7('0x22')];var _0x35d5b7=_0x240bbb?0x0:_0x23b21d['offset'];var _0x4beae8=_0x240bbb?_0x21e53f['count']:_0x23b21d[_0x2ee7('0x23')]+_0x23b21d['limit'];var _0x12392c;if(_0x4beae8>=_0x1cb9ef){_0x4beae8=_0x1cb9ef;_0x12392c=0xc8;}else{_0x12392c=0xce;}_0xc8eab9[_0x2ee7('0x1d')](_0x12392c);return _0xc8eab9[_0x2ee7('0x24')](_0x2ee7('0x25'),_0x35d5b7+'-'+_0x4beae8+'/'+_0x1cb9ef)[_0x2ee7('0x1f')](_0x21e53f);}return null;};}function patchUpdates(_0x4957da){return function(_0x1ef7f6){try{jsonpatch[_0x2ee7('0x26')](_0x1ef7f6,_0x4957da,!![]);}catch(_0x207f05){return BPromise['reject'](_0x207f05);}return _0x1ef7f6[_0x2ee7('0x27')]();};}function saveUpdates(_0x122b90,_0x39d2da){return function(_0x4dc04e){if(_0x4dc04e){return _0x4dc04e['update'](_0x122b90)['then'](function(_0x23f713){return _0x23f713;});}return null;};}function removeEntity(_0x315264,_0x2398f7){return function(_0x8d1230){if(_0x8d1230){return _0x8d1230[_0x2ee7('0x28')]()['then'](function(){_0x315264[_0x2ee7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x509eda,_0xa8147f){return function(_0x2809c9){if(!_0x2809c9){_0x509eda[_0x2ee7('0x1c')](0x194);}return _0x2809c9;};}function handleError(_0x4a45f1,_0x487475){_0x487475=_0x487475||0x1f4;return function(_0x5b99b4){logger['error'](_0x5b99b4['stack']);if(_0x5b99b4['name']){delete _0x5b99b4[_0x2ee7('0x29')];}_0x4a45f1['status'](_0x487475)['send'](_0x5b99b4);};}exports[_0x2ee7('0x2a')]=function(_0x2c1724,_0x2732de){var _0x52c2aa={},_0x26ed96={},_0x2afc84={'count':0x0,'rows':[]};var _0x5029d5=_['map'](db[_0x2ee7('0x2b')][_0x2ee7('0x2c')],function(_0x53bf6a){return{'name':_0x53bf6a[_0x2ee7('0x2d')],'type':_0x53bf6a[_0x2ee7('0x2e')][_0x2ee7('0x2f')]};});_0x26ed96[_0x2ee7('0x30')]=_[_0x2ee7('0x31')](_0x5029d5,_0x2ee7('0x29'));_0x26ed96[_0x2ee7('0x32')]=_['keys'](_0x2c1724[_0x2ee7('0x32')]);_0x26ed96[_0x2ee7('0x33')]=_[_0x2ee7('0x34')](_0x26ed96[_0x2ee7('0x30')],_0x26ed96[_0x2ee7('0x32')]);_0x52c2aa['attributes']=_[_0x2ee7('0x34')](_0x26ed96[_0x2ee7('0x30')],qs['fields'](_0x2c1724['query'][_0x2ee7('0x35')]));_0x52c2aa['attributes']=_0x52c2aa['attributes']['length']?_0x52c2aa[_0x2ee7('0x36')]:_0x26ed96[_0x2ee7('0x30')];if(!_0x2c1724['query'][_0x2ee7('0x37')](_0x2ee7('0x38'))){_0x52c2aa[_0x2ee7('0x21')]=qs['limit'](_0x2c1724[_0x2ee7('0x32')]['limit']);_0x52c2aa[_0x2ee7('0x23')]=qs[_0x2ee7('0x23')](_0x2c1724[_0x2ee7('0x32')][_0x2ee7('0x23')]);}_0x52c2aa[_0x2ee7('0x39')]=qs[_0x2ee7('0x3a')](_0x2c1724[_0x2ee7('0x32')]['sort']);_0x52c2aa[_0x2ee7('0x3b')]=qs['filters'](_[_0x2ee7('0x3c')](_0x2c1724[_0x2ee7('0x32')],_0x26ed96[_0x2ee7('0x33')]),_0x5029d5);if(_0x2c1724[_0x2ee7('0x32')][_0x2ee7('0x3d')]){_0x52c2aa['where']=_['merge'](_0x52c2aa[_0x2ee7('0x3b')],{'$or':_[_0x2ee7('0x31')](_0x5029d5,function(_0x563349){if(_0x563349[_0x2ee7('0x2e')]!==_0x2ee7('0x3e')){var _0x2b4bc={};_0x2b4bc[_0x563349[_0x2ee7('0x29')]]={'$like':'%'+_0x2c1724[_0x2ee7('0x32')][_0x2ee7('0x3d')]+'%'};return _0x2b4bc;}})});}_0x52c2aa=_[_0x2ee7('0x3f')]({},_0x52c2aa,_0x2c1724['options']);var _0x5c42a0={'where':_0x52c2aa['where']};return db[_0x2ee7('0x2b')][_0x2ee7('0x22')](_0x5c42a0)[_0x2ee7('0x40')](function(_0x403096){_0x2afc84[_0x2ee7('0x22')]=_0x403096;if(_0x2c1724[_0x2ee7('0x32')]['includeAll']){_0x52c2aa['include']=[{'all':!![]}];}return db[_0x2ee7('0x2b')]['findAll'](_0x52c2aa);})[_0x2ee7('0x40')](function(_0x4885f6){_0x2afc84[_0x2ee7('0x41')]=_0x4885f6;return _0x2afc84;})[_0x2ee7('0x40')](respondWithFilteredResult(_0x2732de,_0x52c2aa))[_0x2ee7('0x42')](handleError(_0x2732de,null));};exports[_0x2ee7('0x43')]=function(_0xe8b30f,_0x491022){var _0x212344={'raw':!![],'where':{'id':_0xe8b30f[_0x2ee7('0x44')]['id']}},_0x3bf096={};_0x3bf096[_0x2ee7('0x30')]=_['keys'](db['ChatGroup'][_0x2ee7('0x2c')]);_0x3bf096['query']=_[_0x2ee7('0x45')](_0xe8b30f['query']);_0x3bf096[_0x2ee7('0x33')]=_[_0x2ee7('0x34')](_0x3bf096[_0x2ee7('0x30')],_0x3bf096[_0x2ee7('0x32')]);_0x212344['attributes']=_['intersection'](_0x3bf096[_0x2ee7('0x30')],qs[_0x2ee7('0x35')](_0xe8b30f[_0x2ee7('0x32')][_0x2ee7('0x35')]));_0x212344[_0x2ee7('0x36')]=_0x212344['attributes']['length']?_0x212344['attributes']:_0x3bf096[_0x2ee7('0x30')];if(_0xe8b30f[_0x2ee7('0x32')][_0x2ee7('0x46')]){_0x212344[_0x2ee7('0x47')]=[{'all':!![]}];}_0x212344=_[_0x2ee7('0x3f')]({},_0x212344,_0xe8b30f[_0x2ee7('0x48')]);return db['ChatGroup']['find'](_0x212344)['then'](handleEntityNotFound(_0x491022,null))[_0x2ee7('0x40')](respondWithResult(_0x491022,null))[_0x2ee7('0x42')](handleError(_0x491022,null));};exports['create']=function(_0x51954a,_0x58d45b){return db['ChatGroup'][_0x2ee7('0x49')](_0x51954a['body'],{})['then'](respondWithResult(_0x58d45b,0xc9))[_0x2ee7('0x42')](handleError(_0x58d45b,null));};exports['update']=function(_0x20db02,_0x3b8812){if(_0x20db02[_0x2ee7('0x4a')]['id']){delete _0x20db02[_0x2ee7('0x4a')]['id'];}return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x20db02['params']['id']}})[_0x2ee7('0x40')](handleEntityNotFound(_0x3b8812,null))[_0x2ee7('0x40')](saveUpdates(_0x20db02[_0x2ee7('0x4a')],null))[_0x2ee7('0x40')](respondWithResult(_0x3b8812,null))[_0x2ee7('0x42')](handleError(_0x3b8812,null));};exports[_0x2ee7('0x28')]=function(_0x2aac2b,_0x5a21c4){return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x2aac2b[_0x2ee7('0x44')]['id']}})[_0x2ee7('0x40')](handleEntityNotFound(_0x5a21c4,null))[_0x2ee7('0x40')](removeEntity(_0x5a21c4,null))['catch'](handleError(_0x5a21c4,null));};exports['describe']=function(_0x30dc96,_0x18c911){return db[_0x2ee7('0x2b')][_0x2ee7('0x4c')]()[_0x2ee7('0x40')](respondWithResult(_0x18c911,null))[_0x2ee7('0x42')](handleError(_0x18c911,null));};exports[_0x2ee7('0x4d')]=function(_0x1724ec,_0x515e1e,_0x304652){return db[_0x2ee7('0x4e')][_0x2ee7('0x22')]({'where':{'ChatGroupId':_0x1724ec[_0x2ee7('0x44')]['id'],'ToId':_0x1724ec[_0x2ee7('0x4f')]['id'],'read':![]}})[_0x2ee7('0x40')](function(_0x48ef3d){return{'id':_[_0x2ee7('0x50')](_0x1724ec[_0x2ee7('0x44')]['id']),'count':_0x48ef3d};})[_0x2ee7('0x40')](respondWithResult(_0x515e1e,null))[_0x2ee7('0x42')](handleError(_0x515e1e,null));};exports[_0x2ee7('0x51')]=function(_0x4f439a,_0x1c6264,_0x58c387){return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x4f439a[_0x2ee7('0x44')]['id']}})[_0x2ee7('0x40')](handleEntityNotFound(_0x1c6264,null))['then'](function(_0x432638){if(_0x432638){return _0x432638[_0x2ee7('0x51')](_0x4f439a[_0x2ee7('0x4a')]['ids'],_[_0x2ee7('0x52')](_0x4f439a[_0x2ee7('0x4a')],[_0x2ee7('0x53'),'id'])||{});}})['then'](respondWithResult(_0x1c6264,null))['catch'](handleError(_0x1c6264,null));};exports[_0x2ee7('0x54')]=function(_0x16bc48,_0x990264,_0x1e974f){var _0x5c76a4={};var _0x47295a={};var _0x206126;var _0x361a0e;return db[_0x2ee7('0x2b')][_0x2ee7('0x55')]({'where':{'id':_0x16bc48[_0x2ee7('0x44')]['id']}})['then'](handleEntityNotFound(_0x990264,null))[_0x2ee7('0x40')](function(_0x29787f){if(_0x29787f){_0x206126=_0x29787f;_0x47295a[_0x2ee7('0x30')]=_[_0x2ee7('0x45')](db[_0x2ee7('0x56')][_0x2ee7('0x2c')]);_0x47295a[_0x2ee7('0x32')]=_[_0x2ee7('0x45')](_0x16bc48['query']);_0x47295a['filters']=_['intersection'](_0x47295a[_0x2ee7('0x30')],_0x47295a['query']);_0x5c76a4['attributes']=_[_0x2ee7('0x34')](_0x47295a[_0x2ee7('0x30')],qs[_0x2ee7('0x35')](_0x16bc48[_0x2ee7('0x32')][_0x2ee7('0x35')]));_0x5c76a4[_0x2ee7('0x36')]=_0x5c76a4[_0x2ee7('0x36')]['length']?_0x5c76a4['attributes']:_0x47295a[_0x2ee7('0x30')];_0x5c76a4[_0x2ee7('0x39')]=qs[_0x2ee7('0x3a')](_0x16bc48[_0x2ee7('0x32')][_0x2ee7('0x3a')]);_0x5c76a4[_0x2ee7('0x3b')]=qs['filters'](_[_0x2ee7('0x3c')](_0x16bc48['query'],_0x47295a[_0x2ee7('0x33')]));if(_0x16bc48['query'][_0x2ee7('0x3d')]){_0x5c76a4[_0x2ee7('0x3b')]=_[_0x2ee7('0x3f')](_0x5c76a4[_0x2ee7('0x3b')],{'$or':_['map'](_0x5c76a4[_0x2ee7('0x36')],function(_0x30d239){var _0x58f4ac={};_0x58f4ac[_0x30d239]={'$like':'%'+_0x16bc48[_0x2ee7('0x32')]['filter']+'%'};return _0x58f4ac;})});}_0x5c76a4=_[_0x2ee7('0x3f')]({},_0x5c76a4,_0x16bc48[_0x2ee7('0x48')]);return _0x206126[_0x2ee7('0x54')](_0x5c76a4);}})[_0x2ee7('0x40')](function(_0xb12692){if(_0xb12692){_0x361a0e=_0xb12692['length'];if(!_0x16bc48['query']['hasOwnProperty'](_0x2ee7('0x38'))){_0x5c76a4['limit']=qs[_0x2ee7('0x21')](_0x16bc48[_0x2ee7('0x32')][_0x2ee7('0x21')]);_0x5c76a4[_0x2ee7('0x23')]=qs[_0x2ee7('0x23')](_0x16bc48[_0x2ee7('0x32')][_0x2ee7('0x23')]);}return _0x206126['getMembers'](_0x5c76a4);}})['then'](function(_0x3231b5){if(_0x3231b5){return _0x3231b5?{'count':_0x361a0e,'rows':_0x3231b5}:null;}})[_0x2ee7('0x40')](respondWithResult(_0x990264,null))['catch'](handleError(_0x990264,null));};exports[_0x2ee7('0x57')]=function(_0x39d5fb,_0x4b7e08,_0x1feb6f){return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x39d5fb[_0x2ee7('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b7e08,null))['then'](function(_0x5cd504){if(_0x5cd504){return _0x5cd504['removeMembers'](_0x39d5fb[_0x2ee7('0x32')][_0x2ee7('0x53')]);}})[_0x2ee7('0x40')](respondWithStatusCode(_0x4b7e08,null))[_0x2ee7('0x42')](handleError(_0x4b7e08,null));};exports['addMessage']=function(_0x361705,_0x190b85,_0x40d065){if(_0x361705['body']['id']){delete _0x361705[_0x2ee7('0x4a')]['id'];}return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x361705[_0x2ee7('0x44')]['id']}})[_0x2ee7('0x40')](handleEntityNotFound(_0x190b85,null))['then'](function(_0x3eb5c1){if(_0x3eb5c1){_0x361705[_0x2ee7('0x4a')][_0x2ee7('0x58')]=_0x3eb5c1['id'];return db[_0x2ee7('0x4e')][_0x2ee7('0x49')](_0x361705[_0x2ee7('0x4a')]);}})[_0x2ee7('0x40')](respondWithResult(_0x190b85,null))[_0x2ee7('0x42')](handleError(_0x190b85,null));};exports[_0x2ee7('0x59')]=function(_0x13e50b,_0x292a4c,_0x1817d5){var _0x257fc0={};var _0x5876fb={};var _0x1e0936;var _0x309631;return db['ChatGroup'][_0x2ee7('0x55')]({'where':{'id':_0x13e50b[_0x2ee7('0x44')]['id']}})['then'](handleEntityNotFound(_0x292a4c,null))[_0x2ee7('0x40')](function(_0x4e8c89){if(_0x4e8c89){_0x1e0936=_0x4e8c89;_0x5876fb['model']=_[_0x2ee7('0x45')](db[_0x2ee7('0x4e')][_0x2ee7('0x2c')]);_0x5876fb[_0x2ee7('0x32')]=_[_0x2ee7('0x45')](_0x13e50b['query']);_0x5876fb['filters']=_['intersection'](_0x5876fb['model'],_0x5876fb['query']);_0x257fc0[_0x2ee7('0x36')]=_[_0x2ee7('0x34')](_0x5876fb[_0x2ee7('0x30')],qs[_0x2ee7('0x35')](_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x35')]));_0x257fc0[_0x2ee7('0x36')]=_0x257fc0[_0x2ee7('0x36')][_0x2ee7('0x5a')]?_0x257fc0['attributes']:_0x5876fb[_0x2ee7('0x30')];_0x257fc0[_0x2ee7('0x39')]=qs[_0x2ee7('0x3a')](_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x3a')]);_0x257fc0[_0x2ee7('0x3b')]=qs['filters'](_['pick'](_0x13e50b['query'],_0x5876fb['filters']));if(_0x13e50b['query'][_0x2ee7('0x3d')]){_0x257fc0[_0x2ee7('0x3b')]=_[_0x2ee7('0x3f')](_0x257fc0[_0x2ee7('0x3b')],{'$or':_['map'](_0x257fc0[_0x2ee7('0x36')],function(_0x214108){var _0x3c2a5b={};_0x3c2a5b[_0x214108]={'$like':'%'+_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x3d')]+'%'};return _0x3c2a5b;})});}if(_0x13e50b['query'][_0x2ee7('0x5b')]){var _0x2bd11e=_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x5b')][_0x2ee7('0x5c')](',');var _0x38e560={};_0x38e560[_0x2bd11e[0x0]]={'$gte':moment(_0x2bd11e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x257fc0[_0x2ee7('0x3b')]=_[_0x2ee7('0x3f')](_0x257fc0[_0x2ee7('0x3b')],_0x38e560);}_0x257fc0=_[_0x2ee7('0x3f')]({},_0x257fc0,_0x13e50b['options']);return _0x1e0936[_0x2ee7('0x59')](_0x257fc0);}})[_0x2ee7('0x40')](function(_0x54f7a3){if(_0x54f7a3){_0x309631=_0x54f7a3[_0x2ee7('0x5a')];if(!_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x37')]('nolimit')){_0x257fc0['limit']=qs[_0x2ee7('0x21')](_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x21')]);_0x257fc0[_0x2ee7('0x23')]=qs[_0x2ee7('0x23')](_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x23')]);}return _0x1e0936['getMessages'](_0x257fc0);}})[_0x2ee7('0x40')](function(_0x5b8f70){if(_0x5b8f70){return _0x5b8f70?{'count':_0x309631,'rows':_0x5b8f70}:null;}})[_0x2ee7('0x40')](respondWithResult(_0x292a4c,null))[_0x2ee7('0x42')](handleError(_0x292a4c,null));};
\ No newline at end of file
+var _0xceb6=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','length','find','create','body','params','ChatInternalMessage','toInteger','addMembers','omit','pick','merge','getMembers','hasOwnProperty','removeMembers','ids','addMessage','ChatGroupId','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','fast-json-patch','request-promise','moment','mustache','sox'];(function(_0x132b3b,_0x30424a){var _0x1c425a=function(_0x3f6093){while(--_0x3f6093){_0x132b3b['push'](_0x132b3b['shift']());}};_0x1c425a(++_0x30424a);}(_0xceb6,0xb3));var _0x6ceb=function(_0x17165a,_0x8641a8){_0x17165a=_0x17165a-0x0;var _0x109de3=_0xceb6[_0x17165a];return _0x109de3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ceb('0x0'));var rp=require(_0x6ceb('0x1'));var moment=require(_0x6ceb('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6ceb('0x3'));var util=require('util');var path=require('path');var sox=require(_0x6ceb('0x4'));var csv=require(_0x6ceb('0x5'));var ejs=require(_0x6ceb('0x6'));var fs=require('fs');var fs_extra=require(_0x6ceb('0x7'));var _=require(_0x6ceb('0x8'));var squel=require(_0x6ceb('0x9'));var crypto=require(_0x6ceb('0xa'));var jsforce=require(_0x6ceb('0xb'));var deskjs=require(_0x6ceb('0xc'));var toCsv=require(_0x6ceb('0x5'));var querystring=require(_0x6ceb('0xd'));var Papa=require(_0x6ceb('0xe'));var Redis=require(_0x6ceb('0xf'));var authService=require(_0x6ceb('0x10'));var qs=require(_0x6ceb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ceb('0x12'))(_0x6ceb('0x13'));var utils=require(_0x6ceb('0x14'));var config=require(_0x6ceb('0x15'));var licenseUtil=require(_0x6ceb('0x16'));var db=require(_0x6ceb('0x17'))['db'];config[_0x6ceb('0x18')]=_[_0x6ceb('0x19')](config[_0x6ceb('0x18')],{'host':_0x6ceb('0x1a'),'port':0x18eb});var socket=require(_0x6ceb('0x1b'))(new Redis(config[_0x6ceb('0x18')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x310540,_0x5cc46a){_0x5cc46a=_0x5cc46a||0xcc;return function(_0x53f31c){if(_0x53f31c){return _0x310540['sendStatus'](_0x5cc46a);}return _0x310540[_0x6ceb('0x1c')](_0x5cc46a)[_0x6ceb('0x1d')]();};}function respondWithResult(_0x2dce2f,_0x2cbd8e){_0x2cbd8e=_0x2cbd8e||0xc8;return function(_0x4f827f){if(_0x4f827f){return _0x2dce2f[_0x6ceb('0x1c')](_0x2cbd8e)[_0x6ceb('0x1e')](_0x4f827f);}};}function respondWithFilteredResult(_0x2e4729,_0x4a07bf){return function(_0x3c5ab4){if(_0x3c5ab4){var _0x44c6b1=typeof _0x4a07bf[_0x6ceb('0x1f')]===_0x6ceb('0x20')&&typeof _0x4a07bf[_0x6ceb('0x21')]===_0x6ceb('0x20');var _0x266ef2=_0x3c5ab4[_0x6ceb('0x22')];var _0x4ca3bd=_0x44c6b1?0x0:_0x4a07bf[_0x6ceb('0x1f')];var _0xf18a77=_0x44c6b1?_0x3c5ab4['count']:_0x4a07bf[_0x6ceb('0x1f')]+_0x4a07bf[_0x6ceb('0x21')];var _0xc4c282;if(_0xf18a77>=_0x266ef2){_0xf18a77=_0x266ef2;_0xc4c282=0xc8;}else{_0xc4c282=0xce;}_0x2e4729[_0x6ceb('0x1c')](_0xc4c282);return _0x2e4729['set'](_0x6ceb('0x23'),_0x4ca3bd+'-'+_0xf18a77+'/'+_0x266ef2)[_0x6ceb('0x1e')](_0x3c5ab4);}return null;};}function patchUpdates(_0x26d897){return function(_0x4e4b29){try{jsonpatch[_0x6ceb('0x24')](_0x4e4b29,_0x26d897,!![]);}catch(_0xa56bc){return BPromise[_0x6ceb('0x25')](_0xa56bc);}return _0x4e4b29[_0x6ceb('0x26')]();};}function saveUpdates(_0x3c589c,_0x4aa829){return function(_0x26eb6f){if(_0x26eb6f){return _0x26eb6f[_0x6ceb('0x27')](_0x3c589c)[_0x6ceb('0x28')](function(_0x245b0f){return _0x245b0f;});}return null;};}function removeEntity(_0x595037,_0x5608dd){return function(_0x3678dd){if(_0x3678dd){return _0x3678dd[_0x6ceb('0x29')]()[_0x6ceb('0x28')](function(){_0x595037[_0x6ceb('0x1c')](0xcc)[_0x6ceb('0x1d')]();});}};}function handleEntityNotFound(_0x4db80d,_0x382e37){return function(_0x13d741){if(!_0x13d741){_0x4db80d[_0x6ceb('0x2a')](0x194);}return _0x13d741;};}function handleError(_0x484699,_0x1a2dc5){_0x1a2dc5=_0x1a2dc5||0x1f4;return function(_0x2e4c45){logger[_0x6ceb('0x2b')](_0x2e4c45[_0x6ceb('0x2c')]);if(_0x2e4c45[_0x6ceb('0x2d')]){delete _0x2e4c45['name'];}_0x484699[_0x6ceb('0x1c')](_0x1a2dc5)[_0x6ceb('0x2e')](_0x2e4c45);};}exports[_0x6ceb('0x2f')]=function(_0x2bf13b,_0x5493eb){var _0x8d67a3={},_0x7b62ad={},_0xc885e={'count':0x0,'rows':[]};var _0x190aa7=_[_0x6ceb('0x30')](db[_0x6ceb('0x31')][_0x6ceb('0x32')],function(_0x535dfa){return{'name':_0x535dfa['fieldName'],'type':_0x535dfa[_0x6ceb('0x33')][_0x6ceb('0x34')]};});_0x7b62ad['model']=_[_0x6ceb('0x30')](_0x190aa7,_0x6ceb('0x2d'));_0x7b62ad[_0x6ceb('0x35')]=_[_0x6ceb('0x36')](_0x2bf13b[_0x6ceb('0x35')]);_0x7b62ad[_0x6ceb('0x37')]=_[_0x6ceb('0x38')](_0x7b62ad['model'],_0x7b62ad['query']);_0x8d67a3[_0x6ceb('0x39')]=_[_0x6ceb('0x38')](_0x7b62ad[_0x6ceb('0x3a')],qs[_0x6ceb('0x3b')](_0x2bf13b[_0x6ceb('0x35')][_0x6ceb('0x3b')]));_0x8d67a3[_0x6ceb('0x39')]=_0x8d67a3['attributes']['length']?_0x8d67a3[_0x6ceb('0x39')]:_0x7b62ad['model'];if(!_0x2bf13b['query']['hasOwnProperty'](_0x6ceb('0x3c'))){_0x8d67a3[_0x6ceb('0x21')]=qs[_0x6ceb('0x21')](_0x2bf13b['query'][_0x6ceb('0x21')]);_0x8d67a3[_0x6ceb('0x1f')]=qs[_0x6ceb('0x1f')](_0x2bf13b[_0x6ceb('0x35')]['offset']);}_0x8d67a3[_0x6ceb('0x3d')]=qs[_0x6ceb('0x3e')](_0x2bf13b[_0x6ceb('0x35')]['sort']);_0x8d67a3[_0x6ceb('0x3f')]=qs[_0x6ceb('0x37')](_['pick'](_0x2bf13b[_0x6ceb('0x35')],_0x7b62ad[_0x6ceb('0x37')]),_0x190aa7);if(_0x2bf13b[_0x6ceb('0x35')][_0x6ceb('0x40')]){_0x8d67a3['where']=_['merge'](_0x8d67a3[_0x6ceb('0x3f')],{'$or':_[_0x6ceb('0x30')](_0x190aa7,function(_0x5d6948){if(_0x5d6948[_0x6ceb('0x33')]!==_0x6ceb('0x41')){var _0x255ab4={};_0x255ab4[_0x5d6948[_0x6ceb('0x2d')]]={'$like':'%'+_0x2bf13b[_0x6ceb('0x35')][_0x6ceb('0x40')]+'%'};return _0x255ab4;}})});}_0x8d67a3=_['merge']({},_0x8d67a3,_0x2bf13b[_0x6ceb('0x42')]);var _0x4eef05={'where':_0x8d67a3[_0x6ceb('0x3f')]};return db[_0x6ceb('0x31')][_0x6ceb('0x22')](_0x4eef05)[_0x6ceb('0x28')](function(_0x3169d8){_0xc885e['count']=_0x3169d8;if(_0x2bf13b[_0x6ceb('0x35')][_0x6ceb('0x43')]){_0x8d67a3[_0x6ceb('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x6ceb('0x45')](_0x8d67a3);})[_0x6ceb('0x28')](function(_0x3cbe41){_0xc885e['rows']=_0x3cbe41;return _0xc885e;})[_0x6ceb('0x28')](respondWithFilteredResult(_0x5493eb,_0x8d67a3))[_0x6ceb('0x46')](handleError(_0x5493eb,null));};exports[_0x6ceb('0x47')]=function(_0x9b0a57,_0x4937fd){var _0x3fdcdc={'raw':!![],'where':{'id':_0x9b0a57['params']['id']}},_0x3a6050={};_0x3a6050[_0x6ceb('0x3a')]=_[_0x6ceb('0x36')](db['ChatGroup'][_0x6ceb('0x32')]);_0x3a6050[_0x6ceb('0x35')]=_['keys'](_0x9b0a57[_0x6ceb('0x35')]);_0x3a6050['filters']=_[_0x6ceb('0x38')](_0x3a6050[_0x6ceb('0x3a')],_0x3a6050['query']);_0x3fdcdc[_0x6ceb('0x39')]=_[_0x6ceb('0x38')](_0x3a6050['model'],qs['fields'](_0x9b0a57['query'][_0x6ceb('0x3b')]));_0x3fdcdc['attributes']=_0x3fdcdc[_0x6ceb('0x39')][_0x6ceb('0x48')]?_0x3fdcdc[_0x6ceb('0x39')]:_0x3a6050['model'];if(_0x9b0a57[_0x6ceb('0x35')][_0x6ceb('0x43')]){_0x3fdcdc['include']=[{'all':!![]}];}_0x3fdcdc=_['merge']({},_0x3fdcdc,_0x9b0a57['options']);return db[_0x6ceb('0x31')][_0x6ceb('0x49')](_0x3fdcdc)['then'](handleEntityNotFound(_0x4937fd,null))['then'](respondWithResult(_0x4937fd,null))[_0x6ceb('0x46')](handleError(_0x4937fd,null));};exports[_0x6ceb('0x4a')]=function(_0x358bc1,_0x1511c7){return db[_0x6ceb('0x31')][_0x6ceb('0x4a')](_0x358bc1['body'],{})['then'](respondWithResult(_0x1511c7,0xc9))[_0x6ceb('0x46')](handleError(_0x1511c7,null));};exports['update']=function(_0x28448f,_0x1d8747){if(_0x28448f[_0x6ceb('0x4b')]['id']){delete _0x28448f[_0x6ceb('0x4b')]['id'];}return db[_0x6ceb('0x31')][_0x6ceb('0x49')]({'where':{'id':_0x28448f['params']['id']}})['then'](handleEntityNotFound(_0x1d8747,null))[_0x6ceb('0x28')](saveUpdates(_0x28448f['body'],null))[_0x6ceb('0x28')](respondWithResult(_0x1d8747,null))[_0x6ceb('0x46')](handleError(_0x1d8747,null));};exports[_0x6ceb('0x29')]=function(_0x3e9788,_0x17fac8){return db['ChatGroup'][_0x6ceb('0x49')]({'where':{'id':_0x3e9788[_0x6ceb('0x4c')]['id']}})[_0x6ceb('0x28')](handleEntityNotFound(_0x17fac8,null))[_0x6ceb('0x28')](removeEntity(_0x17fac8,null))[_0x6ceb('0x46')](handleError(_0x17fac8,null));};exports['describe']=function(_0x7b8632,_0x5a87c3){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x5a87c3,null))[_0x6ceb('0x46')](handleError(_0x5a87c3,null));};exports['getUnread']=function(_0x558431,_0x2cc34b,_0x5a5d0b){return db[_0x6ceb('0x4d')]['count']({'where':{'ChatGroupId':_0x558431[_0x6ceb('0x4c')]['id'],'ToId':_0x558431['user']['id'],'read':![]}})[_0x6ceb('0x28')](function(_0xb411d2){return{'id':_[_0x6ceb('0x4e')](_0x558431[_0x6ceb('0x4c')]['id']),'count':_0xb411d2};})['then'](respondWithResult(_0x2cc34b,null))[_0x6ceb('0x46')](handleError(_0x2cc34b,null));};exports[_0x6ceb('0x4f')]=function(_0x376c15,_0x55f168,_0x4c2eea){return db[_0x6ceb('0x31')][_0x6ceb('0x49')]({'where':{'id':_0x376c15[_0x6ceb('0x4c')]['id']}})[_0x6ceb('0x28')](handleEntityNotFound(_0x55f168,null))[_0x6ceb('0x28')](function(_0x3023c9){if(_0x3023c9){return _0x3023c9[_0x6ceb('0x4f')](_0x376c15['body']['ids'],_[_0x6ceb('0x50')](_0x376c15[_0x6ceb('0x4b')],['ids','id'])||{});}})[_0x6ceb('0x28')](respondWithResult(_0x55f168,null))[_0x6ceb('0x46')](handleError(_0x55f168,null));};exports['getMembers']=function(_0xef6e91,_0xd41c20,_0x686f87){var _0x3c5cf2={};var _0x19ec03={};var _0xe0dcc2;var _0x427656;return db[_0x6ceb('0x31')]['findOne']({'where':{'id':_0xef6e91[_0x6ceb('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd41c20,null))['then'](function(_0xdb9751){if(_0xdb9751){_0xe0dcc2=_0xdb9751;_0x19ec03[_0x6ceb('0x3a')]=_[_0x6ceb('0x36')](db['User'][_0x6ceb('0x32')]);_0x19ec03[_0x6ceb('0x35')]=_[_0x6ceb('0x36')](_0xef6e91[_0x6ceb('0x35')]);_0x19ec03[_0x6ceb('0x37')]=_[_0x6ceb('0x38')](_0x19ec03[_0x6ceb('0x3a')],_0x19ec03[_0x6ceb('0x35')]);_0x3c5cf2['attributes']=_[_0x6ceb('0x38')](_0x19ec03[_0x6ceb('0x3a')],qs['fields'](_0xef6e91[_0x6ceb('0x35')][_0x6ceb('0x3b')]));_0x3c5cf2[_0x6ceb('0x39')]=_0x3c5cf2['attributes'][_0x6ceb('0x48')]?_0x3c5cf2[_0x6ceb('0x39')]:_0x19ec03['model'];_0x3c5cf2[_0x6ceb('0x3d')]=qs['sort'](_0xef6e91['query'][_0x6ceb('0x3e')]);_0x3c5cf2[_0x6ceb('0x3f')]=qs['filters'](_[_0x6ceb('0x51')](_0xef6e91['query'],_0x19ec03[_0x6ceb('0x37')]));if(_0xef6e91[_0x6ceb('0x35')][_0x6ceb('0x40')]){_0x3c5cf2[_0x6ceb('0x3f')]=_[_0x6ceb('0x52')](_0x3c5cf2['where'],{'$or':_['map'](_0x3c5cf2[_0x6ceb('0x39')],function(_0x5a7797){var _0x4b08fa={};_0x4b08fa[_0x5a7797]={'$like':'%'+_0xef6e91[_0x6ceb('0x35')]['filter']+'%'};return _0x4b08fa;})});}_0x3c5cf2=_[_0x6ceb('0x52')]({},_0x3c5cf2,_0xef6e91[_0x6ceb('0x42')]);return _0xe0dcc2[_0x6ceb('0x53')](_0x3c5cf2);}})['then'](function(_0xf4e8c4){if(_0xf4e8c4){_0x427656=_0xf4e8c4[_0x6ceb('0x48')];if(!_0xef6e91[_0x6ceb('0x35')][_0x6ceb('0x54')](_0x6ceb('0x3c'))){_0x3c5cf2[_0x6ceb('0x21')]=qs[_0x6ceb('0x21')](_0xef6e91[_0x6ceb('0x35')][_0x6ceb('0x21')]);_0x3c5cf2[_0x6ceb('0x1f')]=qs[_0x6ceb('0x1f')](_0xef6e91[_0x6ceb('0x35')]['offset']);}return _0xe0dcc2[_0x6ceb('0x53')](_0x3c5cf2);}})[_0x6ceb('0x28')](function(_0x57b32f){if(_0x57b32f){return _0x57b32f?{'count':_0x427656,'rows':_0x57b32f}:null;}})[_0x6ceb('0x28')](respondWithResult(_0xd41c20,null))[_0x6ceb('0x46')](handleError(_0xd41c20,null));};exports['removeMembers']=function(_0x570c5d,_0x586f9f,_0x30cd5b){return db[_0x6ceb('0x31')][_0x6ceb('0x49')]({'where':{'id':_0x570c5d[_0x6ceb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x586f9f,null))[_0x6ceb('0x28')](function(_0x42ffce){if(_0x42ffce){return _0x42ffce[_0x6ceb('0x55')](_0x570c5d[_0x6ceb('0x35')][_0x6ceb('0x56')]);}})['then'](respondWithStatusCode(_0x586f9f,null))[_0x6ceb('0x46')](handleError(_0x586f9f,null));};exports[_0x6ceb('0x57')]=function(_0x141282,_0x15e57b,_0x16ab74){if(_0x141282[_0x6ceb('0x4b')]['id']){delete _0x141282[_0x6ceb('0x4b')]['id'];}return db[_0x6ceb('0x31')][_0x6ceb('0x49')]({'where':{'id':_0x141282[_0x6ceb('0x4c')]['id']}})[_0x6ceb('0x28')](handleEntityNotFound(_0x15e57b,null))[_0x6ceb('0x28')](function(_0x5d7ca7){if(_0x5d7ca7){_0x141282['body'][_0x6ceb('0x58')]=_0x5d7ca7['id'];return db[_0x6ceb('0x4d')][_0x6ceb('0x4a')](_0x141282[_0x6ceb('0x4b')]);}})[_0x6ceb('0x28')](respondWithResult(_0x15e57b,null))[_0x6ceb('0x46')](handleError(_0x15e57b,null));};exports[_0x6ceb('0x59')]=function(_0x36658e,_0x1011f4,_0x386f7f){var _0x5abeea={};var _0x1d245b={};var _0xf5950a;var _0x1ddf3d;return db['ChatGroup']['findOne']({'where':{'id':_0x36658e[_0x6ceb('0x4c')]['id']}})[_0x6ceb('0x28')](handleEntityNotFound(_0x1011f4,null))[_0x6ceb('0x28')](function(_0x2066f9){if(_0x2066f9){_0xf5950a=_0x2066f9;_0x1d245b[_0x6ceb('0x3a')]=_[_0x6ceb('0x36')](db['ChatInternalMessage']['rawAttributes']);_0x1d245b[_0x6ceb('0x35')]=_[_0x6ceb('0x36')](_0x36658e[_0x6ceb('0x35')]);_0x1d245b[_0x6ceb('0x37')]=_[_0x6ceb('0x38')](_0x1d245b[_0x6ceb('0x3a')],_0x1d245b[_0x6ceb('0x35')]);_0x5abeea[_0x6ceb('0x39')]=_['intersection'](_0x1d245b[_0x6ceb('0x3a')],qs[_0x6ceb('0x3b')](_0x36658e[_0x6ceb('0x35')][_0x6ceb('0x3b')]));_0x5abeea[_0x6ceb('0x39')]=_0x5abeea[_0x6ceb('0x39')][_0x6ceb('0x48')]?_0x5abeea[_0x6ceb('0x39')]:_0x1d245b[_0x6ceb('0x3a')];_0x5abeea['order']=qs['sort'](_0x36658e['query'][_0x6ceb('0x3e')]);_0x5abeea[_0x6ceb('0x3f')]=qs[_0x6ceb('0x37')](_['pick'](_0x36658e['query'],_0x1d245b[_0x6ceb('0x37')]));if(_0x36658e['query'][_0x6ceb('0x40')]){_0x5abeea[_0x6ceb('0x3f')]=_[_0x6ceb('0x52')](_0x5abeea['where'],{'$or':_[_0x6ceb('0x30')](_0x5abeea[_0x6ceb('0x39')],function(_0x1b03d0){var _0x4e940b={};_0x4e940b[_0x1b03d0]={'$like':'%'+_0x36658e[_0x6ceb('0x35')][_0x6ceb('0x40')]+'%'};return _0x4e940b;})});}if(_0x36658e[_0x6ceb('0x35')]['$gte']){var _0xfcd9cb=_0x36658e[_0x6ceb('0x35')]['$gte']['split'](',');var _0x9abcc8={};_0x9abcc8[_0xfcd9cb[0x0]]={'$gte':moment(_0xfcd9cb[0x1])[_0x6ceb('0x5a')](_0x6ceb('0x5b'))};_0x5abeea[_0x6ceb('0x3f')]=_[_0x6ceb('0x52')](_0x5abeea['where'],_0x9abcc8);}_0x5abeea=_[_0x6ceb('0x52')]({},_0x5abeea,_0x36658e[_0x6ceb('0x42')]);return _0xf5950a[_0x6ceb('0x59')](_0x5abeea);}})[_0x6ceb('0x28')](function(_0x446559){if(_0x446559){_0x1ddf3d=_0x446559[_0x6ceb('0x48')];if(!_0x36658e[_0x6ceb('0x35')]['hasOwnProperty'](_0x6ceb('0x3c'))){_0x5abeea[_0x6ceb('0x21')]=qs[_0x6ceb('0x21')](_0x36658e[_0x6ceb('0x35')]['limit']);_0x5abeea[_0x6ceb('0x1f')]=qs['offset'](_0x36658e[_0x6ceb('0x35')]['offset']);}return _0xf5950a[_0x6ceb('0x59')](_0x5abeea);}})[_0x6ceb('0x28')](function(_0x51d7e5){if(_0x51d7e5){return _0x51d7e5?{'count':_0x1ddf3d,'rows':_0x51d7e5}:null;}})[_0x6ceb('0x28')](respondWithResult(_0x1011f4,null))[_0x6ceb('0x46')](handleError(_0x1011f4,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index a5c1178..300b81e 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 _0x83d4=['hasOwnProperty','hook','exports','events','setMaxListeners','update','emit'];(function(_0x20115d,_0x1a193f){var _0x49958b=function(_0x14b604){while(--_0x14b604){_0x20115d['push'](_0x20115d['shift']());}};_0x49958b(++_0x1a193f);}(_0x83d4,0xf1));var _0x483d=function(_0x4f92eb,_0x1237a4){_0x4f92eb=_0x4f92eb-0x0;var _0x2e7f4f=_0x83d4[_0x4f92eb];return _0x2e7f4f;};'use strict';var EventEmitter=require(_0x483d('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x483d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x483d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x838b4c){return function(_0x447f73,_0x224829,_0x1e1c37){ChatGroupEvents[_0x483d('0x3')](_0x838b4c+':'+_0x447f73['id'],_0x447f73);ChatGroupEvents['emit'](_0x838b4c,_0x447f73);_0x1e1c37(null);};}for(var e in events){if(events[_0x483d('0x4')](e)){var event=events[e];ChatGroup[_0x483d('0x5')](e,emitEvent(event));}}module[_0x483d('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x2905=['update','remove','emit','exports','events','../../mysqldb','ChatGroup','save'];(function(_0x491f4b,_0x3b0baa){var _0x34fcf0=function(_0xa83cc0){while(--_0xa83cc0){_0x491f4b['push'](_0x491f4b['shift']());}};_0x34fcf0(++_0x3b0baa);}(_0x2905,0x19c));var _0x5290=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2905[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x5290('0x0'));var ChatGroup=require(_0x5290('0x1'))['db'][_0x5290('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5290('0x3'),'afterUpdate':_0x5290('0x4'),'afterDestroy':_0x5290('0x5')};function emitEvent(_0x8f2404){return function(_0x313bbe,_0x4c09d8,_0x223a29){ChatGroupEvents[_0x5290('0x6')](_0x8f2404+':'+_0x313bbe['id'],_0x313bbe);ChatGroupEvents[_0x5290('0x6')](_0x8f2404,_0x313bbe);_0x223a29(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x5290('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index c19b10c..cc2570f 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 _0x7918=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','define','ChatGroup'];(function(_0x5bee28,_0x1dc7e2){var _0x395d1d=function(_0x33af90){while(--_0x33af90){_0x5bee28['push'](_0x5bee28['shift']());}};_0x395d1d(++_0x1dc7e2);}(_0x7918,0x11e));var _0x8791=function(_0x10bc04,_0x669fa5){_0x10bc04=_0x10bc04-0x0;var _0x1fd6de=_0x7918[_0x10bc04];return _0x1fd6de;};'use strict';var _=require(_0x8791('0x0'));var util=require(_0x8791('0x1'));var logger=require('../../config/logger')(_0x8791('0x2'));var moment=require(_0x8791('0x3'));var BPromise=require(_0x8791('0x4'));var rp=require(_0x8791('0x5'));var fs=require('fs');var path=require(_0x8791('0x6'));var rimraf=require(_0x8791('0x7'));var config=require('../../config/environment');var attributes=require(_0x8791('0x8'));module['exports']=function(_0x354f76,_0x81d64){return _0x354f76[_0x8791('0x9')](_0x8791('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe29a=['bluebird','request-promise','path','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','api','moment'];(function(_0x1107ed,_0x292041){var _0x3ae7f7=function(_0x426b7d){while(--_0x426b7d){_0x1107ed['push'](_0x1107ed['shift']());}};_0x3ae7f7(++_0x292041);}(_0xe29a,0x1b4));var _0xae29=function(_0x2e8abc,_0xe408ae){_0x2e8abc=_0x2e8abc-0x0;var _0x1e7a8e=_0xe29a[_0x2e8abc];return _0x1e7a8e;};'use strict';var _=require(_0xae29('0x0'));var util=require(_0xae29('0x1'));var logger=require('../../config/logger')(_0xae29('0x2'));var moment=require(_0xae29('0x3'));var BPromise=require(_0xae29('0x4'));var rp=require(_0xae29('0x5'));var fs=require('fs');var path=require(_0xae29('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xae29('0x7'));module[_0xae29('0x8')]=function(_0x1c7e2c,_0x409188){return _0x1c7e2c['define'](_0xae29('0x9'),attributes,{'tableName':_0xae29('0xa'),'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 3c206ef..48a19b1 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 _0x1134=['./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x3bba57,_0x440aad){var _0x1f13b7=function(_0x8ec7f6){while(--_0x8ec7f6){_0x3bba57['push'](_0x3bba57['shift']());}};_0x1f13b7(++_0x440aad);}(_0x1134,0x19c));var _0x4113=function(_0x342386,_0x369070){_0x342386=_0x342386-0x0;var _0x29616c=_0x1134[_0x342386];return _0x29616c;};'use strict';var _=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var moment=require('moment');var BPromise=require(_0x4113('0x2'));var rs=require(_0x4113('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4113('0x4'))['db'];var utils=require(_0x4113('0x5'));var logger=require('../../config/logger')(_0x4113('0x6'));var config=require('../../config/environment');var jayson=require(_0x4113('0x7'));var client=jayson['client'][_0x4113('0x8')]({'port':0x232a});config['redis']=_[_0x4113('0x9')](config[_0x4113('0xa')],{'host':_0x4113('0xb'),'port':0x18eb});var socket=require(_0x4113('0xc'))(new Redis(config[_0x4113('0xa')]));require(_0x4113('0xd'))[_0x4113('0xe')](socket);function respondWithRpcPromise(_0x19b6f2,_0x5e635c,_0x85a9dd){return new BPromise(function(_0x207442,_0x29c7f9){return client[_0x4113('0xf')](_0x19b6f2,_0x85a9dd)[_0x4113('0x10')](function(_0x30f02a){logger[_0x4113('0x11')](_0x4113('0x12'),_0x5e635c,_0x4113('0x13'));logger[_0x4113('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5e635c,'request\x20sent',JSON['stringify'](_0x30f02a));if(_0x30f02a[_0x4113('0x15')]){if(_0x30f02a[_0x4113('0x15')]['code']===0x1f4){logger['error'](_0x4113('0x12'),_0x5e635c,_0x30f02a['error'][_0x4113('0x16')]);return _0x29c7f9(_0x30f02a['error']['message']);}logger[_0x4113('0x15')](_0x4113('0x12'),_0x5e635c,_0x30f02a[_0x4113('0x15')][_0x4113('0x16')]);return _0x207442(_0x30f02a[_0x4113('0x15')][_0x4113('0x16')]);}else{logger[_0x4113('0x11')](_0x4113('0x12'),_0x5e635c,_0x4113('0x13'));_0x207442(_0x30f02a[_0x4113('0x17')]['message']);}})[_0x4113('0x18')](function(_0x287efd){logger[_0x4113('0x15')](_0x4113('0x12'),_0x5e635c,_0x287efd);_0x29c7f9(_0x287efd);});});}
\ No newline at end of file
+var _0xec46=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','catch','lodash','util','moment','bluebird'];(function(_0x53b594,_0x559767){var _0x1e616f=function(_0x333eda){while(--_0x333eda){_0x53b594['push'](_0x53b594['shift']());}};_0x1e616f(++_0x559767);}(_0xec46,0x19c));var _0x6ec4=function(_0x357979,_0x56feef){_0x357979=_0x357979-0x0;var _0xabb42f=_0xec46[_0x357979];return _0xabb42f;};'use strict';var _=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var moment=require(_0x6ec4('0x2'));var BPromise=require(_0x6ec4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ec4('0x4'))['db'];var utils=require(_0x6ec4('0x5'));var logger=require(_0x6ec4('0x6'))('rpc');var config=require(_0x6ec4('0x7'));var jayson=require(_0x6ec4('0x8'));var client=jayson['client'][_0x6ec4('0x9')]({'port':0x232a});config['redis']=_[_0x6ec4('0xa')](config[_0x6ec4('0xb')],{'host':_0x6ec4('0xc'),'port':0x18eb});var socket=require(_0x6ec4('0xd'))(new Redis(config[_0x6ec4('0xb')]));require(_0x6ec4('0xe'))[_0x6ec4('0xf')](socket);function respondWithRpcPromise(_0x164b81,_0x5e8746,_0x259d07){return new BPromise(function(_0xe51f56,_0x47bfaa){return client['request'](_0x164b81,_0x259d07)[_0x6ec4('0x10')](function(_0x45f738){logger[_0x6ec4('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x6ec4('0x12'));logger['debug'](_0x6ec4('0x13'),_0x5e8746,'request\x20sent',JSON[_0x6ec4('0x14')](_0x45f738));if(_0x45f738[_0x6ec4('0x15')]){if(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x16')]===0x1f4){logger[_0x6ec4('0x15')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);return _0x47bfaa(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);}logger[_0x6ec4('0x15')](_0x6ec4('0x18'),_0x5e8746,_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);return _0xe51f56(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);}else{logger[_0x6ec4('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x6ec4('0x12'));_0xe51f56(_0x45f738['result']['message']);}})[_0x6ec4('0x19')](function(_0x49594b){logger[_0x6ec4('0x15')](_0x6ec4('0x18'),_0x5e8746,_0x49594b);_0x47bfaa(_0x49594b);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 487832d..cdd180f 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 _0x7581=['./chatGroup.events','remove','update','emit','removeListener','length','chatGroup:'];(function(_0x34368f,_0x27ca25){var _0x3ffc70=function(_0x5c27c5){while(--_0x5c27c5){_0x34368f['push'](_0x34368f['shift']());}};_0x3ffc70(++_0x27ca25);}(_0x7581,0x1ce));var _0x1758=function(_0x24a819,_0x33eb25){_0x24a819=_0x24a819-0x0;var _0xbd47fd=_0x7581[_0x24a819];return _0xbd47fd;};'use strict';var ChatGroupEvents=require(_0x1758('0x0'));var events=['save',_0x1758('0x1'),_0x1758('0x2')];function createListener(_0x556d20,_0x2fe42f){return function(_0x5433b9){_0x2fe42f[_0x1758('0x3')](_0x556d20,_0x5433b9);};}function removeListener(_0x3d7937,_0xb78f3f){return function(){ChatGroupEvents[_0x1758('0x4')](_0x3d7937,_0xb78f3f);};}exports['register']=function(_0x3f329d){for(var _0x4fb467=0x0,_0x1f9dd3=events[_0x1758('0x5')];_0x4fb467<_0x1f9dd3;_0x4fb467++){var _0x311198=events[_0x4fb467];var _0x672a73=createListener(_0x1758('0x6')+_0x311198,_0x3f329d);ChatGroupEvents['on'](_0x311198,_0x672a73);}};
\ No newline at end of file
+var _0x5539=['emit','register','chatGroup:','./chatGroup.events','save','remove'];(function(_0x373d92,_0x35a07f){var _0x2fd989=function(_0x48f986){while(--_0x48f986){_0x373d92['push'](_0x373d92['shift']());}};_0x2fd989(++_0x35a07f);}(_0x5539,0x141));var _0x9553=function(_0x533643,_0x2fd320){_0x533643=_0x533643-0x0;var _0x158b07=_0x5539[_0x533643];return _0x158b07;};'use strict';var ChatGroupEvents=require(_0x9553('0x0'));var events=[_0x9553('0x1'),_0x9553('0x2'),'update'];function createListener(_0x5309b0,_0x5f3698){return function(_0x1d2cc4){_0x5f3698[_0x9553('0x3')](_0x5309b0,_0x1d2cc4);};}function removeListener(_0x9c4bb1,_0x1999a0){return function(){ChatGroupEvents['removeListener'](_0x9c4bb1,_0x1999a0);};}exports[_0x9553('0x4')]=function(_0x38bc9e){for(var _0x11135c=0x0,_0x19da57=events['length'];_0x11135c<_0x19da57;_0x11135c++){var _0x5e78bc=events[_0x11135c];var _0x3e3d45=createListener(_0x9553('0x5')+_0x5e78bc,_0x38bc9e);ChatGroupEvents['on'](_0x5e78bc,_0x3e3d45);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 40e4a0d..23d2a7e 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 _0xe729=['isAuthenticated','/:id','show','/:id/unread','/:id/members','/:id/messages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe729,0x160));var _0x9e72=function(_0xb65eb5,_0x5601db){_0xb65eb5=_0xb65eb5-0x0;var _0x41359b=_0xe729[_0xb65eb5];return _0x41359b;};'use strict';var multer=require(_0x9e72('0x0'));var util=require(_0x9e72('0x1'));var path=require(_0x9e72('0x2'));var timeout=require(_0x9e72('0x3'));var express=require(_0x9e72('0x4'));var router=express['Router']();var fs_extra=require(_0x9e72('0x5'));var auth=require(_0x9e72('0x6'));var interaction=require(_0x9e72('0x7'));var config=require(_0x9e72('0x8'));var controller=require(_0x9e72('0x9'));router[_0x9e72('0xa')]('/',auth['isAuthenticated'](),controller[_0x9e72('0xb')]);router[_0x9e72('0xa')]('/describe',auth[_0x9e72('0xc')](),controller['describe']);router[_0x9e72('0xa')](_0x9e72('0xd'),auth[_0x9e72('0xc')](),controller[_0x9e72('0xe')]);router[_0x9e72('0xa')](_0x9e72('0xf'),auth[_0x9e72('0xc')](),controller['getUnread']);router[_0x9e72('0xa')](_0x9e72('0x10'),auth[_0x9e72('0xc')](),controller['getMembers']);router[_0x9e72('0xa')](_0x9e72('0x11'),auth[_0x9e72('0xc')](),controller['getMessages']);router[_0x9e72('0x12')]('/',auth[_0x9e72('0xc')](),controller[_0x9e72('0x13')]);router[_0x9e72('0x12')]('/:id/members',auth[_0x9e72('0xc')](),controller[_0x9e72('0x14')]);router['post'](_0x9e72('0x11'),auth[_0x9e72('0xc')](),controller[_0x9e72('0x15')]);router[_0x9e72('0x16')]('/:id',auth[_0x9e72('0xc')](),controller['update']);router[_0x9e72('0x17')](_0x9e72('0xd'),auth[_0x9e72('0xc')](),controller['destroy']);router['delete'](_0x9e72('0x10'),auth[_0x9e72('0xc')](),controller[_0x9e72('0x18')]);module[_0x9e72('0x19')]=router;
\ No newline at end of file
+var _0xc207=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','put','update','delete','destroy','removeMembers','exports','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2afa7d,_0x1591f0){var _0x2a781d=function(_0x4b82bc){while(--_0x4b82bc){_0x2afa7d['push'](_0x2afa7d['shift']());}};_0x2a781d(++_0x1591f0);}(_0xc207,0x79));var _0x7c20=function(_0x1bc95c,_0x109aec){_0x1bc95c=_0x1bc95c-0x0;var _0x1a9fdc=_0xc207[_0x1bc95c];return _0x1a9fdc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7c20('0x0'));var express=require(_0x7c20('0x1'));var router=express[_0x7c20('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7c20('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7c20('0x4'));var controller=require(_0x7c20('0x5'));router[_0x7c20('0x6')]('/',auth[_0x7c20('0x7')](),controller[_0x7c20('0x8')]);router['get'](_0x7c20('0x9'),auth[_0x7c20('0x7')](),controller['describe']);router[_0x7c20('0x6')](_0x7c20('0xa'),auth['isAuthenticated'](),controller[_0x7c20('0xb')]);router[_0x7c20('0x6')]('/:id/unread',auth['isAuthenticated'](),controller[_0x7c20('0xc')]);router[_0x7c20('0x6')](_0x7c20('0xd'),auth[_0x7c20('0x7')](),controller[_0x7c20('0xe')]);router[_0x7c20('0x6')](_0x7c20('0xf'),auth[_0x7c20('0x7')](),controller[_0x7c20('0x10')]);router['post']('/',auth[_0x7c20('0x7')](),controller[_0x7c20('0x11')]);router['post'](_0x7c20('0xd'),auth[_0x7c20('0x7')](),controller['addMembers']);router[_0x7c20('0x12')](_0x7c20('0xf'),auth[_0x7c20('0x7')](),controller['addMessage']);router[_0x7c20('0x13')](_0x7c20('0xa'),auth[_0x7c20('0x7')](),controller[_0x7c20('0x14')]);router[_0x7c20('0x15')](_0x7c20('0xa'),auth[_0x7c20('0x7')](),controller[_0x7c20('0x16')]);router[_0x7c20('0x15')](_0x7c20('0xd'),auth['isAuthenticated'](),controller[_0x7c20('0x17')]);module[_0x7c20('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 43da563..9a5f0be 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 _0x12e5=['star','TEXT','DATE','STRING','long','out','exports','BOOLEAN','INTEGER','ENUM'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x12e5,0x100));var _0x512e=function(_0x45212,_0xa6803){_0x45212=_0x45212-0x0;var _0x42437a=_0x12e5[_0x45212];return _0x42437a;};'use strict';var Sequelize=require('sequelize');module[_0x512e('0x0')]={'closed':{'type':Sequelize[_0x512e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x512e('0x2')]},'ratingType':{'type':Sequelize[_0x512e('0x3')]('star','thumb'),'defaultValue':_0x512e('0x4')},'ratingMessage':{'type':Sequelize[_0x512e('0x5')]},'pathTranscript':{'type':Sequelize[_0x512e('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x512e('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x512e('0x7')]},'thirdDisposition':{'type':Sequelize[_0x512e('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x512e('0x7')]},'browserVersion':{'type':Sequelize[_0x512e('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x512e('0x7')]},'deviceModel':{'type':Sequelize[_0x512e('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x512e('0x7')]},'referer':{'type':Sequelize[_0x512e('0x5')]},'customerIp':{'type':Sequelize[_0x512e('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x512e('0x8'))},'read1stAt':{'type':Sequelize[_0x512e('0x6')]},'lastMsgAt':{'type':Sequelize[_0x512e('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x512e('0x3')]('in',_0x512e('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x512e('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x512e('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x512e('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x512e('0x2')]}};
\ No newline at end of file
+var _0xfff1=['TEXT','STRING','DATE','long','ENUM','out','exports','BOOLEAN','star','thumb'];(function(_0x1d1a90,_0x40f97){var _0x36fc75=function(_0x984dfe){while(--_0x984dfe){_0x1d1a90['push'](_0x1d1a90['shift']());}};_0x36fc75(++_0x40f97);}(_0xfff1,0x150));var _0x1fff=function(_0x536216,_0xdcc088){_0x536216=_0x536216-0x0;var _0x2a2a25=_0xfff1[_0x536216];return _0x2a2a25;};'use strict';var Sequelize=require('sequelize');module[_0x1fff('0x0')]={'closed':{'type':Sequelize[_0x1fff('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x1fff('0x2'),_0x1fff('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x1fff('0x4')]},'pathTranscript':{'type':Sequelize[_0x1fff('0x4')]},'mailTranscript':{'type':Sequelize[_0x1fff('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1fff('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1fff('0x5')]},'thirdDisposition':{'type':Sequelize[_0x1fff('0x5')]},'note':{'type':Sequelize[_0x1fff('0x5')]},'browserName':{'type':Sequelize[_0x1fff('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x1fff('0x5')]},'osVersion':{'type':Sequelize[_0x1fff('0x5')]},'deviceModel':{'type':Sequelize[_0x1fff('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x1fff('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x1fff('0x7'))},'read1stAt':{'type':Sequelize[_0x1fff('0x6')]},'lastMsgAt':{'type':Sequelize[_0x1fff('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x1fff('0x8')]('in',_0x1fff('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1fff('0x5')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x1fff('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x1fff('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 84c4d4f..483e7b1 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 _0x2e9b=['query','model','keys','filters','intersection','fields','attributes','length','find','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','transcript-%s.txt','now','pathTranscript','Messages','User','UserId','format','%s%d','agentAlias','Visitor','ContactId','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','hasOwnProperty','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','nolimit','include','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','firstName','lastName','secret','read','Account','get','mkdirSync','Chat','Owner','N.A.','disposition','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','agent','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','chat'];(function(_0x36765e,_0x14ed23){var _0x5e33b8=function(_0x3a84d3){while(--_0x3a84d3){_0x36765e['push'](_0x36765e['shift']());}};_0x5e33b8(++_0x14ed23);}(_0x2e9b,0x167));var _0xb2e9=function(_0x37a7e9,_0x4bb5aa){_0x37a7e9=_0x37a7e9-0x0;var _0x50e838=_0x2e9b[_0x37a7e9];return _0x50e838;};'use strict';var rimraf=require(_0xb2e9('0x0'));var zipdir=require(_0xb2e9('0x1'));var rp=require('request-promise');var moment=require(_0xb2e9('0x2'));var BPromise=require(_0xb2e9('0x3'));var Mustache=require(_0xb2e9('0x4'));var util=require(_0xb2e9('0x5'));var path=require(_0xb2e9('0x6'));var ejs=require(_0xb2e9('0x7'));var fs=require('fs');var _=require(_0xb2e9('0x8'));var Redis=require(_0xb2e9('0x9'));var interaction=require('../../components/interaction/service');var qs=require(_0xb2e9('0xa'));var pdf=require(_0xb2e9('0xb'));var logger=require(_0xb2e9('0xc'))('api');var config=require(_0xb2e9('0xd'));var db=require(_0xb2e9('0xe'))['db'];config[_0xb2e9('0xf')]=_[_0xb2e9('0x10')](config[_0xb2e9('0xf')],{'host':_0xb2e9('0x11'),'port':0x18eb});var socket=require(_0xb2e9('0x12'))(new Redis(config[_0xb2e9('0xf')]));require(_0xb2e9('0x13'))[_0xb2e9('0x14')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb2e9('0x15')]({'port':0x232b});var client9004=jayson[_0xb2e9('0x16')][_0xb2e9('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x97e466,_0xce9ee3,_0x1fc6ef,_0x5801ca){return new BPromise(function(_0x472c35,_0x3ee37a){var _0x235ba9=_0x5801ca||client;return _0x235ba9[_0xb2e9('0x17')](_0x97e466,_0x1fc6ef)[_0xb2e9('0x18')](function(_0x25c06f){logger[_0xb2e9('0x19')](_0xb2e9('0x1a'),_0xce9ee3,'request\x20sent');logger[_0xb2e9('0x1b')](_0xb2e9('0x1c'),_0xce9ee3,_0xb2e9('0x1d'),JSON[_0xb2e9('0x1e')](_0x25c06f));if(_0x25c06f[_0xb2e9('0x1f')]){if(_0x25c06f['error'][_0xb2e9('0x20')]===0x1f4){logger[_0xb2e9('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0xce9ee3,_0x25c06f['error'][_0xb2e9('0x21')]);return _0x3ee37a(_0x25c06f[_0xb2e9('0x1f')]['message']);}logger[_0xb2e9('0x1f')](_0xb2e9('0x1a'),_0xce9ee3,_0x25c06f[_0xb2e9('0x1f')][_0xb2e9('0x21')]);return _0x472c35(_0x25c06f[_0xb2e9('0x1f')][_0xb2e9('0x21')]);}else{logger['info'](_0xb2e9('0x1a'),_0xce9ee3,_0xb2e9('0x1d'));_0x472c35(_0x25c06f[_0xb2e9('0x22')][_0xb2e9('0x21')]);}})[_0xb2e9('0x23')](function(_0x33dd15){logger['error'](_0xb2e9('0x1a'),_0xce9ee3,_0x33dd15);_0x3ee37a(_0x33dd15);});});}function respondWithStatusCode(_0x4c165b,_0x2e5980){_0x2e5980=_0x2e5980||0xcc;return function(_0x2290d9){if(_0x2290d9){return _0x4c165b[_0xb2e9('0x24')](_0x2e5980);}return _0x4c165b[_0xb2e9('0x25')](_0x2e5980)['end']();};}function respondWithResult(_0x4b683d,_0x5e3db7){_0x5e3db7=_0x5e3db7||0xc8;return function(_0x546717){if(_0x546717){return _0x4b683d['status'](_0x5e3db7)[_0xb2e9('0x26')](_0x546717);}};}function respondWithFilteredResult(_0x3268e9,_0x3056bd){return function(_0x43b51c){if(_0x43b51c){var _0x59d56e=typeof _0x3056bd[_0xb2e9('0x27')]===_0xb2e9('0x28')&&typeof _0x3056bd[_0xb2e9('0x29')]===_0xb2e9('0x28');var _0x588b30=_0x43b51c[_0xb2e9('0x2a')];var _0x36c836=_0x59d56e?0x0:_0x3056bd['offset'];var _0x2c11f3=_0x59d56e?_0x43b51c['count']:_0x3056bd['offset']+_0x3056bd[_0xb2e9('0x29')];var _0x38e55e;if(_0x2c11f3>=_0x588b30){_0x2c11f3=_0x588b30;_0x38e55e=0xc8;}else{_0x38e55e=0xce;}_0x3268e9['status'](_0x38e55e);return _0x3268e9[_0xb2e9('0x2b')](_0xb2e9('0x2c'),_0x36c836+'-'+_0x2c11f3+'/'+_0x588b30)[_0xb2e9('0x26')](_0x43b51c);}return null;};}function saveUpdates(_0x2b1813){return function(_0x3b8562){if(_0x3b8562){return _0x3b8562[_0xb2e9('0x2d')](_0x2b1813)[_0xb2e9('0x18')](function(_0x1a3421){return _0x1a3421;});}return null;};}function removeEntity(_0x1c5b55){return function(_0x5677b2){if(_0x5677b2){return _0x5677b2[_0xb2e9('0x2e')]()['then'](function(){_0x1c5b55['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f0fb4){return function(_0x362d4f){if(!_0x362d4f){_0x5f0fb4['sendStatus'](0x194);}return _0x362d4f;};}function handleError(_0x1a7dea,_0x59ca76){_0x59ca76=_0x59ca76||0x1f4;return function(_0x3e8f3f){logger[_0xb2e9('0x1f')](_0x3e8f3f[_0xb2e9('0x2f')]);if(_0x3e8f3f[_0xb2e9('0x30')]){delete _0x3e8f3f[_0xb2e9('0x30')];}_0x1a7dea[_0xb2e9('0x25')](_0x59ca76)[_0xb2e9('0x31')](_0x3e8f3f);};}function getMustacheRender(_0x585a53,_0xf3c192){return Mustache[_0xb2e9('0x32')](_0x585a53,_[_0xb2e9('0x33')](_0xf3c192[_0xb2e9('0x34')],{'contact':_0xf3c192[_0xb2e9('0x35')],'message':_0xf3c192[_0xb2e9('0x21')],'agent':_0xf3c192[_0xb2e9('0x36')],'interaction':_0xf3c192['interaction'],'account':_0xf3c192['account']}))||'';}exports[_0xb2e9('0x37')]=function(_0x9faa4d,_0x6b25f7){var _0x400c47={};var _0x4ac7f3=_[_0xb2e9('0x38')](db[_0xb2e9('0x39')][_0xb2e9('0x3a')],function(_0x5b4e0f){return{'name':_0x5b4e0f['fieldName'],'type':_0x5b4e0f[_0xb2e9('0x3b')]['key']};});_0x400c47=qs[_0xb2e9('0x3c')](_0x4ac7f3,_0x9faa4d);return interaction[_0xb2e9('0x3d')](_0xb2e9('0x3e'),_0x9faa4d[_0xb2e9('0x3f')],_0x9faa4d['user'],_0x400c47,_0x4ac7f3)['then'](respondWithFilteredResult(_0x6b25f7,_0x400c47))['catch'](handleError(_0x6b25f7,null));};exports['show']=function(_0xb6a505,_0x8b7807){var _0x2a8dbc={'raw':![],'where':{'id':_0xb6a505['params']['id']}},_0x4f5164={};_0x4f5164[_0xb2e9('0x40')]=_[_0xb2e9('0x41')](db[_0xb2e9('0x39')][_0xb2e9('0x3a')]);_0x4f5164[_0xb2e9('0x3f')]=_['keys'](_0xb6a505[_0xb2e9('0x3f')]);_0x4f5164[_0xb2e9('0x42')]=_['intersection'](_0x4f5164[_0xb2e9('0x40')],_0x4f5164[_0xb2e9('0x3f')]);_0x2a8dbc['attributes']=_[_0xb2e9('0x43')](_0x4f5164[_0xb2e9('0x40')],qs[_0xb2e9('0x44')](_0xb6a505[_0xb2e9('0x3f')][_0xb2e9('0x44')]));_0x2a8dbc[_0xb2e9('0x45')]=_0x2a8dbc[_0xb2e9('0x45')][_0xb2e9('0x46')]?_0x2a8dbc['attributes']:_0x4f5164[_0xb2e9('0x40')];if(_0xb6a505[_0xb2e9('0x3f')]['includeAll']){_0x2a8dbc['include']=[{'all':!![]}];}_0x2a8dbc=_[_0xb2e9('0x33')]({},_0x2a8dbc,_0xb6a505['options']);return db[_0xb2e9('0x39')][_0xb2e9('0x47')](_0x2a8dbc)['then'](handleEntityNotFound(_0x8b7807,null))[_0xb2e9('0x18')](respondWithResult(_0x8b7807,null))['catch'](handleError(_0x8b7807,null));};exports[_0xb2e9('0x48')]=function(_0x13b005,_0x4c12b9){return db[_0xb2e9('0x39')][_0xb2e9('0x48')](_0x13b005[_0xb2e9('0x34')],{})[_0xb2e9('0x18')](respondWithResult(_0x4c12b9,0xc9))[_0xb2e9('0x23')](handleError(_0x4c12b9,null));};exports[_0xb2e9('0x2d')]=function(_0x4f2f66,_0x2ea643){if(_0x4f2f66[_0xb2e9('0x34')]['id']){delete _0x4f2f66[_0xb2e9('0x34')]['id'];}return db['ChatInteraction'][_0xb2e9('0x47')]({'where':{'id':_0x4f2f66['params']['id']}})['then'](handleEntityNotFound(_0x2ea643,null))[_0xb2e9('0x18')](saveUpdates(_0x4f2f66['body'],null))[_0xb2e9('0x18')](respondWithResult(_0x2ea643,null))[_0xb2e9('0x23')](handleError(_0x2ea643,null));};exports[_0xb2e9('0x2e')]=function(_0x567068,_0x1de1b4){return db['ChatInteraction'][_0xb2e9('0x47')]({'where':{'id':_0x567068[_0xb2e9('0x49')]['id']}})[_0xb2e9('0x18')](handleEntityNotFound(_0x1de1b4,null))[_0xb2e9('0x18')](removeEntity(_0x1de1b4,null))['catch'](handleError(_0x1de1b4,null));};exports[_0xb2e9('0x4a')]=function(_0x55617b,_0x11ec59){return db[_0xb2e9('0x39')]['describe']()[_0xb2e9('0x18')](respondWithResult(_0x11ec59,null))[_0xb2e9('0x23')](handleError(_0x11ec59,null));};exports[_0xb2e9('0x4b')]=function(_0x34a111,_0x39e289){var _0x3244e5=_0x34a111['params']['id'];var _0xfd36ae;var _0x7b0d00;var _0x459cc6;return db[_0xb2e9('0x39')][_0xb2e9('0x4c')]({'where':{'id':_0x3244e5}})[_0xb2e9('0x18')](function(_0xfbcb2b){_0xfd36ae=_0xfbcb2b;return db[_0xb2e9('0x4d')][_0xb2e9('0x4c')]({'where':{'id':_0xfbcb2b['ChatWebsiteId']},'attributes':['id',_0xb2e9('0x4e'),_0xb2e9('0x4f'),_0xb2e9('0x50'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xb2e9('0x18')](function(_0x3accb8){if(_0x3accb8&&_0x3accb8['vidaooApiKey']&&_0x3accb8[_0xb2e9('0x4f')]){_0x7b0d00=_0x3accb8;var _0x5b3b7d={'interaction':{'id':_0x3244e5},'agent':{'id':_0x34a111['user']['id'],'name':_0x34a111[_0xb2e9('0x51')][_0xb2e9('0x30')],'fullname':_0x34a111['user'][_0xb2e9('0x52')],'email':_0x34a111[_0xb2e9('0x51')][_0xb2e9('0x53')]},'contact':_0x34a111[_0xb2e9('0x34')][_0xb2e9('0x35')],'account':_0x34a111[_0xb2e9('0x34')][_0xb2e9('0x54')]};var _0x35dbcb={'rejectUnauthorized':![],'method':_0xb2e9('0x55'),'url':_0xb2e9('0x56'),'headers':{'X-APIKEY':_0x3accb8[_0xb2e9('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x34a111[_0xb2e9('0x51')]['email']],'buttons':null,'topic':_0x7b0d00[_0xb2e9('0x50')],'note':_[_0xb2e9('0x57')](_0x7b0d00[_0xb2e9('0x58')])?null:getMustacheRender(_0x7b0d00[_0xb2e9('0x58')],_0x5b3b7d),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xb2e9('0x57')](_0x7b0d00[_0xb2e9('0x59')])){var _0xaa2a2e=getMustacheRender(_0x7b0d00['vidaooMetadata'],_0x5b3b7d);var _0x199d4a=JSON[_0xb2e9('0x5a')](_0xaa2a2e);_0x35dbcb[_0xb2e9('0x34')][_0xb2e9('0x5b')]=_0x199d4a;}}catch(_0x642bf4){throw new db[(_0xb2e9('0x5c'))][(_0xb2e9('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35dbcb);}else{throw new db[(_0xb2e9('0x5c'))][(_0xb2e9('0x5d'))](_0xb2e9('0x5e'));}})[_0xb2e9('0x18')](function(_0x558ad0){_0x459cc6=_0x558ad0;if(_0x459cc6['id']){var _0x326f89={'body':_0x459cc6[_0xb2e9('0x5f')],'ChatWebsiteId':_0x7b0d00['id'],'ChatInteractionId':_0xfd36ae['id'],'direction':_0xb2e9('0x60'),'UserId':_0x34a111[_0xb2e9('0x51')]['id']};return db[_0xb2e9('0x61')][_0xb2e9('0x48')](_0x326f89,{});}else{throw new db[(_0xb2e9('0x5c'))]['ValidationError'](_0xb2e9('0x62'));}})['then'](function(){return _0xfd36ae[_0xb2e9('0x63')]({'vidaooSessionId':_0x459cc6['id']});})[_0xb2e9('0x18')](respondWithResult(_0x39e289,null))[_0xb2e9('0x23')](handleError(_0x39e289,null));};exports[_0xb2e9('0x64')]=function(_0x352e92,_0xd1e6c0){if(_0x352e92[_0xb2e9('0x34')]['id']){delete _0x352e92[_0xb2e9('0x34')]['id'];}return db[_0xb2e9('0x39')][_0xb2e9('0x47')]({'where':{'id':_0x352e92['params']['id']},'include':[{'model':db[_0xb2e9('0x65')],'as':_0xb2e9('0x66')}]})[_0xb2e9('0x18')](handleEntityNotFound(_0xd1e6c0,null))[_0xb2e9('0x18')](saveUpdates(_0x352e92[_0xb2e9('0x34')],null))['then'](respondWithResult(_0xd1e6c0,null))[_0xb2e9('0x23')](handleError(_0xd1e6c0,null));};exports['abandon']=function(_0x801a87,_0x373cdc){if(_0x801a87['body']['id']){delete _0x801a87[_0xb2e9('0x34')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x801a87[_0xb2e9('0x49')]['id']}})[_0xb2e9('0x18')](function(_0x344939){if(!_0x344939){logger[_0xb2e9('0x1f')](_0xb2e9('0x67'),_0xb2e9('0x68'),0x194,'entity\x20not\x20found');_0x373cdc[_0xb2e9('0x24')](0x194);}else{if(_0x344939['UserId']){throw new db[(_0xb2e9('0x5c'))][(_0xb2e9('0x5d'))]('Interaction\x20already\x20assigned');}}return _0x344939;})[_0xb2e9('0x18')](function(_0x3ec097){if(_0x3ec097){return _0x3ec097[_0xb2e9('0x2d')]({'closed':_0x801a87[_0xb2e9('0x34')][_0xb2e9('0x69')],'disposition':_0x801a87[_0xb2e9('0x34')]['disposition']})[_0xb2e9('0x18')](function(_0x41420d){return _0x41420d;});}})[_0xb2e9('0x18')](function(){return respondWithRpcPromise(_0xb2e9('0x6a'),_0xb2e9('0x68'),_0x801a87[_0xb2e9('0x34')],client9004);})[_0xb2e9('0x18')](respondWithResult(_0x373cdc,null))[_0xb2e9('0x23')](handleError(_0x373cdc,null));};exports[_0xb2e9('0x6b')]=function(_0x43dc11,_0x4219c0){_0x43dc11['body'][_0xb2e9('0x30')]=_0x43dc11[_0xb2e9('0x6c')][_0xb2e9('0x6d')];_0x43dc11['body'][_0xb2e9('0x6e')]=_0x43dc11[_0xb2e9('0x6c')][_0xb2e9('0x6f')];_0x43dc11[_0xb2e9('0x34')][_0xb2e9('0x3b')]=_0x43dc11['file'][_0xb2e9('0x70')];return db['Attachment'][_0xb2e9('0x48')](_0x43dc11[_0xb2e9('0x34')])[_0xb2e9('0x18')](respondWithResult(_0x4219c0,0xc9))['catch'](handleError(_0x4219c0,null));};exports[_0xb2e9('0x71')]=function(_0x3649d0,_0x3d93c9){return db[_0xb2e9('0x39')][_0xb2e9('0x4c')]({'where':{'id':_0x3649d0[_0xb2e9('0x49')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3d93c9,null))['then'](function(_0x2ce906){if(_0x2ce906){if(_0x2ce906[_0xb2e9('0x69')]){return _0x3d93c9[_0xb2e9('0x25')](0x193)[_0xb2e9('0x26')]({'status':0x193,'message':_0xb2e9('0x72')});}return db[_0xb2e9('0x73')][_0xb2e9('0x4c')]({'where':{'id':_0x3649d0[_0xb2e9('0x3f')][_0xb2e9('0x74')]},'raw':!![]})['then'](handleEntityNotFound(_0x3d93c9,null));}})[_0xb2e9('0x18')](function(_0x4555cc){if(_0x4555cc){var _0x228f63=_0x4555cc['ChatOfflineMessageId']!==null;var _0x6c3b20=path[_0xb2e9('0x75')](config[_0xb2e9('0x76')],_0xb2e9('0x77'));if(_0x228f63){_0x6c3b20=path[_0xb2e9('0x75')](_0x6c3b20,_0xb2e9('0x78'));}var _0x4fd5e1=path['join'](_0x6c3b20,_0x4555cc[_0xb2e9('0x6e')]);return _0x3d93c9[_0xb2e9('0x79')](_0x4fd5e1);}})['catch'](handleError(_0x3d93c9,null));};exports[_0xb2e9('0x7a')]=function(_0x49fac9,_0x9a3c3a){var _0x1b75a4=null;var _0x163ff7=null;var _0x294a34=null;if(_0x49fac9[_0xb2e9('0x34')]['id']){delete _0x49fac9[_0xb2e9('0x34')]['id'];}if(_0x49fac9[_0xb2e9('0x34')][_0xb2e9('0x7b')]){_0x294a34=path[_0xb2e9('0x75')](config['root'],'server/files/chat/upload/',util['format'](_0xb2e9('0x7c'),Date[_0xb2e9('0x7d')]()));_0x49fac9[_0xb2e9('0x34')][_0xb2e9('0x7e')]=_0x294a34;}return db['ChatInteraction'][_0xb2e9('0x47')]({'where':{'id':_0x49fac9['params']['id']},'include':[{'model':db[_0xb2e9('0x61')],'as':_0xb2e9('0x7f'),'include':[{'model':db[_0xb2e9('0x80')],'as':_0xb2e9('0x80')}]}]})[_0xb2e9('0x18')](handleEntityNotFound(_0x9a3c3a,null))[_0xb2e9('0x18')](saveUpdates(_0x49fac9[_0xb2e9('0x34')],null))[_0xb2e9('0x18')](function(_0x3cd648){if(_0x3cd648){_0x1b75a4=_0x3cd648;return db['ChatWebsite'][_0xb2e9('0x47')]({'where':{'id':_0x1b75a4['ChatWebsiteId']}});}})[_0xb2e9('0x18')](function(_0x4ad4b6){if(_0x4ad4b6){_0x163ff7=_0x4ad4b6;return db['CmContact'][_0xb2e9('0x47')]({'where':{'id':_0x1b75a4['ContactId']}});}})[_0xb2e9('0x18')](function(_0x1bc550){if(_0x1bc550){if(_0x294a34){var _0x457cc7=null;for(var _0x463cc5=0x1;_0x463cc5<_0x1b75a4[_0xb2e9('0x7f')][_0xb2e9('0x46')];++_0x463cc5){_0x457cc7=_0x1b75a4[_0xb2e9('0x7f')][_0x463cc5];var _0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?util[_0xb2e9('0x82')](_0xb2e9('0x83'),_0x163ff7[_0xb2e9('0x84')],_0x457cc7['UserId']):'System';var _0x24bff2=_0x49fac9[_0xb2e9('0x34')]['customer']||util['format'](_0xb2e9('0x83'),_0xb2e9('0x85'),_0x457cc7[_0xb2e9('0x86')]);switch(_0x163ff7[_0xb2e9('0x87')]){case _0xb2e9('0x88'):_0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?util[_0xb2e9('0x82')](_0xb2e9('0x83'),_0x163ff7[_0xb2e9('0x84')],_0x457cc7[_0xb2e9('0x81')]):_0xb2e9('0x89');break;case _0xb2e9('0x8a'):_0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?_0x457cc7[_0xb2e9('0x80')][_0xb2e9('0x8b')]||_0x457cc7['User'][_0xb2e9('0x52')]:_0xb2e9('0x89');break;case'agent_fullname':_0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?_0x457cc7['User'][_0xb2e9('0x52')]:_0xb2e9('0x89');break;default:_0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?util[_0xb2e9('0x82')]('%s%d',_0x163ff7[_0xb2e9('0x84')],_0x457cc7['UserId']):_0xb2e9('0x89');}var _0x5e0b7f=util[_0xb2e9('0x82')](_0xb2e9('0x8c'),moment(_0x457cc7[_0xb2e9('0x8d')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x457cc7[_0xb2e9('0x8e')]==='in'?_0x24bff2:_0x18ba3a,_0x457cc7[_0xb2e9('0x34')]);if(!_0x457cc7['secret']){fs[_0xb2e9('0x8f')](_0x294a34,_0x5e0b7f);}}return db[_0xb2e9('0x90')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xb2e9('0x91'),'raw':!![],'include':[{'model':db[_0xb2e9('0x92')],'as':_0xb2e9('0x92'),'raw':!![]}]}]});}}})[_0xb2e9('0x18')](function(_0x30b2b6){if(!_0x30b2b6||!_0x30b2b6[_0xb2e9('0x91')]||!_0x49fac9[_0xb2e9('0x34')])return _0x1b75a4;var _0x2151af=_0x30b2b6[_0xb2e9('0x93')]();return respondWithRpcPromise('SendMail',_0xb2e9('0x94'),{'account':_0x2151af,'message':{'from':util[_0xb2e9('0x82')](_0xb2e9('0x95'),_0x30b2b6[_0xb2e9('0x30')],_0x30b2b6[_0xb2e9('0x53')]||_0x30b2b6[_0xb2e9('0x91')]['user']),'to':_0x49fac9[_0xb2e9('0x34')]['mailTranscript'],'subject':_0xb2e9('0x96'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x49fac9['body'][_0xb2e9('0x7b')]),'attachments':[{'path':_0x294a34}]}})[_0xb2e9('0x18')](function(){return _0x1b75a4;})['catch'](function(_0xb3f0ee){logger['error'](_0xb3f0ee);});})[_0xb2e9('0x18')](respondWithStatusCode(_0x9a3c3a,0xc8))[_0xb2e9('0x23')](handleError(_0x9a3c3a,null));};exports['addMessage']=function(_0x3d455a,_0x28701c){return db[_0xb2e9('0x61')][_0xb2e9('0x47')]({'where':{'id':_0x3d455a[_0xb2e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x28701c,null))[_0xb2e9('0x18')](function(_0x6a34a6){if(_0x6a34a6){return _0x6a34a6[_0xb2e9('0x97')](_0x3d455a['body'][_0xb2e9('0x98')],_[_0xb2e9('0x99')](_0x3d455a[_0xb2e9('0x34')],['ids','id'])||{});}})[_0xb2e9('0x18')](respondWithResult(_0x28701c,null))[_0xb2e9('0x23')](handleError(_0x28701c,null));};exports['getMessages']=function(_0x22bf3e,_0x3b815f){var _0x2f62a3={'raw':![],'where':{}};var _0x5d2e8f={};var _0x56ac35={'count':0x0,'rows':[]};return db[_0xb2e9('0x39')][_0xb2e9('0x4c')]({'where':{'id':_0x22bf3e[_0xb2e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b815f,null))[_0xb2e9('0x18')](function(_0x38741e){if(_0x38741e){_0x5d2e8f['model']=_[_0xb2e9('0x41')](db[_0xb2e9('0x61')][_0xb2e9('0x3a')]);_0x5d2e8f[_0xb2e9('0x3f')]=_[_0xb2e9('0x41')](_0x22bf3e[_0xb2e9('0x3f')]);_0x5d2e8f[_0xb2e9('0x42')]=_[_0xb2e9('0x43')](_0x5d2e8f[_0xb2e9('0x40')],_0x5d2e8f['query']);_0x2f62a3['attributes']=_[_0xb2e9('0x43')](_0x5d2e8f['model'],qs[_0xb2e9('0x44')](_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0x44')]));_0x2f62a3[_0xb2e9('0x45')]=_0x2f62a3['attributes']['length']?_0x2f62a3[_0xb2e9('0x45')]:_0x5d2e8f[_0xb2e9('0x40')];if(!_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0x9a')]('nolimit')){_0x2f62a3[_0xb2e9('0x29')]=qs[_0xb2e9('0x29')](_0x22bf3e[_0xb2e9('0x3f')]['limit']);_0x2f62a3[_0xb2e9('0x27')]=qs['offset'](_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0x27')]);}_0x2f62a3[_0xb2e9('0x9b')]=qs[_0xb2e9('0x9c')](_0x22bf3e[_0xb2e9('0x3f')]['sort']);_0x2f62a3['where']=qs[_0xb2e9('0x42')](_[_0xb2e9('0x9d')](_0x22bf3e['query'],_0x5d2e8f[_0xb2e9('0x42')]));_0x2f62a3[_0xb2e9('0x9e')][_0xb2e9('0x9f')]=_0x38741e['id'];if(_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0xa0')]){_0x2f62a3[_0xb2e9('0x9e')]=_[_0xb2e9('0x33')](_0x2f62a3[_0xb2e9('0x9e')],{'$or':_['map'](_0x2f62a3[_0xb2e9('0x45')],function(_0x314bc1){var _0x11f231={};_0x11f231[_0x314bc1]={'$like':'%'+_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0xa0')]+'%'};return _0x11f231;})});}if(_0x22bf3e['query'][_0xb2e9('0xa1')]){var _0x575132=_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0xa1')][_0xb2e9('0xa2')](',');var _0x34f032={};_0x34f032[_0x575132[0x0]]={'$gte':moment(_0x575132[0x1])[_0xb2e9('0x82')](_0xb2e9('0xa3'))};_0x2f62a3[_0xb2e9('0x9e')]=_[_0xb2e9('0x33')](_0x2f62a3[_0xb2e9('0x9e')],_0x34f032);}_0x2f62a3=_[_0xb2e9('0x33')]({},_0x2f62a3,_0x22bf3e[_0xb2e9('0xa4')]);return db[_0xb2e9('0x61')][_0xb2e9('0x2a')]({'where':_0x2f62a3[_0xb2e9('0x9e')]})[_0xb2e9('0x18')](function(_0x3767ca){_0x56ac35[_0xb2e9('0x2a')]=_0x3767ca;if(_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0xa5')]){_0x2f62a3['include']=[{'all':!![]}];}return db[_0xb2e9('0x61')]['findAll'](_0x2f62a3);})['then'](function(_0xf74c0){_0x56ac35['rows']=_0xf74c0;return _0x56ac35;});}})[_0xb2e9('0x18')](respondWithFilteredResult(_0x3b815f,_0x2f62a3))[_0xb2e9('0x23')](handleError(_0x3b815f,null));};exports['getMyMessages']=function(_0x5ddaa6,_0x59bed0){var _0x399b5a={'where':{}},_0x11b7a1={},_0x1cd41a={'count':0x0,'rows':[]};return db[_0xb2e9('0x39')][_0xb2e9('0x4c')]({'where':{'id':_0x5ddaa6[_0xb2e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x59bed0,null))[_0xb2e9('0x18')](function(_0x259588){if(_0x259588){_0x11b7a1[_0xb2e9('0x40')]=_[_0xb2e9('0x41')](db[_0xb2e9('0x61')][_0xb2e9('0x3a')]);_0x11b7a1['query']=_[_0xb2e9('0x41')](_0x5ddaa6[_0xb2e9('0x3f')]);_0x11b7a1[_0xb2e9('0x42')]=_[_0xb2e9('0x43')](_0x11b7a1['model'],_0x11b7a1[_0xb2e9('0x3f')]);_0x399b5a[_0xb2e9('0x45')]=_[_0xb2e9('0x43')](_0x11b7a1[_0xb2e9('0x40')],qs['fields'](_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0x44')]));_0x399b5a['attributes']=_0x399b5a[_0xb2e9('0x45')][_0xb2e9('0x46')]?_0x399b5a[_0xb2e9('0x45')]:_0x11b7a1['model'];if(!_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0x9a')](_0xb2e9('0xa6'))){_0x399b5a[_0xb2e9('0x29')]=qs[_0xb2e9('0x29')](_0x5ddaa6['query'][_0xb2e9('0x29')]);_0x399b5a['offset']=qs[_0xb2e9('0x27')](_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0x27')]);}_0x399b5a[_0xb2e9('0x9b')]=qs[_0xb2e9('0x9c')](_0x5ddaa6['query']['sort']);_0x399b5a['where']=qs[_0xb2e9('0x42')](_['pick'](_0x5ddaa6[_0xb2e9('0x3f')],_0x11b7a1[_0xb2e9('0x42')]));_0x399b5a[_0xb2e9('0x9e')][_0xb2e9('0x9f')]=_0x259588['id'];if(_0x5ddaa6['query'][_0xb2e9('0xa0')]){_0x399b5a[_0xb2e9('0x9e')]=_[_0xb2e9('0x33')](_0x399b5a[_0xb2e9('0x9e')],{'$or':_[_0xb2e9('0x38')](_0x399b5a['attributes'],function(_0x240d39){var _0x4af753={};_0x4af753[_0x240d39]={'$like':'%'+_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0xa0')]+'%'};return _0x4af753;})});}_0x399b5a[_0xb2e9('0x9e')]['secret']=![];if(_0x5ddaa6[_0xb2e9('0x3f')]['id']){_0x399b5a[_0xb2e9('0x9e')]['id']={'$gt':_0x5ddaa6[_0xb2e9('0x3f')]['id']};}_0x399b5a=_['merge']({},_0x399b5a,_0x5ddaa6['options']);return db[_0xb2e9('0x61')][_0xb2e9('0x2a')]({'where':_0x399b5a[_0xb2e9('0x9e')]})['then'](function(_0x2a29bb){_0x1cd41a['count']=_0x2a29bb;_0x399b5a[_0xb2e9('0xa7')]=[];if(_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0xa8')]){_0x399b5a[_0xb2e9('0xa7')][_0xb2e9('0xa9')]({'model':db[_0xb2e9('0x80')],'as':_0xb2e9('0x80'),'attributes':['id','fullname',_0xb2e9('0x8b')]});}if(_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0xa5')]){_0x399b5a[_0xb2e9('0xa7')]=[{'all':!![]}];}return db['ChatMessage'][_0xb2e9('0x3d')](_0x399b5a);})['then'](function(_0x2f6394){_0x1cd41a[_0xb2e9('0xaa')]=_0x2f6394;return _0x1cd41a;});}})[_0xb2e9('0x18')](respondWithFilteredResult(_0x59bed0,_0x399b5a))[_0xb2e9('0x23')](handleError(_0x59bed0,null));};exports[_0xb2e9('0xab')]=function(_0x170022,_0x22c476){return db[_0xb2e9('0x39')]['find']({'where':{'id':_0x170022['params']['id']}})[_0xb2e9('0x18')](handleEntityNotFound(_0x22c476,null))[_0xb2e9('0x18')](function(_0x55923c){if(_0x55923c){return _0x55923c[_0xb2e9('0xac')](_0x170022[_0xb2e9('0x34')][_0xb2e9('0x98')],_['omit'](_0x170022[_0xb2e9('0x34')],[_0xb2e9('0x98'),'id'])||{})[_0xb2e9('0xad')](function(){return db[_0xb2e9('0xae')][_0xb2e9('0x3d')]({'attributes':['id',_0xb2e9('0x30'),_0xb2e9('0xaf')],'where':{'id':_0x170022[_0xb2e9('0x34')]['ids']}});})[_0xb2e9('0x18')](function(_0x302114){socket[_0xb2e9('0xb0')](_0xb2e9('0xb1'),{'id':Number(_0x170022[_0xb2e9('0x49')]['id']),'tags':_0x302114||[]});return{'id':Number(_0x170022['params']['id']),'tags':_0x302114||[]};});}})[_0xb2e9('0x18')](respondWithResult(_0x22c476,null))[_0xb2e9('0x23')](handleError(_0x22c476,null));};exports[_0xb2e9('0xb2')]=function(_0x552e8a,_0x950e56){return db[_0xb2e9('0x39')][_0xb2e9('0x47')]({'where':{'id':_0x552e8a[_0xb2e9('0x49')]['id']}})[_0xb2e9('0x18')](handleEntityNotFound(_0x950e56,null))['then'](function(_0xc09714){if(_0xc09714){return _0xc09714[_0xb2e9('0xb2')](_0x552e8a[_0xb2e9('0x3f')][_0xb2e9('0x98')]);}})[_0xb2e9('0x18')](respondWithStatusCode(_0x950e56,null))[_0xb2e9('0x23')](handleError(_0x950e56,null));};exports[_0xb2e9('0x79')]=function(_0x24b5dd,_0x4e4bf3){var _0x174740=moment()[_0xb2e9('0xb3')]()[_0xb2e9('0xb4')]();var _0x13178a=path[_0xb2e9('0x75')](config[_0xb2e9('0x76')],_0xb2e9('0xb5'),_0xb2e9('0xb6'),_0xb2e9('0xb7'));var _0x2bbcb9=path[_0xb2e9('0x75')](config[_0xb2e9('0x76')],_0xb2e9('0xb5'),_0xb2e9('0xb6'),_0xb2e9('0xb8'));var _0xec07ae=path[_0xb2e9('0x75')](_0x13178a,_0x174740);var _0x4f763b=util[_0xb2e9('0x82')]('transcript-%d-%s.zip',_0x24b5dd[_0xb2e9('0x49')]['id'],_0x174740);var _0x12b98=path[_0xb2e9('0x75')](_0x13178a,_0x4f763b);var _0x114401=[];_0x114401['push']({'model':db[_0xb2e9('0x80')],'as':_0xb2e9('0x80'),'attributes':['id',_0xb2e9('0x52')],'raw':!![]});_0x114401[_0xb2e9('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xb2e9('0xb9'),_0xb2e9('0xba')],'raw':!![]});if(_0x24b5dd[_0xb2e9('0x3f')][_0xb2e9('0xb8')]){_0x114401['push']({'model':db[_0xb2e9('0x73')],'as':'Attachment','raw':!![]});}var _0x318619=[{'model':db[_0xb2e9('0x61')],'as':'Messages','attributes':['id',_0xb2e9('0x34'),_0xb2e9('0x8d'),_0xb2e9('0x8e'),_0xb2e9('0xbb'),_0xb2e9('0xbc')],'include':_0x114401}];_0x318619[_0xb2e9('0xa9')]({'model':db[_0xb2e9('0x4d')],'as':_0xb2e9('0xbd'),'attributes':['id',_0xb2e9('0x30')]});_0x318619[_0xb2e9('0xa9')]({'model':db[_0xb2e9('0x80')],'as':'Owner','attributes':['id',_0xb2e9('0x52')]});return db[_0xb2e9('0x39')]['find']({'where':{'id':_0x24b5dd[_0xb2e9('0x49')]['id']},'include':_0x318619})[_0xb2e9('0x18')](handleEntityNotFound(_0x4e4bf3,null))[_0xb2e9('0x18')](function(_0x23455b){if(_0x23455b){var _0x283c89=_0x23455b[_0xb2e9('0xbe')]({'plain':!![]});fs[_0xb2e9('0xbf')](_0xec07ae);var _0xdc8a07={'channel':_0xb2e9('0xc0'),'account':_0x283c89[_0xb2e9('0xbd')][_0xb2e9('0x30')],'agent':_0x283c89[_0xb2e9('0xc1')]?_0x283c89[_0xb2e9('0xc1')][_0xb2e9('0x52')]:_0xb2e9('0xc2'),'createdAt':moment(_0x283c89[_0xb2e9('0x8d')])[_0xb2e9('0x82')](_0xb2e9('0xa3'))['toString'](),'closedAt':_0x283c89[_0xb2e9('0x69')]?moment(_0x283c89['closedAt'])[_0xb2e9('0x82')](_0xb2e9('0xa3'))[_0xb2e9('0xb4')]():'','disposition':_0x283c89[_0xb2e9('0xc3')],'chatInfo':{'browser':_0x283c89[_0xb2e9('0xc4')],'os':_0x283c89['osName'],'referer':_0x283c89[_0xb2e9('0xc5')],'customerIp':_0x283c89[_0xb2e9('0xc6')],'customerPort':_0x283c89['customerPort']?_0x283c89[_0xb2e9('0xc7')]:_0xb2e9('0xc2')},'messages':_(_0x283c89[_0xb2e9('0x7f')])[_0xb2e9('0xc8')]()[_0xb2e9('0xa0')]({'secret':![]})[_0xb2e9('0x38')](function(_0x750ada){if(_0x750ada['Attachment']){var _0x173c39=path[_0xb2e9('0x75')](_0x2bbcb9,_0x750ada[_0xb2e9('0x73')]['basename']);if(fs[_0xb2e9('0xc9')](_0x173c39)){fs[_0xb2e9('0xca')](_0x173c39)[_0xb2e9('0xcb')](fs['createWriteStream'](path[_0xb2e9('0x75')](_0xec07ae,_0x750ada[_0xb2e9('0x73')][_0xb2e9('0x6e')])));}}return{'date':moment(_0x750ada[_0xb2e9('0x8d')])[_0xb2e9('0x82')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb2e9('0xb4')](),'sender':_0x750ada['direction']==='out'?_0x750ada[_0xb2e9('0x80')]?_0x750ada[_0xb2e9('0x80')][_0xb2e9('0x52')]:_0xb2e9('0x89'):_0x750ada[_0xb2e9('0x66')][_0xb2e9('0xb9')]+(_0x750ada[_0xb2e9('0x66')][_0xb2e9('0xba')]?'\x20'+_0x750ada[_0xb2e9('0x66')][_0xb2e9('0xba')]:''),'body':_0x750ada['Attachment']?_0x750ada['Attachment'][_0xb2e9('0x6e')]:_0x750ada['body'],'direction':_0x750ada[_0xb2e9('0x8e')]===_0xb2e9('0x60')?'A':'C','secret':_0x750ada[_0xb2e9('0xbb')],'read':_0x750ada['read'],'attachment':_0x750ada['Attachment']};})['value']()};return ejs[_0xb2e9('0xcc')](path[_0xb2e9('0x75')](config[_0xb2e9('0x76')],_0xb2e9('0xb5'),_0xb2e9('0xcd'),_0xb2e9('0xce')),{'interaction':_0xdc8a07})[_0xb2e9('0x18')](function(_0x425ccc){var _0x268102=path[_0xb2e9('0x75')](_0xec07ae,_0xb2e9('0xcf')+_0x283c89['id']+'-'+_0x174740+_0xb2e9('0xd0'));var _0x954165={'path':_0x268102,'channel':_0xb2e9('0xc0'),'interactionId':_0x283c89['id']};return pdf[_0xb2e9('0xd1')](_0x425ccc,_0x954165);})[_0xb2e9('0x18')](function(){return new Promise(function(_0xfbea79,_0x2d9b98){zipdir(_0xec07ae,{'saveTo':_0x12b98},function(_0x3d7ba1,_0x358925){if(_0x3d7ba1)return _0x2d9b98(_0x3d7ba1);return _0xfbea79(_0x358925);});})[_0xb2e9('0x18')](function(){return new BPromise(function(_0x299d57,_0x454325){rimraf(_0xec07ae,function(_0x4841be){if(_0x4841be)_0x454325(_0x4841be);return _0x299d57();});});})[_0xb2e9('0x18')](function(){return _0x4e4bf3[_0xb2e9('0x79')](_0x12b98,_0x4f763b,function(_0x2e9e7c){if(_0x2e9e7c){logger[_0xb2e9('0x1f')](_0xb2e9('0xd2'),_0x2e9e7c);}else{fs['unlinkSync'](_0x12b98);}});});});}else{return _0x4e4bf3[_0xb2e9('0x24')](0xc8);}})[_0xb2e9('0x23')](handleError(_0x4e4bf3,null));};
\ No newline at end of file
+var _0x95c4=['alias','findAll','addTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','unix','toString','root','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','read','Owner','mkdirSync','Chat','Account','N.A.','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','sendStatus','name','send','render','merge','body','agent','interaction','account','index','map','rawAttributes','fieldName','type','key','getOptions','chat','query','user','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','ChatInteraction','find','catch','create','update','describe','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','abandon','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','ChatOfflineMessageId','server/files/attachments/','offline-chat/','join','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','ContactId','format','%s%d','agentAlias','Visitor','agentIdentifier','website_alias','UserId','agent_alias','User','fullname','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','nolimit','includeAgent','push'];(function(_0x406cf7,_0xe378a5){var _0x325d00=function(_0x80872f){while(--_0x80872f){_0x406cf7['push'](_0x406cf7['shift']());}};_0x325d00(++_0xe378a5);}(_0x95c4,0xfd));var _0x495c=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x95c4[_0x3fba9f];return _0x192cf1;};'use strict';var rimraf=require(_0x495c('0x0'));var zipdir=require(_0x495c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x495c('0x2'));var Mustache=require(_0x495c('0x3'));var util=require(_0x495c('0x4'));var path=require(_0x495c('0x5'));var ejs=require(_0x495c('0x6'));var fs=require('fs');var _=require(_0x495c('0x7'));var Redis=require('ioredis');var interaction=require(_0x495c('0x8'));var qs=require(_0x495c('0x9'));var pdf=require(_0x495c('0xa'));var logger=require(_0x495c('0xb'))('api');var config=require('../../config/environment');var db=require(_0x495c('0xc'))['db'];config[_0x495c('0xd')]=_[_0x495c('0xe')](config[_0x495c('0xd')],{'host':_0x495c('0xf'),'port':0x18eb});var socket=require(_0x495c('0x10'))(new Redis(config[_0x495c('0xd')]));require(_0x495c('0x11'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x495c('0x12')]({'port':0x232b});var client9004=jayson['client'][_0x495c('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x27a29e,_0x14830a,_0x528f24,_0x10417b){return new BPromise(function(_0x80a73a,_0x3404d7){var _0x4dbe14=_0x10417b||client;return _0x4dbe14[_0x495c('0x13')](_0x27a29e,_0x528f24)[_0x495c('0x14')](function(_0x313efc){logger[_0x495c('0x15')](_0x495c('0x16'),_0x14830a,'request\x20sent');logger[_0x495c('0x17')](_0x495c('0x18'),_0x14830a,_0x495c('0x19'),JSON['stringify'](_0x313efc));if(_0x313efc[_0x495c('0x1a')]){if(_0x313efc['error'][_0x495c('0x1b')]===0x1f4){logger[_0x495c('0x1a')](_0x495c('0x16'),_0x14830a,_0x313efc[_0x495c('0x1a')][_0x495c('0x1c')]);return _0x3404d7(_0x313efc[_0x495c('0x1a')][_0x495c('0x1c')]);}logger[_0x495c('0x1a')](_0x495c('0x16'),_0x14830a,_0x313efc[_0x495c('0x1a')][_0x495c('0x1c')]);return _0x80a73a(_0x313efc[_0x495c('0x1a')][_0x495c('0x1c')]);}else{logger[_0x495c('0x15')](_0x495c('0x16'),_0x14830a,'request\x20sent');_0x80a73a(_0x313efc['result'][_0x495c('0x1c')]);}})['catch'](function(_0xc608d1){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x14830a,_0xc608d1);_0x3404d7(_0xc608d1);});});}function respondWithStatusCode(_0x1a5e1f,_0x19c363){_0x19c363=_0x19c363||0xcc;return function(_0xadc628){if(_0xadc628){return _0x1a5e1f['sendStatus'](_0x19c363);}return _0x1a5e1f[_0x495c('0x1d')](_0x19c363)[_0x495c('0x1e')]();};}function respondWithResult(_0xd4f8ed,_0x455050){_0x455050=_0x455050||0xc8;return function(_0x37198a){if(_0x37198a){return _0xd4f8ed[_0x495c('0x1d')](_0x455050)[_0x495c('0x1f')](_0x37198a);}};}function respondWithFilteredResult(_0x58f681,_0x172306){return function(_0x26d359){if(_0x26d359){var _0x4f323a=typeof _0x172306['offset']===_0x495c('0x20')&&typeof _0x172306[_0x495c('0x21')]==='undefined';var _0x341f65=_0x26d359[_0x495c('0x22')];var _0x3f80aa=_0x4f323a?0x0:_0x172306[_0x495c('0x23')];var _0x299744=_0x4f323a?_0x26d359[_0x495c('0x22')]:_0x172306['offset']+_0x172306[_0x495c('0x21')];var _0x158f8e;if(_0x299744>=_0x341f65){_0x299744=_0x341f65;_0x158f8e=0xc8;}else{_0x158f8e=0xce;}_0x58f681[_0x495c('0x1d')](_0x158f8e);return _0x58f681[_0x495c('0x24')](_0x495c('0x25'),_0x3f80aa+'-'+_0x299744+'/'+_0x341f65)[_0x495c('0x1f')](_0x26d359);}return null;};}function saveUpdates(_0xe5bbd0){return function(_0x38bc66){if(_0x38bc66){return _0x38bc66['update'](_0xe5bbd0)[_0x495c('0x14')](function(_0x2706d0){return _0x2706d0;});}return null;};}function removeEntity(_0x266b99){return function(_0x3b404a){if(_0x3b404a){return _0x3b404a[_0x495c('0x26')]()[_0x495c('0x14')](function(){_0x266b99[_0x495c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d8df){return function(_0x5825c8){if(!_0x5825c8){_0x16d8df[_0x495c('0x27')](0x194);}return _0x5825c8;};}function handleError(_0x4978e2,_0x36b978){_0x36b978=_0x36b978||0x1f4;return function(_0x41650a){logger[_0x495c('0x1a')](_0x41650a['stack']);if(_0x41650a[_0x495c('0x28')]){delete _0x41650a[_0x495c('0x28')];}_0x4978e2[_0x495c('0x1d')](_0x36b978)[_0x495c('0x29')](_0x41650a);};}function getMustacheRender(_0x364081,_0x42e340){return Mustache[_0x495c('0x2a')](_0x364081,_[_0x495c('0x2b')](_0x42e340[_0x495c('0x2c')],{'contact':_0x42e340['contact'],'message':_0x42e340['message'],'agent':_0x42e340[_0x495c('0x2d')],'interaction':_0x42e340[_0x495c('0x2e')],'account':_0x42e340[_0x495c('0x2f')]}))||'';}exports[_0x495c('0x30')]=function(_0x9214e5,_0xaac129){var _0x2432bc={};var _0x44c4ab=_[_0x495c('0x31')](db['ChatInteraction'][_0x495c('0x32')],function(_0x2571a5){return{'name':_0x2571a5[_0x495c('0x33')],'type':_0x2571a5[_0x495c('0x34')][_0x495c('0x35')]};});_0x2432bc=qs[_0x495c('0x36')](_0x44c4ab,_0x9214e5);return interaction['findAll'](_0x495c('0x37'),_0x9214e5[_0x495c('0x38')],_0x9214e5[_0x495c('0x39')],_0x2432bc,_0x44c4ab)[_0x495c('0x14')](respondWithFilteredResult(_0xaac129,_0x2432bc))['catch'](handleError(_0xaac129,null));};exports['show']=function(_0x252d52,_0x17e779){var _0x138221={'raw':![],'where':{'id':_0x252d52[_0x495c('0x3a')]['id']}},_0x1a3cf3={};_0x1a3cf3[_0x495c('0x3b')]=_[_0x495c('0x3c')](db['ChatInteraction'][_0x495c('0x32')]);_0x1a3cf3[_0x495c('0x38')]=_[_0x495c('0x3c')](_0x252d52[_0x495c('0x38')]);_0x1a3cf3[_0x495c('0x3d')]=_[_0x495c('0x3e')](_0x1a3cf3[_0x495c('0x3b')],_0x1a3cf3[_0x495c('0x38')]);_0x138221[_0x495c('0x3f')]=_[_0x495c('0x3e')](_0x1a3cf3[_0x495c('0x3b')],qs[_0x495c('0x40')](_0x252d52[_0x495c('0x38')][_0x495c('0x40')]));_0x138221[_0x495c('0x3f')]=_0x138221[_0x495c('0x3f')][_0x495c('0x41')]?_0x138221[_0x495c('0x3f')]:_0x1a3cf3[_0x495c('0x3b')];if(_0x252d52[_0x495c('0x38')][_0x495c('0x42')]){_0x138221[_0x495c('0x43')]=[{'all':!![]}];}_0x138221=_[_0x495c('0x2b')]({},_0x138221,_0x252d52[_0x495c('0x44')]);return db[_0x495c('0x45')][_0x495c('0x46')](_0x138221)[_0x495c('0x14')](handleEntityNotFound(_0x17e779,null))['then'](respondWithResult(_0x17e779,null))[_0x495c('0x47')](handleError(_0x17e779,null));};exports['create']=function(_0x2cd88c,_0xbdffce){return db[_0x495c('0x45')][_0x495c('0x48')](_0x2cd88c['body'],{})['then'](respondWithResult(_0xbdffce,0xc9))[_0x495c('0x47')](handleError(_0xbdffce,null));};exports[_0x495c('0x49')]=function(_0x27701f,_0x38f89c){if(_0x27701f[_0x495c('0x2c')]['id']){delete _0x27701f[_0x495c('0x2c')]['id'];}return db[_0x495c('0x45')]['find']({'where':{'id':_0x27701f[_0x495c('0x3a')]['id']}})[_0x495c('0x14')](handleEntityNotFound(_0x38f89c,null))[_0x495c('0x14')](saveUpdates(_0x27701f[_0x495c('0x2c')],null))[_0x495c('0x14')](respondWithResult(_0x38f89c,null))[_0x495c('0x47')](handleError(_0x38f89c,null));};exports[_0x495c('0x26')]=function(_0x34345f,_0x123d91){return db['ChatInteraction'][_0x495c('0x46')]({'where':{'id':_0x34345f[_0x495c('0x3a')]['id']}})[_0x495c('0x14')](handleEntityNotFound(_0x123d91,null))[_0x495c('0x14')](removeEntity(_0x123d91,null))[_0x495c('0x47')](handleError(_0x123d91,null));};exports[_0x495c('0x4a')]=function(_0x2ed021,_0x1d4cb8){return db[_0x495c('0x45')]['describe']()[_0x495c('0x14')](respondWithResult(_0x1d4cb8,null))[_0x495c('0x47')](handleError(_0x1d4cb8,null));};exports['createVidaooSession']=function(_0x4405c6,_0x36e407){var _0x457359=_0x4405c6[_0x495c('0x3a')]['id'];var _0x5eba88;var _0x485aab;var _0xfa584;return db[_0x495c('0x45')]['findOne']({'where':{'id':_0x457359}})[_0x495c('0x14')](function(_0xd46511){_0x5eba88=_0xd46511;return db[_0x495c('0x4b')]['findOne']({'where':{'id':_0xd46511[_0x495c('0x4c')]},'attributes':['id',_0x495c('0x4d'),_0x495c('0x4e'),_0x495c('0x4f'),_0x495c('0x50'),_0x495c('0x51')],'raw':!![]});})[_0x495c('0x14')](function(_0x39aab7){if(_0x39aab7&&_0x39aab7[_0x495c('0x4d')]&&_0x39aab7[_0x495c('0x4e')]){_0x485aab=_0x39aab7;var _0x3e10f6={'interaction':{'id':_0x457359},'agent':{'id':_0x4405c6[_0x495c('0x39')]['id'],'name':_0x4405c6['user'][_0x495c('0x28')],'fullname':_0x4405c6[_0x495c('0x39')]['fullname'],'email':_0x4405c6[_0x495c('0x39')][_0x495c('0x52')]},'contact':_0x4405c6[_0x495c('0x2c')][_0x495c('0x53')],'account':_0x4405c6[_0x495c('0x2c')][_0x495c('0x2f')]};var _0x23895e={'rejectUnauthorized':![],'method':_0x495c('0x54'),'url':_0x495c('0x55'),'headers':{'X-APIKEY':_0x39aab7[_0x495c('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4405c6[_0x495c('0x39')][_0x495c('0x52')]],'buttons':null,'topic':_0x485aab[_0x495c('0x4f')],'note':_[_0x495c('0x56')](_0x485aab['vidaooNote'])?null:getMustacheRender(_0x485aab[_0x495c('0x50')],_0x3e10f6),'metadata':null},'redirect':_0x495c('0x57'),'json':!![]};try{if(!_[_0x495c('0x56')](_0x485aab['vidaooMetadata'])){var _0x45ce7c=getMustacheRender(_0x485aab[_0x495c('0x51')],_0x3e10f6);var _0x199a6d=JSON[_0x495c('0x58')](_0x45ce7c);_0x23895e[_0x495c('0x2c')][_0x495c('0x59')]=_0x199a6d;}}catch(_0xdf5ccf){throw new db[(_0x495c('0x5a'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x23895e);}else{throw new db[(_0x495c('0x5a'))][(_0x495c('0x5b'))](_0x495c('0x5c'));}})[_0x495c('0x14')](function(_0x3f92fc){_0xfa584=_0x3f92fc;if(_0xfa584['id']){var _0x490d86={'body':_0xfa584[_0x495c('0x5d')],'ChatWebsiteId':_0x485aab['id'],'ChatInteractionId':_0x5eba88['id'],'direction':_0x495c('0x5e'),'UserId':_0x4405c6[_0x495c('0x39')]['id']};return db[_0x495c('0x5f')][_0x495c('0x48')](_0x490d86,{});}else{throw new db[(_0x495c('0x5a'))][(_0x495c('0x5b'))](_0x495c('0x60'));}})[_0x495c('0x14')](function(){return _0x5eba88[_0x495c('0x61')]({'vidaooSessionId':_0xfa584['id']});})['then'](respondWithResult(_0x36e407,null))['catch'](handleError(_0x36e407,null));};exports[_0x495c('0x62')]=function(_0x2bef92,_0x2ae9c0){if(_0x2bef92[_0x495c('0x2c')]['id']){delete _0x2bef92[_0x495c('0x2c')]['id'];}return db[_0x495c('0x45')][_0x495c('0x46')]({'where':{'id':_0x2bef92[_0x495c('0x3a')]['id']},'include':[{'model':db[_0x495c('0x63')],'as':_0x495c('0x64')}]})[_0x495c('0x14')](handleEntityNotFound(_0x2ae9c0,null))[_0x495c('0x14')](saveUpdates(_0x2bef92[_0x495c('0x2c')],null))[_0x495c('0x14')](respondWithResult(_0x2ae9c0,null))[_0x495c('0x47')](handleError(_0x2ae9c0,null));};exports['abandon']=function(_0x3a16f6,_0x418a7e){if(_0x3a16f6[_0x495c('0x2c')]['id']){delete _0x3a16f6[_0x495c('0x2c')]['id'];}return db['ChatInteraction'][_0x495c('0x46')]({'where':{'id':_0x3a16f6['params']['id']}})[_0x495c('0x14')](function(_0x62bf06){if(!_0x62bf06){logger[_0x495c('0x1a')](_0x495c('0x65'),'abandon',0x194,'entity\x20not\x20found');_0x418a7e[_0x495c('0x27')](0x194);}else{if(_0x62bf06['UserId']){throw new db[(_0x495c('0x5a'))][(_0x495c('0x5b'))](_0x495c('0x66'));}}return _0x62bf06;})[_0x495c('0x14')](function(_0x23513e){if(_0x23513e){return _0x23513e[_0x495c('0x49')]({'closed':_0x3a16f6[_0x495c('0x2c')][_0x495c('0x67')],'disposition':_0x3a16f6[_0x495c('0x2c')][_0x495c('0x68')]})[_0x495c('0x14')](function(_0x4f59b2){return _0x4f59b2;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x495c('0x69'),_0x3a16f6[_0x495c('0x2c')],client9004);})[_0x495c('0x14')](respondWithResult(_0x418a7e,null))[_0x495c('0x47')](handleError(_0x418a7e,null));};exports[_0x495c('0x6a')]=function(_0x5da0de,_0x1371a9){_0x5da0de[_0x495c('0x2c')][_0x495c('0x28')]=_0x5da0de[_0x495c('0x6b')][_0x495c('0x6c')];_0x5da0de['body'][_0x495c('0x6d')]=_0x5da0de[_0x495c('0x6b')][_0x495c('0x6e')];_0x5da0de[_0x495c('0x2c')][_0x495c('0x34')]=_0x5da0de['file'][_0x495c('0x6f')];return db[_0x495c('0x70')][_0x495c('0x48')](_0x5da0de['body'])[_0x495c('0x14')](respondWithResult(_0x1371a9,0xc9))['catch'](handleError(_0x1371a9,null));};exports[_0x495c('0x71')]=function(_0xda0f84,_0x59365f){return db[_0x495c('0x45')][_0x495c('0x72')]({'where':{'id':_0xda0f84['params']['id']},'raw':!![]})[_0x495c('0x14')](handleEntityNotFound(_0x59365f,null))[_0x495c('0x14')](function(_0x250d75){if(_0x250d75){if(_0x250d75[_0x495c('0x67')]){return _0x59365f[_0x495c('0x1d')](0x193)['json']({'status':0x193,'message':_0x495c('0x73')});}return db['Attachment'][_0x495c('0x72')]({'where':{'id':_0xda0f84[_0x495c('0x38')]['attachId']},'raw':!![]})[_0x495c('0x14')](handleEntityNotFound(_0x59365f,null));}})[_0x495c('0x14')](function(_0x328691){if(_0x328691){var _0x3b9df4=_0x328691[_0x495c('0x74')]!==null;var _0x956a5c=path['join'](config['root'],_0x495c('0x75'));if(_0x3b9df4){_0x956a5c=path['join'](_0x956a5c,_0x495c('0x76'));}var _0x56110a=path[_0x495c('0x77')](_0x956a5c,_0x328691['basename']);return _0x59365f['download'](_0x56110a);}})['catch'](handleError(_0x59365f,null));};exports['close']=function(_0x5b3a1e,_0x1ce2d4){var _0x3f3b2e=null;var _0x21483a=null;var _0x30dc41=null;if(_0x5b3a1e['body']['id']){delete _0x5b3a1e[_0x495c('0x2c')]['id'];}if(_0x5b3a1e[_0x495c('0x2c')][_0x495c('0x78')]){_0x30dc41=path[_0x495c('0x77')](config['root'],_0x495c('0x79'),util['format'](_0x495c('0x7a'),Date[_0x495c('0x7b')]()));_0x5b3a1e['body'][_0x495c('0x7c')]=_0x30dc41;}return db[_0x495c('0x45')][_0x495c('0x46')]({'where':{'id':_0x5b3a1e[_0x495c('0x3a')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x495c('0x7d'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x495c('0x14')](handleEntityNotFound(_0x1ce2d4,null))[_0x495c('0x14')](saveUpdates(_0x5b3a1e['body'],null))[_0x495c('0x14')](function(_0x5262a1){if(_0x5262a1){_0x3f3b2e=_0x5262a1;return db[_0x495c('0x4b')][_0x495c('0x46')]({'where':{'id':_0x3f3b2e['ChatWebsiteId']}});}})[_0x495c('0x14')](function(_0x3ac6da){if(_0x3ac6da){_0x21483a=_0x3ac6da;return db[_0x495c('0x63')][_0x495c('0x46')]({'where':{'id':_0x3f3b2e[_0x495c('0x7e')]}});}})[_0x495c('0x14')](function(_0x43ac8d){if(_0x43ac8d){if(_0x30dc41){var _0x3b0ddb=null;for(var _0x59a5bd=0x1;_0x59a5bd<_0x3f3b2e[_0x495c('0x7d')]['length'];++_0x59a5bd){_0x3b0ddb=_0x3f3b2e[_0x495c('0x7d')][_0x59a5bd];var _0xa3893c=_0x3b0ddb['UserId']?util[_0x495c('0x7f')](_0x495c('0x80'),_0x21483a[_0x495c('0x81')],_0x3b0ddb['UserId']):'System';var _0x862e6c=_0x5b3a1e['body']['customer']||util[_0x495c('0x7f')](_0x495c('0x80'),_0x495c('0x82'),_0x3b0ddb[_0x495c('0x7e')]);switch(_0x21483a[_0x495c('0x83')]){case _0x495c('0x84'):_0xa3893c=_0x3b0ddb[_0x495c('0x85')]?util[_0x495c('0x7f')](_0x495c('0x80'),_0x21483a[_0x495c('0x81')],_0x3b0ddb[_0x495c('0x85')]):'System';break;case _0x495c('0x86'):_0xa3893c=_0x3b0ddb[_0x495c('0x85')]?_0x3b0ddb[_0x495c('0x87')]['alias']||_0x3b0ddb['User'][_0x495c('0x88')]:_0x495c('0x89');break;case _0x495c('0x8a'):_0xa3893c=_0x3b0ddb['UserId']?_0x3b0ddb[_0x495c('0x87')][_0x495c('0x88')]:'System';break;default:_0xa3893c=_0x3b0ddb['UserId']?util['format']('%s%d',_0x21483a[_0x495c('0x81')],_0x3b0ddb[_0x495c('0x85')]):_0x495c('0x89');}var _0x26952b=util[_0x495c('0x7f')](_0x495c('0x8b'),moment(_0x3b0ddb[_0x495c('0x8c')])[_0x495c('0x7f')](_0x495c('0x8d')),_0x3b0ddb['direction']==='in'?_0x862e6c:_0xa3893c,_0x3b0ddb[_0x495c('0x2c')]);if(!_0x3b0ddb[_0x495c('0x8e')]){fs[_0x495c('0x8f')](_0x30dc41,_0x26952b);}}return db[_0x495c('0x90')][_0x495c('0x72')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x495c('0x91'),'raw':!![],'include':[{'model':db[_0x495c('0x92')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x495c('0x14')](function(_0x17785d){if(!_0x17785d||!_0x17785d[_0x495c('0x91')]||!_0x5b3a1e[_0x495c('0x2c')])return _0x3f3b2e;var _0x4efb46=_0x17785d['getSmtpOptions']();return respondWithRpcPromise(_0x495c('0x93'),_0x495c('0x94'),{'account':_0x4efb46,'message':{'from':util[_0x495c('0x7f')](_0x495c('0x95'),_0x17785d[_0x495c('0x28')],_0x17785d[_0x495c('0x52')]||_0x17785d[_0x495c('0x91')][_0x495c('0x39')]),'to':_0x5b3a1e[_0x495c('0x2c')][_0x495c('0x78')],'subject':_0x495c('0x96'),'text':util[_0x495c('0x7f')](_0x495c('0x97'),_0x5b3a1e['body'][_0x495c('0x78')]),'attachments':[{'path':_0x30dc41}]}})[_0x495c('0x14')](function(){return _0x3f3b2e;})[_0x495c('0x47')](function(_0x34007e){logger[_0x495c('0x1a')](_0x34007e);});})[_0x495c('0x14')](respondWithStatusCode(_0x1ce2d4,0xc8))[_0x495c('0x47')](handleError(_0x1ce2d4,null));};exports[_0x495c('0x98')]=function(_0x3ae5aa,_0x20b760){return db[_0x495c('0x5f')][_0x495c('0x46')]({'where':{'id':_0x3ae5aa['params']['id']}})[_0x495c('0x14')](handleEntityNotFound(_0x20b760,null))[_0x495c('0x14')](function(_0x2f00f0){if(_0x2f00f0){return _0x2f00f0['addMessage'](_0x3ae5aa[_0x495c('0x2c')][_0x495c('0x99')],_['omit'](_0x3ae5aa['body'],[_0x495c('0x99'),'id'])||{});}})['then'](respondWithResult(_0x20b760,null))[_0x495c('0x47')](handleError(_0x20b760,null));};exports[_0x495c('0x9a')]=function(_0x50577e,_0x150bc6){var _0xf60b19={'raw':![],'where':{}};var _0x1b5c16={};var _0x2f8f4a={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x495c('0x72')]({'where':{'id':_0x50577e['params']['id']}})[_0x495c('0x14')](handleEntityNotFound(_0x150bc6,null))[_0x495c('0x14')](function(_0x370012){if(_0x370012){_0x1b5c16[_0x495c('0x3b')]=_[_0x495c('0x3c')](db['ChatMessage'][_0x495c('0x32')]);_0x1b5c16[_0x495c('0x38')]=_[_0x495c('0x3c')](_0x50577e[_0x495c('0x38')]);_0x1b5c16[_0x495c('0x3d')]=_[_0x495c('0x3e')](_0x1b5c16[_0x495c('0x3b')],_0x1b5c16[_0x495c('0x38')]);_0xf60b19['attributes']=_[_0x495c('0x3e')](_0x1b5c16[_0x495c('0x3b')],qs[_0x495c('0x40')](_0x50577e['query']['fields']));_0xf60b19[_0x495c('0x3f')]=_0xf60b19['attributes'][_0x495c('0x41')]?_0xf60b19[_0x495c('0x3f')]:_0x1b5c16[_0x495c('0x3b')];if(!_0x50577e[_0x495c('0x38')][_0x495c('0x9b')]('nolimit')){_0xf60b19['limit']=qs[_0x495c('0x21')](_0x50577e[_0x495c('0x38')][_0x495c('0x21')]);_0xf60b19[_0x495c('0x23')]=qs['offset'](_0x50577e[_0x495c('0x38')]['offset']);}_0xf60b19[_0x495c('0x9c')]=qs[_0x495c('0x9d')](_0x50577e[_0x495c('0x38')][_0x495c('0x9d')]);_0xf60b19[_0x495c('0x9e')]=qs['filters'](_[_0x495c('0x9f')](_0x50577e[_0x495c('0x38')],_0x1b5c16[_0x495c('0x3d')]));_0xf60b19[_0x495c('0x9e')][_0x495c('0xa0')]=_0x370012['id'];if(_0x50577e[_0x495c('0x38')][_0x495c('0xa1')]){_0xf60b19[_0x495c('0x9e')]=_['merge'](_0xf60b19[_0x495c('0x9e')],{'$or':_[_0x495c('0x31')](_0xf60b19[_0x495c('0x3f')],function(_0x2b0d42){var _0x4ca57b={};_0x4ca57b[_0x2b0d42]={'$like':'%'+_0x50577e[_0x495c('0x38')][_0x495c('0xa1')]+'%'};return _0x4ca57b;})});}if(_0x50577e[_0x495c('0x38')][_0x495c('0xa2')]){var _0x4ada27=_0x50577e['query'][_0x495c('0xa2')]['split'](',');var _0x12a828={};_0x12a828[_0x4ada27[0x0]]={'$gte':moment(_0x4ada27[0x1])[_0x495c('0x7f')](_0x495c('0xa3'))};_0xf60b19[_0x495c('0x9e')]=_['merge'](_0xf60b19[_0x495c('0x9e')],_0x12a828);}_0xf60b19=_['merge']({},_0xf60b19,_0x50577e[_0x495c('0x44')]);return db[_0x495c('0x5f')]['count']({'where':_0xf60b19[_0x495c('0x9e')]})[_0x495c('0x14')](function(_0xf6ac23){_0x2f8f4a[_0x495c('0x22')]=_0xf6ac23;if(_0x50577e[_0x495c('0x38')][_0x495c('0x42')]){_0xf60b19[_0x495c('0x43')]=[{'all':!![]}];}return db[_0x495c('0x5f')]['findAll'](_0xf60b19);})[_0x495c('0x14')](function(_0x41f243){_0x2f8f4a[_0x495c('0xa4')]=_0x41f243;return _0x2f8f4a;});}})[_0x495c('0x14')](respondWithFilteredResult(_0x150bc6,_0xf60b19))['catch'](handleError(_0x150bc6,null));};exports[_0x495c('0xa5')]=function(_0x5279ec,_0x52f16a){var _0x57a084={'where':{}},_0x275d90={},_0x4b7c43={'count':0x0,'rows':[]};return db[_0x495c('0x45')][_0x495c('0x72')]({'where':{'id':_0x5279ec[_0x495c('0x3a')]['id']}})[_0x495c('0x14')](handleEntityNotFound(_0x52f16a,null))[_0x495c('0x14')](function(_0x1d804f){if(_0x1d804f){_0x275d90[_0x495c('0x3b')]=_[_0x495c('0x3c')](db[_0x495c('0x5f')][_0x495c('0x32')]);_0x275d90[_0x495c('0x38')]=_['keys'](_0x5279ec[_0x495c('0x38')]);_0x275d90[_0x495c('0x3d')]=_['intersection'](_0x275d90['model'],_0x275d90['query']);_0x57a084[_0x495c('0x3f')]=_[_0x495c('0x3e')](_0x275d90[_0x495c('0x3b')],qs[_0x495c('0x40')](_0x5279ec[_0x495c('0x38')][_0x495c('0x40')]));_0x57a084['attributes']=_0x57a084[_0x495c('0x3f')][_0x495c('0x41')]?_0x57a084[_0x495c('0x3f')]:_0x275d90['model'];if(!_0x5279ec[_0x495c('0x38')][_0x495c('0x9b')](_0x495c('0xa6'))){_0x57a084[_0x495c('0x21')]=qs[_0x495c('0x21')](_0x5279ec[_0x495c('0x38')][_0x495c('0x21')]);_0x57a084[_0x495c('0x23')]=qs[_0x495c('0x23')](_0x5279ec[_0x495c('0x38')][_0x495c('0x23')]);}_0x57a084['order']=qs[_0x495c('0x9d')](_0x5279ec[_0x495c('0x38')][_0x495c('0x9d')]);_0x57a084[_0x495c('0x9e')]=qs[_0x495c('0x3d')](_[_0x495c('0x9f')](_0x5279ec[_0x495c('0x38')],_0x275d90[_0x495c('0x3d')]));_0x57a084[_0x495c('0x9e')][_0x495c('0xa0')]=_0x1d804f['id'];if(_0x5279ec[_0x495c('0x38')][_0x495c('0xa1')]){_0x57a084['where']=_['merge'](_0x57a084[_0x495c('0x9e')],{'$or':_[_0x495c('0x31')](_0x57a084[_0x495c('0x3f')],function(_0x3ad5eb){var _0x8df879={};_0x8df879[_0x3ad5eb]={'$like':'%'+_0x5279ec[_0x495c('0x38')][_0x495c('0xa1')]+'%'};return _0x8df879;})});}_0x57a084[_0x495c('0x9e')][_0x495c('0x8e')]=![];if(_0x5279ec['query']['id']){_0x57a084[_0x495c('0x9e')]['id']={'$gt':_0x5279ec[_0x495c('0x38')]['id']};}_0x57a084=_['merge']({},_0x57a084,_0x5279ec[_0x495c('0x44')]);return db[_0x495c('0x5f')][_0x495c('0x22')]({'where':_0x57a084[_0x495c('0x9e')]})[_0x495c('0x14')](function(_0x24d05c){_0x4b7c43['count']=_0x24d05c;_0x57a084[_0x495c('0x43')]=[];if(_0x5279ec['query'][_0x495c('0xa7')]){_0x57a084[_0x495c('0x43')][_0x495c('0xa8')]({'model':db['User'],'as':_0x495c('0x87'),'attributes':['id',_0x495c('0x88'),_0x495c('0xa9')]});}if(_0x5279ec[_0x495c('0x38')][_0x495c('0x42')]){_0x57a084[_0x495c('0x43')]=[{'all':!![]}];}return db[_0x495c('0x5f')][_0x495c('0xaa')](_0x57a084);})['then'](function(_0x50527c){_0x4b7c43[_0x495c('0xa4')]=_0x50527c;return _0x4b7c43;});}})[_0x495c('0x14')](respondWithFilteredResult(_0x52f16a,_0x57a084))[_0x495c('0x47')](handleError(_0x52f16a,null));};exports[_0x495c('0xab')]=function(_0x2e3b5d,_0x1ca03c){return db[_0x495c('0x45')][_0x495c('0x46')]({'where':{'id':_0x2e3b5d['params']['id']}})[_0x495c('0x14')](handleEntityNotFound(_0x1ca03c,null))[_0x495c('0x14')](function(_0x19c257){if(_0x19c257){return _0x19c257['setTags'](_0x2e3b5d['body'][_0x495c('0x99')],_[_0x495c('0xac')](_0x2e3b5d[_0x495c('0x2c')],['ids','id'])||{})[_0x495c('0xad')](function(){return db['Tag'][_0x495c('0xaa')]({'attributes':['id','name',_0x495c('0xae')],'where':{'id':_0x2e3b5d[_0x495c('0x2c')][_0x495c('0x99')]}});})[_0x495c('0x14')](function(_0x6b13a5){socket[_0x495c('0xaf')](_0x495c('0xb0'),{'id':Number(_0x2e3b5d[_0x495c('0x3a')]['id']),'tags':_0x6b13a5||[]});return{'id':Number(_0x2e3b5d[_0x495c('0x3a')]['id']),'tags':_0x6b13a5||[]};});}})[_0x495c('0x14')](respondWithResult(_0x1ca03c,null))[_0x495c('0x47')](handleError(_0x1ca03c,null));};exports['removeTags']=function(_0x48cd74,_0x9342e4){return db[_0x495c('0x45')][_0x495c('0x46')]({'where':{'id':_0x48cd74[_0x495c('0x3a')]['id']}})['then'](handleEntityNotFound(_0x9342e4,null))[_0x495c('0x14')](function(_0x2fa82d){if(_0x2fa82d){return _0x2fa82d[_0x495c('0xb1')](_0x48cd74['query'][_0x495c('0x99')]);}})[_0x495c('0x14')](respondWithStatusCode(_0x9342e4,null))[_0x495c('0x47')](handleError(_0x9342e4,null));};exports['download']=function(_0x3d4600,_0xe18db4){var _0x416249=moment()[_0x495c('0xb2')]()[_0x495c('0xb3')]();var _0x27e62a=path[_0x495c('0x77')](config[_0x495c('0xb4')],_0x495c('0xb5'),_0x495c('0xb6'),'tmp');var _0x244972=path[_0x495c('0x77')](config[_0x495c('0xb4')],_0x495c('0xb5'),'files',_0x495c('0xb7'));var _0x4c8c85=path[_0x495c('0x77')](_0x27e62a,_0x416249);var _0x3212b3=util[_0x495c('0x7f')](_0x495c('0xb8'),_0x3d4600[_0x495c('0x3a')]['id'],_0x416249);var _0x563f74=path[_0x495c('0x77')](_0x27e62a,_0x3212b3);var _0x268460=[];_0x268460[_0x495c('0xa8')]({'model':db['User'],'as':'User','attributes':['id',_0x495c('0x88')],'raw':!![]});_0x268460[_0x495c('0xa8')]({'model':db['CmContact'],'as':_0x495c('0x64'),'attributes':['id',_0x495c('0xb9'),_0x495c('0xba')],'raw':!![]});if(_0x3d4600['query'][_0x495c('0xb7')]){_0x268460[_0x495c('0xa8')]({'model':db[_0x495c('0x70')],'as':_0x495c('0x70'),'raw':!![]});}var _0x1dcb0e=[{'model':db[_0x495c('0x5f')],'as':_0x495c('0x7d'),'attributes':['id',_0x495c('0x2c'),_0x495c('0x8c'),_0x495c('0xbb'),'secret',_0x495c('0xbc')],'include':_0x268460}];_0x1dcb0e[_0x495c('0xa8')]({'model':db[_0x495c('0x4b')],'as':'Account','attributes':['id',_0x495c('0x28')]});_0x1dcb0e['push']({'model':db[_0x495c('0x87')],'as':_0x495c('0xbd'),'attributes':['id','fullname']});return db[_0x495c('0x45')][_0x495c('0x46')]({'where':{'id':_0x3d4600[_0x495c('0x3a')]['id']},'include':_0x1dcb0e})[_0x495c('0x14')](handleEntityNotFound(_0xe18db4,null))['then'](function(_0x40d15b){if(_0x40d15b){var _0x44c1ac=_0x40d15b['get']({'plain':!![]});fs[_0x495c('0xbe')](_0x4c8c85);var _0x352ee5={'channel':_0x495c('0xbf'),'account':_0x44c1ac[_0x495c('0xc0')][_0x495c('0x28')],'agent':_0x44c1ac[_0x495c('0xbd')]?_0x44c1ac[_0x495c('0xbd')][_0x495c('0x88')]:_0x495c('0xc1'),'createdAt':moment(_0x44c1ac['createdAt'])[_0x495c('0x7f')](_0x495c('0xa3'))[_0x495c('0xb3')](),'closedAt':_0x44c1ac[_0x495c('0x67')]?moment(_0x44c1ac['closedAt'])[_0x495c('0x7f')](_0x495c('0xa3'))[_0x495c('0xb3')]():'','disposition':_0x44c1ac[_0x495c('0x68')],'chatInfo':{'browser':_0x44c1ac['browserName'],'os':_0x44c1ac[_0x495c('0xc2')],'referer':_0x44c1ac['referer'],'customerIp':_0x44c1ac[_0x495c('0xc3')],'customerPort':_0x44c1ac[_0x495c('0xc4')]?_0x44c1ac[_0x495c('0xc4')]:_0x495c('0xc1')},'messages':_(_0x44c1ac[_0x495c('0x7d')])[_0x495c('0xc5')]()[_0x495c('0xa1')]({'secret':![]})['map'](function(_0x2ef042){if(_0x2ef042[_0x495c('0x70')]){var _0x80dd85=path[_0x495c('0x77')](_0x244972,_0x2ef042[_0x495c('0x70')]['basename']);if(fs[_0x495c('0xc6')](_0x80dd85)){fs[_0x495c('0xc7')](_0x80dd85)[_0x495c('0xc8')](fs[_0x495c('0xc9')](path[_0x495c('0x77')](_0x4c8c85,_0x2ef042[_0x495c('0x70')][_0x495c('0x6d')])));}}return{'date':moment(_0x2ef042[_0x495c('0x8c')])[_0x495c('0x7f')](_0x495c('0xa3'))[_0x495c('0xb3')](),'sender':_0x2ef042[_0x495c('0xbb')]===_0x495c('0x5e')?_0x2ef042[_0x495c('0x87')]?_0x2ef042[_0x495c('0x87')]['fullname']:_0x495c('0x89'):_0x2ef042[_0x495c('0x64')][_0x495c('0xb9')]+(_0x2ef042[_0x495c('0x64')][_0x495c('0xba')]?'\x20'+_0x2ef042[_0x495c('0x64')]['lastName']:''),'body':_0x2ef042[_0x495c('0x70')]?_0x2ef042[_0x495c('0x70')]['basename']:_0x2ef042[_0x495c('0x2c')],'direction':_0x2ef042[_0x495c('0xbb')]==='out'?'A':'C','secret':_0x2ef042['secret'],'read':_0x2ef042[_0x495c('0xbc')],'attachment':_0x2ef042[_0x495c('0x70')]};})[_0x495c('0xca')]()};return ejs[_0x495c('0xcb')](path[_0x495c('0x77')](config[_0x495c('0xb4')],_0x495c('0xb5'),_0x495c('0xcc'),_0x495c('0xcd')),{'interaction':_0x352ee5})[_0x495c('0x14')](function(_0x4f35bf){var _0x571212=path['join'](_0x4c8c85,_0x495c('0xce')+_0x44c1ac['id']+'-'+_0x416249+_0x495c('0xcf'));var _0x3e5399={'path':_0x571212,'channel':_0x495c('0xbf'),'interactionId':_0x44c1ac['id']};return pdf[_0x495c('0xd0')](_0x4f35bf,_0x3e5399);})[_0x495c('0x14')](function(){return new Promise(function(_0xe23150,_0x5a0290){zipdir(_0x4c8c85,{'saveTo':_0x563f74},function(_0x447ae7,_0x4b5e79){if(_0x447ae7)return _0x5a0290(_0x447ae7);return _0xe23150(_0x4b5e79);});})[_0x495c('0x14')](function(){return new BPromise(function(_0x5bb01d,_0x476d21){rimraf(_0x4c8c85,function(_0x5d74d9){if(_0x5d74d9)_0x476d21(_0x5d74d9);return _0x5bb01d();});});})[_0x495c('0x14')](function(){return _0xe18db4[_0x495c('0xd1')](_0x563f74,_0x3212b3,function(_0x5a379b){if(_0x5a379b){logger[_0x495c('0x1a')]('err',_0x5a379b);}else{fs[_0x495c('0xd2')](_0x563f74);}});});});}else{return _0xe18db4[_0x495c('0x27')](0xc8);}})['catch'](handleError(_0xe18db4,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index deab900..029af46 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 _0x8a9d=['hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','then','setDataValue','findAll','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a9d,0x162));var _0xd8a9=function(_0x4250b4,_0x3fd543){_0x4250b4=_0x4250b4-0x0;var _0x8a4807=_0x8a9d[_0x4250b4];return _0x8a4807;};'use strict';var EventEmitter=require(_0xd8a9('0x0'));var ChatInteraction=require(_0xd8a9('0x1'))['db'][_0xd8a9('0x2')];var ChatMessage=require(_0xd8a9('0x1'))['db'][_0xd8a9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xd8a9('0x4')](0x0);var events={'afterCreate':_0xd8a9('0x5'),'afterUpdate':'update','afterDestroy':_0xd8a9('0x6')};function emitEvent(_0x2b0e2a){return function(_0x153529,_0x3d24b7,_0x18d4eb){_0x153529['getUsers']({'attributes':['id'],'raw':!![]})[_0xd8a9('0x7')](function(_0x14351d){_0x153529[_0xd8a9('0x8')]('Users',_0x14351d['map'](function(_0x311012){return{'id':_0x311012['id']};}));return ChatMessage[_0xd8a9('0x9')]({'where':{'ChatInteractionId':_0x153529['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd8a9('0x7')](function(_0x3294dd){_0x153529[_0xd8a9('0x8')](_0xd8a9('0xa'),_0x3294dd['length']);ChatInteractionEvents[_0xd8a9('0xb')](_0x2b0e2a+':'+_0x153529['id'],_0x153529);ChatInteractionEvents[_0xd8a9('0xb')](_0x2b0e2a,_0x153529);_0x18d4eb(null);})[_0xd8a9('0xc')](_0x18d4eb(null));};}for(var e in events){if(events[_0xd8a9('0xd')](e)){var event=events[e];ChatInteraction[_0xd8a9('0xe')](e,emitEvent(event));}}module[_0xd8a9('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x2e94=['setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0xc587ed,_0x11cbc2){var _0x41d137=function(_0x2d288f){while(--_0x2d288f){_0xc587ed['push'](_0xc587ed['shift']());}};_0x41d137(++_0x11cbc2);}(_0x2e94,0x68));var _0x42e9=function(_0x126359,_0x59fd24){_0x126359=_0x126359-0x0;var _0x2db227=_0x2e94[_0x126359];return _0x2db227;};'use strict';var EventEmitter=require(_0x42e9('0x0'));var ChatInteraction=require(_0x42e9('0x1'))['db'][_0x42e9('0x2')];var ChatMessage=require(_0x42e9('0x1'))['db'][_0x42e9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x42e9('0x4')](0x0);var events={'afterCreate':_0x42e9('0x5'),'afterUpdate':'update','afterDestroy':_0x42e9('0x6')};function emitEvent(_0x5b26f4){return function(_0x39d2ce,_0x1bb80d,_0xb28b02){_0x39d2ce[_0x42e9('0x7')]({'attributes':['id'],'raw':!![]})[_0x42e9('0x8')](function(_0x14b9fa){_0x39d2ce[_0x42e9('0x9')](_0x42e9('0xa'),_0x14b9fa[_0x42e9('0xb')](function(_0x9dd01){return{'id':_0x9dd01['id']};}));return ChatMessage[_0x42e9('0xc')]({'where':{'ChatInteractionId':_0x39d2ce['id'],'direction':'in','read':![]},'raw':!![]});})[_0x42e9('0x8')](function(_0x4ffc66){_0x39d2ce[_0x42e9('0x9')](_0x42e9('0xd'),_0x4ffc66['length']);ChatInteractionEvents['emit'](_0x5b26f4+':'+_0x39d2ce['id'],_0x39d2ce);ChatInteractionEvents[_0x42e9('0xe')](_0x5b26f4,_0x39d2ce);_0xb28b02(null);})[_0x42e9('0xf')](_0xb28b02(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x42e9('0x10')](e,emitEvent(event));}}module[_0x42e9('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 4846e76..7d26a08 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 _0xbb38=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4'];(function(_0x22b0cb,_0x5a764a){var _0x444178=function(_0x5aed3d){while(--_0x5aed3d){_0x22b0cb['push'](_0x22b0cb['shift']());}};_0x444178(++_0x5a764a);}(_0xbb38,0x177));var _0x8bb3=function(_0x1c8c07,_0x2579af){_0x1c8c07=_0x1c8c07-0x0;var _0x4aa88f=_0xbb38[_0x1c8c07];return _0x4aa88f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8bb3('0x0'));var BPromise=require(_0x8bb3('0x1'));var rp=require(_0x8bb3('0x2'));var fs=require('fs');var path=require(_0x8bb3('0x3'));var rimraf=require(_0x8bb3('0x4'));var config=require(_0x8bb3('0x5'));var attributes=require(_0x8bb3('0x6'));module['exports']=function(_0x3bfa50,_0x5efe7e){return _0x3bfa50[_0x8bb3('0x7')](_0x8bb3('0x8'),attributes,{'tableName':_0x8bb3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50c67d,_0x2acbe3,_0x31547b){if(_0x50c67d[_0x8bb3('0xa')](_0x8bb3('0xb'))){_0x50c67d[_0x8bb3('0xc')]=moment()[_0x8bb3('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31547b(null,_0x50c67d);}},'charset':_0x8bb3('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xeb9f=['format','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x449aae,_0x394f3d){var _0x3ba2ae=function(_0x206d6f){while(--_0x206d6f){_0x449aae['push'](_0x449aae['shift']());}};_0x3ba2ae(++_0x394f3d);}(_0xeb9f,0x173));var _0xfeb9=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0xeb9f[_0x1ab180];return _0xfb2c2d;};'use strict';var _=require('lodash');var util=require(_0xfeb9('0x0'));var logger=require(_0xfeb9('0x1'))(_0xfeb9('0x2'));var moment=require(_0xfeb9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfeb9('0x4'));var rimraf=require(_0xfeb9('0x5'));var config=require('../../config/environment');var attributes=require(_0xfeb9('0x6'));module[_0xfeb9('0x7')]=function(_0x16a101,_0x19228d){return _0x16a101[_0xfeb9('0x8')](_0xfeb9('0x9'),attributes,{'tableName':_0xfeb9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19eeb9,_0x513f8b,_0x3e9fac){if(_0x19eeb9[_0xfeb9('0xb')](_0xfeb9('0xc'))){_0x19eeb9['closedAt']=moment()[_0xfeb9('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3e9fac(null,_0x19eeb9);}},'charset':_0xfeb9('0xe'),'collate':_0xfeb9('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d5cc615..07e5de4 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 _0x786f=['info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then'];(function(_0x2b74c8,_0x82f97f){var _0x339692=function(_0x5d07f4){while(--_0x5d07f4){_0x2b74c8['push'](_0x2b74c8['shift']());}};_0x339692(++_0x82f97f);}(_0x786f,0x9c));var _0xf786=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x786f[_0x20fb02];return _0x24a33e;};'use strict';var _=require(_0xf786('0x0'));var util=require(_0xf786('0x1'));var moment=require(_0xf786('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf786('0x3'));var db=require(_0xf786('0x4'))['db'];var utils=require(_0xf786('0x5'));var logger=require(_0xf786('0x6'))(_0xf786('0x7'));var config=require(_0xf786('0x8'));var jayson=require(_0xf786('0x9'));var client=jayson[_0xf786('0xa')][_0xf786('0xb')]({'port':0x232a});config[_0xf786('0xc')]=_[_0xf786('0xd')](config[_0xf786('0xc')],{'host':_0xf786('0xe'),'port':0x18eb});var socket=require(_0xf786('0xf'))(new Redis(config[_0xf786('0xc')]));require(_0xf786('0x10'))[_0xf786('0x11')](socket);function respondWithRpcPromise(_0x4340c2,_0xbd312,_0x48d823){return new BPromise(function(_0x444796,_0x2ec530){return client[_0xf786('0x12')](_0x4340c2,_0x48d823)[_0xf786('0x13')](function(_0x2c3b55){logger[_0xf786('0x14')](_0xf786('0x15'),_0xbd312,'request\x20sent');logger[_0xf786('0x16')](_0xf786('0x17'),_0xbd312,'request\x20sent',JSON[_0xf786('0x18')](_0x2c3b55));if(_0x2c3b55[_0xf786('0x19')]){if(_0x2c3b55[_0xf786('0x19')]['code']===0x1f4){logger[_0xf786('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xbd312,_0x2c3b55[_0xf786('0x19')]['message']);return _0x2ec530(_0x2c3b55[_0xf786('0x19')][_0xf786('0x1a')]);}logger[_0xf786('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xbd312,_0x2c3b55[_0xf786('0x19')]['message']);return _0x444796(_0x2c3b55[_0xf786('0x19')]['message']);}else{logger[_0xf786('0x14')](_0xf786('0x15'),_0xbd312,'request\x20sent');_0x444796(_0x2c3b55['result'][_0xf786('0x1a')]);}})['catch'](function(_0x12bd62){logger[_0xf786('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xbd312,_0x12bd62);_0x2ec530(_0x12bd62);});});}exports[_0xf786('0x1b')]=function(_0x47d546){var _0x126d59=this;return new Promise(function(_0x34bd2f,_0x1345ee){return db[_0xf786('0x1c')][_0xf786('0x1d')](_0x47d546[_0xf786('0x1e')],{'raw':_0x47d546['options']?_0x47d546[_0xf786('0x1f')][_0xf786('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47d546['options']?_0x47d546[_0xf786('0x1f')][_0xf786('0x21')]||null:null,'attributes':_0x47d546['options']?_0x47d546[_0xf786('0x1f')][_0xf786('0x22')]||null:null,'limit':_0x47d546[_0xf786('0x1f')]?_0x47d546[_0xf786('0x1f')][_0xf786('0x23')]||null:null})[_0xf786('0x13')](function(_0x3dfb89){logger[_0xf786('0x14')](_0xf786('0x1b'),_0x47d546);logger['debug'](_0xf786('0x1b'),_0x47d546,JSON[_0xf786('0x18')](_0x3dfb89));_0x34bd2f(_0x3dfb89);})[_0xf786('0x24')](function(_0x4c19b9){logger['error'](_0xf786('0x1b'),_0x4c19b9[_0xf786('0x1a')],_0x47d546);_0x1345ee(_0x126d59['error'](0x1f4,_0x4c19b9[_0xf786('0x1a')]));});});};exports[_0xf786('0x25')]=function(_0x1dae8d){return new Promise(function(_0x525e8f,_0x4d6f69){return db['ChatInteraction'][_0xf786('0x26')]({'where':_0x1dae8d['options']?_0x1dae8d[_0xf786('0x1f')][_0xf786('0x21')]||null:null})[_0xf786('0x13')](function(_0x564d11){if(_0x564d11){return _0x564d11[_0xf786('0x27')](_0x1dae8d[_0xf786('0x1e')][_0xf786('0x28')],_[_0xf786('0x29')](_0x1dae8d[_0xf786('0x1e')],['ids','id'])||{});}})[_0xf786('0x2a')](function(_0x24146c){logger['info'](_0xf786('0x2b'),_0x1dae8d);logger[_0xf786('0x16')](_0xf786('0x2b'),_0x1dae8d,JSON[_0xf786('0x18')](_0x24146c));_0x525e8f(_0x24146c);})[_0xf786('0x24')](function(_0x21eafb){logger[_0xf786('0x19')](_0xf786('0x2b'),_0x21eafb[_0xf786('0x1a')],_0x1dae8d);_0x4d6f69(_this[_0xf786('0x19')](0x1f4,_0x21eafb['message']));});});};
\ No newline at end of file
+var _0xfcb1=['omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','find','addTags','ids'];(function(_0x3bc3cf,_0x252ce9){var _0x2b66b3=function(_0x487930){while(--_0x487930){_0x3bc3cf['push'](_0x3bc3cf['shift']());}};_0x2b66b3(++_0x252ce9);}(_0xfcb1,0xaf));var _0x1fcb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfcb1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1fcb('0x0'));var util=require(_0x1fcb('0x1'));var moment=require(_0x1fcb('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fcb('0x3'));var fs=require('fs');var Redis=require(_0x1fcb('0x4'));var db=require(_0x1fcb('0x5'))['db'];var utils=require(_0x1fcb('0x6'));var logger=require(_0x1fcb('0x7'))(_0x1fcb('0x8'));var config=require(_0x1fcb('0x9'));var jayson=require(_0x1fcb('0xa'));var client=jayson['client'][_0x1fcb('0xb')]({'port':0x232a});config[_0x1fcb('0xc')]=_[_0x1fcb('0xd')](config[_0x1fcb('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1fcb('0xe'))(new Redis(config[_0x1fcb('0xc')]));require(_0x1fcb('0xf'))['register'](socket);function respondWithRpcPromise(_0x5ee0b4,_0x49a245,_0x802fb4){return new BPromise(function(_0x3f6003,_0x24859d){return client[_0x1fcb('0x10')](_0x5ee0b4,_0x802fb4)[_0x1fcb('0x11')](function(_0x106627){logger[_0x1fcb('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x49a245,_0x1fcb('0x13'));logger[_0x1fcb('0x14')](_0x1fcb('0x15'),_0x49a245,_0x1fcb('0x13'),JSON[_0x1fcb('0x16')](_0x106627));if(_0x106627[_0x1fcb('0x17')]){if(_0x106627[_0x1fcb('0x17')][_0x1fcb('0x18')]===0x1f4){logger['error'](_0x1fcb('0x19'),_0x49a245,_0x106627[_0x1fcb('0x17')][_0x1fcb('0x1a')]);return _0x24859d(_0x106627[_0x1fcb('0x17')]['message']);}logger[_0x1fcb('0x17')](_0x1fcb('0x19'),_0x49a245,_0x106627[_0x1fcb('0x17')]['message']);return _0x3f6003(_0x106627[_0x1fcb('0x17')][_0x1fcb('0x1a')]);}else{logger[_0x1fcb('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x49a245,_0x1fcb('0x13'));_0x3f6003(_0x106627[_0x1fcb('0x1b')][_0x1fcb('0x1a')]);}})[_0x1fcb('0x1c')](function(_0x364a50){logger[_0x1fcb('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x49a245,_0x364a50);_0x24859d(_0x364a50);});});}exports[_0x1fcb('0x1d')]=function(_0x145778){var _0x45b7d1=this;return new Promise(function(_0x466517,_0x599a3f){return db[_0x1fcb('0x1e')][_0x1fcb('0x1f')](_0x145778[_0x1fcb('0x20')],{'raw':_0x145778['options']?_0x145778['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x145778[_0x1fcb('0x21')]?_0x145778[_0x1fcb('0x21')][_0x1fcb('0x22')]||null:null,'attributes':_0x145778[_0x1fcb('0x21')]?_0x145778[_0x1fcb('0x21')][_0x1fcb('0x23')]||null:null,'limit':_0x145778[_0x1fcb('0x21')]?_0x145778['options'][_0x1fcb('0x24')]||null:null})['then'](function(_0x20e8dc){logger[_0x1fcb('0x12')](_0x1fcb('0x1d'),_0x145778);logger['debug']('UpdateChatInteraction',_0x145778,JSON[_0x1fcb('0x16')](_0x20e8dc));_0x466517(_0x20e8dc);})[_0x1fcb('0x1c')](function(_0x2344c4){logger[_0x1fcb('0x17')](_0x1fcb('0x1d'),_0x2344c4['message'],_0x145778);_0x599a3f(_0x45b7d1[_0x1fcb('0x17')](0x1f4,_0x2344c4[_0x1fcb('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x504037){return new Promise(function(_0x335c28,_0x509fdc){return db['ChatInteraction'][_0x1fcb('0x25')]({'where':_0x504037[_0x1fcb('0x21')]?_0x504037[_0x1fcb('0x21')][_0x1fcb('0x22')]||null:null})['then'](function(_0x4ce880){if(_0x4ce880){return _0x4ce880[_0x1fcb('0x26')](_0x504037[_0x1fcb('0x20')][_0x1fcb('0x27')],_[_0x1fcb('0x28')](_0x504037[_0x1fcb('0x20')],['ids','id'])||{});}})[_0x1fcb('0x29')](function(_0x2bb669){logger[_0x1fcb('0x12')]('AddTags',_0x504037);logger[_0x1fcb('0x14')](_0x1fcb('0x2a'),_0x504037,JSON['stringify'](_0x2bb669));_0x335c28(_0x2bb669);})[_0x1fcb('0x1c')](function(_0x10ddba){logger['error'](_0x1fcb('0x2a'),_0x10ddba[_0x1fcb('0x1a')],_0x504037);_0x509fdc(_this[_0x1fcb('0x17')](0x1f4,_0x10ddba[_0x1fcb('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 2110e44..ab46917 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 _0x8388=['update','emit','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x8388,0x18d));var _0x8838=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x8388[_0x1057a3];return _0x131cdb;};'use strict';var ChatInteractionEvents=require(_0x8838('0x0'));var events=[_0x8838('0x1'),_0x8838('0x2'),_0x8838('0x3')];function createListener(_0x5307bd,_0x140ee6){return function(_0x3dbcd4){_0x140ee6[_0x8838('0x4')](_0x5307bd,_0x3dbcd4);};}function removeListener(_0x20a813,_0xd474f2){return function(){ChatInteractionEvents['removeListener'](_0x20a813,_0xd474f2);};}exports[_0x8838('0x5')]=function(_0x471568){for(var _0x49cac2=0x0,_0xca2d0f=events[_0x8838('0x6')];_0x49cac2<_0xca2d0f;_0x49cac2++){var _0x27707c=events[_0x49cac2];var _0x56596f=createListener(_0x8838('0x7')+_0x27707c,_0x471568);ChatInteractionEvents['on'](_0x27707c,_0x56596f);}};
\ No newline at end of file
+var _0xa9d7=['remove','length','./chatInteraction.events'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0xa9d7,0x134));var _0x7a9d=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0xa9d7[_0x254076];return _0x21a93e;};'use strict';var ChatInteractionEvents=require(_0x7a9d('0x0'));var events=['save',_0x7a9d('0x1'),'update'];function createListener(_0x513369,_0x59c5d6){return function(_0x3f7e30){_0x59c5d6['emit'](_0x513369,_0x3f7e30);};}function removeListener(_0x24409f,_0x3bbe6d){return function(){ChatInteractionEvents['removeListener'](_0x24409f,_0x3bbe6d);};}exports['register']=function(_0xeb9176){for(var _0x4d860b=0x0,_0x54d582=events[_0x7a9d('0x2')];_0x4d860b<_0x54d582;_0x4d860b++){var _0x4e274c=events[_0x4d860b];var _0x26405b=createListener('chatInteraction:'+_0x4e274c,_0xeb9176);ChatInteractionEvents['on'](_0x4e274c,_0x26405b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 44f4111..17a5558 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 _0x0c99=['diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','create','post','/:id/vidaoo','createVidaooSession'];(function(_0x2529a6,_0x45598a){var _0x515326=function(_0xf5824b){while(--_0xf5824b){_0x2529a6['push'](_0x2529a6['shift']());}};_0x515326(++_0x45598a);}(_0x0c99,0x8a));var _0x90c9=function(_0x5951e8,_0x42b9a7){_0x5951e8=_0x5951e8-0x0;var _0x20a1f5=_0x0c99[_0x5951e8];return _0x20a1f5;};'use strict';var multer=require(_0x90c9('0x0'));var util=require(_0x90c9('0x1'));var path=require(_0x90c9('0x2'));var timeout=require(_0x90c9('0x3'));var express=require(_0x90c9('0x4'));var router=express[_0x90c9('0x5')]();var fs_extra=require(_0x90c9('0x6'));var auth=require(_0x90c9('0x7'));var interaction=require(_0x90c9('0x8'));var config=require(_0x90c9('0x9'));var controller=require('./chatInteraction.controller');router[_0x90c9('0xa')]('/',auth[_0x90c9('0xb')](),controller[_0x90c9('0xc')]);router[_0x90c9('0xa')](_0x90c9('0xd'),auth[_0x90c9('0xb')](),controller['describe']);router[_0x90c9('0xa')](_0x90c9('0xe'),auth[_0x90c9('0xf')](),controller[_0x90c9('0x10')]);router[_0x90c9('0xa')](_0x90c9('0x11'),auth[_0x90c9('0xf')](),controller[_0x90c9('0x12')]);router[_0x90c9('0xa')](_0x90c9('0x13'),auth[_0x90c9('0xb')](),controller[_0x90c9('0x14')]);router['get']('/:id/my_messages',auth[_0x90c9('0xf')](),controller[_0x90c9('0x15')]);router[_0x90c9('0xa')](_0x90c9('0x16'),auth[_0x90c9('0xb')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x90c9('0x17')]);router[_0x90c9('0x18')](_0x90c9('0x19'),auth['isAuthenticated'](),controller[_0x90c9('0x1a')]);var upload=multer({'storage':multer[_0x90c9('0x1b')]({'destination':function(_0x1c8faa,_0x44f184,_0x40aa87){_0x40aa87(null,path[_0x90c9('0x1c')](config['root'],_0x90c9('0x1d')));},'filename':function(_0xddd9f1,_0x410920,_0x16fb6f){_0x16fb6f(null,util[_0x90c9('0x1e')](_0x90c9('0x1f'),Date[_0x90c9('0x20')](),_0x410920[_0x90c9('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x90c9('0x18')](_0x90c9('0x22'),upload[_0x90c9('0x23')]('file'),controller[_0x90c9('0x24')]);router[_0x90c9('0x18')](_0x90c9('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x90c9('0x25')]);router[_0x90c9('0x18')]('/:id/tags',auth[_0x90c9('0xb')](),interaction[_0x90c9('0x26')](_0x90c9('0x27'),_0x90c9('0x28')),controller['addTags']);router[_0x90c9('0x29')]('/:id',auth['isAuthenticated'](),interaction[_0x90c9('0x26')](_0x90c9('0x27'),_0x90c9('0x2a')),controller[_0x90c9('0x2b')]);router[_0x90c9('0x29')]('/:id/custom_update',controller[_0x90c9('0x2c')]);router[_0x90c9('0x29')](_0x90c9('0x2d'),auth[_0x90c9('0xf')](),controller[_0x90c9('0x2e')]);router[_0x90c9('0x29')](_0x90c9('0x2f'),controller[_0x90c9('0x30')]);router[_0x90c9('0x31')](_0x90c9('0xe'),auth[_0x90c9('0xb')](),interaction['tracked'](_0x90c9('0x27'),_0x90c9('0x32')),controller[_0x90c9('0x33')]);router[_0x90c9('0x31')](_0x90c9('0x34'),auth[_0x90c9('0xb')](),controller[_0x90c9('0x35')]);module[_0x90c9('0x36')]=router;
\ No newline at end of file
+var _0x19ff=['%s-%s','now','replace','/:id/attachment_upload','attachmentUpload','tracked','addTags','/:id/custom_update','customUpdate','put','/:id/abandon','abandon','/:id/close','close','/:id','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/'];(function(_0x49497b,_0x185992){var _0x2a33b9=function(_0x473fba){while(--_0x473fba){_0x49497b['push'](_0x49497b['shift']());}};_0x2a33b9(++_0x185992);}(_0x19ff,0x165));var _0xf19f=function(_0x5b5d68,_0x575d65){_0x5b5d68=_0x5b5d68-0x0;var _0x9f45c3=_0x19ff[_0x5b5d68];return _0x9f45c3;};'use strict';var multer=require('multer');var util=require(_0xf19f('0x0'));var path=require(_0xf19f('0x1'));var timeout=require(_0xf19f('0x2'));var express=require(_0xf19f('0x3'));var router=express[_0xf19f('0x4')]();var fs_extra=require(_0xf19f('0x5'));var auth=require(_0xf19f('0x6'));var interaction=require(_0xf19f('0x7'));var config=require('../../config/environment');var controller=require(_0xf19f('0x8'));router[_0xf19f('0x9')]('/',auth[_0xf19f('0xa')](),controller['index']);router[_0xf19f('0x9')](_0xf19f('0xb'),auth[_0xf19f('0xa')](),controller[_0xf19f('0xc')]);router[_0xf19f('0x9')]('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router['get']('/:id/attachment_download',auth[_0xf19f('0xd')](),controller[_0xf19f('0xe')]);router[_0xf19f('0x9')](_0xf19f('0xf'),auth[_0xf19f('0xa')](),controller[_0xf19f('0x10')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xf19f('0x11')]);router[_0xf19f('0x9')](_0xf19f('0x12'),auth[_0xf19f('0xa')](),controller[_0xf19f('0x13')]);router[_0xf19f('0x14')]('/',auth[_0xf19f('0xa')](),controller[_0xf19f('0x15')]);router[_0xf19f('0x14')](_0xf19f('0x16'),auth[_0xf19f('0xa')](),controller[_0xf19f('0x17')]);var upload=multer({'storage':multer[_0xf19f('0x18')]({'destination':function(_0x3f23a1,_0x1231be,_0x2a344b){_0x2a344b(null,path['join'](config[_0xf19f('0x19')],_0xf19f('0x1a')));},'filename':function(_0x56f576,_0x5dc01d,_0x2a6f74){_0x2a6f74(null,util['format'](_0xf19f('0x1b'),Date[_0xf19f('0x1c')](),_0x5dc01d['originalname'][_0xf19f('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf19f('0x14')](_0xf19f('0x1e'),upload['single']('file'),controller[_0xf19f('0x1f')]);router[_0xf19f('0x14')](_0xf19f('0xf'),auth[_0xf19f('0xd')](),controller['addMessage']);router[_0xf19f('0x14')]('/:id/tags',auth[_0xf19f('0xa')](),interaction[_0xf19f('0x20')]('chat','chatinteraction:addtags'),controller[_0xf19f('0x21')]);router['put']('/:id',auth[_0xf19f('0xa')](),interaction[_0xf19f('0x20')]('chat','chatinteraction:update'),controller['update']);router['put'](_0xf19f('0x22'),controller[_0xf19f('0x23')]);router[_0xf19f('0x24')](_0xf19f('0x25'),auth[_0xf19f('0xd')](),controller[_0xf19f('0x26')]);router['put'](_0xf19f('0x27'),controller[_0xf19f('0x28')]);router['delete'](_0xf19f('0x29'),auth['isAuthenticated'](),interaction[_0xf19f('0x20')]('chat',_0xf19f('0x2a')),controller[_0xf19f('0x2b')]);router[_0xf19f('0x2c')](_0xf19f('0x2d'),auth[_0xf19f('0xa')](),controller[_0xf19f('0x2e')]);module[_0xf19f('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 0d9d6c4..410d1e1 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 _0x6866=['BOOLEAN','sequelize','medium'];(function(_0x5e92b6,_0x23219a){var _0x487171=function(_0x1ac1dc){while(--_0x1ac1dc){_0x5e92b6['push'](_0x5e92b6['shift']());}};_0x487171(++_0x23219a);}(_0x6866,0x14e));var _0x6686=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x6866[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x6686('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x6686('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6686('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa827=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xa827,0x7c));var _0x7a82=function(_0x52b2d4,_0x1b74b8){_0x52b2d4=_0x52b2d4-0x0;var _0x259b2c=_0xa827[_0x52b2d4];return _0x259b2c;};'use strict';var Sequelize=require(_0x7a82('0x0'));module[_0x7a82('0x1')]={'body':{'type':Sequelize[_0x7a82('0x2')](_0x7a82('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7a82('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7a82('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index b8605df..8495659 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 _0x3b71=['./chatInternalMessage.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','send','index','map','ChatInternalMessage','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','sort','where','merge','filter','options','includeAll','findAll','catch','show','params','rawAttributes','include','create','body','find','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','redis','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b71,0x181));var _0x13b7=function(_0x4949e2,_0x1bf3be){_0x4949e2=_0x4949e2-0x0;var _0x1e45d8=_0x3b71[_0x4949e2];return _0x1e45d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13b7('0x0'));var zipdir=require(_0x13b7('0x1'));var jsonpatch=require(_0x13b7('0x2'));var rp=require(_0x13b7('0x3'));var moment=require(_0x13b7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x13b7('0x5'));var util=require(_0x13b7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x13b7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13b7('0x8'));var _=require(_0x13b7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x13b7('0xa'));var deskjs=require(_0x13b7('0xb'));var toCsv=require(_0x13b7('0x7'));var querystring=require(_0x13b7('0xc'));var Papa=require(_0x13b7('0xd'));var Redis=require('ioredis');var authService=require(_0x13b7('0xe'));var qs=require(_0x13b7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13b7('0x10'));var logger=require('../../config/logger')(_0x13b7('0x11'));var utils=require(_0x13b7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x13b7('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x13b7('0x14')](config[_0x13b7('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x13b7('0x16'))(new Redis(config[_0x13b7('0x15')]));require(_0x13b7('0x17'))['register'](socket);function respondWithStatusCode(_0x26fa4b,_0x2822b9){_0x2822b9=_0x2822b9||0xcc;return function(_0x4f93fd){if(_0x4f93fd){return _0x26fa4b[_0x13b7('0x18')](_0x2822b9);}return _0x26fa4b['status'](_0x2822b9)[_0x13b7('0x19')]();};}function respondWithResult(_0x2d9f9f,_0x1f51c3){_0x1f51c3=_0x1f51c3||0xc8;return function(_0x84f408){if(_0x84f408){return _0x2d9f9f[_0x13b7('0x1a')](_0x1f51c3)[_0x13b7('0x1b')](_0x84f408);}};}function respondWithFilteredResult(_0xd4144a,_0x3c4cba){return function(_0x3dc345){if(_0x3dc345){var _0x3fb14c=typeof _0x3c4cba[_0x13b7('0x1c')]===_0x13b7('0x1d')&&typeof _0x3c4cba[_0x13b7('0x1e')]==='undefined';var _0xec09d9=_0x3dc345[_0x13b7('0x1f')];var _0x2e4f15=_0x3fb14c?0x0:_0x3c4cba[_0x13b7('0x1c')];var _0x346bc0=_0x3fb14c?_0x3dc345[_0x13b7('0x1f')]:_0x3c4cba['offset']+_0x3c4cba[_0x13b7('0x1e')];var _0x4b1b73;if(_0x346bc0>=_0xec09d9){_0x346bc0=_0xec09d9;_0x4b1b73=0xc8;}else{_0x4b1b73=0xce;}_0xd4144a[_0x13b7('0x1a')](_0x4b1b73);return _0xd4144a[_0x13b7('0x20')]('Content-Range',_0x2e4f15+'-'+_0x346bc0+'/'+_0xec09d9)[_0x13b7('0x1b')](_0x3dc345);}return null;};}function patchUpdates(_0xff9324){return function(_0x13246b){try{jsonpatch[_0x13b7('0x21')](_0x13246b,_0xff9324,!![]);}catch(_0x2a85a5){return BPromise[_0x13b7('0x22')](_0x2a85a5);}return _0x13246b[_0x13b7('0x23')]();};}function saveUpdates(_0x21d474,_0x3ac2e1){return function(_0x55144b){if(_0x55144b){return _0x55144b[_0x13b7('0x24')](_0x21d474)[_0x13b7('0x25')](function(_0x21e8a1){return _0x21e8a1;});}return null;};}function removeEntity(_0x584f76,_0x2cfc5c){return function(_0x265b61){if(_0x265b61){return _0x265b61[_0x13b7('0x26')]()[_0x13b7('0x25')](function(){_0x584f76[_0x13b7('0x1a')](0xcc)[_0x13b7('0x19')]();});}};}function handleEntityNotFound(_0x231cee,_0xa51bd1){return function(_0x21ece9){if(!_0x21ece9){_0x231cee[_0x13b7('0x18')](0x194);}return _0x21ece9;};}function handleError(_0x5e4723,_0x366b47){_0x366b47=_0x366b47||0x1f4;return function(_0x1ab4c8){logger['error'](_0x1ab4c8[_0x13b7('0x27')]);if(_0x1ab4c8['name']){delete _0x1ab4c8['name'];}_0x5e4723[_0x13b7('0x1a')](_0x366b47)[_0x13b7('0x28')](_0x1ab4c8);};}exports[_0x13b7('0x29')]=function(_0x190e60,_0x54e634){var _0x5a3bc4={},_0x4a88b1={},_0x38df97={'count':0x0,'rows':[]};var _0x5214f5=_[_0x13b7('0x2a')](db[_0x13b7('0x2b')]['rawAttributes'],function(_0x4c4bdd){return{'name':_0x4c4bdd[_0x13b7('0x2c')],'type':_0x4c4bdd[_0x13b7('0x2d')]['key']};});_0x4a88b1[_0x13b7('0x2e')]=_[_0x13b7('0x2a')](_0x5214f5,_0x13b7('0x2f'));_0x4a88b1[_0x13b7('0x30')]=_[_0x13b7('0x31')](_0x190e60[_0x13b7('0x30')]);_0x4a88b1[_0x13b7('0x32')]=_[_0x13b7('0x33')](_0x4a88b1['model'],_0x4a88b1[_0x13b7('0x30')]);_0x5a3bc4[_0x13b7('0x34')]=_[_0x13b7('0x33')](_0x4a88b1[_0x13b7('0x2e')],qs[_0x13b7('0x35')](_0x190e60[_0x13b7('0x30')]['fields']));_0x5a3bc4[_0x13b7('0x34')]=_0x5a3bc4[_0x13b7('0x34')][_0x13b7('0x36')]?_0x5a3bc4[_0x13b7('0x34')]:_0x4a88b1[_0x13b7('0x2e')];if(!_0x190e60['query']['hasOwnProperty']('nolimit')){_0x5a3bc4[_0x13b7('0x1e')]=qs[_0x13b7('0x1e')](_0x190e60[_0x13b7('0x30')][_0x13b7('0x1e')]);_0x5a3bc4[_0x13b7('0x1c')]=qs[_0x13b7('0x1c')](_0x190e60[_0x13b7('0x30')][_0x13b7('0x1c')]);}_0x5a3bc4['order']=qs[_0x13b7('0x37')](_0x190e60[_0x13b7('0x30')][_0x13b7('0x37')]);_0x5a3bc4[_0x13b7('0x38')]=qs[_0x13b7('0x32')](_['pick'](_0x190e60['query'],_0x4a88b1['filters']),_0x5214f5);if(_0x190e60[_0x13b7('0x30')]['filter']){_0x5a3bc4[_0x13b7('0x38')]=_[_0x13b7('0x39')](_0x5a3bc4[_0x13b7('0x38')],{'$or':_[_0x13b7('0x2a')](_0x5214f5,function(_0x36b60b){if(_0x36b60b[_0x13b7('0x2d')]!=='VIRTUAL'){var _0x123c61={};_0x123c61[_0x36b60b['name']]={'$like':'%'+_0x190e60[_0x13b7('0x30')][_0x13b7('0x3a')]+'%'};return _0x123c61;}})});}_0x5a3bc4=_[_0x13b7('0x39')]({},_0x5a3bc4,_0x190e60[_0x13b7('0x3b')]);var _0x4e9a4a={'where':_0x5a3bc4[_0x13b7('0x38')]};return db[_0x13b7('0x2b')][_0x13b7('0x1f')](_0x4e9a4a)['then'](function(_0x1008cb){_0x38df97[_0x13b7('0x1f')]=_0x1008cb;if(_0x190e60[_0x13b7('0x30')][_0x13b7('0x3c')]){_0x5a3bc4['include']=[{'all':!![]}];}return db[_0x13b7('0x2b')][_0x13b7('0x3d')](_0x5a3bc4);})['then'](function(_0x23271b){_0x38df97['rows']=_0x23271b;return _0x38df97;})[_0x13b7('0x25')](respondWithFilteredResult(_0x54e634,_0x5a3bc4))[_0x13b7('0x3e')](handleError(_0x54e634,null));};exports[_0x13b7('0x3f')]=function(_0x256a3e,_0x168705){var _0x1c6ed1={'raw':!![],'where':{'id':_0x256a3e[_0x13b7('0x40')]['id']}},_0x491af1={};_0x491af1[_0x13b7('0x2e')]=_['keys'](db[_0x13b7('0x2b')][_0x13b7('0x41')]);_0x491af1['query']=_[_0x13b7('0x31')](_0x256a3e['query']);_0x491af1[_0x13b7('0x32')]=_['intersection'](_0x491af1[_0x13b7('0x2e')],_0x491af1[_0x13b7('0x30')]);_0x1c6ed1[_0x13b7('0x34')]=_[_0x13b7('0x33')](_0x491af1[_0x13b7('0x2e')],qs[_0x13b7('0x35')](_0x256a3e['query'][_0x13b7('0x35')]));_0x1c6ed1[_0x13b7('0x34')]=_0x1c6ed1[_0x13b7('0x34')][_0x13b7('0x36')]?_0x1c6ed1['attributes']:_0x491af1[_0x13b7('0x2e')];if(_0x256a3e[_0x13b7('0x30')][_0x13b7('0x3c')]){_0x1c6ed1[_0x13b7('0x42')]=[{'all':!![]}];}_0x1c6ed1=_[_0x13b7('0x39')]({},_0x1c6ed1,_0x256a3e['options']);return db['ChatInternalMessage']['find'](_0x1c6ed1)['then'](handleEntityNotFound(_0x168705,null))[_0x13b7('0x25')](respondWithResult(_0x168705,null))[_0x13b7('0x3e')](handleError(_0x168705,null));};exports['create']=function(_0x2a4172,_0x202623){return db[_0x13b7('0x2b')][_0x13b7('0x43')](_0x2a4172[_0x13b7('0x44')],{})['then'](respondWithResult(_0x202623,0xc9))[_0x13b7('0x3e')](handleError(_0x202623,null));};exports['update']=function(_0x403b0c,_0x1c725b){if(_0x403b0c[_0x13b7('0x44')]['id']){delete _0x403b0c[_0x13b7('0x44')]['id'];}return db[_0x13b7('0x2b')][_0x13b7('0x45')]({'where':{'id':_0x403b0c[_0x13b7('0x40')]['id']}})[_0x13b7('0x25')](handleEntityNotFound(_0x1c725b,null))[_0x13b7('0x25')](saveUpdates(_0x403b0c[_0x13b7('0x44')],null))[_0x13b7('0x25')](respondWithResult(_0x1c725b,null))[_0x13b7('0x3e')](handleError(_0x1c725b,null));};exports['destroy']=function(_0x35bd5b,_0x43055f){return db[_0x13b7('0x2b')][_0x13b7('0x45')]({'where':{'id':_0x35bd5b['params']['id']}})[_0x13b7('0x25')](handleEntityNotFound(_0x43055f,null))[_0x13b7('0x25')](removeEntity(_0x43055f,null))[_0x13b7('0x3e')](handleError(_0x43055f,null));};exports['describe']=function(_0x1144ed,_0x3e491){return db[_0x13b7('0x2b')]['describe']()[_0x13b7('0x25')](respondWithResult(_0x3e491,null))[_0x13b7('0x3e')](handleError(_0x3e491,null));};function wrapUser(_0x134df3){return function(_0x5886ef){var _0x39a720=_0x134df3['get']({'plain':!![]});_0x39a720[_0x13b7('0x46')]=[];if(_0x5886ef){_0x39a720[_0x13b7('0x47')]=_0x5886ef[_0x13b7('0x48')];_0x39a720[_0x13b7('0x49')]=_0x5886ef;}else{_0x39a720[_0x13b7('0x47')]=moment(0x0)[_0x13b7('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x39a720[_0x13b7('0x49')]={};}return _0x39a720;};}exports[_0x13b7('0x4b')]=function(_0x3135da,_0x54af24,_0x5a0022){var _0x125c24=[];return db[_0x13b7('0x4c')]['findAll']({'where':{'role':[_0x13b7('0x4d'),_0x13b7('0x4e'),_0x13b7('0x4f')]},'attributes':['id',_0x13b7('0x50'),_0x13b7('0x2f'),_0x13b7('0x51'),_0x13b7('0x52'),_0x13b7('0x53'),_0x13b7('0x54'),_0x13b7('0x55'),_0x13b7('0x56'),_0x13b7('0x57')],'order':qs[_0x13b7('0x37')](_0x13b7('0x58')),'include':[{'model':db['VoiceQueue'],'as':_0x13b7('0x59'),'attributes':['id',_0x13b7('0x2f'),_0x13b7('0x2d')],'through':{'attributes':[]}}]})[_0x13b7('0x25')](function(_0x434552){if(_0x434552){var _0x1b8215=_0x3135da[_0x13b7('0x4f')][_0x13b7('0x5a')]({'plain':!![]});if(!_0x1b8215)throw new Error(_0x13b7('0x5b'));if(_0x1b8215['role']===_0x13b7('0x4f')){return db['UserProfileSection'][_0x13b7('0x45')]({'where':{'name':_0x13b7('0x5c'),'userProfileId':_0x1b8215[_0x13b7('0x5d')]},'raw':!![]})[_0x13b7('0x25')](function(_0x31329d){if(_0x31329d){if(_0x31329d['autoAssociation']===0x0){return db[_0x13b7('0x5e')][_0x13b7('0x3d')]({'where':{'sectionId':_0x31329d['id']},'raw':!![]})['then'](function(_0xb0d3f4){var _0x3489c8=[];if(_[_0x13b7('0x5f')](_0xb0d3f4)){_0x3489c8=_['filter'](_0x434552,function(_0x47730f){if(_0x47730f[_0x13b7('0x51')]!=='agent'){return _0x47730f;}});return _0x3489c8;}else{for(var _0x2c6a3f=0x0;_0x2c6a3f<_0x434552[_0x13b7('0x36')];_0x2c6a3f++){var _0x3fdaf6=_0x434552[_0x2c6a3f];if(_0x3fdaf6[_0x13b7('0x51')]===_0x13b7('0x4d')){var _0xf78590=_[_0x13b7('0x45')](_0xb0d3f4,function(_0x2a78cb){return _0x2a78cb[_0x13b7('0x60')]===_0x3fdaf6['id'];});if(_0xf78590)_0x3489c8[_0x13b7('0x61')](_0x3fdaf6);}else{_0x3489c8['push'](_0x3fdaf6);}}return _0x3489c8;}});}else{return _0x434552;}}else{var _0x41e938=_['filter'](_0x434552,function(_0x2a27c1){if(_0x2a27c1[_0x13b7('0x51')]!==_0x13b7('0x4d')){return _0x2a27c1;}});return _0x41e938;}});}else{return _0x434552;}}})[_0x13b7('0x25')](function(_0x2d3bec){var _0x1309d5=[];if(_0x2d3bec){_0x125c24=_0x2d3bec;for(var _0x2822d4=0x0;_0x2822d4<_0x2d3bec['length'];_0x2822d4+=0x1){_0x125c24[_0x2822d4]['messages']=[];_0x1309d5[_0x13b7('0x61')](db[_0x13b7('0x2b')]['find']({'where':{'FromId':[_0x3135da['user']['id'],_0x2d3bec[_0x2822d4]['id']],'ToId':[_0x3135da[_0x13b7('0x4f')]['id'],_0x2d3bec[_0x2822d4]['id']],'ChatGroupId':null},'attributes':['id',_0x13b7('0x48'),_0x13b7('0x62'),_0x13b7('0x63'),_0x13b7('0x64'),_0x13b7('0x44')],'order':qs['sort'](_0x13b7('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x13b7('0x25')](wrapUser(_0x2d3bec[_0x2822d4])));}return BPromise['all'](_0x1309d5);}return[];})['then'](function(_0x10ed99){return{'rows':_0x10ed99,'count':_0x10ed99['length']};})['then'](respondWithResult(_0x54af24,null))[_0x13b7('0x3e')](handleError(_0x54af24,null));};
\ No newline at end of file
+var _0x662e=['index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','messages','createdAt','lastMessage','lastMessageAt','format','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send'];(function(_0x4a6b92,_0x53929c){var _0x303f17=function(_0x30a218){while(--_0x30a218){_0x4a6b92['push'](_0x4a6b92['shift']());}};_0x303f17(++_0x53929c);}(_0x662e,0x19f));var _0xe662=function(_0x5abdf9,_0xd088d9){_0x5abdf9=_0x5abdf9-0x0;var _0x3856d8=_0x662e[_0x5abdf9];return _0x3856d8;};'use strict';var emlformat=require(_0xe662('0x0'));var rimraf=require(_0xe662('0x1'));var zipdir=require(_0xe662('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe662('0x3'));var moment=require(_0xe662('0x4'));var BPromise=require(_0xe662('0x5'));var Mustache=require('mustache');var util=require(_0xe662('0x6'));var path=require(_0xe662('0x7'));var sox=require(_0xe662('0x8'));var csv=require(_0xe662('0x9'));var ejs=require(_0xe662('0xa'));var fs=require('fs');var fs_extra=require(_0xe662('0xb'));var _=require(_0xe662('0xc'));var squel=require(_0xe662('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe662('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe662('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe662('0x10'));var hardwareService=require(_0xe662('0x11'));var logger=require(_0xe662('0x12'))('api');var utils=require(_0xe662('0x13'));var config=require(_0xe662('0x14'));var licenseUtil=require(_0xe662('0x15'));var db=require('../../mysqldb')['db'];config[_0xe662('0x16')]=_[_0xe662('0x17')](config['redis'],{'host':_0xe662('0x18'),'port':0x18eb});var socket=require(_0xe662('0x19'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xe662('0x1a')](socket);function respondWithStatusCode(_0x2f4fa4,_0x5def07){_0x5def07=_0x5def07||0xcc;return function(_0x30fc09){if(_0x30fc09){return _0x2f4fa4[_0xe662('0x1b')](_0x5def07);}return _0x2f4fa4['status'](_0x5def07)[_0xe662('0x1c')]();};}function respondWithResult(_0x57672d,_0x1a1689){_0x1a1689=_0x1a1689||0xc8;return function(_0x39a5e0){if(_0x39a5e0){return _0x57672d[_0xe662('0x1d')](_0x1a1689)[_0xe662('0x1e')](_0x39a5e0);}};}function respondWithFilteredResult(_0xa4b806,_0x34138f){return function(_0x435a58){if(_0x435a58){var _0x5ade08=typeof _0x34138f[_0xe662('0x1f')]==='undefined'&&typeof _0x34138f['limit']===_0xe662('0x20');var _0x26bb11=_0x435a58['count'];var _0x31b702=_0x5ade08?0x0:_0x34138f['offset'];var _0x30846d=_0x5ade08?_0x435a58['count']:_0x34138f['offset']+_0x34138f[_0xe662('0x21')];var _0x5f58e5;if(_0x30846d>=_0x26bb11){_0x30846d=_0x26bb11;_0x5f58e5=0xc8;}else{_0x5f58e5=0xce;}_0xa4b806[_0xe662('0x1d')](_0x5f58e5);return _0xa4b806[_0xe662('0x22')](_0xe662('0x23'),_0x31b702+'-'+_0x30846d+'/'+_0x26bb11)['json'](_0x435a58);}return null;};}function patchUpdates(_0x13a597){return function(_0x2c3261){try{jsonpatch[_0xe662('0x24')](_0x2c3261,_0x13a597,!![]);}catch(_0x214111){return BPromise[_0xe662('0x25')](_0x214111);}return _0x2c3261[_0xe662('0x26')]();};}function saveUpdates(_0x1b6b78,_0x3e9974){return function(_0x4917d4){if(_0x4917d4){return _0x4917d4[_0xe662('0x27')](_0x1b6b78)[_0xe662('0x28')](function(_0x4ab2a3){return _0x4ab2a3;});}return null;};}function removeEntity(_0x4d2afa,_0x2ebb2b){return function(_0x2b032f){if(_0x2b032f){return _0x2b032f[_0xe662('0x29')]()[_0xe662('0x28')](function(){_0x4d2afa[_0xe662('0x1d')](0xcc)[_0xe662('0x1c')]();});}};}function handleEntityNotFound(_0x170967,_0x514b2e){return function(_0x17aedb){if(!_0x17aedb){_0x170967[_0xe662('0x1b')](0x194);}return _0x17aedb;};}function handleError(_0x1999d7,_0x3860ad){_0x3860ad=_0x3860ad||0x1f4;return function(_0x141400){logger[_0xe662('0x2a')](_0x141400['stack']);if(_0x141400[_0xe662('0x2b')]){delete _0x141400[_0xe662('0x2b')];}_0x1999d7[_0xe662('0x1d')](_0x3860ad)[_0xe662('0x2c')](_0x141400);};}exports[_0xe662('0x2d')]=function(_0x5aa02d,_0x5bcccb){var _0x45d91b={},_0x17cc64={},_0x301736={'count':0x0,'rows':[]};var _0xfb0fb2=_[_0xe662('0x2e')](db[_0xe662('0x2f')][_0xe662('0x30')],function(_0x5da04c){return{'name':_0x5da04c[_0xe662('0x31')],'type':_0x5da04c[_0xe662('0x32')][_0xe662('0x33')]};});_0x17cc64['model']=_[_0xe662('0x2e')](_0xfb0fb2,'name');_0x17cc64[_0xe662('0x34')]=_[_0xe662('0x35')](_0x5aa02d[_0xe662('0x34')]);_0x17cc64['filters']=_[_0xe662('0x36')](_0x17cc64[_0xe662('0x37')],_0x17cc64[_0xe662('0x34')]);_0x45d91b[_0xe662('0x38')]=_[_0xe662('0x36')](_0x17cc64[_0xe662('0x37')],qs[_0xe662('0x39')](_0x5aa02d[_0xe662('0x34')][_0xe662('0x39')]));_0x45d91b[_0xe662('0x38')]=_0x45d91b[_0xe662('0x38')][_0xe662('0x3a')]?_0x45d91b[_0xe662('0x38')]:_0x17cc64['model'];if(!_0x5aa02d['query'][_0xe662('0x3b')](_0xe662('0x3c'))){_0x45d91b[_0xe662('0x21')]=qs[_0xe662('0x21')](_0x5aa02d[_0xe662('0x34')][_0xe662('0x21')]);_0x45d91b[_0xe662('0x1f')]=qs[_0xe662('0x1f')](_0x5aa02d[_0xe662('0x34')]['offset']);}_0x45d91b[_0xe662('0x3d')]=qs[_0xe662('0x3e')](_0x5aa02d[_0xe662('0x34')][_0xe662('0x3e')]);_0x45d91b[_0xe662('0x3f')]=qs['filters'](_[_0xe662('0x40')](_0x5aa02d[_0xe662('0x34')],_0x17cc64[_0xe662('0x41')]),_0xfb0fb2);if(_0x5aa02d[_0xe662('0x34')][_0xe662('0x42')]){_0x45d91b[_0xe662('0x3f')]=_[_0xe662('0x43')](_0x45d91b[_0xe662('0x3f')],{'$or':_[_0xe662('0x2e')](_0xfb0fb2,function(_0x513f2b){if(_0x513f2b[_0xe662('0x32')]!==_0xe662('0x44')){var _0x565c19={};_0x565c19[_0x513f2b[_0xe662('0x2b')]]={'$like':'%'+_0x5aa02d[_0xe662('0x34')]['filter']+'%'};return _0x565c19;}})});}_0x45d91b=_['merge']({},_0x45d91b,_0x5aa02d[_0xe662('0x45')]);var _0x47e982={'where':_0x45d91b[_0xe662('0x3f')]};return db['ChatInternalMessage'][_0xe662('0x46')](_0x47e982)[_0xe662('0x28')](function(_0x48e654){_0x301736[_0xe662('0x46')]=_0x48e654;if(_0x5aa02d[_0xe662('0x34')][_0xe662('0x47')]){_0x45d91b[_0xe662('0x48')]=[{'all':!![]}];}return db[_0xe662('0x2f')][_0xe662('0x49')](_0x45d91b);})[_0xe662('0x28')](function(_0x24be36){_0x301736[_0xe662('0x4a')]=_0x24be36;return _0x301736;})['then'](respondWithFilteredResult(_0x5bcccb,_0x45d91b))[_0xe662('0x4b')](handleError(_0x5bcccb,null));};exports[_0xe662('0x4c')]=function(_0xb04f9c,_0xde933c){var _0x5b52a8={'raw':!![],'where':{'id':_0xb04f9c['params']['id']}},_0x5eee9b={};_0x5eee9b['model']=_['keys'](db[_0xe662('0x2f')][_0xe662('0x30')]);_0x5eee9b[_0xe662('0x34')]=_[_0xe662('0x35')](_0xb04f9c[_0xe662('0x34')]);_0x5eee9b[_0xe662('0x41')]=_['intersection'](_0x5eee9b[_0xe662('0x37')],_0x5eee9b['query']);_0x5b52a8['attributes']=_[_0xe662('0x36')](_0x5eee9b['model'],qs[_0xe662('0x39')](_0xb04f9c[_0xe662('0x34')][_0xe662('0x39')]));_0x5b52a8[_0xe662('0x38')]=_0x5b52a8['attributes'][_0xe662('0x3a')]?_0x5b52a8[_0xe662('0x38')]:_0x5eee9b[_0xe662('0x37')];if(_0xb04f9c[_0xe662('0x34')][_0xe662('0x47')]){_0x5b52a8[_0xe662('0x48')]=[{'all':!![]}];}_0x5b52a8=_[_0xe662('0x43')]({},_0x5b52a8,_0xb04f9c['options']);return db[_0xe662('0x2f')]['find'](_0x5b52a8)[_0xe662('0x28')](handleEntityNotFound(_0xde933c,null))[_0xe662('0x28')](respondWithResult(_0xde933c,null))[_0xe662('0x4b')](handleError(_0xde933c,null));};exports[_0xe662('0x4d')]=function(_0x359381,_0x3399fd){return db[_0xe662('0x2f')]['create'](_0x359381[_0xe662('0x4e')],{})[_0xe662('0x28')](respondWithResult(_0x3399fd,0xc9))['catch'](handleError(_0x3399fd,null));};exports[_0xe662('0x27')]=function(_0x22a580,_0x53c33d){if(_0x22a580[_0xe662('0x4e')]['id']){delete _0x22a580[_0xe662('0x4e')]['id'];}return db[_0xe662('0x2f')][_0xe662('0x4f')]({'where':{'id':_0x22a580[_0xe662('0x50')]['id']}})['then'](handleEntityNotFound(_0x53c33d,null))[_0xe662('0x28')](saveUpdates(_0x22a580[_0xe662('0x4e')],null))[_0xe662('0x28')](respondWithResult(_0x53c33d,null))[_0xe662('0x4b')](handleError(_0x53c33d,null));};exports[_0xe662('0x29')]=function(_0x5ade31,_0x208bec){return db['ChatInternalMessage'][_0xe662('0x4f')]({'where':{'id':_0x5ade31['params']['id']}})[_0xe662('0x28')](handleEntityNotFound(_0x208bec,null))['then'](removeEntity(_0x208bec,null))['catch'](handleError(_0x208bec,null));};exports[_0xe662('0x51')]=function(_0x417928,_0x16e41b){return db[_0xe662('0x2f')][_0xe662('0x51')]()[_0xe662('0x28')](respondWithResult(_0x16e41b,null))[_0xe662('0x4b')](handleError(_0x16e41b,null));};function wrapUser(_0x26ccf9){return function(_0x59ba04){var _0x2c8f4c=_0x26ccf9['get']({'plain':!![]});_0x2c8f4c[_0xe662('0x52')]=[];if(_0x59ba04){_0x2c8f4c['lastMessageAt']=_0x59ba04[_0xe662('0x53')];_0x2c8f4c[_0xe662('0x54')]=_0x59ba04;}else{_0x2c8f4c[_0xe662('0x55')]=moment(0x0)[_0xe662('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c8f4c[_0xe662('0x54')]={};}return _0x2c8f4c;};}exports[_0xe662('0x57')]=function(_0x5e93a5,_0x443ec9,_0x146df4){var _0x580e81=[];return db[_0xe662('0x58')]['findAll']({'where':{'role':[_0xe662('0x59'),_0xe662('0x5a'),_0xe662('0x5b')]},'attributes':['id',_0xe662('0x5c'),_0xe662('0x2b'),_0xe662('0x5d'),_0xe662('0x5e'),_0xe662('0x5f'),_0xe662('0x60'),_0xe662('0x61'),_0xe662('0x62'),_0xe662('0x63')],'order':qs['sort']('-online'),'include':[{'model':db[_0xe662('0x64')],'as':_0xe662('0x65'),'attributes':['id','name',_0xe662('0x32')],'through':{'attributes':[]}}]})[_0xe662('0x28')](function(_0x251004){if(_0x251004){var _0x47356d=_0x5e93a5[_0xe662('0x5b')][_0xe662('0x66')]({'plain':!![]});if(!_0x47356d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47356d[_0xe662('0x5d')]==='user'){return db[_0xe662('0x67')][_0xe662('0x4f')]({'where':{'name':_0xe662('0x68'),'userProfileId':_0x47356d[_0xe662('0x69')]},'raw':!![]})[_0xe662('0x28')](function(_0x232210){if(_0x232210){if(_0x232210[_0xe662('0x6a')]===0x0){return db[_0xe662('0x6b')][_0xe662('0x49')]({'where':{'sectionId':_0x232210['id']},'raw':!![]})[_0xe662('0x28')](function(_0x2875d7){var _0x2edef8=[];if(_[_0xe662('0x6c')](_0x2875d7)){_0x2edef8=_[_0xe662('0x42')](_0x251004,function(_0x36c423){if(_0x36c423[_0xe662('0x5d')]!=='agent'){return _0x36c423;}});return _0x2edef8;}else{for(var _0x419216=0x0;_0x419216<_0x251004[_0xe662('0x3a')];_0x419216++){var _0x4c0f34=_0x251004[_0x419216];if(_0x4c0f34[_0xe662('0x5d')]===_0xe662('0x59')){var _0x129076=_['find'](_0x2875d7,function(_0xcd1fe1){return _0xcd1fe1[_0xe662('0x6d')]===_0x4c0f34['id'];});if(_0x129076)_0x2edef8[_0xe662('0x6e')](_0x4c0f34);}else{_0x2edef8['push'](_0x4c0f34);}}return _0x2edef8;}});}else{return _0x251004;}}else{var _0x535ae3=_[_0xe662('0x42')](_0x251004,function(_0x4de454){if(_0x4de454['role']!==_0xe662('0x59')){return _0x4de454;}});return _0x535ae3;}});}else{return _0x251004;}}})['then'](function(_0x9a7919){var _0x1de565=[];if(_0x9a7919){_0x580e81=_0x9a7919;for(var _0x5dada3=0x0;_0x5dada3<_0x9a7919[_0xe662('0x3a')];_0x5dada3+=0x1){_0x580e81[_0x5dada3][_0xe662('0x52')]=[];_0x1de565['push'](db[_0xe662('0x2f')]['find']({'where':{'FromId':[_0x5e93a5[_0xe662('0x5b')]['id'],_0x9a7919[_0x5dada3]['id']],'ToId':[_0x5e93a5[_0xe662('0x5b')]['id'],_0x9a7919[_0x5dada3]['id']],'ChatGroupId':null},'attributes':['id',_0xe662('0x53'),_0xe662('0x6f'),'ToId',_0xe662('0x70'),_0xe662('0x4e')],'order':qs[_0xe662('0x3e')](_0xe662('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe662('0x28')](wrapUser(_0x9a7919[_0x5dada3])));}return BPromise[_0xe662('0x72')](_0x1de565);}return[];})[_0xe662('0x28')](function(_0x1bd47e){return{'rows':_0x1bd47e,'count':_0x1bd47e[_0xe662('0x3a')]};})[_0xe662('0x28')](respondWithResult(_0x443ec9,null))[_0xe662('0x4b')](handleError(_0x443ec9,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 7cc8b68..236e91f 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 _0xe003=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x3dca5f,_0x3bf609){var _0x2ad290=function(_0x35ca60){while(--_0x35ca60){_0x3dca5f['push'](_0x3dca5f['shift']());}};_0x2ad290(++_0x3bf609);}(_0xe003,0x1c4));var _0x3e00=function(_0x5bfb3e,_0x4975ca){_0x5bfb3e=_0x5bfb3e-0x0;var _0x58e6cd=_0xe003[_0x5bfb3e];return _0x58e6cd;};'use strict';var EventEmitter=require(_0x3e00('0x0'));var ChatInternalMessage=require(_0x3e00('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3e00('0x2')](0x0);var events={'afterCreate':_0x3e00('0x3'),'afterUpdate':_0x3e00('0x4'),'afterDestroy':_0x3e00('0x5')};function emitEvent(_0x19e0a4){return function(_0x4f3d98,_0x3705d5,_0x2c75a3){ChatInternalMessageEvents['emit'](_0x19e0a4+':'+_0x4f3d98['id'],_0x4f3d98);ChatInternalMessageEvents[_0x3e00('0x6')](_0x19e0a4,_0x4f3d98);_0x2c75a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x3e00('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x4ef9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update','remove'];(function(_0x223983,_0x6e97cb){var _0x4c8fb4=function(_0x89ebeb){while(--_0x89ebeb){_0x223983['push'](_0x223983['shift']());}};_0x4c8fb4(++_0x6e97cb);}(_0x4ef9,0x144));var _0x94ef=function(_0x16d3c7,_0x82a2c4){_0x16d3c7=_0x16d3c7-0x0;var _0x1f6edc=_0x4ef9[_0x16d3c7];return _0x1f6edc;};'use strict';var EventEmitter=require(_0x94ef('0x0'));var ChatInternalMessage=require(_0x94ef('0x1'))['db'][_0x94ef('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x94ef('0x3'),'afterUpdate':_0x94ef('0x4'),'afterDestroy':_0x94ef('0x5')};function emitEvent(_0x53eae1){return function(_0x1a8030,_0x2cb58e,_0x4b2398){ChatInternalMessageEvents[_0x94ef('0x6')](_0x53eae1+':'+_0x1a8030['id'],_0x1a8030);ChatInternalMessageEvents[_0x94ef('0x6')](_0x53eae1,_0x1a8030);_0x4b2398(null);};}for(var e in events){if(events[_0x94ef('0x7')](e)){var event=events[e];ChatInternalMessage[_0x94ef('0x8')](e,emitEvent(event));}}module[_0x94ef('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index c827db9..6430f0f 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 _0x69f1=['moment','request-promise','path','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69f1,0x6b));var _0x169f=function(_0x59ff13,_0x2a91c1){_0x59ff13=_0x59ff13-0x0;var _0x4f3045=_0x69f1[_0x59ff13];return _0x4f3045;};'use strict';var _=require(_0x169f('0x0'));var util=require(_0x169f('0x1'));var logger=require(_0x169f('0x2'))('api');var moment=require(_0x169f('0x3'));var BPromise=require('bluebird');var rp=require(_0x169f('0x4'));var fs=require('fs');var path=require(_0x169f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x169f('0x6'));module[_0x169f('0x7')]=function(_0x3d6092,_0x2f58a0){return _0x3d6092[_0x169f('0x8')](_0x169f('0x9'),attributes,{'tableName':_0x169f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x57ac=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','exports'];(function(_0x139280,_0x1da61c){var _0x48ecdf=function(_0x5e5fbe){while(--_0x5e5fbe){_0x139280['push'](_0x139280['shift']());}};_0x48ecdf(++_0x1da61c);}(_0x57ac,0x1b4));var _0xc57a=function(_0x1a5245,_0x4b71ba){_0x1a5245=_0x1a5245-0x0;var _0x6ee039=_0x57ac[_0x1a5245];return _0x6ee039;};'use strict';var _=require(_0xc57a('0x0'));var util=require(_0xc57a('0x1'));var logger=require('../../config/logger')(_0xc57a('0x2'));var moment=require(_0xc57a('0x3'));var BPromise=require(_0xc57a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc57a('0x5'));var rimraf=require(_0xc57a('0x6'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xc57a('0x7')]=function(_0x4cb128,_0x52cdfa){return _0x4cb128[_0xc57a('0x8')](_0xc57a('0x9'),attributes,{'tableName':_0xc57a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc57a('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 1daa473..4e0c1ff 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 _0x5d53=['request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','register','request','then','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x52171e,_0x45804b){var _0x4bcaa5=function(_0x1aa4c8){while(--_0x1aa4c8){_0x52171e['push'](_0x52171e['shift']());}};_0x4bcaa5(++_0x45804b);}(_0x5d53,0x81));var _0x35d5=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0x5d53[_0x69a451];return _0x3d6ef5;};'use strict';var _=require('lodash');var util=require(_0x35d5('0x0'));var moment=require(_0x35d5('0x1'));var BPromise=require(_0x35d5('0x2'));var rs=require(_0x35d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35d5('0x4'))['db'];var utils=require(_0x35d5('0x5'));var logger=require('../../config/logger')(_0x35d5('0x6'));var config=require(_0x35d5('0x7'));var jayson=require(_0x35d5('0x8'));var client=jayson[_0x35d5('0x9')]['http']({'port':0x232a});config[_0x35d5('0xa')]=_['defaults'](config[_0x35d5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35d5('0xa')]));require('./chatInternalMessage.socket')[_0x35d5('0xb')](socket);function respondWithRpcPromise(_0x3a6018,_0x4a5f1b,_0x241f6e){return new BPromise(function(_0x292ef3,_0xbd56a1){return client[_0x35d5('0xc')](_0x3a6018,_0x241f6e)[_0x35d5('0xd')](function(_0x5eb042){logger['info'](_0x35d5('0xe'),_0x4a5f1b,_0x35d5('0xf'));logger[_0x35d5('0x10')](_0x35d5('0x11'),_0x4a5f1b,'request\x20sent',JSON[_0x35d5('0x12')](_0x5eb042));if(_0x5eb042[_0x35d5('0x13')]){if(_0x5eb042[_0x35d5('0x13')][_0x35d5('0x14')]===0x1f4){logger[_0x35d5('0x13')](_0x35d5('0xe'),_0x4a5f1b,_0x5eb042[_0x35d5('0x13')][_0x35d5('0x15')]);return _0xbd56a1(_0x5eb042['error'][_0x35d5('0x15')]);}logger[_0x35d5('0x13')](_0x35d5('0xe'),_0x4a5f1b,_0x5eb042[_0x35d5('0x13')][_0x35d5('0x15')]);return _0x292ef3(_0x5eb042['error'][_0x35d5('0x15')]);}else{logger[_0x35d5('0x16')](_0x35d5('0xe'),_0x4a5f1b,_0x35d5('0xf'));_0x292ef3(_0x5eb042['result'][_0x35d5('0x15')]);}})[_0x35d5('0x17')](function(_0x912809){logger[_0x35d5('0x13')](_0x35d5('0xe'),_0x4a5f1b,_0x912809);_0xbd56a1(_0x912809);});});}
\ No newline at end of file
+var _0xc452=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xc8a11,_0x347a33){var _0x55a500=function(_0x288d05){while(--_0x288d05){_0xc8a11['push'](_0xc8a11['shift']());}};_0x55a500(++_0x347a33);}(_0xc452,0x154));var _0x2c45=function(_0x16d661,_0x39513b){_0x16d661=_0x16d661-0x0;var _0x2effde=_0xc452[_0x16d661];return _0x2effde;};'use strict';var _=require('lodash');var util=require(_0x2c45('0x0'));var moment=require('moment');var BPromise=require(_0x2c45('0x1'));var rs=require(_0x2c45('0x2'));var fs=require('fs');var Redis=require(_0x2c45('0x3'));var db=require(_0x2c45('0x4'))['db'];var utils=require(_0x2c45('0x5'));var logger=require(_0x2c45('0x6'))(_0x2c45('0x7'));var config=require('../../config/environment');var jayson=require(_0x2c45('0x8'));var client=jayson[_0x2c45('0x9')][_0x2c45('0xa')]({'port':0x232a});config['redis']=_[_0x2c45('0xb')](config[_0x2c45('0xc')],{'host':_0x2c45('0xd'),'port':0x18eb});var socket=require(_0x2c45('0xe'))(new Redis(config[_0x2c45('0xc')]));require(_0x2c45('0xf'))[_0x2c45('0x10')](socket);function respondWithRpcPromise(_0xb4d847,_0x2499b6,_0x17c7cf){return new BPromise(function(_0x3957a4,_0x228500){return client[_0x2c45('0x11')](_0xb4d847,_0x17c7cf)[_0x2c45('0x12')](function(_0xde0f62){logger[_0x2c45('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x2499b6,'request\x20sent');logger[_0x2c45('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x2499b6,_0x2c45('0x15'),JSON[_0x2c45('0x16')](_0xde0f62));if(_0xde0f62[_0x2c45('0x17')]){if(_0xde0f62[_0x2c45('0x17')][_0x2c45('0x18')]===0x1f4){logger[_0x2c45('0x17')](_0x2c45('0x19'),_0x2499b6,_0xde0f62[_0x2c45('0x17')][_0x2c45('0x1a')]);return _0x228500(_0xde0f62['error'][_0x2c45('0x1a')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x2499b6,_0xde0f62[_0x2c45('0x17')][_0x2c45('0x1a')]);return _0x3957a4(_0xde0f62[_0x2c45('0x17')][_0x2c45('0x1a')]);}else{logger['info'](_0x2c45('0x19'),_0x2499b6,_0x2c45('0x15'));_0x3957a4(_0xde0f62[_0x2c45('0x1b')][_0x2c45('0x1a')]);}})[_0x2c45('0x1c')](function(_0x2370ec){logger[_0x2c45('0x17')](_0x2c45('0x19'),_0x2499b6,_0x2370ec);_0x228500(_0x2370ec);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index a4af659..88c5f55 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 _0x2e4f=['chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener','register','length'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2e4f,0x1a5));var _0xf2e4=function(_0x98db33,_0x397f20){_0x98db33=_0x98db33-0x0;var _0x5ae63a=_0x2e4f[_0x98db33];return _0x5ae63a;};'use strict';var ChatInternalMessageEvents=require(_0xf2e4('0x0'));var events=[_0xf2e4('0x1'),'remove','update'];function createListener(_0x11c359,_0x5ea72a){return function(_0x36a9a6){_0x5ea72a[_0xf2e4('0x2')](_0x11c359,_0x36a9a6);};}function removeListener(_0x185a9b,_0x447f79){return function(){ChatInternalMessageEvents[_0xf2e4('0x3')](_0x185a9b,_0x447f79);};}exports[_0xf2e4('0x4')]=function(_0x5a072b){for(var _0xa0c128=0x0,_0x53ea9b=events[_0xf2e4('0x5')];_0xa0c128<_0x53ea9b;_0xa0c128++){var _0x29d4a3=events[_0xa0c128];var _0x269685=createListener(_0xf2e4('0x6')+_0x29d4a3,_0x5a072b);ChatInternalMessageEvents['on'](_0x29d4a3,_0x269685);}};
\ No newline at end of file
+var _0x179b=['remove','update','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x179b,0x1e1));var _0xb179=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x179b[_0x2a55f8];return _0x245efd;};'use strict';var ChatInternalMessageEvents=require(_0xb179('0x0'));var events=[_0xb179('0x1'),_0xb179('0x2'),_0xb179('0x3')];function createListener(_0x1645bc,_0xe785c1){return function(_0x344b30){_0xe785c1['emit'](_0x1645bc,_0x344b30);};}function removeListener(_0x5a9107,_0x96eb8c){return function(){ChatInternalMessageEvents['removeListener'](_0x5a9107,_0x96eb8c);};}exports[_0xb179('0x4')]=function(_0x1f203d){for(var _0x25de37=0x0,_0x1e56be=events[_0xb179('0x5')];_0x25de37<_0x1e56be;_0x25de37++){var _0x23bee2=events[_0x25de37];var _0x4bbbed=createListener(_0xb179('0x6')+_0x23bee2,_0x1f203d);ChatInternalMessageEvents['on'](_0x23bee2,_0x4bbbed);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 4acab42..fc37ce4 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 _0xa0de=['isAuthenticated','get','/describe','describe','/users','getUsers','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','fs-extra','../../config/environment','./chatInternalMessage.controller'];(function(_0x49f59e,_0x3b3fce){var _0x1786a0=function(_0x5d51e8){while(--_0x5d51e8){_0x49f59e['push'](_0x49f59e['shift']());}};_0x1786a0(++_0x3b3fce);}(_0xa0de,0x1c3));var _0xea0d=function(_0x2ad159,_0x22b591){_0x2ad159=_0x2ad159-0x0;var _0x507651=_0xa0de[_0x2ad159];return _0x507651;};'use strict';var multer=require(_0xea0d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xea0d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xea0d('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xea0d('0x3'));var controller=require(_0xea0d('0x4'));router['get']('/',auth[_0xea0d('0x5')](),controller['index']);router[_0xea0d('0x6')](_0xea0d('0x7'),auth['isAuthenticated'](),controller[_0xea0d('0x8')]);router['get'](_0xea0d('0x9'),auth[_0xea0d('0x5')](),controller[_0xea0d('0xa')]);router[_0xea0d('0x6')](_0xea0d('0xb'),auth['isAuthenticated'](),controller[_0xea0d('0xc')]);router[_0xea0d('0xd')]('/',auth[_0xea0d('0x5')](),controller[_0xea0d('0xe')]);router[_0xea0d('0xf')](_0xea0d('0xb'),controller[_0xea0d('0x10')]);router[_0xea0d('0x11')](_0xea0d('0xb'),auth[_0xea0d('0x5')](),controller['destroy']);module[_0xea0d('0x12')]=router;
\ No newline at end of file
+var _0x616b=['create','put','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','/describe','isAuthenticated','getUsers','/:id'];(function(_0x124a88,_0x20514e){var _0x2b0d88=function(_0xe5d7bc){while(--_0xe5d7bc){_0x124a88['push'](_0x124a88['shift']());}};_0x2b0d88(++_0x20514e);}(_0x616b,0x1e5));var _0xb616=function(_0x2b365f,_0x17aa37){_0x2b365f=_0x2b365f-0x0;var _0x26b060=_0x616b[_0x2b365f];return _0x26b060;};'use strict';var multer=require('multer');var util=require(_0xb616('0x0'));var path=require('path');var timeout=require(_0xb616('0x1'));var express=require('express');var router=express[_0xb616('0x2')]();var fs_extra=require(_0xb616('0x3'));var auth=require(_0xb616('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb616('0x5'));router[_0xb616('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb616('0x7'),auth[_0xb616('0x8')](),controller['describe']);router[_0xb616('0x6')]('/users',auth[_0xb616('0x8')](),controller[_0xb616('0x9')]);router[_0xb616('0x6')](_0xb616('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb616('0x8')](),controller[_0xb616('0xb')]);router[_0xb616('0xc')](_0xb616('0xa'),controller[_0xb616('0xd')]);router[_0xb616('0xe')](_0xb616('0xa'),auth[_0xb616('0x8')](),controller[_0xb616('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 8d87eed..6094502 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 _0x0cfa=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0xc7a446,_0x555b8b){var _0x37ab03=function(_0x327204){while(--_0x327204){_0xc7a446['push'](_0xc7a446['shift']());}};_0x37ab03(++_0x555b8b);}(_0x0cfa,0x73));var _0xa0cf=function(_0x43317b,_0xc88025){_0x43317b=_0x43317b-0x0;var _0xaee277=_0x0cfa[_0x43317b];return _0xaee277;};'use strict';var Sequelize=require(_0xa0cf('0x0'));module[_0xa0cf('0x1')]={'body':{'type':Sequelize[_0xa0cf('0x2')](_0xa0cf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa0cf('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa0cf('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa0cf('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xa0cf('0x6')]},'providerName':{'type':Sequelize[_0xa0cf('0x7')]},'providerResponse':{'type':Sequelize[_0xa0cf('0x2')]}};
\ No newline at end of file
+var _0x6ea9=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3ac0e8,_0x3d51c1){var _0x23dcd2=function(_0x14d20e){while(--_0x14d20e){_0x3ac0e8['push'](_0x3ac0e8['shift']());}};_0x23dcd2(++_0x3d51c1);}(_0x6ea9,0x89));var _0x96ea=function(_0x1ed7d4,_0x4b17a5){_0x1ed7d4=_0x1ed7d4-0x0;var _0x488f90=_0x6ea9[_0x1ed7d4];return _0x488f90;};'use strict';var Sequelize=require(_0x96ea('0x0'));module[_0x96ea('0x1')]={'body':{'type':Sequelize[_0x96ea('0x2')](_0x96ea('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96ea('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x96ea('0x5')]('in',_0x96ea('0x6')),'defaultValue':_0x96ea('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x96ea('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 3ab387c..cdbc998 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 _0x8e74=['fullname','email','internal','interface','channel','motionChannel','event','EventManager','formData','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','count','limit','update','destroy','end','sendStatus','stack','name','index','ChatMessage','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','describe','accept','chat','reject','UserId','user','agent','get','ChatInteractionId','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8e74,0x189));var _0x48e7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e74[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0x48e7('0x0'));var Redis=require(_0x48e7('0x1'));var interactionService=require('../../components/interaction/service');var qs=require(_0x48e7('0x2'));var logger=require(_0x48e7('0x3'))('api');var config=require(_0x48e7('0x4'));var db=require(_0x48e7('0x5'))['db'];config[_0x48e7('0x6')]=_['defaults'](config[_0x48e7('0x6')],{'host':_0x48e7('0x7'),'port':0x18eb});var socket=require(_0x48e7('0x8'))(new Redis(config[_0x48e7('0x6')]));require(_0x48e7('0x9'))[_0x48e7('0xa')](socket);var jayson=require(_0x48e7('0xb'));var client=jayson[_0x48e7('0xc')][_0x48e7('0xd')]({'port':0x232c});var client9002=jayson[_0x48e7('0xc')][_0x48e7('0xd')]({'port':0x232a});var interaction_log=require(_0x48e7('0x3'))('chat-interactions');function respondWithRpcPromise(_0x3b0136,_0x4a7240,_0x48f10e,_0x279cba){return new Promise(function(_0x2ed224,_0x528b51){var _0x5ce0f8=_0x279cba||client;return _0x5ce0f8[_0x48e7('0xe')](_0x3b0136,_0x48f10e)[_0x48e7('0xf')](function(_0x3b0610){logger[_0x48e7('0x10')]('ChatMessage,\x20%s,\x20%s',_0x4a7240,_0x48e7('0x11'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4a7240,'request\x20sent',JSON['stringify'](_0x3b0610));if(_0x3b0610[_0x48e7('0x12')]){if(_0x3b0610[_0x48e7('0x12')][_0x48e7('0x13')]===0x1f4){logger[_0x48e7('0x12')](_0x48e7('0x14'),_0x4a7240,_0x3b0610[_0x48e7('0x12')][_0x48e7('0x15')]);return _0x528b51(_0x3b0610[_0x48e7('0x12')][_0x48e7('0x15')]);}logger[_0x48e7('0x12')](_0x48e7('0x14'),_0x4a7240,_0x3b0610[_0x48e7('0x12')][_0x48e7('0x15')]);return _0x2ed224(_0x3b0610[_0x48e7('0x12')][_0x48e7('0x15')]);}else{logger['info'](_0x48e7('0x14'),_0x4a7240,'request\x20sent');_0x2ed224(_0x3b0610[_0x48e7('0x16')][_0x48e7('0x15')]);}})[_0x48e7('0x17')](function(_0x3a2bb3){logger[_0x48e7('0x12')](_0x48e7('0x14'),_0x4a7240,_0x3a2bb3);_0x528b51(_0x3a2bb3);});});}function respondWithResult(_0x7cae1f,_0x38f21c){_0x38f21c=_0x38f21c||0xc8;return function(_0x59649f){if(_0x59649f){return _0x7cae1f[_0x48e7('0x18')](_0x38f21c)[_0x48e7('0x19')](_0x59649f);}};}function respondWithFilteredResult(_0x4d05ed,_0x472eea){return function(_0xbee7b4){if(_0xbee7b4){var _0x89b571=typeof _0x472eea[_0x48e7('0x1a')]===_0x48e7('0x1b')&&typeof _0x472eea['limit']==='undefined';var _0x445d0e=_0xbee7b4[_0x48e7('0x1c')];var _0x26da01=_0x89b571?0x0:_0x472eea[_0x48e7('0x1a')];var _0x513a3f=_0x89b571?_0xbee7b4[_0x48e7('0x1c')]:_0x472eea[_0x48e7('0x1a')]+_0x472eea[_0x48e7('0x1d')];var _0x2421c2;if(_0x513a3f>=_0x445d0e){_0x513a3f=_0x445d0e;_0x2421c2=0xc8;}else{_0x2421c2=0xce;}_0x4d05ed[_0x48e7('0x18')](_0x2421c2);return _0x4d05ed['set']('Content-Range',_0x26da01+'-'+_0x513a3f+'/'+_0x445d0e)[_0x48e7('0x19')](_0xbee7b4);}return null;};}function saveUpdates(_0x2f35e8){return function(_0x5b6b51){if(_0x5b6b51){return _0x5b6b51[_0x48e7('0x1e')](_0x2f35e8)['then'](function(_0x2cdf75){return _0x2cdf75;});}return null;};}function removeEntity(_0xf1b55b){return function(_0x6a7a7f){if(_0x6a7a7f){return _0x6a7a7f[_0x48e7('0x1f')]()[_0x48e7('0xf')](function(){_0xf1b55b[_0x48e7('0x18')](0xcc)[_0x48e7('0x20')]();});}};}function handleEntityNotFound(_0x1a6591){return function(_0x3ca412){if(!_0x3ca412){_0x1a6591[_0x48e7('0x21')](0x194);}return _0x3ca412;};}function handleError(_0x197274,_0x763e05){_0x763e05=_0x763e05||0x1f4;return function(_0x4acec0){logger['error'](_0x4acec0[_0x48e7('0x22')]);if(_0x4acec0['name']){delete _0x4acec0[_0x48e7('0x23')];}_0x197274['status'](_0x763e05)['send'](_0x4acec0);};}exports[_0x48e7('0x24')]=function(_0x5ffc66,_0x339a56){var _0x505923={},_0xb98a10={},_0x38a495={'count':0x0,'rows':[]};var _0x552061=_['map'](db[_0x48e7('0x25')]['rawAttributes'],function(_0x561e38){return{'name':_0x561e38[_0x48e7('0x26')],'type':_0x561e38[_0x48e7('0x27')][_0x48e7('0x28')]};});_0xb98a10[_0x48e7('0x29')]=_[_0x48e7('0x2a')](_0x552061,_0x48e7('0x23'));_0xb98a10[_0x48e7('0x2b')]=_[_0x48e7('0x2c')](_0x5ffc66['query']);_0xb98a10[_0x48e7('0x2d')]=_[_0x48e7('0x2e')](_0xb98a10[_0x48e7('0x29')],_0xb98a10[_0x48e7('0x2b')]);_0x505923[_0x48e7('0x2f')]=_[_0x48e7('0x2e')](_0xb98a10[_0x48e7('0x29')],qs[_0x48e7('0x30')](_0x5ffc66['query'][_0x48e7('0x30')]));_0x505923[_0x48e7('0x2f')]=_0x505923[_0x48e7('0x2f')]['length']?_0x505923[_0x48e7('0x2f')]:_0xb98a10['model'];if(!_0x5ffc66[_0x48e7('0x2b')]['hasOwnProperty'](_0x48e7('0x31'))){_0x505923['limit']=qs['limit'](_0x5ffc66[_0x48e7('0x2b')][_0x48e7('0x1d')]);_0x505923[_0x48e7('0x1a')]=qs[_0x48e7('0x1a')](_0x5ffc66[_0x48e7('0x2b')][_0x48e7('0x1a')]);}_0x505923[_0x48e7('0x32')]=qs[_0x48e7('0x33')](_0x5ffc66['query'][_0x48e7('0x33')]);_0x505923[_0x48e7('0x34')]=qs[_0x48e7('0x2d')](_[_0x48e7('0x35')](_0x5ffc66['query'],_0xb98a10[_0x48e7('0x2d')]),_0x552061);if(_0x5ffc66['query'][_0x48e7('0x36')]){_0x505923[_0x48e7('0x34')]=_[_0x48e7('0x37')](_0x505923[_0x48e7('0x34')],{'$or':_[_0x48e7('0x2a')](_0x552061,function(_0x395dad){if(_0x395dad[_0x48e7('0x27')]!=='VIRTUAL'){var _0x59b2b2={};_0x59b2b2[_0x395dad[_0x48e7('0x23')]]={'$like':'%'+_0x5ffc66[_0x48e7('0x2b')][_0x48e7('0x36')]+'%'};return _0x59b2b2;}})});}_0x505923=_['merge']({},_0x505923,_0x5ffc66['options']);var _0x52117d={'where':_0x505923['where']};return db['ChatMessage'][_0x48e7('0x1c')](_0x52117d)[_0x48e7('0xf')](function(_0x3a7128){_0x38a495[_0x48e7('0x1c')]=_0x3a7128;if(_0x5ffc66[_0x48e7('0x2b')][_0x48e7('0x38')]){_0x505923[_0x48e7('0x39')]=[{'all':!![]}];}return db['ChatMessage'][_0x48e7('0x3a')](_0x505923);})[_0x48e7('0xf')](function(_0x561876){_0x38a495[_0x48e7('0x3b')]=_0x561876;return _0x38a495;})[_0x48e7('0xf')](respondWithFilteredResult(_0x339a56,_0x505923))[_0x48e7('0x17')](handleError(_0x339a56,null));};exports[_0x48e7('0x3c')]=function(_0x412f3f,_0x3c8219){var _0xe0bddb={'raw':!![],'where':{'id':_0x412f3f['params']['id']}},_0x5120e7={};_0x5120e7[_0x48e7('0x29')]=_[_0x48e7('0x2c')](db[_0x48e7('0x25')][_0x48e7('0x3d')]);_0x5120e7['query']=_['keys'](_0x412f3f[_0x48e7('0x2b')]);_0x5120e7['filters']=_[_0x48e7('0x2e')](_0x5120e7[_0x48e7('0x29')],_0x5120e7[_0x48e7('0x2b')]);_0xe0bddb[_0x48e7('0x2f')]=_[_0x48e7('0x2e')](_0x5120e7['model'],qs[_0x48e7('0x30')](_0x412f3f[_0x48e7('0x2b')]['fields']));_0xe0bddb[_0x48e7('0x2f')]=_0xe0bddb['attributes']['length']?_0xe0bddb[_0x48e7('0x2f')]:_0x5120e7[_0x48e7('0x29')];if(_0x412f3f[_0x48e7('0x2b')][_0x48e7('0x38')]){_0xe0bddb[_0x48e7('0x39')]=[{'all':!![]}];}_0xe0bddb=_[_0x48e7('0x37')]({},_0xe0bddb,_0x412f3f['options']);return db[_0x48e7('0x25')][_0x48e7('0x3e')](_0xe0bddb)['then'](handleEntityNotFound(_0x3c8219,null))[_0x48e7('0xf')](respondWithResult(_0x3c8219,null))[_0x48e7('0x17')](handleError(_0x3c8219,null));};exports[_0x48e7('0x3f')]=function(_0x31bfd7,_0x2e4eb0){return db[_0x48e7('0x25')][_0x48e7('0x3f')](_0x31bfd7['body'],{})[_0x48e7('0xf')](respondWithResult(_0x2e4eb0,0xc9))['catch'](handleError(_0x2e4eb0,null));};exports[_0x48e7('0x1e')]=function(_0x21e58d,_0x4a1ab0){if(_0x21e58d[_0x48e7('0x40')]['id']){delete _0x21e58d[_0x48e7('0x40')]['id'];}return db['ChatMessage'][_0x48e7('0x3e')]({'where':{'id':_0x21e58d[_0x48e7('0x41')]['id']}})[_0x48e7('0xf')](handleEntityNotFound(_0x4a1ab0,null))[_0x48e7('0xf')](saveUpdates(_0x21e58d[_0x48e7('0x40')],null))[_0x48e7('0xf')](respondWithResult(_0x4a1ab0,null))[_0x48e7('0x17')](handleError(_0x4a1ab0,null));};exports[_0x48e7('0x1f')]=function(_0x3a6aa0,_0x599fd3){return db['ChatMessage'][_0x48e7('0x3e')]({'where':{'id':_0x3a6aa0[_0x48e7('0x41')]['id']}})[_0x48e7('0xf')](handleEntityNotFound(_0x599fd3,null))[_0x48e7('0xf')](removeEntity(_0x599fd3,null))['catch'](handleError(_0x599fd3,null));};exports[_0x48e7('0x42')]=function(_0x28859e,_0x2a9e03){return db[_0x48e7('0x25')][_0x48e7('0x42')]()['then'](respondWithResult(_0x2a9e03,null))['catch'](handleError(_0x2a9e03,null));};exports[_0x48e7('0x43')]=function(_0x473a16,_0x3ca4c9){var _0x4191c9=_0x48e7('0x44');return interactionService['acceptMessage'](_0x473a16,_0x4191c9)[_0x48e7('0xf')](respondWithResult(_0x3ca4c9,null))[_0x48e7('0x17')](handleError(_0x3ca4c9,null));};exports[_0x48e7('0x45')]=function(_0x4eeeee,_0x596ffd){var _0x26dfc7={'agent':{},'channel':_0x48e7('0x44')};if(_0x4eeeee[_0x48e7('0x40')]['id']){delete _0x4eeeee[_0x48e7('0x40')]['id'];}_0x4eeeee[_0x48e7('0x40')][_0x48e7('0x46')]=_0x4eeeee[_0x48e7('0x40')]['UserId']||_0x4eeeee[_0x48e7('0x47')]['id'];_0x26dfc7[_0x48e7('0x48')]['id']=_0x4eeeee[_0x48e7('0x40')][_0x48e7('0x46')];return db['ChatMessage'][_0x48e7('0x3e')]({'where':{'id':_0x4eeeee[_0x48e7('0x41')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x596ffd,null))['then'](function(_0x4d7a55){if(_0x4d7a55){_0x26dfc7[_0x48e7('0x15')]=_0x4d7a55[_0x48e7('0x49')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4d7a55[_0x48e7('0x4a')]}});}return null;})['then'](handleEntityNotFound(_0x596ffd,null))[_0x48e7('0xf')](function(_0x3e818b){if(_0x3e818b){_0x26dfc7[_0x48e7('0x4b')]=_0x3e818b['get']({'plain':!![]});interaction_log[_0x48e7('0x10')](_0x48e7('0x4c'),_0x4eeeee[_0x48e7('0x47')]['id'],_0x4eeeee[_0x48e7('0x47')][_0x48e7('0x23')],_0x4eeeee['user'][_0x48e7('0x4d')],_0x26dfc7[_0x48e7('0x4b')]['id'],_0x4eeeee[_0x48e7('0x40')]?JSON[_0x48e7('0x4e')](_0x4eeeee[_0x48e7('0x40')]):'null');return respondWithRpcPromise(_0x48e7('0x4f'),_0x48e7('0x50'),_0x26dfc7);}return null;})[_0x48e7('0xf')](function(_0x5b91b8){var _0x5a95a8=_0x48e7('0x51')+_0x5b91b8[_0x48e7('0x15')][_0x48e7('0x52')];return db[_0x48e7('0x53')][_0x48e7('0x2b')](_0x5a95a8,{'type':db['Sequelize'][_0x48e7('0x54')][_0x48e7('0x55')],'raw':!![]})['then'](function(_0x2b7913){return _0x2b7913;});})[_0x48e7('0xf')](function(_0x23b6b8){if(_0x23b6b8){_0x26dfc7[_0x48e7('0x15')]['contact']=_0x23b6b8[0x0];if(!_0x4eeeee[_0x48e7('0x40')]['UserId'])return;return db[_0x48e7('0x56')][_0x48e7('0x3e')]({'where':{'id':_0x4eeeee[_0x48e7('0x40')][_0x48e7('0x46')],'role':_0x48e7('0x48')},'attributes':['id','name',_0x48e7('0x57'),_0x48e7('0x58'),_0x48e7('0x59')],'raw':!![]});}return null;})[_0x48e7('0xf')](function(_0x30a8c7){if(!_0x30a8c7)return null;_0x26dfc7['message'][_0x48e7('0x48')]=_0x30a8c7;return _0x26dfc7;})[_0x48e7('0xf')](function(_0x1625b1){if(_0x1625b1){_0x1625b1['message'][_0x48e7('0x5a')]=util['format']('SIP/%s',_0x4eeeee[_0x48e7('0x47')][_0x48e7('0x23')]);_0x1625b1['message'][_0x48e7('0x5b')]=_0x26dfc7[_0x48e7('0x5b')];_0x1625b1[_0x48e7('0x15')][_0x48e7('0x5c')]=_0x26dfc7['channel'];_0x1625b1[_0x48e7('0x15')][_0x48e7('0x5d')]=_0x48e7('0x45');respondWithRpcPromise(_0x48e7('0x5e'),'EventManager',{'event':'rejectmessage','message':_[_0x48e7('0x37')](_0x26dfc7[_0x48e7('0x15')],JSON['parse'](_0x26dfc7['interaction'][_0x48e7('0x5f')]))},client9002);return _0x26dfc7;}return null;})[_0x48e7('0xf')](respondWithResult(_0x596ffd,null))[_0x48e7('0x17')](handleError(_0x596ffd,null));};
\ No newline at end of file
+var _0xc644=['findAll','rows','show','params','keys','intersection','includeAll','create','body','find','describe','accept','chat','reject','UserId','agent','get','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','email','internal','interface','format','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','util','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','chat-interactions','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','undefined','count','set','Content-Range','update','destroy','end','sendStatus','stack','send','index','ChatMessage','rawAttributes','fieldName','type','key','name','query','filters','attributes','fields','length','model','nolimit','limit','order','sort','where','filter','merge','options','include'];(function(_0x20737e,_0x3e70c0){var _0x4ade3c=function(_0x1d76a0){while(--_0x1d76a0){_0x20737e['push'](_0x20737e['shift']());}};_0x4ade3c(++_0x3e70c0);}(_0xc644,0x16d));var _0x4c64=function(_0x389a12,_0x41a036){_0x389a12=_0x389a12-0x0;var _0x1db8a9=_0xc644[_0x389a12];return _0x1db8a9;};'use strict';var util=require(_0x4c64('0x0'));var _=require('lodash');var Redis=require(_0x4c64('0x1'));var interactionService=require(_0x4c64('0x2'));var qs=require(_0x4c64('0x3'));var logger=require(_0x4c64('0x4'))(_0x4c64('0x5'));var config=require('../../config/environment');var db=require(_0x4c64('0x6'))['db'];config['redis']=_[_0x4c64('0x7')](config[_0x4c64('0x8')],{'host':_0x4c64('0x9'),'port':0x18eb});var socket=require(_0x4c64('0xa'))(new Redis(config[_0x4c64('0x8')]));require(_0x4c64('0xb'))[_0x4c64('0xc')](socket);var jayson=require(_0x4c64('0xd'));var client=jayson[_0x4c64('0xe')][_0x4c64('0xf')]({'port':0x232c});var client9002=jayson[_0x4c64('0xe')]['http']({'port':0x232a});var interaction_log=require(_0x4c64('0x4'))(_0x4c64('0x10'));function respondWithRpcPromise(_0x54d4a5,_0x3b4908,_0x29102a,_0x20b09a){return new Promise(function(_0x1cd328,_0x8f6351){var _0x355ae7=_0x20b09a||client;return _0x355ae7[_0x4c64('0x11')](_0x54d4a5,_0x29102a)[_0x4c64('0x12')](function(_0x40457b){logger[_0x4c64('0x13')](_0x4c64('0x14'),_0x3b4908,_0x4c64('0x15'));logger[_0x4c64('0x16')](_0x4c64('0x17'),_0x3b4908,'request\x20sent',JSON['stringify'](_0x40457b));if(_0x40457b[_0x4c64('0x18')]){if(_0x40457b['error']['code']===0x1f4){logger[_0x4c64('0x18')]('ChatMessage,\x20%s,\x20%s',_0x3b4908,_0x40457b['error']['message']);return _0x8f6351(_0x40457b[_0x4c64('0x18')][_0x4c64('0x19')]);}logger['error'](_0x4c64('0x14'),_0x3b4908,_0x40457b[_0x4c64('0x18')]['message']);return _0x1cd328(_0x40457b[_0x4c64('0x18')][_0x4c64('0x19')]);}else{logger[_0x4c64('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3b4908,_0x4c64('0x15'));_0x1cd328(_0x40457b[_0x4c64('0x1a')][_0x4c64('0x19')]);}})[_0x4c64('0x1b')](function(_0x23dd08){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3b4908,_0x23dd08);_0x8f6351(_0x23dd08);});});}function respondWithResult(_0x355653,_0x1fea22){_0x1fea22=_0x1fea22||0xc8;return function(_0x188471){if(_0x188471){return _0x355653[_0x4c64('0x1c')](_0x1fea22)[_0x4c64('0x1d')](_0x188471);}};}function respondWithFilteredResult(_0x171214,_0x559449){return function(_0x480e02){if(_0x480e02){var _0x16b9ea=typeof _0x559449[_0x4c64('0x1e')]==='undefined'&&typeof _0x559449['limit']===_0x4c64('0x1f');var _0x383918=_0x480e02['count'];var _0x368137=_0x16b9ea?0x0:_0x559449[_0x4c64('0x1e')];var _0x2b6fe8=_0x16b9ea?_0x480e02[_0x4c64('0x20')]:_0x559449[_0x4c64('0x1e')]+_0x559449['limit'];var _0x3f2ca1;if(_0x2b6fe8>=_0x383918){_0x2b6fe8=_0x383918;_0x3f2ca1=0xc8;}else{_0x3f2ca1=0xce;}_0x171214[_0x4c64('0x1c')](_0x3f2ca1);return _0x171214[_0x4c64('0x21')](_0x4c64('0x22'),_0x368137+'-'+_0x2b6fe8+'/'+_0x383918)['json'](_0x480e02);}return null;};}function saveUpdates(_0x54a3be){return function(_0x4a1f5a){if(_0x4a1f5a){return _0x4a1f5a[_0x4c64('0x23')](_0x54a3be)[_0x4c64('0x12')](function(_0x296004){return _0x296004;});}return null;};}function removeEntity(_0x583afd){return function(_0xfe8cba){if(_0xfe8cba){return _0xfe8cba[_0x4c64('0x24')]()[_0x4c64('0x12')](function(){_0x583afd[_0x4c64('0x1c')](0xcc)[_0x4c64('0x25')]();});}};}function handleEntityNotFound(_0x4f7f24){return function(_0x5dc6d1){if(!_0x5dc6d1){_0x4f7f24[_0x4c64('0x26')](0x194);}return _0x5dc6d1;};}function handleError(_0x26512c,_0x202b7c){_0x202b7c=_0x202b7c||0x1f4;return function(_0xa748ee){logger[_0x4c64('0x18')](_0xa748ee[_0x4c64('0x27')]);if(_0xa748ee['name']){delete _0xa748ee['name'];}_0x26512c[_0x4c64('0x1c')](_0x202b7c)[_0x4c64('0x28')](_0xa748ee);};}exports[_0x4c64('0x29')]=function(_0x5741fb,_0x1f1ef2){var _0x139259={},_0x15f8fa={},_0x42fe51={'count':0x0,'rows':[]};var _0x4cd347=_['map'](db[_0x4c64('0x2a')][_0x4c64('0x2b')],function(_0x467c4e){return{'name':_0x467c4e[_0x4c64('0x2c')],'type':_0x467c4e[_0x4c64('0x2d')][_0x4c64('0x2e')]};});_0x15f8fa['model']=_['map'](_0x4cd347,_0x4c64('0x2f'));_0x15f8fa[_0x4c64('0x30')]=_['keys'](_0x5741fb[_0x4c64('0x30')]);_0x15f8fa[_0x4c64('0x31')]=_['intersection'](_0x15f8fa['model'],_0x15f8fa[_0x4c64('0x30')]);_0x139259[_0x4c64('0x32')]=_['intersection'](_0x15f8fa['model'],qs[_0x4c64('0x33')](_0x5741fb['query'][_0x4c64('0x33')]));_0x139259[_0x4c64('0x32')]=_0x139259['attributes'][_0x4c64('0x34')]?_0x139259[_0x4c64('0x32')]:_0x15f8fa[_0x4c64('0x35')];if(!_0x5741fb[_0x4c64('0x30')]['hasOwnProperty'](_0x4c64('0x36'))){_0x139259['limit']=qs[_0x4c64('0x37')](_0x5741fb[_0x4c64('0x30')][_0x4c64('0x37')]);_0x139259['offset']=qs['offset'](_0x5741fb[_0x4c64('0x30')][_0x4c64('0x1e')]);}_0x139259[_0x4c64('0x38')]=qs['sort'](_0x5741fb['query'][_0x4c64('0x39')]);_0x139259[_0x4c64('0x3a')]=qs[_0x4c64('0x31')](_['pick'](_0x5741fb[_0x4c64('0x30')],_0x15f8fa['filters']),_0x4cd347);if(_0x5741fb['query'][_0x4c64('0x3b')]){_0x139259['where']=_[_0x4c64('0x3c')](_0x139259['where'],{'$or':_['map'](_0x4cd347,function(_0x4b75ff){if(_0x4b75ff[_0x4c64('0x2d')]!=='VIRTUAL'){var _0x3b55c8={};_0x3b55c8[_0x4b75ff[_0x4c64('0x2f')]]={'$like':'%'+_0x5741fb['query'][_0x4c64('0x3b')]+'%'};return _0x3b55c8;}})});}_0x139259=_['merge']({},_0x139259,_0x5741fb[_0x4c64('0x3d')]);var _0xb71d99={'where':_0x139259['where']};return db[_0x4c64('0x2a')][_0x4c64('0x20')](_0xb71d99)[_0x4c64('0x12')](function(_0x18202f){_0x42fe51['count']=_0x18202f;if(_0x5741fb[_0x4c64('0x30')]['includeAll']){_0x139259[_0x4c64('0x3e')]=[{'all':!![]}];}return db[_0x4c64('0x2a')][_0x4c64('0x3f')](_0x139259);})[_0x4c64('0x12')](function(_0x1f274c){_0x42fe51[_0x4c64('0x40')]=_0x1f274c;return _0x42fe51;})[_0x4c64('0x12')](respondWithFilteredResult(_0x1f1ef2,_0x139259))[_0x4c64('0x1b')](handleError(_0x1f1ef2,null));};exports[_0x4c64('0x41')]=function(_0x31229b,_0x39d79b){var _0x27eb80={'raw':!![],'where':{'id':_0x31229b[_0x4c64('0x42')]['id']}},_0x581477={};_0x581477['model']=_[_0x4c64('0x43')](db[_0x4c64('0x2a')][_0x4c64('0x2b')]);_0x581477[_0x4c64('0x30')]=_[_0x4c64('0x43')](_0x31229b[_0x4c64('0x30')]);_0x581477[_0x4c64('0x31')]=_['intersection'](_0x581477[_0x4c64('0x35')],_0x581477[_0x4c64('0x30')]);_0x27eb80[_0x4c64('0x32')]=_[_0x4c64('0x44')](_0x581477[_0x4c64('0x35')],qs[_0x4c64('0x33')](_0x31229b['query'][_0x4c64('0x33')]));_0x27eb80[_0x4c64('0x32')]=_0x27eb80[_0x4c64('0x32')][_0x4c64('0x34')]?_0x27eb80[_0x4c64('0x32')]:_0x581477['model'];if(_0x31229b['query'][_0x4c64('0x45')]){_0x27eb80[_0x4c64('0x3e')]=[{'all':!![]}];}_0x27eb80=_[_0x4c64('0x3c')]({},_0x27eb80,_0x31229b[_0x4c64('0x3d')]);return db['ChatMessage']['find'](_0x27eb80)['then'](handleEntityNotFound(_0x39d79b,null))['then'](respondWithResult(_0x39d79b,null))[_0x4c64('0x1b')](handleError(_0x39d79b,null));};exports['create']=function(_0x57c556,_0x2cc4f4){return db[_0x4c64('0x2a')][_0x4c64('0x46')](_0x57c556[_0x4c64('0x47')],{})[_0x4c64('0x12')](respondWithResult(_0x2cc4f4,0xc9))[_0x4c64('0x1b')](handleError(_0x2cc4f4,null));};exports[_0x4c64('0x23')]=function(_0x14e262,_0x35274c){if(_0x14e262[_0x4c64('0x47')]['id']){delete _0x14e262[_0x4c64('0x47')]['id'];}return db[_0x4c64('0x2a')][_0x4c64('0x48')]({'where':{'id':_0x14e262['params']['id']}})[_0x4c64('0x12')](handleEntityNotFound(_0x35274c,null))[_0x4c64('0x12')](saveUpdates(_0x14e262[_0x4c64('0x47')],null))[_0x4c64('0x12')](respondWithResult(_0x35274c,null))[_0x4c64('0x1b')](handleError(_0x35274c,null));};exports[_0x4c64('0x24')]=function(_0x3696e4,_0x188a79){return db[_0x4c64('0x2a')]['find']({'where':{'id':_0x3696e4[_0x4c64('0x42')]['id']}})['then'](handleEntityNotFound(_0x188a79,null))[_0x4c64('0x12')](removeEntity(_0x188a79,null))[_0x4c64('0x1b')](handleError(_0x188a79,null));};exports[_0x4c64('0x49')]=function(_0x205575,_0x44ede3){return db[_0x4c64('0x2a')][_0x4c64('0x49')]()[_0x4c64('0x12')](respondWithResult(_0x44ede3,null))[_0x4c64('0x1b')](handleError(_0x44ede3,null));};exports[_0x4c64('0x4a')]=function(_0x2ab73a,_0x533af9){var _0x159dbd=_0x4c64('0x4b');return interactionService['acceptMessage'](_0x2ab73a,_0x159dbd)['then'](respondWithResult(_0x533af9,null))[_0x4c64('0x1b')](handleError(_0x533af9,null));};exports[_0x4c64('0x4c')]=function(_0x18e79a,_0x586657){var _0x350a11={'agent':{},'channel':_0x4c64('0x4b')};if(_0x18e79a[_0x4c64('0x47')]['id']){delete _0x18e79a[_0x4c64('0x47')]['id'];}_0x18e79a['body'][_0x4c64('0x4d')]=_0x18e79a['body']['UserId']||_0x18e79a['user']['id'];_0x350a11[_0x4c64('0x4e')]['id']=_0x18e79a['body'][_0x4c64('0x4d')];return db[_0x4c64('0x2a')][_0x4c64('0x48')]({'where':{'id':_0x18e79a['params']['id'],'UserId':null}})[_0x4c64('0x12')](handleEntityNotFound(_0x586657,null))[_0x4c64('0x12')](function(_0x4ade66){if(_0x4ade66){_0x350a11[_0x4c64('0x19')]=_0x4ade66[_0x4c64('0x4f')]({'plain':!![]});return db[_0x4c64('0x50')][_0x4c64('0x48')]({'where':{'id':_0x4ade66[_0x4c64('0x51')]}});}return null;})[_0x4c64('0x12')](handleEntityNotFound(_0x586657,null))[_0x4c64('0x12')](function(_0x22c67e){if(_0x22c67e){_0x350a11['interaction']=_0x22c67e['get']({'plain':!![]});interaction_log[_0x4c64('0x13')](_0x4c64('0x52'),_0x18e79a['user']['id'],_0x18e79a[_0x4c64('0x53')][_0x4c64('0x2f')],_0x18e79a[_0x4c64('0x53')][_0x4c64('0x54')],_0x350a11[_0x4c64('0x55')]['id'],_0x18e79a[_0x4c64('0x47')]?JSON[_0x4c64('0x56')](_0x18e79a[_0x4c64('0x47')]):_0x4c64('0x57'));return respondWithRpcPromise(_0x4c64('0x58'),_0x4c64('0x59'),_0x350a11);}return null;})['then'](function(_0x26843d){var _0x2bae69=_0x4c64('0x5a')+_0x26843d[_0x4c64('0x19')]['ContactId'];return db[_0x4c64('0x5b')]['query'](_0x2bae69,{'type':db[_0x4c64('0x5c')]['QueryTypes'][_0x4c64('0x5d')],'raw':!![]})[_0x4c64('0x12')](function(_0x1a0422){return _0x1a0422;});})[_0x4c64('0x12')](function(_0x5a4d02){if(_0x5a4d02){_0x350a11[_0x4c64('0x19')][_0x4c64('0x5e')]=_0x5a4d02[0x0];if(!_0x18e79a[_0x4c64('0x47')][_0x4c64('0x4d')])return;return db[_0x4c64('0x5f')][_0x4c64('0x48')]({'where':{'id':_0x18e79a['body'][_0x4c64('0x4d')],'role':_0x4c64('0x4e')},'attributes':['id',_0x4c64('0x2f'),'fullname',_0x4c64('0x60'),_0x4c64('0x61')],'raw':!![]});}return null;})[_0x4c64('0x12')](function(_0x11366f){if(!_0x11366f)return null;_0x350a11[_0x4c64('0x19')][_0x4c64('0x4e')]=_0x11366f;return _0x350a11;})[_0x4c64('0x12')](function(_0x5ee0ef){if(_0x5ee0ef){_0x5ee0ef['message'][_0x4c64('0x62')]=util[_0x4c64('0x63')](_0x4c64('0x64'),_0x18e79a[_0x4c64('0x53')]['name']);_0x5ee0ef[_0x4c64('0x19')]['channel']=_0x350a11[_0x4c64('0x65')];_0x5ee0ef[_0x4c64('0x19')][_0x4c64('0x66')]=_0x350a11['channel'];_0x5ee0ef['message'][_0x4c64('0x67')]='reject';respondWithRpcPromise(_0x4c64('0x68'),_0x4c64('0x68'),{'event':'rejectmessage','message':_[_0x4c64('0x3c')](_0x350a11[_0x4c64('0x19')],JSON[_0x4c64('0x69')](_0x350a11[_0x4c64('0x55')][_0x4c64('0x6a')]))},client9002);return _0x350a11;}return null;})[_0x4c64('0x12')](respondWithResult(_0x586657,null))[_0x4c64('0x1b')](handleError(_0x586657,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index fc04452..2b1dfd0 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 _0x0769=['hook','exports','events','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0769,0xda));var _0x9076=function(_0x204587,_0x3e40c2){_0x204587=_0x204587-0x0;var _0x224eb0=_0x0769[_0x204587];return _0x224eb0;};'use strict';var EventEmitter=require(_0x9076('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x9076('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9076('0x2')](0x0);var events={'afterCreate':_0x9076('0x3'),'afterUpdate':_0x9076('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e3b88){return function(_0x55b70b,_0x4215e4,_0x2c435a){ChatMessageEvents[_0x9076('0x5')](_0x2e3b88+':'+_0x55b70b['id'],_0x55b70b);ChatMessageEvents[_0x9076('0x5')](_0x2e3b88,_0x55b70b);_0x2c435a(null);};}for(var e in events){if(events[_0x9076('0x6')](e)){var event=events[e];ChatMessage[_0x9076('0x7')](e,emitEvent(event));}}module[_0x9076('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xdb56=['ChatMessage','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x473bdc,_0x28ecf9){var _0x1478fd=function(_0x2fed7e){while(--_0x2fed7e){_0x473bdc['push'](_0x473bdc['shift']());}};_0x1478fd(++_0x28ecf9);}(_0xdb56,0xec));var _0x6db5=function(_0x291a25,_0x31ae01){_0x291a25=_0x291a25-0x0;var _0x380fab=_0xdb56[_0x291a25];return _0x380fab;};'use strict';var EventEmitter=require(_0x6db5('0x0'));var ChatMessage=require(_0x6db5('0x1'))['db'][_0x6db5('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6db5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x19e9d0){return function(_0x16a695,_0x988334,_0x5c6a9b){ChatMessageEvents[_0x6db5('0x4')](_0x19e9d0+':'+_0x16a695['id'],_0x16a695);ChatMessageEvents[_0x6db5('0x4')](_0x19e9d0,_0x16a695);_0x5c6a9b(null);};}for(var e in events){if(events[_0x6db5('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x6db5('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 005794c..76f6d87 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 _0xd772=['../../config/logger','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','util'];(function(_0x4b7c2a,_0x3de9a8){var _0x405fe6=function(_0x56a583){while(--_0x56a583){_0x4b7c2a['push'](_0x4b7c2a['shift']());}};_0x405fe6(++_0x3de9a8);}(_0xd772,0xd7));var _0x2d77=function(_0x4f0853,_0x13791a){_0x4f0853=_0x4f0853-0x0;var _0x59c809=_0xd772[_0x4f0853];return _0x59c809;};'use strict';var _=require('lodash');var util=require(_0x2d77('0x0'));var logger=require(_0x2d77('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2d77('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d77('0x3'));var rimraf=require(_0x2d77('0x4'));var config=require(_0x2d77('0x5'));var attributes=require(_0x2d77('0x6'));module['exports']=function(_0x2a7860,_0x1ad986){return _0x2a7860[_0x2d77('0x7')]('ChatMessage',attributes,{'tableName':_0x2d77('0x8'),'paranoid':![],'indexes':[{'name':_0x2d77('0x9'),'fields':['body'],'type':_0x2d77('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20f8ad,_0x27f698,_0x1b798a){var _0x559bbc=_0x2a7860[_0x2d77('0xb')];var _0x4b78c=_0x20f8ad[_0x2d77('0xc')]({'plain':!![]});if(_0x4b78c[_0x2d77('0xd')][_0x2d77('0xe')]()==='in'||_0x4b78c[_0x2d77('0xd')][_0x2d77('0xe')]()===_0x2d77('0xf')&&!_0x4b78c['secret']&&!_[_0x2d77('0x10')](_0x4b78c[_0x2d77('0x11')])){_0x559bbc[_0x2d77('0x12')][_0x2d77('0x13')]({'where':{'id':_0x4b78c[_0x2d77('0x14')]}})[_0x2d77('0x15')](function(_0x431d5c){if(_0x431d5c){_0x431d5c[_0x2d77('0x16')]({'lastMsgAt':_0x4b78c[_0x2d77('0x17')],'lastMsgDirection':_0x4b78c[_0x2d77('0xd')][_0x2d77('0xe')]()});}})[_0x2d77('0x18')](function(_0x29d308){console[_0x2d77('0x19')](_0x29d308);});}_0x1b798a();}},'charset':_0x2d77('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3b0d=['../../config/environment','./chatMessage.attributes','exports','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','rimraf'];(function(_0x5536e8,_0x3ff64d){var _0x277a3b=function(_0x30b13b){while(--_0x30b13b){_0x5536e8['push'](_0x5536e8['shift']());}};_0x277a3b(++_0x3ff64d);}(_0x3b0d,0x1db));var _0xd3b0=function(_0x1cacd0,_0x574d30){_0x1cacd0=_0x1cacd0-0x0;var _0x4a2df2=_0x3b0d[_0x1cacd0];return _0x4a2df2;};'use strict';var _=require('lodash');var util=require(_0xd3b0('0x0'));var logger=require('../../config/logger')(_0xd3b0('0x1'));var moment=require(_0xd3b0('0x2'));var BPromise=require('bluebird');var rp=require(_0xd3b0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3b0('0x4'));var config=require(_0xd3b0('0x5'));var attributes=require(_0xd3b0('0x6'));module[_0xd3b0('0x7')]=function(_0xfca637,_0x10d7db){return _0xfca637['define']('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xd3b0('0x8'),'fields':[_0xd3b0('0x9')],'type':_0xd3b0('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3dee3e,_0x13553b,_0x37da08){var _0x183d94=_0xfca637[_0xd3b0('0xb')];var _0x1ab897=_0x3dee3e[_0xd3b0('0xc')]({'plain':!![]});if(_0x1ab897[_0xd3b0('0xd')][_0xd3b0('0xe')]()==='in'||_0x1ab897[_0xd3b0('0xd')][_0xd3b0('0xe')]()==='out'&&!_0x1ab897[_0xd3b0('0xf')]&&!_['isNil'](_0x1ab897['UserId'])){_0x183d94['ChatInteraction'][_0xd3b0('0x10')]({'where':{'id':_0x1ab897[_0xd3b0('0x11')]}})[_0xd3b0('0x12')](function(_0x4e8baa){if(_0x4e8baa){_0x4e8baa[_0xd3b0('0x13')]({'lastMsgAt':_0x1ab897[_0xd3b0('0x14')],'lastMsgDirection':_0x1ab897[_0xd3b0('0xd')]['toLowerCase']()});}})[_0xd3b0('0x15')](function(_0x2d2177){console['error'](_0x2d2177);});}_0x37da08();}},'charset':_0xd3b0('0x16'),'collate':_0xd3b0('0x17')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 7c9b380..47295a9 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 _0x18e9=['http','defaults','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','create','body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x59747c,_0x4de5fc){var _0x5b7e3a=function(_0x58741c){while(--_0x58741c){_0x59747c['push'](_0x59747c['shift']());}};_0x5b7e3a(++_0x4de5fc);}(_0x18e9,0x1e5));var _0x918e=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0x18e9[_0x3a3c17];return _0xd07f21;};'use strict';var _=require(_0x918e('0x0'));var util=require(_0x918e('0x1'));var moment=require(_0x918e('0x2'));var BPromise=require(_0x918e('0x3'));var rs=require(_0x918e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x918e('0x5'))['db'];var utils=require(_0x918e('0x6'));var logger=require('../../config/logger')(_0x918e('0x7'));var config=require('../../config/environment');var jayson=require(_0x918e('0x8'));var client=jayson[_0x918e('0x9')][_0x918e('0xa')]({'port':0x232a});config['redis']=_[_0x918e('0xb')](config[_0x918e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x918e('0xd'))(new Redis(config[_0x918e('0xc')]));require(_0x918e('0xe'))[_0x918e('0xf')](socket);function respondWithRpcPromise(_0x2a7a5a,_0x335f8b,_0x403dd2){return new BPromise(function(_0x11510a,_0x545ed1){return client[_0x918e('0x10')](_0x2a7a5a,_0x403dd2)[_0x918e('0x11')](function(_0x5a8390){logger[_0x918e('0x12')]('ChatMessage,\x20%s,\x20%s',_0x335f8b,_0x918e('0x13'));logger[_0x918e('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x335f8b,_0x918e('0x13'),JSON[_0x918e('0x15')](_0x5a8390));if(_0x5a8390[_0x918e('0x16')]){if(_0x5a8390[_0x918e('0x16')][_0x918e('0x17')]===0x1f4){logger[_0x918e('0x16')](_0x918e('0x18'),_0x335f8b,_0x5a8390['error']['message']);return _0x545ed1(_0x5a8390[_0x918e('0x16')][_0x918e('0x19')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x335f8b,_0x5a8390[_0x918e('0x16')][_0x918e('0x19')]);return _0x11510a(_0x5a8390[_0x918e('0x16')]['message']);}else{logger[_0x918e('0x12')](_0x918e('0x18'),_0x335f8b,'request\x20sent');_0x11510a(_0x5a8390[_0x918e('0x1a')]['message']);}})[_0x918e('0x1b')](function(_0x38a621){logger[_0x918e('0x16')](_0x918e('0x18'),_0x335f8b,_0x38a621);_0x545ed1(_0x38a621);});});}exports['CreateChatMessage']=function(_0x2aa152){var _0x218862=this;return new Promise(function(_0x6f2728,_0x1d8777){return db['ChatMessage'][_0x918e('0x1c')](_0x2aa152[_0x918e('0x1d')],{'raw':_0x2aa152[_0x918e('0x1e')]?_0x2aa152[_0x918e('0x1e')][_0x918e('0x1f')]===undefined?!![]:![]:!![]})[_0x918e('0x11')](function(_0x41968e){logger[_0x918e('0x12')](_0x918e('0x20'),_0x2aa152);logger[_0x918e('0x14')](_0x918e('0x20'),_0x2aa152,JSON[_0x918e('0x15')](_0x41968e));_0x6f2728(_0x41968e);})[_0x918e('0x1b')](function(_0x3b7e92){logger[_0x918e('0x16')](_0x918e('0x20'),_0x3b7e92[_0x918e('0x19')],_0x2aa152);_0x1d8777(_0x218862[_0x918e('0x16')](0x1f4,_0x3b7e92[_0x918e('0x19')]));});});};
\ No newline at end of file
+var _0x28e4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','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','util','moment','randomstring'];(function(_0x35a041,_0x955e98){var _0x4b9efd=function(_0x2fa4be){while(--_0x2fa4be){_0x35a041['push'](_0x35a041['shift']());}};_0x4b9efd(++_0x955e98);}(_0x28e4,0x81));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x428e('0x0'));var moment=require(_0x428e('0x1'));var BPromise=require('bluebird');var rs=require(_0x428e('0x2'));var fs=require('fs');var Redis=require(_0x428e('0x3'));var db=require(_0x428e('0x4'))['db'];var utils=require(_0x428e('0x5'));var logger=require(_0x428e('0x6'))(_0x428e('0x7'));var config=require(_0x428e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x428e('0x9')][_0x428e('0xa')]({'port':0x232a});config[_0x428e('0xb')]=_[_0x428e('0xc')](config[_0x428e('0xb')],{'host':_0x428e('0xd'),'port':0x18eb});var socket=require(_0x428e('0xe'))(new Redis(config[_0x428e('0xb')]));require(_0x428e('0xf'))[_0x428e('0x10')](socket);function respondWithRpcPromise(_0x4641d3,_0x21ece0,_0xc8afd7){return new BPromise(function(_0x76b197,_0x1ae465){return client[_0x428e('0x11')](_0x4641d3,_0xc8afd7)['then'](function(_0x2e621b){logger[_0x428e('0x12')](_0x428e('0x13'),_0x21ece0,_0x428e('0x14'));logger[_0x428e('0x15')](_0x428e('0x16'),_0x21ece0,_0x428e('0x14'),JSON[_0x428e('0x17')](_0x2e621b));if(_0x2e621b[_0x428e('0x18')]){if(_0x2e621b[_0x428e('0x18')][_0x428e('0x19')]===0x1f4){logger[_0x428e('0x18')](_0x428e('0x13'),_0x21ece0,_0x2e621b[_0x428e('0x18')][_0x428e('0x1a')]);return _0x1ae465(_0x2e621b[_0x428e('0x18')][_0x428e('0x1a')]);}logger[_0x428e('0x18')](_0x428e('0x13'),_0x21ece0,_0x2e621b[_0x428e('0x18')][_0x428e('0x1a')]);return _0x76b197(_0x2e621b[_0x428e('0x18')][_0x428e('0x1a')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x21ece0,'request\x20sent');_0x76b197(_0x2e621b[_0x428e('0x1b')][_0x428e('0x1a')]);}})[_0x428e('0x1c')](function(_0x3e929a){logger[_0x428e('0x18')](_0x428e('0x13'),_0x21ece0,_0x3e929a);_0x1ae465(_0x3e929a);});});}exports[_0x428e('0x1d')]=function(_0x4de3ca){var _0x4dd0a3=this;return new Promise(function(_0x35a568,_0x25b1a1){return db['ChatMessage'][_0x428e('0x1e')](_0x4de3ca[_0x428e('0x1f')],{'raw':_0x4de3ca[_0x428e('0x20')]?_0x4de3ca[_0x428e('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53d482){logger[_0x428e('0x12')](_0x428e('0x1d'),_0x4de3ca);logger[_0x428e('0x15')](_0x428e('0x1d'),_0x4de3ca,JSON['stringify'](_0x53d482));_0x35a568(_0x53d482);})[_0x428e('0x1c')](function(_0x5ec409){logger[_0x428e('0x18')](_0x428e('0x1d'),_0x5ec409[_0x428e('0x1a')],_0x4de3ca);_0x25b1a1(_0x4dd0a3[_0x428e('0x18')](0x1f4,_0x5ec409[_0x428e('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index d96d231..593b920 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 _0x1c3b=['removeListener','./chatMessage.events','save','remove','emit'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x1c3b,0xab));var _0xb1c3=function(_0x514c64,_0x29a704){_0x514c64=_0x514c64-0x0;var _0x5b0287=_0x1c3b[_0x514c64];return _0x5b0287;};'use strict';var ChatMessageEvents=require(_0xb1c3('0x0'));var events=[_0xb1c3('0x1'),_0xb1c3('0x2'),'update'];function createListener(_0x4eeac2,_0x28a375){return function(_0x89ce0b){_0x28a375[_0xb1c3('0x3')](_0x4eeac2,_0x89ce0b);};}function removeListener(_0x34dbb5,_0x24d4c0){return function(){ChatMessageEvents[_0xb1c3('0x4')](_0x34dbb5,_0x24d4c0);};}exports['register']=function(_0x472813){for(var _0x62da34=0x0,_0x211254=events['length'];_0x62da34<_0x211254;_0x62da34++){var _0x504fc9=events[_0x62da34];var _0x4ed6cf=createListener('chatMessage:'+_0x504fc9,_0x472813);ChatMessageEvents['on'](_0x504fc9,_0x4ed6cf);}};
\ No newline at end of file
+var _0xabce=['chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x24254e,_0x5a29d0){var _0x180cdb=function(_0x2c59ae){while(--_0x2c59ae){_0x24254e['push'](_0x24254e['shift']());}};_0x180cdb(++_0x5a29d0);}(_0xabce,0x103));var _0xeabc=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xabce[_0xdc37a1];return _0x99b4fe;};'use strict';var ChatMessageEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){ChatMessageEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);ChatMessageEvents['on'](_0x3bdc29,_0x9417af);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 013c146..bdd7899 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 _0x57a6=['../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','reject','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x310ab4,_0x525c3e){var _0x28dfbb=function(_0x18820a){while(--_0x18820a){_0x310ab4['push'](_0x310ab4['shift']());}};_0x28dfbb(++_0x525c3e);}(_0x57a6,0x172));var _0x657a=function(_0x2ba9aa,_0x2cdb8f){_0x2ba9aa=_0x2ba9aa-0x0;var _0x4b753b=_0x57a6[_0x2ba9aa];return _0x4b753b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x657a('0x0'));var express=require(_0x657a('0x1'));var router=express[_0x657a('0x2')]();var fs_extra=require(_0x657a('0x3'));var auth=require(_0x657a('0x4'));var interaction=require(_0x657a('0x5'));var config=require(_0x657a('0x6'));var controller=require(_0x657a('0x7'));router['get']('/',auth[_0x657a('0x8')](),controller[_0x657a('0x9')]);router[_0x657a('0xa')](_0x657a('0xb'),auth['isAuthenticated'](),controller[_0x657a('0xc')]);router[_0x657a('0xa')](_0x657a('0xd'),auth[_0x657a('0x8')](),controller[_0x657a('0xe')]);router['post']('/',auth[_0x657a('0x8')](),interaction[_0x657a('0xf')](_0x657a('0x10'),_0x657a('0x11')),controller['create']);router[_0x657a('0x12')](_0x657a('0xd'),controller[_0x657a('0x13')]);router[_0x657a('0x12')](_0x657a('0x14'),auth[_0x657a('0x8')](),controller[_0x657a('0x15')]);router[_0x657a('0x12')]('/:id/reject',auth[_0x657a('0x8')](),controller[_0x657a('0x16')]);router[_0x657a('0x17')](_0x657a('0xd'),auth[_0x657a('0x8')](),controller[_0x657a('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x0e33=['accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','post','tracked','chatmessage:create','put','update'];(function(_0x3322a0,_0xc75fc7){var _0x15be8e=function(_0x44983b){while(--_0x44983b){_0x3322a0['push'](_0x3322a0['shift']());}};_0x15be8e(++_0xc75fc7);}(_0x0e33,0x119));var _0x30e3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0e33[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x30e3('0x0'));var util=require(_0x30e3('0x1'));var path=require('path');var timeout=require(_0x30e3('0x2'));var express=require(_0x30e3('0x3'));var router=express['Router']();var fs_extra=require(_0x30e3('0x4'));var auth=require(_0x30e3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x30e3('0x6'));var controller=require(_0x30e3('0x7'));router[_0x30e3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x30e3('0x8')](_0x30e3('0x9'),auth['isAuthenticated'](),controller[_0x30e3('0xa')]);router[_0x30e3('0x8')](_0x30e3('0xb'),auth[_0x30e3('0xc')](),controller[_0x30e3('0xd')]);router[_0x30e3('0xe')]('/',auth[_0x30e3('0xc')](),interaction[_0x30e3('0xf')]('chat',_0x30e3('0x10')),controller['create']);router[_0x30e3('0x11')]('/:id',controller[_0x30e3('0x12')]);router['put']('/:id/accept',auth[_0x30e3('0xc')](),controller[_0x30e3('0x13')]);router[_0x30e3('0x11')](_0x30e3('0x14'),auth['isAuthenticated'](),controller[_0x30e3('0x15')]);router[_0x30e3('0x16')]('/:id',auth[_0x30e3('0xc')](),controller[_0x30e3('0x17')]);module[_0x30e3('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 1b27ca6..459772f 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x267bc6,_0x1843a7){var _0x14856c=function(_0x37e51f){while(--_0x37e51f){_0x267bc6['push'](_0x267bc6['shift']());}};_0x14856c(++_0x1843a7);}(_0xdb28,0x106));var _0x8db2=function(_0x294136,_0xf5c874){_0x294136=_0x294136-0x0;var _0x1498a4=_0xdb28[_0x294136];return _0x1498a4;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x3da776,_0x1279e9){var _0x4bb9fb=function(_0x2e81aa){while(--_0x2e81aa){_0x3da776['push'](_0x3da776['shift']());}};_0x4bb9fb(++_0x1279e9);}(_0xdb28,0x106));var _0x8db2=function(_0x1a40e1,_0x48372f){_0x1a40e1=_0x1a40e1-0x0;var _0x53c3cc=_0xdb28[_0x1a40e1];return _0x53c3cc;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 55c88d1..8c80d45 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(_0x27e8c4,_0x1b4f89){var _0x519f5a=function(_0x34d70b){while(--_0x34d70b){_0x27e8c4['push'](_0x27e8c4['shift']());}};_0x519f5a(++_0x1b4f89);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0x136b08,_0x2ec4c5){var _0x5239d2=function(_0xbcf2cc){while(--_0xbcf2cc){_0x136b08['push'](_0x136b08['shift']());}};_0x5239d2(++_0x2ec4c5);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 7a5c352..308899c 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 _0x26e9=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','save'];(function(_0xa84996,_0x16c698){var _0x1b9325=function(_0x4f2a31){while(--_0x4f2a31){_0xa84996['push'](_0xa84996['shift']());}};_0x1b9325(++_0x16c698);}(_0x26e9,0x1a2));var _0x926e=function(_0x3113b1,_0x42646c){_0x3113b1=_0x3113b1-0x0;var _0x4d45a8=_0x26e9[_0x3113b1];return _0x4d45a8;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x926e('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x926e('0x1'),'afterUpdate':_0x926e('0x2'),'afterDestroy':'remove'};function emitEvent(_0x37c0ca){return function(_0x2308af,_0x1e2798,_0x554f3a){ChatOfflineMessageEvents[_0x926e('0x3')](_0x37c0ca+':'+_0x2308af['id'],_0x2308af);ChatOfflineMessageEvents[_0x926e('0x3')](_0x37c0ca,_0x2308af);_0x554f3a(null);};}for(var e in events){if(events[_0x926e('0x4')](e)){var event=events[e];ChatOfflineMessage[_0x926e('0x5')](e,emitEvent(event));}}module[_0x926e('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x4734=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x22ed4b,_0x5c80ef){var _0x4309fa=function(_0x5065e2){while(--_0x5065e2){_0x22ed4b['push'](_0x22ed4b['shift']());}};_0x4309fa(++_0x5c80ef);}(_0x4734,0x87));var _0x4473=function(_0x55b3f6,_0x4b03cf){_0x55b3f6=_0x55b3f6-0x0;var _0x1b7ede=_0x4734[_0x55b3f6];return _0x1b7ede;};'use strict';var EventEmitter=require(_0x4473('0x0'));var ChatOfflineMessage=require(_0x4473('0x1'))['db'][_0x4473('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4473('0x3')](0x0);var events={'afterCreate':_0x4473('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x433ab9){return function(_0x2c13d3,_0x58f2e4,_0xfab7bf){ChatOfflineMessageEvents[_0x4473('0x5')](_0x433ab9+':'+_0x2c13d3['id'],_0x2c13d3);ChatOfflineMessageEvents[_0x4473('0x5')](_0x433ab9,_0x2c13d3);_0xfab7bf(null);};}for(var e in events){if(events[_0x4473('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x4473('0x7')](e,emitEvent(event));}}module[_0x4473('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 394a0fe..e9f25b4 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 _0x8099=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x487eeb,_0x120b41){var _0x34917b=function(_0x4d0ab0){while(--_0x4d0ab0){_0x487eeb['push'](_0x487eeb['shift']());}};_0x34917b(++_0x120b41);}(_0x8099,0x91));var _0x9809=function(_0x2e010c,_0x1819a2){_0x2e010c=_0x2e010c-0x0;var _0x1b19d9=_0x8099[_0x2e010c];return _0x1b19d9;};'use strict';var attributes=require(_0x9809('0x0'));module[_0x9809('0x1')]=function(_0x29969e){return _0x29969e['define'](_0x9809('0x2'),attributes,{'tableName':_0x9809('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9809('0x4'),'collate':_0x9809('0x5')});};
\ No newline at end of file
+var _0x3682=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x44606e,_0x2bf244){var _0xe68388=function(_0x488a30){while(--_0x488a30){_0x44606e['push'](_0x44606e['shift']());}};_0xe68388(++_0x2bf244);}(_0x3682,0x95));var _0x2368=function(_0xf7ff4,_0x543a19){_0xf7ff4=_0xf7ff4-0x0;var _0x554e6a=_0x3682[_0xf7ff4];return _0x554e6a;};'use strict';var attributes=require(_0x2368('0x0'));module[_0x2368('0x1')]=function(_0x4ea49e){return _0x4ea49e[_0x2368('0x2')](_0x2368('0x3'),attributes,{'tableName':_0x2368('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2368('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7710cc1..39962c3 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 _0x39c7=['stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x39c7,0x85));var _0x739c=function(_0xb5b557,_0x4a4eae){_0xb5b557=_0xb5b557-0x0;var _0x4a1090=_0x39c7[_0xb5b557];return _0x4a1090;};'use strict';var _=require('lodash');var util=require(_0x739c('0x0'));var moment=require(_0x739c('0x1'));var BPromise=require(_0x739c('0x2'));var rs=require(_0x739c('0x3'));var fs=require('fs');var Redis=require(_0x739c('0x4'));var db=require(_0x739c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x739c('0x6'))(_0x739c('0x7'));var config=require(_0x739c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x739c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c0af1,_0x5df5d3,_0x480159){return new BPromise(function(_0x27c5a4,_0x3475f2){return client['request'](_0x3c0af1,_0x480159)[_0x739c('0xa')](function(_0x277f61){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5df5d3,_0x739c('0xb'));logger[_0x739c('0xc')](_0x739c('0xd'),_0x5df5d3,_0x739c('0xb'),JSON[_0x739c('0xe')](_0x277f61));if(_0x277f61[_0x739c('0xf')]){if(_0x277f61[_0x739c('0xf')][_0x739c('0x10')]===0x1f4){logger[_0x739c('0xf')](_0x739c('0x11'),_0x5df5d3,_0x277f61[_0x739c('0xf')][_0x739c('0x12')]);return _0x3475f2(_0x277f61['error'][_0x739c('0x12')]);}logger[_0x739c('0xf')](_0x739c('0x11'),_0x5df5d3,_0x277f61[_0x739c('0xf')][_0x739c('0x12')]);return _0x27c5a4(_0x277f61[_0x739c('0xf')][_0x739c('0x12')]);}else{logger[_0x739c('0x13')](_0x739c('0x11'),_0x5df5d3,_0x739c('0xb'));_0x27c5a4(_0x277f61['result']['message']);}})[_0x739c('0x14')](function(_0x23888d){logger[_0x739c('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5df5d3,_0x23888d);_0x3475f2(_0x23888d);});});}
\ No newline at end of file
+var _0x80ce=['code','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x5793e2,_0x430100){var _0x37776b=function(_0xb30111){while(--_0xb30111){_0x5793e2['push'](_0x5793e2['shift']());}};_0x37776b(++_0x430100);}(_0x80ce,0xae));var _0xe80c=function(_0x264d47,_0x2c97c6){_0x264d47=_0x264d47-0x0;var _0x5a3414=_0x80ce[_0x264d47];return _0x5a3414;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe80c('0x0'));var rs=require(_0xe80c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe80c('0x2'))['db'];var utils=require(_0xe80c('0x3'));var logger=require(_0xe80c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe80c('0x5')][_0xe80c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x320a7e,_0x704aa3,_0x591a4a){return new BPromise(function(_0x4da07c,_0x1fdd3b){return client[_0xe80c('0x7')](_0x320a7e,_0x591a4a)['then'](function(_0x104665){logger[_0xe80c('0x8')](_0xe80c('0x9'),_0x704aa3,_0xe80c('0xa'));logger[_0xe80c('0xb')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x704aa3,'request\x20sent',JSON['stringify'](_0x104665));if(_0x104665[_0xe80c('0xc')]){if(_0x104665[_0xe80c('0xc')][_0xe80c('0xd')]===0x1f4){logger[_0xe80c('0xc')](_0xe80c('0x9'),_0x704aa3,_0x104665[_0xe80c('0xc')][_0xe80c('0xe')]);return _0x1fdd3b(_0x104665[_0xe80c('0xc')][_0xe80c('0xe')]);}logger[_0xe80c('0xc')](_0xe80c('0x9'),_0x704aa3,_0x104665[_0xe80c('0xc')][_0xe80c('0xe')]);return _0x4da07c(_0x104665['error'][_0xe80c('0xe')]);}else{logger['info'](_0xe80c('0x9'),_0x704aa3,_0xe80c('0xa'));_0x4da07c(_0x104665[_0xe80c('0xf')]['message']);}})[_0xe80c('0x10')](function(_0x35d108){logger['error'](_0xe80c('0x9'),_0x704aa3,_0x35d108);_0x1fdd3b(_0x35d108);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index cde7695..3e94eba 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 _0x0274=['delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update'];(function(_0x577247,_0x269bff){var _0x5e07d2=function(_0x625269){while(--_0x625269){_0x577247['push'](_0x577247['shift']());}};_0x5e07d2(++_0x269bff);}(_0x0274,0x10c));var _0x4027=function(_0x1c924c,_0x425bb3){_0x1c924c=_0x1c924c-0x0;var _0x30909d=_0x0274[_0x1c924c];return _0x30909d;};'use strict';var multer=require(_0x4027('0x0'));var util=require('util');var path=require(_0x4027('0x1'));var timeout=require(_0x4027('0x2'));var express=require('express');var router=express[_0x4027('0x3')]();var fs_extra=require(_0x4027('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4027('0x5'));var config=require(_0x4027('0x6'));var controller=require(_0x4027('0x7'));router[_0x4027('0x8')]('/',auth[_0x4027('0x9')](),controller[_0x4027('0xa')]);router[_0x4027('0x8')](_0x4027('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4027('0xc'),auth[_0x4027('0x9')](),controller[_0x4027('0xd')]);router[_0x4027('0xe')]('/',auth[_0x4027('0x9')](),controller['create']);router[_0x4027('0xf')]('/:id',auth[_0x4027('0x9')](),controller[_0x4027('0x10')]);router[_0x4027('0x11')](_0x4027('0xc'),auth[_0x4027('0x9')](),controller[_0x4027('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x955f=['Router','../../components/auth/service','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0xc8c149,_0x104184){var _0x261259=function(_0x314df3){while(--_0x314df3){_0xc8c149['push'](_0xc8c149['shift']());}};_0x261259(++_0x104184);}(_0x955f,0x6e));var _0xf955=function(_0x25d616,_0x438694){_0x25d616=_0x25d616-0x0;var _0x380b29=_0x955f[_0x25d616];return _0x380b29;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require('path');var timeout=require(_0xf955('0x2'));var express=require(_0xf955('0x3'));var router=express[_0xf955('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf955('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf955('0x6'));router[_0xf955('0x7')]('/',auth['isAuthenticated'](),controller[_0xf955('0x8')]);router['get'](_0xf955('0x9'),auth[_0xf955('0xa')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0xa')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth['isAuthenticated'](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/:id',auth[_0xf955('0xa')](),controller[_0xf955('0x10')]);router['delete'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module[_0xf955('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 5160aa8..ab4049f 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 _0xdeb8=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0xbbc40e,_0x4297ea){var _0x2abd33=function(_0x4f7ea5){while(--_0x4f7ea5){_0xbbc40e['push'](_0xbbc40e['shift']());}};_0x2abd33(++_0x4297ea);}(_0xdeb8,0xef));var _0x8deb=function(_0x5632d3,_0x2eed0b){_0x5632d3=_0x5632d3-0x0;var _0x2c4ba8=_0xdeb8[_0x5632d3];return _0x2c4ba8;};'use strict';var Sequelize=require(_0x8deb('0x0'));module[_0x8deb('0x1')]={'name':{'type':Sequelize[_0x8deb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8deb('0x3')](_0x8deb('0x4'),_0x8deb('0x5')),'defaultValue':_0x8deb('0x4')},'selector':{'type':Sequelize[_0x8deb('0x2')]},'timeout':{'type':Sequelize[_0x8deb('0x6')]}};
\ No newline at end of file
+var _0xf411=['mouseOver','timeout','STRING','exports','ENUM'];(function(_0x1d6cb8,_0x31a3f3){var _0x38a43f=function(_0x4ef6bd){while(--_0x4ef6bd){_0x1d6cb8['push'](_0x1d6cb8['shift']());}};_0x38a43f(++_0x31a3f3);}(_0xf411,0x1c5));var _0x1f41=function(_0x19c434,_0x8f3986){_0x19c434=_0x19c434-0x0;var _0x363fd2=_0xf411[_0x19c434];return _0x363fd2;};'use strict';var Sequelize=require('sequelize');module[_0x1f41('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1f41('0x1')](_0x1f41('0x2'),_0x1f41('0x3')),'defaultValue':_0x1f41('0x2')},'selector':{'type':Sequelize[_0x1f41('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 44b6930..18ccc9e 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 _0x3d9f=['undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','show','params','keys','rawAttributes','filters','intersection','model','attributes','fields','query','length','includeAll','include','merge','find','catch','create','body','ChatProactiveAction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset'];(function(_0x28bef9,_0x28e8d6){var _0x45db81=function(_0x269033){while(--_0x269033){_0x28bef9['push'](_0x28bef9['shift']());}};_0x45db81(++_0x28e8d6);}(_0x3d9f,0xd2));var _0xf3d9=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x3d9f[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0xf3d9('0x0'));var rimraf=require(_0xf3d9('0x1'));var zipdir=require(_0xf3d9('0x2'));var jsonpatch=require(_0xf3d9('0x3'));var rp=require(_0xf3d9('0x4'));var moment=require(_0xf3d9('0x5'));var BPromise=require(_0xf3d9('0x6'));var Mustache=require(_0xf3d9('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf3d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3d9('0x9'));var _=require(_0xf3d9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf3d9('0xb'));var deskjs=require(_0xf3d9('0xc'));var toCsv=require(_0xf3d9('0x8'));var querystring=require(_0xf3d9('0xd'));var Papa=require(_0xf3d9('0xe'));var Redis=require(_0xf3d9('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf3d9('0x10'));var hardwareService=require(_0xf3d9('0x11'));var logger=require(_0xf3d9('0x12'))(_0xf3d9('0x13'));var utils=require(_0xf3d9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf3d9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b08c8,_0x2eb42c){_0x2eb42c=_0x2eb42c||0xcc;return function(_0x5b91a7){if(_0x5b91a7){return _0x1b08c8['sendStatus'](_0x2eb42c);}return _0x1b08c8[_0xf3d9('0x16')](_0x2eb42c)[_0xf3d9('0x17')]();};}function respondWithResult(_0x898431,_0x15a74e){_0x15a74e=_0x15a74e||0xc8;return function(_0x55e310){if(_0x55e310){return _0x898431[_0xf3d9('0x16')](_0x15a74e)[_0xf3d9('0x18')](_0x55e310);}};}function respondWithFilteredResult(_0x1f3f9b,_0x4a8e70){return function(_0x4033a6){if(_0x4033a6){var _0x1508f2=typeof _0x4a8e70[_0xf3d9('0x19')]===_0xf3d9('0x1a')&&typeof _0x4a8e70[_0xf3d9('0x1b')]==='undefined';var _0x18393a=_0x4033a6[_0xf3d9('0x1c')];var _0x3e2206=_0x1508f2?0x0:_0x4a8e70[_0xf3d9('0x19')];var _0x3386cb=_0x1508f2?_0x4033a6[_0xf3d9('0x1c')]:_0x4a8e70[_0xf3d9('0x19')]+_0x4a8e70[_0xf3d9('0x1b')];var _0x473085;if(_0x3386cb>=_0x18393a){_0x3386cb=_0x18393a;_0x473085=0xc8;}else{_0x473085=0xce;}_0x1f3f9b[_0xf3d9('0x16')](_0x473085);return _0x1f3f9b[_0xf3d9('0x1d')]('Content-Range',_0x3e2206+'-'+_0x3386cb+'/'+_0x18393a)['json'](_0x4033a6);}return null;};}function patchUpdates(_0x3d4945){return function(_0x2145b3){try{jsonpatch[_0xf3d9('0x1e')](_0x2145b3,_0x3d4945,!![]);}catch(_0x22d2f6){return BPromise[_0xf3d9('0x1f')](_0x22d2f6);}return _0x2145b3[_0xf3d9('0x20')]();};}function saveUpdates(_0x207cea,_0x269890){return function(_0x7770dc){if(_0x7770dc){return _0x7770dc[_0xf3d9('0x21')](_0x207cea)[_0xf3d9('0x22')](function(_0x36e868){return _0x36e868;});}return null;};}function removeEntity(_0x3aeec9,_0x5aecca){return function(_0x168ca6){if(_0x168ca6){return _0x168ca6[_0xf3d9('0x23')]()[_0xf3d9('0x22')](function(){_0x3aeec9['status'](0xcc)[_0xf3d9('0x17')]();});}};}function handleEntityNotFound(_0x289d62,_0x26f206){return function(_0x21c846){if(!_0x21c846){_0x289d62[_0xf3d9('0x24')](0x194);}return _0x21c846;};}function handleError(_0x3e1c4d,_0x41a6ac){_0x41a6ac=_0x41a6ac||0x1f4;return function(_0x240c44){logger[_0xf3d9('0x25')](_0x240c44['stack']);if(_0x240c44[_0xf3d9('0x26')]){delete _0x240c44['name'];}_0x3e1c4d[_0xf3d9('0x16')](_0x41a6ac)[_0xf3d9('0x27')](_0x240c44);};}exports[_0xf3d9('0x28')]=function(_0x3d9c23,_0x4e336a){var _0x1d51ce={'raw':!![],'where':{'id':_0x3d9c23[_0xf3d9('0x29')]['id']}},_0x367b60={};_0x367b60['model']=_[_0xf3d9('0x2a')](db['ChatProactiveAction'][_0xf3d9('0x2b')]);_0x367b60['query']=_[_0xf3d9('0x2a')](_0x3d9c23['query']);_0x367b60[_0xf3d9('0x2c')]=_[_0xf3d9('0x2d')](_0x367b60[_0xf3d9('0x2e')],_0x367b60['query']);_0x1d51ce[_0xf3d9('0x2f')]=_['intersection'](_0x367b60[_0xf3d9('0x2e')],qs[_0xf3d9('0x30')](_0x3d9c23[_0xf3d9('0x31')][_0xf3d9('0x30')]));_0x1d51ce[_0xf3d9('0x2f')]=_0x1d51ce[_0xf3d9('0x2f')][_0xf3d9('0x32')]?_0x1d51ce[_0xf3d9('0x2f')]:_0x367b60[_0xf3d9('0x2e')];if(_0x3d9c23[_0xf3d9('0x31')][_0xf3d9('0x33')]){_0x1d51ce[_0xf3d9('0x34')]=[{'all':!![]}];}_0x1d51ce=_[_0xf3d9('0x35')]({},_0x1d51ce,_0x3d9c23['options']);return db['ChatProactiveAction'][_0xf3d9('0x36')](_0x1d51ce)[_0xf3d9('0x22')](handleEntityNotFound(_0x4e336a,null))[_0xf3d9('0x22')](respondWithResult(_0x4e336a,null))[_0xf3d9('0x37')](handleError(_0x4e336a,null));};exports[_0xf3d9('0x38')]=function(_0x3b98b5,_0x14fa3c){return db['ChatProactiveAction'][_0xf3d9('0x38')](_0x3b98b5[_0xf3d9('0x39')],{})['then'](respondWithResult(_0x14fa3c,0xc9))[_0xf3d9('0x37')](handleError(_0x14fa3c,null));};exports['update']=function(_0x25ef2d,_0x164c27){if(_0x25ef2d[_0xf3d9('0x39')]['id']){delete _0x25ef2d[_0xf3d9('0x39')]['id'];}return db[_0xf3d9('0x3a')]['find']({'where':{'id':_0x25ef2d[_0xf3d9('0x29')]['id']}})[_0xf3d9('0x22')](handleEntityNotFound(_0x164c27,null))[_0xf3d9('0x22')](saveUpdates(_0x25ef2d[_0xf3d9('0x39')],null))['then'](respondWithResult(_0x164c27,null))[_0xf3d9('0x37')](handleError(_0x164c27,null));};exports[_0xf3d9('0x23')]=function(_0x3f6b21,_0x43d598){return db['ChatProactiveAction'][_0xf3d9('0x36')]({'where':{'id':_0x3f6b21['params']['id']}})[_0xf3d9('0x22')](handleEntityNotFound(_0x43d598,null))[_0xf3d9('0x22')](removeEntity(_0x43d598,null))[_0xf3d9('0x37')](handleError(_0x43d598,null));};
\ No newline at end of file
+var _0xd6bb=['find','create','body','catch','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xd6bb[_0x126fb9];return _0xc8a3b1;};'use strict';var emlformat=require(_0xbd6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd6b('0x1'));var jsonpatch=require(_0xbd6b('0x2'));var rp=require(_0xbd6b('0x3'));var moment=require(_0xbd6b('0x4'));var BPromise=require(_0xbd6b('0x5'));var Mustache=require('mustache');var util=require(_0xbd6b('0x6'));var path=require(_0xbd6b('0x7'));var sox=require(_0xbd6b('0x8'));var csv=require('to-csv');var ejs=require(_0xbd6b('0x9'));var fs=require('fs');var fs_extra=require(_0xbd6b('0xa'));var _=require(_0xbd6b('0xb'));var squel=require(_0xbd6b('0xc'));var crypto=require(_0xbd6b('0xd'));var jsforce=require(_0xbd6b('0xe'));var deskjs=require(_0xbd6b('0xf'));var toCsv=require(_0xbd6b('0x10'));var querystring=require(_0xbd6b('0x11'));var Papa=require(_0xbd6b('0x12'));var Redis=require(_0xbd6b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbd6b('0x14'));var as=require(_0xbd6b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd6b('0x16'))(_0xbd6b('0x17'));var utils=require('../../config/utils');var config=require(_0xbd6b('0x18'));var licenseUtil=require(_0xbd6b('0x19'));var db=require(_0xbd6b('0x1a'))['db'];function respondWithStatusCode(_0x34992e,_0x372139){_0x372139=_0x372139||0xcc;return function(_0x5225ea){if(_0x5225ea){return _0x34992e[_0xbd6b('0x1b')](_0x372139);}return _0x34992e[_0xbd6b('0x1c')](_0x372139)[_0xbd6b('0x1d')]();};}function respondWithResult(_0x4952ed,_0x504785){_0x504785=_0x504785||0xc8;return function(_0x557820){if(_0x557820){return _0x4952ed[_0xbd6b('0x1c')](_0x504785)[_0xbd6b('0x1e')](_0x557820);}};}function respondWithFilteredResult(_0xecaf18,_0x13e93a){return function(_0xa40969){if(_0xa40969){var _0x2208de=typeof _0x13e93a['offset']===_0xbd6b('0x1f')&&typeof _0x13e93a['limit']==='undefined';var _0x5437c1=_0xa40969[_0xbd6b('0x20')];var _0x1c0cad=_0x2208de?0x0:_0x13e93a[_0xbd6b('0x21')];var _0x50d857=_0x2208de?_0xa40969[_0xbd6b('0x20')]:_0x13e93a[_0xbd6b('0x21')]+_0x13e93a['limit'];var _0x11b28f;if(_0x50d857>=_0x5437c1){_0x50d857=_0x5437c1;_0x11b28f=0xc8;}else{_0x11b28f=0xce;}_0xecaf18[_0xbd6b('0x1c')](_0x11b28f);return _0xecaf18[_0xbd6b('0x22')](_0xbd6b('0x23'),_0x1c0cad+'-'+_0x50d857+'/'+_0x5437c1)[_0xbd6b('0x1e')](_0xa40969);}return null;};}function patchUpdates(_0x59aa3f){return function(_0x1233a4){try{jsonpatch[_0xbd6b('0x24')](_0x1233a4,_0x59aa3f,!![]);}catch(_0x2389c1){return BPromise[_0xbd6b('0x25')](_0x2389c1);}return _0x1233a4[_0xbd6b('0x26')]();};}function saveUpdates(_0x447b7a,_0x5e0be3){return function(_0x24ce5b){if(_0x24ce5b){return _0x24ce5b['update'](_0x447b7a)[_0xbd6b('0x27')](function(_0x34c452){return _0x34c452;});}return null;};}function removeEntity(_0x3ece0f,_0x5d6329){return function(_0x314526){if(_0x314526){return _0x314526['destroy']()[_0xbd6b('0x27')](function(){_0x3ece0f[_0xbd6b('0x1c')](0xcc)[_0xbd6b('0x1d')]();});}};}function handleEntityNotFound(_0x323964,_0x25d609){return function(_0x450a6e){if(!_0x450a6e){_0x323964[_0xbd6b('0x1b')](0x194);}return _0x450a6e;};}function handleError(_0x1218f3,_0x33014a){_0x33014a=_0x33014a||0x1f4;return function(_0x139948){logger[_0xbd6b('0x28')](_0x139948[_0xbd6b('0x29')]);if(_0x139948[_0xbd6b('0x2a')]){delete _0x139948[_0xbd6b('0x2a')];}_0x1218f3['status'](_0x33014a)[_0xbd6b('0x2b')](_0x139948);};}exports[_0xbd6b('0x2c')]=function(_0x391b59,_0x4f8879){var _0x3b3e77={'raw':!![],'where':{'id':_0x391b59[_0xbd6b('0x2d')]['id']}},_0x2ddf8c={};_0x2ddf8c['model']=_[_0xbd6b('0x2e')](db[_0xbd6b('0x2f')][_0xbd6b('0x30')]);_0x2ddf8c[_0xbd6b('0x31')]=_[_0xbd6b('0x2e')](_0x391b59[_0xbd6b('0x31')]);_0x2ddf8c[_0xbd6b('0x32')]=_[_0xbd6b('0x33')](_0x2ddf8c[_0xbd6b('0x34')],_0x2ddf8c[_0xbd6b('0x31')]);_0x3b3e77[_0xbd6b('0x35')]=_[_0xbd6b('0x33')](_0x2ddf8c[_0xbd6b('0x34')],qs['fields'](_0x391b59[_0xbd6b('0x31')][_0xbd6b('0x36')]));_0x3b3e77[_0xbd6b('0x35')]=_0x3b3e77[_0xbd6b('0x35')][_0xbd6b('0x37')]?_0x3b3e77[_0xbd6b('0x35')]:_0x2ddf8c[_0xbd6b('0x34')];if(_0x391b59['query'][_0xbd6b('0x38')]){_0x3b3e77[_0xbd6b('0x39')]=[{'all':!![]}];}_0x3b3e77=_[_0xbd6b('0x3a')]({},_0x3b3e77,_0x391b59[_0xbd6b('0x3b')]);return db[_0xbd6b('0x2f')][_0xbd6b('0x3c')](_0x3b3e77)[_0xbd6b('0x27')](handleEntityNotFound(_0x4f8879,null))[_0xbd6b('0x27')](respondWithResult(_0x4f8879,null))['catch'](handleError(_0x4f8879,null));};exports[_0xbd6b('0x3d')]=function(_0x4c913d,_0xf33931){return db[_0xbd6b('0x2f')][_0xbd6b('0x3d')](_0x4c913d[_0xbd6b('0x3e')],{})[_0xbd6b('0x27')](respondWithResult(_0xf33931,0xc9))['catch'](handleError(_0xf33931,null));};exports['update']=function(_0x23c4ae,_0x5e4a4e){if(_0x23c4ae[_0xbd6b('0x3e')]['id']){delete _0x23c4ae[_0xbd6b('0x3e')]['id'];}return db[_0xbd6b('0x2f')][_0xbd6b('0x3c')]({'where':{'id':_0x23c4ae[_0xbd6b('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5e4a4e,null))[_0xbd6b('0x27')](saveUpdates(_0x23c4ae['body'],null))['then'](respondWithResult(_0x5e4a4e,null))[_0xbd6b('0x3f')](handleError(_0x5e4a4e,null));};exports[_0xbd6b('0x40')]=function(_0x2ccc30,_0x18c674){return db[_0xbd6b('0x2f')]['find']({'where':{'id':_0x2ccc30[_0xbd6b('0x2d')]['id']}})[_0xbd6b('0x27')](handleEntityNotFound(_0x18c674,null))[_0xbd6b('0x27')](removeEntity(_0x18c674,null))['catch'](handleError(_0x18c674,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index bd913f9..033b991 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 _0xd447=['chat_proactive_actions','util','../../config/logger','api','moment','bluebird','path','./chatProactiveAction.attributes','exports','define'];(function(_0x41b4e9,_0x51a253){var _0x36d5ca=function(_0x5db9d0){while(--_0x5db9d0){_0x41b4e9['push'](_0x41b4e9['shift']());}};_0x36d5ca(++_0x51a253);}(_0xd447,0x1e1));var _0x7d44=function(_0x41a12c,_0x362888){_0x41a12c=_0x41a12c-0x0;var _0x13d8d0=_0xd447[_0x41a12c];return _0x13d8d0;};'use strict';var _=require('lodash');var util=require(_0x7d44('0x0'));var logger=require(_0x7d44('0x1'))(_0x7d44('0x2'));var moment=require(_0x7d44('0x3'));var BPromise=require(_0x7d44('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d44('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7d44('0x6'));module[_0x7d44('0x7')]=function(_0x4b7b6d,_0x2fed56){return _0x4b7b6d[_0x7d44('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x7d44('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7318=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x49aa1c,_0x56d2b9){var _0x1041c8=function(_0x48e6b8){while(--_0x48e6b8){_0x49aa1c['push'](_0x49aa1c['shift']());}};_0x1041c8(++_0x56d2b9);}(_0x7318,0xac));var _0x8731=function(_0x42cce1,_0x5811de){_0x42cce1=_0x42cce1-0x0;var _0x5c0e27=_0x7318[_0x42cce1];return _0x5c0e27;};'use strict';var _=require(_0x8731('0x0'));var util=require(_0x8731('0x1'));var logger=require(_0x8731('0x2'))(_0x8731('0x3'));var moment=require(_0x8731('0x4'));var BPromise=require(_0x8731('0x5'));var rp=require(_0x8731('0x6'));var fs=require('fs');var path=require(_0x8731('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8731('0x8'));module[_0x8731('0x9')]=function(_0x3f0f81,_0x31125f){return _0x3f0f81[_0x8731('0xa')](_0x8731('0xb'),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 2ed3127..bb39d35 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 _0x1e50=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x5076e9,_0x22454a){var _0x2a0de1=function(_0x5b6895){while(--_0x5b6895){_0x5076e9['push'](_0x5076e9['shift']());}};_0x2a0de1(++_0x22454a);}(_0x1e50,0x1d4));var _0x01e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x01e5('0x0'));var util=require(_0x01e5('0x1'));var moment=require(_0x01e5('0x2'));var BPromise=require(_0x01e5('0x3'));var rs=require(_0x01e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01e5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x01e5('0x6'))('rpc');var config=require(_0x01e5('0x7'));var jayson=require(_0x01e5('0x8'));var client=jayson[_0x01e5('0x9')][_0x01e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43284e,_0x32d502,_0x19af63){return new BPromise(function(_0x5860cd,_0x5257f5){return client[_0x01e5('0xb')](_0x43284e,_0x19af63)[_0x01e5('0xc')](function(_0x511973){logger[_0x01e5('0xd')](_0x01e5('0xe'),_0x32d502,_0x01e5('0xf'));logger[_0x01e5('0x10')](_0x01e5('0x11'),_0x32d502,_0x01e5('0xf'),JSON['stringify'](_0x511973));if(_0x511973[_0x01e5('0x12')]){if(_0x511973[_0x01e5('0x12')][_0x01e5('0x13')]===0x1f4){logger[_0x01e5('0x12')](_0x01e5('0xe'),_0x32d502,_0x511973[_0x01e5('0x12')][_0x01e5('0x14')]);return _0x5257f5(_0x511973[_0x01e5('0x12')][_0x01e5('0x14')]);}logger['error'](_0x01e5('0xe'),_0x32d502,_0x511973[_0x01e5('0x12')][_0x01e5('0x14')]);return _0x5860cd(_0x511973[_0x01e5('0x12')]['message']);}else{logger['info'](_0x01e5('0xe'),_0x32d502,_0x01e5('0xf'));_0x5860cd(_0x511973[_0x01e5('0x15')][_0x01e5('0x14')]);}})['catch'](function(_0x494cf7){logger[_0x01e5('0x12')](_0x01e5('0xe'),_0x32d502,_0x494cf7);_0x5257f5(_0x494cf7);});});}
\ No newline at end of file
+var _0xff0d=['result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0xff0d,0xe8));var _0xdff0=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xff0d[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xdff0('0x0'));var util=require(_0xdff0('0x1'));var moment=require('moment');var BPromise=require(_0xdff0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdff0('0x3'));var db=require(_0xdff0('0x4'))['db'];var utils=require(_0xdff0('0x5'));var logger=require('../../config/logger')(_0xdff0('0x6'));var config=require(_0xdff0('0x7'));var jayson=require(_0xdff0('0x8'));var client=jayson[_0xdff0('0x9')][_0xdff0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4242d7,_0x394541,_0x14b0b3){return new BPromise(function(_0x1ae075,_0x4922f5){return client[_0xdff0('0xb')](_0x4242d7,_0x14b0b3)[_0xdff0('0xc')](function(_0x4ec159){logger[_0xdff0('0xd')](_0xdff0('0xe'),_0x394541,'request\x20sent');logger[_0xdff0('0xf')](_0xdff0('0x10'),_0x394541,'request\x20sent',JSON['stringify'](_0x4ec159));if(_0x4ec159[_0xdff0('0x11')]){if(_0x4ec159[_0xdff0('0x11')][_0xdff0('0x12')]===0x1f4){logger['error'](_0xdff0('0xe'),_0x394541,_0x4ec159[_0xdff0('0x11')][_0xdff0('0x13')]);return _0x4922f5(_0x4ec159[_0xdff0('0x11')]['message']);}logger[_0xdff0('0x11')](_0xdff0('0xe'),_0x394541,_0x4ec159[_0xdff0('0x11')][_0xdff0('0x13')]);return _0x1ae075(_0x4ec159[_0xdff0('0x11')][_0xdff0('0x13')]);}else{logger[_0xdff0('0xd')](_0xdff0('0xe'),_0x394541,'request\x20sent');_0x1ae075(_0x4ec159[_0xdff0('0x14')][_0xdff0('0x13')]);}})['catch'](function(_0xcf3b35){logger['error'](_0xdff0('0xe'),_0x394541,_0xcf3b35);_0x4922f5(_0xcf3b35);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 917b28c..b2806bd 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 _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x179c19,_0x43a64a){var _0x3cdfa0=function(_0x5d40d4){while(--_0x5d40d4){_0x179c19['push'](_0x179c19['shift']());}};_0x3cdfa0(++_0x43a64a);}(_0x032e,0x124));var _0xe032=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x032e[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
+var _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xabce,0x103));var _0xeabc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xabce[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 95e9fa2..265aa85 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 _0xe611=['INTEGER','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x353627,_0xf01069){var _0x426c5b=function(_0x3d1428){while(--_0x3d1428){_0x353627['push'](_0x353627['shift']());}};_0x426c5b(++_0xf01069);}(_0xe611,0x135));var _0x1e61=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe611[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x1e61('0x0'));module[_0x1e61('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1e61('0x2')]},'timeout':{'type':Sequelize[_0x1e61('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1e61('0x4'),_0x1e61('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x17ac=['beepall','roundrobin','sequelize','exports','STRING','rrmemory'];(function(_0x4160de,_0x14a94a){var _0xf76365=function(_0x2a4ef5){while(--_0x2a4ef5){_0x4160de['push'](_0x4160de['shift']());}};_0xf76365(++_0x14a94a);}(_0x17ac,0x1a0));var _0xc17a=function(_0x7a7c1a,_0x273806){_0x7a7c1a=_0x7a7c1a-0x0;var _0x4e9327=_0x17ac[_0x7a7c1a];return _0x4e9327;};'use strict';var Sequelize=require(_0xc17a('0x0'));module[_0xc17a('0x1')]={'name':{'type':Sequelize[_0xc17a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc17a('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc17a('0x3'),_0xc17a('0x4'),_0xc17a('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index d052e5d..e934490 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 _0x289a=['params','model','keys','filters','attributes','intersection','fields','includeAll','merge','options','find','create','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','length','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','findAndCountAll','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./chatQueue.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','update','then','destroy','get','ChatQueues','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x289a,0x156));var _0xa289=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x289a[_0x3c22e0];return _0x215811;};'use strict';var BPromise=require('bluebird');var util=require(_0xa289('0x0'));var _=require(_0xa289('0x1'));var squel=require(_0xa289('0x2'));var Redis=require(_0xa289('0x3'));var qs=require(_0xa289('0x4'));var logger=require(_0xa289('0x5'))(_0xa289('0x6'));var config=require(_0xa289('0x7'));var db=require(_0xa289('0x8'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa289('0x9'))(new Redis(config[_0xa289('0xa')]));require(_0xa289('0xb'))[_0xa289('0xc')](socket);function respondWithStatusCode(_0x451c6f,_0x475932){_0x475932=_0x475932||0xcc;return function(_0x57b220){if(_0x57b220){return _0x451c6f[_0xa289('0xd')](_0x475932);}return _0x451c6f[_0xa289('0xe')](_0x475932)[_0xa289('0xf')]();};}function respondWithResult(_0x3bc67a,_0x2512ef){_0x2512ef=_0x2512ef||0xc8;return function(_0x4bcfaa){if(_0x4bcfaa){return _0x3bc67a[_0xa289('0xe')](_0x2512ef)['json'](_0x4bcfaa);}};}function respondWithFilteredResult(_0x34fc45,_0x53a3f1){return function(_0x1e75e5){if(_0x1e75e5){var _0x3c9556=typeof _0x53a3f1['offset']===_0xa289('0x10')&&typeof _0x53a3f1['limit']===_0xa289('0x10');var _0x397e8b=_0x1e75e5[_0xa289('0x11')];var _0x569d8b=_0x3c9556?0x0:_0x53a3f1[_0xa289('0x12')];var _0x5ed4dd=_0x3c9556?_0x1e75e5[_0xa289('0x11')]:_0x53a3f1[_0xa289('0x12')]+_0x53a3f1[_0xa289('0x13')];var _0x107610;if(_0x5ed4dd>=_0x397e8b){_0x5ed4dd=_0x397e8b;_0x107610=0xc8;}else{_0x107610=0xce;}_0x34fc45['status'](_0x107610);return _0x34fc45[_0xa289('0x14')](_0xa289('0x15'),_0x569d8b+'-'+_0x5ed4dd+'/'+_0x397e8b)[_0xa289('0x16')](_0x1e75e5);}return null;};}function saveUpdates(_0xd96b86){return function(_0x45ff1b){if(_0x45ff1b){return _0x45ff1b[_0xa289('0x17')](_0xd96b86)[_0xa289('0x18')](function(_0x3e738e){return _0x3e738e;});}return null;};}function removeEntity(_0x536e01){return function(_0x5a1d20){if(_0x5a1d20){return _0x5a1d20[_0xa289('0x19')]()['then'](function(){var _0x50d32e=_0x5a1d20[_0xa289('0x1a')]({'plain':!![]});var _0x365897=_0xa289('0x1b');return db['UserProfileResource']['destroy']({'where':{'type':_0x365897,'resourceId':_0x50d32e['id']}})[_0xa289('0x18')](function(){return _0x5a1d20;});})[_0xa289('0x18')](function(){_0x536e01[_0xa289('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7a8c20){return function(_0x75bf34){if(!_0x75bf34){_0x7a8c20['sendStatus'](0x194);}return _0x75bf34;};}function handleError(_0x965927,_0x440689){_0x440689=_0x440689||0x1f4;return function(_0x3f0a7f){logger[_0xa289('0x1c')](_0x3f0a7f['stack']);if(_0x3f0a7f[_0xa289('0x1d')]){delete _0x3f0a7f[_0xa289('0x1d')];}_0x965927[_0xa289('0xe')](_0x440689)[_0xa289('0x1e')](_0x3f0a7f);};}exports[_0xa289('0x1f')]=function(_0x3cec16,_0x159645){var _0x48036d={};var _0x3defa8={'count':0x0,'rows':[]};var _0xe677d9=_[_0xa289('0x20')](db[_0xa289('0x21')][_0xa289('0x22')],function(_0x107440){return{'name':_0x107440[_0xa289('0x23')],'type':_0x107440[_0xa289('0x24')][_0xa289('0x25')]};});_0x48036d=qs[_0xa289('0x26')](_0xe677d9,_0x3cec16);var _0x23cc3d={'where':_0x48036d[_0xa289('0x27')]};return db['ChatQueue'][_0xa289('0x11')](_0x23cc3d)[_0xa289('0x18')](function(_0x40b19c){_0x3defa8['count']=_0x40b19c;_0x48036d[_0xa289('0x28')]=qs[_0xa289('0x28')](_0x3cec16[_0xa289('0x29')]);return db['ChatQueue'][_0xa289('0x2a')](_0x48036d);})['then'](function(_0x2b5f4b){_0x3defa8[_0xa289('0x2b')]=_0x2b5f4b;return _0x3defa8;})['then'](respondWithFilteredResult(_0x159645,_0x48036d))[_0xa289('0x2c')](handleError(_0x159645,null));};exports['show']=function(_0x227988,_0x1b4fb0){var _0x357f5c={'raw':!![],'where':{'id':_0x227988[_0xa289('0x2d')]['id']}},_0x727adf={};_0x727adf[_0xa289('0x2e')]=_[_0xa289('0x2f')](db[_0xa289('0x21')][_0xa289('0x22')]);_0x727adf['query']=_[_0xa289('0x2f')](_0x227988[_0xa289('0x29')]);_0x727adf[_0xa289('0x30')]=_['intersection'](_0x727adf[_0xa289('0x2e')],_0x727adf[_0xa289('0x29')]);_0x357f5c[_0xa289('0x31')]=_[_0xa289('0x32')](_0x727adf['model'],qs[_0xa289('0x33')](_0x227988[_0xa289('0x29')][_0xa289('0x33')]));_0x357f5c[_0xa289('0x31')]=_0x357f5c[_0xa289('0x31')]['length']?_0x357f5c[_0xa289('0x31')]:_0x727adf[_0xa289('0x2e')];if(_0x227988[_0xa289('0x29')][_0xa289('0x34')]){_0x357f5c['include']=[{'all':!![]}];}_0x357f5c=_[_0xa289('0x35')]({},_0x357f5c,_0x227988[_0xa289('0x36')]);return db['ChatQueue'][_0xa289('0x37')](_0x357f5c)[_0xa289('0x18')](handleEntityNotFound(_0x1b4fb0,null))[_0xa289('0x18')](respondWithResult(_0x1b4fb0,null))[_0xa289('0x2c')](handleError(_0x1b4fb0,null));};exports[_0xa289('0x38')]=function(_0x3bbc47,_0x5b0c35){return db['ChatQueue'][_0xa289('0x38')](_0x3bbc47['body'],{})['then'](function(_0x247b54){var _0x5d7c66=_0x3bbc47[_0xa289('0x39')][_0xa289('0x1a')]({'plain':!![]});if(!_0x5d7c66)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d7c66[_0xa289('0x3a')]===_0xa289('0x39')){var _0x388c7b=_0x247b54['get']({'plain':!![]});var _0x3a521c=_0xa289('0x1b');return db[_0xa289('0x3b')][_0xa289('0x37')]({'where':{'name':_0x3a521c,'userProfileId':_0x5d7c66['userProfileId']},'raw':!![]})[_0xa289('0x18')](function(_0x485b11){if(_0x485b11&&_0x485b11[_0xa289('0x3c')]===0x0){return db[_0xa289('0x3d')][_0xa289('0x38')]({'name':_0x388c7b[_0xa289('0x1d')],'resourceId':_0x388c7b['id'],'type':_0x485b11[_0xa289('0x1d')],'sectionId':_0x485b11['id']},{})[_0xa289('0x18')](function(){return _0x247b54;});}else{return _0x247b54;}})['catch'](function(_0x4e809b){logger[_0xa289('0x1c')](_0xa289('0x3e'),_0x4e809b);throw _0x4e809b;});}return _0x247b54;})[_0xa289('0x18')](respondWithResult(_0x5b0c35,0xc9))['catch'](handleError(_0x5b0c35,null));};exports[_0xa289('0x17')]=function(_0x183be3,_0xb47c14){if(_0x183be3['body']['id']){delete _0x183be3['body']['id'];}return db[_0xa289('0x21')]['find']({'where':{'id':_0x183be3[_0xa289('0x2d')]['id']}})['then'](handleEntityNotFound(_0xb47c14,null))[_0xa289('0x18')](saveUpdates(_0x183be3[_0xa289('0x3f')],null))[_0xa289('0x18')](respondWithResult(_0xb47c14,null))[_0xa289('0x2c')](handleError(_0xb47c14,null));};exports['destroy']=function(_0x3e2f0a,_0x4d0633){return db[_0xa289('0x21')][_0xa289('0x37')]({'where':{'id':_0x3e2f0a[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x4d0633,null))[_0xa289('0x18')](removeEntity(_0x4d0633,null))[_0xa289('0x2c')](handleError(_0x4d0633,null));};exports[_0xa289('0x40')]=function(_0x1eda3c,_0x582e99){return db[_0xa289('0x21')][_0xa289('0x40')]()['then'](respondWithResult(_0x582e99,null))[_0xa289('0x2c')](handleError(_0x582e99,null));};exports[_0xa289('0x41')]=function(_0x3cafc4,_0x5b950e){var _0x20a443={'raw':!![],'where':{}},_0x48aff1={},_0x37b2c4;return db[_0xa289('0x21')][_0xa289('0x42')]({'where':{'id':_0x3cafc4[_0xa289('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5b950e,null))[_0xa289('0x18')](function(_0x50a1aa){if(_0x50a1aa){_0x37b2c4=_0x50a1aa['get']({'plain':!![]});_0x48aff1['model']=_[_0xa289('0x2f')](db[_0xa289('0x43')]['rawAttributes']);_0x48aff1[_0xa289('0x29')]=_[_0xa289('0x2f')](_0x3cafc4[_0xa289('0x29')]);_0x48aff1['filters']=_[_0xa289('0x32')](_0x48aff1['model'],_0x48aff1[_0xa289('0x29')]);_0x20a443['attributes']=_[_0xa289('0x32')](_0x48aff1[_0xa289('0x2e')],qs[_0xa289('0x33')](_0x3cafc4[_0xa289('0x29')]['fields']));_0x20a443[_0xa289('0x31')]=_0x20a443[_0xa289('0x31')][_0xa289('0x44')]?_0x20a443['attributes']:_0x48aff1['model'];if(!_0x3cafc4[_0xa289('0x29')][_0xa289('0x45')](_0xa289('0x46'))){_0x20a443[_0xa289('0x13')]=qs[_0xa289('0x13')](_0x3cafc4[_0xa289('0x29')]['limit']);_0x20a443['offset']=qs[_0xa289('0x12')](_0x3cafc4['query']['offset']);}_0x20a443[_0xa289('0x47')]=qs[_0xa289('0x48')](_0x3cafc4[_0xa289('0x29')][_0xa289('0x48')]);_0x20a443[_0xa289('0x27')]=qs[_0xa289('0x30')](_[_0xa289('0x49')](_0x3cafc4['query'],_0x48aff1[_0xa289('0x30')]));_0x20a443[_0xa289('0x27')][_0xa289('0x4a')]=_0x50a1aa['id'];if(_0x3cafc4['query']['filter']){_0x20a443['where']=_[_0xa289('0x35')](_0x20a443['where'],{'$or':_['map'](_0x20a443[_0xa289('0x31')],function(_0x2da4c6){var _0x5d9cef={};_0x5d9cef[_0x2da4c6]={'$like':'%'+_0x3cafc4[_0xa289('0x29')][_0xa289('0x4b')]+'%'};return _0x5d9cef;})});}_0x20a443=_[_0xa289('0x35')]({},_0x20a443,_0x3cafc4[_0xa289('0x36')]);return db[_0xa289('0x43')]['findAll'](_0x20a443);}})['then'](function(_0xb779c9){if(_0xb779c9){return db['User'][_0xa289('0x4c')]({'where':{'id':_[_0xa289('0x20')](_0xb779c9,'UserId'),'role':_0xa289('0x4d')},'attributes':['id','name',_0xa289('0x4e'),_0xa289('0x4f'),'createdAt']});}})[_0xa289('0x18')](function(_0xd4562f){if(_0xd4562f){return{'count':_0xd4562f['count'],'rows':_[_0xa289('0x20')](_0xd4562f[_0xa289('0x2b')],function(_0x5952da){return{'membername':_0x5952da[_0xa289('0x1d')],'UserId':_0x5952da['id'],'queue_name':_0x37b2c4[_0xa289('0x1d')],'ChatQueueId':_0x37b2c4['id'],'interface':util[_0xa289('0x50')](_0xa289('0x51'),_0xa289('0x52'),_0x5952da['name']),'penalty':0x0,'paused':_0x5952da[_0xa289('0x4e')],'createdAt':_0x5952da[_0xa289('0x53')],'updatedAt':_0x5952da['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa289('0x18')](respondWithFilteredResult(_0x5b950e,_0x20a443))[_0xa289('0x2c')](handleError(_0x5b950e,null));};exports['getTeams']=function(_0x53ca40,_0x5d24b6){var _0x20a94f={};var _0x38d015={};var _0xf4e0aa;var _0xb41e4c;return db[_0xa289('0x21')][_0xa289('0x42')]({'where':{'id':_0x53ca40[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x5d24b6,null))[_0xa289('0x18')](function(_0x4622b7){if(_0x4622b7){_0xf4e0aa=_0x4622b7;_0x38d015[_0xa289('0x2e')]=_['keys'](db[_0xa289('0x54')]['rawAttributes']);_0x38d015[_0xa289('0x29')]=_[_0xa289('0x2f')](_0x53ca40[_0xa289('0x29')]);_0x38d015[_0xa289('0x30')]=_['intersection'](_0x38d015[_0xa289('0x2e')],_0x38d015[_0xa289('0x29')]);_0x20a94f[_0xa289('0x31')]=_['intersection'](_0x38d015[_0xa289('0x2e')],qs[_0xa289('0x33')](_0x53ca40[_0xa289('0x29')][_0xa289('0x33')]));_0x20a94f[_0xa289('0x31')]=_0x20a94f[_0xa289('0x31')][_0xa289('0x44')]?_0x20a94f[_0xa289('0x31')]:_0x38d015[_0xa289('0x2e')];_0x20a94f[_0xa289('0x47')]=qs[_0xa289('0x48')](_0x53ca40[_0xa289('0x29')][_0xa289('0x48')]);_0x20a94f[_0xa289('0x27')]=qs['filters'](_[_0xa289('0x49')](_0x53ca40[_0xa289('0x29')],_0x38d015['filters']));if(_0x53ca40[_0xa289('0x29')]['filter']){_0x20a94f[_0xa289('0x27')]=_[_0xa289('0x35')](_0x20a94f[_0xa289('0x27')],{'$or':_[_0xa289('0x20')](_0x20a94f[_0xa289('0x31')],function(_0x4bd070){var _0x4051fe={};_0x4051fe[_0x4bd070]={'$like':'%'+_0x53ca40[_0xa289('0x29')][_0xa289('0x4b')]+'%'};return _0x4051fe;})});}_0x20a94f=_[_0xa289('0x35')]({},_0x20a94f,_0x53ca40[_0xa289('0x36')]);return _0xf4e0aa['getTeams'](_0x20a94f);}})[_0xa289('0x18')](function(_0x3ad149){if(_0x3ad149){_0xb41e4c=_0x3ad149[_0xa289('0x44')];if(!_0x53ca40['query'][_0xa289('0x45')](_0xa289('0x46'))){_0x20a94f[_0xa289('0x13')]=qs[_0xa289('0x13')](_0x53ca40[_0xa289('0x29')][_0xa289('0x13')]);_0x20a94f[_0xa289('0x12')]=qs[_0xa289('0x12')](_0x53ca40[_0xa289('0x29')][_0xa289('0x12')]);}return _0xf4e0aa[_0xa289('0x55')](_0x20a94f);}})['then'](function(_0x44b164){if(_0x44b164){return _0x44b164?{'count':_0xb41e4c,'rows':_0x44b164}:null;}})['then'](respondWithResult(_0x5d24b6,null))['catch'](handleError(_0x5d24b6,null));};exports[_0xa289('0x56')]=function(_0x22cd62,_0x5a0151){var _0x316c60=_0x22cd62[_0xa289('0x3f')][_0xa289('0x57')];return db[_0xa289('0x54')][_0xa289('0x2a')]({'where':{'id':_0x316c60},'attributes':['id'],'include':[{'model':db[_0xa289('0x58')],'as':_0xa289('0x59'),'attributes':['id',_0xa289('0x1d'),_0xa289('0x5a'),_0xa289('0x5b'),_0xa289('0x5c')],'raw':!![]}]})[_0xa289('0x18')](function(_0x48716c){if(_0x48716c){var _0x40ae46=_[_0xa289('0x5d')](_0x48716c,function(_0x4f3b4d){var _0x32370c=_0x4f3b4d['get']({'plain':!![]});return _0x32370c[_0xa289('0x59')];});return db[_0xa289('0x21')][_0xa289('0x37')]({'where':{'id':_0x22cd62['params']['id']}})[_0xa289('0x18')](function(_0x4b0eb1){return db[_0xa289('0x5e')][_0xa289('0x5f')](function(_0x519969){return _0x4b0eb1[_0xa289('0x56')](_0x316c60,{'transaction':_0x519969})[_0xa289('0x18')](function(){return BPromise[_0xa289('0x60')](_0x40ae46,function(_0x79151d){return db['UserChatQueue'][_0xa289('0x61')]({'where':{'UserId':_0x79151d['id'],'ChatQueueId':_0x22cd62[_0xa289('0x2d')]['id']},'transaction':_0x519969});});})[_0xa289('0x18')](function(){_0x40ae46[_0xa289('0x62')](function(_0x4514e2){socket['emit'](_0xa289('0x63'),{'UserId':_0x4514e2['id'],'ChatQueueId':_0x4b0eb1['id']});});});});});}})[_0xa289('0x18')](respondWithStatusCode(_0x5a0151,null))[_0xa289('0x2c')](handleError(_0x5a0151,null));};exports[_0xa289('0x64')]=function(_0x363ec7,_0x2ba687){return db[_0xa289('0x54')][_0xa289('0x2a')]({'where':{'id':_0x363ec7[_0xa289('0x29')][_0xa289('0x57')]},'attributes':['id'],'include':[{'model':db[_0xa289('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2ba687,null))['then'](function(_0x2dbd1b){var _0x43a7ef=_[_0xa289('0x20')](_0x2dbd1b,'id');var _0x3adf86=[];var _0x563b8f=[];var _0x1aaaad=squel[_0xa289('0x65')]();_0x1aaaad['field'](_0xa289('0x66'))[_0xa289('0x67')](_0xa289('0x68'),'tq')[_0xa289('0x69')](_0xa289('0x6a'),'ut',_0xa289('0x6b'))[_0xa289('0x27')](_0xa289('0x6c'),_0x363ec7[_0xa289('0x2d')]['id']);for(var _0x1458f7=0x0;_0x1458f7<_0x2dbd1b[_0xa289('0x44')];_0x1458f7+=0x1){let _0x389831=_0x2dbd1b[_0x1458f7];for(var _0x572403=0x0;_0x572403<_0x389831[_0xa289('0x59')][_0xa289('0x44')];_0x572403+=0x1){let _0x4521fe=_0x389831['Agents'][_0x572403];var _0x31124b=_0x1aaaad[_0xa289('0x6d')]();_0x31124b[_0xa289('0x27')](_0xa289('0x6e'),_0x4521fe['id']);_0x563b8f[_0xa289('0x6f')](db[_0xa289('0x5e')][_0xa289('0x29')](_0x31124b[_0xa289('0x70')](),{'type':db[_0xa289('0x5e')][_0xa289('0x71')]['SELECT']})[_0xa289('0x18')](function(_0x413c22){if(_0x413c22[_0xa289('0x44')]===0x1){return _0x4521fe['id'];}else{var _0x2a539c=_[_0xa289('0x72')](_[_0xa289('0x20')](_0x413c22,_0xa289('0x73')),function(_0x4a95d9){return _[_0xa289('0x74')](_0x43a7ef,_0x4a95d9);});if(_0x2a539c){return _0x4521fe['id'];}}}));}}return BPromise[_0xa289('0x75')](_0x563b8f)[_0xa289('0x18')](function(_0x50c32a){_0x3adf86=_(_0x3adf86)['union'](_0x50c32a)[_0xa289('0x76')]()[_0xa289('0x77')]();return db['ChatQueue'][_0xa289('0x37')]({'where':{'id':_0x363ec7[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](function(_0x3430ce){return db[_0xa289('0x5e')]['transaction'](function(_0x331cf8){return _0x3430ce[_0xa289('0x64')](_0x363ec7['query'][_0xa289('0x57')],{'transaction':_0x331cf8})[_0xa289('0x18')](function(){if(!_[_0xa289('0x78')](_0x3adf86)){return _0x3430ce[_0xa289('0x79')](_0x3adf86,{'transaction':_0x331cf8});}})[_0xa289('0x18')](function(){_0x3adf86['forEach'](function(_0x2c9ad3){socket[_0xa289('0x7a')](_0xa289('0x7b'),{'UserId':_0x2c9ad3,'ChatQueueId':_0x3430ce['id']});});});});});});})[_0xa289('0x18')](respondWithStatusCode(_0x2ba687,null))[_0xa289('0x2c')](handleError(_0x2ba687,null));};exports[_0xa289('0x7c')]=function(_0x3b6d46,_0x5d4f64){return db[_0xa289('0x21')][_0xa289('0x37')]({'where':{'id':_0x3b6d46[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x5d4f64,null))['then'](function(_0x1d003f){if(_0x1d003f){return _0x1d003f[_0xa289('0x7c')](_0x3b6d46[_0xa289('0x3f')]['ids'],_[_0xa289('0x7d')](_0x3b6d46[_0xa289('0x3f')],[_0xa289('0x57'),'id'])||{})[_0xa289('0x7e')](function(_0x251f37){for(var _0x412fc5=0x0;_0x412fc5<_0x3b6d46[_0xa289('0x3f')]['ids'][_0xa289('0x44')];_0x412fc5+=0x1){socket[_0xa289('0x7a')](_0xa289('0x63'),{'UserId':Number(_0x3b6d46[_0xa289('0x3f')][_0xa289('0x57')][_0x412fc5]),'ChatQueueId':Number(_0x3b6d46[_0xa289('0x2d')]['id'])});}return _0x251f37;});}})[_0xa289('0x18')](respondWithResult(_0x5d4f64,null))[_0xa289('0x2c')](handleError(_0x5d4f64,null));};exports[_0xa289('0x79')]=function(_0x100916,_0x586472){return db['ChatQueue'][_0xa289('0x37')]({'where':{'id':_0x100916[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x586472,null))[_0xa289('0x18')](function(_0x373442){if(_0x373442){return _0x373442[_0xa289('0x79')](_0x100916[_0xa289('0x29')]['ids'])['then'](function(){if(_[_0xa289('0x7f')](_0x100916[_0xa289('0x29')][_0xa289('0x57')])){for(var _0x20791c=0x0;_0x20791c<_0x100916[_0xa289('0x29')][_0xa289('0x57')]['length'];_0x20791c+=0x1){socket['emit'](_0xa289('0x7b'),{'UserId':Number(_0x100916[_0xa289('0x29')]['ids'][_0x20791c]),'ChatQueueId':Number(_0x100916[_0xa289('0x2d')]['id'])});}}else{socket[_0xa289('0x7a')](_0xa289('0x7b'),{'UserId':Number(_0x100916[_0xa289('0x29')][_0xa289('0x57')]),'ChatQueueId':Number(_0x100916[_0xa289('0x2d')]['id'])});}});}})[_0xa289('0x18')](respondWithStatusCode(_0x586472,null))[_0xa289('0x2c')](handleError(_0x586472,null));};exports[_0xa289('0x80')]=function(_0x8d57fc,_0x2b2f0a){var _0x41a758={};var _0x3006e3={};var _0x92294d;var _0x3eef5f;return db[_0xa289('0x21')][_0xa289('0x42')]({'where':{'id':_0x8d57fc['params']['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x2b2f0a,null))[_0xa289('0x18')](function(_0x484d00){if(_0x484d00){_0x92294d=_0x484d00;_0x3006e3[_0xa289('0x2e')]=_['keys'](db[_0xa289('0x58')]['rawAttributes']);_0x3006e3['query']=_[_0xa289('0x2f')](_0x8d57fc['query']);_0x3006e3[_0xa289('0x30')]=_[_0xa289('0x32')](_0x3006e3['model'],_0x3006e3['query']);_0x41a758['attributes']=_[_0xa289('0x32')](_0x3006e3[_0xa289('0x2e')],qs[_0xa289('0x33')](_0x8d57fc[_0xa289('0x29')]['fields']));_0x41a758[_0xa289('0x31')]=_0x41a758[_0xa289('0x31')]['length']?_0x41a758[_0xa289('0x31')]:_0x3006e3['model'];_0x41a758['order']=qs[_0xa289('0x48')](_0x8d57fc['query'][_0xa289('0x48')]);_0x41a758[_0xa289('0x27')]=qs[_0xa289('0x30')](_[_0xa289('0x49')](_0x8d57fc[_0xa289('0x29')],_0x3006e3[_0xa289('0x30')]));if(_0x8d57fc[_0xa289('0x29')][_0xa289('0x4b')]){_0x41a758[_0xa289('0x27')]=_[_0xa289('0x35')](_0x41a758[_0xa289('0x27')],{'$or':_[_0xa289('0x20')](_0x41a758[_0xa289('0x31')],function(_0x41425f){var _0x1f72e7={};_0x1f72e7[_0x41425f]={'$like':'%'+_0x8d57fc['query'][_0xa289('0x4b')]+'%'};return _0x1f72e7;})});}_0x41a758=_['merge']({},_0x41a758,_0x8d57fc['options']);return _0x92294d[_0xa289('0x80')](_0x41a758);}})['then'](function(_0xa86769){if(_0xa86769){_0x3eef5f=_0xa86769[_0xa289('0x44')];if(!_0x8d57fc['query'][_0xa289('0x45')](_0xa289('0x46'))){_0x41a758[_0xa289('0x13')]=qs['limit'](_0x8d57fc[_0xa289('0x29')]['limit']);_0x41a758[_0xa289('0x12')]=qs['offset'](_0x8d57fc[_0xa289('0x29')][_0xa289('0x12')]);}return _0x92294d[_0xa289('0x80')](_0x41a758);}})[_0xa289('0x18')](function(_0x3ea82c){if(_0x3ea82c){return _0x3ea82c?{'count':_0x3eef5f,'rows':_0x3ea82c}:null;}})[_0xa289('0x18')](respondWithResult(_0x2b2f0a,null))['catch'](handleError(_0x2b2f0a,null));};
\ No newline at end of file
+var _0x4389=['ChatQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','addAgents','omit','spread','isArray','getAgents','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','then','destroy','ChatQueues','error','name','send','index','map','ChatQueue','rawAttributes','type','where','query','findAll','catch','show','params','model','keys','filters','intersection','attributes','fields','length','options','find','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','merge','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userChatQueue:save','removeTeams','Agents','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x2631f6,_0x552ce5){var _0x45917c=function(_0x14b140){while(--_0x14b140){_0x2631f6['push'](_0x2631f6['shift']());}};_0x45917c(++_0x552ce5);}(_0x4389,0x17d));var _0x9438=function(_0x207695,_0x30389a){_0x207695=_0x207695-0x0;var _0x392cc7=_0x4389[_0x207695];return _0x392cc7;};'use strict';var BPromise=require('bluebird');var util=require(_0x9438('0x0'));var _=require(_0x9438('0x1'));var squel=require(_0x9438('0x2'));var Redis=require('ioredis');var qs=require(_0x9438('0x3'));var logger=require(_0x9438('0x4'))('api');var config=require(_0x9438('0x5'));var db=require(_0x9438('0x6'))['db'];config[_0x9438('0x7')]=_['defaults'](config[_0x9438('0x7')],{'host':_0x9438('0x8'),'port':0x18eb});var socket=require(_0x9438('0x9'))(new Redis(config['redis']));require(_0x9438('0xa'))[_0x9438('0xb')](socket);function respondWithStatusCode(_0x2d6e70,_0x1535f6){_0x1535f6=_0x1535f6||0xcc;return function(_0x4ffa21){if(_0x4ffa21){return _0x2d6e70[_0x9438('0xc')](_0x1535f6);}return _0x2d6e70[_0x9438('0xd')](_0x1535f6)[_0x9438('0xe')]();};}function respondWithResult(_0x2bd4a5,_0x4b8a0d){_0x4b8a0d=_0x4b8a0d||0xc8;return function(_0x173165){if(_0x173165){return _0x2bd4a5[_0x9438('0xd')](_0x4b8a0d)['json'](_0x173165);}};}function respondWithFilteredResult(_0x57257a,_0xb6a6ce){return function(_0x4e80f5){if(_0x4e80f5){var _0x5175a7=typeof _0xb6a6ce[_0x9438('0xf')]==='undefined'&&typeof _0xb6a6ce['limit']===_0x9438('0x10');var _0x28edb1=_0x4e80f5[_0x9438('0x11')];var _0x2b8171=_0x5175a7?0x0:_0xb6a6ce[_0x9438('0xf')];var _0x308d83=_0x5175a7?_0x4e80f5[_0x9438('0x11')]:_0xb6a6ce[_0x9438('0xf')]+_0xb6a6ce[_0x9438('0x12')];var _0x8c37ed;if(_0x308d83>=_0x28edb1){_0x308d83=_0x28edb1;_0x8c37ed=0xc8;}else{_0x8c37ed=0xce;}_0x57257a[_0x9438('0xd')](_0x8c37ed);return _0x57257a[_0x9438('0x13')](_0x9438('0x14'),_0x2b8171+'-'+_0x308d83+'/'+_0x28edb1)[_0x9438('0x15')](_0x4e80f5);}return null;};}function saveUpdates(_0x23cde7){return function(_0xef68da){if(_0xef68da){return _0xef68da['update'](_0x23cde7)[_0x9438('0x16')](function(_0x26c9c6){return _0x26c9c6;});}return null;};}function removeEntity(_0x548624){return function(_0x40bd3b){if(_0x40bd3b){return _0x40bd3b[_0x9438('0x17')]()[_0x9438('0x16')](function(){var _0x302162=_0x40bd3b['get']({'plain':!![]});var _0x2b8c2b=_0x9438('0x18');return db['UserProfileResource'][_0x9438('0x17')]({'where':{'type':_0x2b8c2b,'resourceId':_0x302162['id']}})['then'](function(){return _0x40bd3b;});})[_0x9438('0x16')](function(){_0x548624[_0x9438('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b3587){return function(_0x2bbea3){if(!_0x2bbea3){_0x1b3587[_0x9438('0xc')](0x194);}return _0x2bbea3;};}function handleError(_0x4b5cb3,_0x52228c){_0x52228c=_0x52228c||0x1f4;return function(_0x116331){logger[_0x9438('0x19')](_0x116331['stack']);if(_0x116331[_0x9438('0x1a')]){delete _0x116331[_0x9438('0x1a')];}_0x4b5cb3[_0x9438('0xd')](_0x52228c)[_0x9438('0x1b')](_0x116331);};}exports[_0x9438('0x1c')]=function(_0x143537,_0x525433){var _0x55e978={};var _0x38c716={'count':0x0,'rows':[]};var _0xa3f2f=_[_0x9438('0x1d')](db[_0x9438('0x1e')][_0x9438('0x1f')],function(_0x3f08e6){return{'name':_0x3f08e6['fieldName'],'type':_0x3f08e6[_0x9438('0x20')]['key']};});_0x55e978=qs['getOptions'](_0xa3f2f,_0x143537);var _0x5d2d77={'where':_0x55e978[_0x9438('0x21')]};return db[_0x9438('0x1e')][_0x9438('0x11')](_0x5d2d77)[_0x9438('0x16')](function(_0x584251){_0x38c716[_0x9438('0x11')]=_0x584251;_0x55e978['include']=qs['include'](_0x143537[_0x9438('0x22')]);return db[_0x9438('0x1e')][_0x9438('0x23')](_0x55e978);})[_0x9438('0x16')](function(_0x86042){_0x38c716['rows']=_0x86042;return _0x38c716;})[_0x9438('0x16')](respondWithFilteredResult(_0x525433,_0x55e978))[_0x9438('0x24')](handleError(_0x525433,null));};exports[_0x9438('0x25')]=function(_0x3f00ef,_0x2f8c90){var _0xf0601c={'raw':!![],'where':{'id':_0x3f00ef[_0x9438('0x26')]['id']}},_0x2f230d={};_0x2f230d[_0x9438('0x27')]=_[_0x9438('0x28')](db['ChatQueue'][_0x9438('0x1f')]);_0x2f230d[_0x9438('0x22')]=_[_0x9438('0x28')](_0x3f00ef[_0x9438('0x22')]);_0x2f230d[_0x9438('0x29')]=_[_0x9438('0x2a')](_0x2f230d[_0x9438('0x27')],_0x2f230d['query']);_0xf0601c[_0x9438('0x2b')]=_[_0x9438('0x2a')](_0x2f230d[_0x9438('0x27')],qs[_0x9438('0x2c')](_0x3f00ef[_0x9438('0x22')]['fields']));_0xf0601c['attributes']=_0xf0601c['attributes'][_0x9438('0x2d')]?_0xf0601c['attributes']:_0x2f230d['model'];if(_0x3f00ef[_0x9438('0x22')]['includeAll']){_0xf0601c['include']=[{'all':!![]}];}_0xf0601c=_['merge']({},_0xf0601c,_0x3f00ef[_0x9438('0x2e')]);return db['ChatQueue'][_0x9438('0x2f')](_0xf0601c)[_0x9438('0x16')](handleEntityNotFound(_0x2f8c90,null))[_0x9438('0x16')](respondWithResult(_0x2f8c90,null))[_0x9438('0x24')](handleError(_0x2f8c90,null));};exports[_0x9438('0x30')]=function(_0x30d414,_0x571a5f){return db[_0x9438('0x1e')]['create'](_0x30d414[_0x9438('0x31')],{})[_0x9438('0x16')](function(_0x1dbbf6){var _0x4e16b8=_0x30d414[_0x9438('0x32')]['get']({'plain':!![]});if(!_0x4e16b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e16b8[_0x9438('0x33')]===_0x9438('0x32')){var _0x1d1921=_0x1dbbf6[_0x9438('0x34')]({'plain':!![]});var _0x4b7537=_0x9438('0x18');return db[_0x9438('0x35')][_0x9438('0x2f')]({'where':{'name':_0x4b7537,'userProfileId':_0x4e16b8[_0x9438('0x36')]},'raw':!![]})[_0x9438('0x16')](function(_0x86d6d3){if(_0x86d6d3&&_0x86d6d3[_0x9438('0x37')]===0x0){return db[_0x9438('0x38')][_0x9438('0x30')]({'name':_0x1d1921[_0x9438('0x1a')],'resourceId':_0x1d1921['id'],'type':_0x86d6d3['name'],'sectionId':_0x86d6d3['id']},{})[_0x9438('0x16')](function(){return _0x1dbbf6;});}else{return _0x1dbbf6;}})['catch'](function(_0x185a50){logger[_0x9438('0x19')](_0x9438('0x39'),_0x185a50);throw _0x185a50;});}return _0x1dbbf6;})[_0x9438('0x16')](respondWithResult(_0x571a5f,0xc9))[_0x9438('0x24')](handleError(_0x571a5f,null));};exports[_0x9438('0x3a')]=function(_0x54ef6c,_0x3da4f9){if(_0x54ef6c[_0x9438('0x31')]['id']){delete _0x54ef6c[_0x9438('0x31')]['id'];}return db[_0x9438('0x1e')][_0x9438('0x2f')]({'where':{'id':_0x54ef6c[_0x9438('0x26')]['id']}})['then'](handleEntityNotFound(_0x3da4f9,null))[_0x9438('0x16')](saveUpdates(_0x54ef6c[_0x9438('0x31')],null))['then'](respondWithResult(_0x3da4f9,null))[_0x9438('0x24')](handleError(_0x3da4f9,null));};exports[_0x9438('0x17')]=function(_0x3bfe19,_0x46ff58){return db[_0x9438('0x1e')][_0x9438('0x2f')]({'where':{'id':_0x3bfe19[_0x9438('0x26')]['id']}})[_0x9438('0x16')](handleEntityNotFound(_0x46ff58,null))[_0x9438('0x16')](removeEntity(_0x46ff58,null))[_0x9438('0x24')](handleError(_0x46ff58,null));};exports[_0x9438('0x3b')]=function(_0x358f5e,_0x4a7961){return db[_0x9438('0x1e')]['describe']()['then'](respondWithResult(_0x4a7961,null))[_0x9438('0x24')](handleError(_0x4a7961,null));};exports[_0x9438('0x3c')]=function(_0x26acd1,_0x4b2f1e){var _0x46ef73={'raw':!![],'where':{}},_0x1baa4e={},_0x356262;return db[_0x9438('0x1e')][_0x9438('0x3d')]({'where':{'id':_0x26acd1['params']['id']}})['then'](handleEntityNotFound(_0x4b2f1e,null))['then'](function(_0x4805c8){if(_0x4805c8){_0x356262=_0x4805c8[_0x9438('0x34')]({'plain':!![]});_0x1baa4e[_0x9438('0x27')]=_[_0x9438('0x28')](db[_0x9438('0x3e')][_0x9438('0x1f')]);_0x1baa4e['query']=_[_0x9438('0x28')](_0x26acd1['query']);_0x1baa4e[_0x9438('0x29')]=_[_0x9438('0x2a')](_0x1baa4e[_0x9438('0x27')],_0x1baa4e['query']);_0x46ef73[_0x9438('0x2b')]=_[_0x9438('0x2a')](_0x1baa4e[_0x9438('0x27')],qs[_0x9438('0x2c')](_0x26acd1[_0x9438('0x22')]['fields']));_0x46ef73[_0x9438('0x2b')]=_0x46ef73['attributes'][_0x9438('0x2d')]?_0x46ef73[_0x9438('0x2b')]:_0x1baa4e[_0x9438('0x27')];if(!_0x26acd1['query'][_0x9438('0x3f')](_0x9438('0x40'))){_0x46ef73[_0x9438('0x12')]=qs[_0x9438('0x12')](_0x26acd1[_0x9438('0x22')][_0x9438('0x12')]);_0x46ef73['offset']=qs[_0x9438('0xf')](_0x26acd1[_0x9438('0x22')][_0x9438('0xf')]);}_0x46ef73[_0x9438('0x41')]=qs[_0x9438('0x42')](_0x26acd1[_0x9438('0x22')][_0x9438('0x42')]);_0x46ef73['where']=qs[_0x9438('0x29')](_[_0x9438('0x43')](_0x26acd1[_0x9438('0x22')],_0x1baa4e[_0x9438('0x29')]));_0x46ef73['where'][_0x9438('0x44')]=_0x4805c8['id'];if(_0x26acd1['query'][_0x9438('0x45')]){_0x46ef73['where']=_[_0x9438('0x46')](_0x46ef73[_0x9438('0x21')],{'$or':_['map'](_0x46ef73[_0x9438('0x2b')],function(_0x2f07b1){var _0x2acbee={};_0x2acbee[_0x2f07b1]={'$like':'%'+_0x26acd1[_0x9438('0x22')][_0x9438('0x45')]+'%'};return _0x2acbee;})});}_0x46ef73=_[_0x9438('0x46')]({},_0x46ef73,_0x26acd1[_0x9438('0x2e')]);return db[_0x9438('0x3e')]['findAll'](_0x46ef73);}})[_0x9438('0x16')](function(_0x19c49a){if(_0x19c49a){return db[_0x9438('0x47')][_0x9438('0x48')]({'where':{'id':_[_0x9438('0x1d')](_0x19c49a,_0x9438('0x49')),'role':_0x9438('0x4a')},'attributes':['id',_0x9438('0x1a'),_0x9438('0x4b'),_0x9438('0x4c'),_0x9438('0x4d')]});}})[_0x9438('0x16')](function(_0x16fb38){if(_0x16fb38){return{'count':_0x16fb38[_0x9438('0x11')],'rows':_[_0x9438('0x1d')](_0x16fb38[_0x9438('0x4e')],function(_0x330f9b){return{'membername':_0x330f9b[_0x9438('0x1a')],'UserId':_0x330f9b['id'],'queue_name':_0x356262[_0x9438('0x1a')],'ChatQueueId':_0x356262['id'],'interface':util[_0x9438('0x4f')](_0x9438('0x50'),_0x9438('0x51'),_0x330f9b[_0x9438('0x1a')]),'penalty':0x0,'paused':_0x330f9b[_0x9438('0x4b')],'createdAt':_0x330f9b[_0x9438('0x4d')],'updatedAt':_0x330f9b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9438('0x16')](respondWithFilteredResult(_0x4b2f1e,_0x46ef73))[_0x9438('0x24')](handleError(_0x4b2f1e,null));};exports[_0x9438('0x52')]=function(_0x415374,_0x38b70f){var _0x2dc554={};var _0x38f964={};var _0x51f283;var _0x275d92;return db[_0x9438('0x1e')][_0x9438('0x3d')]({'where':{'id':_0x415374['params']['id']}})['then'](handleEntityNotFound(_0x38b70f,null))[_0x9438('0x16')](function(_0x4e3a39){if(_0x4e3a39){_0x51f283=_0x4e3a39;_0x38f964['model']=_[_0x9438('0x28')](db[_0x9438('0x53')][_0x9438('0x1f')]);_0x38f964[_0x9438('0x22')]=_[_0x9438('0x28')](_0x415374['query']);_0x38f964[_0x9438('0x29')]=_[_0x9438('0x2a')](_0x38f964[_0x9438('0x27')],_0x38f964[_0x9438('0x22')]);_0x2dc554[_0x9438('0x2b')]=_[_0x9438('0x2a')](_0x38f964[_0x9438('0x27')],qs[_0x9438('0x2c')](_0x415374[_0x9438('0x22')][_0x9438('0x2c')]));_0x2dc554[_0x9438('0x2b')]=_0x2dc554[_0x9438('0x2b')][_0x9438('0x2d')]?_0x2dc554[_0x9438('0x2b')]:_0x38f964[_0x9438('0x27')];_0x2dc554[_0x9438('0x41')]=qs['sort'](_0x415374[_0x9438('0x22')]['sort']);_0x2dc554[_0x9438('0x21')]=qs['filters'](_[_0x9438('0x43')](_0x415374[_0x9438('0x22')],_0x38f964[_0x9438('0x29')]));if(_0x415374[_0x9438('0x22')][_0x9438('0x45')]){_0x2dc554[_0x9438('0x21')]=_[_0x9438('0x46')](_0x2dc554[_0x9438('0x21')],{'$or':_[_0x9438('0x1d')](_0x2dc554[_0x9438('0x2b')],function(_0x3a8cc5){var _0x1acf4f={};_0x1acf4f[_0x3a8cc5]={'$like':'%'+_0x415374[_0x9438('0x22')][_0x9438('0x45')]+'%'};return _0x1acf4f;})});}_0x2dc554=_['merge']({},_0x2dc554,_0x415374[_0x9438('0x2e')]);return _0x51f283[_0x9438('0x52')](_0x2dc554);}})['then'](function(_0x2c4d2c){if(_0x2c4d2c){_0x275d92=_0x2c4d2c[_0x9438('0x2d')];if(!_0x415374[_0x9438('0x22')]['hasOwnProperty'](_0x9438('0x40'))){_0x2dc554['limit']=qs[_0x9438('0x12')](_0x415374[_0x9438('0x22')][_0x9438('0x12')]);_0x2dc554['offset']=qs[_0x9438('0xf')](_0x415374[_0x9438('0x22')][_0x9438('0xf')]);}return _0x51f283[_0x9438('0x52')](_0x2dc554);}})[_0x9438('0x16')](function(_0x544b52){if(_0x544b52){return _0x544b52?{'count':_0x275d92,'rows':_0x544b52}:null;}})[_0x9438('0x16')](respondWithResult(_0x38b70f,null))[_0x9438('0x24')](handleError(_0x38b70f,null));};exports[_0x9438('0x54')]=function(_0x14755d,_0x5b92f4){var _0xb4fcfb=_0x14755d['body'][_0x9438('0x55')];return db[_0x9438('0x53')]['findAll']({'where':{'id':_0xb4fcfb},'attributes':['id'],'include':[{'model':db[_0x9438('0x47')],'as':'Agents','attributes':['id','name',_0x9438('0x56'),_0x9438('0x57'),_0x9438('0x58')],'raw':!![]}]})[_0x9438('0x16')](function(_0x59a8cd){if(_0x59a8cd){var _0x2f91d8=_[_0x9438('0x59')](_0x59a8cd,function(_0x5919be){var _0x662bbf=_0x5919be['get']({'plain':!![]});return _0x662bbf['Agents'];});return db[_0x9438('0x1e')][_0x9438('0x2f')]({'where':{'id':_0x14755d[_0x9438('0x26')]['id']}})['then'](function(_0x5cb26d){return db[_0x9438('0x5a')][_0x9438('0x5b')](function(_0x56894d){return _0x5cb26d[_0x9438('0x54')](_0xb4fcfb,{'transaction':_0x56894d})['then'](function(){return BPromise['each'](_0x2f91d8,function(_0x2793b7){return db[_0x9438('0x3e')]['findOrCreate']({'where':{'UserId':_0x2793b7['id'],'ChatQueueId':_0x14755d[_0x9438('0x26')]['id']},'transaction':_0x56894d});});})['then'](function(){_0x2f91d8[_0x9438('0x5c')](function(_0x4541f8){socket[_0x9438('0x5d')](_0x9438('0x5e'),{'UserId':_0x4541f8['id'],'ChatQueueId':_0x5cb26d['id']});});});});});}})[_0x9438('0x16')](respondWithStatusCode(_0x5b92f4,null))[_0x9438('0x24')](handleError(_0x5b92f4,null));};exports[_0x9438('0x5f')]=function(_0x14f2b7,_0x51bb97){return db[_0x9438('0x53')][_0x9438('0x23')]({'where':{'id':_0x14f2b7[_0x9438('0x22')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9438('0x47')],'as':_0x9438('0x60'),'attributes':['id'],'raw':!![]}]})[_0x9438('0x16')](handleEntityNotFound(_0x51bb97,null))['then'](function(_0x41c44d){var _0x26a6fa=_['map'](_0x41c44d,'id');var _0x3943fd=[];var _0x49b56a=[];var _0xd5a687=squel['select']();_0xd5a687[_0x9438('0x61')](_0x9438('0x62'))[_0x9438('0x63')](_0x9438('0x64'),'tq')[_0x9438('0x65')]('user_has_teams','ut',_0x9438('0x66'))['where'](_0x9438('0x67'),_0x14f2b7[_0x9438('0x26')]['id']);for(var _0x228251=0x0;_0x228251<_0x41c44d[_0x9438('0x2d')];_0x228251+=0x1){let _0x3514eb=_0x41c44d[_0x228251];for(var _0x2eed52=0x0;_0x2eed52<_0x3514eb[_0x9438('0x60')][_0x9438('0x2d')];_0x2eed52+=0x1){let _0x43c1b5=_0x3514eb['Agents'][_0x2eed52];var _0x7913c0=_0xd5a687[_0x9438('0x68')]();_0x7913c0['where']('ut.UserId\x20=\x20?',_0x43c1b5['id']);_0x49b56a['push'](db[_0x9438('0x5a')]['query'](_0x7913c0[_0x9438('0x69')](),{'type':db[_0x9438('0x5a')][_0x9438('0x6a')][_0x9438('0x6b')]})[_0x9438('0x16')](function(_0x2ebb0a){if(_0x2ebb0a['length']===0x1){return _0x43c1b5['id'];}else{var _0x2eb8a8=_[_0x9438('0x6c')](_['map'](_0x2ebb0a,_0x9438('0x6d')),function(_0x3138c8){return _[_0x9438('0x6e')](_0x26a6fa,_0x3138c8);});if(_0x2eb8a8){return _0x43c1b5['id'];}}}));}}return BPromise[_0x9438('0x6f')](_0x49b56a)['then'](function(_0x2a41af){_0x3943fd=_(_0x3943fd)[_0x9438('0x70')](_0x2a41af)[_0x9438('0x71')]()[_0x9438('0x72')]();return db['ChatQueue']['find']({'where':{'id':_0x14f2b7[_0x9438('0x26')]['id']}})[_0x9438('0x16')](function(_0x5fc695){return db[_0x9438('0x5a')][_0x9438('0x5b')](function(_0x146f9d){return _0x5fc695[_0x9438('0x5f')](_0x14f2b7[_0x9438('0x22')][_0x9438('0x55')],{'transaction':_0x146f9d})['then'](function(){if(!_['isEmpty'](_0x3943fd)){return _0x5fc695[_0x9438('0x73')](_0x3943fd,{'transaction':_0x146f9d});}})['then'](function(){_0x3943fd[_0x9438('0x5c')](function(_0x2ce80b){socket[_0x9438('0x5d')]('userChatQueue:remove',{'UserId':_0x2ce80b,'ChatQueueId':_0x5fc695['id']});});});});});});})[_0x9438('0x16')](respondWithStatusCode(_0x51bb97,null))['catch'](handleError(_0x51bb97,null));};exports['addAgents']=function(_0xe3bc19,_0x166668){return db[_0x9438('0x1e')][_0x9438('0x2f')]({'where':{'id':_0xe3bc19[_0x9438('0x26')]['id']}})['then'](handleEntityNotFound(_0x166668,null))[_0x9438('0x16')](function(_0x4031f){if(_0x4031f){return _0x4031f[_0x9438('0x74')](_0xe3bc19['body']['ids'],_[_0x9438('0x75')](_0xe3bc19[_0x9438('0x31')],[_0x9438('0x55'),'id'])||{})[_0x9438('0x76')](function(_0x4d5caf){for(var _0x5958a6=0x0;_0x5958a6<_0xe3bc19['body'][_0x9438('0x55')][_0x9438('0x2d')];_0x5958a6+=0x1){socket['emit'](_0x9438('0x5e'),{'UserId':Number(_0xe3bc19[_0x9438('0x31')][_0x9438('0x55')][_0x5958a6]),'ChatQueueId':Number(_0xe3bc19['params']['id'])});}return _0x4d5caf;});}})[_0x9438('0x16')](respondWithResult(_0x166668,null))[_0x9438('0x24')](handleError(_0x166668,null));};exports[_0x9438('0x73')]=function(_0x28c11f,_0x4ccc95){return db[_0x9438('0x1e')][_0x9438('0x2f')]({'where':{'id':_0x28c11f[_0x9438('0x26')]['id']}})[_0x9438('0x16')](handleEntityNotFound(_0x4ccc95,null))[_0x9438('0x16')](function(_0x2f3ee6){if(_0x2f3ee6){return _0x2f3ee6[_0x9438('0x73')](_0x28c11f[_0x9438('0x22')]['ids'])[_0x9438('0x16')](function(){if(_[_0x9438('0x77')](_0x28c11f['query'][_0x9438('0x55')])){for(var _0x5b3e76=0x0;_0x5b3e76<_0x28c11f[_0x9438('0x22')][_0x9438('0x55')][_0x9438('0x2d')];_0x5b3e76+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x28c11f[_0x9438('0x22')][_0x9438('0x55')][_0x5b3e76]),'ChatQueueId':Number(_0x28c11f[_0x9438('0x26')]['id'])});}}else{socket[_0x9438('0x5d')]('userChatQueue:remove',{'UserId':Number(_0x28c11f['query']['ids']),'ChatQueueId':Number(_0x28c11f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4ccc95,null))[_0x9438('0x24')](handleError(_0x4ccc95,null));};exports[_0x9438('0x78')]=function(_0x1d14cd,_0x13a720){var _0x528e80={};var _0x56d7c8={};var _0x22b5a1;var _0x5c5878;return db[_0x9438('0x1e')]['findOne']({'where':{'id':_0x1d14cd[_0x9438('0x26')]['id']}})['then'](handleEntityNotFound(_0x13a720,null))[_0x9438('0x16')](function(_0x3c8d97){if(_0x3c8d97){_0x22b5a1=_0x3c8d97;_0x56d7c8[_0x9438('0x27')]=_[_0x9438('0x28')](db[_0x9438('0x47')][_0x9438('0x1f')]);_0x56d7c8[_0x9438('0x22')]=_[_0x9438('0x28')](_0x1d14cd[_0x9438('0x22')]);_0x56d7c8[_0x9438('0x29')]=_[_0x9438('0x2a')](_0x56d7c8[_0x9438('0x27')],_0x56d7c8[_0x9438('0x22')]);_0x528e80[_0x9438('0x2b')]=_[_0x9438('0x2a')](_0x56d7c8[_0x9438('0x27')],qs[_0x9438('0x2c')](_0x1d14cd[_0x9438('0x22')][_0x9438('0x2c')]));_0x528e80[_0x9438('0x2b')]=_0x528e80[_0x9438('0x2b')][_0x9438('0x2d')]?_0x528e80['attributes']:_0x56d7c8[_0x9438('0x27')];_0x528e80[_0x9438('0x41')]=qs[_0x9438('0x42')](_0x1d14cd[_0x9438('0x22')][_0x9438('0x42')]);_0x528e80[_0x9438('0x21')]=qs['filters'](_[_0x9438('0x43')](_0x1d14cd[_0x9438('0x22')],_0x56d7c8['filters']));if(_0x1d14cd[_0x9438('0x22')][_0x9438('0x45')]){_0x528e80[_0x9438('0x21')]=_['merge'](_0x528e80['where'],{'$or':_['map'](_0x528e80['attributes'],function(_0x41a94a){var _0x2404f9={};_0x2404f9[_0x41a94a]={'$like':'%'+_0x1d14cd[_0x9438('0x22')][_0x9438('0x45')]+'%'};return _0x2404f9;})});}_0x528e80=_[_0x9438('0x46')]({},_0x528e80,_0x1d14cd[_0x9438('0x2e')]);return _0x22b5a1[_0x9438('0x78')](_0x528e80);}})[_0x9438('0x16')](function(_0x191279){if(_0x191279){_0x5c5878=_0x191279[_0x9438('0x2d')];if(!_0x1d14cd[_0x9438('0x22')][_0x9438('0x3f')](_0x9438('0x40'))){_0x528e80[_0x9438('0x12')]=qs[_0x9438('0x12')](_0x1d14cd[_0x9438('0x22')][_0x9438('0x12')]);_0x528e80[_0x9438('0xf')]=qs[_0x9438('0xf')](_0x1d14cd[_0x9438('0x22')][_0x9438('0xf')]);}return _0x22b5a1[_0x9438('0x78')](_0x528e80);}})[_0x9438('0x16')](function(_0x262d4f){if(_0x262d4f){return _0x262d4f?{'count':_0x5c5878,'rows':_0x262d4f}:null;}})['then'](respondWithResult(_0x13a720,null))[_0x9438('0x24')](handleError(_0x13a720,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index de4a0ae..18b7f38 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 _0x6108=['ChatQueue','setMaxListeners','save','emit','hasOwnProperty','hook','events'];(function(_0x4b0733,_0x2324ed){var _0x1d5fdc=function(_0x2fb672){while(--_0x2fb672){_0x4b0733['push'](_0x4b0733['shift']());}};_0x1d5fdc(++_0x2324ed);}(_0x6108,0xbc));var _0x8610=function(_0x3fc430,_0x17dcdf){_0x3fc430=_0x3fc430-0x0;var _0x59a28d=_0x6108[_0x3fc430];return _0x59a28d;};'use strict';var EventEmitter=require(_0x8610('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x8610('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8610('0x2')](0x0);var events={'afterCreate':_0x8610('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x142cb5){return function(_0x42741d,_0x54802f,_0x4aa00f){ChatQueueEvents[_0x8610('0x4')](_0x142cb5+':'+_0x42741d['id'],_0x42741d);ChatQueueEvents[_0x8610('0x4')](_0x142cb5,_0x42741d);_0x4aa00f(null);};}for(var e in events){if(events[_0x8610('0x5')](e)){var event=events[e];ChatQueue[_0x8610('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x61a2=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3a97d2,_0x45ac9e){var _0x3a927c=function(_0x3c7f48){while(--_0x3c7f48){_0x3a97d2['push'](_0x3a97d2['shift']());}};_0x3a927c(++_0x45ac9e);}(_0x61a2,0x184));var _0x261a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x61a2[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0x261a('0x0'));var ChatQueue=require(_0x261a('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x261a('0x2')](0x0);var events={'afterCreate':_0x261a('0x3'),'afterUpdate':_0x261a('0x4'),'afterDestroy':_0x261a('0x5')};function emitEvent(_0x27eb98){return function(_0x156ef3,_0x104617,_0x3463e4){ChatQueueEvents[_0x261a('0x6')](_0x27eb98+':'+_0x156ef3['id'],_0x156ef3);ChatQueueEvents[_0x261a('0x6')](_0x27eb98,_0x156ef3);_0x3463e4(null);};}for(var e in events){if(events[_0x261a('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x261a('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 869899e..4cde105 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 _0xe2a6=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x241ec1,_0x2fac9e){var _0x3de936=function(_0x5f3ce5){while(--_0x5f3ce5){_0x241ec1['push'](_0x241ec1['shift']());}};_0x3de936(++_0x2fac9e);}(_0xe2a6,0xcb));var _0x6e2a=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0xe2a6[_0x1f6f84];return _0x177f40;};'use strict';var _=require(_0x6e2a('0x0'));var util=require(_0x6e2a('0x1'));var logger=require(_0x6e2a('0x2'))('api');var moment=require(_0x6e2a('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e2a('0x4'));var fs=require('fs');var path=require(_0x6e2a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e2a('0x6'));module[_0x6e2a('0x7')]=function(_0x21c8c9,_0x5a7340){return _0x21c8c9[_0x6e2a('0x8')](_0x6e2a('0x9'),attributes,{'tableName':_0x6e2a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c76=['ChatQueue','chat_queues','lodash','util','api','bluebird','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x332960,_0x52d3a5){var _0x3ac280=function(_0x42ae36){while(--_0x42ae36){_0x332960['push'](_0x332960['shift']());}};_0x3ac280(++_0x52d3a5);}(_0x0c76,0x120));var _0x60c7=function(_0x47c4bd,_0x4492f2){_0x47c4bd=_0x47c4bd-0x0;var _0x356830=_0x0c76[_0x47c4bd];return _0x356830;};'use strict';var _=require(_0x60c7('0x0'));var util=require(_0x60c7('0x1'));var logger=require('../../config/logger')(_0x60c7('0x2'));var moment=require('moment');var BPromise=require(_0x60c7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x60c7('0x4'));var config=require(_0x60c7('0x5'));var attributes=require(_0x60c7('0x6'));module[_0x60c7('0x7')]=function(_0x1f29b6,_0x5470e4){return _0x1f29b6[_0x60c7('0x8')](_0x60c7('0x9'),attributes,{'tableName':_0x60c7('0xa'),'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 dabf809..067b9af 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 _0xafcd=['then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','map','include','model','stringify','ShowChatQueue'];(function(_0x9bcc0b,_0x120f6c){var _0x195399=function(_0x5be8b9){while(--_0x5be8b9){_0x9bcc0b['push'](_0x9bcc0b['shift']());}};_0x195399(++_0x120f6c);}(_0xafcd,0x157));var _0xdafc=function(_0x292380,_0x2c9565){_0x292380=_0x292380-0x0;var _0x148f5d=_0xafcd[_0x292380];return _0x148f5d;};'use strict';var _=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var moment=require(_0xdafc('0x2'));var BPromise=require(_0xdafc('0x3'));var rs=require(_0xdafc('0x4'));var fs=require('fs');var Redis=require(_0xdafc('0x5'));var db=require(_0xdafc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdafc('0x7'))(_0xdafc('0x8'));var config=require(_0xdafc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdafc('0xa')][_0xdafc('0xb')]({'port':0x232a});config[_0xdafc('0xc')]=_['defaults'](config[_0xdafc('0xc')],{'host':_0xdafc('0xd'),'port':0x18eb});var socket=require(_0xdafc('0xe'))(new Redis(config[_0xdafc('0xc')]));require(_0xdafc('0xf'))[_0xdafc('0x10')](socket);function respondWithRpcPromise(_0x3df5fb,_0x312e69,_0x1f87c5){return new BPromise(function(_0x2fdc39,_0x39561b){return client['request'](_0x3df5fb,_0x1f87c5)['then'](function(_0x2a1a6b){logger[_0xdafc('0x11')](_0xdafc('0x12'),_0x312e69,_0xdafc('0x13'));logger[_0xdafc('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x312e69,'request\x20sent',JSON['stringify'](_0x2a1a6b));if(_0x2a1a6b[_0xdafc('0x15')]){if(_0x2a1a6b['error'][_0xdafc('0x16')]===0x1f4){logger['error'](_0xdafc('0x12'),_0x312e69,_0x2a1a6b[_0xdafc('0x15')][_0xdafc('0x17')]);return _0x39561b(_0x2a1a6b[_0xdafc('0x15')]['message']);}logger['error'](_0xdafc('0x12'),_0x312e69,_0x2a1a6b[_0xdafc('0x15')][_0xdafc('0x17')]);return _0x2fdc39(_0x2a1a6b['error']['message']);}else{logger[_0xdafc('0x11')](_0xdafc('0x12'),_0x312e69,_0xdafc('0x13'));_0x2fdc39(_0x2a1a6b[_0xdafc('0x18')][_0xdafc('0x17')]);}})[_0xdafc('0x19')](function(_0x1ff505){logger[_0xdafc('0x15')]('ChatQueue,\x20%s,\x20%s',_0x312e69,_0x1ff505);_0x39561b(_0x1ff505);});});}exports[_0xdafc('0x1a')]=function(_0x10258f){var _0x5f4d1d=this;return new Promise(function(_0x239908,_0xb825df){return db[_0xdafc('0x1b')][_0xdafc('0x1c')]({'raw':_0x10258f[_0xdafc('0x1d')]?_0x10258f[_0xdafc('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x10258f['options']?_0x10258f['options'][_0xdafc('0x1e')]||null:null,'attributes':_0x10258f['options']?_0x10258f[_0xdafc('0x1d')][_0xdafc('0x1f')]||null:null,'limit':_0x10258f[_0xdafc('0x1d')]?_0x10258f[_0xdafc('0x1d')]['limit']||null:null,'include':_0x10258f[_0xdafc('0x1d')]?_0x10258f[_0xdafc('0x1d')]['include']?_[_0xdafc('0x20')](_0x10258f[_0xdafc('0x1d')][_0xdafc('0x21')],function(_0x3d3f06){return{'model':db[_0x3d3f06[_0xdafc('0x22')]],'as':_0x3d3f06['as'],'attributes':_0x3d3f06[_0xdafc('0x1f')],'include':_0x3d3f06[_0xdafc('0x21')]?_['map'](_0x3d3f06[_0xdafc('0x21')],function(_0x2d8bb0){return{'model':db[_0x2d8bb0['model']],'as':_0x2d8bb0['as'],'attributes':_0x2d8bb0[_0xdafc('0x1f')],'include':_0x2d8bb0['include']?_['map'](_0x2d8bb0[_0xdafc('0x21')],function(_0x56a820){return{'model':db[_0x56a820[_0xdafc('0x22')]],'as':_0x56a820['as'],'attributes':_0x56a820[_0xdafc('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2752bd){logger['info']('GetChatQueue',_0x10258f);logger['debug'](_0xdafc('0x1a'),_0x10258f,JSON[_0xdafc('0x23')](_0x2752bd));_0x239908(_0x2752bd);})[_0xdafc('0x19')](function(_0x219e1e){logger[_0xdafc('0x15')](_0xdafc('0x1a'),_0x219e1e[_0xdafc('0x17')],_0x10258f);_0xb825df(_0x5f4d1d['error'](0x1f4,_0x219e1e[_0xdafc('0x17')]));});});};exports[_0xdafc('0x24')]=function(_0x51f59f){var _0x5e1f4c=this;return new Promise(function(_0x3d91b5,_0x727050){return db['ChatQueue']['find']({'raw':_0x51f59f[_0xdafc('0x1d')]?_0x51f59f[_0xdafc('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x51f59f['options']?_0x51f59f['options']['where']||null:null,'attributes':_0x51f59f[_0xdafc('0x1d')]?_0x51f59f['options'][_0xdafc('0x1f')]||null:null,'include':_0x51f59f[_0xdafc('0x1d')]?_0x51f59f[_0xdafc('0x1d')][_0xdafc('0x21')]?_['map'](_0x51f59f[_0xdafc('0x1d')][_0xdafc('0x21')],function(_0x25ee4c){return{'model':db[_0x25ee4c[_0xdafc('0x22')]],'as':_0x25ee4c['as'],'attributes':_0x25ee4c[_0xdafc('0x1f')],'include':_0x25ee4c[_0xdafc('0x21')]?_['map'](_0x25ee4c[_0xdafc('0x21')],function(_0x413862){return{'model':db[_0x413862[_0xdafc('0x22')]],'as':_0x413862['as'],'attributes':_0x413862['attributes'],'include':_0x413862[_0xdafc('0x21')]?_['map'](_0x413862[_0xdafc('0x21')],function(_0x4a1591){return{'model':db[_0x4a1591[_0xdafc('0x22')]],'as':_0x4a1591['as'],'attributes':_0x4a1591[_0xdafc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdafc('0x25')](function(_0x52ff5b){logger[_0xdafc('0x11')](_0xdafc('0x24'),_0x51f59f);logger[_0xdafc('0x14')]('ShowChatQueue',_0x51f59f,JSON[_0xdafc('0x23')](_0x52ff5b));_0x3d91b5(_0x52ff5b);})['catch'](function(_0x13fc41){logger[_0xdafc('0x15')](_0xdafc('0x24'),_0x13fc41['message'],_0x51f59f);_0x727050(_0x5e1f4c['error'](0x1f4,_0x13fc41[_0xdafc('0x17')]));});});};
\ No newline at end of file
+var _0xf7d9=['then','ShowChatQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','limit','include','model','attributes','map'];(function(_0x32632b,_0x2c134c){var _0x7f7571=function(_0xb0b978){while(--_0xb0b978){_0x32632b['push'](_0x32632b['shift']());}};_0x7f7571(++_0x2c134c);}(_0xf7d9,0x122));var _0x9f7d=function(_0x1c293b,_0x2bffe4){_0x1c293b=_0x1c293b-0x0;var _0x245d04=_0xf7d9[_0x1c293b];return _0x245d04;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var moment=require(_0x9f7d('0x2'));var BPromise=require(_0x9f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f7d('0x5'))(_0x9f7d('0x6'));var config=require(_0x9f7d('0x7'));var jayson=require(_0x9f7d('0x8'));var client=jayson[_0x9f7d('0x9')]['http']({'port':0x232a});config['redis']=_[_0x9f7d('0xa')](config[_0x9f7d('0xb')],{'host':_0x9f7d('0xc'),'port':0x18eb});var socket=require(_0x9f7d('0xd'))(new Redis(config[_0x9f7d('0xb')]));require(_0x9f7d('0xe'))['register'](socket);function respondWithRpcPromise(_0x9a9655,_0x2baa65,_0x4eecfd){return new BPromise(function(_0x405b3c,_0x2227e3){return client[_0x9f7d('0xf')](_0x9a9655,_0x4eecfd)['then'](function(_0x43a48e){logger[_0x9f7d('0x10')](_0x9f7d('0x11'),_0x2baa65,_0x9f7d('0x12'));logger[_0x9f7d('0x13')](_0x9f7d('0x14'),_0x2baa65,'request\x20sent',JSON[_0x9f7d('0x15')](_0x43a48e));if(_0x43a48e[_0x9f7d('0x16')]){if(_0x43a48e[_0x9f7d('0x16')][_0x9f7d('0x17')]===0x1f4){logger['error'](_0x9f7d('0x11'),_0x2baa65,_0x43a48e[_0x9f7d('0x16')][_0x9f7d('0x18')]);return _0x2227e3(_0x43a48e[_0x9f7d('0x16')][_0x9f7d('0x18')]);}logger[_0x9f7d('0x16')](_0x9f7d('0x11'),_0x2baa65,_0x43a48e['error']['message']);return _0x405b3c(_0x43a48e[_0x9f7d('0x16')][_0x9f7d('0x18')]);}else{logger[_0x9f7d('0x10')](_0x9f7d('0x11'),_0x2baa65,_0x9f7d('0x12'));_0x405b3c(_0x43a48e[_0x9f7d('0x19')][_0x9f7d('0x18')]);}})[_0x9f7d('0x1a')](function(_0x3d2bcf){logger['error'](_0x9f7d('0x11'),_0x2baa65,_0x3d2bcf);_0x2227e3(_0x3d2bcf);});});}exports[_0x9f7d('0x1b')]=function(_0x50204c){var _0x4c2977=this;return new Promise(function(_0x5b17ad,_0x3f650e){return db[_0x9f7d('0x1c')][_0x9f7d('0x1d')]({'raw':_0x50204c['options']?_0x50204c['options'][_0x9f7d('0x1e')]===undefined?!![]:![]:!![],'where':_0x50204c[_0x9f7d('0x1f')]?_0x50204c[_0x9f7d('0x1f')][_0x9f7d('0x20')]||null:null,'attributes':_0x50204c[_0x9f7d('0x1f')]?_0x50204c[_0x9f7d('0x1f')]['attributes']||null:null,'limit':_0x50204c[_0x9f7d('0x1f')]?_0x50204c['options'][_0x9f7d('0x21')]||null:null,'include':_0x50204c['options']?_0x50204c['options'][_0x9f7d('0x22')]?_['map'](_0x50204c['options'][_0x9f7d('0x22')],function(_0xe2ada9){return{'model':db[_0xe2ada9[_0x9f7d('0x23')]],'as':_0xe2ada9['as'],'attributes':_0xe2ada9[_0x9f7d('0x24')],'include':_0xe2ada9['include']?_['map'](_0xe2ada9[_0x9f7d('0x22')],function(_0x238d13){return{'model':db[_0x238d13[_0x9f7d('0x23')]],'as':_0x238d13['as'],'attributes':_0x238d13[_0x9f7d('0x24')],'include':_0x238d13['include']?_[_0x9f7d('0x25')](_0x238d13[_0x9f7d('0x22')],function(_0x8c6833){return{'model':db[_0x8c6833[_0x9f7d('0x23')]],'as':_0x8c6833['as'],'attributes':_0x8c6833[_0x9f7d('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9f7d('0x26')](function(_0x3ec5a0){logger[_0x9f7d('0x10')]('GetChatQueue',_0x50204c);logger['debug'](_0x9f7d('0x1b'),_0x50204c,JSON[_0x9f7d('0x15')](_0x3ec5a0));_0x5b17ad(_0x3ec5a0);})[_0x9f7d('0x1a')](function(_0x1a467d){logger[_0x9f7d('0x16')](_0x9f7d('0x1b'),_0x1a467d[_0x9f7d('0x18')],_0x50204c);_0x3f650e(_0x4c2977[_0x9f7d('0x16')](0x1f4,_0x1a467d['message']));});});};exports[_0x9f7d('0x27')]=function(_0x1d4f34){var _0x30a12e=this;return new Promise(function(_0x4fa5b4,_0x2c27fd){return db[_0x9f7d('0x1c')][_0x9f7d('0x28')]({'raw':_0x1d4f34['options']?_0x1d4f34[_0x9f7d('0x1f')][_0x9f7d('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d4f34['options']?_0x1d4f34[_0x9f7d('0x1f')][_0x9f7d('0x20')]||null:null,'attributes':_0x1d4f34[_0x9f7d('0x1f')]?_0x1d4f34['options']['attributes']||null:null,'include':_0x1d4f34[_0x9f7d('0x1f')]?_0x1d4f34[_0x9f7d('0x1f')][_0x9f7d('0x22')]?_[_0x9f7d('0x25')](_0x1d4f34[_0x9f7d('0x1f')][_0x9f7d('0x22')],function(_0x498bdf){return{'model':db[_0x498bdf['model']],'as':_0x498bdf['as'],'attributes':_0x498bdf[_0x9f7d('0x24')],'include':_0x498bdf['include']?_['map'](_0x498bdf[_0x9f7d('0x22')],function(_0x2dd9ff){return{'model':db[_0x2dd9ff[_0x9f7d('0x23')]],'as':_0x2dd9ff['as'],'attributes':_0x2dd9ff[_0x9f7d('0x24')],'include':_0x2dd9ff['include']?_[_0x9f7d('0x25')](_0x2dd9ff['include'],function(_0x1ef808){return{'model':db[_0x1ef808[_0x9f7d('0x23')]],'as':_0x1ef808['as'],'attributes':_0x1ef808[_0x9f7d('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9f7d('0x26')](function(_0x4bb270){logger[_0x9f7d('0x10')](_0x9f7d('0x27'),_0x1d4f34);logger[_0x9f7d('0x13')](_0x9f7d('0x27'),_0x1d4f34,JSON['stringify'](_0x4bb270));_0x4fa5b4(_0x4bb270);})[_0x9f7d('0x1a')](function(_0x1f61b0){logger[_0x9f7d('0x16')](_0x9f7d('0x27'),_0x1f61b0[_0x9f7d('0x18')],_0x1d4f34);_0x2c27fd(_0x30a12e[_0x9f7d('0x16')](0x1f4,_0x1f61b0[_0x9f7d('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 6f4bb2c..02c3367 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 _0x04de=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x04de,0x107));var _0xe04d=function(_0x376ca9,_0x3754dd){_0x376ca9=_0x376ca9-0x0;var _0xeda94=_0x04de[_0x376ca9];return _0xeda94;};'use strict';var ChatQueueEvents=require(_0xe04d('0x0'));var events=[_0xe04d('0x1'),_0xe04d('0x2'),_0xe04d('0x3')];function createListener(_0x1e650d,_0x28f63f){return function(_0x1113af){_0x28f63f[_0xe04d('0x4')](_0x1e650d,_0x1113af);};}function removeListener(_0x2593a4,_0x70ead0){return function(){ChatQueueEvents[_0xe04d('0x5')](_0x2593a4,_0x70ead0);};}exports['register']=function(_0x4bb925){for(var _0x4f7637=0x0,_0x531688=events[_0xe04d('0x6')];_0x4f7637<_0x531688;_0x4f7637++){var _0x210e93=events[_0x4f7637];var _0x72b1ce=createListener(_0xe04d('0x7')+_0x210e93,_0x4bb925);ChatQueueEvents['on'](_0x210e93,_0x72b1ce);}};
\ No newline at end of file
+var _0x4ea3=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x7b6b42,_0x20eea3){var _0x1496c3=function(_0x2b1815){while(--_0x2b1815){_0x7b6b42['push'](_0x7b6b42['shift']());}};_0x1496c3(++_0x20eea3);}(_0x4ea3,0x70));var _0x34ea=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4ea3[_0x5b644e];return _0x49c6bf;};'use strict';var ChatQueueEvents=require(_0x34ea('0x0'));var events=[_0x34ea('0x1'),_0x34ea('0x2'),_0x34ea('0x3')];function createListener(_0x588172,_0x374ec1){return function(_0x494b56){_0x374ec1[_0x34ea('0x4')](_0x588172,_0x494b56);};}function removeListener(_0x571f1b,_0x5e5a84){return function(){ChatQueueEvents[_0x34ea('0x5')](_0x571f1b,_0x5e5a84);};}exports[_0x34ea('0x6')]=function(_0x962596){for(var _0x123d48=0x0,_0x40434e=events[_0x34ea('0x7')];_0x123d48<_0x40434e;_0x123d48++){var _0x22b09e=events[_0x123d48];var _0x5bec7c=createListener(_0x34ea('0x8')+_0x22b09e,_0x962596);ChatQueueEvents['on'](_0x22b09e,_0x5bec7c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e895da3..726dc4e 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x3d6fb8,_0x1cb6e5){var _0xf21d8a=function(_0x1f9429){while(--_0x1f9429){_0x3d6fb8['push'](_0x3d6fb8['shift']());}};_0xf21d8a(++_0x1cb6e5);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x310af3,_0x1e6f47){var _0x317f9a=function(_0x33667f){while(--_0x33667f){_0x310af3['push'](_0x310af3['shift']());}};_0x317f9a(++_0x1e6f47);}(_0xe14b,0x93));var _0xbe14=function(_0x19d0f4,_0x38b420){_0x19d0f4=_0x19d0f4-0x0;var _0x186ed6=_0xe14b[_0x19d0f4];return _0x186ed6;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 710ef8d..f9b7c5e 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 _0x3739=['DATE','moment','exports','STRING'];(function(_0x177135,_0x156a57){var _0x356eee=function(_0x59a61f){while(--_0x59a61f){_0x177135['push'](_0x177135['shift']());}};_0x356eee(++_0x156a57);}(_0x3739,0x1f1));var _0x9373=function(_0x415ac5,_0x663a59){_0x415ac5=_0x415ac5-0x0;var _0x2fb770=_0x3739[_0x415ac5];return _0x2fb770;};'use strict';var moment=require(_0x9373('0x0'));var Sequelize=require('sequelize');module[_0x9373('0x1')]={'uniqueid':{'type':Sequelize[_0x9373('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9373('0x2')]},'joinAt':{'type':Sequelize[_0x9373('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9373('0x3')]},'reason':{'type':Sequelize[_0x9373('0x2')]}};
\ No newline at end of file
+var _0xc51e=['sequelize','exports','STRING','DATE'];(function(_0x4ddf8a,_0x1fe45e){var _0x1794b1=function(_0x55c1b7){while(--_0x55c1b7){_0x4ddf8a['push'](_0x4ddf8a['shift']());}};_0x1794b1(++_0x1fe45e);}(_0xc51e,0x1a0));var _0xec51=function(_0x455e00,_0x29577f){_0x455e00=_0x455e00-0x0;var _0x568400=_0xc51e[_0x455e00];return _0x568400;};'use strict';var moment=require('moment');var Sequelize=require(_0xec51('0x0'));module[_0xec51('0x1')]={'uniqueid':{'type':Sequelize[_0xec51('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xec51('0x3')]},'leaveAt':{'type':Sequelize[_0xec51('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xec51('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index d39a477..4a5dcd8 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 _0xc677=['ChatQueueReport','includeAll','include','catch','show','params','filters','intersection','find','create','update','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','then','end','name','send','index','map','rawAttributes','type','key','query','keys','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options'];(function(_0x4c7e96,_0xc2c958){var _0x1a021c=function(_0x1b693c){while(--_0x1b693c){_0x4c7e96['push'](_0x4c7e96['shift']());}};_0x1a021c(++_0xc2c958);}(_0xc677,0x16c));var _0x7c67=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc677[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c67('0x0'));var zipdir=require(_0x7c67('0x1'));var jsonpatch=require(_0x7c67('0x2'));var rp=require(_0x7c67('0x3'));var moment=require(_0x7c67('0x4'));var BPromise=require(_0x7c67('0x5'));var Mustache=require(_0x7c67('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7c67('0x7'));var fs=require('fs');var fs_extra=require(_0x7c67('0x8'));var _=require('lodash');var squel=require(_0x7c67('0x9'));var crypto=require('crypto');var jsforce=require(_0x7c67('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7c67('0xb'));var querystring=require(_0x7c67('0xc'));var Papa=require(_0x7c67('0xd'));var Redis=require(_0x7c67('0xe'));var authService=require(_0x7c67('0xf'));var qs=require(_0x7c67('0x10'));var as=require(_0x7c67('0x11'));var hardwareService=require(_0x7c67('0x12'));var logger=require(_0x7c67('0x13'))(_0x7c67('0x14'));var utils=require(_0x7c67('0x15'));var config=require(_0x7c67('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c67('0x17'))['db'];function respondWithStatusCode(_0x449661,_0x26fa55){_0x26fa55=_0x26fa55||0xcc;return function(_0x52f65b){if(_0x52f65b){return _0x449661[_0x7c67('0x18')](_0x26fa55);}return _0x449661['status'](_0x26fa55)['end']();};}function respondWithResult(_0x31355e,_0x2935eb){_0x2935eb=_0x2935eb||0xc8;return function(_0x3bf387){if(_0x3bf387){return _0x31355e[_0x7c67('0x19')](_0x2935eb)[_0x7c67('0x1a')](_0x3bf387);}};}function respondWithFilteredResult(_0x3c21c9,_0xd9743c){return function(_0x3a01ad){if(_0x3a01ad){var _0x336bb3=typeof _0xd9743c[_0x7c67('0x1b')]==='undefined'&&typeof _0xd9743c[_0x7c67('0x1c')]===_0x7c67('0x1d');var _0x2a4936=_0x3a01ad[_0x7c67('0x1e')];var _0x35d227=_0x336bb3?0x0:_0xd9743c[_0x7c67('0x1b')];var _0x197de0=_0x336bb3?_0x3a01ad[_0x7c67('0x1e')]:_0xd9743c[_0x7c67('0x1b')]+_0xd9743c[_0x7c67('0x1c')];var _0x30ed2c;if(_0x197de0>=_0x2a4936){_0x197de0=_0x2a4936;_0x30ed2c=0xc8;}else{_0x30ed2c=0xce;}_0x3c21c9[_0x7c67('0x19')](_0x30ed2c);return _0x3c21c9[_0x7c67('0x1f')](_0x7c67('0x20'),_0x35d227+'-'+_0x197de0+'/'+_0x2a4936)[_0x7c67('0x1a')](_0x3a01ad);}return null;};}function patchUpdates(_0x271f4e){return function(_0x307bd0){try{jsonpatch['apply'](_0x307bd0,_0x271f4e,!![]);}catch(_0x17d523){return BPromise['reject'](_0x17d523);}return _0x307bd0[_0x7c67('0x21')]();};}function saveUpdates(_0x1a05aa,_0x2af1fd){return function(_0x3f19ce){if(_0x3f19ce){return _0x3f19ce['update'](_0x1a05aa)['then'](function(_0x35b9c8){return _0x35b9c8;});}return null;};}function removeEntity(_0x11170e,_0x42a3d3){return function(_0x5ebfaf){if(_0x5ebfaf){return _0x5ebfaf['destroy']()[_0x7c67('0x22')](function(){_0x11170e[_0x7c67('0x19')](0xcc)[_0x7c67('0x23')]();});}};}function handleEntityNotFound(_0x670d50,_0xe1863a){return function(_0xf09e83){if(!_0xf09e83){_0x670d50['sendStatus'](0x194);}return _0xf09e83;};}function handleError(_0x250848,_0x11dd8d){_0x11dd8d=_0x11dd8d||0x1f4;return function(_0x52bc2b){logger['error'](_0x52bc2b['stack']);if(_0x52bc2b['name']){delete _0x52bc2b[_0x7c67('0x24')];}_0x250848['status'](_0x11dd8d)[_0x7c67('0x25')](_0x52bc2b);};}exports[_0x7c67('0x26')]=function(_0x2d67d5,_0x42ed09){var _0x2d03ef={},_0x51b48f={},_0x20e77c={'count':0x0,'rows':[]};var _0x42926d=_[_0x7c67('0x27')](db['ChatQueueReport'][_0x7c67('0x28')],function(_0x207846){return{'name':_0x207846['fieldName'],'type':_0x207846[_0x7c67('0x29')][_0x7c67('0x2a')]};});_0x51b48f['model']=_['map'](_0x42926d,_0x7c67('0x24'));_0x51b48f[_0x7c67('0x2b')]=_[_0x7c67('0x2c')](_0x2d67d5[_0x7c67('0x2b')]);_0x51b48f['filters']=_['intersection'](_0x51b48f[_0x7c67('0x2d')],_0x51b48f[_0x7c67('0x2b')]);_0x2d03ef[_0x7c67('0x2e')]=_['intersection'](_0x51b48f[_0x7c67('0x2d')],qs[_0x7c67('0x2f')](_0x2d67d5['query'][_0x7c67('0x2f')]));_0x2d03ef[_0x7c67('0x2e')]=_0x2d03ef[_0x7c67('0x2e')]['length']?_0x2d03ef[_0x7c67('0x2e')]:_0x51b48f[_0x7c67('0x2d')];if(!_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x30')](_0x7c67('0x31'))){_0x2d03ef[_0x7c67('0x1c')]=qs[_0x7c67('0x1c')](_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x1c')]);_0x2d03ef['offset']=qs[_0x7c67('0x1b')](_0x2d67d5['query'][_0x7c67('0x1b')]);}_0x2d03ef[_0x7c67('0x32')]=qs['sort'](_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x33')]);_0x2d03ef[_0x7c67('0x34')]=qs['filters'](_['pick'](_0x2d67d5[_0x7c67('0x2b')],_0x51b48f['filters']),_0x42926d);if(_0x2d67d5[_0x7c67('0x2b')]['filter']){_0x2d03ef[_0x7c67('0x34')]=_['merge'](_0x2d03ef[_0x7c67('0x34')],{'$or':_[_0x7c67('0x27')](_0x42926d,function(_0x30543d){if(_0x30543d['type']!==_0x7c67('0x35')){var _0x378006={};_0x378006[_0x30543d['name']]={'$like':'%'+_0x2d67d5[_0x7c67('0x2b')]['filter']+'%'};return _0x378006;}})});}_0x2d03ef=_[_0x7c67('0x36')]({},_0x2d03ef,_0x2d67d5[_0x7c67('0x37')]);var _0x2f7f28={'where':_0x2d03ef['where']};return db[_0x7c67('0x38')][_0x7c67('0x1e')](_0x2f7f28)['then'](function(_0x45245b){_0x20e77c['count']=_0x45245b;if(_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x39')]){_0x2d03ef[_0x7c67('0x3a')]=[{'all':!![]}];}return db[_0x7c67('0x38')]['findAll'](_0x2d03ef);})[_0x7c67('0x22')](function(_0x36d344){_0x20e77c['rows']=_0x36d344;return _0x20e77c;})[_0x7c67('0x22')](respondWithFilteredResult(_0x42ed09,_0x2d03ef))[_0x7c67('0x3b')](handleError(_0x42ed09,null));};exports[_0x7c67('0x3c')]=function(_0x3ee63c,_0x3aaa82){var _0x2695c8={'raw':!![],'where':{'id':_0x3ee63c[_0x7c67('0x3d')]['id']}},_0x45da99={};_0x45da99[_0x7c67('0x2d')]=_[_0x7c67('0x2c')](db[_0x7c67('0x38')][_0x7c67('0x28')]);_0x45da99[_0x7c67('0x2b')]=_['keys'](_0x3ee63c[_0x7c67('0x2b')]);_0x45da99[_0x7c67('0x3e')]=_[_0x7c67('0x3f')](_0x45da99[_0x7c67('0x2d')],_0x45da99['query']);_0x2695c8[_0x7c67('0x2e')]=_[_0x7c67('0x3f')](_0x45da99['model'],qs[_0x7c67('0x2f')](_0x3ee63c[_0x7c67('0x2b')][_0x7c67('0x2f')]));_0x2695c8[_0x7c67('0x2e')]=_0x2695c8[_0x7c67('0x2e')]['length']?_0x2695c8['attributes']:_0x45da99['model'];if(_0x3ee63c[_0x7c67('0x2b')][_0x7c67('0x39')]){_0x2695c8[_0x7c67('0x3a')]=[{'all':!![]}];}_0x2695c8=_[_0x7c67('0x36')]({},_0x2695c8,_0x3ee63c['options']);return db[_0x7c67('0x38')][_0x7c67('0x40')](_0x2695c8)[_0x7c67('0x22')](handleEntityNotFound(_0x3aaa82,null))[_0x7c67('0x22')](respondWithResult(_0x3aaa82,null))['catch'](handleError(_0x3aaa82,null));};exports[_0x7c67('0x41')]=function(_0x3840b5,_0x20428e){return db[_0x7c67('0x38')][_0x7c67('0x41')](_0x3840b5['body'],{})[_0x7c67('0x22')](respondWithResult(_0x20428e,0xc9))[_0x7c67('0x3b')](handleError(_0x20428e,null));};exports[_0x7c67('0x42')]=function(_0x1e07bf,_0x26e374){if(_0x1e07bf[_0x7c67('0x43')]['id']){delete _0x1e07bf[_0x7c67('0x43')]['id'];}return db[_0x7c67('0x38')]['find']({'where':{'id':_0x1e07bf[_0x7c67('0x3d')]['id']}})[_0x7c67('0x22')](handleEntityNotFound(_0x26e374,null))[_0x7c67('0x22')](saveUpdates(_0x1e07bf['body'],null))[_0x7c67('0x22')](respondWithResult(_0x26e374,null))[_0x7c67('0x3b')](handleError(_0x26e374,null));};exports[_0x7c67('0x44')]=function(_0x1b766d,_0x156c5a){return db[_0x7c67('0x38')]['find']({'where':{'id':_0x1b766d['params']['id']}})[_0x7c67('0x22')](handleEntityNotFound(_0x156c5a,null))['then'](removeEntity(_0x156c5a,null))[_0x7c67('0x3b')](handleError(_0x156c5a,null));};exports['describe']=function(_0x12c471,_0x23883f){return db[_0x7c67('0x38')][_0x7c67('0x45')]()['then'](respondWithResult(_0x23883f,null))['catch'](handleError(_0x23883f,null));};
\ No newline at end of file
+var _0x5078=['sort','where','filters','merge','filter','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order'];(function(_0x46f5f1,_0xf9bbce){var _0x3117b8=function(_0x1d3801){while(--_0x1d3801){_0x46f5f1['push'](_0x46f5f1['shift']());}};_0x3117b8(++_0xf9bbce);}(_0x5078,0x148));var _0x8507=function(_0x308e4f,_0x134e25){_0x308e4f=_0x308e4f-0x0;var _0x17ab35=_0x5078[_0x308e4f];return _0x17ab35;};'use strict';var emlformat=require(_0x8507('0x0'));var rimraf=require(_0x8507('0x1'));var zipdir=require(_0x8507('0x2'));var jsonpatch=require(_0x8507('0x3'));var rp=require(_0x8507('0x4'));var moment=require(_0x8507('0x5'));var BPromise=require(_0x8507('0x6'));var Mustache=require(_0x8507('0x7'));var util=require(_0x8507('0x8'));var path=require(_0x8507('0x9'));var sox=require(_0x8507('0xa'));var csv=require(_0x8507('0xb'));var ejs=require(_0x8507('0xc'));var fs=require('fs');var fs_extra=require(_0x8507('0xd'));var _=require(_0x8507('0xe'));var squel=require(_0x8507('0xf'));var crypto=require('crypto');var jsforce=require(_0x8507('0x10'));var deskjs=require(_0x8507('0x11'));var toCsv=require(_0x8507('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8507('0x12'));var authService=require(_0x8507('0x13'));var qs=require(_0x8507('0x14'));var as=require(_0x8507('0x15'));var hardwareService=require(_0x8507('0x16'));var logger=require(_0x8507('0x17'))(_0x8507('0x18'));var utils=require('../../config/utils');var config=require(_0x8507('0x19'));var licenseUtil=require(_0x8507('0x1a'));var db=require(_0x8507('0x1b'))['db'];function respondWithStatusCode(_0x31109f,_0x21a236){_0x21a236=_0x21a236||0xcc;return function(_0x5c41e2){if(_0x5c41e2){return _0x31109f['sendStatus'](_0x21a236);}return _0x31109f[_0x8507('0x1c')](_0x21a236)[_0x8507('0x1d')]();};}function respondWithResult(_0x1f5550,_0x3bafeb){_0x3bafeb=_0x3bafeb||0xc8;return function(_0x2ea0e1){if(_0x2ea0e1){return _0x1f5550[_0x8507('0x1c')](_0x3bafeb)['json'](_0x2ea0e1);}};}function respondWithFilteredResult(_0x4f5aa0,_0x58ff83){return function(_0x1ec9b8){if(_0x1ec9b8){var _0x3f1ed1=typeof _0x58ff83['offset']===_0x8507('0x1e')&&typeof _0x58ff83[_0x8507('0x1f')]===_0x8507('0x1e');var _0x412aee=_0x1ec9b8[_0x8507('0x20')];var _0x13b285=_0x3f1ed1?0x0:_0x58ff83[_0x8507('0x21')];var _0x36e387=_0x3f1ed1?_0x1ec9b8['count']:_0x58ff83['offset']+_0x58ff83[_0x8507('0x1f')];var _0xc556a4;if(_0x36e387>=_0x412aee){_0x36e387=_0x412aee;_0xc556a4=0xc8;}else{_0xc556a4=0xce;}_0x4f5aa0[_0x8507('0x1c')](_0xc556a4);return _0x4f5aa0[_0x8507('0x22')](_0x8507('0x23'),_0x13b285+'-'+_0x36e387+'/'+_0x412aee)['json'](_0x1ec9b8);}return null;};}function patchUpdates(_0x1b8dbf){return function(_0x16501a){try{jsonpatch[_0x8507('0x24')](_0x16501a,_0x1b8dbf,!![]);}catch(_0x192f1c){return BPromise[_0x8507('0x25')](_0x192f1c);}return _0x16501a[_0x8507('0x26')]();};}function saveUpdates(_0x42e5ff,_0x2dc900){return function(_0x539cf9){if(_0x539cf9){return _0x539cf9[_0x8507('0x27')](_0x42e5ff)[_0x8507('0x28')](function(_0x37fd9c){return _0x37fd9c;});}return null;};}function removeEntity(_0x40ad72,_0x873ec4){return function(_0x438001){if(_0x438001){return _0x438001[_0x8507('0x29')]()[_0x8507('0x28')](function(){_0x40ad72['status'](0xcc)[_0x8507('0x1d')]();});}};}function handleEntityNotFound(_0x24fc61,_0x188ae0){return function(_0x5a559e){if(!_0x5a559e){_0x24fc61[_0x8507('0x2a')](0x194);}return _0x5a559e;};}function handleError(_0x15c710,_0x404d73){_0x404d73=_0x404d73||0x1f4;return function(_0x160402){logger['error'](_0x160402[_0x8507('0x2b')]);if(_0x160402[_0x8507('0x2c')]){delete _0x160402[_0x8507('0x2c')];}_0x15c710[_0x8507('0x1c')](_0x404d73)[_0x8507('0x2d')](_0x160402);};}exports['index']=function(_0x23c6e1,_0xb01c06){var _0x232182={},_0x2ca452={},_0x25fe12={'count':0x0,'rows':[]};var _0x8b5a47=_[_0x8507('0x2e')](db[_0x8507('0x2f')][_0x8507('0x30')],function(_0x6e9a38){return{'name':_0x6e9a38[_0x8507('0x31')],'type':_0x6e9a38[_0x8507('0x32')][_0x8507('0x33')]};});_0x2ca452['model']=_['map'](_0x8b5a47,_0x8507('0x2c'));_0x2ca452['query']=_[_0x8507('0x34')](_0x23c6e1[_0x8507('0x35')]);_0x2ca452['filters']=_['intersection'](_0x2ca452['model'],_0x2ca452[_0x8507('0x35')]);_0x232182[_0x8507('0x36')]=_[_0x8507('0x37')](_0x2ca452[_0x8507('0x38')],qs[_0x8507('0x39')](_0x23c6e1[_0x8507('0x35')]['fields']));_0x232182['attributes']=_0x232182[_0x8507('0x36')][_0x8507('0x3a')]?_0x232182[_0x8507('0x36')]:_0x2ca452['model'];if(!_0x23c6e1['query'][_0x8507('0x3b')](_0x8507('0x3c'))){_0x232182['limit']=qs[_0x8507('0x1f')](_0x23c6e1[_0x8507('0x35')]['limit']);_0x232182['offset']=qs['offset'](_0x23c6e1[_0x8507('0x35')][_0x8507('0x21')]);}_0x232182[_0x8507('0x3d')]=qs[_0x8507('0x3e')](_0x23c6e1['query']['sort']);_0x232182[_0x8507('0x3f')]=qs[_0x8507('0x40')](_['pick'](_0x23c6e1[_0x8507('0x35')],_0x2ca452[_0x8507('0x40')]),_0x8b5a47);if(_0x23c6e1[_0x8507('0x35')]['filter']){_0x232182[_0x8507('0x3f')]=_[_0x8507('0x41')](_0x232182[_0x8507('0x3f')],{'$or':_[_0x8507('0x2e')](_0x8b5a47,function(_0x46e6dd){if(_0x46e6dd[_0x8507('0x32')]!=='VIRTUAL'){var _0x42e640={};_0x42e640[_0x46e6dd[_0x8507('0x2c')]]={'$like':'%'+_0x23c6e1['query'][_0x8507('0x42')]+'%'};return _0x42e640;}})});}_0x232182=_[_0x8507('0x41')]({},_0x232182,_0x23c6e1['options']);var _0x2297a8={'where':_0x232182['where']};return db[_0x8507('0x2f')][_0x8507('0x20')](_0x2297a8)['then'](function(_0x2d344e){_0x25fe12['count']=_0x2d344e;if(_0x23c6e1[_0x8507('0x35')][_0x8507('0x43')]){_0x232182[_0x8507('0x44')]=[{'all':!![]}];}return db[_0x8507('0x2f')][_0x8507('0x45')](_0x232182);})[_0x8507('0x28')](function(_0x54d8d3){_0x25fe12[_0x8507('0x46')]=_0x54d8d3;return _0x25fe12;})[_0x8507('0x28')](respondWithFilteredResult(_0xb01c06,_0x232182))[_0x8507('0x47')](handleError(_0xb01c06,null));};exports[_0x8507('0x48')]=function(_0x57083e,_0x260a98){var _0x2e49d0={'raw':!![],'where':{'id':_0x57083e[_0x8507('0x49')]['id']}},_0x55b156={};_0x55b156[_0x8507('0x38')]=_[_0x8507('0x34')](db['ChatQueueReport'][_0x8507('0x30')]);_0x55b156['query']=_[_0x8507('0x34')](_0x57083e[_0x8507('0x35')]);_0x55b156[_0x8507('0x40')]=_[_0x8507('0x37')](_0x55b156['model'],_0x55b156[_0x8507('0x35')]);_0x2e49d0[_0x8507('0x36')]=_[_0x8507('0x37')](_0x55b156[_0x8507('0x38')],qs['fields'](_0x57083e['query']['fields']));_0x2e49d0[_0x8507('0x36')]=_0x2e49d0[_0x8507('0x36')][_0x8507('0x3a')]?_0x2e49d0[_0x8507('0x36')]:_0x55b156[_0x8507('0x38')];if(_0x57083e[_0x8507('0x35')]['includeAll']){_0x2e49d0[_0x8507('0x44')]=[{'all':!![]}];}_0x2e49d0=_[_0x8507('0x41')]({},_0x2e49d0,_0x57083e['options']);return db[_0x8507('0x2f')][_0x8507('0x4a')](_0x2e49d0)[_0x8507('0x28')](handleEntityNotFound(_0x260a98,null))[_0x8507('0x28')](respondWithResult(_0x260a98,null))[_0x8507('0x47')](handleError(_0x260a98,null));};exports[_0x8507('0x4b')]=function(_0x4858b6,_0x5e119e){return db['ChatQueueReport'][_0x8507('0x4b')](_0x4858b6[_0x8507('0x4c')],{})[_0x8507('0x28')](respondWithResult(_0x5e119e,0xc9))[_0x8507('0x47')](handleError(_0x5e119e,null));};exports[_0x8507('0x27')]=function(_0x2c3a5d,_0x5bb3c4){if(_0x2c3a5d[_0x8507('0x4c')]['id']){delete _0x2c3a5d[_0x8507('0x4c')]['id'];}return db[_0x8507('0x2f')][_0x8507('0x4a')]({'where':{'id':_0x2c3a5d[_0x8507('0x49')]['id']}})[_0x8507('0x28')](handleEntityNotFound(_0x5bb3c4,null))['then'](saveUpdates(_0x2c3a5d['body'],null))[_0x8507('0x28')](respondWithResult(_0x5bb3c4,null))[_0x8507('0x47')](handleError(_0x5bb3c4,null));};exports[_0x8507('0x29')]=function(_0x75b763,_0x50465d){return db[_0x8507('0x2f')][_0x8507('0x4a')]({'where':{'id':_0x75b763['params']['id']}})[_0x8507('0x28')](handleEntityNotFound(_0x50465d,null))[_0x8507('0x28')](removeEntity(_0x50465d,null))['catch'](handleError(_0x50465d,null));};exports[_0x8507('0x4d')]=function(_0x109b91,_0x447978){return db[_0x8507('0x2f')][_0x8507('0x4d')]()[_0x8507('0x28')](respondWithResult(_0x447978,null))[_0x8507('0x47')](handleError(_0x447978,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 598970b..614d016 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x4dc3c6,_0x541ba2){var _0x1f4f81=function(_0x1206e4){while(--_0x1206e4){_0x4dc3c6['push'](_0x4dc3c6['shift']());}};_0x1f4f81(++_0x541ba2);}(_0x757a,0xde));var _0xa757=function(_0x1ad8bc,_0x3fe383){_0x1ad8bc=_0x1ad8bc-0x0;var _0x2a30c7=_0x757a[_0x1ad8bc];return _0x2a30c7;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x47c333,_0x298b54){var _0x2fded7=function(_0x15aae1){while(--_0x15aae1){_0x47c333['push'](_0x47c333['shift']());}};_0x2fded7(++_0x298b54);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index eb80812..f0e54db 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 _0xe021=['ChatQueueReport','create','options','raw','debug','body','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','http','then','info','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport'];(function(_0xecdf7,_0x29ecda){var _0x25c15c=function(_0x1cef05){while(--_0x1cef05){_0xecdf7['push'](_0xecdf7['shift']());}};_0x25c15c(++_0x29ecda);}(_0xe021,0x10e));var _0x1e02=function(_0x407b70,_0x5f254c){_0x407b70=_0x407b70-0x0;var _0x5b7a85=_0xe021[_0x407b70];return _0x5b7a85;};'use strict';var _=require(_0x1e02('0x0'));var util=require(_0x1e02('0x1'));var moment=require(_0x1e02('0x2'));var BPromise=require(_0x1e02('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1e02('0x4'));var logger=require('../../config/logger')(_0x1e02('0x5'));var config=require(_0x1e02('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e02('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6f4c4c,_0x49be38,_0x198301){return new BPromise(function(_0x3b960e,_0x1ebc80){return client['request'](_0x6f4c4c,_0x198301)[_0x1e02('0x8')](function(_0x3d1db1){logger[_0x1e02('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x49be38,'request\x20sent');logger['debug'](_0x1e02('0xa'),_0x49be38,_0x1e02('0xb'),JSON[_0x1e02('0xc')](_0x3d1db1));if(_0x3d1db1[_0x1e02('0xd')]){if(_0x3d1db1[_0x1e02('0xd')][_0x1e02('0xe')]===0x1f4){logger[_0x1e02('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x49be38,_0x3d1db1[_0x1e02('0xd')][_0x1e02('0xf')]);return _0x1ebc80(_0x3d1db1[_0x1e02('0xd')][_0x1e02('0xf')]);}logger[_0x1e02('0xd')](_0x1e02('0x10'),_0x49be38,_0x3d1db1['error'][_0x1e02('0xf')]);return _0x3b960e(_0x3d1db1['error'][_0x1e02('0xf')]);}else{logger[_0x1e02('0x9')](_0x1e02('0x10'),_0x49be38,_0x1e02('0xb'));_0x3b960e(_0x3d1db1[_0x1e02('0x11')][_0x1e02('0xf')]);}})[_0x1e02('0x12')](function(_0x4bc062){logger[_0x1e02('0xd')](_0x1e02('0x10'),_0x49be38,_0x4bc062);_0x1ebc80(_0x4bc062);});});}exports[_0x1e02('0x13')]=function(_0x31f37f){var _0x426ea2=this;return new Promise(function(_0x432b5d,_0x5b009f){return db[_0x1e02('0x14')][_0x1e02('0x15')](_0x31f37f['body'],{'raw':_0x31f37f[_0x1e02('0x16')]?_0x31f37f[_0x1e02('0x16')][_0x1e02('0x17')]===undefined?!![]:![]:!![]})[_0x1e02('0x8')](function(_0xe36577){logger[_0x1e02('0x9')](_0x1e02('0x13'),_0x31f37f);logger[_0x1e02('0x18')](_0x1e02('0x13'),_0x31f37f,JSON['stringify'](_0xe36577));_0x432b5d(_0xe36577);})[_0x1e02('0x12')](function(_0x3b222b){logger[_0x1e02('0xd')](_0x1e02('0x13'),_0x3b222b[_0x1e02('0xf')],_0x31f37f);_0x5b009f(_0x426ea2['error'](0x1f4,_0x3b222b[_0x1e02('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x149764){var _0x5df68a=this;return new Promise(function(_0x3d4ff8,_0x2b6d80){return db[_0x1e02('0x14')]['update'](_0x149764[_0x1e02('0x19')],{'raw':_0x149764['options']?_0x149764[_0x1e02('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149764[_0x1e02('0x16')]?_0x149764[_0x1e02('0x16')]['where']||null:null,'attributes':_0x149764['options']?_0x149764[_0x1e02('0x16')][_0x1e02('0x1a')]||null:null,'limit':_0x149764['options']?_0x149764[_0x1e02('0x16')][_0x1e02('0x1b')]||null:null})[_0x1e02('0x8')](function(_0x199c15){logger['info'](_0x1e02('0x1c'),_0x149764);logger['debug'](_0x1e02('0x1c'),_0x149764,JSON['stringify'](_0x199c15));_0x3d4ff8(_0x199c15);})[_0x1e02('0x12')](function(_0x587aa9){logger[_0x1e02('0xd')](_0x1e02('0x1c'),_0x587aa9[_0x1e02('0xf')],_0x149764);_0x2b6d80(_0x5df68a[_0x1e02('0xd')](0x1f4,_0x587aa9[_0x1e02('0xf')]));});});};
\ No newline at end of file
+var _0x30b2=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1ab0a1,_0x8daa77){var _0x567836=function(_0x207ed9){while(--_0x207ed9){_0x1ab0a1['push'](_0x1ab0a1['shift']());}};_0x567836(++_0x8daa77);}(_0x30b2,0xbb));var _0x230b=function(_0x282deb,_0x1bf22b){_0x282deb=_0x282deb-0x0;var _0x4ffa69=_0x30b2[_0x282deb];return _0x4ffa69;};'use strict';var _=require(_0x230b('0x0'));var util=require('util');var moment=require(_0x230b('0x1'));var BPromise=require(_0x230b('0x2'));var rs=require(_0x230b('0x3'));var fs=require('fs');var Redis=require(_0x230b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x230b('0x5'));var logger=require(_0x230b('0x6'))(_0x230b('0x7'));var config=require(_0x230b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x230b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22ed8f,_0x1577af,_0x32b5f5){return new BPromise(function(_0x17011b,_0xe24b82){return client[_0x230b('0xa')](_0x22ed8f,_0x32b5f5)[_0x230b('0xb')](function(_0x82e771){logger[_0x230b('0xc')](_0x230b('0xd'),_0x1577af,_0x230b('0xe'));logger[_0x230b('0xf')](_0x230b('0x10'),_0x1577af,_0x230b('0xe'),JSON[_0x230b('0x11')](_0x82e771));if(_0x82e771['error']){if(_0x82e771['error'][_0x230b('0x12')]===0x1f4){logger[_0x230b('0x13')](_0x230b('0xd'),_0x1577af,_0x82e771[_0x230b('0x13')]['message']);return _0xe24b82(_0x82e771[_0x230b('0x13')][_0x230b('0x14')]);}logger[_0x230b('0x13')](_0x230b('0xd'),_0x1577af,_0x82e771[_0x230b('0x13')][_0x230b('0x14')]);return _0x17011b(_0x82e771[_0x230b('0x13')][_0x230b('0x14')]);}else{logger[_0x230b('0xc')](_0x230b('0xd'),_0x1577af,'request\x20sent');_0x17011b(_0x82e771[_0x230b('0x15')][_0x230b('0x14')]);}})[_0x230b('0x16')](function(_0x44d450){logger[_0x230b('0x13')](_0x230b('0xd'),_0x1577af,_0x44d450);_0xe24b82(_0x44d450);});});}exports[_0x230b('0x17')]=function(_0x1969a2){var _0x5e7810=this;return new Promise(function(_0x55ab8d,_0x46ebd5){return db[_0x230b('0x18')][_0x230b('0x19')](_0x1969a2[_0x230b('0x1a')],{'raw':_0x1969a2[_0x230b('0x1b')]?_0x1969a2[_0x230b('0x1b')][_0x230b('0x1c')]===undefined?!![]:![]:!![]})[_0x230b('0xb')](function(_0x1f3055){logger[_0x230b('0xc')](_0x230b('0x17'),_0x1969a2);logger[_0x230b('0xf')](_0x230b('0x17'),_0x1969a2,JSON[_0x230b('0x11')](_0x1f3055));_0x55ab8d(_0x1f3055);})[_0x230b('0x16')](function(_0x39c89a){logger[_0x230b('0x13')](_0x230b('0x17'),_0x39c89a[_0x230b('0x14')],_0x1969a2);_0x46ebd5(_0x5e7810[_0x230b('0x13')](0x1f4,_0x39c89a[_0x230b('0x14')]));});});};exports[_0x230b('0x1d')]=function(_0x26bd86){var _0x5a92ed=this;return new Promise(function(_0x8ec62b,_0x483e8a){return db['ChatQueueReport'][_0x230b('0x1e')](_0x26bd86['body'],{'raw':_0x26bd86['options']?_0x26bd86['options'][_0x230b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26bd86[_0x230b('0x1b')]?_0x26bd86['options'][_0x230b('0x1f')]||null:null,'attributes':_0x26bd86[_0x230b('0x1b')]?_0x26bd86['options']['attributes']||null:null,'limit':_0x26bd86[_0x230b('0x1b')]?_0x26bd86['options']['limit']||null:null})[_0x230b('0xb')](function(_0x1641b7){logger[_0x230b('0xc')](_0x230b('0x1d'),_0x26bd86);logger[_0x230b('0xf')](_0x230b('0x1d'),_0x26bd86,JSON[_0x230b('0x11')](_0x1641b7));_0x8ec62b(_0x1641b7);})['catch'](function(_0x6d86b9){logger[_0x230b('0x13')](_0x230b('0x1d'),_0x6d86b9[_0x230b('0x14')],_0x26bd86);_0x483e8a(_0x5a92ed['error'](0x1f4,_0x6d86b9[_0x230b('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 4618398..b83fa95 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 _0x0871=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xf74f46,_0x1a49d4){var _0x5ea729=function(_0x73e853){while(--_0x73e853){_0xf74f46['push'](_0xf74f46['shift']());}};_0x5ea729(++_0x1a49d4);}(_0x0871,0xdc));var _0x1087=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x0871[_0x2b7764];return _0x848dcb;};'use strict';var multer=require(_0x1087('0x0'));var util=require(_0x1087('0x1'));var path=require(_0x1087('0x2'));var timeout=require(_0x1087('0x3'));var express=require(_0x1087('0x4'));var router=express[_0x1087('0x5')]();var fs_extra=require(_0x1087('0x6'));var auth=require(_0x1087('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1087('0x8'));var controller=require('./chatQueueReport.controller');router[_0x1087('0x9')]('/',auth[_0x1087('0xa')](),controller[_0x1087('0xb')]);router[_0x1087('0x9')]('/describe',auth[_0x1087('0xa')](),controller[_0x1087('0xc')]);router[_0x1087('0x9')](_0x1087('0xd'),auth[_0x1087('0xa')](),controller[_0x1087('0xe')]);router['post']('/',auth[_0x1087('0xa')](),controller['create']);router[_0x1087('0xf')]('/:id',auth[_0x1087('0xa')](),controller[_0x1087('0x10')]);router['delete'](_0x1087('0xd'),auth['isAuthenticated'](),controller[_0x1087('0x11')]);module[_0x1087('0x12')]=router;
\ No newline at end of file
+var _0x4340=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x301135,_0x15af00){var _0x1568e2=function(_0x14eb38){while(--_0x14eb38){_0x301135['push'](_0x301135['shift']());}};_0x1568e2(++_0x15af00);}(_0x4340,0x136));var _0x0434=function(_0x45d932,_0x3e8ec4){_0x45d932=_0x45d932-0x0;var _0x4828b3=_0x4340[_0x45d932];return _0x4828b3;};'use strict';var multer=require(_0x0434('0x0'));var util=require(_0x0434('0x1'));var path=require('path');var timeout=require(_0x0434('0x2'));var express=require(_0x0434('0x3'));var router=express[_0x0434('0x4')]();var fs_extra=require(_0x0434('0x5'));var auth=require(_0x0434('0x6'));var interaction=require(_0x0434('0x7'));var config=require('../../config/environment');var controller=require(_0x0434('0x8'));router[_0x0434('0x9')]('/',auth['isAuthenticated'](),controller[_0x0434('0xa')]);router['get'](_0x0434('0xb'),auth['isAuthenticated'](),controller[_0x0434('0xc')]);router[_0x0434('0x9')](_0x0434('0xd'),auth[_0x0434('0xe')](),controller[_0x0434('0xf')]);router[_0x0434('0x10')]('/',auth[_0x0434('0xe')](),controller[_0x0434('0x11')]);router['put'](_0x0434('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0434('0x12')]('/:id',auth[_0x0434('0xe')](),controller[_0x0434('0x13')]);module[_0x0434('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 3aded91..fc44e44 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x48f038,_0x2bde84){var _0x2edc62=function(_0x1e6cc8){while(--_0x1e6cc8){_0x48f038['push'](_0x48f038['shift']());}};_0x2edc62(++_0x2bde84);}(_0x54ef,0x112));var _0xf54e=function(_0x23013,_0x55eaa7){_0x23013=_0x23013-0x0;var _0x52479a=_0x54ef[_0x23013];return _0x52479a;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1be4b6,_0x5c6a95){var _0x3278d5=function(_0xefe3b4){while(--_0xefe3b4){_0x1be4b6['push'](_0x1be4b6['shift']());}};_0x3278d5(++_0x5c6a95);}(_0xaa88,0x137));var _0x8aa8=function(_0x1d4449,_0x495153){_0x1d4449=_0x1d4449-0x0;var _0x4dcde3=_0xaa88[_0x1d4449];return _0x4dcde3;};'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
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 38350a5..4b8d0c9 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 _0x1826=['../../mysqldb','end','status','json','offset','undefined','limit','count','set','save','update','then','sendStatus','error','name','index','map','ChatTransferReport','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','rawAttributes','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x51ffc3,_0x5f03b2){var _0x14da54=function(_0x36eb4a){while(--_0x36eb4a){_0x51ffc3['push'](_0x51ffc3['shift']());}};_0x14da54(++_0x5f03b2);}(_0x1826,0x1da));var _0x6182=function(_0x46dc29,_0x18c45a){_0x46dc29=_0x46dc29-0x0;var _0x4bbb8d=_0x1826[_0x46dc29];return _0x4bbb8d;};'use strict';var emlformat=require(_0x6182('0x0'));var rimraf=require(_0x6182('0x1'));var zipdir=require(_0x6182('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6182('0x3'));var moment=require('moment');var BPromise=require(_0x6182('0x4'));var Mustache=require(_0x6182('0x5'));var util=require(_0x6182('0x6'));var path=require('path');var sox=require(_0x6182('0x7'));var csv=require(_0x6182('0x8'));var ejs=require(_0x6182('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6182('0xa'));var squel=require(_0x6182('0xb'));var crypto=require(_0x6182('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6182('0xd'));var toCsv=require(_0x6182('0x8'));var querystring=require('querystring');var Papa=require(_0x6182('0xe'));var Redis=require(_0x6182('0xf'));var authService=require(_0x6182('0x10'));var qs=require(_0x6182('0x11'));var as=require(_0x6182('0x12'));var hardwareService=require(_0x6182('0x13'));var logger=require(_0x6182('0x14'))(_0x6182('0x15'));var utils=require('../../config/utils');var config=require(_0x6182('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6182('0x17'))['db'];function respondWithStatusCode(_0xc5959e,_0x72f907){_0x72f907=_0x72f907||0xcc;return function(_0x3a8a0e){if(_0x3a8a0e){return _0xc5959e['sendStatus'](_0x72f907);}return _0xc5959e['status'](_0x72f907)[_0x6182('0x18')]();};}function respondWithResult(_0x4ca7a5,_0x16a30d){_0x16a30d=_0x16a30d||0xc8;return function(_0x5ef8f9){if(_0x5ef8f9){return _0x4ca7a5[_0x6182('0x19')](_0x16a30d)[_0x6182('0x1a')](_0x5ef8f9);}};}function respondWithFilteredResult(_0x3db03c,_0x53d456){return function(_0x3eb0f8){if(_0x3eb0f8){var _0x464c54=typeof _0x53d456[_0x6182('0x1b')]===_0x6182('0x1c')&&typeof _0x53d456[_0x6182('0x1d')]===_0x6182('0x1c');var _0x3a961e=_0x3eb0f8[_0x6182('0x1e')];var _0x3bd4f8=_0x464c54?0x0:_0x53d456[_0x6182('0x1b')];var _0x3876e5=_0x464c54?_0x3eb0f8['count']:_0x53d456[_0x6182('0x1b')]+_0x53d456['limit'];var _0x4c48f2;if(_0x3876e5>=_0x3a961e){_0x3876e5=_0x3a961e;_0x4c48f2=0xc8;}else{_0x4c48f2=0xce;}_0x3db03c[_0x6182('0x19')](_0x4c48f2);return _0x3db03c[_0x6182('0x1f')]('Content-Range',_0x3bd4f8+'-'+_0x3876e5+'/'+_0x3a961e)['json'](_0x3eb0f8);}return null;};}function patchUpdates(_0x2230cd){return function(_0x2995ee){try{jsonpatch['apply'](_0x2995ee,_0x2230cd,!![]);}catch(_0x2b92ad){return BPromise['reject'](_0x2b92ad);}return _0x2995ee[_0x6182('0x20')]();};}function saveUpdates(_0x373df2,_0xd722cb){return function(_0x5251ae){if(_0x5251ae){return _0x5251ae[_0x6182('0x21')](_0x373df2)[_0x6182('0x22')](function(_0x1e3e23){return _0x1e3e23;});}return null;};}function removeEntity(_0x1ab12f,_0x43c2be){return function(_0x94c7d0){if(_0x94c7d0){return _0x94c7d0['destroy']()['then'](function(){_0x1ab12f[_0x6182('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f84ce,_0xe29c0c){return function(_0x1fc60d){if(!_0x1fc60d){_0x1f84ce[_0x6182('0x23')](0x194);}return _0x1fc60d;};}function handleError(_0xb3656e,_0x34e2ae){_0x34e2ae=_0x34e2ae||0x1f4;return function(_0x282b36){logger[_0x6182('0x24')](_0x282b36['stack']);if(_0x282b36[_0x6182('0x25')]){delete _0x282b36[_0x6182('0x25')];}_0xb3656e[_0x6182('0x19')](_0x34e2ae)['send'](_0x282b36);};}exports[_0x6182('0x26')]=function(_0x3bf9c9,_0x340ba3){var _0x4dcae9={},_0x52ddea={},_0x479cb9={'count':0x0,'rows':[]};var _0x5ed5f2=_[_0x6182('0x27')](db[_0x6182('0x28')]['rawAttributes'],function(_0x418ba7){return{'name':_0x418ba7[_0x6182('0x29')],'type':_0x418ba7[_0x6182('0x2a')][_0x6182('0x2b')]};});_0x52ddea[_0x6182('0x2c')]=_[_0x6182('0x27')](_0x5ed5f2,_0x6182('0x25'));_0x52ddea['query']=_[_0x6182('0x2d')](_0x3bf9c9[_0x6182('0x2e')]);_0x52ddea[_0x6182('0x2f')]=_['intersection'](_0x52ddea[_0x6182('0x2c')],_0x52ddea['query']);_0x4dcae9['attributes']=_[_0x6182('0x30')](_0x52ddea[_0x6182('0x2c')],qs[_0x6182('0x31')](_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x31')]));_0x4dcae9['attributes']=_0x4dcae9['attributes'][_0x6182('0x32')]?_0x4dcae9[_0x6182('0x33')]:_0x52ddea[_0x6182('0x2c')];if(!_0x3bf9c9[_0x6182('0x2e')]['hasOwnProperty'](_0x6182('0x34'))){_0x4dcae9['limit']=qs[_0x6182('0x1d')](_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x1d')]);_0x4dcae9['offset']=qs[_0x6182('0x1b')](_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x1b')]);}_0x4dcae9[_0x6182('0x35')]=qs[_0x6182('0x36')](_0x3bf9c9[_0x6182('0x2e')]['sort']);_0x4dcae9[_0x6182('0x37')]=qs[_0x6182('0x2f')](_[_0x6182('0x38')](_0x3bf9c9[_0x6182('0x2e')],_0x52ddea[_0x6182('0x2f')]),_0x5ed5f2);if(_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x39')]){_0x4dcae9[_0x6182('0x37')]=_[_0x6182('0x3a')](_0x4dcae9[_0x6182('0x37')],{'$or':_['map'](_0x5ed5f2,function(_0x296a12){if(_0x296a12[_0x6182('0x2a')]!==_0x6182('0x3b')){var _0xbce622={};_0xbce622[_0x296a12[_0x6182('0x25')]]={'$like':'%'+_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x39')]+'%'};return _0xbce622;}})});}_0x4dcae9=_[_0x6182('0x3a')]({},_0x4dcae9,_0x3bf9c9['options']);var _0xa0bc8d={'where':_0x4dcae9[_0x6182('0x37')]};return db[_0x6182('0x28')][_0x6182('0x1e')](_0xa0bc8d)[_0x6182('0x22')](function(_0x37c5ad){_0x479cb9[_0x6182('0x1e')]=_0x37c5ad;if(_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x3c')]){_0x4dcae9[_0x6182('0x3d')]=[{'all':!![]}];}return db[_0x6182('0x28')][_0x6182('0x3e')](_0x4dcae9);})[_0x6182('0x22')](function(_0x131bb8){_0x479cb9[_0x6182('0x3f')]=_0x131bb8;return _0x479cb9;})['then'](respondWithFilteredResult(_0x340ba3,_0x4dcae9))['catch'](handleError(_0x340ba3,null));};exports['show']=function(_0x235ff6,_0x5f5ba1){var _0x1b9e08={'raw':!![],'where':{'id':_0x235ff6['params']['id']}},_0x258797={};_0x258797[_0x6182('0x2c')]=_[_0x6182('0x2d')](db['ChatTransferReport'][_0x6182('0x40')]);_0x258797[_0x6182('0x2e')]=_[_0x6182('0x2d')](_0x235ff6[_0x6182('0x2e')]);_0x258797[_0x6182('0x2f')]=_['intersection'](_0x258797[_0x6182('0x2c')],_0x258797['query']);_0x1b9e08[_0x6182('0x33')]=_['intersection'](_0x258797[_0x6182('0x2c')],qs['fields'](_0x235ff6[_0x6182('0x2e')]['fields']));_0x1b9e08[_0x6182('0x33')]=_0x1b9e08[_0x6182('0x33')][_0x6182('0x32')]?_0x1b9e08[_0x6182('0x33')]:_0x258797[_0x6182('0x2c')];if(_0x235ff6[_0x6182('0x2e')]['includeAll']){_0x1b9e08[_0x6182('0x3d')]=[{'all':!![]}];}_0x1b9e08=_[_0x6182('0x3a')]({},_0x1b9e08,_0x235ff6['options']);return db['ChatTransferReport'][_0x6182('0x41')](_0x1b9e08)[_0x6182('0x22')](handleEntityNotFound(_0x5f5ba1,null))[_0x6182('0x22')](respondWithResult(_0x5f5ba1,null))[_0x6182('0x42')](handleError(_0x5f5ba1,null));};exports['create']=function(_0x15315b,_0x5b8ab6){return db[_0x6182('0x28')][_0x6182('0x43')](_0x15315b[_0x6182('0x44')],{})[_0x6182('0x22')](respondWithResult(_0x5b8ab6,0xc9))[_0x6182('0x42')](handleError(_0x5b8ab6,null));};exports[_0x6182('0x21')]=function(_0x12e5c9,_0x49c251){if(_0x12e5c9['body']['id']){delete _0x12e5c9[_0x6182('0x44')]['id'];}return db['ChatTransferReport'][_0x6182('0x41')]({'where':{'id':_0x12e5c9[_0x6182('0x45')]['id']}})[_0x6182('0x22')](handleEntityNotFound(_0x49c251,null))[_0x6182('0x22')](saveUpdates(_0x12e5c9['body'],null))[_0x6182('0x22')](respondWithResult(_0x49c251,null))[_0x6182('0x42')](handleError(_0x49c251,null));};exports['destroy']=function(_0x298228,_0x18eaf4){return db['ChatTransferReport']['find']({'where':{'id':_0x298228[_0x6182('0x45')]['id']}})['then'](handleEntityNotFound(_0x18eaf4,null))[_0x6182('0x22')](removeEntity(_0x18eaf4,null))[_0x6182('0x42')](handleError(_0x18eaf4,null));};exports['describe']=function(_0x218246,_0x2ef36e){return db[_0x6182('0x28')][_0x6182('0x46')]()[_0x6182('0x22')](respondWithResult(_0x2ef36e,null))[_0x6182('0x42')](handleError(_0x2ef36e,null));};
\ No newline at end of file
+var _0x4256=['status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','model','map','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','ChatTransferReport','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xe69810,_0x5633e5){var _0x1779fe=function(_0x59f1b2){while(--_0x59f1b2){_0xe69810['push'](_0xe69810['shift']());}};_0x1779fe(++_0x5633e5);}(_0x4256,0x10b));var _0x6425=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x4256[_0xa2c0a3];return _0x52c618;};'use strict';var emlformat=require(_0x6425('0x0'));var rimraf=require(_0x6425('0x1'));var zipdir=require(_0x6425('0x2'));var jsonpatch=require(_0x6425('0x3'));var rp=require(_0x6425('0x4'));var moment=require(_0x6425('0x5'));var BPromise=require(_0x6425('0x6'));var Mustache=require('mustache');var util=require(_0x6425('0x7'));var path=require(_0x6425('0x8'));var sox=require('sox');var csv=require(_0x6425('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6425('0xa'));var _=require(_0x6425('0xb'));var squel=require(_0x6425('0xc'));var crypto=require(_0x6425('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6425('0xe'));var toCsv=require(_0x6425('0x9'));var querystring=require(_0x6425('0xf'));var Papa=require('papaparse');var Redis=require(_0x6425('0x10'));var authService=require(_0x6425('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6425('0x12'));var logger=require(_0x6425('0x13'))('api');var utils=require(_0x6425('0x14'));var config=require(_0x6425('0x15'));var licenseUtil=require(_0x6425('0x16'));var db=require(_0x6425('0x17'))['db'];function respondWithStatusCode(_0x2345e7,_0x17ed0d){_0x17ed0d=_0x17ed0d||0xcc;return function(_0x3587ff){if(_0x3587ff){return _0x2345e7[_0x6425('0x18')](_0x17ed0d);}return _0x2345e7[_0x6425('0x19')](_0x17ed0d)[_0x6425('0x1a')]();};}function respondWithResult(_0x2439d2,_0x517cd8){_0x517cd8=_0x517cd8||0xc8;return function(_0x5a8412){if(_0x5a8412){return _0x2439d2[_0x6425('0x19')](_0x517cd8)[_0x6425('0x1b')](_0x5a8412);}};}function respondWithFilteredResult(_0xcc2f89,_0x3985d1){return function(_0xf66aca){if(_0xf66aca){var _0x223365=typeof _0x3985d1['offset']===_0x6425('0x1c')&&typeof _0x3985d1[_0x6425('0x1d')]==='undefined';var _0x27657c=_0xf66aca[_0x6425('0x1e')];var _0xde4125=_0x223365?0x0:_0x3985d1[_0x6425('0x1f')];var _0x182bd1=_0x223365?_0xf66aca[_0x6425('0x1e')]:_0x3985d1[_0x6425('0x1f')]+_0x3985d1[_0x6425('0x1d')];var _0x384b63;if(_0x182bd1>=_0x27657c){_0x182bd1=_0x27657c;_0x384b63=0xc8;}else{_0x384b63=0xce;}_0xcc2f89[_0x6425('0x19')](_0x384b63);return _0xcc2f89[_0x6425('0x20')]('Content-Range',_0xde4125+'-'+_0x182bd1+'/'+_0x27657c)['json'](_0xf66aca);}return null;};}function patchUpdates(_0x15d9e3){return function(_0x3863e6){try{jsonpatch[_0x6425('0x21')](_0x3863e6,_0x15d9e3,!![]);}catch(_0x3c4512){return BPromise[_0x6425('0x22')](_0x3c4512);}return _0x3863e6[_0x6425('0x23')]();};}function saveUpdates(_0x540a86,_0x281dfa){return function(_0x569d1a){if(_0x569d1a){return _0x569d1a[_0x6425('0x24')](_0x540a86)[_0x6425('0x25')](function(_0x3b798b){return _0x3b798b;});}return null;};}function removeEntity(_0x58f623,_0x46f141){return function(_0x16c0ac){if(_0x16c0ac){return _0x16c0ac[_0x6425('0x26')]()[_0x6425('0x25')](function(){_0x58f623['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bc5b8,_0x3868b8){return function(_0x35eeb8){if(!_0x35eeb8){_0x4bc5b8[_0x6425('0x18')](0x194);}return _0x35eeb8;};}function handleError(_0x3731cb,_0x1cbe4f){_0x1cbe4f=_0x1cbe4f||0x1f4;return function(_0x203b02){logger[_0x6425('0x27')](_0x203b02[_0x6425('0x28')]);if(_0x203b02[_0x6425('0x29')]){delete _0x203b02[_0x6425('0x29')];}_0x3731cb[_0x6425('0x19')](_0x1cbe4f)[_0x6425('0x2a')](_0x203b02);};}exports[_0x6425('0x2b')]=function(_0x13fc98,_0x29fa82){var _0x199730={},_0x33e11e={},_0x31efec={'count':0x0,'rows':[]};var _0x35710d=_['map'](db['ChatTransferReport'][_0x6425('0x2c')],function(_0x296f65){return{'name':_0x296f65['fieldName'],'type':_0x296f65[_0x6425('0x2d')]['key']};});_0x33e11e[_0x6425('0x2e')]=_[_0x6425('0x2f')](_0x35710d,_0x6425('0x29'));_0x33e11e[_0x6425('0x30')]=_['keys'](_0x13fc98[_0x6425('0x30')]);_0x33e11e[_0x6425('0x31')]=_[_0x6425('0x32')](_0x33e11e[_0x6425('0x2e')],_0x33e11e[_0x6425('0x30')]);_0x199730[_0x6425('0x33')]=_[_0x6425('0x32')](_0x33e11e['model'],qs['fields'](_0x13fc98[_0x6425('0x30')]['fields']));_0x199730[_0x6425('0x33')]=_0x199730[_0x6425('0x33')][_0x6425('0x34')]?_0x199730[_0x6425('0x33')]:_0x33e11e[_0x6425('0x2e')];if(!_0x13fc98['query'][_0x6425('0x35')]('nolimit')){_0x199730[_0x6425('0x1d')]=qs[_0x6425('0x1d')](_0x13fc98[_0x6425('0x30')]['limit']);_0x199730[_0x6425('0x1f')]=qs['offset'](_0x13fc98[_0x6425('0x30')][_0x6425('0x1f')]);}_0x199730['order']=qs[_0x6425('0x36')](_0x13fc98['query'][_0x6425('0x36')]);_0x199730[_0x6425('0x37')]=qs[_0x6425('0x31')](_[_0x6425('0x38')](_0x13fc98[_0x6425('0x30')],_0x33e11e[_0x6425('0x31')]),_0x35710d);if(_0x13fc98[_0x6425('0x30')][_0x6425('0x39')]){_0x199730[_0x6425('0x37')]=_[_0x6425('0x3a')](_0x199730[_0x6425('0x37')],{'$or':_['map'](_0x35710d,function(_0x46dc89){if(_0x46dc89[_0x6425('0x2d')]!=='VIRTUAL'){var _0x3f6d80={};_0x3f6d80[_0x46dc89[_0x6425('0x29')]]={'$like':'%'+_0x13fc98[_0x6425('0x30')][_0x6425('0x39')]+'%'};return _0x3f6d80;}})});}_0x199730=_[_0x6425('0x3a')]({},_0x199730,_0x13fc98[_0x6425('0x3b')]);var _0x2c2beb={'where':_0x199730[_0x6425('0x37')]};return db[_0x6425('0x3c')]['count'](_0x2c2beb)['then'](function(_0x41a8c7){_0x31efec[_0x6425('0x1e')]=_0x41a8c7;if(_0x13fc98[_0x6425('0x30')]['includeAll']){_0x199730[_0x6425('0x3d')]=[{'all':!![]}];}return db[_0x6425('0x3c')][_0x6425('0x3e')](_0x199730);})[_0x6425('0x25')](function(_0x36757e){_0x31efec[_0x6425('0x3f')]=_0x36757e;return _0x31efec;})[_0x6425('0x25')](respondWithFilteredResult(_0x29fa82,_0x199730))[_0x6425('0x40')](handleError(_0x29fa82,null));};exports[_0x6425('0x41')]=function(_0x4bf455,_0x18d5a7){var _0x439622={'raw':!![],'where':{'id':_0x4bf455[_0x6425('0x42')]['id']}},_0x28f046={};_0x28f046['model']=_[_0x6425('0x43')](db[_0x6425('0x3c')][_0x6425('0x2c')]);_0x28f046[_0x6425('0x30')]=_[_0x6425('0x43')](_0x4bf455[_0x6425('0x30')]);_0x28f046['filters']=_['intersection'](_0x28f046[_0x6425('0x2e')],_0x28f046[_0x6425('0x30')]);_0x439622[_0x6425('0x33')]=_[_0x6425('0x32')](_0x28f046[_0x6425('0x2e')],qs['fields'](_0x4bf455['query']['fields']));_0x439622['attributes']=_0x439622['attributes'][_0x6425('0x34')]?_0x439622[_0x6425('0x33')]:_0x28f046[_0x6425('0x2e')];if(_0x4bf455[_0x6425('0x30')][_0x6425('0x44')]){_0x439622[_0x6425('0x3d')]=[{'all':!![]}];}_0x439622=_['merge']({},_0x439622,_0x4bf455['options']);return db[_0x6425('0x3c')][_0x6425('0x45')](_0x439622)[_0x6425('0x25')](handleEntityNotFound(_0x18d5a7,null))[_0x6425('0x25')](respondWithResult(_0x18d5a7,null))['catch'](handleError(_0x18d5a7,null));};exports[_0x6425('0x46')]=function(_0x5f4c5d,_0x48fb8f){return db['ChatTransferReport'][_0x6425('0x46')](_0x5f4c5d[_0x6425('0x47')],{})[_0x6425('0x25')](respondWithResult(_0x48fb8f,0xc9))['catch'](handleError(_0x48fb8f,null));};exports[_0x6425('0x24')]=function(_0xb8fcdb,_0x137abb){if(_0xb8fcdb[_0x6425('0x47')]['id']){delete _0xb8fcdb[_0x6425('0x47')]['id'];}return db[_0x6425('0x3c')][_0x6425('0x45')]({'where':{'id':_0xb8fcdb[_0x6425('0x42')]['id']}})[_0x6425('0x25')](handleEntityNotFound(_0x137abb,null))[_0x6425('0x25')](saveUpdates(_0xb8fcdb[_0x6425('0x47')],null))[_0x6425('0x25')](respondWithResult(_0x137abb,null))[_0x6425('0x40')](handleError(_0x137abb,null));};exports[_0x6425('0x26')]=function(_0x5c4702,_0x1b7354){return db[_0x6425('0x3c')][_0x6425('0x45')]({'where':{'id':_0x5c4702[_0x6425('0x42')]['id']}})[_0x6425('0x25')](handleEntityNotFound(_0x1b7354,null))[_0x6425('0x25')](removeEntity(_0x1b7354,null))['catch'](handleError(_0x1b7354,null));};exports['describe']=function(_0x4fc8c5,_0x372e65){return db[_0x6425('0x3c')][_0x6425('0x48')]()[_0x6425('0x25')](respondWithResult(_0x372e65,null))[_0x6425('0x40')](handleError(_0x372e65,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 401b278..4a3dd2b 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 _0x8c7d=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c7d,0x186));var _0xd8c7=function(_0x1a94a9,_0x61a77d){_0x1a94a9=_0x1a94a9-0x0;var _0x2118f2=_0x8c7d[_0x1a94a9];return _0x2118f2;};'use strict';var _=require(_0xd8c7('0x0'));var util=require(_0xd8c7('0x1'));var logger=require(_0xd8c7('0x2'))(_0xd8c7('0x3'));var moment=require(_0xd8c7('0x4'));var BPromise=require(_0xd8c7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8c7('0x6'));var rimraf=require(_0xd8c7('0x7'));var config=require(_0xd8c7('0x8'));var attributes=require(_0xd8c7('0x9'));module['exports']=function(_0x1e77c6,_0x1eeba3){return _0x1e77c6[_0xd8c7('0xa')](_0xd8c7('0xb'),attributes,{'tableName':_0xd8c7('0xc'),'paranoid':![],'indexes':[{'name':_0xd8c7('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe75=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5744d1,_0x30a094){var _0x2d27d0=function(_0xd7181){while(--_0xd7181){_0x5744d1['push'](_0x5744d1['shift']());}};_0x2d27d0(++_0x30a094);}(_0xbe75,0x19c));var _0x5be7=function(_0x104954,_0x4bee51){_0x104954=_0x104954-0x0;var _0x2a1d83=_0xbe75[_0x104954];return _0x2a1d83;};'use strict';var _=require(_0x5be7('0x0'));var util=require(_0x5be7('0x1'));var logger=require(_0x5be7('0x2'))(_0x5be7('0x3'));var moment=require(_0x5be7('0x4'));var BPromise=require(_0x5be7('0x5'));var rp=require(_0x5be7('0x6'));var fs=require('fs');var path=require(_0x5be7('0x7'));var rimraf=require(_0x5be7('0x8'));var config=require(_0x5be7('0x9'));var attributes=require(_0x5be7('0xa'));module[_0x5be7('0xb')]=function(_0x526f62,_0x51ab55){return _0x526f62[_0x5be7('0xc')](_0x5be7('0xd'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x5be7('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index e934727..efe2117 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 _0xcbd8=['request\x20sent','debug','error','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcbd8,0x1c7));var _0x8cbd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xcbd8[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x8cbd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8cbd('0x1'));var fs=require('fs');var Redis=require(_0x8cbd('0x2'));var db=require(_0x8cbd('0x3'))['db'];var utils=require(_0x8cbd('0x4'));var logger=require(_0x8cbd('0x5'))(_0x8cbd('0x6'));var config=require(_0x8cbd('0x7'));var jayson=require(_0x8cbd('0x8'));var client=jayson['client'][_0x8cbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x238fa5,_0x32f493,_0x2d6267){return new BPromise(function(_0x4f1194,_0x48726a){return client[_0x8cbd('0xa')](_0x238fa5,_0x2d6267)['then'](function(_0x5864cb){logger[_0x8cbd('0xb')](_0x8cbd('0xc'),_0x32f493,_0x8cbd('0xd'));logger[_0x8cbd('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x32f493,'request\x20sent',JSON['stringify'](_0x5864cb));if(_0x5864cb['error']){if(_0x5864cb[_0x8cbd('0xf')]['code']===0x1f4){logger['error'](_0x8cbd('0xc'),_0x32f493,_0x5864cb['error']['message']);return _0x48726a(_0x5864cb[_0x8cbd('0xf')][_0x8cbd('0x10')]);}logger['error'](_0x8cbd('0xc'),_0x32f493,_0x5864cb[_0x8cbd('0xf')][_0x8cbd('0x10')]);return _0x4f1194(_0x5864cb[_0x8cbd('0xf')][_0x8cbd('0x10')]);}else{logger[_0x8cbd('0xb')](_0x8cbd('0xc'),_0x32f493,_0x8cbd('0xd'));_0x4f1194(_0x5864cb['result']['message']);}})[_0x8cbd('0x11')](function(_0x4eef43){logger[_0x8cbd('0xf')](_0x8cbd('0xc'),_0x32f493,_0x4eef43);_0x48726a(_0x4eef43);});});}
\ No newline at end of file
+var _0xaccf=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4a0c20,_0x1b7a7a){var _0x4a5de6=function(_0x26d705){while(--_0x26d705){_0x4a0c20['push'](_0x4a0c20['shift']());}};_0x4a5de6(++_0x1b7a7a);}(_0xaccf,0x75));var _0xfacc=function(_0x3dfbc5,_0x4d59f0){_0x3dfbc5=_0x3dfbc5-0x0;var _0x44a7b6=_0xaccf[_0x3dfbc5];return _0x44a7b6;};'use strict';var _=require(_0xfacc('0x0'));var util=require(_0xfacc('0x1'));var moment=require('moment');var BPromise=require(_0xfacc('0x2'));var rs=require(_0xfacc('0x3'));var fs=require('fs');var Redis=require(_0xfacc('0x4'));var db=require(_0xfacc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfacc('0x6'))('rpc');var config=require(_0xfacc('0x7'));var jayson=require(_0xfacc('0x8'));var client=jayson[_0xfacc('0x9')][_0xfacc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x538a33,_0x295d29,_0x4466af){return new BPromise(function(_0x467a3f,_0x3ce865){return client['request'](_0x538a33,_0x4466af)[_0xfacc('0xb')](function(_0x5afcea){logger[_0xfacc('0xc')](_0xfacc('0xd'),_0x295d29,_0xfacc('0xe'));logger[_0xfacc('0xf')](_0xfacc('0x10'),_0x295d29,'request\x20sent',JSON[_0xfacc('0x11')](_0x5afcea));if(_0x5afcea[_0xfacc('0x12')]){if(_0x5afcea[_0xfacc('0x12')][_0xfacc('0x13')]===0x1f4){logger[_0xfacc('0x12')](_0xfacc('0xd'),_0x295d29,_0x5afcea['error']['message']);return _0x3ce865(_0x5afcea['error'][_0xfacc('0x14')]);}logger['error'](_0xfacc('0xd'),_0x295d29,_0x5afcea[_0xfacc('0x12')][_0xfacc('0x14')]);return _0x467a3f(_0x5afcea[_0xfacc('0x12')][_0xfacc('0x14')]);}else{logger[_0xfacc('0xc')](_0xfacc('0xd'),_0x295d29,_0xfacc('0xe'));_0x467a3f(_0x5afcea['result']['message']);}})[_0xfacc('0x15')](function(_0xf879d3){logger[_0xfacc('0x12')](_0xfacc('0xd'),_0x295d29,_0xf879d3);_0x3ce865(_0xf879d3);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index bb8c8d0..d2f4179 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 _0xf583=['express','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','isAuthenticated','show','put','/:id','update','exports','multer','util'];(function(_0x325dee,_0xb67e1f){var _0xc05924=function(_0x41ef66){while(--_0x41ef66){_0x325dee['push'](_0x325dee['shift']());}};_0xc05924(++_0xb67e1f);}(_0xf583,0x12a));var _0x3f58=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xf583[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x3f58('0x0'));var util=require(_0x3f58('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3f58('0x2'));var router=express['Router']();var fs_extra=require(_0x3f58('0x3'));var auth=require(_0x3f58('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3f58('0x5'));var controller=require(_0x3f58('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x3f58('0x7')]);router[_0x3f58('0x8')]('/describe',auth[_0x3f58('0x9')](),controller['describe']);router['get']('/:id',auth[_0x3f58('0x9')](),controller[_0x3f58('0xa')]);router['post']('/',auth[_0x3f58('0x9')](),controller['create']);router[_0x3f58('0xb')](_0x3f58('0xc'),auth['isAuthenticated'](),controller[_0x3f58('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3f58('0xe')]=router;
\ No newline at end of file
+var _0x9981=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3c029c,_0x2e3027){var _0x4749fb=function(_0x2354a1){while(--_0x2354a1){_0x3c029c['push'](_0x3c029c['shift']());}};_0x4749fb(++_0x2e3027);}(_0x9981,0x159));var _0x1998=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x9981[_0x4ae829];return _0x256b31;};'use strict';var multer=require(_0x1998('0x0'));var util=require(_0x1998('0x1'));var path=require(_0x1998('0x2'));var timeout=require(_0x1998('0x3'));var express=require(_0x1998('0x4'));var router=express[_0x1998('0x5')]();var fs_extra=require(_0x1998('0x6'));var auth=require(_0x1998('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1998('0x8'));var controller=require(_0x1998('0x9'));router[_0x1998('0xa')]('/',auth[_0x1998('0xb')](),controller[_0x1998('0xc')]);router[_0x1998('0xa')](_0x1998('0xd'),auth['isAuthenticated'](),controller[_0x1998('0xe')]);router[_0x1998('0xa')](_0x1998('0xf'),auth[_0x1998('0xb')](),controller[_0x1998('0x10')]);router[_0x1998('0x11')]('/',auth[_0x1998('0xb')](),controller[_0x1998('0x12')]);router['put'](_0x1998('0xf'),auth[_0x1998('0xb')](),controller[_0x1998('0x13')]);router[_0x1998('0x14')](_0x1998('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x1998('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 9c51e61..b0c0977 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 _0xab74=['Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','INTEGER','stringify','input','text','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','setDataValue','generate','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:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!'];(function(_0x48ed9a,_0x3ebf20){var _0x69bc41=function(_0x2b7208){while(--_0x2b7208){_0x48ed9a['push'](_0x48ed9a['shift']());}};_0x69bc41(++_0x3ebf20);}(_0xab74,0x85));var _0x4ab7=function(_0x3bebeb,_0x3d9919){_0x3bebeb=_0x3bebeb-0x0;var _0x3e81c4=_0xab74[_0x3bebeb];return _0x3e81c4;};'use strict';var Sequelize=require(_0x4ab7('0x0'));var rs=require(_0x4ab7('0x1'));module['exports']={'name':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'unique':_0x4ab7('0x3')},'description':{'type':Sequelize[_0x4ab7('0x2')]},'mapKey':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x4')},'mapKeyOffline':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x4')},'key':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':_0x4ab7('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':_0x4ab7('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4ab7('0x2')]},'animation':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4ab7('0x7')](_0x4ab7('0x8'),_0x4ab7('0x9')),'defaultValue':_0x4ab7('0x8')},'header_online':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xa')},'start_chat_button':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xb')},'offline_chat_button':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xc')},'header_offline':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4ab7('0xf')]},'closingQuestion':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x10')},'placeholderMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x11')},'closingMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x12')},'closingMessageButton':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xc')},'skipMessageButton':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4ab7('0x13')},'ratingType':{'type':Sequelize[_0x4ab7('0x7')]('star','thumb'),'defaultValue':_0x4ab7('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x4ab7('0x15')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4ab7('0xf')],'defaultValue':function(){return JSON[_0x4ab7('0x16')]({'items':[{'type':_0x4ab7('0x17'),'variable':null,'config':{'placeholder':'name','type':_0x4ab7('0x18'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x4ab7('0x17'),'props':{'title':_0x4ab7('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x4ab7('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4ab7('0x19')](_0x4ab7('0x1a'))?JSON['parse'](this['getDataValue'](_0x4ab7('0x1a'))):{};},'set':function(_0xb71604){return this['setDataValue'](_0x4ab7('0x1a'),JSON[_0x4ab7('0x16')](_0xb71604));}},'offlineForm':{'type':Sequelize[_0x4ab7('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x4ab7('0x17'),'props':{'title':_0x4ab7('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4ab7('0x4'),'type':'email'},'variable':null},{'type':_0x4ab7('0x1b'),'config':{'placeholder':'Comments'},'props':{'title':_0x4ab7('0x1c'),'helpText':_0x4ab7('0x1d')}}],'fromKey':0x0});},'get':function(){return this[_0x4ab7('0x19')](_0x4ab7('0x1e'))?JSON[_0x4ab7('0x1f')](this['getDataValue'](_0x4ab7('0x1e'))):{};},'set':function(_0x3c6570){return this[_0x4ab7('0x20')](_0x4ab7('0x1e'),JSON[_0x4ab7('0x16')](_0x3c6570));}},'token':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':function(){return rs[_0x4ab7('0x21')]();}},'autoclose':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4ab7('0x2')]},'forwardOffline':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4ab7('0x2')]},'waitingTitle':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x23')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x24')},'sendUnmanaged':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4ab7('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4ab7('0xf')],'defaultValue':function(){return _0x4ab7('0x25');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x4ab7('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4ab7('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x4ab7('0x15')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x27')},'messagesAlignment':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x28')},'defaultTitle':{'type':Sequelize[_0x4ab7('0x2')]},'customerAvatar':{'type':Sequelize[_0x4ab7('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4ab7('0x15')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':_0x4ab7('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4ab7('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4ab7('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4ab7('0x15')],'comment':_0x4ab7('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![],'comment':_0x4ab7('0x2c'),'set':function(_0x533e52){if(!_0x533e52)this['setDataValue'](_0x4ab7('0x2d'),null);this[_0x4ab7('0x20')](_0x4ab7('0x2e'),_0x533e52);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x4ab7('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x4ab7('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8188=['Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','star','TEXT','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0x8188,0x1e2));var _0x8818=function(_0x28fd67,_0xa0de0d){_0x28fd67=_0x28fd67-0x0;var _0x12e454=_0x8188[_0x28fd67];return _0x12e454;};'use strict';var Sequelize=require(_0x8818('0x0'));var rs=require(_0x8818('0x1'));module['exports']={'name':{'type':Sequelize[_0x8818('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x8818('0x2')],'allowNull':![],'unique':_0x8818('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x8818('0x4')},'key':{'type':Sequelize[_0x8818('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x5')},'customerAlias':{'type':Sequelize[_0x8818('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8818('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8818('0x2')],'allowNull':![],'defaultValue':_0x8818('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8818('0x2')],'allowNull':![],'defaultValue':_0x8818('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8818('0x2')],'allowNull':![],'defaultValue':_0x8818('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8818('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8818('0x8')](_0x8818('0x9'),'squared'),'defaultValue':_0x8818('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x8818('0xa')},'start_chat_button':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x8818('0xc')},'header_offline':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0xd')},'download_transcript':{'type':Sequelize[_0x8818('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8818('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x8818('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x8818('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8818('0x14')},'closingMessageButton':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0xc')},'skipMessageButton':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x15')},'conditionAgreement':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x8818('0x16'),'thumb'),'defaultValue':_0x8818('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x8818('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8818('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x8818('0x18'),'type':_0x8818('0x19'),'required':!![]},'props':{'title':_0x8818('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x8818('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x8818('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8818('0x1a')](_0x8818('0x1b'))?JSON[_0x8818('0x1c')](this[_0x8818('0x1a')](_0x8818('0x1b'))):{};},'set':function(_0x32189e){return this[_0x8818('0x1d')](_0x8818('0x1b'),JSON[_0x8818('0x1e')](_0x32189e));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x8818('0x1e')]({'items':[{'type':_0x8818('0x1f'),'props':{'title':_0x8818('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x8818('0x20'),'config':{'placeholder':_0x8818('0x21')},'props':{'title':_0x8818('0x21'),'helpText':_0x8818('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8818('0x23'))?JSON[_0x8818('0x1c')](this['getDataValue'](_0x8818('0x23'))):{};},'set':function(_0x241adb){return this[_0x8818('0x1d')](_0x8818('0x23'),JSON[_0x8818('0x1e')](_0x241adb));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8818('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8818('0x2')]},'waitingTitle':{'type':Sequelize[_0x8818('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x26')},'offlineMessageBody':{'type':Sequelize[_0x8818('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x8818('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8818('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x8818('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8818('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8818('0x17')],'defaultValue':function(){return _0x8818('0x27');}},'notificationSound':{'type':Sequelize[_0x8818('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8818('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x8818('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8818('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x28')},'verticalAlignment':{'type':Sequelize[_0x8818('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x29')},'messagesAlignment':{'type':Sequelize[_0x8818('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8818('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8818('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8818('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8818('0x2')],'defaultValue':_0x8818('0x2b')},'systemAvatar':{'type':Sequelize[_0x8818('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8818('0xf')],'comment':_0x8818('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8818('0x2d'),'set':function(_0x5ebcef){if(!_0x5ebcef)this[_0x8818('0x1d')](_0x8818('0x2e'),null);this[_0x8818('0x1d')](_0x8818('0x2f'),_0x5ebcef);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x8818('0x2')],'allowNull':![],'defaultValue':_0x8818('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x8818('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x8818('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8818('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8818('0x17')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index c9e24fc..70a2bd0 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 _0xf3cd=['split','firstName','lastName','x-real-port','referer','browser','name','version','format','unknown','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','type','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','length','find','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','create','update','addDisposition','Disposition','pick','ChatWebsiteId','options','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','orderBy','list','ListId','contact','headers','threadId','closed','ChatInteraction','customerIp','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','applications','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','ChatQueue','Start','startRouting','EventManager','offline','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','server','files','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','Tag','color','tag','getProactiveActions','virtual','License','chatLicenseExceeded','timezone','3.13.0','origin','http://localhost:9000','testWebsiteWithWildcard','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','transaction','Transaction','bulkCreate','findAndCountAll','priority','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','handleError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','get','UserProfileResource','destroy','stack','user-agent-parser','setUA','getResult','cf-connecting-ip','x-forwarded-for'];(function(_0x148cab,_0xe10466){var _0x4df904=function(_0x53d14d){while(--_0x53d14d){_0x148cab['push'](_0x148cab['shift']());}};_0x4df904(++_0xe10466);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0xf3cd[_0x5da0d9];return _0x4b6d2f;};'use strict';var Mustache=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var ejs=require(_0xdf3c('0x3'));var fs=require('fs');var fs_extra=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var querystring=require('querystring');var htmlToText=require(_0xdf3c('0x6'));var Redis=require(_0xdf3c('0x7'));var jayson=require(_0xdf3c('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0xdf3c('0x9'))(_0xdf3c('0xa'));var config=require(_0xdf3c('0xb'));var APIBadRequestError=require(_0xdf3c('0xc'))[_0xdf3c('0xd')];var APINotFoundError=require(_0xdf3c('0xc'))['APINotFoundError'];var APIOutOfIntervalError=require(_0xdf3c('0xc'))['APIOutOfIntervalError'];var APIHandleError=require('../../errors/api')[_0xdf3c('0xe')];var APIConflictError=require(_0xdf3c('0xc'))['APIConflictError'];var wildcardUtils=require(_0xdf3c('0xf'));var URL=require(_0xdf3c('0x10'))[_0xdf3c('0x11')];var db=require(_0xdf3c('0x12'))['db'];config[_0xdf3c('0x13')]=_[_0xdf3c('0x14')](config[_0xdf3c('0x13')],{'host':_0xdf3c('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf3c('0x13')]));require(_0xdf3c('0x16'))[_0xdf3c('0x17')](socket);var client=jayson[_0xdf3c('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xdf3c('0x18')][_0xdf3c('0x19')]({'port':0x232a});var client9003=jayson[_0xdf3c('0x18')]['http']({'port':0x232b});var client9001=jayson[_0xdf3c('0x18')][_0xdf3c('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x173041,_0x4274fd,_0x21e587,_0x1a7a5a){return new Promise(function(_0x305ea5,_0x92008b){var _0x2986d0=_0x1a7a5a||client;return _0x2986d0[_0xdf3c('0x1a')](_0x173041,_0x21e587)['then'](function(_0x13b0e6){logger[_0xdf3c('0x1b')](_0xdf3c('0x1c'),_0x4274fd,_0xdf3c('0x1d'));logger[_0xdf3c('0x1e')](_0xdf3c('0x1f'),_0x4274fd,_0xdf3c('0x1d'),JSON[_0xdf3c('0x20')](_0x13b0e6));if(_0x13b0e6[_0xdf3c('0x21')]){if(_0x13b0e6[_0xdf3c('0x21')][_0xdf3c('0x22')]===0x1f4){logger[_0xdf3c('0x21')](_0xdf3c('0x1c'),_0x4274fd,_0x13b0e6['error']['message']);return _0x92008b(_0x13b0e6[_0xdf3c('0x21')]['message']);}logger[_0xdf3c('0x21')](_0xdf3c('0x1c'),_0x4274fd,_0x13b0e6[_0xdf3c('0x21')][_0xdf3c('0x23')]);return _0x305ea5(_0x13b0e6[_0xdf3c('0x21')][_0xdf3c('0x23')]);}else{logger['info'](_0xdf3c('0x1c'),_0x4274fd,_0xdf3c('0x1d'));_0x305ea5(_0x13b0e6[_0xdf3c('0x24')][_0xdf3c('0x23')]);}})[_0xdf3c('0x25')](function(_0x3b5371){logger[_0xdf3c('0x21')](_0xdf3c('0x1c'),_0x4274fd,_0x3b5371);_0x92008b(_0x3b5371);});});}function respondWithStatusCode(_0x18cb46,_0x1adee4){_0x1adee4=_0x1adee4||0xcc;return function(_0x4c076c){if(_0x4c076c){return _0x18cb46[_0xdf3c('0x26')](_0x1adee4);}return _0x18cb46[_0xdf3c('0x27')](_0x1adee4)['end']();};}function respondWithResult(_0xdc8962,_0x59659e){_0x59659e=_0x59659e||0xc8;return function(_0x4eaced){if(_0x4eaced){return _0xdc8962['status'](_0x59659e)[_0xdf3c('0x28')](_0x4eaced);}};}function respondWithFilteredResult(_0x186bba,_0x52b8f6){return function(_0x5c3b5a){if(_0x5c3b5a){var _0x37ecfd=typeof _0x52b8f6[_0xdf3c('0x29')]===_0xdf3c('0x2a')&&typeof _0x52b8f6[_0xdf3c('0x2b')]==='undefined';var _0x43ce06=_0x5c3b5a[_0xdf3c('0x2c')];var _0x5386bf=_0x37ecfd?0x0:_0x52b8f6['offset'];var _0x1f1d8a=_0x37ecfd?_0x5c3b5a[_0xdf3c('0x2c')]:_0x52b8f6[_0xdf3c('0x29')]+_0x52b8f6['limit'];var _0x2355f6;if(_0x1f1d8a>=_0x43ce06){_0x1f1d8a=_0x43ce06;_0x2355f6=0xc8;}else{_0x2355f6=0xce;}_0x186bba[_0xdf3c('0x27')](_0x2355f6);return _0x186bba[_0xdf3c('0x2d')](_0xdf3c('0x2e'),_0x5386bf+'-'+_0x1f1d8a+'/'+_0x43ce06)['json'](_0x5c3b5a);}return null;};}function saveUpdates(_0xda0de0){return function(_0x46b445){if(_0x46b445){return _0x46b445['update'](_0xda0de0)[_0xdf3c('0x2f')](function(_0x3daeda){return _0x3daeda;});}return null;};}function removeEntity(_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x2f')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x30')]({'plain':!![]});var _0x3b9ce8='ChatWebsites';return db[_0xdf3c('0x31')][_0xdf3c('0x32')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x217a65[_0xdf3c('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115){return function(_0x5e8130){if(!_0x5e8130){_0x216115['sendStatus'](0x194);}return _0x5e8130;};}function handleError(_0x52f0c3,_0x44a478){_0x44a478=_0x44a478||0x1f4;return function(_0x2ee9ad){logger[_0xdf3c('0x21')](_0x2ee9ad[_0xdf3c('0x33')]);if(_0x2ee9ad['name']){delete _0x2ee9ad['name'];}_0x52f0c3[_0xdf3c('0x27')](_0x44a478)['send'](_0x2ee9ad);};}function createInteractionObject(_0x46e40f,_0x17b502,_0x3628ae,_0xcdd731){var _0x1004e9=require(_0xdf3c('0x34'));var _0x1c7335=new _0x1004e9();var _0x809f3d=_0x1c7335[_0xdf3c('0x35')](_0x3628ae['user-agent'])[_0xdf3c('0x36')]();var _0x54e689=_0x17b502['customerIp'];if(_0x3628ae[_0xdf3c('0x37')]){_0x54e689=_0x3628ae['cf-connecting-ip'];}else if(_0x3628ae[_0xdf3c('0x38')]){_0x54e689=_['first'](_0x3628ae[_0xdf3c('0x38')][_0xdf3c('0x39')](','));}return{'ContactId':_0xcdd731['id'],'ChatWebsiteId':_0x46e40f,'from':(_0xcdd731[_0xdf3c('0x3a')]||'')+'\x20'+(_0xcdd731[_0xdf3c('0x3b')]||''),'customerIp':_0x54e689,'customerPort':_0x3628ae[_0xdf3c('0x3c')]?_0x3628ae[_0xdf3c('0x3c')]:null,'referer':_0x17b502[_0xdf3c('0x3d')],'browserName':_0x809f3d[_0xdf3c('0x3e')][_0xdf3c('0x3f')]&&_0x809f3d[_0xdf3c('0x3e')][_0xdf3c('0x40')]?util[_0xdf3c('0x41')]('%s\x20%s',_0x809f3d['browser'][_0xdf3c('0x3f')],_0x809f3d['browser'][_0xdf3c('0x40')]):_0xdf3c('0x42'),'browserVersion':_0x809f3d[_0xdf3c('0x3e')][_0xdf3c('0x40')]||'unknown','osName':util['format'](_0xdf3c('0x43'),_0x809f3d['os'][_0xdf3c('0x3f')],_0x809f3d['os'][_0xdf3c('0x40')]),'osVersion':_0x809f3d['os']['version'],'deviceModel':_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x45')]&&_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x46')]?util['format'](_0xdf3c('0x47'),_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x45')],_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x46')],_0x809f3d['device'][_0xdf3c('0x48')]):null,'deviceVendor':_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x46')],'deviceType':_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x48')],'formData':JSON[_0xdf3c('0x20')](_0x17b502)};}exports['index']=function(_0x4d6349,_0x2c6c6d){var _0x2be86d={'include':[{'model':db[_0xdf3c('0x49')],'as':_0xdf3c('0x4a')}]},_0x5a4443={},_0x5c9885={'count':0x0,'rows':[]};var _0x46b2bd=_[_0xdf3c('0x4b')](db[_0xdf3c('0x4c')][_0xdf3c('0x4d')],function(_0x466ea1){return{'name':_0x466ea1[_0xdf3c('0x4e')],'type':_0x466ea1[_0xdf3c('0x48')]['key']};});_0x5a4443[_0xdf3c('0x45')]=_[_0xdf3c('0x4b')](_0x46b2bd,_0xdf3c('0x3f'));_0x5a4443[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x4d6349[_0xdf3c('0x4f')]);_0x5a4443[_0xdf3c('0x51')]=_['intersection'](_0x5a4443[_0xdf3c('0x45')],_0x5a4443['query']);_0x2be86d[_0xdf3c('0x52')]=_['intersection'](_0x5a4443[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x4d6349[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x2be86d['attributes']=_0x2be86d['attributes']['length']?_0x2be86d[_0xdf3c('0x52')]:_0x5a4443['model'];if(!_0x4d6349[_0xdf3c('0x4f')][_0xdf3c('0x54')](_0xdf3c('0x55'))){_0x2be86d[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x4d6349['query']['limit']);_0x2be86d[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x4d6349['query'][_0xdf3c('0x29')]);}_0x2be86d[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x4d6349[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0x2be86d[_0xdf3c('0x58')]=qs[_0xdf3c('0x51')](_['pick'](_0x4d6349['query'],_0x5a4443[_0xdf3c('0x51')]),_0x46b2bd);if(_0x4d6349[_0xdf3c('0x4f')][_0xdf3c('0x59')]){_0x2be86d[_0xdf3c('0x58')]=_[_0xdf3c('0x5a')](_0x2be86d[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x46b2bd,function(_0x2aace4){if(_0x2aace4[_0xdf3c('0x48')]!==_0xdf3c('0x5b')){var _0x393ad2={};_0x393ad2[_0x2aace4['name']]={'$like':'%'+_0x4d6349[_0xdf3c('0x4f')]['filter']+'%'};return _0x393ad2;}})});}_0x2be86d=_['merge']({},_0x2be86d,_0x4d6349['options']);var _0x58fcbf={'where':_0x2be86d['where']};return db[_0xdf3c('0x4c')][_0xdf3c('0x2c')](_0x58fcbf)['then'](function(_0x4257c4){_0x5c9885[_0xdf3c('0x2c')]=_0x4257c4;if(_0x4d6349['query'][_0xdf3c('0x5c')]){_0x2be86d[_0xdf3c('0x5d')]=[{'all':!![]}];}return db[_0xdf3c('0x4c')][_0xdf3c('0x5e')](_0x2be86d);})[_0xdf3c('0x2f')](function(_0x28f387){_0x5c9885[_0xdf3c('0x5f')]=_0x28f387;return _0x5c9885;})[_0xdf3c('0x2f')](respondWithFilteredResult(_0x2c6c6d,_0x2be86d))[_0xdf3c('0x25')](handleError(_0x2c6c6d,null));};exports[_0xdf3c('0x60')]=function(_0x55e29b,_0x503d94){var _0x1ed898={'raw':![],'where':{'id':_0x55e29b[_0xdf3c('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0xdf3c('0x4a')}]},_0x158932={};_0x158932[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db['ChatWebsite'][_0xdf3c('0x4d')]);_0x158932[_0xdf3c('0x4f')]=_['keys'](_0x55e29b[_0xdf3c('0x4f')]);_0x158932['filters']=_[_0xdf3c('0x62')](_0x158932[_0xdf3c('0x45')],_0x158932[_0xdf3c('0x4f')]);_0x1ed898[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0x158932[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x55e29b[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x1ed898[_0xdf3c('0x52')]=_0x1ed898[_0xdf3c('0x52')][_0xdf3c('0x63')]?_0x1ed898[_0xdf3c('0x52')]:_0x158932[_0xdf3c('0x45')];if(_0x55e29b[_0xdf3c('0x4f')][_0xdf3c('0x5c')]){_0x1ed898[_0xdf3c('0x5d')]=[{'all':!![]}];}_0x1ed898=_['merge']({},_0x1ed898,_0x55e29b['options']);return db[_0xdf3c('0x4c')][_0xdf3c('0x64')](_0x1ed898)[_0xdf3c('0x2f')](handleEntityNotFound(_0x503d94,null))['then'](respondWithResult(_0x503d94,null))[_0xdf3c('0x25')](handleError(_0x503d94,null));};exports['create']=function(_0x574852,_0x184952){var _0x399db6=null;_0x574852[_0xdf3c('0x65')][_0xdf3c('0x66')][_0xdf3c('0x39')](',')[_0xdf3c('0x67')](_0x1a31d7=>{if(_0x1a31d7[_0xdf3c('0x68')]()!==''&&!wildcardUtils[_0xdf3c('0x69')](_0x1a31d7[_0xdf3c('0x68')]())){_0x399db6=new APIBadRequestError('\x22'+_0x1a31d7[_0xdf3c('0x68')]()+_0xdf3c('0x6a'));}});if(_0x399db6){return handleError(_0x184952,null)(_0x399db6);}return db[_0xdf3c('0x4c')]['create'](_0x574852[_0xdf3c('0x65')],{})[_0xdf3c('0x2f')](function(_0x149cd5){var _0x16d6ea=_0x574852[_0xdf3c('0x6b')]['get']({'plain':!![]});if(!_0x16d6ea)throw new Error(_0xdf3c('0x6c'));if(_0x16d6ea[_0xdf3c('0x6d')]===_0xdf3c('0x6b')){var _0x12d791=_0x149cd5[_0xdf3c('0x30')]({'plain':!![]});var _0x50805c=_0xdf3c('0x6e');return db[_0xdf3c('0x6f')][_0xdf3c('0x64')]({'where':{'name':_0x50805c,'userProfileId':_0x16d6ea[_0xdf3c('0x70')]},'raw':!![]})['then'](function(_0xb867a1){if(_0xb867a1&&_0xb867a1[_0xdf3c('0x71')]===0x0){return db[_0xdf3c('0x31')][_0xdf3c('0x72')]({'name':_0x12d791[_0xdf3c('0x3f')],'resourceId':_0x12d791['id'],'type':_0xb867a1[_0xdf3c('0x3f')],'sectionId':_0xb867a1['id']},{})[_0xdf3c('0x2f')](function(){return _0x149cd5;});}else{return _0x149cd5;}})['catch'](function(_0x2b6069){logger[_0xdf3c('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b6069);throw _0x2b6069;});}return _0x149cd5;})['then'](respondWithResult(_0x184952,0xc9))[_0xdf3c('0x25')](handleError(_0x184952,null));};exports[_0xdf3c('0x73')]=function(_0x3064de,_0x1e6529){var _0x87f730=null;_0x3064de[_0xdf3c('0x65')][_0xdf3c('0x66')][_0xdf3c('0x39')](',')['forEach'](_0x14cd72=>{if(_0x14cd72[_0xdf3c('0x68')]()!==''&&!wildcardUtils[_0xdf3c('0x69')](_0x14cd72['trim']())){_0x87f730=new APIBadRequestError('\x22'+_0x14cd72[_0xdf3c('0x68')]()+_0xdf3c('0x6a'));}});if(_0x87f730){return handleError(_0x1e6529,null)(_0x87f730);}if(_0x3064de[_0xdf3c('0x65')]['id']){delete _0x3064de['body']['id'];}return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x3064de[_0xdf3c('0x61')]['id']},'include':[{'model':db[_0xdf3c('0x49')],'as':_0xdf3c('0x4a')}]})[_0xdf3c('0x2f')](handleEntityNotFound(_0x1e6529,null))['then'](saveUpdates(_0x3064de['body'],null))['then'](respondWithResult(_0x1e6529,null))['catch'](handleError(_0x1e6529,null));};exports['destroy']=function(_0x2a4e4c,_0x3f43a0){return db[_0xdf3c('0x4c')]['find']({'where':{'id':_0x2a4e4c[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x3f43a0,null))[_0xdf3c('0x2f')](removeEntity(_0x3f43a0,null))['catch'](handleError(_0x3f43a0,null));};exports['describe']=function(_0x233718,_0x4e3517){return db[_0xdf3c('0x4c')]['describe']()[_0xdf3c('0x2f')](respondWithResult(_0x4e3517,null))[_0xdf3c('0x25')](handleError(_0x4e3517,null));};exports[_0xdf3c('0x74')]=function(_0x31f023,_0x5316ef){if(_0x31f023['body']['id']){delete _0x31f023[_0xdf3c('0x65')]['id'];}return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x31f023[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x5316ef,null))[_0xdf3c('0x2f')](function(_0x4eb295){if(_0x4eb295){_0x31f023[_0xdf3c('0x65')]['ChatWebsiteId']=_0x4eb295['id'];return db[_0xdf3c('0x75')][_0xdf3c('0x72')](_0x31f023[_0xdf3c('0x65')]);}})[_0xdf3c('0x2f')](respondWithResult(_0x5316ef,null))[_0xdf3c('0x25')](handleError(_0x5316ef,null));};exports['getDispositions']=function(_0x45e4e0,_0x5c27cc){var _0x332041={'raw':![],'where':{}};var _0x4fabda={};var _0x591578={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x45e4e0[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x5c27cc,null))[_0xdf3c('0x2f')](function(_0x391042){if(_0x391042){_0x4fabda[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db['Disposition'][_0xdf3c('0x4d')]);_0x4fabda['query']=_[_0xdf3c('0x50')](_0x45e4e0[_0xdf3c('0x4f')]);_0x4fabda[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0x4fabda[_0xdf3c('0x45')],_0x4fabda[_0xdf3c('0x4f')]);_0x332041[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0x4fabda[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x332041[_0xdf3c('0x52')]=_0x332041[_0xdf3c('0x52')]['length']?_0x332041[_0xdf3c('0x52')]:_0x4fabda[_0xdf3c('0x45')];if(!_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x54')]('nolimit')){_0x332041[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x45e4e0['query']['limit']);_0x332041[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x29')]);}_0x332041[_0xdf3c('0x56')]=qs['sort'](_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0x332041[_0xdf3c('0x58')]=qs[_0xdf3c('0x51')](_[_0xdf3c('0x76')](_0x45e4e0[_0xdf3c('0x4f')],_0x4fabda['filters']));_0x332041[_0xdf3c('0x58')][_0xdf3c('0x77')]=_0x391042['id'];if(_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x59')]){_0x332041[_0xdf3c('0x58')]=_['merge'](_0x332041['where'],{'$or':_['map'](_0x332041[_0xdf3c('0x52')],function(_0x2cdc6d){var _0x2d4ece={};_0x2d4ece[_0x2cdc6d]={'$like':'%'+_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x2d4ece;})});}_0x332041=_[_0xdf3c('0x5a')]({},_0x332041,_0x45e4e0[_0xdf3c('0x78')]);return db[_0xdf3c('0x75')]['count']({'where':_0x332041[_0xdf3c('0x58')]})[_0xdf3c('0x2f')](function(_0x1cb9fd){_0x591578[_0xdf3c('0x2c')]=_0x1cb9fd;if(_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x5c')]){_0x332041['include']=[{'all':!![]}];}return db[_0xdf3c('0x75')][_0xdf3c('0x5e')](_0x332041);})['then'](function(_0x5115ea){_0x591578[_0xdf3c('0x5f')]=_0x5115ea;return _0x591578;});}})['then'](respondWithFilteredResult(_0x5c27cc,_0x332041))[_0xdf3c('0x25')](handleError(_0x5c27cc,null));};exports[_0xdf3c('0x79')]=function(_0x4e917f,_0x2b4084){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x4e917f[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x2b4084,null))[_0xdf3c('0x2f')](function(_0x498882){if(_0x498882){return _0x498882[_0xdf3c('0x79')](_0x4e917f[_0xdf3c('0x4f')][_0xdf3c('0x7a')]);}})[_0xdf3c('0x2f')](respondWithStatusCode(_0x2b4084,null))[_0xdf3c('0x25')](handleError(_0x2b4084,null));};exports[_0xdf3c('0x7b')]=function(_0x3deacb,_0x48b892){if(_0x3deacb['body']['id']){delete _0x3deacb[_0xdf3c('0x65')]['id'];}return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x3deacb['params']['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x48b892,null))['then'](function(_0x56a655){if(_0x56a655){_0x3deacb[_0xdf3c('0x65')][_0xdf3c('0x77')]=_0x56a655['id'];return db['CannedAnswer'][_0xdf3c('0x72')](_0x3deacb['body']);}})[_0xdf3c('0x2f')](respondWithResult(_0x48b892,null))['catch'](handleError(_0x48b892,null));};exports[_0xdf3c('0x7c')]=function(_0x3676a2,_0x284635){var _0xb91d51={'raw':![],'where':{}};var _0x8da8b8={};var _0x87e942={'count':0x0,'rows':[]};return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x3676a2[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x284635,null))[_0xdf3c('0x2f')](function(_0x404761){if(_0x404761){_0x8da8b8[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db['CannedAnswer'][_0xdf3c('0x4d')]);_0x8da8b8[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x3676a2['query']);_0x8da8b8[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0x8da8b8[_0xdf3c('0x45')],_0x8da8b8[_0xdf3c('0x4f')]);_0xb91d51[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0x8da8b8[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0xb91d51[_0xdf3c('0x52')]=_0xb91d51['attributes'][_0xdf3c('0x63')]?_0xb91d51[_0xdf3c('0x52')]:_0x8da8b8[_0xdf3c('0x45')];if(!_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x54')](_0xdf3c('0x55'))){_0xb91d51[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x2b')]);_0xb91d51[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x3676a2['query'][_0xdf3c('0x29')]);}_0xb91d51[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0xb91d51[_0xdf3c('0x58')]=qs[_0xdf3c('0x51')](_['pick'](_0x3676a2[_0xdf3c('0x4f')],_0x8da8b8[_0xdf3c('0x51')]));_0xb91d51[_0xdf3c('0x58')][_0xdf3c('0x77')]=_0x404761['id'];if(_0x3676a2['query'][_0xdf3c('0x59')]){_0xb91d51[_0xdf3c('0x58')]=_['merge'](_0xb91d51[_0xdf3c('0x58')],{'$or':_['map'](_0xb91d51[_0xdf3c('0x52')],function(_0x1b2363){var _0x5e6cc1={};_0x5e6cc1[_0x1b2363]={'$like':'%'+_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x5e6cc1;})});}_0xb91d51=_[_0xdf3c('0x5a')]({},_0xb91d51,_0x3676a2['options']);return db['CannedAnswer'][_0xdf3c('0x2c')]({'where':_0xb91d51['where']})[_0xdf3c('0x2f')](function(_0x82225d){_0x87e942[_0xdf3c('0x2c')]=_0x82225d;if(_0x3676a2[_0xdf3c('0x4f')]['includeAll']){_0xb91d51[_0xdf3c('0x5d')]=[{'all':!![]}];}return db[_0xdf3c('0x7e')]['findAll'](_0xb91d51);})[_0xdf3c('0x2f')](function(_0x545e1c){_0x87e942[_0xdf3c('0x5f')]=_0x545e1c;return _0x87e942;});}})[_0xdf3c('0x2f')](respondWithFilteredResult(_0x284635,_0xb91d51))['catch'](handleError(_0x284635,null));};exports['removeAnswers']=function(_0x243fbf,_0x4e01ca){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x243fbf[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x4e01ca,null))[_0xdf3c('0x2f')](function(_0x12bd07){if(_0x12bd07){return _0x12bd07[_0xdf3c('0x7f')](_0x243fbf[_0xdf3c('0x4f')][_0xdf3c('0x7a')]);}})[_0xdf3c('0x2f')](respondWithStatusCode(_0x4e01ca,null))[_0xdf3c('0x25')](handleError(_0x4e01ca,null));};exports['addLogo']=function(_0x4299d1,_0x132c27){_0x4299d1['body'][_0xdf3c('0x80')]=_0x4299d1[_0xdf3c('0x81')][_0xdf3c('0x82')];return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x4299d1[_0xdf3c('0x61')]['id']}})['then'](handleEntityNotFound(_0x132c27,null))[_0xdf3c('0x2f')](saveUpdates(_0x4299d1['body'],null))[_0xdf3c('0x2f')](respondWithResult(_0x132c27,null))[_0xdf3c('0x25')](handleError(_0x132c27,null));};exports[_0xdf3c('0x83')]=function(_0x2dafff,_0x2a934a){_0x2dafff[_0xdf3c('0x65')]['agentAvatar']=_0x2dafff[_0xdf3c('0x81')][_0xdf3c('0x82')];return db['ChatWebsite'][_0xdf3c('0x64')]({'where':{'id':_0x2dafff[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x2a934a,null))[_0xdf3c('0x2f')](saveUpdates(_0x2dafff[_0xdf3c('0x65')],null))[_0xdf3c('0x2f')](respondWithResult(_0x2a934a,null))[_0xdf3c('0x25')](handleError(_0x2a934a,null));};exports[_0xdf3c('0x84')]=function(_0x59cfce,_0x50b470){_0x59cfce[_0xdf3c('0x65')][_0xdf3c('0x85')]=_0x59cfce[_0xdf3c('0x81')][_0xdf3c('0x82')];return db['ChatWebsite']['find']({'where':{'id':_0x59cfce[_0xdf3c('0x61')]['id']}})['then'](handleEntityNotFound(_0x50b470,null))[_0xdf3c('0x2f')](saveUpdates(_0x59cfce['body'],null))[_0xdf3c('0x2f')](respondWithResult(_0x50b470,null))[_0xdf3c('0x25')](handleError(_0x50b470,null));};exports[_0xdf3c('0x86')]=function(_0x53555a,_0x292798){_0x53555a[_0xdf3c('0x65')]['systemAvatar']=_0x53555a['file'][_0xdf3c('0x82')];return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x53555a[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x292798,null))[_0xdf3c('0x2f')](saveUpdates(_0x53555a[_0xdf3c('0x65')],null))['then'](respondWithResult(_0x292798,null))['catch'](handleError(_0x292798,null));};exports[_0xdf3c('0x87')]=function(_0x39c993,_0x2efe5b){var _0x140e5e=path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x8a'));var _0x828c9c={'where':{'id':_0x39c993[_0xdf3c('0x61')]['id']},'attributes':['id',_0xdf3c('0x80')],'raw':!![]};var _0x3e4a0e=![];return require(_0xdf3c('0x8b'))[_0xdf3c('0x8c')]()[_0xdf3c('0x2f')](function(_0x434b1b){if(_0x434b1b){_0x3e4a0e=_0x434b1b[_0xdf3c('0x8d')];}})[_0xdf3c('0x2f')](function(){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')](_0x828c9c);})['then'](handleEntityNotFound(_0x2efe5b,null))['then'](function(_0x7cf0de){if(_0x7cf0de){if(!_['isNil'](_0x7cf0de['sitepic'])){if(fs[_0xdf3c('0x8e')](path['join'](config[_0xdf3c('0x89')],_0xdf3c('0x8f'),_0x7cf0de['sitepic']))&&_0x3e4a0e){_0x140e5e=path['join'](config['root'],_0xdf3c('0x8f'),_0x7cf0de[_0xdf3c('0x80')]);}}return _0x2efe5b[_0xdf3c('0x90')](_0x140e5e);}})['catch'](handleError(_0x2efe5b,null));};exports[_0xdf3c('0x91')]=function(_0x51f4b6,_0x37b921){var _0x4ba88f=path['join'](config[_0xdf3c('0x89')],_0xdf3c('0x92'));var _0x3ff959={'where':{'id':_0x51f4b6[_0xdf3c('0x61')]['id']},'attributes':['id',_0xdf3c('0x93')],'raw':!![]};return db[_0xdf3c('0x4c')]['find'](_0x3ff959)['then'](handleEntityNotFound(_0x37b921,null))[_0xdf3c('0x2f')](function(_0x57484a){if(_0x57484a){if(!_[_0xdf3c('0x94')](_0x57484a[_0xdf3c('0x93')])){if(fs[_0xdf3c('0x8e')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x95'),_0x57484a[_0xdf3c('0x93')]))){_0x4ba88f=path['join'](config['root'],_0xdf3c('0x95'),_0x57484a[_0xdf3c('0x93')]);}}return _0x37b921[_0xdf3c('0x90')](_0x4ba88f);}})[_0xdf3c('0x25')](handleError(_0x37b921,null));};exports['getCustomerAvatar']=function(_0xe14463,_0x364b5e){var _0x32ec3c=path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x96'));var _0x524482={'where':{'id':_0xe14463[_0xdf3c('0x61')]['id']},'attributes':['id',_0xdf3c('0x85'),'showCustomerAvatar'],'raw':!![]};return db[_0xdf3c('0x4c')][_0xdf3c('0x64')](_0x524482)[_0xdf3c('0x2f')](handleEntityNotFound(_0x364b5e,null))['then'](function(_0x87ec92){if(_0x87ec92){if(!_[_0xdf3c('0x94')](_0x87ec92[_0xdf3c('0x85')])){if(fs[_0xdf3c('0x8e')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x95'),_0x87ec92[_0xdf3c('0x85')]))&&_0x87ec92[_0xdf3c('0x97')]){_0x32ec3c=path['join'](config[_0xdf3c('0x89')],'server/files/images/avatars/',_0x87ec92[_0xdf3c('0x85')]);}}return _0x364b5e[_0xdf3c('0x90')](_0x32ec3c);}})[_0xdf3c('0x25')](handleError(_0x364b5e,null));};exports[_0xdf3c('0x98')]=function(_0x90c66,_0x34344b){var _0x1e2f88=path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x99'));var _0x3a90f4={'where':{'id':_0x90c66['params']['id']},'attributes':['id',_0xdf3c('0x9a')],'raw':!![]};return db[_0xdf3c('0x4c')]['find'](_0x3a90f4)[_0xdf3c('0x2f')](handleEntityNotFound(_0x34344b,null))[_0xdf3c('0x2f')](function(_0x367cd3){if(_0x367cd3){if(!_[_0xdf3c('0x94')](_0x367cd3['systemAvatar'])){if(fs[_0xdf3c('0x8e')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],'server/files/images/avatars/',_0x367cd3['systemAvatar']))){_0x1e2f88=path['join'](config[_0xdf3c('0x89')],_0xdf3c('0x95'),_0x367cd3[_0xdf3c('0x9a')]);}}return _0x34344b[_0xdf3c('0x90')](_0x1e2f88);}})[_0xdf3c('0x25')](handleError(_0x34344b,null));};function checkWebsiteInterval(_0x33132b){var _0x18a7ac=_0x33132b[_0xdf3c('0x9b')];if(!_0x18a7ac){return Promise['resolve'](_0x33132b);}var _0x1a0613=_0x33132b['timezone']||undefined;return _0x18a7ac[_0xdf3c('0x9c')](_0x1a0613)[_0xdf3c('0x2f')](function(_0x1b2e93){if(!_0x1b2e93){throw new APIOutOfIntervalError();}return _0x33132b;});}exports[_0xdf3c('0x9d')]=function(_0x3cb8a7,_0x440c7c){var _0x4e5569={'body':_0x3cb8a7[_0xdf3c('0x65')],'channel':_0xdf3c('0x9e')};var _0x4d3059=[];var _0x28337a=[];var _0x270353={};var _0x5926b6=![];if(_0x3cb8a7[_0xdf3c('0x65')]['id']){delete _0x3cb8a7['body']['id'];}if(_[_0xdf3c('0x94')](_0x3cb8a7['body'][_0xdf3c('0x9f')])){throw new APIBadRequestError(_0xdf3c('0xa0'));}if(_[_0xdf3c('0x94')](_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xa1')])){throw new APIBadRequestError(_0xdf3c('0xa2'));}if(_['isEmpty'](_0x3cb8a7['body']['body'])){throw new APIBadRequestError(_0xdf3c('0xa3'));}var _0x18f52c=_0x3cb8a7['body']['customerIp']&&_0x3cb8a7[_0xdf3c('0x65')]['referer'];return db['CmContact']['describe']()[_0xdf3c('0x2f')](function(_0x242b95){if(!_0x242b95){throw new Error(_0xdf3c('0xa4'));}_0x4d3059=Object['keys'](_0x242b95)[_0xdf3c('0x59')](function(_0x51d880){return![_0xdf3c('0xa5'),_0xdf3c('0xa6')][_0xdf3c('0xa7')](_0x51d880);});_0x28337a=Object[_0xdf3c('0x50')](_0x242b95)[_0xdf3c('0x59')](function(_0x467090){return![_0xdf3c('0xa5'),_0xdf3c('0xa6'),_0xdf3c('0xa8'),'ListId'][_0xdf3c('0xa7')](_0x467090);});if(!_[_0xdf3c('0xa7')](_0x28337a,_0x3cb8a7['body'][_0xdf3c('0xa1')])){throw new APIBadRequestError(_0xdf3c('0xa9')+_0x28337a['join'](',\x20'));}_0x270353[_0x3cb8a7[_0xdf3c('0x65')]['mapKey']]=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0x9f')];})[_0xdf3c('0x2f')](function(){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x3cb8a7[_0xdf3c('0x61')]['id']},'include':[{'model':db[_0xdf3c('0xaa')],'as':_0xdf3c('0xab'),'include':[{'model':db[_0xdf3c('0xac')],'as':_0xdf3c('0xad'),'where':_0x270353,'limit':0x1,'order':[[_0xdf3c('0xa6'),_0xdf3c('0xae')]]}]},{'model':db[_0xdf3c('0xaf')],'as':_0xdf3c('0xb0')},{'model':db[_0xdf3c('0x9b')],'as':_0xdf3c('0x9b'),'include':[{'model':db['Interval'],'as':_0xdf3c('0xb1'),'attributes':['id',_0xdf3c('0xb2')],'raw':!![]}]}]});})['then'](function(_0x518292){if(!_0x518292){throw new APINotFoundError(util[_0xdf3c('0x41')](_0xdf3c('0xb3'),_0x3cb8a7[_0xdf3c('0x61')]['id']));}if(_0x18f52c){return checkWebsiteInterval(_0x518292);}return _0x518292;})['then'](function(_0x5c3767){_0x4e5569[_0xdf3c('0xb4')]=_0x5c3767;_0x4e5569['applications']=_[_0xdf3c('0xb5')](_0x5c3767[_0xdf3c('0xb0')],['priority'],['asc']);if(_0x4e5569[_0xdf3c('0xb4')][_0xdf3c('0xb0')]){delete _0x4e5569[_0xdf3c('0xb4')]['Applications'];}_0x4e5569[_0xdf3c('0xb6')]=_0x5c3767['List']||{'id':_0x5c3767[_0xdf3c('0xb7')]};if(_0x4e5569[_0xdf3c('0xb6')]&&_0x4e5569[_0xdf3c('0xb6')][_0xdf3c('0xad')][_0xdf3c('0x63')]){return _0x4e5569[_0xdf3c('0xb6')]['Contacts'][0x0];}var _0x16ae87=_['defaults'](_0x3cb8a7[_0xdf3c('0x65')],{'firstName':_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0x9f')],'ListId':_0x5c3767['ListId']});_0x16ae87[_0x3cb8a7[_0xdf3c('0x65')]['mapKey']]=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0x9f')];return db['CmContact'][_0xdf3c('0x72')](_0x16ae87,{'fields':_0x4d3059,'raw':!![]});})[_0xdf3c('0x2f')](function(_0x2c3655){_0x4e5569[_0xdf3c('0xb8')]=_0x2c3655;var _0x55969c=createInteractionObject(_0x3cb8a7[_0xdf3c('0x61')]['id'],_0x3cb8a7[_0xdf3c('0x65')],_0x3cb8a7[_0xdf3c('0xb9')],_0x2c3655);var _0x393d06={'ChatWebsiteId':_0x3cb8a7[_0xdf3c('0x61')]['id']};if(_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xba')]){_0x393d06['threadId']=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xba')];_0x393d06[_0xdf3c('0xbb')]=![];return db[_0xdf3c('0xbc')][_0xdf3c('0x64')]({'where':_0x393d06})[_0xdf3c('0x2f')](function(_0x282f44){var _0x6e0498=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xbd')]&&_0x3cb8a7[_0xdf3c('0x65')]['referer'];if(_0x282f44){_0x5926b6=!![];return _0x282f44;}else if(!_0x6e0498&&_0x282f44&&_0x282f44[_0xdf3c('0xbb')]){throw new APIConflictError(_0xdf3c('0xbe'));}_0x55969c[_0xdf3c('0xba')]=_0x3cb8a7['body'][_0xdf3c('0xba')];_0x55969c[_0xdf3c('0xbf')]=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xbf')];return db[_0xdf3c('0xbc')]['create'](_0x55969c);});}_0x393d06[_0xdf3c('0xc0')]=_0x2c3655['id'];if(_0x3cb8a7[_0xdf3c('0x65')]['interaction']&&_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xc1')]['id']){_0x393d06['id']=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xc1')]['id'];return db[_0xdf3c('0xbc')][_0xdf3c('0x64')]({'where':_0x393d06})[_0xdf3c('0x2f')](function(_0x3d9041){var _0x16564c=_0x3cb8a7['body'][_0xdf3c('0xbd')]&&_0x3cb8a7[_0xdf3c('0x65')]['referer'];if(!_0x16564c&&_0x3d9041&&_0x3d9041[_0xdf3c('0xbb')]){throw new APIConflictError(_0xdf3c('0xbe'));}else if(_0x3d9041){_0x5926b6=!![];return _0x3d9041;}else{return db['ChatInteraction']['create'](_0x55969c);}});}return db[_0xdf3c('0xbc')][_0xdf3c('0x72')](_0x55969c);})[_0xdf3c('0x2f')](function(_0x2bf92d){if(!_0x5926b6){return _0x2bf92d;}var _0x1f5c1b={'from':(_0x4e5569[_0xdf3c('0xb8')][_0xdf3c('0x3a')]||'')+'\x20'+(_0x4e5569[_0xdf3c('0xb8')]['lastName']||'')};if(_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xba')]&&_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xc2')]&&_0x3cb8a7['body'][_0xdf3c('0xba')]!=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xc2')]){_0x1f5c1b[_0xdf3c('0xba')]=_0x3cb8a7['body'][_0xdf3c('0xc2')];}return _0x2bf92d[_0xdf3c('0x73')](_0x1f5c1b);})[_0xdf3c('0x2f')](function(_0x58bc3a){_0x4e5569['interaction']=_0x58bc3a[_0xdf3c('0x30')]({'plain':!![]});_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xc3')]=!_0x5926b6;if(_0x4e5569['interaction'][_0xdf3c('0xc3')]){if(_0x4e5569[_0xdf3c('0xb4')][_0xdf3c('0xc4')]){_0x4e5569[_0xdf3c('0xc5')][_0xdf3c('0xc6')]({'id':0x0,'priority':_0x4e5569['applications']['length']+0x1,'app':_0xdf3c('0xc7'),'appdata':'unmanaged','interval':_0xdf3c('0xc8')});}}return db[_0xdf3c('0xc9')][_0xdf3c('0x72')]({'body':_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0x65')],'ChatWebsiteId':_0x3cb8a7[_0xdf3c('0x61')]['id'],'ChatInteractionId':_0x58bc3a['id'],'direction':'in','ContactId':_0x4e5569['contact']['id'],'AttachmentId':_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xca')]});})[_0xdf3c('0x2f')](function(_0x5fcc1){_0x4e5569['message']=_0x5fcc1;if(!_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xcb')]){return;}return db[_0xdf3c('0xcc')]['find']({'attributes':['id','name'],'where':{'id':_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xcb')]}});})['then'](function(_0x20af56){if(_0x20af56){_0x4e5569['applications'][_0xdf3c('0xcd')]({'id':0x0,'priority':0x0,'app':_0xdf3c('0xce'),'appdata':_0x20af56[_0xdf3c('0x3f')]+','+(_0x4e5569[_0xdf3c('0xb4')][_0xdf3c('0xcf')]||0xa),'interval':_0xdf3c('0xc8')});_0x4e5569['forcedOwnership']=!![];}if(!_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xd0')]){return;}return db[_0xdf3c('0xd1')][_0xdf3c('0x64')]({'attributes':['id',_0xdf3c('0x3f')],'where':{'id':_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xd0')]}});})[_0xdf3c('0x2f')](function(_0x43ce1f){if(_0x43ce1f){_0x4e5569[_0xdf3c('0xc5')][_0xdf3c('0xcd')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x43ce1f[_0xdf3c('0x3f')]+','+(_0x4e5569[_0xdf3c('0xb4')]['waitForTheAssignedQueue']||0x12c),'interval':_0xdf3c('0xc8')});}return respondWithRpcPromise(_0xdf3c('0xd2'),_0xdf3c('0xd3'),_0x4e5569);})[_0xdf3c('0x2f')](function(_0xa316ce){respondWithRpcPromise('EventManager',_0xdf3c('0xd4'),{'event':_0xdf3c('0x9d'),'message':_0xa316ce},client9002);return _0xa316ce;})[_0xdf3c('0x2f')](respondWithResult(_0x440c7c,null))[_0xdf3c('0x25')](APIHandleError(_0x440c7c));};exports[_0xdf3c('0xd5')]=function(_0x31391d,_0x158c75){var _0x7554e2,_0xdc8438,_0x4727f2;var _0x299dc3=[];var _0x4c3c70={};var _0x352c54=_0x31391d['files']||[];var _0x40c59b=[];var _0x11a887;return db['CmContact'][_0xdf3c('0xd6')]()[_0xdf3c('0x2f')](function(_0x44388c){if(!_0x44388c){throw new db[(_0xdf3c('0xd7'))][(_0xdf3c('0xd8'))](_0xdf3c('0xd9'));}_0x299dc3=_[_0xdf3c('0xda')](_[_0xdf3c('0x50')](_0x44388c),[_0xdf3c('0xa5'),_0xdf3c('0xa6'),'CompanyId',_0xdf3c('0xb7')]);if(_0x31391d[_0xdf3c('0x65')]['id']){delete _0x31391d['body']['id'];}if(_[_0xdf3c('0x94')](_0x31391d['body'][_0xdf3c('0x9f')])){throw _0x158c75['status'](0x1f4)[_0xdf3c('0xdb')](new db['Sequelize'][(_0xdf3c('0xd8'))](_0xdf3c('0xdc')));}if(_[_0xdf3c('0x94')](_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x65')])||_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x65')]===''){throw _0x158c75[_0xdf3c('0x27')](0x1f4)['send'](new db[(_0xdf3c('0xd7'))][(_0xdf3c('0xd8'))](_0xdf3c('0xdd')));}if(_['isNil'](_0x31391d[_0xdf3c('0x65')][_0xdf3c('0xde')])){throw _0x158c75[_0xdf3c('0x27')](0x1f4)[_0xdf3c('0xdb')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x299dc3));}if(!_['includes'](_0x299dc3,_0x31391d[_0xdf3c('0x65')][_0xdf3c('0xde')])){throw _0x158c75[_0xdf3c('0x27')](0x1f4)[_0xdf3c('0xdb')](new db[(_0xdf3c('0xd7'))][(_0xdf3c('0xd8'))](_0xdf3c('0xdf')+_0x299dc3));}_0x4c3c70[_0x31391d['body'][_0xdf3c('0xde')]]=_0x31391d['body'][_0xdf3c('0x9f')];})[_0xdf3c('0x2f')](function(){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x31391d[_0xdf3c('0x61')]['id']},'include':[{'model':db[_0xdf3c('0xaa')],'as':_0xdf3c('0xab')},{'model':db[_0xdf3c('0xe0')],'as':'MailAccount'}]});})[_0xdf3c('0x2f')](handleEntityNotFound(_0x158c75,null))[_0xdf3c('0x2f')](function(_0x474e78){if(_0x474e78&&_0x474e78[_0xdf3c('0xab')]){_0xdc8438=_0x474e78;var _0x25bc5a=_['defaults'](_0x31391d['body'],{'firstName':_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x9f')],'phone':_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x9f')],'ListId':_0x474e78[_0xdf3c('0xb7')]});_0x25bc5a[_0x31391d[_0xdf3c('0x65')][_0xdf3c('0xde')]]=_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x9f')];return db[_0xdf3c('0xac')][_0xdf3c('0xe1')]({'where':_0x4c3c70,'defaults':_0x25bc5a});}})['spread'](function(_0x345a7b){if(_0x345a7b){_0x4727f2=_0x345a7b;var _0x14a995=fs[_0xdf3c('0xe2')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0xe3')),_0xdf3c('0xe4'));var _0x4e8ad8=ejs[_0xdf3c('0xe5')](_0x14a995,{'body':_['toPairs'](_0x31391d[_0xdf3c('0x65')]['body']),'bodyTitle':_0xdc8438[_0xdf3c('0xe6')]});return db[_0xdf3c('0xe7')]['create']({'body':_0x4e8ad8,'plainBody':htmlToText['fromString'](_0x4e8ad8),'ContactId':_0x345a7b['id'],'ChatWebsiteId':_0xdc8438['id']});}})[_0xdf3c('0x2f')](function(_0x10b2d9){_0x11a887=_0x10b2d9;if(_0x352c54[_0xdf3c('0x63')]){var _0x31d7d7=_0x352c54[_0xdf3c('0x4b')](function(_0x50e6e7){return{'name':_0x50e6e7[_0xdf3c('0xe8')],'basename':_0x50e6e7[_0xdf3c('0x82')],'type':_0x50e6e7[_0xdf3c('0xe9')],'ChatOfflineMessageId':_0x10b2d9['id']};});_0x40c59b=_0x31d7d7[_0xdf3c('0x4b')](_0x40944d=>{var _0x5b6c9a={'filename':_0x40944d[_0xdf3c('0x3f')],'path':path['join'](config[_0xdf3c('0x89')],'server','files',_0xdf3c('0xea'),_0xdf3c('0xeb'),_0x40944d[_0xdf3c('0xec')])};return _0x5b6c9a;});if(!_0xdc8438[_0xdf3c('0xed')]){return db[_0xdf3c('0xee')]['transaction'](function(_0xd3d760){return db[_0xdf3c('0xef')]['bulkCreate'](_0x31d7d7,{'transaction':_0xd3d760});});}}})[_0xdf3c('0x2f')](function(){if(_0x11a887){_0x7554e2=_0x11a887;return db[_0xdf3c('0xe0')][_0xdf3c('0x7d')]({'where':{'service':!![]},'include':[{'model':db[_0xdf3c('0xf0')],'as':_0xdf3c('0xf1'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xdf3c('0xf2'),'raw':!![]}]}]});}})[_0xdf3c('0x2f')](function(_0x25ed77){if(_0x25ed77&&_0x25ed77[_0xdf3c('0xf1')]&&_0xdc8438[_0xdf3c('0xf3')]&&_0xdc8438['forwardOfflineAddress']){var _0x2cf46=_0x25ed77[_0xdf3c('0xf4')]();return respondWithRpcPromise(_0xdf3c('0xf5'),_0xdf3c('0xf6'),{'account':_0x2cf46,'message':{'from':util[_0xdf3c('0x41')](_0xdf3c('0xf7'),_0x25ed77[_0xdf3c('0x3f')],_0x25ed77[_0xdf3c('0xf8')]||_0x25ed77[_0xdf3c('0xf1')][_0xdf3c('0x6b')]),'to':_0xdc8438[_0xdf3c('0xf9')],'subject':_0xdc8438[_0xdf3c('0xfa')],'html':_0x7554e2[_0xdf3c('0x65')],'attachments':_0x40c59b}},client9003)[_0xdf3c('0x2f')](function(){return _0x7554e2;})[_0xdf3c('0x25')](function(_0x2be6c7){logger[_0xdf3c('0x21')](_0x2be6c7);});}})[_0xdf3c('0x2f')](function(){if(_0xdc8438&&_0xdc8438['openNewInteraction']&&_0xdc8438[_0xdf3c('0xfb')]){var _0x350e07=[];if(_0x352c54[_0xdf3c('0x63')]){_0x350e07=_0x352c54['map'](function(_0xb9f71c){return{'name':_0xb9f71c['originalname'],'basename':_0xb9f71c[_0xdf3c('0x82')],'type':_0xb9f71c['mimetype'],'ChatOfflineMessageId':_0x11a887['id']};});}var _0x425ddb;if(!_[_0xdf3c('0x94')](_0xdc8438[_0xdf3c('0xfc')])){var _0xd9aaa5=_[_0xdf3c('0x4b')](_0x31391d[_0xdf3c('0x65')],function(_0xd8be1){return _0xd8be1;});var _0x4642ca=_[_0xdf3c('0xfd')](_0xd9aaa5)[0x0];var _0x4e3a41=_[_0xdf3c('0xfe')](_0x4642ca,function(_0x3e3d63){return _0x3e3d63;});_0x425ddb=_0x4e3a41[0x1][_0xdc8438[_0xdf3c('0xfc')]];}var _0x2964ed={'from':_0x4727f2['email'],'firstName':_0x4727f2['firstName'],'lastName':_0x4727f2[_0xdf3c('0x3b')],'mapKey':_0xdf3c('0xf8'),'message':{'from':_0x4727f2[_0xdf3c('0xf8')],'to':_0xdc8438[_0xdf3c('0xe0')]['email'],'cc':'','subject':_[_0xdf3c('0x94')](_0x425ddb)?_0xdc8438['offlineMessageSubject']:_0x425ddb,'messageId':'','sentAt':new Date(),'attach':_0x350e07['length'],'attachments':_0x350e07,'originChannel':_0xdf3c('0xff'),'ChatWebsiteId':_0xdc8438['id'],'ChatOfflineMessageId':_0x7554e2['id'],'originTo':_0xdc8438[_0xdf3c('0xe0')]['email']},'body':_0x7554e2[_0xdf3c('0x65')]};var _0x19024e={'account':{'id':_0xdc8438['MailAccountId']},'body':_0x2964ed,'log':_0xdf3c('0x100')};return respondWithRpcPromise(_0xdf3c('0x100'),'notifyMail',_0x19024e,client9001)[_0xdf3c('0x2f')](function(){return _0x7554e2;})[_0xdf3c('0x25')](function(_0x119524){logger[_0xdf3c('0x21')](_0x119524);});}return;})[_0xdf3c('0x2f')](function(){if(_0x7554e2){return _0x7554e2;}})[_0xdf3c('0x2f')](respondWithResult(_0x158c75,null))['catch'](function(){for(var _0x5291d8 of _0x352c54){var _0x1a79a1=path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x101'),_0xdf3c('0x102'),_0xdf3c('0xea'),'offline-chat',_0x5291d8[_0xdf3c('0x82')]);fs_extra[_0xdf3c('0x103')](_0x1a79a1)[_0xdf3c('0x25')](function(_0xb25239){logger['error'](_0xdf3c('0x104'),_0x1a79a1,_0xb25239);});}});};exports[_0xdf3c('0x105')]=function(_0x50d59a,_0x112e4){return db[_0xdf3c('0xbc')][_0xdf3c('0x64')]({'where':{'id':_0x50d59a[_0xdf3c('0x61')]['id']}})['then'](handleEntityNotFound(_0x112e4,null))[_0xdf3c('0x2f')](function(_0xcb362a){if(_0xcb362a){return _0xcb362a[_0xdf3c('0x105')](_0x50d59a[_0xdf3c('0x65')]['ids'],_['omit'](_0x50d59a[_0xdf3c('0x65')],[_0xdf3c('0x7a'),'id'])||{});}})[_0xdf3c('0x2f')](respondWithResult(_0x112e4,null))[_0xdf3c('0x25')](handleError(_0x112e4,null));};exports[_0xdf3c('0x106')]=function(_0x3eb7b2,_0x3fec35){var _0x2fefc1={'raw':![],'where':{}};var _0x5b8dc4={};var _0x375d8d={'count':0x0,'rows':[]};return db[_0xdf3c('0x4c')]['findOne']({'where':{'id':_0x3eb7b2[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x3fec35,null))['then'](function(_0x3d497d){if(_0x3d497d){_0x5b8dc4['model']=_[_0xdf3c('0x50')](db[_0xdf3c('0xbc')][_0xdf3c('0x4d')]);_0x5b8dc4[_0xdf3c('0x4f')]=_['keys'](_0x3eb7b2['query']);_0x5b8dc4['filters']=_[_0xdf3c('0x62')](_0x5b8dc4[_0xdf3c('0x45')],_0x5b8dc4[_0xdf3c('0x4f')]);_0x2fefc1[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0x5b8dc4[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x3eb7b2['query'][_0xdf3c('0x53')]));_0x2fefc1[_0xdf3c('0x52')]=_0x2fefc1['attributes'][_0xdf3c('0x63')]?_0x2fefc1['attributes']:_0x5b8dc4[_0xdf3c('0x45')];if(!_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x54')]('nolimit')){_0x2fefc1[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x2b')]);_0x2fefc1[_0xdf3c('0x29')]=qs['offset'](_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x29')]);}_0x2fefc1[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0x2fefc1[_0xdf3c('0x58')]=qs['filters'](_[_0xdf3c('0x76')](_0x3eb7b2[_0xdf3c('0x4f')],_0x5b8dc4[_0xdf3c('0x51')]));_0x2fefc1['where'][_0xdf3c('0x77')]=_0x3d497d['id'];if(_0x3eb7b2['query'][_0xdf3c('0x59')]){_0x2fefc1[_0xdf3c('0x58')]=_['merge'](_0x2fefc1[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x2fefc1[_0xdf3c('0x52')],function(_0x27a534){var _0x45a467={};_0x45a467[_0x27a534]={'$like':'%'+_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x45a467;})});}_0x2fefc1=_[_0xdf3c('0x5a')]({},_0x2fefc1,_0x3eb7b2[_0xdf3c('0x78')]);return db[_0xdf3c('0xbc')][_0xdf3c('0x2c')]({'where':_0x2fefc1[_0xdf3c('0x58')]})['then'](function(_0x2888e3){_0x375d8d['count']=_0x2888e3;if(_0x3eb7b2['query']['includeAll']){_0x2fefc1['include']=[{'model':db[_0xdf3c('0xac')],'as':_0xdf3c('0x107'),'required':![]},{'model':db[_0xdf3c('0xcc')],'as':_0xdf3c('0x108'),'attributes':[_0xdf3c('0x3f'),_0xdf3c('0x109'),'internal'],'required':![]},{'model':db[_0xdf3c('0x10a')],'as':'Tags','attributes':['id',_0xdf3c('0x3f'),_0xdf3c('0x10b')],'where':_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x10c')]?{'id':_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x10c')]}:undefined,'required':_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x10c')]?!![]:![]}];}return db[_0xdf3c('0xbc')]['findAll'](_0x2fefc1);})[_0xdf3c('0x2f')](function(_0x258b2d){_0x375d8d[_0xdf3c('0x5f')]=_0x258b2d;return _0x375d8d;});}})[_0xdf3c('0x2f')](respondWithFilteredResult(_0x3fec35,_0x2fefc1))['catch'](handleError(_0x3fec35,null));};exports['getSnippet']=function(_0x1a1ac0,_0x22d16f){var _0x427a90=0x0;var _0x5f557c=0x0;var _0x559e83=![];var _0x2fc1d8;var _0x2c2775;return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x1a1ac0[_0xdf3c('0x61')]['id']},'include':[{'model':db[_0xdf3c('0x9b')],'as':_0xdf3c('0x9b'),'include':[{'model':db['Interval'],'as':_0xdf3c('0xb1'),'attributes':['id',_0xdf3c('0xb2')]}]}]})[_0xdf3c('0x2f')](handleEntityNotFound(_0x22d16f,null))[_0xdf3c('0x2f')](function(_0x367df9){if(_0x367df9){_0x2fc1d8=_0x367df9;return _0x367df9[_0xdf3c('0x10d')]({'raw':!![]});}})['then'](function(_0x4cfc67){if(_0x2fc1d8){if(_0x4cfc67){_0x2c2775=_0x4cfc67;}}return require(_0xdf3c('0x8b'))[_0xdf3c('0x8c')]();})[_0xdf3c('0x2f')](function(_0x1b2961){if(_0x1b2961){_0x5f557c=_0x1b2961[_0xdf3c('0x10e')];_0x559e83=_0x1b2961['custom'];}})[_0xdf3c('0x2f')](function(){return db[_0xdf3c('0xbc')][_0xdf3c('0x2c')]({'where':{'closed':![]}});})[_0xdf3c('0x2f')](function(_0x2cab31){_0x427a90=_0x2cab31;if(_0x5f557c&&_0x2cab31>_0x5f557c){return db[_0xdf3c('0x10f')]['findOne']({'where':{'id':0x1}})[_0xdf3c('0x2f')](function(_0x462195){if(_0x462195){_0x462195['increment'](_0xdf3c('0x110'));}});}})['then'](function(){var _0x32c476=_0x2fc1d8[_0xdf3c('0x9b')];var _0xa6fa19=_0x2fc1d8[_0xdf3c('0x111')]||undefined;return _0x32c476?_0x32c476['ifTime'](_0xa6fa19):!![];})['then'](function(_0xa523c8){var _0x52ae27=fs[_0xdf3c('0xe2')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],'server/files/chat/iframe.ejs'),_0xdf3c('0xe4'));var _0x148785=_0xdf3c('0x112');var _0x2b0e64=![];var _0x479252,_0x5696dd;if(_0x1a1ac0[_0xdf3c('0xb9')]['referer']){_0x479252=new URL(_0x1a1ac0[_0xdf3c('0xb9')][_0xdf3c('0x3d')])[_0xdf3c('0x113')];}else if(_0x1a1ac0[_0xdf3c('0xb9')][_0xdf3c('0x113')]){_0x479252=new URL(_0x1a1ac0['headers'][_0xdf3c('0x113')])[_0xdf3c('0x113')];}else{_0x479252=_0xdf3c('0x114');}_0x5696dd=typeof _0x2fc1d8['address'][_0xdf3c('0x39')](',')[_0xdf3c('0x64')](function(_0x8f769e){return wildcardUtils[_0xdf3c('0x115')](_0x8f769e,_0x479252);})!==_0xdf3c('0x2a');var _0xc2306c={'chatVersion':_0x148785,'chatWebsiteAddressOrigin':_0x5696dd?_0x479252:_0x2fc1d8[_0xdf3c('0x66')],'remote':_0x2fc1d8['remote'],'query':querystring['stringify'](_[_0xdf3c('0x5a')](_0x2fc1d8['get']({'plain':!![]}),{'customerIp':_0x1a1ac0[_0xdf3c('0xb9')][_0xdf3c('0x38')]||_0x1a1ac0[_0xdf3c('0xb9')][_0xdf3c('0x116')]||_0x1a1ac0['connection'][_0xdf3c('0x117')]||_0x1a1ac0['ip'],'referer':_0x1a1ac0['headers'][_0xdf3c('0x3d')],'openedInteractions':_0x427a90,'maxInteractions':_0x5f557c,'virtual':_0x559e83['virtual'],'online':_0xa523c8,'custom':_0x559e83,'address':_0x5696dd?_0x479252:null}))[_0xdf3c('0x118')](/'/g,'\x5c\x27')};_0x22d16f[_0xdf3c('0xdb')](ejs[_0xdf3c('0xe5')](Mustache[_0xdf3c('0xe5')](_0x52ae27,_0xc2306c),{'proactiveActions':_0x2c2775,'alignment':_0x2fc1d8[_0xdf3c('0x119')],'verticalAlignment':_0x2fc1d8[_0xdf3c('0x11a')],'div_color':_0x2fc1d8[_0xdf3c('0x10b')],'labelText':_0x2fc1d8['labelText'],'text_color':_0x2fc1d8[_0xdf3c('0x11b')],'text_button_color':_0x2fc1d8[_0xdf3c('0x11c')],'button_color':_0x2fc1d8[_0xdf3c('0x11d')],'background_color':_0x2fc1d8[_0xdf3c('0x11e')],'hideWhenOffline':_0x2fc1d8['hideWhenOffline'],'intervalId':_0x2fc1d8[_0xdf3c('0x11f')],'isDevelopment':_0x2b0e64,'chatVersion':_0x148785}));})[_0xdf3c('0x25')](handleError(_0x22d16f,null));};exports[_0xdf3c('0x120')]=function(_0x2ac5c7,_0x361143){var _0x526533=_0x2ac5c7['params']['id'];var _0x54a06b=_0x2ac5c7[_0xdf3c('0x65')];var _0x47bef6=0xc8;var _0x3ff664=null;return db['sequelize'][_0xdf3c('0x121')]({'isolationLevel':db[_0xdf3c('0xee')][_0xdf3c('0x122')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4dd133){return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x526533},'transaction':_0x4dd133})['then'](function(_0x3819cd){if(_0x3819cd){return db[_0xdf3c('0xaf')][_0xdf3c('0x32')]({'where':{'ChatWebsiteId':_0x526533},'transaction':_0x4dd133})[_0xdf3c('0x2f')](function(){var _0xa729d1=_[_0xdf3c('0x4b')](_0x54a06b,function(_0x2e0bf3){_0x2e0bf3[_0xdf3c('0x77')]=_0x526533;return _0x2e0bf3;});return db['ChatApplication'][_0xdf3c('0x123')](_0xa729d1,{'transaction':_0x4dd133});});}else{_0x47bef6=0x194;_0x3ff664=[];}});})[_0xdf3c('0x2f')](function(){if(_0x47bef6!==0x194){return db[_0xdf3c('0xaf')][_0xdf3c('0x124')]({'where':{'ChatWebsiteId':_0x526533},'order':_0xdf3c('0x125')})['then'](function(_0x461212){_0x3ff664=_0x461212;});}})[_0xdf3c('0x25')](function(_0x41f47a){_0x47bef6=0x1f4;logger[_0xdf3c('0x21')](_0x41f47a[_0xdf3c('0x33')]);if(_0x41f47a[_0xdf3c('0x3f')]){delete _0x41f47a['name'];}_0x3ff664=_0x41f47a;})[_0xdf3c('0x126')](function(){if(_0x3ff664===null){_0x361143['sendStatus'](_0x47bef6);}else{if(_0x47bef6===0x1f4){_0x361143[_0xdf3c('0x27')](_0x47bef6)[_0xdf3c('0xdb')](_0x3ff664);}else{_0x361143[_0xdf3c('0x27')](_0x47bef6)[_0xdf3c('0x28')](_0x3ff664);}}});};exports[_0xdf3c('0x127')]=function(_0x2724b6,_0x3c1a8a){var _0x3b0c07={};var _0x40506e={};var _0x4b46cf;var _0x31cdad;return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x2724b6['params']['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x3c1a8a,null))['then'](function(_0xddf03e){if(_0xddf03e){_0x4b46cf=_0xddf03e;_0x40506e[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db[_0xdf3c('0xaf')][_0xdf3c('0x4d')]);_0x40506e[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x2724b6[_0xdf3c('0x4f')]);_0x40506e[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0x40506e[_0xdf3c('0x45')],_0x40506e[_0xdf3c('0x4f')]);_0x3b0c07['attributes']=_['intersection'](_0x40506e['model'],qs[_0xdf3c('0x53')](_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x3b0c07[_0xdf3c('0x52')]=_0x3b0c07[_0xdf3c('0x52')][_0xdf3c('0x63')]?_0x3b0c07[_0xdf3c('0x52')]:_0x40506e[_0xdf3c('0x45')];_0x3b0c07[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0x3b0c07[_0xdf3c('0x58')]=qs['filters'](_['pick'](_0x2724b6[_0xdf3c('0x4f')],_0x40506e[_0xdf3c('0x51')]));if(_0x2724b6[_0xdf3c('0x4f')]['filter']){_0x3b0c07[_0xdf3c('0x58')]=_['merge'](_0x3b0c07[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x3b0c07['attributes'],function(_0xabf05c){var _0x2e4a90={};_0x2e4a90[_0xabf05c]={'$like':'%'+_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x2e4a90;})});}_0x3b0c07=_[_0xdf3c('0x5a')]({},_0x3b0c07,_0x2724b6[_0xdf3c('0x78')]);return _0x4b46cf[_0xdf3c('0x127')](_0x3b0c07);}})[_0xdf3c('0x2f')](function(_0x5e6a87){if(_0x5e6a87){_0x31cdad=_0x5e6a87[_0xdf3c('0x63')];if(!_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x54')](_0xdf3c('0x55'))){_0x3b0c07['limit']=qs['limit'](_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x2b')]);_0x3b0c07[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x2724b6['query']['offset']);}return _0x4b46cf[_0xdf3c('0x127')](_0x3b0c07);}})[_0xdf3c('0x2f')](function(_0x381d88){if(_0x381d88){return _0x381d88?{'count':_0x31cdad,'rows':_0x381d88}:null;}})['then'](respondWithResult(_0x3c1a8a,null))[_0xdf3c('0x25')](handleError(_0x3c1a8a,null));};exports['addProactiveActions']=function(_0x10bdce,_0x3cb78b){return db[_0xdf3c('0x128')]['find']({'where':{'id':_0x10bdce['params']['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x3cb78b,null))[_0xdf3c('0x2f')](function(_0x3c0d93){if(_0x3c0d93){return _0x3c0d93['addProactiveActions'](_0x10bdce[_0xdf3c('0x65')][_0xdf3c('0x7a')],_['omit'](_0x10bdce[_0xdf3c('0x65')],[_0xdf3c('0x7a'),'id'])||{});}})[_0xdf3c('0x2f')](respondWithResult(_0x3cb78b,null))[_0xdf3c('0x25')](handleError(_0x3cb78b,null));};exports[_0xdf3c('0x10d')]=function(_0x3e8060,_0x1d61c5){var _0x7d5fda={};var _0x9f1875={};var _0x21e823;var _0xd66ea7;return db['ChatWebsite'][_0xdf3c('0x7d')]({'where':{'id':_0x3e8060[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x1d61c5,null))['then'](function(_0x6cce5f){if(_0x6cce5f){_0x21e823=_0x6cce5f;_0x9f1875[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db[_0xdf3c('0x129')]['rawAttributes']);_0x9f1875[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x3e8060[_0xdf3c('0x4f')]);_0x9f1875[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0x9f1875[_0xdf3c('0x45')],_0x9f1875['query']);_0x7d5fda[_0xdf3c('0x52')]=_['intersection'](_0x9f1875[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x3e8060[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x7d5fda[_0xdf3c('0x52')]=_0x7d5fda[_0xdf3c('0x52')][_0xdf3c('0x63')]?_0x7d5fda[_0xdf3c('0x52')]:_0x9f1875['model'];_0x7d5fda[_0xdf3c('0x56')]=qs['sort'](_0x3e8060[_0xdf3c('0x4f')]['sort']);_0x7d5fda['where']=qs[_0xdf3c('0x51')](_[_0xdf3c('0x76')](_0x3e8060['query'],_0x9f1875[_0xdf3c('0x51')]));if(_0x3e8060['query']['filter']){_0x7d5fda[_0xdf3c('0x58')]=_[_0xdf3c('0x5a')](_0x7d5fda[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x7d5fda[_0xdf3c('0x52')],function(_0x4280ac){var _0x2a2447={};_0x2a2447[_0x4280ac]={'$like':'%'+_0x3e8060[_0xdf3c('0x4f')]['filter']+'%'};return _0x2a2447;})});}_0x7d5fda=_[_0xdf3c('0x5a')]({},_0x7d5fda,_0x3e8060[_0xdf3c('0x78')]);return _0x21e823[_0xdf3c('0x10d')](_0x7d5fda);}})[_0xdf3c('0x2f')](function(_0x69233c){if(_0x69233c){_0xd66ea7=_0x69233c[_0xdf3c('0x63')];if(!_0x3e8060['query'][_0xdf3c('0x54')](_0xdf3c('0x55'))){_0x7d5fda[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x3e8060['query']['limit']);_0x7d5fda[_0xdf3c('0x29')]=qs['offset'](_0x3e8060[_0xdf3c('0x4f')]['offset']);}return _0x21e823[_0xdf3c('0x10d')](_0x7d5fda);}})[_0xdf3c('0x2f')](function(_0x58d739){if(_0x58d739){return _0x58d739?{'count':_0xd66ea7,'rows':_0x58d739}:null;}})[_0xdf3c('0x2f')](respondWithResult(_0x1d61c5,null))[_0xdf3c('0x25')](handleError(_0x1d61c5,null));};exports[_0xdf3c('0x12a')]=function(_0x346270,_0x2c732e){var _0x396f50=_0x346270['query']['online']===_0xdf3c('0x12b')?'offlineForm':_0xdf3c('0x12c');return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'attributes':['id',_0x396f50],'where':{'id':_0x346270[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x2c732e,null))[_0xdf3c('0x2f')](function(_0x5ef7a6){if(_0x5ef7a6){var _0x54acce=_0x5ef7a6[_0x396f50];var _0x58a7b7=_0x54acce&&_0x54acce[_0xdf3c('0x12d')]?_0x54acce['items']:[];_0x2c732e[_0xdf3c('0xdb')]({'fromKey':_[_0xdf3c('0x94')](_0x54acce['fromKey'])?undefined:_0x54acce[_0xdf3c('0x12e')],'count':_0x58a7b7[_0xdf3c('0x63')],'rows':_0x58a7b7});}})[_0xdf3c('0x25')](handleError(_0x2c732e,null));};exports[_0xdf3c('0x12f')]=function(_0x2beff1,_0x4264e6){var _0x26dbe6={'raw':![],'where':{}};var _0xdb9eb4={};var _0x5adb7b={'count':0x0,'rows':[]};return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x2beff1[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x4264e6,null))[_0xdf3c('0x2f')](function(_0x120f66){if(_0x120f66){_0xdb9eb4[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db[_0xdf3c('0xe7')][_0xdf3c('0x4d')]);_0xdb9eb4[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x2beff1[_0xdf3c('0x4f')]);_0xdb9eb4[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0xdb9eb4['model'],_0xdb9eb4[_0xdf3c('0x4f')]);_0x26dbe6['attributes']=_[_0xdf3c('0x62')](_0xdb9eb4[_0xdf3c('0x45')],qs['fields'](_0x2beff1[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x26dbe6['attributes']=_0x26dbe6[_0xdf3c('0x52')][_0xdf3c('0x63')]?_0x26dbe6[_0xdf3c('0x52')]:_0xdb9eb4[_0xdf3c('0x45')];if(!_0x2beff1['query']['hasOwnProperty'](_0xdf3c('0x55'))){_0x26dbe6[_0xdf3c('0x2b')]=qs['limit'](_0x2beff1[_0xdf3c('0x4f')][_0xdf3c('0x2b')]);_0x26dbe6[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x2beff1[_0xdf3c('0x4f')][_0xdf3c('0x29')]);}_0x26dbe6[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x2beff1['query'][_0xdf3c('0x57')]);_0x26dbe6[_0xdf3c('0x58')]=qs[_0xdf3c('0x51')](_[_0xdf3c('0x76')](_0x2beff1[_0xdf3c('0x4f')],_0xdb9eb4[_0xdf3c('0x51')]));_0x26dbe6[_0xdf3c('0x58')]['ChatWebsiteId']=_0x120f66['id'];if(_0x2beff1[_0xdf3c('0x4f')][_0xdf3c('0x59')]){_0x26dbe6[_0xdf3c('0x58')]=_[_0xdf3c('0x5a')](_0x26dbe6[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x26dbe6[_0xdf3c('0x52')],function(_0x14d34d){var _0x367cf0={};_0x367cf0[_0x14d34d]={'$like':'%'+_0x2beff1[_0xdf3c('0x4f')]['filter']+'%'};return _0x367cf0;})});}_0x26dbe6=_[_0xdf3c('0x5a')]({},_0x26dbe6,_0x2beff1[_0xdf3c('0x78')]);return db[_0xdf3c('0xe7')][_0xdf3c('0x2c')]({'where':_0x26dbe6[_0xdf3c('0x58')]})[_0xdf3c('0x2f')](function(_0x82b7ee){_0x5adb7b[_0xdf3c('0x2c')]=_0x82b7ee;if(_0x2beff1['query']['includeAll']){_0x26dbe6[_0xdf3c('0x5d')]=[{'all':!![]}];}else{_0x26dbe6['include']=[{'model':db[_0xdf3c('0xac')],'as':_0xdf3c('0x107'),'required':![]},{'model':db[_0xdf3c('0xef')],'as':_0xdf3c('0x130'),'required':![]}];}return db[_0xdf3c('0xe7')]['findAll'](_0x26dbe6);})[_0xdf3c('0x2f')](function(_0xf864e2){_0x5adb7b[_0xdf3c('0x5f')]=_0xf864e2;return _0x5adb7b;});}})[_0xdf3c('0x2f')](respondWithFilteredResult(_0x4264e6,_0x26dbe6))[_0xdf3c('0x25')](handleError(_0x4264e6,null));};exports['addAgents']=function(_0x4fcf64,_0x471f69){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x4fcf64[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x471f69,null))[_0xdf3c('0x2f')](function(_0x4fe59c){if(_0x4fe59c){return _0x4fe59c[_0xdf3c('0x131')](_0x4fcf64[_0xdf3c('0x65')][_0xdf3c('0x7a')],_['omit'](_0x4fcf64['body'],[_0xdf3c('0x7a'),'id'])||{})['spread'](function(_0x4dc604){for(var _0x136935=0x0;_0x136935<_0x4fcf64[_0xdf3c('0x65')]['ids'][_0xdf3c('0x63')];_0x136935+=0x1){socket[_0xdf3c('0x132')](_0xdf3c('0x133'),{'UserId':Number(_0x4fcf64[_0xdf3c('0x65')][_0xdf3c('0x7a')][_0x136935]),'ChatWebsiteId':Number(_0x4fcf64[_0xdf3c('0x61')]['id'])});}return _0x4dc604;});}})[_0xdf3c('0x2f')](respondWithResult(_0x471f69,null))['catch'](handleError(_0x471f69,null));};exports['removeAgents']=function(_0x3dc2da,_0x413aa3){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x3dc2da[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x413aa3,null))[_0xdf3c('0x2f')](function(_0x20e6b0){if(_0x20e6b0){return _0x20e6b0[_0xdf3c('0x134')](_0x3dc2da[_0xdf3c('0x4f')][_0xdf3c('0x7a')])[_0xdf3c('0x2f')](function(){if(_['isArray'](_0x3dc2da[_0xdf3c('0x4f')][_0xdf3c('0x7a')])){for(var _0x20d58c=0x0;_0x20d58c<_0x3dc2da[_0xdf3c('0x4f')][_0xdf3c('0x7a')][_0xdf3c('0x63')];_0x20d58c+=0x1){socket[_0xdf3c('0x132')](_0xdf3c('0x135'),{'UserId':Number(_0x3dc2da[_0xdf3c('0x4f')][_0xdf3c('0x7a')][_0x20d58c]),'ChatWebsiteId':Number(_0x3dc2da['params']['id'])});}}else{socket[_0xdf3c('0x132')](_0xdf3c('0x135'),{'UserId':Number(_0x3dc2da[_0xdf3c('0x4f')]['ids']),'ChatWebsiteId':Number(_0x3dc2da[_0xdf3c('0x61')]['id'])});}});}})[_0xdf3c('0x2f')](respondWithStatusCode(_0x413aa3,null))[_0xdf3c('0x25')](handleError(_0x413aa3,null));};exports[_0xdf3c('0x136')]=function(_0x5226da,_0x1c9417){var _0x5e7070={};var _0xd096c7={};var _0x2af066;var _0x4a9157;return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x5226da[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x1c9417,null))['then'](function(_0x5b59e6){if(_0x5b59e6){_0x2af066=_0x5b59e6;_0xd096c7[_0xdf3c('0x45')]=_['keys'](db[_0xdf3c('0xcc')]['rawAttributes']);_0xd096c7[_0xdf3c('0x4f')]=_['keys'](_0x5226da[_0xdf3c('0x4f')]);_0xd096c7[_0xdf3c('0x51')]=_['intersection'](_0xd096c7[_0xdf3c('0x45')],_0xd096c7['query']);_0x5e7070[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0xd096c7[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x5226da[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x5e7070['attributes']=_0x5e7070['attributes'][_0xdf3c('0x63')]?_0x5e7070['attributes']:_0xd096c7[_0xdf3c('0x45')];_0x5e7070[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x5226da['query'][_0xdf3c('0x57')]);_0x5e7070[_0xdf3c('0x58')]=qs['filters'](_['pick'](_0x5226da[_0xdf3c('0x4f')],_0xd096c7['filters']));if(_0x5226da[_0xdf3c('0x4f')][_0xdf3c('0x59')]){_0x5e7070[_0xdf3c('0x58')]=_[_0xdf3c('0x5a')](_0x5e7070['where'],{'$or':_['map'](_0x5e7070[_0xdf3c('0x52')],function(_0xc5ad19){var _0x275ac3={};_0x275ac3[_0xc5ad19]={'$like':'%'+_0x5226da[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x275ac3;})});}_0x5e7070=_['merge']({},_0x5e7070,_0x5226da[_0xdf3c('0x78')]);return _0x2af066[_0xdf3c('0x136')](_0x5e7070);}})[_0xdf3c('0x2f')](function(_0x17a760){if(_0x17a760){_0x4a9157=_0x17a760[_0xdf3c('0x63')];if(!_0x5226da[_0xdf3c('0x4f')]['hasOwnProperty'](_0xdf3c('0x55'))){_0x5e7070['limit']=qs[_0xdf3c('0x2b')](_0x5226da['query'][_0xdf3c('0x2b')]);_0x5e7070[_0xdf3c('0x29')]=qs['offset'](_0x5226da[_0xdf3c('0x4f')]['offset']);}return _0x2af066[_0xdf3c('0x136')](_0x5e7070);}})[_0xdf3c('0x2f')](function(_0x241f9d){if(_0x241f9d){return _0x241f9d?{'count':_0x4a9157,'rows':_0x241f9d}:null;}})[_0xdf3c('0x2f')](respondWithResult(_0x1c9417,null))[_0xdf3c('0x25')](handleError(_0x1c9417,null));};
\ No newline at end of file
+var _0xb458=['ChatWebsites','name','send','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','model','vendor','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','includeAll','body','address','forEach','trim','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','params','describe','addDisposition','Disposition','getDispositions','findOne','order','pick','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','existsSync','download','Interval','resolve','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','isEmpty','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Intervals','interval','account','applications','orderBy','priority','asc','list','defaults','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','Sequelize','ValidationError','difference','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','files','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','openNewInteraction','toPairsIn','subjectOffline','email','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','remove','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','origin','x-real-ip','remoteAddress','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','lodash','querystring','html-to-text','ioredis','../../components/parsers/qs','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','url','URL','localhost','socket.io-emitter','redis','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','get'];(function(_0x3f7e37,_0x32f790){var _0x2a3ec7=function(_0x32922c){while(--_0x32922c){_0x3f7e37['push'](_0x3f7e37['shift']());}};_0x2a3ec7(++_0x32f790);}(_0xb458,0x103));var _0x8b45=function(_0x1ec606,_0x1a2d83){_0x1ec606=_0x1ec606-0x0;var _0x5418e4=_0xb458[_0x1ec606];return _0x5418e4;};'use strict';var Mustache=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b45('0x3'));var querystring=require(_0x8b45('0x4'));var htmlToText=require(_0x8b45('0x5'));var Redis=require(_0x8b45('0x6'));var jayson=require('jayson/promise');var qs=require(_0x8b45('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x8b45('0x8'));var APIBadRequestError=require(_0x8b45('0x9'))[_0x8b45('0xa')];var APINotFoundError=require(_0x8b45('0x9'))[_0x8b45('0xb')];var APIOutOfIntervalError=require('../../errors/api')[_0x8b45('0xc')];var APIHandleError=require(_0x8b45('0x9'))[_0x8b45('0xd')];var APIConflictError=require(_0x8b45('0x9'))[_0x8b45('0xe')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x8b45('0xf'))[_0x8b45('0x10')];var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x8b45('0x11'),'port':0x18eb});var socket=require(_0x8b45('0x12'))(new Redis(config[_0x8b45('0x13')]));require('./chatWebsite.socket')[_0x8b45('0x14')](socket);var client=jayson[_0x8b45('0x15')][_0x8b45('0x16')]({'port':0x232c});var client9002=jayson[_0x8b45('0x15')][_0x8b45('0x16')]({'port':0x232a});var client9003=jayson[_0x8b45('0x15')]['http']({'port':0x232b});var client9001=jayson['client'][_0x8b45('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x23f1dd,_0x445170,_0x39c1d1,_0x4781d7){return new Promise(function(_0x27ebb3,_0x902c50){var _0x147d6b=_0x4781d7||client;return _0x147d6b[_0x8b45('0x17')](_0x23f1dd,_0x39c1d1)[_0x8b45('0x18')](function(_0x287a3b){logger[_0x8b45('0x19')](_0x8b45('0x1a'),_0x445170,_0x8b45('0x1b'));logger[_0x8b45('0x1c')](_0x8b45('0x1d'),_0x445170,_0x8b45('0x1b'),JSON[_0x8b45('0x1e')](_0x287a3b));if(_0x287a3b['error']){if(_0x287a3b[_0x8b45('0x1f')][_0x8b45('0x20')]===0x1f4){logger[_0x8b45('0x1f')](_0x8b45('0x1a'),_0x445170,_0x287a3b[_0x8b45('0x1f')][_0x8b45('0x21')]);return _0x902c50(_0x287a3b[_0x8b45('0x1f')][_0x8b45('0x21')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x445170,_0x287a3b[_0x8b45('0x1f')]['message']);return _0x27ebb3(_0x287a3b[_0x8b45('0x1f')][_0x8b45('0x21')]);}else{logger[_0x8b45('0x19')](_0x8b45('0x1a'),_0x445170,_0x8b45('0x1b'));_0x27ebb3(_0x287a3b[_0x8b45('0x22')][_0x8b45('0x21')]);}})['catch'](function(_0x59d36b){logger[_0x8b45('0x1f')](_0x8b45('0x1a'),_0x445170,_0x59d36b);_0x902c50(_0x59d36b);});});}function respondWithStatusCode(_0x500044,_0x5723a2){_0x5723a2=_0x5723a2||0xcc;return function(_0x129c35){if(_0x129c35){return _0x500044[_0x8b45('0x23')](_0x5723a2);}return _0x500044[_0x8b45('0x24')](_0x5723a2)[_0x8b45('0x25')]();};}function respondWithResult(_0x4e84cc,_0x3df287){_0x3df287=_0x3df287||0xc8;return function(_0x24be07){if(_0x24be07){return _0x4e84cc[_0x8b45('0x24')](_0x3df287)[_0x8b45('0x26')](_0x24be07);}};}function respondWithFilteredResult(_0x395dc3,_0xf334b2){return function(_0x461017){if(_0x461017){var _0x234f62=typeof _0xf334b2[_0x8b45('0x27')]===_0x8b45('0x28')&&typeof _0xf334b2[_0x8b45('0x29')]===_0x8b45('0x28');var _0x5b6151=_0x461017['count'];var _0x1d98c3=_0x234f62?0x0:_0xf334b2[_0x8b45('0x27')];var _0x34eb03=_0x234f62?_0x461017[_0x8b45('0x2a')]:_0xf334b2[_0x8b45('0x27')]+_0xf334b2[_0x8b45('0x29')];var _0x1a8974;if(_0x34eb03>=_0x5b6151){_0x34eb03=_0x5b6151;_0x1a8974=0xc8;}else{_0x1a8974=0xce;}_0x395dc3[_0x8b45('0x24')](_0x1a8974);return _0x395dc3['set'](_0x8b45('0x2b'),_0x1d98c3+'-'+_0x34eb03+'/'+_0x5b6151)[_0x8b45('0x26')](_0x461017);}return null;};}function saveUpdates(_0x50302){return function(_0xc2ae94){if(_0xc2ae94){return _0xc2ae94[_0x8b45('0x2c')](_0x50302)['then'](function(_0x29fbec){return _0x29fbec;});}return null;};}function removeEntity(_0x59f257){return function(_0x5a07de){if(_0x5a07de){return _0x5a07de[_0x8b45('0x2d')]()[_0x8b45('0x18')](function(){var _0xd3ba91=_0x5a07de[_0x8b45('0x2e')]({'plain':!![]});var _0x1e72d2=_0x8b45('0x2f');return db['UserProfileResource'][_0x8b45('0x2d')]({'where':{'type':_0x1e72d2,'resourceId':_0xd3ba91['id']}})[_0x8b45('0x18')](function(){return _0x5a07de;});})[_0x8b45('0x18')](function(){_0x59f257[_0x8b45('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b6fba){return function(_0x213037){if(!_0x213037){_0x1b6fba[_0x8b45('0x23')](0x194);}return _0x213037;};}function handleError(_0x55b76b,_0x29c606){_0x29c606=_0x29c606||0x1f4;return function(_0x475401){logger[_0x8b45('0x1f')](_0x475401['stack']);if(_0x475401[_0x8b45('0x30')]){delete _0x475401[_0x8b45('0x30')];}_0x55b76b[_0x8b45('0x24')](_0x29c606)[_0x8b45('0x31')](_0x475401);};}function createInteractionObject(_0x58d94f,_0x14788c,_0x1077bd,_0x2de02d){var _0x15df7c=require(_0x8b45('0x32'));var _0x9acf8=new _0x15df7c();var _0x56d959=_0x9acf8['setUA'](_0x1077bd[_0x8b45('0x33')])[_0x8b45('0x34')]();var _0x41d6b5=_0x14788c[_0x8b45('0x35')];if(_0x1077bd[_0x8b45('0x36')]){_0x41d6b5=_0x1077bd['cf-connecting-ip'];}else if(_0x1077bd[_0x8b45('0x37')]){_0x41d6b5=_['first'](_0x1077bd[_0x8b45('0x37')][_0x8b45('0x38')](','));}return{'ContactId':_0x2de02d['id'],'ChatWebsiteId':_0x58d94f,'from':(_0x2de02d[_0x8b45('0x39')]||'')+'\x20'+(_0x2de02d[_0x8b45('0x3a')]||''),'customerIp':_0x41d6b5,'customerPort':_0x1077bd[_0x8b45('0x3b')]?_0x1077bd[_0x8b45('0x3b')]:null,'referer':_0x14788c[_0x8b45('0x3c')],'browserName':_0x56d959[_0x8b45('0x3d')][_0x8b45('0x30')]&&_0x56d959[_0x8b45('0x3d')][_0x8b45('0x3e')]?util['format'](_0x8b45('0x3f'),_0x56d959['browser'][_0x8b45('0x30')],_0x56d959['browser'][_0x8b45('0x3e')]):_0x8b45('0x40'),'browserVersion':_0x56d959[_0x8b45('0x3d')][_0x8b45('0x3e')]||_0x8b45('0x40'),'osName':util[_0x8b45('0x41')]('%s\x20%s',_0x56d959['os'][_0x8b45('0x30')],_0x56d959['os']['version']),'osVersion':_0x56d959['os']['version'],'deviceModel':_0x56d959[_0x8b45('0x42')][_0x8b45('0x43')]&&_0x56d959[_0x8b45('0x42')]['vendor']?util[_0x8b45('0x41')]('%s\x20%s\x20%s',_0x56d959[_0x8b45('0x42')][_0x8b45('0x43')],_0x56d959[_0x8b45('0x42')][_0x8b45('0x44')],_0x56d959[_0x8b45('0x42')][_0x8b45('0x45')]):null,'deviceVendor':_0x56d959['device'][_0x8b45('0x44')],'deviceType':_0x56d959[_0x8b45('0x42')][_0x8b45('0x45')],'formData':JSON[_0x8b45('0x1e')](_0x14788c)};}exports[_0x8b45('0x46')]=function(_0x11ba01,_0x371553){var _0x3de3c2={'include':[{'model':db[_0x8b45('0x47')],'as':_0x8b45('0x48')}]},_0x37b94a={},_0x462b51={'count':0x0,'rows':[]};var _0x1a87e4=_[_0x8b45('0x49')](db[_0x8b45('0x4a')][_0x8b45('0x4b')],function(_0x5e9499){return{'name':_0x5e9499['fieldName'],'type':_0x5e9499['type'][_0x8b45('0x4c')]};});_0x37b94a[_0x8b45('0x43')]=_[_0x8b45('0x49')](_0x1a87e4,_0x8b45('0x30'));_0x37b94a[_0x8b45('0x4d')]=_[_0x8b45('0x4e')](_0x11ba01[_0x8b45('0x4d')]);_0x37b94a[_0x8b45('0x4f')]=_['intersection'](_0x37b94a[_0x8b45('0x43')],_0x37b94a['query']);_0x3de3c2[_0x8b45('0x50')]=_[_0x8b45('0x51')](_0x37b94a[_0x8b45('0x43')],qs[_0x8b45('0x52')](_0x11ba01['query'][_0x8b45('0x52')]));_0x3de3c2[_0x8b45('0x50')]=_0x3de3c2['attributes'][_0x8b45('0x53')]?_0x3de3c2[_0x8b45('0x50')]:_0x37b94a['model'];if(!_0x11ba01[_0x8b45('0x4d')][_0x8b45('0x54')](_0x8b45('0x55'))){_0x3de3c2[_0x8b45('0x29')]=qs[_0x8b45('0x29')](_0x11ba01[_0x8b45('0x4d')]['limit']);_0x3de3c2['offset']=qs[_0x8b45('0x27')](_0x11ba01[_0x8b45('0x4d')][_0x8b45('0x27')]);}_0x3de3c2['order']=qs[_0x8b45('0x56')](_0x11ba01[_0x8b45('0x4d')][_0x8b45('0x56')]);_0x3de3c2[_0x8b45('0x57')]=qs[_0x8b45('0x4f')](_['pick'](_0x11ba01[_0x8b45('0x4d')],_0x37b94a[_0x8b45('0x4f')]),_0x1a87e4);if(_0x11ba01['query'][_0x8b45('0x58')]){_0x3de3c2['where']=_[_0x8b45('0x59')](_0x3de3c2[_0x8b45('0x57')],{'$or':_[_0x8b45('0x49')](_0x1a87e4,function(_0x39a609){if(_0x39a609['type']!==_0x8b45('0x5a')){var _0x423231={};_0x423231[_0x39a609[_0x8b45('0x30')]]={'$like':'%'+_0x11ba01[_0x8b45('0x4d')][_0x8b45('0x58')]+'%'};return _0x423231;}})});}_0x3de3c2=_[_0x8b45('0x59')]({},_0x3de3c2,_0x11ba01[_0x8b45('0x5b')]);var _0x2a35c1={'where':_0x3de3c2[_0x8b45('0x57')]};return db[_0x8b45('0x4a')][_0x8b45('0x2a')](_0x2a35c1)[_0x8b45('0x18')](function(_0x1405f3){_0x462b51[_0x8b45('0x2a')]=_0x1405f3;if(_0x11ba01[_0x8b45('0x4d')]['includeAll']){_0x3de3c2[_0x8b45('0x5c')]=[{'all':!![]}];}return db[_0x8b45('0x4a')][_0x8b45('0x5d')](_0x3de3c2);})['then'](function(_0x29fde9){_0x462b51[_0x8b45('0x5e')]=_0x29fde9;return _0x462b51;})[_0x8b45('0x18')](respondWithFilteredResult(_0x371553,_0x3de3c2))[_0x8b45('0x5f')](handleError(_0x371553,null));};exports['show']=function(_0x456c0e,_0x1a8822){var _0x1d99bb={'raw':![],'where':{'id':_0x456c0e['params']['id']},'include':[{'model':db[_0x8b45('0x47')],'as':_0x8b45('0x48')}]},_0xbb5e67={};_0xbb5e67[_0x8b45('0x43')]=_[_0x8b45('0x4e')](db[_0x8b45('0x4a')]['rawAttributes']);_0xbb5e67[_0x8b45('0x4d')]=_['keys'](_0x456c0e[_0x8b45('0x4d')]);_0xbb5e67[_0x8b45('0x4f')]=_[_0x8b45('0x51')](_0xbb5e67[_0x8b45('0x43')],_0xbb5e67[_0x8b45('0x4d')]);_0x1d99bb[_0x8b45('0x50')]=_['intersection'](_0xbb5e67['model'],qs[_0x8b45('0x52')](_0x456c0e[_0x8b45('0x4d')]['fields']));_0x1d99bb[_0x8b45('0x50')]=_0x1d99bb[_0x8b45('0x50')][_0x8b45('0x53')]?_0x1d99bb['attributes']:_0xbb5e67['model'];if(_0x456c0e[_0x8b45('0x4d')][_0x8b45('0x60')]){_0x1d99bb['include']=[{'all':!![]}];}_0x1d99bb=_[_0x8b45('0x59')]({},_0x1d99bb,_0x456c0e['options']);return db[_0x8b45('0x4a')]['find'](_0x1d99bb)['then'](handleEntityNotFound(_0x1a8822,null))[_0x8b45('0x18')](respondWithResult(_0x1a8822,null))[_0x8b45('0x5f')](handleError(_0x1a8822,null));};exports['create']=function(_0x324592,_0x73ec44){var _0x165b1c=null;_0x324592[_0x8b45('0x61')][_0x8b45('0x62')]['split'](',')[_0x8b45('0x63')](_0x3b3d21=>{if(_0x3b3d21[_0x8b45('0x64')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x3b3d21['trim']())){_0x165b1c=new APIBadRequestError('\x22'+_0x3b3d21[_0x8b45('0x64')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x165b1c){return handleError(_0x73ec44,null)(_0x165b1c);}return db[_0x8b45('0x4a')]['create'](_0x324592['body'],{})['then'](function(_0x2e3d2f){var _0x4df581=_0x324592[_0x8b45('0x65')][_0x8b45('0x2e')]({'plain':!![]});if(!_0x4df581)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4df581[_0x8b45('0x66')]===_0x8b45('0x65')){var _0x5f3477=_0x2e3d2f[_0x8b45('0x2e')]({'plain':!![]});var _0x46b686=_0x8b45('0x2f');return db[_0x8b45('0x67')][_0x8b45('0x68')]({'where':{'name':_0x46b686,'userProfileId':_0x4df581[_0x8b45('0x69')]},'raw':!![]})[_0x8b45('0x18')](function(_0x35048c){if(_0x35048c&&_0x35048c[_0x8b45('0x6a')]===0x0){return db[_0x8b45('0x6b')][_0x8b45('0x6c')]({'name':_0x5f3477[_0x8b45('0x30')],'resourceId':_0x5f3477['id'],'type':_0x35048c['name'],'sectionId':_0x35048c['id']},{})[_0x8b45('0x18')](function(){return _0x2e3d2f;});}else{return _0x2e3d2f;}})[_0x8b45('0x5f')](function(_0x283eb6){logger[_0x8b45('0x1f')](_0x8b45('0x6d'),_0x283eb6);throw _0x283eb6;});}return _0x2e3d2f;})[_0x8b45('0x18')](respondWithResult(_0x73ec44,0xc9))[_0x8b45('0x5f')](handleError(_0x73ec44,null));};exports[_0x8b45('0x2c')]=function(_0x243632,_0x1542db){var _0x183c34=null;_0x243632[_0x8b45('0x61')][_0x8b45('0x62')][_0x8b45('0x38')](',')[_0x8b45('0x63')](_0x53143d=>{if(_0x53143d[_0x8b45('0x64')]()!==''&&!wildcardUtils[_0x8b45('0x6e')](_0x53143d[_0x8b45('0x64')]())){_0x183c34=new APIBadRequestError('\x22'+_0x53143d[_0x8b45('0x64')]()+_0x8b45('0x6f'));}});if(_0x183c34){return handleError(_0x1542db,null)(_0x183c34);}if(_0x243632[_0x8b45('0x61')]['id']){delete _0x243632[_0x8b45('0x61')]['id'];}return db[_0x8b45('0x4a')]['find']({'where':{'id':_0x243632[_0x8b45('0x70')]['id']},'include':[{'model':db[_0x8b45('0x47')],'as':_0x8b45('0x48')}]})[_0x8b45('0x18')](handleEntityNotFound(_0x1542db,null))[_0x8b45('0x18')](saveUpdates(_0x243632[_0x8b45('0x61')],null))[_0x8b45('0x18')](respondWithResult(_0x1542db,null))[_0x8b45('0x5f')](handleError(_0x1542db,null));};exports[_0x8b45('0x2d')]=function(_0xd19d7c,_0x2d0045){return db['ChatWebsite']['find']({'where':{'id':_0xd19d7c[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x2d0045,null))[_0x8b45('0x18')](removeEntity(_0x2d0045,null))[_0x8b45('0x5f')](handleError(_0x2d0045,null));};exports[_0x8b45('0x71')]=function(_0x19b851,_0x6cdd2b){return db[_0x8b45('0x4a')][_0x8b45('0x71')]()['then'](respondWithResult(_0x6cdd2b,null))['catch'](handleError(_0x6cdd2b,null));};exports[_0x8b45('0x72')]=function(_0x28b0b9,_0x19497b){if(_0x28b0b9[_0x8b45('0x61')]['id']){delete _0x28b0b9['body']['id'];}return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0x28b0b9[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x19497b,null))[_0x8b45('0x18')](function(_0x17588b){if(_0x17588b){_0x28b0b9['body']['ChatWebsiteId']=_0x17588b['id'];return db[_0x8b45('0x73')]['create'](_0x28b0b9['body']);}})['then'](respondWithResult(_0x19497b,null))[_0x8b45('0x5f')](handleError(_0x19497b,null));};exports[_0x8b45('0x74')]=function(_0xcc1330,_0x1e7a9c){var _0x430551={'raw':![],'where':{}};var _0x37ef4c={};var _0x274902={'count':0x0,'rows':[]};return db[_0x8b45('0x4a')][_0x8b45('0x75')]({'where':{'id':_0xcc1330[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x1e7a9c,null))[_0x8b45('0x18')](function(_0x324d93){if(_0x324d93){_0x37ef4c[_0x8b45('0x43')]=_[_0x8b45('0x4e')](db['Disposition'][_0x8b45('0x4b')]);_0x37ef4c[_0x8b45('0x4d')]=_[_0x8b45('0x4e')](_0xcc1330[_0x8b45('0x4d')]);_0x37ef4c[_0x8b45('0x4f')]=_[_0x8b45('0x51')](_0x37ef4c[_0x8b45('0x43')],_0x37ef4c[_0x8b45('0x4d')]);_0x430551[_0x8b45('0x50')]=_[_0x8b45('0x51')](_0x37ef4c['model'],qs[_0x8b45('0x52')](_0xcc1330[_0x8b45('0x4d')][_0x8b45('0x52')]));_0x430551[_0x8b45('0x50')]=_0x430551['attributes'][_0x8b45('0x53')]?_0x430551['attributes']:_0x37ef4c[_0x8b45('0x43')];if(!_0xcc1330['query'][_0x8b45('0x54')](_0x8b45('0x55'))){_0x430551[_0x8b45('0x29')]=qs[_0x8b45('0x29')](_0xcc1330[_0x8b45('0x4d')][_0x8b45('0x29')]);_0x430551['offset']=qs[_0x8b45('0x27')](_0xcc1330[_0x8b45('0x4d')][_0x8b45('0x27')]);}_0x430551[_0x8b45('0x76')]=qs['sort'](_0xcc1330[_0x8b45('0x4d')][_0x8b45('0x56')]);_0x430551['where']=qs['filters'](_[_0x8b45('0x77')](_0xcc1330[_0x8b45('0x4d')],_0x37ef4c[_0x8b45('0x4f')]));_0x430551['where'][_0x8b45('0x78')]=_0x324d93['id'];if(_0xcc1330['query'][_0x8b45('0x58')]){_0x430551[_0x8b45('0x57')]=_['merge'](_0x430551['where'],{'$or':_[_0x8b45('0x49')](_0x430551[_0x8b45('0x50')],function(_0x445bca){var _0x36e785={};_0x36e785[_0x445bca]={'$like':'%'+_0xcc1330['query'][_0x8b45('0x58')]+'%'};return _0x36e785;})});}_0x430551=_[_0x8b45('0x59')]({},_0x430551,_0xcc1330[_0x8b45('0x5b')]);return db[_0x8b45('0x73')][_0x8b45('0x2a')]({'where':_0x430551[_0x8b45('0x57')]})['then'](function(_0x175269){_0x274902[_0x8b45('0x2a')]=_0x175269;if(_0xcc1330['query'][_0x8b45('0x60')]){_0x430551[_0x8b45('0x5c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x430551);})['then'](function(_0x186aa2){_0x274902[_0x8b45('0x5e')]=_0x186aa2;return _0x274902;});}})[_0x8b45('0x18')](respondWithFilteredResult(_0x1e7a9c,_0x430551))[_0x8b45('0x5f')](handleError(_0x1e7a9c,null));};exports[_0x8b45('0x79')]=function(_0x378e53,_0xd4b4eb){return db['ChatWebsite'][_0x8b45('0x68')]({'where':{'id':_0x378e53[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0xd4b4eb,null))[_0x8b45('0x18')](function(_0x2fde22){if(_0x2fde22){return _0x2fde22[_0x8b45('0x79')](_0x378e53['query'][_0x8b45('0x7a')]);}})[_0x8b45('0x18')](respondWithStatusCode(_0xd4b4eb,null))[_0x8b45('0x5f')](handleError(_0xd4b4eb,null));};exports[_0x8b45('0x7b')]=function(_0x224b7a,_0x4c3bc9){if(_0x224b7a['body']['id']){delete _0x224b7a[_0x8b45('0x61')]['id'];}return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0x224b7a[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x4c3bc9,null))['then'](function(_0x1f7f33){if(_0x1f7f33){_0x224b7a['body'][_0x8b45('0x78')]=_0x1f7f33['id'];return db['CannedAnswer'][_0x8b45('0x6c')](_0x224b7a[_0x8b45('0x61')]);}})[_0x8b45('0x18')](respondWithResult(_0x4c3bc9,null))[_0x8b45('0x5f')](handleError(_0x4c3bc9,null));};exports[_0x8b45('0x7c')]=function(_0x2b8492,_0x19cea1){var _0x46f88={'raw':![],'where':{}};var _0x39d000={};var _0xfff1e={'count':0x0,'rows':[]};return db[_0x8b45('0x4a')][_0x8b45('0x75')]({'where':{'id':_0x2b8492[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x19cea1,null))['then'](function(_0x3db51c){if(_0x3db51c){_0x39d000[_0x8b45('0x43')]=_[_0x8b45('0x4e')](db['CannedAnswer'][_0x8b45('0x4b')]);_0x39d000['query']=_[_0x8b45('0x4e')](_0x2b8492[_0x8b45('0x4d')]);_0x39d000['filters']=_[_0x8b45('0x51')](_0x39d000['model'],_0x39d000[_0x8b45('0x4d')]);_0x46f88[_0x8b45('0x50')]=_[_0x8b45('0x51')](_0x39d000[_0x8b45('0x43')],qs[_0x8b45('0x52')](_0x2b8492[_0x8b45('0x4d')]['fields']));_0x46f88['attributes']=_0x46f88[_0x8b45('0x50')][_0x8b45('0x53')]?_0x46f88['attributes']:_0x39d000['model'];if(!_0x2b8492['query'][_0x8b45('0x54')]('nolimit')){_0x46f88[_0x8b45('0x29')]=qs[_0x8b45('0x29')](_0x2b8492[_0x8b45('0x4d')][_0x8b45('0x29')]);_0x46f88['offset']=qs[_0x8b45('0x27')](_0x2b8492[_0x8b45('0x4d')][_0x8b45('0x27')]);}_0x46f88[_0x8b45('0x76')]=qs[_0x8b45('0x56')](_0x2b8492[_0x8b45('0x4d')][_0x8b45('0x56')]);_0x46f88[_0x8b45('0x57')]=qs['filters'](_[_0x8b45('0x77')](_0x2b8492['query'],_0x39d000[_0x8b45('0x4f')]));_0x46f88['where']['ChatWebsiteId']=_0x3db51c['id'];if(_0x2b8492['query'][_0x8b45('0x58')]){_0x46f88[_0x8b45('0x57')]=_['merge'](_0x46f88[_0x8b45('0x57')],{'$or':_[_0x8b45('0x49')](_0x46f88[_0x8b45('0x50')],function(_0x18a754){var _0x123610={};_0x123610[_0x18a754]={'$like':'%'+_0x2b8492[_0x8b45('0x4d')][_0x8b45('0x58')]+'%'};return _0x123610;})});}_0x46f88=_[_0x8b45('0x59')]({},_0x46f88,_0x2b8492[_0x8b45('0x5b')]);return db['CannedAnswer'][_0x8b45('0x2a')]({'where':_0x46f88[_0x8b45('0x57')]})[_0x8b45('0x18')](function(_0x43545b){_0xfff1e['count']=_0x43545b;if(_0x2b8492[_0x8b45('0x4d')][_0x8b45('0x60')]){_0x46f88[_0x8b45('0x5c')]=[{'all':!![]}];}return db[_0x8b45('0x7d')][_0x8b45('0x5d')](_0x46f88);})['then'](function(_0xe58ecf){_0xfff1e['rows']=_0xe58ecf;return _0xfff1e;});}})[_0x8b45('0x18')](respondWithFilteredResult(_0x19cea1,_0x46f88))[_0x8b45('0x5f')](handleError(_0x19cea1,null));};exports['removeAnswers']=function(_0x574d49,_0x4c13c3){return db['ChatWebsite'][_0x8b45('0x68')]({'where':{'id':_0x574d49['params']['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x4c13c3,null))[_0x8b45('0x18')](function(_0x2af25b){if(_0x2af25b){return _0x2af25b['removeAnswers'](_0x574d49[_0x8b45('0x4d')]['ids']);}})[_0x8b45('0x18')](respondWithStatusCode(_0x4c13c3,null))[_0x8b45('0x5f')](handleError(_0x4c13c3,null));};exports[_0x8b45('0x7e')]=function(_0x1f62e0,_0x1c5e4c){_0x1f62e0[_0x8b45('0x61')][_0x8b45('0x7f')]=_0x1f62e0[_0x8b45('0x80')][_0x8b45('0x81')];return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0x1f62e0[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x1c5e4c,null))[_0x8b45('0x18')](saveUpdates(_0x1f62e0[_0x8b45('0x61')],null))['then'](respondWithResult(_0x1c5e4c,null))[_0x8b45('0x5f')](handleError(_0x1c5e4c,null));};exports[_0x8b45('0x82')]=function(_0x49cf74,_0x49cc78){_0x49cf74[_0x8b45('0x61')][_0x8b45('0x83')]=_0x49cf74[_0x8b45('0x80')][_0x8b45('0x81')];return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0x49cf74[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x49cc78,null))[_0x8b45('0x18')](saveUpdates(_0x49cf74['body'],null))[_0x8b45('0x18')](respondWithResult(_0x49cc78,null))[_0x8b45('0x5f')](handleError(_0x49cc78,null));};exports['addCustomerAvatar']=function(_0x76b6b,_0x2434a8){_0x76b6b[_0x8b45('0x61')][_0x8b45('0x84')]=_0x76b6b[_0x8b45('0x80')][_0x8b45('0x81')];return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0x76b6b[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x2434a8,null))[_0x8b45('0x18')](saveUpdates(_0x76b6b[_0x8b45('0x61')],null))[_0x8b45('0x18')](respondWithResult(_0x2434a8,null))['catch'](handleError(_0x2434a8,null));};exports[_0x8b45('0x85')]=function(_0x5b7f57,_0x2714e6){_0x5b7f57[_0x8b45('0x61')][_0x8b45('0x86')]=_0x5b7f57['file'][_0x8b45('0x81')];return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0x5b7f57[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x2714e6,null))[_0x8b45('0x18')](saveUpdates(_0x5b7f57['body'],null))[_0x8b45('0x18')](respondWithResult(_0x2714e6,null))[_0x8b45('0x5f')](handleError(_0x2714e6,null));};exports[_0x8b45('0x87')]=function(_0x1ba08f,_0x588510){var _0x3db5dc=path[_0x8b45('0x88')](config[_0x8b45('0x89')],_0x8b45('0x8a'));var _0x505d13={'where':{'id':_0x1ba08f[_0x8b45('0x70')]['id']},'attributes':['id',_0x8b45('0x7f')],'raw':!![]};var _0x2b8e5c=![];return require('../../config/license/util')[_0x8b45('0x8b')]()[_0x8b45('0x18')](function(_0xeee220){if(_0xeee220){_0x2b8e5c=_0xeee220[_0x8b45('0x8c')];}})[_0x8b45('0x18')](function(){return db[_0x8b45('0x4a')]['find'](_0x505d13);})[_0x8b45('0x18')](handleEntityNotFound(_0x588510,null))[_0x8b45('0x18')](function(_0x59ea0d){if(_0x59ea0d){if(!_[_0x8b45('0x8d')](_0x59ea0d[_0x8b45('0x7f')])){if(fs['existsSync'](path[_0x8b45('0x88')](config[_0x8b45('0x89')],_0x8b45('0x8e'),_0x59ea0d[_0x8b45('0x7f')]))&&_0x2b8e5c){_0x3db5dc=path[_0x8b45('0x88')](config[_0x8b45('0x89')],_0x8b45('0x8e'),_0x59ea0d[_0x8b45('0x7f')]);}}return _0x588510['download'](_0x3db5dc);}})[_0x8b45('0x5f')](handleError(_0x588510,null));};exports['getAvatar']=function(_0x1b11e0,_0x255b6a){var _0x192932=path['join'](config[_0x8b45('0x89')],_0x8b45('0x8f'));var _0x48ab1b={'where':{'id':_0x1b11e0[_0x8b45('0x70')]['id']},'attributes':['id',_0x8b45('0x83')],'raw':!![]};return db[_0x8b45('0x4a')][_0x8b45('0x68')](_0x48ab1b)[_0x8b45('0x18')](handleEntityNotFound(_0x255b6a,null))[_0x8b45('0x18')](function(_0x1d1584){if(_0x1d1584){if(!_[_0x8b45('0x8d')](_0x1d1584[_0x8b45('0x83')])){if(fs['existsSync'](path[_0x8b45('0x88')](config[_0x8b45('0x89')],_0x8b45('0x90'),_0x1d1584['agentAvatar']))){_0x192932=path[_0x8b45('0x88')](config['root'],_0x8b45('0x90'),_0x1d1584['agentAvatar']);}}return _0x255b6a['download'](_0x192932);}})[_0x8b45('0x5f')](handleError(_0x255b6a,null));};exports[_0x8b45('0x91')]=function(_0x404a06,_0x5d8e63){var _0x2d31a8=path[_0x8b45('0x88')](config[_0x8b45('0x89')],_0x8b45('0x92'));var _0x256d7e={'where':{'id':_0x404a06[_0x8b45('0x70')]['id']},'attributes':['id',_0x8b45('0x84'),_0x8b45('0x93')],'raw':!![]};return db['ChatWebsite'][_0x8b45('0x68')](_0x256d7e)[_0x8b45('0x18')](handleEntityNotFound(_0x5d8e63,null))[_0x8b45('0x18')](function(_0x4148bd){if(_0x4148bd){if(!_[_0x8b45('0x8d')](_0x4148bd[_0x8b45('0x84')])){if(fs['existsSync'](path['join'](config[_0x8b45('0x89')],'server/files/images/avatars/',_0x4148bd['customerAvatar']))&&_0x4148bd[_0x8b45('0x93')]){_0x2d31a8=path[_0x8b45('0x88')](config[_0x8b45('0x89')],_0x8b45('0x90'),_0x4148bd[_0x8b45('0x84')]);}}return _0x5d8e63['download'](_0x2d31a8);}})[_0x8b45('0x5f')](handleError(_0x5d8e63,null));};exports[_0x8b45('0x94')]=function(_0x4b88be,_0x48ab84){var _0xc5bb1f=path[_0x8b45('0x88')](config[_0x8b45('0x89')],_0x8b45('0x95'));var _0x38c778={'where':{'id':_0x4b88be[_0x8b45('0x70')]['id']},'attributes':['id',_0x8b45('0x86')],'raw':!![]};return db[_0x8b45('0x4a')][_0x8b45('0x68')](_0x38c778)[_0x8b45('0x18')](handleEntityNotFound(_0x48ab84,null))[_0x8b45('0x18')](function(_0xe804a){if(_0xe804a){if(!_['isNil'](_0xe804a[_0x8b45('0x86')])){if(fs[_0x8b45('0x96')](path[_0x8b45('0x88')](config['root'],_0x8b45('0x90'),_0xe804a['systemAvatar']))){_0xc5bb1f=path[_0x8b45('0x88')](config[_0x8b45('0x89')],_0x8b45('0x90'),_0xe804a[_0x8b45('0x86')]);}}return _0x48ab84[_0x8b45('0x97')](_0xc5bb1f);}})[_0x8b45('0x5f')](handleError(_0x48ab84,null));};function checkWebsiteInterval(_0x36f411){var _0x2f94c9=_0x36f411[_0x8b45('0x98')];if(!_0x2f94c9){return Promise[_0x8b45('0x99')](_0x36f411);}var _0x543f81=_0x36f411[_0x8b45('0x9a')]||undefined;return _0x2f94c9[_0x8b45('0x9b')](_0x543f81)['then'](function(_0x252ef3){if(!_0x252ef3){throw new APIOutOfIntervalError();}return _0x36f411;});}exports[_0x8b45('0x9c')]=function(_0x3cafc4,_0x461169){var _0x221594={'body':_0x3cafc4[_0x8b45('0x61')],'channel':_0x8b45('0x9d')};var _0x593609=[];var _0x19222d=[];var _0x5bd946={};var _0x3344f9=![];if(_0x3cafc4[_0x8b45('0x61')]['id']){delete _0x3cafc4['body']['id'];}if(_[_0x8b45('0x8d')](_0x3cafc4[_0x8b45('0x61')][_0x8b45('0x9e')])){throw new APIBadRequestError(_0x8b45('0x9f'));}if(_[_0x8b45('0x8d')](_0x3cafc4['body'][_0x8b45('0xa0')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x8b45('0xa1')](_0x3cafc4[_0x8b45('0x61')]['body'])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x4a998f=_0x3cafc4['body'][_0x8b45('0x35')]&&_0x3cafc4[_0x8b45('0x61')][_0x8b45('0x3c')];return db[_0x8b45('0xa2')][_0x8b45('0x71')]()[_0x8b45('0x18')](function(_0xf20f24){if(!_0xf20f24){throw new Error(_0x8b45('0xa3'));}_0x593609=Object[_0x8b45('0x4e')](_0xf20f24)[_0x8b45('0x58')](function(_0x3b6dae){return![_0x8b45('0xa4'),_0x8b45('0xa5')][_0x8b45('0xa6')](_0x3b6dae);});_0x19222d=Object[_0x8b45('0x4e')](_0xf20f24)['filter'](function(_0x583fa0){return![_0x8b45('0xa4'),_0x8b45('0xa5'),'CompanyId',_0x8b45('0xa7')][_0x8b45('0xa6')](_0x583fa0);});if(!_[_0x8b45('0xa6')](_0x19222d,_0x3cafc4[_0x8b45('0x61')][_0x8b45('0xa0')])){throw new APIBadRequestError(_0x8b45('0xa8')+_0x19222d['join'](',\x20'));}_0x5bd946[_0x3cafc4[_0x8b45('0x61')]['mapKey']]=_0x3cafc4['body'][_0x8b45('0x9e')];})['then'](function(){return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0x3cafc4[_0x8b45('0x70')]['id']},'include':[{'model':db[_0x8b45('0xa9')],'as':_0x8b45('0xaa'),'include':[{'model':db[_0x8b45('0xa2')],'as':_0x8b45('0xab'),'where':_0x5bd946,'limit':0x1,'order':[[_0x8b45('0xa5'),_0x8b45('0xac')]]}]},{'model':db[_0x8b45('0xad')],'as':_0x8b45('0xae')},{'model':db[_0x8b45('0x98')],'as':_0x8b45('0x98'),'include':[{'model':db['Interval'],'as':_0x8b45('0xaf'),'attributes':['id',_0x8b45('0xb0')],'raw':!![]}]}]});})[_0x8b45('0x18')](function(_0x271c7b){if(!_0x271c7b){throw new APINotFoundError(util[_0x8b45('0x41')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x3cafc4[_0x8b45('0x70')]['id']));}if(_0x4a998f){return checkWebsiteInterval(_0x271c7b);}return _0x271c7b;})[_0x8b45('0x18')](function(_0x693a6){_0x221594[_0x8b45('0xb1')]=_0x693a6;_0x221594[_0x8b45('0xb2')]=_[_0x8b45('0xb3')](_0x693a6[_0x8b45('0xae')],[_0x8b45('0xb4')],[_0x8b45('0xb5')]);if(_0x221594[_0x8b45('0xb1')][_0x8b45('0xae')]){delete _0x221594[_0x8b45('0xb1')][_0x8b45('0xae')];}_0x221594[_0x8b45('0xb6')]=_0x693a6[_0x8b45('0xaa')]||{'id':_0x693a6[_0x8b45('0xa7')]};if(_0x221594[_0x8b45('0xb6')]&&_0x221594[_0x8b45('0xb6')][_0x8b45('0xab')][_0x8b45('0x53')]){return _0x221594[_0x8b45('0xb6')]['Contacts'][0x0];}var _0xbf7715=_[_0x8b45('0xb7')](_0x3cafc4['body'],{'firstName':_0x3cafc4[_0x8b45('0x61')][_0x8b45('0x9e')],'ListId':_0x693a6[_0x8b45('0xa7')]});_0xbf7715[_0x3cafc4[_0x8b45('0x61')][_0x8b45('0xa0')]]=_0x3cafc4['body'][_0x8b45('0x9e')];return db[_0x8b45('0xa2')][_0x8b45('0x6c')](_0xbf7715,{'fields':_0x593609,'raw':!![]});})[_0x8b45('0x18')](function(_0x32f600){_0x221594[_0x8b45('0xb8')]=_0x32f600;var _0x4978b8=createInteractionObject(_0x3cafc4['params']['id'],_0x3cafc4[_0x8b45('0x61')],_0x3cafc4[_0x8b45('0xb9')],_0x32f600);var _0x358316={'ChatWebsiteId':_0x3cafc4['params']['id']};if(_0x3cafc4[_0x8b45('0x61')][_0x8b45('0xba')]){_0x358316['threadId']=_0x3cafc4[_0x8b45('0x61')]['threadId'];_0x358316[_0x8b45('0xbb')]=![];return db[_0x8b45('0xbc')][_0x8b45('0x68')]({'where':_0x358316})[_0x8b45('0x18')](function(_0x5bf7cf){var _0x7ea3d6=_0x3cafc4[_0x8b45('0x61')][_0x8b45('0x35')]&&_0x3cafc4[_0x8b45('0x61')][_0x8b45('0x3c')];if(_0x5bf7cf){_0x3344f9=!![];return _0x5bf7cf;}else if(!_0x7ea3d6&&_0x5bf7cf&&_0x5bf7cf[_0x8b45('0xbb')]){throw new APIConflictError(_0x8b45('0xbd'));}_0x4978b8[_0x8b45('0xba')]=_0x3cafc4[_0x8b45('0x61')]['threadId'];_0x4978b8[_0x8b45('0xbe')]=_0x3cafc4['body'][_0x8b45('0xbe')];return db[_0x8b45('0xbc')][_0x8b45('0x6c')](_0x4978b8);});}_0x358316[_0x8b45('0xbf')]=_0x32f600['id'];if(_0x3cafc4[_0x8b45('0x61')][_0x8b45('0xc0')]&&_0x3cafc4[_0x8b45('0x61')][_0x8b45('0xc0')]['id']){_0x358316['id']=_0x3cafc4[_0x8b45('0x61')][_0x8b45('0xc0')]['id'];return db[_0x8b45('0xbc')]['find']({'where':_0x358316})[_0x8b45('0x18')](function(_0x425ae2){var _0x1595e7=_0x3cafc4[_0x8b45('0x61')][_0x8b45('0x35')]&&_0x3cafc4[_0x8b45('0x61')]['referer'];if(!_0x1595e7&&_0x425ae2&&_0x425ae2[_0x8b45('0xbb')]){throw new APIConflictError(_0x8b45('0xbd'));}else if(_0x425ae2){_0x3344f9=!![];return _0x425ae2;}else{return db[_0x8b45('0xbc')][_0x8b45('0x6c')](_0x4978b8);}});}return db[_0x8b45('0xbc')][_0x8b45('0x6c')](_0x4978b8);})[_0x8b45('0x18')](function(_0x31802c){if(!_0x3344f9){return _0x31802c;}var _0x3a0417={'from':(_0x221594[_0x8b45('0xb8')][_0x8b45('0x39')]||'')+'\x20'+(_0x221594['contact'][_0x8b45('0x3a')]||'')};if(_0x3cafc4[_0x8b45('0x61')][_0x8b45('0xba')]&&_0x3cafc4['body']['messageId']&&_0x3cafc4[_0x8b45('0x61')]['threadId']!=_0x3cafc4['body'][_0x8b45('0xc1')]){_0x3a0417[_0x8b45('0xba')]=_0x3cafc4[_0x8b45('0x61')][_0x8b45('0xc1')];}return _0x31802c[_0x8b45('0x2c')](_0x3a0417);})[_0x8b45('0x18')](function(_0x76c89f){_0x221594[_0x8b45('0xc0')]=_0x76c89f[_0x8b45('0x2e')]({'plain':!![]});_0x221594['interaction']['created']=!_0x3344f9;if(_0x221594[_0x8b45('0xc0')][_0x8b45('0xc2')]){if(_0x221594['account']['autoclose']){_0x221594[_0x8b45('0xb2')]['push']({'id':0x0,'priority':_0x221594[_0x8b45('0xb2')][_0x8b45('0x53')]+0x1,'app':_0x8b45('0xc3'),'appdata':_0x8b45('0xc4'),'interval':_0x8b45('0xc5')});}}return db[_0x8b45('0xc6')][_0x8b45('0x6c')]({'body':_0x3cafc4[_0x8b45('0x61')][_0x8b45('0x61')],'ChatWebsiteId':_0x3cafc4[_0x8b45('0x70')]['id'],'ChatInteractionId':_0x76c89f['id'],'direction':'in','ContactId':_0x221594[_0x8b45('0xb8')]['id'],'AttachmentId':_0x3cafc4[_0x8b45('0x61')][_0x8b45('0xc7')]});})[_0x8b45('0x18')](function(_0x4f1d30){_0x221594[_0x8b45('0x21')]=_0x4f1d30;if(!_0x221594[_0x8b45('0xc0')][_0x8b45('0xc8')]){return;}return db['User']['find']({'attributes':['id',_0x8b45('0x30')],'where':{'id':_0x221594[_0x8b45('0xc0')][_0x8b45('0xc8')]}});})['then'](function(_0x5a686a){if(_0x5a686a){_0x221594[_0x8b45('0xb2')][_0x8b45('0xc9')]({'id':0x0,'priority':0x0,'app':_0x8b45('0xca'),'appdata':_0x5a686a[_0x8b45('0x30')]+','+(_0x221594['account'][_0x8b45('0xcb')]||0xa),'interval':_0x8b45('0xc5')});_0x221594[_0x8b45('0xcc')]=!![];}if(!_0x221594[_0x8b45('0xc0')][_0x8b45('0xcd')]){return;}return db[_0x8b45('0xce')][_0x8b45('0x68')]({'attributes':['id',_0x8b45('0x30')],'where':{'id':_0x221594[_0x8b45('0xc0')][_0x8b45('0xcd')]}});})['then'](function(_0x4e8da8){if(_0x4e8da8){_0x221594[_0x8b45('0xb2')]['unshift']({'id':0x0,'priority':0x1,'app':_0x8b45('0xcf'),'appdata':_0x4e8da8['name']+','+(_0x221594[_0x8b45('0xb1')][_0x8b45('0xd0')]||0x12c),'interval':_0x8b45('0xc5')});}return respondWithRpcPromise('Start',_0x8b45('0xd1'),_0x221594);})[_0x8b45('0x18')](function(_0x6760ef){respondWithRpcPromise(_0x8b45('0xd2'),_0x8b45('0xd2'),{'event':_0x8b45('0x9c'),'message':_0x6760ef},client9002);return _0x6760ef;})[_0x8b45('0x18')](respondWithResult(_0x461169,null))[_0x8b45('0x5f')](APIHandleError(_0x461169));};exports['offline']=function(_0x5bd65a,_0x305ab){var _0x1ed04b,_0x491e39,_0xbfbad4;var _0x56f793=[];var _0x1fee78={};var _0x37ef44=_0x5bd65a['files']||[];var _0x1639ea=[];var _0x4ba0c3;return db['CmContact'][_0x8b45('0x71')]()[_0x8b45('0x18')](function(_0x1dce03){if(!_0x1dce03){throw new db[(_0x8b45('0xd3'))][(_0x8b45('0xd4'))]('no\x20available\x20attributes');}_0x56f793=_[_0x8b45('0xd5')](_[_0x8b45('0x4e')](_0x1dce03),['createdAt',_0x8b45('0xa5'),_0x8b45('0xd6'),'ListId']);if(_0x5bd65a['body']['id']){delete _0x5bd65a[_0x8b45('0x61')]['id'];}if(_[_0x8b45('0x8d')](_0x5bd65a[_0x8b45('0x61')][_0x8b45('0x9e')])){throw _0x305ab['status'](0x1f4)[_0x8b45('0x31')](new db[(_0x8b45('0xd3'))][(_0x8b45('0xd4'))](_0x8b45('0xd7')));}if(_[_0x8b45('0x8d')](_0x5bd65a[_0x8b45('0x61')][_0x8b45('0x61')])||_0x5bd65a[_0x8b45('0x61')][_0x8b45('0x61')]===''){throw _0x305ab[_0x8b45('0x24')](0x1f4)[_0x8b45('0x31')](new db['Sequelize'][(_0x8b45('0xd4'))](_0x8b45('0xd8')));}if(_[_0x8b45('0x8d')](_0x5bd65a[_0x8b45('0x61')][_0x8b45('0xd9')])){throw _0x305ab[_0x8b45('0x24')](0x1f4)['send'](new db[(_0x8b45('0xd3'))][(_0x8b45('0xd4'))](_0x8b45('0xda')+_0x56f793));}if(!_[_0x8b45('0xa6')](_0x56f793,_0x5bd65a[_0x8b45('0x61')][_0x8b45('0xd9')])){throw _0x305ab[_0x8b45('0x24')](0x1f4)[_0x8b45('0x31')](new db[(_0x8b45('0xd3'))][(_0x8b45('0xd4'))](_0x8b45('0xdb')+_0x56f793));}_0x1fee78[_0x5bd65a[_0x8b45('0x61')][_0x8b45('0xd9')]]=_0x5bd65a[_0x8b45('0x61')][_0x8b45('0x9e')];})[_0x8b45('0x18')](function(){return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0x5bd65a[_0x8b45('0x70')]['id']},'include':[{'model':db[_0x8b45('0xa9')],'as':_0x8b45('0xaa')},{'model':db[_0x8b45('0xdc')],'as':_0x8b45('0xdc')}]});})['then'](handleEntityNotFound(_0x305ab,null))[_0x8b45('0x18')](function(_0x2657be){if(_0x2657be&&_0x2657be['List']){_0x491e39=_0x2657be;var _0x3c3c87=_[_0x8b45('0xb7')](_0x5bd65a[_0x8b45('0x61')],{'firstName':_0x5bd65a[_0x8b45('0x61')][_0x8b45('0x9e')],'phone':_0x5bd65a[_0x8b45('0x61')]['from'],'ListId':_0x2657be[_0x8b45('0xa7')]});_0x3c3c87[_0x5bd65a['body'][_0x8b45('0xd9')]]=_0x5bd65a[_0x8b45('0x61')][_0x8b45('0x9e')];return db[_0x8b45('0xa2')]['findOrCreate']({'where':_0x1fee78,'defaults':_0x3c3c87});}})[_0x8b45('0xdd')](function(_0x46147b){if(_0x46147b){_0xbfbad4=_0x46147b;var _0x277de9=fs[_0x8b45('0xde')](path[_0x8b45('0x88')](config['root'],_0x8b45('0xdf')),_0x8b45('0xe0'));var _0x218d77=ejs['render'](_0x277de9,{'body':_[_0x8b45('0xe1')](_0x5bd65a[_0x8b45('0x61')][_0x8b45('0x61')]),'bodyTitle':_0x491e39['offlineMessageBody']});return db[_0x8b45('0xe2')][_0x8b45('0x6c')]({'body':_0x218d77,'plainBody':htmlToText[_0x8b45('0xe3')](_0x218d77),'ContactId':_0x46147b['id'],'ChatWebsiteId':_0x491e39['id']});}})['then'](function(_0x2c6db3){_0x4ba0c3=_0x2c6db3;if(_0x37ef44[_0x8b45('0x53')]){var _0x54e723=_0x37ef44[_0x8b45('0x49')](function(_0x1908a8){return{'name':_0x1908a8[_0x8b45('0xe4')],'basename':_0x1908a8[_0x8b45('0x81')],'type':_0x1908a8[_0x8b45('0xe5')],'ChatOfflineMessageId':_0x2c6db3['id']};});_0x1639ea=_0x54e723['map'](_0x4c4e8d=>{var _0x1f7f17={'filename':_0x4c4e8d['name'],'path':path[_0x8b45('0x88')](config['root'],_0x8b45('0xe6'),_0x8b45('0xe7'),'attachments',_0x8b45('0xe8'),_0x4c4e8d[_0x8b45('0xe9')])};return _0x1f7f17;});if(!_0x491e39['openNewInteraction']){return db[_0x8b45('0xea')][_0x8b45('0xeb')](function(_0x58117e){return db[_0x8b45('0xec')][_0x8b45('0xed')](_0x54e723,{'transaction':_0x58117e});});}}})[_0x8b45('0x18')](function(){if(_0x4ba0c3){_0x1ed04b=_0x4ba0c3;return db[_0x8b45('0xdc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x8b45('0xee')],'as':_0x8b45('0xef'),'raw':!![],'include':[{'model':db[_0x8b45('0xf0')],'as':_0x8b45('0xf0'),'raw':!![]}]}]});}})[_0x8b45('0x18')](function(_0x2de555){if(_0x2de555&&_0x2de555[_0x8b45('0xef')]&&_0x491e39['forwardOffline']&&_0x491e39['forwardOfflineAddress']){var _0x1a2d5d=_0x2de555[_0x8b45('0xf1')]();return respondWithRpcPromise('SendMail',_0x8b45('0xf2'),{'account':_0x1a2d5d,'message':{'from':util[_0x8b45('0x41')](_0x8b45('0xf3'),_0x2de555[_0x8b45('0x30')],_0x2de555['email']||_0x2de555[_0x8b45('0xef')][_0x8b45('0x65')]),'to':_0x491e39['forwardOfflineAddress'],'subject':_0x491e39['offlineMessageSubject'],'html':_0x1ed04b[_0x8b45('0x61')],'attachments':_0x1639ea}},client9003)[_0x8b45('0x18')](function(){return _0x1ed04b;})[_0x8b45('0x5f')](function(_0x302f68){logger[_0x8b45('0x1f')](_0x302f68);});}})['then'](function(){if(_0x491e39&&_0x491e39[_0x8b45('0xf4')]&&_0x491e39['MailAccountId']){var _0x3aba04=[];if(_0x37ef44['length']){_0x3aba04=_0x37ef44[_0x8b45('0x49')](function(_0x140bf0){return{'name':_0x140bf0['originalname'],'basename':_0x140bf0[_0x8b45('0x81')],'type':_0x140bf0[_0x8b45('0xe5')],'ChatOfflineMessageId':_0x4ba0c3['id']};});}var _0x40ec6b;if(!_['isNil'](_0x491e39['subjectOffline'])){var _0x40daf3=_[_0x8b45('0x49')](_0x5bd65a[_0x8b45('0x61')],function(_0x515774){return _0x515774;});var _0x1342c9=_[_0x8b45('0xf5')](_0x40daf3)[0x0];var _0x5b35f3=_['mapValues'](_0x1342c9,function(_0x1c1a90){return _0x1c1a90;});_0x40ec6b=_0x5b35f3[0x1][_0x491e39[_0x8b45('0xf6')]];}var _0x5c3245={'from':_0xbfbad4[_0x8b45('0xf7')],'firstName':_0xbfbad4['firstName'],'lastName':_0xbfbad4[_0x8b45('0x3a')],'mapKey':_0x8b45('0xf7'),'message':{'from':_0xbfbad4[_0x8b45('0xf7')],'to':_0x491e39[_0x8b45('0xdc')][_0x8b45('0xf7')],'cc':'','subject':_[_0x8b45('0x8d')](_0x40ec6b)?_0x491e39[_0x8b45('0xf8')]:_0x40ec6b,'messageId':'','sentAt':new Date(),'attach':_0x3aba04[_0x8b45('0x53')],'attachments':_0x3aba04,'originChannel':_0x8b45('0xf9'),'ChatWebsiteId':_0x491e39['id'],'ChatOfflineMessageId':_0x1ed04b['id'],'originTo':_0x491e39[_0x8b45('0xdc')][_0x8b45('0xf7')]},'body':_0x1ed04b[_0x8b45('0x61')]};var _0x27d264={'account':{'id':_0x491e39[_0x8b45('0xfa')]},'body':_0x5c3245,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x8b45('0xfb'),'notifyMail',_0x27d264,client9001)[_0x8b45('0x18')](function(){return _0x1ed04b;})[_0x8b45('0x5f')](function(_0x2ae0d){logger[_0x8b45('0x1f')](_0x2ae0d);});}return;})[_0x8b45('0x18')](function(){if(_0x1ed04b){return _0x1ed04b;}})['then'](respondWithResult(_0x305ab,null))['catch'](function(){for(var _0x5b3543 of _0x37ef44){var _0x41437d=path[_0x8b45('0x88')](config[_0x8b45('0x89')],_0x8b45('0xe6'),_0x8b45('0xe7'),'attachments','offline-chat',_0x5b3543[_0x8b45('0x81')]);fs_extra[_0x8b45('0xfc')](_0x41437d)[_0x8b45('0x5f')](function(_0x5d870e){logger[_0x8b45('0x1f')]('Could\x20not\x20remove\x20attachment\x20file',_0x41437d,_0x5d870e);});}});};exports[_0x8b45('0xfd')]=function(_0x2312bc,_0x3eebd9){return db['ChatInteraction'][_0x8b45('0x68')]({'where':{'id':_0x2312bc['params']['id']}})['then'](handleEntityNotFound(_0x3eebd9,null))[_0x8b45('0x18')](function(_0x5f4829){if(_0x5f4829){return _0x5f4829[_0x8b45('0xfd')](_0x2312bc[_0x8b45('0x61')][_0x8b45('0x7a')],_[_0x8b45('0xfe')](_0x2312bc[_0x8b45('0x61')],[_0x8b45('0x7a'),'id'])||{});}})['then'](respondWithResult(_0x3eebd9,null))[_0x8b45('0x5f')](handleError(_0x3eebd9,null));};exports[_0x8b45('0xff')]=function(_0x1f024a,_0x5a5ee1){var _0x182c39={'raw':![],'where':{}};var _0x3bd9b0={};var _0xebb778={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8b45('0x75')]({'where':{'id':_0x1f024a['params']['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x5a5ee1,null))['then'](function(_0x51a46f){if(_0x51a46f){_0x3bd9b0[_0x8b45('0x43')]=_[_0x8b45('0x4e')](db[_0x8b45('0xbc')][_0x8b45('0x4b')]);_0x3bd9b0[_0x8b45('0x4d')]=_['keys'](_0x1f024a[_0x8b45('0x4d')]);_0x3bd9b0['filters']=_[_0x8b45('0x51')](_0x3bd9b0[_0x8b45('0x43')],_0x3bd9b0[_0x8b45('0x4d')]);_0x182c39[_0x8b45('0x50')]=_['intersection'](_0x3bd9b0[_0x8b45('0x43')],qs[_0x8b45('0x52')](_0x1f024a['query'][_0x8b45('0x52')]));_0x182c39[_0x8b45('0x50')]=_0x182c39[_0x8b45('0x50')]['length']?_0x182c39['attributes']:_0x3bd9b0['model'];if(!_0x1f024a[_0x8b45('0x4d')][_0x8b45('0x54')](_0x8b45('0x55'))){_0x182c39['limit']=qs[_0x8b45('0x29')](_0x1f024a[_0x8b45('0x4d')][_0x8b45('0x29')]);_0x182c39[_0x8b45('0x27')]=qs[_0x8b45('0x27')](_0x1f024a['query'][_0x8b45('0x27')]);}_0x182c39[_0x8b45('0x76')]=qs['sort'](_0x1f024a[_0x8b45('0x4d')][_0x8b45('0x56')]);_0x182c39['where']=qs[_0x8b45('0x4f')](_[_0x8b45('0x77')](_0x1f024a[_0x8b45('0x4d')],_0x3bd9b0[_0x8b45('0x4f')]));_0x182c39['where'][_0x8b45('0x78')]=_0x51a46f['id'];if(_0x1f024a[_0x8b45('0x4d')][_0x8b45('0x58')]){_0x182c39[_0x8b45('0x57')]=_[_0x8b45('0x59')](_0x182c39[_0x8b45('0x57')],{'$or':_['map'](_0x182c39[_0x8b45('0x50')],function(_0x290f64){var _0x2d2d6a={};_0x2d2d6a[_0x290f64]={'$like':'%'+_0x1f024a[_0x8b45('0x4d')][_0x8b45('0x58')]+'%'};return _0x2d2d6a;})});}_0x182c39=_[_0x8b45('0x59')]({},_0x182c39,_0x1f024a['options']);return db[_0x8b45('0xbc')][_0x8b45('0x2a')]({'where':_0x182c39[_0x8b45('0x57')]})['then'](function(_0x3f58bf){_0xebb778['count']=_0x3f58bf;if(_0x1f024a['query'][_0x8b45('0x60')]){_0x182c39[_0x8b45('0x5c')]=[{'model':db[_0x8b45('0xa2')],'as':_0x8b45('0x100'),'required':![]},{'model':db[_0x8b45('0x101')],'as':_0x8b45('0x102'),'attributes':[_0x8b45('0x30'),_0x8b45('0x103'),_0x8b45('0x104')],'required':![]},{'model':db[_0x8b45('0x105')],'as':_0x8b45('0x106'),'attributes':['id',_0x8b45('0x30'),_0x8b45('0x107')],'where':_0x1f024a[_0x8b45('0x4d')][_0x8b45('0x108')]?{'id':_0x1f024a[_0x8b45('0x4d')]['tag']}:undefined,'required':_0x1f024a['query'][_0x8b45('0x108')]?!![]:![]}];}return db['ChatInteraction'][_0x8b45('0x5d')](_0x182c39);})[_0x8b45('0x18')](function(_0x16b14a){_0xebb778[_0x8b45('0x5e')]=_0x16b14a;return _0xebb778;});}})[_0x8b45('0x18')](respondWithFilteredResult(_0x5a5ee1,_0x182c39))[_0x8b45('0x5f')](handleError(_0x5a5ee1,null));};exports[_0x8b45('0x109')]=function(_0x4f3af1,_0x2f0036){var _0x5ec0c1=0x0;var _0x2f0e4a=0x0;var _0x5a7969=![];var _0x39bc34;var _0x355213;return db['ChatWebsite']['find']({'where':{'id':_0x4f3af1['params']['id']},'include':[{'model':db[_0x8b45('0x98')],'as':_0x8b45('0x98'),'include':[{'model':db[_0x8b45('0x98')],'as':_0x8b45('0xaf'),'attributes':['id',_0x8b45('0xb0')]}]}]})[_0x8b45('0x18')](handleEntityNotFound(_0x2f0036,null))[_0x8b45('0x18')](function(_0x65c5d7){if(_0x65c5d7){_0x39bc34=_0x65c5d7;return _0x65c5d7[_0x8b45('0x10a')]({'raw':!![]});}})[_0x8b45('0x18')](function(_0x30781a){if(_0x39bc34){if(_0x30781a){_0x355213=_0x30781a;}}return require(_0x8b45('0x10b'))['getLicense']();})['then'](function(_0x28c0f1){if(_0x28c0f1){_0x2f0e4a=_0x28c0f1[_0x8b45('0x10c')];_0x5a7969=_0x28c0f1[_0x8b45('0x8c')];}})[_0x8b45('0x18')](function(){return db[_0x8b45('0xbc')][_0x8b45('0x2a')]({'where':{'closed':![]}});})['then'](function(_0x482021){_0x5ec0c1=_0x482021;if(_0x2f0e4a&&_0x482021>_0x2f0e4a){return db[_0x8b45('0x10d')][_0x8b45('0x75')]({'where':{'id':0x1}})['then'](function(_0x2b618b){if(_0x2b618b){_0x2b618b[_0x8b45('0x10e')](_0x8b45('0x10f'));}});}})[_0x8b45('0x18')](function(){var _0x4eb05d=_0x39bc34[_0x8b45('0x98')];var _0x36a341=_0x39bc34[_0x8b45('0x9a')]||undefined;return _0x4eb05d?_0x4eb05d[_0x8b45('0x9b')](_0x36a341):!![];})[_0x8b45('0x18')](function(_0x4f329c){var _0x5b3e5a=fs['readFileSync'](path[_0x8b45('0x88')](config[_0x8b45('0x89')],'server/files/chat/iframe.ejs'),'utf8');var _0x2cb0d4='3.13.0';var _0x385842=![];var _0x19f33f,_0x6a6e5;if(_0x4f3af1[_0x8b45('0xb9')][_0x8b45('0x3c')]){_0x19f33f=new URL(_0x4f3af1['headers'][_0x8b45('0x3c')])[_0x8b45('0x110')];}else if(_0x4f3af1[_0x8b45('0xb9')][_0x8b45('0x110')]){_0x19f33f=new URL(_0x4f3af1[_0x8b45('0xb9')][_0x8b45('0x110')])[_0x8b45('0x110')];}else{_0x19f33f='http://localhost:9000';}_0x6a6e5=typeof _0x39bc34[_0x8b45('0x62')][_0x8b45('0x38')](',')['find'](function(_0xd31105){return wildcardUtils['testWebsiteWithWildcard'](_0xd31105,_0x19f33f);})!==_0x8b45('0x28');var _0x3af143={'chatVersion':_0x2cb0d4,'chatWebsiteAddressOrigin':_0x6a6e5?_0x19f33f:_0x39bc34['address'],'remote':_0x39bc34['remote'],'query':querystring[_0x8b45('0x1e')](_[_0x8b45('0x59')](_0x39bc34[_0x8b45('0x2e')]({'plain':!![]}),{'customerIp':_0x4f3af1[_0x8b45('0xb9')][_0x8b45('0x37')]||_0x4f3af1[_0x8b45('0xb9')][_0x8b45('0x111')]||_0x4f3af1['connection'][_0x8b45('0x112')]||_0x4f3af1['ip'],'referer':_0x4f3af1[_0x8b45('0xb9')][_0x8b45('0x3c')],'openedInteractions':_0x5ec0c1,'maxInteractions':_0x2f0e4a,'virtual':_0x5a7969[_0x8b45('0x10c')],'online':_0x4f329c,'custom':_0x5a7969,'address':_0x6a6e5?_0x19f33f:null}))['replace'](/'/g,'\x5c\x27')};_0x2f0036[_0x8b45('0x31')](ejs[_0x8b45('0x113')](Mustache[_0x8b45('0x113')](_0x5b3e5a,_0x3af143),{'proactiveActions':_0x355213,'alignment':_0x39bc34[_0x8b45('0x114')],'verticalAlignment':_0x39bc34[_0x8b45('0x115')],'div_color':_0x39bc34['color'],'labelText':_0x39bc34[_0x8b45('0x116')],'text_color':_0x39bc34[_0x8b45('0x117')],'text_button_color':_0x39bc34[_0x8b45('0x118')],'button_color':_0x39bc34['color_button'],'background_color':_0x39bc34[_0x8b45('0x119')],'hideWhenOffline':_0x39bc34[_0x8b45('0x11a')],'intervalId':_0x39bc34[_0x8b45('0x11b')],'isDevelopment':_0x385842,'chatVersion':_0x2cb0d4}));})[_0x8b45('0x5f')](handleError(_0x2f0036,null));};exports[_0x8b45('0x11c')]=function(_0x5cb4a4,_0x36fbda){var _0x298c84=_0x5cb4a4['params']['id'];var _0x1fd7ae=_0x5cb4a4[_0x8b45('0x61')];var _0x48ebcf=0xc8;var _0x4fdf7c=null;return db[_0x8b45('0xea')][_0x8b45('0xeb')]({'isolationLevel':db[_0x8b45('0xea')]['Transaction'][_0x8b45('0x11d')]['READ_COMMITTED']},function(_0x64c270){return db[_0x8b45('0x4a')][_0x8b45('0x75')]({'where':{'id':_0x298c84},'transaction':_0x64c270})['then'](function(_0x23b731){if(_0x23b731){return db[_0x8b45('0xad')][_0x8b45('0x2d')]({'where':{'ChatWebsiteId':_0x298c84},'transaction':_0x64c270})[_0x8b45('0x18')](function(){var _0x45d2ed=_[_0x8b45('0x49')](_0x1fd7ae,function(_0x167215){_0x167215['ChatWebsiteId']=_0x298c84;return _0x167215;});return db['ChatApplication'][_0x8b45('0xed')](_0x45d2ed,{'transaction':_0x64c270});});}else{_0x48ebcf=0x194;_0x4fdf7c=[];}});})['then'](function(){if(_0x48ebcf!==0x194){return db[_0x8b45('0xad')][_0x8b45('0x11e')]({'where':{'ChatWebsiteId':_0x298c84},'order':_0x8b45('0xb4')})[_0x8b45('0x18')](function(_0x3e26e8){_0x4fdf7c=_0x3e26e8;});}})[_0x8b45('0x5f')](function(_0x3a6577){_0x48ebcf=0x1f4;logger[_0x8b45('0x1f')](_0x3a6577['stack']);if(_0x3a6577[_0x8b45('0x30')]){delete _0x3a6577['name'];}_0x4fdf7c=_0x3a6577;})[_0x8b45('0x11f')](function(){if(_0x4fdf7c===null){_0x36fbda['sendStatus'](_0x48ebcf);}else{if(_0x48ebcf===0x1f4){_0x36fbda['status'](_0x48ebcf)['send'](_0x4fdf7c);}else{_0x36fbda[_0x8b45('0x24')](_0x48ebcf)[_0x8b45('0x26')](_0x4fdf7c);}}});};exports[_0x8b45('0x120')]=function(_0x43320d,_0x847faf){var _0x198279={};var _0x580011={};var _0x4976bb;var _0x3cf1b1;return db[_0x8b45('0x4a')][_0x8b45('0x75')]({'where':{'id':_0x43320d['params']['id']}})['then'](handleEntityNotFound(_0x847faf,null))['then'](function(_0x42bfb5){if(_0x42bfb5){_0x4976bb=_0x42bfb5;_0x580011[_0x8b45('0x43')]=_[_0x8b45('0x4e')](db[_0x8b45('0xad')][_0x8b45('0x4b')]);_0x580011[_0x8b45('0x4d')]=_[_0x8b45('0x4e')](_0x43320d[_0x8b45('0x4d')]);_0x580011['filters']=_[_0x8b45('0x51')](_0x580011[_0x8b45('0x43')],_0x580011[_0x8b45('0x4d')]);_0x198279[_0x8b45('0x50')]=_['intersection'](_0x580011[_0x8b45('0x43')],qs[_0x8b45('0x52')](_0x43320d[_0x8b45('0x4d')][_0x8b45('0x52')]));_0x198279[_0x8b45('0x50')]=_0x198279[_0x8b45('0x50')]['length']?_0x198279['attributes']:_0x580011[_0x8b45('0x43')];_0x198279[_0x8b45('0x76')]=qs[_0x8b45('0x56')](_0x43320d[_0x8b45('0x4d')][_0x8b45('0x56')]);_0x198279[_0x8b45('0x57')]=qs[_0x8b45('0x4f')](_[_0x8b45('0x77')](_0x43320d[_0x8b45('0x4d')],_0x580011[_0x8b45('0x4f')]));if(_0x43320d['query']['filter']){_0x198279['where']=_[_0x8b45('0x59')](_0x198279[_0x8b45('0x57')],{'$or':_[_0x8b45('0x49')](_0x198279['attributes'],function(_0x563c40){var _0x1e5d48={};_0x1e5d48[_0x563c40]={'$like':'%'+_0x43320d[_0x8b45('0x4d')][_0x8b45('0x58')]+'%'};return _0x1e5d48;})});}_0x198279=_[_0x8b45('0x59')]({},_0x198279,_0x43320d[_0x8b45('0x5b')]);return _0x4976bb[_0x8b45('0x120')](_0x198279);}})[_0x8b45('0x18')](function(_0x3d90c0){if(_0x3d90c0){_0x3cf1b1=_0x3d90c0[_0x8b45('0x53')];if(!_0x43320d[_0x8b45('0x4d')][_0x8b45('0x54')]('nolimit')){_0x198279[_0x8b45('0x29')]=qs[_0x8b45('0x29')](_0x43320d[_0x8b45('0x4d')][_0x8b45('0x29')]);_0x198279[_0x8b45('0x27')]=qs[_0x8b45('0x27')](_0x43320d[_0x8b45('0x4d')]['offset']);}return _0x4976bb[_0x8b45('0x120')](_0x198279);}})[_0x8b45('0x18')](function(_0x217b56){if(_0x217b56){return _0x217b56?{'count':_0x3cf1b1,'rows':_0x217b56}:null;}})[_0x8b45('0x18')](respondWithResult(_0x847faf,null))[_0x8b45('0x5f')](handleError(_0x847faf,null));};exports[_0x8b45('0x121')]=function(_0x52e041,_0x1ac5cf){return db['chatProactiveAction'][_0x8b45('0x68')]({'where':{'id':_0x52e041[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x1ac5cf,null))[_0x8b45('0x18')](function(_0x373401){if(_0x373401){return _0x373401[_0x8b45('0x121')](_0x52e041['body']['ids'],_[_0x8b45('0xfe')](_0x52e041[_0x8b45('0x61')],['ids','id'])||{});}})[_0x8b45('0x18')](respondWithResult(_0x1ac5cf,null))[_0x8b45('0x5f')](handleError(_0x1ac5cf,null));};exports[_0x8b45('0x10a')]=function(_0xf516ad,_0x377f5e){var _0xdd4dcd={};var _0x2ab03c={};var _0x2a89f5;var _0x540997;return db[_0x8b45('0x4a')]['findOne']({'where':{'id':_0xf516ad['params']['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x377f5e,null))[_0x8b45('0x18')](function(_0x4a1bc1){if(_0x4a1bc1){_0x2a89f5=_0x4a1bc1;_0x2ab03c['model']=_[_0x8b45('0x4e')](db[_0x8b45('0x122')][_0x8b45('0x4b')]);_0x2ab03c[_0x8b45('0x4d')]=_[_0x8b45('0x4e')](_0xf516ad[_0x8b45('0x4d')]);_0x2ab03c[_0x8b45('0x4f')]=_[_0x8b45('0x51')](_0x2ab03c[_0x8b45('0x43')],_0x2ab03c[_0x8b45('0x4d')]);_0xdd4dcd[_0x8b45('0x50')]=_['intersection'](_0x2ab03c[_0x8b45('0x43')],qs[_0x8b45('0x52')](_0xf516ad['query']['fields']));_0xdd4dcd[_0x8b45('0x50')]=_0xdd4dcd['attributes']['length']?_0xdd4dcd['attributes']:_0x2ab03c[_0x8b45('0x43')];_0xdd4dcd['order']=qs[_0x8b45('0x56')](_0xf516ad['query'][_0x8b45('0x56')]);_0xdd4dcd[_0x8b45('0x57')]=qs['filters'](_['pick'](_0xf516ad[_0x8b45('0x4d')],_0x2ab03c[_0x8b45('0x4f')]));if(_0xf516ad[_0x8b45('0x4d')][_0x8b45('0x58')]){_0xdd4dcd[_0x8b45('0x57')]=_[_0x8b45('0x59')](_0xdd4dcd[_0x8b45('0x57')],{'$or':_['map'](_0xdd4dcd[_0x8b45('0x50')],function(_0x515fc0){var _0x48c3e4={};_0x48c3e4[_0x515fc0]={'$like':'%'+_0xf516ad[_0x8b45('0x4d')][_0x8b45('0x58')]+'%'};return _0x48c3e4;})});}_0xdd4dcd=_[_0x8b45('0x59')]({},_0xdd4dcd,_0xf516ad[_0x8b45('0x5b')]);return _0x2a89f5['getProactiveActions'](_0xdd4dcd);}})[_0x8b45('0x18')](function(_0x36fbe3){if(_0x36fbe3){_0x540997=_0x36fbe3[_0x8b45('0x53')];if(!_0xf516ad[_0x8b45('0x4d')][_0x8b45('0x54')]('nolimit')){_0xdd4dcd[_0x8b45('0x29')]=qs[_0x8b45('0x29')](_0xf516ad[_0x8b45('0x4d')]['limit']);_0xdd4dcd['offset']=qs[_0x8b45('0x27')](_0xf516ad[_0x8b45('0x4d')][_0x8b45('0x27')]);}return _0x2a89f5['getProactiveActions'](_0xdd4dcd);}})[_0x8b45('0x18')](function(_0x49d6d1){if(_0x49d6d1){return _0x49d6d1?{'count':_0x540997,'rows':_0x49d6d1}:null;}})[_0x8b45('0x18')](respondWithResult(_0x377f5e,null))[_0x8b45('0x5f')](handleError(_0x377f5e,null));};exports[_0x8b45('0x123')]=function(_0x10fe20,_0x434e42){var _0x2db12a=_0x10fe20[_0x8b45('0x4d')][_0x8b45('0x124')]===_0x8b45('0x125')?_0x8b45('0x126'):_0x8b45('0x127');return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'attributes':['id',_0x2db12a],'where':{'id':_0x10fe20[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x434e42,null))[_0x8b45('0x18')](function(_0x1fc0f4){if(_0x1fc0f4){var _0x119702=_0x1fc0f4[_0x2db12a];var _0x14659b=_0x119702&&_0x119702['items']?_0x119702[_0x8b45('0x128')]:[];_0x434e42[_0x8b45('0x31')]({'fromKey':_['isNil'](_0x119702[_0x8b45('0x129')])?undefined:_0x119702[_0x8b45('0x129')],'count':_0x14659b[_0x8b45('0x53')],'rows':_0x14659b});}})[_0x8b45('0x5f')](handleError(_0x434e42,null));};exports[_0x8b45('0x12a')]=function(_0xa19e1,_0x3b4c23){var _0x427161={'raw':![],'where':{}};var _0x43237b={};var _0x450624={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xa19e1[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x3b4c23,null))[_0x8b45('0x18')](function(_0x493a0c){if(_0x493a0c){_0x43237b['model']=_[_0x8b45('0x4e')](db['ChatOfflineMessage']['rawAttributes']);_0x43237b[_0x8b45('0x4d')]=_[_0x8b45('0x4e')](_0xa19e1[_0x8b45('0x4d')]);_0x43237b[_0x8b45('0x4f')]=_[_0x8b45('0x51')](_0x43237b[_0x8b45('0x43')],_0x43237b[_0x8b45('0x4d')]);_0x427161[_0x8b45('0x50')]=_[_0x8b45('0x51')](_0x43237b[_0x8b45('0x43')],qs[_0x8b45('0x52')](_0xa19e1[_0x8b45('0x4d')][_0x8b45('0x52')]));_0x427161['attributes']=_0x427161[_0x8b45('0x50')]['length']?_0x427161[_0x8b45('0x50')]:_0x43237b['model'];if(!_0xa19e1['query'][_0x8b45('0x54')](_0x8b45('0x55'))){_0x427161[_0x8b45('0x29')]=qs['limit'](_0xa19e1['query'][_0x8b45('0x29')]);_0x427161[_0x8b45('0x27')]=qs[_0x8b45('0x27')](_0xa19e1[_0x8b45('0x4d')][_0x8b45('0x27')]);}_0x427161['order']=qs[_0x8b45('0x56')](_0xa19e1[_0x8b45('0x4d')][_0x8b45('0x56')]);_0x427161[_0x8b45('0x57')]=qs[_0x8b45('0x4f')](_[_0x8b45('0x77')](_0xa19e1[_0x8b45('0x4d')],_0x43237b[_0x8b45('0x4f')]));_0x427161['where']['ChatWebsiteId']=_0x493a0c['id'];if(_0xa19e1[_0x8b45('0x4d')]['filter']){_0x427161['where']=_[_0x8b45('0x59')](_0x427161['where'],{'$or':_[_0x8b45('0x49')](_0x427161[_0x8b45('0x50')],function(_0x164f7a){var _0x5d194d={};_0x5d194d[_0x164f7a]={'$like':'%'+_0xa19e1[_0x8b45('0x4d')][_0x8b45('0x58')]+'%'};return _0x5d194d;})});}_0x427161=_[_0x8b45('0x59')]({},_0x427161,_0xa19e1[_0x8b45('0x5b')]);return db['ChatOfflineMessage'][_0x8b45('0x2a')]({'where':_0x427161[_0x8b45('0x57')]})[_0x8b45('0x18')](function(_0x4bd1ab){_0x450624[_0x8b45('0x2a')]=_0x4bd1ab;if(_0xa19e1['query'][_0x8b45('0x60')]){_0x427161[_0x8b45('0x5c')]=[{'all':!![]}];}else{_0x427161[_0x8b45('0x5c')]=[{'model':db[_0x8b45('0xa2')],'as':_0x8b45('0x100'),'required':![]},{'model':db['Attachment'],'as':_0x8b45('0x12b'),'required':![]}];}return db[_0x8b45('0xe2')][_0x8b45('0x5d')](_0x427161);})[_0x8b45('0x18')](function(_0x52879d){_0x450624[_0x8b45('0x5e')]=_0x52879d;return _0x450624;});}})['then'](respondWithFilteredResult(_0x3b4c23,_0x427161))['catch'](handleError(_0x3b4c23,null));};exports[_0x8b45('0x12c')]=function(_0xaad3df,_0x1ff5e5){return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0xaad3df['params']['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x1ff5e5,null))[_0x8b45('0x18')](function(_0x19722b){if(_0x19722b){return _0x19722b['addAgents'](_0xaad3df['body']['ids'],_[_0x8b45('0xfe')](_0xaad3df[_0x8b45('0x61')],[_0x8b45('0x7a'),'id'])||{})[_0x8b45('0xdd')](function(_0x2796a7){for(var _0x116bd2=0x0;_0x116bd2<_0xaad3df[_0x8b45('0x61')][_0x8b45('0x7a')][_0x8b45('0x53')];_0x116bd2+=0x1){socket[_0x8b45('0x12d')](_0x8b45('0x12e'),{'UserId':Number(_0xaad3df[_0x8b45('0x61')]['ids'][_0x116bd2]),'ChatWebsiteId':Number(_0xaad3df[_0x8b45('0x70')]['id'])});}return _0x2796a7;});}})[_0x8b45('0x18')](respondWithResult(_0x1ff5e5,null))[_0x8b45('0x5f')](handleError(_0x1ff5e5,null));};exports[_0x8b45('0x12f')]=function(_0x868c05,_0x27fc9c){return db[_0x8b45('0x4a')][_0x8b45('0x68')]({'where':{'id':_0x868c05[_0x8b45('0x70')]['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x27fc9c,null))[_0x8b45('0x18')](function(_0x39b657){if(_0x39b657){return _0x39b657[_0x8b45('0x12f')](_0x868c05[_0x8b45('0x4d')]['ids'])[_0x8b45('0x18')](function(){if(_['isArray'](_0x868c05[_0x8b45('0x4d')][_0x8b45('0x7a')])){for(var _0x1e7c92=0x0;_0x1e7c92<_0x868c05['query'][_0x8b45('0x7a')][_0x8b45('0x53')];_0x1e7c92+=0x1){socket[_0x8b45('0x12d')](_0x8b45('0x130'),{'UserId':Number(_0x868c05[_0x8b45('0x4d')][_0x8b45('0x7a')][_0x1e7c92]),'ChatWebsiteId':Number(_0x868c05['params']['id'])});}}else{socket[_0x8b45('0x12d')](_0x8b45('0x130'),{'UserId':Number(_0x868c05[_0x8b45('0x4d')][_0x8b45('0x7a')]),'ChatWebsiteId':Number(_0x868c05['params']['id'])});}});}})['then'](respondWithStatusCode(_0x27fc9c,null))[_0x8b45('0x5f')](handleError(_0x27fc9c,null));};exports[_0x8b45('0x131')]=function(_0x3ae9b2,_0x531db4){var _0x1a5564={};var _0x348ee0={};var _0x3537d3;var _0x27ed43;return db[_0x8b45('0x4a')][_0x8b45('0x75')]({'where':{'id':_0x3ae9b2['params']['id']}})[_0x8b45('0x18')](handleEntityNotFound(_0x531db4,null))[_0x8b45('0x18')](function(_0x164648){if(_0x164648){_0x3537d3=_0x164648;_0x348ee0[_0x8b45('0x43')]=_[_0x8b45('0x4e')](db[_0x8b45('0x101')][_0x8b45('0x4b')]);_0x348ee0[_0x8b45('0x4d')]=_[_0x8b45('0x4e')](_0x3ae9b2[_0x8b45('0x4d')]);_0x348ee0['filters']=_[_0x8b45('0x51')](_0x348ee0[_0x8b45('0x43')],_0x348ee0['query']);_0x1a5564['attributes']=_[_0x8b45('0x51')](_0x348ee0[_0x8b45('0x43')],qs['fields'](_0x3ae9b2[_0x8b45('0x4d')]['fields']));_0x1a5564[_0x8b45('0x50')]=_0x1a5564[_0x8b45('0x50')][_0x8b45('0x53')]?_0x1a5564[_0x8b45('0x50')]:_0x348ee0['model'];_0x1a5564['order']=qs[_0x8b45('0x56')](_0x3ae9b2[_0x8b45('0x4d')]['sort']);_0x1a5564[_0x8b45('0x57')]=qs[_0x8b45('0x4f')](_['pick'](_0x3ae9b2['query'],_0x348ee0[_0x8b45('0x4f')]));if(_0x3ae9b2['query'][_0x8b45('0x58')]){_0x1a5564['where']=_[_0x8b45('0x59')](_0x1a5564[_0x8b45('0x57')],{'$or':_[_0x8b45('0x49')](_0x1a5564['attributes'],function(_0x45a4f2){var _0x5be512={};_0x5be512[_0x45a4f2]={'$like':'%'+_0x3ae9b2[_0x8b45('0x4d')][_0x8b45('0x58')]+'%'};return _0x5be512;})});}_0x1a5564=_[_0x8b45('0x59')]({},_0x1a5564,_0x3ae9b2[_0x8b45('0x5b')]);return _0x3537d3[_0x8b45('0x131')](_0x1a5564);}})[_0x8b45('0x18')](function(_0x2db8d8){if(_0x2db8d8){_0x27ed43=_0x2db8d8[_0x8b45('0x53')];if(!_0x3ae9b2[_0x8b45('0x4d')][_0x8b45('0x54')](_0x8b45('0x55'))){_0x1a5564[_0x8b45('0x29')]=qs['limit'](_0x3ae9b2[_0x8b45('0x4d')][_0x8b45('0x29')]);_0x1a5564[_0x8b45('0x27')]=qs['offset'](_0x3ae9b2['query'][_0x8b45('0x27')]);}return _0x3537d3[_0x8b45('0x131')](_0x1a5564);}})['then'](function(_0x5b97ca){if(_0x5b97ca){return _0x5b97ca?{'count':_0x27ed43,'rows':_0x5b97ca}:null;}})[_0x8b45('0x18')](respondWithResult(_0x531db4,null))['catch'](handleError(_0x531db4,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 3e250b6..c9f0154 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 _0x87df=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x12813f,_0x38ae10){var _0x313ce3=function(_0x4006fe){while(--_0x4006fe){_0x12813f['push'](_0x12813f['shift']());}};_0x313ce3(++_0x38ae10);}(_0x87df,0x167));var _0xf87d=function(_0x3fc287,_0x5c3f36){_0x3fc287=_0x3fc287-0x0;var _0x33af9f=_0x87df[_0x3fc287];return _0x33af9f;};'use strict';var EventEmitter=require(_0xf87d('0x0'));var ChatWebsite=require(_0xf87d('0x1'))['db'][_0xf87d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf87d('0x3')](0x0);var events={'afterCreate':_0xf87d('0x4'),'afterUpdate':_0xf87d('0x5'),'afterDestroy':_0xf87d('0x6')};function emitEvent(_0xb0fb5a){return function(_0x25290a,_0x1d4ff6,_0x4fbca2){ChatWebsiteEvents['emit'](_0xb0fb5a+':'+_0x25290a['id'],_0x25290a);ChatWebsiteEvents[_0xf87d('0x7')](_0xb0fb5a,_0x25290a);_0x4fbca2(null);};}for(var e in events){if(events[_0xf87d('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xf87d('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x0689=['remove','emit','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x4d86d7,_0x29884d){var _0x4c80ca=function(_0x21b53b){while(--_0x21b53b){_0x4d86d7['push'](_0x4d86d7['shift']());}};_0x4c80ca(++_0x29884d);}(_0x0689,0x161));var _0x9068=function(_0x435fa1,_0x58550a){_0x435fa1=_0x435fa1-0x0;var _0x845f9f=_0x0689[_0x435fa1];return _0x845f9f;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x9068('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9068('0x1')](0x0);var events={'afterCreate':_0x9068('0x2'),'afterUpdate':_0x9068('0x3'),'afterDestroy':_0x9068('0x4')};function emitEvent(_0x44080a){return function(_0x1c35ba,_0x3b12f4,_0x1dbc6f){ChatWebsiteEvents[_0x9068('0x5')](_0x44080a+':'+_0x1c35ba['id'],_0x1c35ba);ChatWebsiteEvents[_0x9068('0x5')](_0x44080a,_0x1c35ba);_0x1dbc6f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x9068('0x6')](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 7ea285b..b27c2a5 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 _0xaa9e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xaa9e,0xa8));var _0xeaa9=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xaa9e[_0x45f951];return _0x24756c;};'use strict';var _=require(_0xeaa9('0x0'));var util=require('util');var logger=require(_0xeaa9('0x1'))(_0xeaa9('0x2'));var moment=require(_0xeaa9('0x3'));var BPromise=require(_0xeaa9('0x4'));var rp=require(_0xeaa9('0x5'));var fs=require('fs');var path=require(_0xeaa9('0x6'));var rimraf=require(_0xeaa9('0x7'));var config=require(_0xeaa9('0x8'));var attributes=require(_0xeaa9('0x9'));module[_0xeaa9('0xa')]=function(_0x5cb17c,_0x3d2e78){return _0x5cb17c[_0xeaa9('0xb')](_0xeaa9('0xc'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd6a=['../../config/environment','exports','define','ChatWebsite','chat_websites','util','moment','bluebird','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd6a,0x195));var _0xabd6=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xbd6a[_0x18abd2];return _0x1dcad6;};'use strict';var _=require('lodash');var util=require(_0xabd6('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xabd6('0x1'));var BPromise=require(_0xabd6('0x2'));var rp=require(_0xabd6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabd6('0x4'));var config=require(_0xabd6('0x5'));var attributes=require('./chatWebsite.attributes');module[_0xabd6('0x6')]=function(_0x1f5ae6,_0x465464){return _0x1f5ae6[_0xabd6('0x7')](_0xabd6('0x8'),attributes,{'tableName':_0xabd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index b32b52f..c530210 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 _0x32e0=['stringify','error','ChatWebsite,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x32e0,0xc5));var _0x032e=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0x32e0[_0x39ffd1];return _0x31267e;};'use strict';var _=require('lodash');var util=require(_0x032e('0x0'));var moment=require(_0x032e('0x1'));var BPromise=require(_0x032e('0x2'));var rs=require(_0x032e('0x3'));var fs=require('fs');var Redis=require(_0x032e('0x4'));var db=require(_0x032e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x032e('0x6'));var config=require(_0x032e('0x7'));var jayson=require(_0x032e('0x8'));var client=jayson[_0x032e('0x9')][_0x032e('0xa')]({'port':0x232a});config[_0x032e('0xb')]=_['defaults'](config[_0x032e('0xb')],{'host':_0x032e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x032e('0xb')]));require('./chatWebsite.socket')[_0x032e('0xd')](socket);function respondWithRpcPromise(_0x1d2214,_0x1a7922,_0x175402){return new BPromise(function(_0xefcdf1,_0x34e439){return client[_0x032e('0xe')](_0x1d2214,_0x175402)['then'](function(_0xabef99){logger[_0x032e('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x1a7922,_0x032e('0x10'));logger[_0x032e('0x11')](_0x032e('0x12'),_0x1a7922,'request\x20sent',JSON[_0x032e('0x13')](_0xabef99));if(_0xabef99[_0x032e('0x14')]){if(_0xabef99['error']['code']===0x1f4){logger[_0x032e('0x14')](_0x032e('0x15'),_0x1a7922,_0xabef99['error']['message']);return _0x34e439(_0xabef99[_0x032e('0x14')][_0x032e('0x16')]);}logger[_0x032e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x1a7922,_0xabef99['error'][_0x032e('0x16')]);return _0xefcdf1(_0xabef99[_0x032e('0x14')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1a7922,_0x032e('0x10'));_0xefcdf1(_0xabef99['result'][_0x032e('0x16')]);}})[_0x032e('0x17')](function(_0x529d96){logger[_0x032e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x1a7922,_0x529d96);_0x34e439(_0x529d96);});});}
\ No newline at end of file
+var _0x94ca=['code','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x39c138,_0x244b52){var _0x5e737a=function(_0x3ff4a8){while(--_0x3ff4a8){_0x39c138['push'](_0x39c138['shift']());}};_0x5e737a(++_0x244b52);}(_0x94ca,0x8e));var _0xa94c=function(_0x6d989d,_0x416427){_0x6d989d=_0x6d989d-0x0;var _0x5c5535=_0x94ca[_0x6d989d];return _0x5c5535;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa94c('0x0'));var rs=require(_0xa94c('0x1'));var fs=require('fs');var Redis=require(_0xa94c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa94c('0x3'));var logger=require(_0xa94c('0x4'))(_0xa94c('0x5'));var config=require(_0xa94c('0x6'));var jayson=require(_0xa94c('0x7'));var client=jayson['client'][_0xa94c('0x8')]({'port':0x232a});config[_0xa94c('0x9')]=_[_0xa94c('0xa')](config[_0xa94c('0x9')],{'host':_0xa94c('0xb'),'port':0x18eb});var socket=require(_0xa94c('0xc'))(new Redis(config[_0xa94c('0x9')]));require('./chatWebsite.socket')[_0xa94c('0xd')](socket);function respondWithRpcPromise(_0x5f3199,_0x2a0d6c,_0x51c065){return new BPromise(function(_0x50cd48,_0x46aefe){return client['request'](_0x5f3199,_0x51c065)['then'](function(_0x267171){logger[_0xa94c('0xe')](_0xa94c('0xf'),_0x2a0d6c,_0xa94c('0x10'));logger[_0xa94c('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2a0d6c,_0xa94c('0x10'),JSON['stringify'](_0x267171));if(_0x267171[_0xa94c('0x12')]){if(_0x267171[_0xa94c('0x12')][_0xa94c('0x13')]===0x1f4){logger[_0xa94c('0x12')](_0xa94c('0xf'),_0x2a0d6c,_0x267171['error'][_0xa94c('0x14')]);return _0x46aefe(_0x267171['error'][_0xa94c('0x14')]);}logger[_0xa94c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2a0d6c,_0x267171[_0xa94c('0x12')][_0xa94c('0x14')]);return _0x50cd48(_0x267171[_0xa94c('0x12')]['message']);}else{logger[_0xa94c('0xe')](_0xa94c('0xf'),_0x2a0d6c,'request\x20sent');_0x50cd48(_0x267171[_0xa94c('0x15')]['message']);}})[_0xa94c('0x16')](function(_0x419ea7){logger['error'](_0xa94c('0xf'),_0x2a0d6c,_0x419ea7);_0x46aefe(_0x419ea7);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index de3c021..2e925ef 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 _0x13d9=['removeListener','register','chatWebsite:','./chatWebsite.events','save','update','emit'];(function(_0x4b9a64,_0x3c3a2a){var _0xdb31de=function(_0x35d4f5){while(--_0x35d4f5){_0x4b9a64['push'](_0x4b9a64['shift']());}};_0xdb31de(++_0x3c3a2a);}(_0x13d9,0xa4));var _0x913d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13d9[_0x14add3];return _0x4a174f;};'use strict';var ChatWebsiteEvents=require(_0x913d('0x0'));var events=[_0x913d('0x1'),'remove',_0x913d('0x2')];function createListener(_0x5136a7,_0x13e669){return function(_0x106c03){_0x13e669[_0x913d('0x3')](_0x5136a7,_0x106c03);};}function removeListener(_0x332464,_0x295b1e){return function(){ChatWebsiteEvents[_0x913d('0x4')](_0x332464,_0x295b1e);};}exports[_0x913d('0x5')]=function(_0x3c1e0d){for(var _0x33dee8=0x0,_0x15bcc3=events['length'];_0x33dee8<_0x15bcc3;_0x33dee8++){var _0x5606dd=events[_0x33dee8];var _0x38257e=createListener(_0x913d('0x6')+_0x5606dd,_0x3c1e0d);ChatWebsiteEvents['on'](_0x5606dd,_0x38257e);}};
\ No newline at end of file
+var _0x6b39=['length','chatWebsite:','./chatWebsite.events','update','emit','register'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6b39,0xf2));var _0x96b3=function(_0x1a3f88,_0x3e0d6d){_0x1a3f88=_0x1a3f88-0x0;var _0x1dca45=_0x6b39[_0x1a3f88];return _0x1dca45;};'use strict';var ChatWebsiteEvents=require(_0x96b3('0x0'));var events=['save','remove',_0x96b3('0x1')];function createListener(_0x349ab5,_0x182019){return function(_0x52e49e){_0x182019[_0x96b3('0x2')](_0x349ab5,_0x52e49e);};}function removeListener(_0x175b8f,_0x40532e){return function(){ChatWebsiteEvents['removeListener'](_0x175b8f,_0x40532e);};}exports[_0x96b3('0x3')]=function(_0x291a7e){for(var _0x3787ec=0x0,_0x4d1e0e=events[_0x96b3('0x4')];_0x3787ec<_0x4d1e0e;_0x3787ec++){var _0x2b5403=events[_0x3787ec];var _0x5ca6e7=createListener(_0x96b3('0x5')+_0x2b5403,_0x291a7e);ChatWebsiteEvents['on'](_0x2b5403,_0x5ca6e7);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 81e2755..6fb047c 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x66fa=['escapeRegExp','URL','replace','localhost','test','trim','exports','../../../utils/misc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x66fa,0x117));var _0xa66f=function(_0x152330,_0x2c86d1){_0x152330=_0x152330-0x0;var _0xc44ae3=_0x66fa[_0x152330];return _0xc44ae3;};var escapeRegExp=require(_0xa66f('0x0'))[_0xa66f('0x1')];var URL=require('url')[_0xa66f('0x2')];function testWildcardValidity(_0x2dcf24){var _0x234f2d=!![];try{new URL(_0x2dcf24[_0xa66f('0x3')]('*',_0xa66f('0x4')));}catch(_0x2a2abf){_0x234f2d=![];}return _0x234f2d&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xa66f('0x5')](_0x2dcf24);}function testWebsiteWithWildcard(_0x5ebea5,_0x4fd9d0){var _0x2239d3;var _0x20a150=escapeRegExp(_0x5ebea5[_0xa66f('0x6')]()[_0xa66f('0x3')](/\/$/,''))[_0xa66f('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x5ebea5[_0xa66f('0x3')]('\x5c*','localhost'));_0x2239d3=new RegExp(_0x20a150)[_0xa66f('0x5')](_0x4fd9d0);}catch(_0x597c7c){_0x2239d3=![];}return _0x2239d3;}module[_0xa66f('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x1261=['escapeRegExp','url','URL','replace','localhost','test','trim','([\x5cw]+)','exports'];(function(_0x2a94f8,_0x454b8d){var _0x29cbfe=function(_0x3630d0){while(--_0x3630d0){_0x2a94f8['push'](_0x2a94f8['shift']());}};_0x29cbfe(++_0x454b8d);}(_0x1261,0x144));var _0x1126=function(_0x8d8f23,_0x8c1961){_0x8d8f23=_0x8d8f23-0x0;var _0x22bf54=_0x1261[_0x8d8f23];return _0x22bf54;};var escapeRegExp=require('../../../utils/misc')[_0x1126('0x0')];var URL=require(_0x1126('0x1'))[_0x1126('0x2')];function testWildcardValidity(_0x331a2c){var _0x39b786=!![];try{new URL(_0x331a2c[_0x1126('0x3')]('*',_0x1126('0x4')));}catch(_0x4245ca){_0x39b786=![];}return _0x39b786&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x1126('0x5')](_0x331a2c);}function testWebsiteWithWildcard(_0x75a851,_0x5a2189){var _0x5c68c8;var _0x40ba58=escapeRegExp(_0x75a851[_0x1126('0x6')]()['replace'](/\/$/,''))[_0x1126('0x3')]('\x5c*',_0x1126('0x7'));try{new URL(_0x75a851[_0x1126('0x3')]('\x5c*',_0x1126('0x4')));_0x5c68c8=new RegExp(_0x40ba58)[_0x1126('0x5')](_0x5a2189);}catch(_0x59cfa1){_0x5c68c8=![];}return _0x5c68c8;}module[_0x1126('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index cfbdf0c..7eaa1ba 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 _0x8fe9=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/fields','getFields','/:id/users','post','diskStorage','join','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','root','server/files/images/avatars/','/:id/avatar','addAvatar','/:id/customer_avatar','addCustomerAvatar','originalname','addSystemAvatar','/:id/notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','/:id/applications','addAgents','put','update','delete','destroy','removeDispositions','exports','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x522c1a,_0x1299ed){var _0x5807ee=function(_0x4e5601){while(--_0x4e5601){_0x522c1a['push'](_0x522c1a['shift']());}};_0x5807ee(++_0x1299ed);}(_0x8fe9,0x122));var _0x98fe=function(_0xd1a252,_0x16396f){_0xd1a252=_0xd1a252-0x0;var _0x560ee1=_0x8fe9[_0xd1a252];return _0x560ee1;};'use strict';var multer=require('multer');var util=require(_0x98fe('0x0'));var path=require(_0x98fe('0x1'));var timeout=require(_0x98fe('0x2'));var express=require(_0x98fe('0x3'));var router=express[_0x98fe('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98fe('0x5'));var controller=require('./chatWebsite.controller');router[_0x98fe('0x6')]('/',auth[_0x98fe('0x7')](),controller['index']);router[_0x98fe('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x98fe('0x6')](_0x98fe('0x8'),auth['isAuthenticated'](),controller[_0x98fe('0x9')]);router['get'](_0x98fe('0xa'),auth[_0x98fe('0x7')](),controller[_0x98fe('0xb')]);router[_0x98fe('0x6')](_0x98fe('0xc'),auth[_0x98fe('0x7')](),controller[_0x98fe('0xd')]);router['get'](_0x98fe('0xe'),controller['getLogo']);router[_0x98fe('0x6')]('/:id/avatar',controller[_0x98fe('0xf')]);router[_0x98fe('0x6')]('/:id/customer_avatar',controller[_0x98fe('0x10')]);router[_0x98fe('0x6')](_0x98fe('0x11'),controller['getSystemAvatar']);router['get'](_0x98fe('0x12'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x98fe('0x6')](_0x98fe('0x13'),controller[_0x98fe('0x14')]);router[_0x98fe('0x6')]('/:id/applications',auth[_0x98fe('0x7')](),controller[_0x98fe('0x15')]);router[_0x98fe('0x6')]('/:id/proactive_actions',auth[_0x98fe('0x7')](),controller['getProactiveActions']);router[_0x98fe('0x6')](_0x98fe('0x16'),controller[_0x98fe('0x17')]);router[_0x98fe('0x6')]('/:id/offline_messages',auth[_0x98fe('0x7')](),controller['getOfflineMessages']);router['get'](_0x98fe('0x18'),auth[_0x98fe('0x7')](),controller['getAgents']);router[_0x98fe('0x19')]('/',auth[_0x98fe('0x7')](),controller['create']);router[_0x98fe('0x19')](_0x98fe('0xa'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x98fe('0x19')](_0x98fe('0xc'),auth[_0x98fe('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x98fe('0x1a')]({'destination':function(_0x521f99,_0x486414,_0xbcbff0){_0xbcbff0(null,path[_0x98fe('0x1b')](config['root'],_0x98fe('0x1c')));},'filename':function(_0x1d1090,_0x472f9e,_0x44dacf){_0x44dacf(null,util[_0x98fe('0x1d')](_0x98fe('0x1e'),Date[_0x98fe('0x1f')](),_0x472f9e['originalname']));}})});router[_0x98fe('0x19')]('/:id/logo',upload[_0x98fe('0x20')](_0x98fe('0x21')),controller[_0x98fe('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb9789e,_0x1d502e,_0x1ec6c){_0x1ec6c(null,path[_0x98fe('0x1b')](config[_0x98fe('0x23')],_0x98fe('0x24')));},'filename':function(_0x9ae7d4,_0x216259,_0xefd76){_0xefd76(null,util[_0x98fe('0x1d')](_0x98fe('0x1e'),Date['now'](),_0x216259['originalname']));}})});router[_0x98fe('0x19')](_0x98fe('0x25'),upload['single'](_0x98fe('0x21')),controller[_0x98fe('0x26')]);var upload=multer({'storage':multer[_0x98fe('0x1a')]({'destination':function(_0x1e3cb6,_0x6f1275,_0x131193){_0x131193(null,path[_0x98fe('0x1b')](config[_0x98fe('0x23')],_0x98fe('0x24')));},'filename':function(_0x399684,_0x40af93,_0x5bf1b3){_0x5bf1b3(null,util[_0x98fe('0x1d')](_0x98fe('0x1e'),Date[_0x98fe('0x1f')](),_0x40af93['originalname']));}})});router[_0x98fe('0x19')](_0x98fe('0x27'),upload[_0x98fe('0x20')](_0x98fe('0x21')),controller[_0x98fe('0x28')]);var upload=multer({'storage':multer[_0x98fe('0x1a')]({'destination':function(_0x5ab2b1,_0x49530a,_0x34b923){_0x34b923(null,path[_0x98fe('0x1b')](config[_0x98fe('0x23')],_0x98fe('0x24')));},'filename':function(_0x2b0690,_0x44b513,_0xfc29ed){_0xfc29ed(null,util[_0x98fe('0x1d')](_0x98fe('0x1e'),Date['now'](),_0x44b513[_0x98fe('0x29')]));}})});router[_0x98fe('0x19')](_0x98fe('0x11'),upload[_0x98fe('0x20')]('file'),controller[_0x98fe('0x2a')]);router[_0x98fe('0x19')](_0x98fe('0x2b'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x41ab90,_0x2dd6ee,_0xe1d93f){const _0x1a2a56=path[_0x98fe('0x1b')](config[_0x98fe('0x23')],_0x98fe('0x2c'),'attachments',_0x98fe('0x2d'));fs_extra[_0x98fe('0x2e')](_0x1a2a56,function(){_0xe1d93f(null,_0x1a2a56);});},'filename':function(_0x5b4f24,_0x7f0023,_0x519bad){const _0x3bb170=_0x7f0023[_0x98fe('0x29')][_0x98fe('0x2f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3bd8ca=path[_0x98fe('0x30')](_0x3bb170);const _0xf85f0=Date[_0x98fe('0x1f')]()+'-'+_0x3bb170['replace'](_0x3bd8ca,'')+_0x3bd8ca;_0x519bad(null,_0xf85f0);}})});router['post']('/:id/offline',offlineUploadMulter[_0x98fe('0x31')](),controller[_0x98fe('0x32')]);router['post']('/:id/interactions',auth[_0x98fe('0x7')](),controller[_0x98fe('0x33')]);router[_0x98fe('0x19')](_0x98fe('0x34'),auth[_0x98fe('0x7')](),controller['addApplications']);router[_0x98fe('0x19')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x98fe('0x19')](_0x98fe('0x18'),auth[_0x98fe('0x7')](),controller[_0x98fe('0x35')]);router[_0x98fe('0x36')](_0x98fe('0x8'),auth['isAuthenticated'](),controller[_0x98fe('0x37')]);router[_0x98fe('0x38')](_0x98fe('0x8'),auth[_0x98fe('0x7')](),controller[_0x98fe('0x39')]);router[_0x98fe('0x38')](_0x98fe('0xa'),auth['isAuthenticated'](),controller[_0x98fe('0x3a')]);router[_0x98fe('0x38')]('/:id/canned_answers',auth[_0x98fe('0x7')](),controller['removeAnswers']);router[_0x98fe('0x38')](_0x98fe('0x18'),auth[_0x98fe('0x7')](),controller['removeAgents']);module[_0x98fe('0x3b')]=router;
\ No newline at end of file
+var _0x525f=['server/files/images/avatars/','originalname','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','update','destroy','delete','removeDispositions','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','file','addLogo','join','%s-%s','now','addAvatar'];(function(_0x3d9cfa,_0x596edc){var _0x21d89d=function(_0x5668c2){while(--_0x5668c2){_0x3d9cfa['push'](_0x3d9cfa['shift']());}};_0x21d89d(++_0x596edc);}(_0x525f,0x180));var _0xf525=function(_0x171e21,_0x2762da){_0x171e21=_0x171e21-0x0;var _0x57afa4=_0x525f[_0x171e21];return _0x57afa4;};'use strict';var multer=require(_0xf525('0x0'));var util=require(_0xf525('0x1'));var path=require(_0xf525('0x2'));var timeout=require('connect-timeout');var express=require(_0xf525('0x3'));var router=express[_0xf525('0x4')]();var fs_extra=require(_0xf525('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf525('0x6'));var config=require(_0xf525('0x7'));var controller=require(_0xf525('0x8'));router[_0xf525('0x9')]('/',auth[_0xf525('0xa')](),controller[_0xf525('0xb')]);router[_0xf525('0x9')]('/describe',auth[_0xf525('0xa')](),controller['describe']);router[_0xf525('0x9')](_0xf525('0xc'),auth[_0xf525('0xa')](),controller[_0xf525('0xd')]);router['get'](_0xf525('0xe'),auth[_0xf525('0xa')](),controller['getDispositions']);router[_0xf525('0x9')](_0xf525('0xf'),auth[_0xf525('0xa')](),controller[_0xf525('0x10')]);router[_0xf525('0x9')](_0xf525('0x11'),controller[_0xf525('0x12')]);router[_0xf525('0x9')]('/:id/avatar',controller[_0xf525('0x13')]);router[_0xf525('0x9')](_0xf525('0x14'),controller[_0xf525('0x15')]);router[_0xf525('0x9')]('/:id/system_avatar',controller[_0xf525('0x16')]);router[_0xf525('0x9')](_0xf525('0x17'),auth[_0xf525('0xa')](),controller[_0xf525('0x18')]);router['get'](_0xf525('0x19'),controller[_0xf525('0x1a')]);router[_0xf525('0x9')](_0xf525('0x1b'),auth[_0xf525('0xa')](),controller[_0xf525('0x1c')]);router[_0xf525('0x9')](_0xf525('0x1d'),auth[_0xf525('0xa')](),controller[_0xf525('0x1e')]);router[_0xf525('0x9')]('/:id/fields',controller['getFields']);router[_0xf525('0x9')](_0xf525('0x1f'),auth[_0xf525('0xa')](),controller['getOfflineMessages']);router['get'](_0xf525('0x20'),auth['isAuthenticated'](),controller[_0xf525('0x21')]);router[_0xf525('0x22')]('/',auth[_0xf525('0xa')](),controller[_0xf525('0x23')]);router[_0xf525('0x22')](_0xf525('0xe'),auth[_0xf525('0xa')](),controller[_0xf525('0x24')]);router[_0xf525('0x22')](_0xf525('0xf'),auth['isAuthenticated'](),controller[_0xf525('0x25')]);var upload=multer({'storage':multer[_0xf525('0x26')]({'destination':function(_0x2842b9,_0x4154ba,_0x2d0bc9){_0x2d0bc9(null,path['join'](config[_0xf525('0x27')],_0xf525('0x28')));},'filename':function(_0x24b4aa,_0x16c8b3,_0x311a9e){_0x311a9e(null,util[_0xf525('0x29')]('%s-%s',Date['now'](),_0x16c8b3['originalname']));}})});router[_0xf525('0x22')](_0xf525('0x11'),upload['single'](_0xf525('0x2a')),controller[_0xf525('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26a090,_0x459253,_0x4af5cd){_0x4af5cd(null,path[_0xf525('0x2c')](config[_0xf525('0x27')],'server/files/images/avatars/'));},'filename':function(_0x32e87e,_0x5b062c,_0x50464d){_0x50464d(null,util['format'](_0xf525('0x2d'),Date[_0xf525('0x2e')](),_0x5b062c['originalname']));}})});router[_0xf525('0x22')]('/:id/avatar',upload['single'](_0xf525('0x2a')),controller[_0xf525('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4bea76,_0x48d585,_0x12bd54){_0x12bd54(null,path[_0xf525('0x2c')](config[_0xf525('0x27')],_0xf525('0x30')));},'filename':function(_0x2fa113,_0x4ae91e,_0x309522){_0x309522(null,util[_0xf525('0x29')](_0xf525('0x2d'),Date[_0xf525('0x2e')](),_0x4ae91e[_0xf525('0x31')]));}})});router[_0xf525('0x22')](_0xf525('0x14'),upload[_0xf525('0x32')]('file'),controller[_0xf525('0x33')]);var upload=multer({'storage':multer[_0xf525('0x26')]({'destination':function(_0x5f4238,_0x43b83a,_0x3377c6){_0x3377c6(null,path[_0xf525('0x2c')](config['root'],_0xf525('0x30')));},'filename':function(_0x108357,_0x55b19b,_0x38c30e){_0x38c30e(null,util['format'](_0xf525('0x2d'),Date['now'](),_0x55b19b[_0xf525('0x31')]));}})});router['post'](_0xf525('0x34'),upload[_0xf525('0x32')](_0xf525('0x2a')),controller[_0xf525('0x35')]);router[_0xf525('0x22')](_0xf525('0x36'),controller[_0xf525('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x362350,_0x1f924d,_0x5681cf){const _0x1ed66c=path[_0xf525('0x2c')](config[_0xf525('0x27')],_0xf525('0x38'),'attachments',_0xf525('0x39'));fs_extra[_0xf525('0x3a')](_0x1ed66c,function(){_0x5681cf(null,_0x1ed66c);});},'filename':function(_0x498c7f,_0x2f96f2,_0xec6fe8){const _0x41441d=_0x2f96f2[_0xf525('0x31')][_0xf525('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5ee12f=path[_0xf525('0x3c')](_0x41441d);const _0x5e2dc1=Date[_0xf525('0x2e')]()+'-'+_0x41441d[_0xf525('0x3b')](_0x5ee12f,'')+_0x5ee12f;_0xec6fe8(null,_0x5e2dc1);}})});router[_0xf525('0x22')](_0xf525('0x3d'),offlineUploadMulter[_0xf525('0x3e')](),controller[_0xf525('0x3f')]);router[_0xf525('0x22')](_0xf525('0x17'),auth[_0xf525('0xa')](),controller[_0xf525('0x40')]);router[_0xf525('0x22')](_0xf525('0x1b'),auth[_0xf525('0xa')](),controller['addApplications']);router[_0xf525('0x22')](_0xf525('0x1d'),auth[_0xf525('0xa')](),controller[_0xf525('0x41')]);router[_0xf525('0x22')](_0xf525('0x20'),auth[_0xf525('0xa')](),controller[_0xf525('0x42')]);router['put']('/:id',auth[_0xf525('0xa')](),controller[_0xf525('0x43')]);router['delete'](_0xf525('0xc'),auth[_0xf525('0xa')](),controller[_0xf525('0x44')]);router[_0xf525('0x45')](_0xf525('0xe'),auth['isAuthenticated'](),controller[_0xf525('0x46')]);router[_0xf525('0x45')](_0xf525('0xf'),auth[_0xf525('0xa')](),controller['removeAnswers']);router[_0xf525('0x45')](_0xf525('0x20'),auth[_0xf525('0xa')](),controller['removeAgents']);module[_0xf525('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 11bbcd0..f5cb688 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 _0x9c00=['/client-logs','isAuthenticated','exports','beaver-logger/server','../components/auth/service','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x368590,_0x48ad74){var _0x5ceb60=function(_0x322b8e){while(--_0x322b8e){_0x368590['push'](_0x368590['shift']());}};_0x5ceb60(++_0x48ad74);}(_0x9c00,0x13b));var _0x09c0=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c00[_0x3511d3];return _0x5d6321;};var beaverLogger=require(_0x09c0('0x0'));var express=require('express');var auth=require(_0x09c0('0x1'));var config=require('../config/environment');var router=express[_0x09c0('0x2')]();var isProduction=config[_0x09c0('0x3')]===_0x09c0('0x4')||![];function clientSideLogs(_0x927b75,_0x456dbc,_0x433146){var _0x1838a5=_0x927b75[_0x09c0('0x5')]['get'](_0x09c0('0x6'));if(!_0x1838a5){throw new Error(_0x09c0('0x7'));}return beaverLogger[_0x09c0('0x8')]({'uri':_0x09c0('0x9'),'logger':_0x1838a5,'enableCors':!isProduction})(_0x927b75,_0x456dbc,_0x433146);}router['use'](auth[_0x09c0('0xa')](),clientSideLogs);module[_0x09c0('0xb')]=router;
\ No newline at end of file
+var _0xff16=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../config/environment','Router'];(function(_0x4c8048,_0x510d1b){var _0x2abe23=function(_0x28b49a){while(--_0x28b49a){_0x4c8048['push'](_0x4c8048['shift']());}};_0x2abe23(++_0x510d1b);}(_0xff16,0xa6));var _0x6ff1=function(_0xe460e8,_0xeb563c){_0xe460e8=_0xe460e8-0x0;var _0x4ee203=_0xff16[_0xe460e8];return _0x4ee203;};var beaverLogger=require('beaver-logger/server');var express=require(_0x6ff1('0x0'));var auth=require('../components/auth/service');var config=require(_0x6ff1('0x1'));var router=express[_0x6ff1('0x2')]();var isProduction=config['env']===_0x6ff1('0x3')||![];function clientSideLogs(_0x368b03,_0x56c49c,_0x47a853){var _0x21bbe8=_0x368b03[_0x6ff1('0x4')][_0x6ff1('0x5')](_0x6ff1('0x6'));if(!_0x21bbe8){throw new Error(_0x6ff1('0x7'));}return beaverLogger[_0x6ff1('0x8')]({'uri':_0x6ff1('0x9'),'logger':_0x21bbe8,'enableCors':!isProduction})(_0x368b03,_0x56c49c,_0x47a853);}router[_0x6ff1('0xa')](auth[_0x6ff1('0xb')](),clientSideLogs);module[_0x6ff1('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e45ef78..768fb48 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 _0x6c9f=['STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x20dbe8,_0x3998af){var _0x2c06c6=function(_0x4d6b02){while(--_0x4d6b02){_0x20dbe8['push'](_0x20dbe8['shift']());}};_0x2c06c6(++_0x3998af);}(_0x6c9f,0xe8));var _0xf6c9=function(_0x3aa2d3,_0x550bbe){_0x3aa2d3=_0x3aa2d3-0x0;var _0x3daba8=_0x6c9f[_0x3aa2d3];return _0x3daba8;};'use strict';var Sequelize=require(_0xf6c9('0x0'));module[_0xf6c9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf6c9('0x2')](_0xf6c9('0x3'),_0xf6c9('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf6c9('0x2')](_0xf6c9('0x5'),_0xf6c9('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0xf6c9('0x7')},'data2':{'type':Sequelize[_0xf6c9('0x8')],'comment':_0xf6c9('0x9')},'data3':{'type':Sequelize[_0xf6c9('0x8')],'comment':_0xf6c9('0xa')},'data4':{'type':Sequelize[_0xf6c9('0x8')],'comment':_0xf6c9('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0xf6c9('0xc')},'data6':{'type':Sequelize[_0xf6c9('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xf6c9('0xd')],'comment':_0xf6c9('0xe')}};
\ No newline at end of file
+var _0x0cf9=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','Outlook365'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0x0cf9,0x120));var _0x90cf=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x0cf9[_0x3ce2c4];return _0x4047c1;};'use strict';var Sequelize=require(_0x90cf('0x0'));module[_0x90cf('0x1')]={'name':{'type':Sequelize[_0x90cf('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x90cf('0x3'),_0x90cf('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x90cf('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0x90cf('0x2')],'comment':_0x90cf('0x6')},'data2':{'type':Sequelize[_0x90cf('0x2')],'comment':_0x90cf('0x7')},'data3':{'type':Sequelize[_0x90cf('0x2')],'comment':_0x90cf('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0x90cf('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x90cf('0xa')},'data6':{'type':Sequelize[_0x90cf('0xb')],'comment':_0x90cf('0xc')},'data7':{'type':Sequelize[_0x90cf('0xb')],'comment':_0x90cf('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index b2b88a6..b7ffd3e 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 _0x80fd=['create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','catch','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','from','base64','toString','ascii','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','set','json','update','then','destroy','end','stack','name','padEnd','slice','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','CloudProvider','includeAll','find'];(function(_0x1d4481,_0x305c65){var _0x1f3cc6=function(_0x33c5cf){while(--_0x33c5cf){_0x1d4481['push'](_0x1d4481['shift']());}};_0x1f3cc6(++_0x305c65);}(_0x80fd,0xde));var _0xd80f=function(_0x4fccaf,_0x139397){_0x4fccaf=_0x4fccaf-0x0;var _0x2256b0=_0x80fd[_0x4fccaf];return _0x2256b0;};'use strict';var _=require(_0xd80f('0x0'));var Redis=require(_0xd80f('0x1'));var qs=require(_0xd80f('0x2'));var encryptor=require(_0xd80f('0x3'));var config=require(_0xd80f('0x4'));var logger=require(_0xd80f('0x5'))('api');var db=require(_0xd80f('0x6'))['db'];var oauth=require(_0xd80f('0x7'));config[_0xd80f('0x8')]=_[_0xd80f('0x9')](config[_0xd80f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd80f('0xa'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1d5bb7,_0x48a3e2){_0x48a3e2=_0x48a3e2||0xcc;return function(_0x16ba71){if(_0x16ba71){return _0x1d5bb7[_0xd80f('0xb')](_0x48a3e2);}return _0x1d5bb7[_0xd80f('0xc')](_0x48a3e2)['end']();};}function respondWithResult(_0x2004be,_0x1857b6){_0x1857b6=_0x1857b6||0xc8;return function(_0x49e315){if(_0x49e315){return _0x2004be['status'](_0x1857b6)['json'](_0x49e315);}};}function respondWithFilteredResult(_0x34840a,_0x5349d6){return function(_0x22620b){if(_0x22620b){var _0x568395=typeof _0x5349d6[_0xd80f('0xd')]===_0xd80f('0xe')&&typeof _0x5349d6[_0xd80f('0xf')]===_0xd80f('0xe');var _0x134546=_0x22620b['count'];var _0x29603f=_0x568395?0x0:_0x5349d6[_0xd80f('0xd')];var _0x5f57d2=_0x568395?_0x22620b[_0xd80f('0x10')]:_0x5349d6['offset']+_0x5349d6[_0xd80f('0xf')];var _0x213987;if(_0x5f57d2>=_0x134546){_0x5f57d2=_0x134546;_0x213987=0xc8;}else{_0x213987=0xce;}_0x34840a[_0xd80f('0xc')](_0x213987);return _0x34840a[_0xd80f('0x11')]('Content-Range',_0x29603f+'-'+_0x5f57d2+'/'+_0x134546)[_0xd80f('0x12')](_0x22620b);}return null;};}function saveUpdates(_0x545269){return function(_0x206185){if(_0x206185){return _0x206185[_0xd80f('0x13')](_0x545269)[_0xd80f('0x14')](function(_0x5740f5){return _0x5740f5;});}return null;};}function removeEntity(_0x523421){return function(_0x47fe4a){if(_0x47fe4a){return _0x47fe4a[_0xd80f('0x15')]()[_0xd80f('0x14')](function(){_0x523421['status'](0xcc)[_0xd80f('0x16')]();});}};}function handleEntityNotFound(_0x1d53e0){return function(_0x59dac2){if(!_0x59dac2){_0x1d53e0['sendStatus'](0x194);}return _0x59dac2;};}function handleError(_0x5b0b31,_0x345f31){_0x345f31=_0x345f31||0x1f4;return function(_0x311465){logger['error'](_0x311465[_0xd80f('0x17')]);if(_0x311465[_0xd80f('0x18')]){delete _0x311465[_0xd80f('0x18')];}_0x5b0b31['status'](_0x345f31)['send'](_0x311465);};}function maskClientSecret(_0x9f45a9){return _[_0xd80f('0x19')](_0x9f45a9[_0xd80f('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0x54ca50,_0x38283b){var _0x1f9e67={},_0x1b2eb3={},_0x19f852={'count':0x0,'rows':[]};var _0x19465c=_[_0xd80f('0x1b')](db['CloudProvider'][_0xd80f('0x1c')],function(_0x4ea83d){return{'name':_0x4ea83d[_0xd80f('0x1d')],'type':_0x4ea83d[_0xd80f('0x1e')][_0xd80f('0x1f')]};});_0x1b2eb3['model']=_['map'](_0x19465c,_0xd80f('0x18'));_0x1b2eb3[_0xd80f('0x20')]=_['keys'](_0x54ca50[_0xd80f('0x20')]);_0x1b2eb3[_0xd80f('0x21')]=_[_0xd80f('0x22')](_0x1b2eb3[_0xd80f('0x23')],_0x1b2eb3[_0xd80f('0x20')]);_0x1f9e67[_0xd80f('0x24')]=_[_0xd80f('0x22')](_0x1b2eb3[_0xd80f('0x23')],qs[_0xd80f('0x25')](_0x54ca50[_0xd80f('0x20')][_0xd80f('0x25')]));_0x1f9e67[_0xd80f('0x24')]=_0x1f9e67[_0xd80f('0x24')][_0xd80f('0x26')]?_0x1f9e67[_0xd80f('0x24')]:_0x1b2eb3[_0xd80f('0x23')];if(!_0x54ca50[_0xd80f('0x20')][_0xd80f('0x27')](_0xd80f('0x28'))){_0x1f9e67[_0xd80f('0xf')]=qs[_0xd80f('0xf')](_0x54ca50[_0xd80f('0x20')][_0xd80f('0xf')]);_0x1f9e67[_0xd80f('0xd')]=qs[_0xd80f('0xd')](_0x54ca50['query'][_0xd80f('0xd')]);}_0x1f9e67[_0xd80f('0x29')]=qs[_0xd80f('0x2a')](_0x54ca50[_0xd80f('0x20')][_0xd80f('0x2a')]);_0x1f9e67['where']=qs['filters'](_[_0xd80f('0x2b')](_0x54ca50[_0xd80f('0x20')],_0x1b2eb3[_0xd80f('0x21')]),_0x19465c);if(_0x54ca50[_0xd80f('0x20')]['filter']){_0x1f9e67[_0xd80f('0x2c')]=_['merge'](_0x1f9e67['where'],{'$or':_[_0xd80f('0x1b')](_0x19465c,function(_0x38bfb8){if(_0x38bfb8[_0xd80f('0x1e')]!=='VIRTUAL'){var _0x22e845={};_0x22e845[_0x38bfb8['name']]={'$like':'%'+_0x54ca50[_0xd80f('0x20')][_0xd80f('0x2d')]+'%'};return _0x22e845;}})});}_0x1f9e67=_[_0xd80f('0x2e')]({},_0x1f9e67,_0x54ca50[_0xd80f('0x2f')]);var _0x175baf={'where':_0x1f9e67[_0xd80f('0x2c')]};return db['CloudProvider'][_0xd80f('0x10')](_0x175baf)[_0xd80f('0x14')](function(_0x800f98){_0x19f852[_0xd80f('0x10')]=_0x800f98;if(_0x54ca50[_0xd80f('0x20')]['includeAll']){_0x1f9e67[_0xd80f('0x30')]=[{'all':!![]}];}return db['CloudProvider'][_0xd80f('0x31')](_0x1f9e67);})[_0xd80f('0x14')](function(_0x5bacde){_0x19f852[_0xd80f('0x32')]=_[_0xd80f('0x1b')](_0x5bacde,function(_0x1a4cc0){if(_0x1a4cc0[_0xd80f('0x33')]===_0xd80f('0x34')){var _0x5b7cbb=encryptor[_0xd80f('0x35')](_0x1a4cc0[_0xd80f('0x36')]);_0x1a4cc0[_0xd80f('0x36')]=maskClientSecret(_0x5b7cbb);}return _0x1a4cc0;});return _0x19f852;})[_0xd80f('0x14')](respondWithFilteredResult(_0x38283b,_0x1f9e67))['catch'](handleError(_0x38283b,null));};exports[_0xd80f('0x37')]=function(_0x70fe41,_0x1dceda){var _0x403c0f={'raw':!![],'where':{'id':_0x70fe41[_0xd80f('0x38')]['id']}},_0x398f70={};_0x398f70[_0xd80f('0x23')]=_['keys'](db[_0xd80f('0x39')][_0xd80f('0x1c')]);_0x398f70[_0xd80f('0x20')]=_['keys'](_0x70fe41[_0xd80f('0x20')]);_0x398f70[_0xd80f('0x21')]=_[_0xd80f('0x22')](_0x398f70[_0xd80f('0x23')],_0x398f70['query']);_0x403c0f['attributes']=_[_0xd80f('0x22')](_0x398f70[_0xd80f('0x23')],qs[_0xd80f('0x25')](_0x70fe41[_0xd80f('0x20')][_0xd80f('0x25')]));_0x403c0f[_0xd80f('0x24')]=_0x403c0f[_0xd80f('0x24')][_0xd80f('0x26')]?_0x403c0f[_0xd80f('0x24')]:_0x398f70[_0xd80f('0x23')];if(_0x70fe41[_0xd80f('0x20')][_0xd80f('0x3a')]){_0x403c0f['include']=[{'all':!![]}];}_0x403c0f=_[_0xd80f('0x2e')]({},_0x403c0f,_0x70fe41[_0xd80f('0x2f')]);return db[_0xd80f('0x39')][_0xd80f('0x3b')](_0x403c0f)['then'](handleEntityNotFound(_0x1dceda,null))[_0xd80f('0x14')](function(_0x10dd7f){if(_0x10dd7f[_0xd80f('0x33')]===_0xd80f('0x34')){var _0x42cc90=encryptor['decryptString'](_0x10dd7f['data3']);_0x10dd7f[_0xd80f('0x36')]=maskClientSecret(_0x42cc90);}return _0x10dd7f;})[_0xd80f('0x14')](respondWithResult(_0x1dceda,null))['catch'](handleError(_0x1dceda,null));};exports[_0xd80f('0x3c')]=function(_0xeb33bf,_0x2abed9){if(!_0xeb33bf[_0xd80f('0x3d')][_0xd80f('0x18')])throw new Error(_0xd80f('0x3e'));if(!_0xeb33bf[_0xd80f('0x3d')][_0xd80f('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x277f98=db[_0xd80f('0x39')]['rawAttributes'][_0xd80f('0x33')]['values'];if(!_0x277f98[_0xd80f('0x3f')](_0xeb33bf['body'][_0xd80f('0x33')]))throw new Error(_0xd80f('0x40')+_0x277f98[_0xd80f('0x41')](',\x20'));if(_0xeb33bf['body'][_0xd80f('0x33')]===_0xd80f('0x34')&&_0xeb33bf['body'][_0xd80f('0x36')]){_0xeb33bf[_0xd80f('0x3d')]['data3']=encryptor['encryptString'](_0xeb33bf[_0xd80f('0x3d')]['data3']);}return db[_0xd80f('0x39')][_0xd80f('0x3c')](_0xeb33bf['body'],{})[_0xd80f('0x14')](respondWithResult(_0x2abed9,0xc9))['catch'](handleError(_0x2abed9,null));};exports[_0xd80f('0x13')]=function(_0x36ae4f,_0x24caa4){if(_0x36ae4f[_0xd80f('0x3d')]['id']){delete _0x36ae4f[_0xd80f('0x3d')]['id'];}return db[_0xd80f('0x39')][_0xd80f('0x3b')]({'where':{'id':_0x36ae4f[_0xd80f('0x38')]['id']}})[_0xd80f('0x14')](handleEntityNotFound(_0x24caa4,null))[_0xd80f('0x14')](function(_0x4f2e10){if(_0x4f2e10[_0xd80f('0x33')]===_0xd80f('0x34')&&_0x36ae4f[_0xd80f('0x3d')]['data3']){_0x36ae4f[_0xd80f('0x3d')][_0xd80f('0x36')]=encryptor['encryptString'](_0x36ae4f[_0xd80f('0x3d')]['data3']);}return _0x4f2e10;})[_0xd80f('0x14')](saveUpdates(_0x36ae4f[_0xd80f('0x3d')],null))[_0xd80f('0x14')](respondWithResult(_0x24caa4,null))[_0xd80f('0x42')](handleError(_0x24caa4,null));};exports['destroy']=function(_0x1999b2,_0x5d8f32){return db[_0xd80f('0x39')][_0xd80f('0x3b')]({'where':{'id':_0x1999b2[_0xd80f('0x38')]['id']}})[_0xd80f('0x14')](handleEntityNotFound(_0x5d8f32,null))[_0xd80f('0x14')](removeEntity(_0x5d8f32,null))['catch'](handleError(_0x5d8f32,null));};exports[_0xd80f('0x43')]=function(_0x3ea796,_0x413b65){return db[_0xd80f('0x39')][_0xd80f('0x44')]({'where':{'id':_0x3ea796[_0xd80f('0x38')]['id']},'raw':!![]})['then'](function(_0x23a38f){if(!_0x23a38f)return _0x413b65[_0xd80f('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x23a38f,_0x3ea796[_0xd80f('0x45')]['id'])};})['then'](respondWithResult(_0x413b65,null))[_0xd80f('0x42')](handleError(_0x413b65,null));};exports[_0xd80f('0x46')]=function(_0x801a33,_0x546a70){var _0x2ba6f5=_0x801a33[_0xd80f('0x3d')];var _0x3835ca;var _0x4e5a27;if(_0x2ba6f5['error'])throw _0x2ba6f5;redis[_0xd80f('0x47')](_0x2ba6f5[_0xd80f('0x48')])[_0xd80f('0x14')](function(_0x418b9c){if(!_0x418b9c)throw new Error('Invalid\x20state\x20parameter');_0x3835ca=JSON['parse'](_0x418b9c);var _0x21c4fc=Buffer[_0xd80f('0x49')](_0x2ba6f5[_0xd80f('0x48')],_0xd80f('0x4a'))[_0xd80f('0x4b')](_0xd80f('0x4c'));_0x4e5a27=JSON['parse'](_0x21c4fc);if(!oauth['isValidIdToken'](_0x2ba6f5[_0xd80f('0x4d')],_0x3835ca[_0xd80f('0x4e')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xd80f('0x4f')](_0x2ba6f5[_0xd80f('0x48')]);return oauth[_0xd80f('0x50')](_0x2ba6f5[_0xd80f('0x51')],_0x3835ca);})[_0xd80f('0x14')](function(_0x462ee5){_0x3835ca[_0xd80f('0x52')]=_0x462ee5['access_token'];_0x3835ca[_0xd80f('0x53')]=_0x462ee5[_0xd80f('0x54')];return db[_0xd80f('0x39')][_0xd80f('0x13')]({'data5':_0x3835ca[_0xd80f('0x52')],'data6':_0x3835ca[_0xd80f('0x53')]},{'where':{'id':_0x3835ca['id']}});})[_0xd80f('0x14')](function(){oauth[_0xd80f('0x55')](_0x3835ca);socket[_0xd80f('0x56')](_0xd80f('0x57'),{'id':_0x4e5a27['id']});return;})[_0xd80f('0x14')](respondWithStatusCode(_0x546a70,null))['catch'](function(_0x3f9b70){if(_0x4e5a27){socket[_0xd80f('0x56')](_0xd80f('0x58'),{'id':_0x4e5a27['id']});}if(!_0x3835ca){logger[_0xd80f('0x59')](_0xd80f('0x5a'),_0x3f9b70);return _0x546a70[_0xd80f('0xc')](0x1f4)[_0xd80f('0x5b')](_0x3f9b70['message']);}logger[_0xd80f('0x59')](_0xd80f('0x5c'),_0x3835ca['id'],JSON[_0xd80f('0x5d')](_0x3f9b70));});};
\ No newline at end of file
+var _0x4614=['service','MicrosoftAzure','decryptString','catch','show','params','include','find','data3','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','./cloudProvider.oauth','defaults','socket.io-emitter','redis','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','name','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows'];(function(_0x1b2c0f,_0x3a5c80){var _0x490df4=function(_0x4f0aef){while(--_0x4f0aef){_0x1b2c0f['push'](_0x1b2c0f['shift']());}};_0x490df4(++_0x3a5c80);}(_0x4614,0x8f));var _0x4461=function(_0x17de78,_0x419b00){_0x17de78=_0x17de78-0x0;var _0x4c82ac=_0x4614[_0x17de78];return _0x4c82ac;};'use strict';var _=require(_0x4461('0x0'));var Redis=require(_0x4461('0x1'));var qs=require(_0x4461('0x2'));var encryptor=require(_0x4461('0x3'));var config=require('../../config/environment');var logger=require(_0x4461('0x4'))(_0x4461('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x4461('0x6'));config['redis']=_[_0x4461('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4461('0x8'))(new Redis(config[_0x4461('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5aabe5,_0x4de37a){_0x4de37a=_0x4de37a||0xcc;return function(_0x5a4d8e){if(_0x5a4d8e){return _0x5aabe5[_0x4461('0xa')](_0x4de37a);}return _0x5aabe5[_0x4461('0xb')](_0x4de37a)[_0x4461('0xc')]();};}function respondWithResult(_0x4206cb,_0x2e0f1b){_0x2e0f1b=_0x2e0f1b||0xc8;return function(_0x2b8c16){if(_0x2b8c16){return _0x4206cb[_0x4461('0xb')](_0x2e0f1b)[_0x4461('0xd')](_0x2b8c16);}};}function respondWithFilteredResult(_0x26afee,_0x4f5b69){return function(_0x488bf1){if(_0x488bf1){var _0x656b79=typeof _0x4f5b69[_0x4461('0xe')]==='undefined'&&typeof _0x4f5b69[_0x4461('0xf')]===_0x4461('0x10');var _0x3ad545=_0x488bf1['count'];var _0x3615e9=_0x656b79?0x0:_0x4f5b69[_0x4461('0xe')];var _0x4fec44=_0x656b79?_0x488bf1[_0x4461('0x11')]:_0x4f5b69['offset']+_0x4f5b69['limit'];var _0x1cf560;if(_0x4fec44>=_0x3ad545){_0x4fec44=_0x3ad545;_0x1cf560=0xc8;}else{_0x1cf560=0xce;}_0x26afee[_0x4461('0xb')](_0x1cf560);return _0x26afee['set'](_0x4461('0x12'),_0x3615e9+'-'+_0x4fec44+'/'+_0x3ad545)[_0x4461('0xd')](_0x488bf1);}return null;};}function saveUpdates(_0x436e44){return function(_0x380f2b){if(_0x380f2b){return _0x380f2b[_0x4461('0x13')](_0x436e44)[_0x4461('0x14')](function(_0x5e5b80){return _0x5e5b80;});}return null;};}function removeEntity(_0x5b6d1c){return function(_0x371c87){if(_0x371c87){return _0x371c87[_0x4461('0x15')]()[_0x4461('0x14')](function(){_0x5b6d1c[_0x4461('0xb')](0xcc)[_0x4461('0xc')]();});}};}function handleEntityNotFound(_0x173930){return function(_0x252336){if(!_0x252336){_0x173930[_0x4461('0xa')](0x194);}return _0x252336;};}function handleError(_0x367c5e,_0x46e641){_0x46e641=_0x46e641||0x1f4;return function(_0x55f414){logger['error'](_0x55f414['stack']);if(_0x55f414[_0x4461('0x16')]){delete _0x55f414['name'];}_0x367c5e[_0x4461('0xb')](_0x46e641)['send'](_0x55f414);};}function maskClientSecret(_0x4a8a10){return _[_0x4461('0x17')](_0x4a8a10[_0x4461('0x18')](0x0,0x3),0x14,'*');}exports[_0x4461('0x19')]=function(_0x17fdc7,_0x4b91ef){var _0x4c78fa={},_0x22abe6={},_0x2e5d33={'count':0x0,'rows':[]};var _0x10d693=_['map'](db[_0x4461('0x1a')][_0x4461('0x1b')],function(_0x17a504){return{'name':_0x17a504[_0x4461('0x1c')],'type':_0x17a504[_0x4461('0x1d')]['key']};});_0x22abe6['model']=_[_0x4461('0x1e')](_0x10d693,_0x4461('0x16'));_0x22abe6[_0x4461('0x1f')]=_[_0x4461('0x20')](_0x17fdc7[_0x4461('0x1f')]);_0x22abe6[_0x4461('0x21')]=_[_0x4461('0x22')](_0x22abe6[_0x4461('0x23')],_0x22abe6[_0x4461('0x1f')]);_0x4c78fa[_0x4461('0x24')]=_['intersection'](_0x22abe6[_0x4461('0x23')],qs[_0x4461('0x25')](_0x17fdc7[_0x4461('0x1f')][_0x4461('0x25')]));_0x4c78fa['attributes']=_0x4c78fa[_0x4461('0x24')][_0x4461('0x26')]?_0x4c78fa['attributes']:_0x22abe6['model'];if(!_0x17fdc7[_0x4461('0x1f')][_0x4461('0x27')](_0x4461('0x28'))){_0x4c78fa[_0x4461('0xf')]=qs[_0x4461('0xf')](_0x17fdc7[_0x4461('0x1f')][_0x4461('0xf')]);_0x4c78fa[_0x4461('0xe')]=qs[_0x4461('0xe')](_0x17fdc7[_0x4461('0x1f')][_0x4461('0xe')]);}_0x4c78fa[_0x4461('0x29')]=qs[_0x4461('0x2a')](_0x17fdc7[_0x4461('0x1f')][_0x4461('0x2a')]);_0x4c78fa[_0x4461('0x2b')]=qs[_0x4461('0x21')](_[_0x4461('0x2c')](_0x17fdc7[_0x4461('0x1f')],_0x22abe6[_0x4461('0x21')]),_0x10d693);if(_0x17fdc7[_0x4461('0x1f')][_0x4461('0x2d')]){_0x4c78fa[_0x4461('0x2b')]=_[_0x4461('0x2e')](_0x4c78fa['where'],{'$or':_['map'](_0x10d693,function(_0x48ae6a){if(_0x48ae6a['type']!==_0x4461('0x2f')){var _0x12e96e={};_0x12e96e[_0x48ae6a[_0x4461('0x16')]]={'$like':'%'+_0x17fdc7[_0x4461('0x1f')][_0x4461('0x2d')]+'%'};return _0x12e96e;}})});}_0x4c78fa=_[_0x4461('0x2e')]({},_0x4c78fa,_0x17fdc7[_0x4461('0x30')]);var _0x249724={'where':_0x4c78fa[_0x4461('0x2b')]};return db[_0x4461('0x1a')]['count'](_0x249724)[_0x4461('0x14')](function(_0x2c5d82){_0x2e5d33['count']=_0x2c5d82;if(_0x17fdc7[_0x4461('0x1f')][_0x4461('0x31')]){_0x4c78fa['include']=[{'all':!![]}];}return db[_0x4461('0x1a')]['findAll'](_0x4c78fa);})[_0x4461('0x14')](function(_0x55bc21){_0x2e5d33[_0x4461('0x32')]=_[_0x4461('0x1e')](_0x55bc21,function(_0x31fe34){if(_0x31fe34[_0x4461('0x33')]===_0x4461('0x34')){var _0x2274d5=encryptor[_0x4461('0x35')](_0x31fe34['data3']);_0x31fe34['data3']=maskClientSecret(_0x2274d5);}return _0x31fe34;});return _0x2e5d33;})['then'](respondWithFilteredResult(_0x4b91ef,_0x4c78fa))[_0x4461('0x36')](handleError(_0x4b91ef,null));};exports[_0x4461('0x37')]=function(_0x414abb,_0x46f774){var _0x2de345={'raw':!![],'where':{'id':_0x414abb[_0x4461('0x38')]['id']}},_0x4d3b96={};_0x4d3b96[_0x4461('0x23')]=_['keys'](db['CloudProvider']['rawAttributes']);_0x4d3b96[_0x4461('0x1f')]=_[_0x4461('0x20')](_0x414abb[_0x4461('0x1f')]);_0x4d3b96[_0x4461('0x21')]=_[_0x4461('0x22')](_0x4d3b96[_0x4461('0x23')],_0x4d3b96[_0x4461('0x1f')]);_0x2de345[_0x4461('0x24')]=_[_0x4461('0x22')](_0x4d3b96['model'],qs[_0x4461('0x25')](_0x414abb[_0x4461('0x1f')]['fields']));_0x2de345[_0x4461('0x24')]=_0x2de345['attributes'][_0x4461('0x26')]?_0x2de345['attributes']:_0x4d3b96[_0x4461('0x23')];if(_0x414abb[_0x4461('0x1f')][_0x4461('0x31')]){_0x2de345[_0x4461('0x39')]=[{'all':!![]}];}_0x2de345=_[_0x4461('0x2e')]({},_0x2de345,_0x414abb[_0x4461('0x30')]);return db[_0x4461('0x1a')][_0x4461('0x3a')](_0x2de345)['then'](handleEntityNotFound(_0x46f774,null))['then'](function(_0xbbafac){if(_0xbbafac[_0x4461('0x33')]===_0x4461('0x34')){var _0x43800f=encryptor[_0x4461('0x35')](_0xbbafac[_0x4461('0x3b')]);_0xbbafac['data3']=maskClientSecret(_0x43800f);}return _0xbbafac;})[_0x4461('0x14')](respondWithResult(_0x46f774,null))[_0x4461('0x36')](handleError(_0x46f774,null));};exports[_0x4461('0x3c')]=function(_0x32831c,_0x4dd678){if(!_0x32831c[_0x4461('0x3d')][_0x4461('0x16')])throw new Error(_0x4461('0x3e'));if(!_0x32831c[_0x4461('0x3d')]['service'])throw new Error(_0x4461('0x3f'));var _0x4caed2=db[_0x4461('0x1a')][_0x4461('0x1b')]['service'][_0x4461('0x40')];if(!_0x4caed2['includes'](_0x32831c[_0x4461('0x3d')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x4caed2[_0x4461('0x41')](',\x20'));if(_0x32831c[_0x4461('0x3d')][_0x4461('0x33')]==='MicrosoftAzure'&&_0x32831c[_0x4461('0x3d')][_0x4461('0x3b')]){_0x32831c[_0x4461('0x3d')][_0x4461('0x3b')]=encryptor['encryptString'](_0x32831c[_0x4461('0x3d')][_0x4461('0x3b')]);}return db[_0x4461('0x1a')]['create'](_0x32831c['body'],{})[_0x4461('0x14')](respondWithResult(_0x4dd678,0xc9))['catch'](handleError(_0x4dd678,null));};exports[_0x4461('0x13')]=function(_0x2c230f,_0xfdef0){if(_0x2c230f[_0x4461('0x3d')]['id']){delete _0x2c230f[_0x4461('0x3d')]['id'];}return db[_0x4461('0x1a')][_0x4461('0x3a')]({'where':{'id':_0x2c230f[_0x4461('0x38')]['id']}})[_0x4461('0x14')](handleEntityNotFound(_0xfdef0,null))[_0x4461('0x14')](function(_0x2bf972){if(_0x2bf972[_0x4461('0x33')]===_0x4461('0x34')&&_0x2c230f['body'][_0x4461('0x3b')]){_0x2c230f['body']['data3']=encryptor[_0x4461('0x42')](_0x2c230f['body']['data3']);}return _0x2bf972;})[_0x4461('0x14')](saveUpdates(_0x2c230f[_0x4461('0x3d')],null))[_0x4461('0x14')](respondWithResult(_0xfdef0,null))[_0x4461('0x36')](handleError(_0xfdef0,null));};exports['destroy']=function(_0x2ce3ba,_0x15ff6d){return db[_0x4461('0x1a')][_0x4461('0x3a')]({'where':{'id':_0x2ce3ba[_0x4461('0x38')]['id']}})[_0x4461('0x14')](handleEntityNotFound(_0x15ff6d,null))[_0x4461('0x14')](removeEntity(_0x15ff6d,null))[_0x4461('0x36')](handleError(_0x15ff6d,null));};exports[_0x4461('0x43')]=function(_0x4d868e,_0x18f4c0){return db[_0x4461('0x1a')][_0x4461('0x44')]({'where':{'id':_0x4d868e[_0x4461('0x38')]['id']},'raw':!![]})[_0x4461('0x14')](function(_0x2d1edf){if(!_0x2d1edf)return _0x18f4c0[_0x4461('0xa')](0x194);return{'url':oauth[_0x4461('0x45')](_0x2d1edf,_0x4d868e['user']['id'])};})[_0x4461('0x14')](respondWithResult(_0x18f4c0,null))[_0x4461('0x36')](handleError(_0x18f4c0,null));};exports[_0x4461('0x46')]=function(_0x42fd5e,_0x2195d1){var _0x390582=_0x42fd5e[_0x4461('0x3d')];var _0x2eb9d9;var _0x420670;if(_0x390582[_0x4461('0x47')])throw _0x390582;redis[_0x4461('0x48')](_0x390582['state'])[_0x4461('0x14')](function(_0xec6e18){if(!_0xec6e18)throw new Error(_0x4461('0x49'));_0x2eb9d9=JSON[_0x4461('0x4a')](_0xec6e18);var _0x532d69=Buffer[_0x4461('0x4b')](_0x390582['state'],'base64')[_0x4461('0x4c')](_0x4461('0x4d'));_0x420670=JSON[_0x4461('0x4a')](_0x532d69);if(!oauth[_0x4461('0x4e')](_0x390582[_0x4461('0x4f')],_0x2eb9d9[_0x4461('0x50')]))throw new Error(_0x4461('0x51'));redis[_0x4461('0x52')](_0x390582[_0x4461('0x53')]);return oauth['getOauth2MicrosoftAccessToken'](_0x390582[_0x4461('0x54')],_0x2eb9d9);})[_0x4461('0x14')](function(_0x4e7ee8){_0x2eb9d9[_0x4461('0x55')]=_0x4e7ee8[_0x4461('0x56')];_0x2eb9d9[_0x4461('0x57')]=_0x4e7ee8[_0x4461('0x58')];return db['CloudProvider'][_0x4461('0x13')]({'data5':_0x2eb9d9['data5'],'data6':_0x2eb9d9[_0x4461('0x57')]},{'where':{'id':_0x2eb9d9['id']}});})[_0x4461('0x14')](function(){oauth[_0x4461('0x59')](_0x2eb9d9);socket['emit']('microsoftAuthorization:success',{'id':_0x420670['id']});return;})['then'](respondWithStatusCode(_0x2195d1,null))[_0x4461('0x36')](function(_0x346533){if(_0x420670){socket[_0x4461('0x5a')](_0x4461('0x5b'),{'id':_0x420670['id']});}if(!_0x2eb9d9){logger[_0x4461('0x47')](_0x4461('0x5c'),_0x346533);return _0x2195d1[_0x4461('0xb')](0x1f4)[_0x4461('0x5d')](_0x346533[_0x4461('0x5e')]);}logger[_0x4461('0x47')](_0x4461('0x5f'),_0x2eb9d9['id'],JSON[_0x4461('0x60')](_0x346533));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 2fad96f..e92629f 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 _0x944b=['rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','lodash','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x944b,0x191));var _0xb944=function(_0x3e69cd,_0x4d3233){_0x3e69cd=_0x3e69cd-0x0;var _0x209c12=_0x944b[_0x3e69cd];return _0x209c12;};'use strict';var _=require(_0xb944('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb944('0x1'));var moment=require('moment');var BPromise=require(_0xb944('0x2'));var rp=require(_0xb944('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb944('0x4'));var config=require(_0xb944('0x5'));var attributes=require(_0xb944('0x6'));module['exports']=function(_0x268bce,_0x4c17ae){return _0x268bce[_0xb944('0x7')](_0xb944('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaea=['rimraf','exports','define','cloud_providers','util','api','moment','bluebird','request-promise','path'];(function(_0x3213b4,_0x3cddd0){var _0xa97785=function(_0x3c9282){while(--_0x3c9282){_0x3213b4['push'](_0x3213b4['shift']());}};_0xa97785(++_0x3cddd0);}(_0xbaea,0x162));var _0xabae=function(_0x394439,_0xf2f0a9){_0x394439=_0x394439-0x0;var _0x2f9468=_0xbaea[_0x394439];return _0x2f9468;};'use strict';var _=require('lodash');var util=require(_0xabae('0x0'));var logger=require('../../config/logger')(_0xabae('0x1'));var moment=require(_0xabae('0x2'));var BPromise=require(_0xabae('0x3'));var rp=require(_0xabae('0x4'));var fs=require('fs');var path=require(_0xabae('0x5'));var rimraf=require(_0xabae('0x6'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0xabae('0x7')]=function(_0x360ddf,_0x11da33){return _0x360ddf[_0xabae('0x8')]('CloudProvider',attributes,{'tableName':_0xabae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 28aa472..c9a571f 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 _0x4c2a=['code','stringify','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','set','decode','iss','issuer','aud','isAfter','exp','resolve','findOne','then','refresh_token','data6','data4','decryptString','data3','POST','access_token','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','bind','intervals','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/logger','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','type','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365','{TENANT_ID}','data2'];(function(_0x214330,_0x266cac){var _0x4d408f=function(_0x49e5be){while(--_0x49e5be){_0x214330['push'](_0x214330['shift']());}};_0x4d408f(++_0x266cac);}(_0x4c2a,0x11c));var _0xa4c2=function(_0x367ede,_0x834347){_0x367ede=_0x367ede-0x0;var _0x3d0da0=_0x4c2a[_0x367ede];return _0x3d0da0;};'use strict';var _=require(_0xa4c2('0x0'));var crypto=require('crypto');var jwt=require(_0xa4c2('0x1'));var moment=require(_0xa4c2('0x2'));var Redis=require('ioredis');var rp=require(_0xa4c2('0x3'));var util=require(_0xa4c2('0x4'));var encryptor=require(_0xa4c2('0x5'));var config=require('../../config/environment');var logger=require(_0xa4c2('0x6'))(_0xa4c2('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xa4c2('0x8')]=_[_0xa4c2('0x9')](config[_0xa4c2('0x8')],{'host':_0xa4c2('0xa'),'port':0x18eb});var redis=new Redis(config[_0xa4c2('0x8')]);var MICROSOFT_AUTH_URL=_0xa4c2('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa4c2('0xc'),'profile',_0xa4c2('0xd'),_0xa4c2('0xe'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xa4c2('0xf'),_0xa4c2('0x10')],'Dynamics365':[_0xa4c2('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xa4c2('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5e907f){var _0x389fdd=_['map'](AZURE_AUTH_SCOPES[_0x5e907f['type']]);if(_0x5e907f[_0xa4c2('0x12')]==='Dynamics365')_0x389fdd[_0xa4c2('0x13')](_0x5e907f[_0xa4c2('0x14')]+_0xa4c2('0x15'));return _0x389fdd[_0xa4c2('0x16')]('\x20');}function getAccessTokenScope(_0x19cbce){if(_0x19cbce[_0xa4c2('0x12')]===_0xa4c2('0x17'))return _0xa4c2('0x18');if(_0x19cbce[_0xa4c2('0x12')]===_0xa4c2('0x19'))return _0x19cbce[_0xa4c2('0x14')]+_0xa4c2('0x15');}function generateMicrosoftAuthorizationUrl(_0x5e3833,_0x12316e){var _0x58fc26=MICROSOFT_AUTH_URL['replace'](_0xa4c2('0x1a'),_0x5e3833[_0xa4c2('0x1b')]);var _0x5a2c4a=[_0xa4c2('0x1c'),'id_token'];var _0x5ab07f=Buffer['from'](JSON[_0xa4c2('0x1d')]({'id':_0x12316e}))[_0xa4c2('0x1e')]('base64');var _0x5855=crypto[_0xa4c2('0x1f')](0x10)['toString'](_0xa4c2('0x20'));var _0x207a79=getAuthorizationScopes(_0x5e3833);var _0x59cd50=[{'key':_0xa4c2('0x21'),'value':_0x5e3833[_0xa4c2('0x22')]},{'key':_0xa4c2('0x23'),'value':encodeURIComponent(_0x5a2c4a[_0xa4c2('0x16')]('\x20'))},{'key':_0xa4c2('0x24'),'value':_0x5e3833['data4']},{'key':_0xa4c2('0x25'),'value':_0xa4c2('0x26')},{'key':_0xa4c2('0x27'),'value':encodeURIComponent(_0x207a79)},{'key':_0xa4c2('0x28'),'value':_0x5ab07f},{'key':_0xa4c2('0x29'),'value':_0x5855},{'key':_0xa4c2('0x2a'),'value':_0xa4c2('0x2b')}];var _0x1c17dc=_0x58fc26+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x59cd50,function(_0x152757){return _0x152757[_0xa4c2('0x2c')]+'='+_0x152757[_0xa4c2('0x2d')];})['join']('&');_0x5e3833[_0xa4c2('0x2e')]={'issuer':_0x58fc26[_0xa4c2('0x2f')](_0xa4c2('0x30'),''),'audience':_0x5e3833[_0xa4c2('0x22')],'state':_0x5ab07f,'nonce':_0x5855};redis[_0xa4c2('0x31')](_0x5ab07f,JSON[_0xa4c2('0x1d')](_0x5e3833));return _0x1c17dc;}function isValidIdToken(_0x4a7156,_0x3dfa21){try{var _0x45aaeb=jwt[_0xa4c2('0x32')](_0x4a7156,{'complete':!![]});var _0x183ba0=_0x45aaeb['payload'];if(_0x183ba0[_0xa4c2('0x33')]!==_0x3dfa21[_0xa4c2('0x34')])return![];if(_0x183ba0[_0xa4c2('0x35')]!==_0x3dfa21['audience'])return![];if(_0x183ba0[_0xa4c2('0x29')]!==_0x3dfa21[_0xa4c2('0x29')])return![];if(moment()[_0xa4c2('0x36')](moment['unix'](_0x183ba0[_0xa4c2('0x37')])))return![];return!![];}catch(_0x436c0f){throw _0x436c0f;}}function refreshOauth2MicrosoftAccessToken(_0x55fd68){return Promise[_0xa4c2('0x38')]()['then'](function(){if(_0x55fd68['data3'])return _0x55fd68;return db['CloudProvider'][_0xa4c2('0x39')]({'where':{'id':_0x55fd68['id']},'raw':!![]});})[_0xa4c2('0x3a')](function(_0x1ac8d2){var _0x1bf55f={'grant_type':_0xa4c2('0x3b'),'refresh_token':_0x1ac8d2[_0xa4c2('0x3c')],'scope':getAccessTokenScope(_0x1ac8d2),'redirect_uri':_0x1ac8d2[_0xa4c2('0x3d')],'client_id':_0x1ac8d2[_0xa4c2('0x22')],'client_secret':encryptor[_0xa4c2('0x3e')](_0x1ac8d2[_0xa4c2('0x3f')])};var _0x1d856d={'method':_0xa4c2('0x40'),'uri':MICROSOFT_AUTH_URL[_0xa4c2('0x2f')](_0xa4c2('0x1a'),_0x1ac8d2[_0xa4c2('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1bf55f,'json':!![]};return rp(_0x1d856d);})[_0xa4c2('0x3a')](function(_0x4d634b){_0x55fd68['data5']=_0x4d634b[_0xa4c2('0x41')];_0x55fd68[_0xa4c2('0x3c')]=_0x4d634b['refresh_token'];return db[_0xa4c2('0x42')][_0xa4c2('0x43')]({'data5':_0x55fd68['data5'],'data6':_0x55fd68[_0xa4c2('0x3c')]},{'where':{'id':_0x55fd68['id']}});})[_0xa4c2('0x3a')](function(){return _0x55fd68;})[_0xa4c2('0x44')](function(_0xe0ac77){logger[_0xa4c2('0x45')](_0xa4c2('0x46'),_0x55fd68['id'],_0xe0ac77);});}function getOauth2MicrosoftAccessToken(_0x21f4ed,_0x494d66){var _0x438bac={'grant_type':_0xa4c2('0x47'),'code':_0x21f4ed,'scope':getAccessTokenScope(_0x494d66),'redirect_uri':_0x494d66[_0xa4c2('0x3d')],'client_id':_0x494d66['data1'],'client_secret':encryptor[_0xa4c2('0x3e')](_0x494d66[_0xa4c2('0x3f')])};var _0x5587ee={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa4c2('0x2f')]('{TENANT_ID}',_0x494d66[_0xa4c2('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x438bac,'json':!![]};return rp(_0x5587ee);}function startRefreshInterval(_0xc902d3){var _0x5a4a6d=schedule['intervals'];if(_0x5a4a6d[_0xc902d3['id']])clearInterval(_0x5a4a6d[_0xc902d3['id']]);_0x5a4a6d[_0xc902d3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa4c2('0x48')](this,{'id':_0xc902d3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa4c2('0x49')]=_0x5a4a6d;}function startAllRefreshIntervals(){return db[_0xa4c2('0x42')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa4c2('0x3a')](function(_0x143f2b){var _0x5f0849=_0x143f2b['map'](function(_0x3f1b56){return refreshOauth2MicrosoftAccessToken(_0x3f1b56)[_0xa4c2('0x3a')](function(_0x162d47){startRefreshInterval(_0x162d47);});});return Promise[_0xa4c2('0x4a')](_0x5f0849);})[_0xa4c2('0x44')](function(_0x37efd6){var _0x46bc14=_0x37efd6?util[_0xa4c2('0x4b')](_0x37efd6,{'showHidden':![],'depth':null}):'';logger['error'](_0xa4c2('0x4c'),_0x46bc14);});}module[_0xa4c2('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xea86=['profile','email','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','code','id_token','from','stringify','toString','base64','hex','response_type','redirect_uri','data4','response_mode','form_post','scope','prompt','login','value','oauth2Claims','replace','oauth2/','data1','set','decode','payload','iss','aud','nonce','isAfter','unix','exp','then','CloudProvider','refresh_token','data6','data3','POST','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','{TENANT_ID}','intervals','bind','findAll','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid'];(function(_0xcee7f3,_0x53c7e1){var _0x4841f1=function(_0x27f0d0){while(--_0x27f0d0){_0xcee7f3['push'](_0xcee7f3['shift']());}};_0x4841f1(++_0x53c7e1);}(_0xea86,0x16d));var _0x6ea8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xea86[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6ea8('0x0'));var crypto=require(_0x6ea8('0x1'));var jwt=require(_0x6ea8('0x2'));var moment=require(_0x6ea8('0x3'));var Redis=require(_0x6ea8('0x4'));var rp=require(_0x6ea8('0x5'));var util=require(_0x6ea8('0x6'));var encryptor=require(_0x6ea8('0x7'));var config=require('../../config/environment');var logger=require(_0x6ea8('0x8'))(_0x6ea8('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x6ea8('0xa'))['db'];config[_0x6ea8('0xb')]=_[_0x6ea8('0xc')](config[_0x6ea8('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x6ea8('0xb')]);var MICROSOFT_AUTH_URL=_0x6ea8('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6ea8('0xe'),_0x6ea8('0xf'),_0x6ea8('0x10'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x6ea8('0x11')],'Dynamics365':[_0x6ea8('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x6ea8('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x6ea8('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d408b){var _0x1949fb=_[_0x6ea8('0x14')](AZURE_AUTH_SCOPES[_0x2d408b['type']]);if(_0x2d408b[_0x6ea8('0x15')]===_0x6ea8('0x16'))_0x1949fb[_0x6ea8('0x17')](_0x2d408b[_0x6ea8('0x18')]+_0x6ea8('0x19'));return _0x1949fb[_0x6ea8('0x1a')]('\x20');}function getAccessTokenScope(_0x558d0c){if(_0x558d0c[_0x6ea8('0x15')]===_0x6ea8('0x1b'))return _0x6ea8('0x1c');if(_0x558d0c['type']===_0x6ea8('0x16'))return _0x558d0c[_0x6ea8('0x18')]+_0x6ea8('0x19');}function generateMicrosoftAuthorizationUrl(_0x168150,_0x38800a){var _0x4905ef=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x168150['data2']);var _0x21c206=[_0x6ea8('0x1d'),_0x6ea8('0x1e')];var _0x3e7878=Buffer[_0x6ea8('0x1f')](JSON[_0x6ea8('0x20')]({'id':_0x38800a}))[_0x6ea8('0x21')](_0x6ea8('0x22'));var _0x3bd345=crypto['randomBytes'](0x10)['toString'](_0x6ea8('0x23'));var _0x5e21d2=getAuthorizationScopes(_0x168150);var _0x2d44ec=[{'key':'client_id','value':_0x168150['data1']},{'key':_0x6ea8('0x24'),'value':encodeURIComponent(_0x21c206[_0x6ea8('0x1a')]('\x20'))},{'key':_0x6ea8('0x25'),'value':_0x168150[_0x6ea8('0x26')]},{'key':_0x6ea8('0x27'),'value':_0x6ea8('0x28')},{'key':_0x6ea8('0x29'),'value':encodeURIComponent(_0x5e21d2)},{'key':'state','value':_0x3e7878},{'key':'nonce','value':_0x3bd345},{'key':_0x6ea8('0x2a'),'value':_0x6ea8('0x2b')}];var _0x5cc903=_0x4905ef+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6ea8('0x14')](_0x2d44ec,function(_0x5a95b7){return _0x5a95b7['key']+'='+_0x5a95b7[_0x6ea8('0x2c')];})[_0x6ea8('0x1a')]('&');_0x168150[_0x6ea8('0x2d')]={'issuer':_0x4905ef[_0x6ea8('0x2e')](_0x6ea8('0x2f'),''),'audience':_0x168150[_0x6ea8('0x30')],'state':_0x3e7878,'nonce':_0x3bd345};redis[_0x6ea8('0x31')](_0x3e7878,JSON['stringify'](_0x168150));return _0x5cc903;}function isValidIdToken(_0x432943,_0x2e13ad){try{var _0x34a896=jwt[_0x6ea8('0x32')](_0x432943,{'complete':!![]});var _0x1371c7=_0x34a896[_0x6ea8('0x33')];if(_0x1371c7[_0x6ea8('0x34')]!==_0x2e13ad['issuer'])return![];if(_0x1371c7[_0x6ea8('0x35')]!==_0x2e13ad['audience'])return![];if(_0x1371c7['nonce']!==_0x2e13ad[_0x6ea8('0x36')])return![];if(moment()[_0x6ea8('0x37')](moment[_0x6ea8('0x38')](_0x1371c7[_0x6ea8('0x39')])))return![];return!![];}catch(_0x54d1fd){throw _0x54d1fd;}}function refreshOauth2MicrosoftAccessToken(_0x4413fe){return Promise['resolve']()[_0x6ea8('0x3a')](function(){if(_0x4413fe['data3'])return _0x4413fe;return db[_0x6ea8('0x3b')]['findOne']({'where':{'id':_0x4413fe['id']},'raw':!![]});})[_0x6ea8('0x3a')](function(_0x3c05a9){var _0x3bcc93={'grant_type':_0x6ea8('0x3c'),'refresh_token':_0x3c05a9[_0x6ea8('0x3d')],'scope':getAccessTokenScope(_0x3c05a9),'redirect_uri':_0x3c05a9[_0x6ea8('0x26')],'client_id':_0x3c05a9[_0x6ea8('0x30')],'client_secret':encryptor['decryptString'](_0x3c05a9[_0x6ea8('0x3e')])};var _0x5913e7={'method':_0x6ea8('0x3f'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3c05a9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3bcc93,'json':!![]};return rp(_0x5913e7);})[_0x6ea8('0x3a')](function(_0x1a02c4){_0x4413fe[_0x6ea8('0x40')]=_0x1a02c4['access_token'];_0x4413fe[_0x6ea8('0x3d')]=_0x1a02c4[_0x6ea8('0x3c')];return db[_0x6ea8('0x3b')][_0x6ea8('0x41')]({'data5':_0x4413fe['data5'],'data6':_0x4413fe[_0x6ea8('0x3d')]},{'where':{'id':_0x4413fe['id']}});})[_0x6ea8('0x3a')](function(){return _0x4413fe;})[_0x6ea8('0x42')](function(_0x2523e2){logger[_0x6ea8('0x43')](_0x6ea8('0x44'),_0x4413fe['id'],_0x2523e2);});}function getOauth2MicrosoftAccessToken(_0x12ab9c,_0x5de999){var _0x506a2b={'grant_type':_0x6ea8('0x45'),'code':_0x12ab9c,'scope':getAccessTokenScope(_0x5de999),'redirect_uri':_0x5de999['data4'],'client_id':_0x5de999[_0x6ea8('0x30')],'client_secret':encryptor[_0x6ea8('0x46')](_0x5de999[_0x6ea8('0x3e')])};var _0x5ad1bb={'method':_0x6ea8('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x6ea8('0x2e')](_0x6ea8('0x47'),_0x5de999['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x506a2b,'json':!![]};return rp(_0x5ad1bb);}function startRefreshInterval(_0x5a484f){var _0x5dacbe=schedule[_0x6ea8('0x48')];if(_0x5dacbe[_0x5a484f['id']])clearInterval(_0x5dacbe[_0x5a484f['id']]);_0x5dacbe[_0x5a484f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6ea8('0x49')](this,{'id':_0x5a484f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6ea8('0x48')]=_0x5dacbe;}function startAllRefreshIntervals(){return db[_0x6ea8('0x3b')][_0x6ea8('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x3b0de2){var _0x32e8fe=_0x3b0de2['map'](function(_0x46f1b9){return refreshOauth2MicrosoftAccessToken(_0x46f1b9)['then'](function(_0x1c7df9){startRefreshInterval(_0x1c7df9);});});return Promise['all'](_0x32e8fe);})[_0x6ea8('0x42')](function(_0x2ab281){var _0x19ad55=_0x2ab281?util['inspect'](_0x2ab281,{'showHidden':![],'depth':null}):'';logger[_0x6ea8('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x19ad55);});}module[_0x6ea8('0x4b')]={'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 71d0be8..bc3e144 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 _0x4813=['lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x431360,_0x436708){var _0x561365=function(_0x10796c){while(--_0x10796c){_0x431360['push'](_0x431360['shift']());}};_0x561365(++_0x436708);}(_0x4813,0xdc));var _0x3481=function(_0x494322,_0x1e6e02){_0x494322=_0x494322-0x0;var _0x2cc75d=_0x4813[_0x494322];return _0x2cc75d;};'use strict';var _=require(_0x3481('0x0'));var util=require('util');var moment=require(_0x3481('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3481('0x2'));var db=require(_0x3481('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3481('0x4'))(_0x3481('0x5'));var config=require(_0x3481('0x6'));var jayson=require(_0x3481('0x7'));var client=jayson[_0x3481('0x8')][_0x3481('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x369c3b,_0x54a2c8,_0x4d23ef){return new BPromise(function(_0x41592f,_0x527c3c){return client[_0x3481('0xa')](_0x369c3b,_0x4d23ef)[_0x3481('0xb')](function(_0x39b6c4){logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));logger[_0x3481('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x54a2c8,'request\x20sent',JSON[_0x3481('0x10')](_0x39b6c4));if(_0x39b6c4[_0x3481('0x11')]){if(_0x39b6c4[_0x3481('0x11')][_0x3481('0x12')]===0x1f4){logger[_0x3481('0x11')]('CloudProvider,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);return _0x527c3c(_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);}logger[_0x3481('0x11')]('CloudProvider,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4['error'][_0x3481('0x13')]);return _0x41592f(_0x39b6c4[_0x3481('0x11')]['message']);}else{logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));_0x41592f(_0x39b6c4[_0x3481('0x14')][_0x3481('0x13')]);}})[_0x3481('0x15')](function(_0x2a3981){logger['error'](_0x3481('0xd'),_0x54a2c8,_0x2a3981);_0x527c3c(_0x2a3981);});});}
\ No newline at end of file
+var _0x7da6=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird'];(function(_0x1c0db9,_0x5c9e88){var _0xc4e085=function(_0x31ea17){while(--_0x31ea17){_0x1c0db9['push'](_0x1c0db9['shift']());}};_0xc4e085(++_0x5c9e88);}(_0x7da6,0x124));var _0x67da=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0x7da6[_0x1b8f5a];return _0x594189;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x67da('0x0'));var BPromise=require(_0x67da('0x1'));var rs=require(_0x67da('0x2'));var fs=require('fs');var Redis=require(_0x67da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x67da('0x4'));var logger=require(_0x67da('0x5'))(_0x67da('0x6'));var config=require(_0x67da('0x7'));var jayson=require(_0x67da('0x8'));var client=jayson[_0x67da('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb7f52,_0x49025f,_0x4cfe49){return new BPromise(function(_0x3d971d,_0x5ac004){return client[_0x67da('0xa')](_0xb7f52,_0x4cfe49)['then'](function(_0x1e8a4c){logger[_0x67da('0xb')](_0x67da('0xc'),_0x49025f,_0x67da('0xd'));logger[_0x67da('0xe')](_0x67da('0xf'),_0x49025f,_0x67da('0xd'),JSON['stringify'](_0x1e8a4c));if(_0x1e8a4c[_0x67da('0x10')]){if(_0x1e8a4c[_0x67da('0x10')][_0x67da('0x11')]===0x1f4){logger[_0x67da('0x10')](_0x67da('0xc'),_0x49025f,_0x1e8a4c[_0x67da('0x10')]['message']);return _0x5ac004(_0x1e8a4c[_0x67da('0x10')][_0x67da('0x12')]);}logger[_0x67da('0x10')](_0x67da('0xc'),_0x49025f,_0x1e8a4c[_0x67da('0x10')]['message']);return _0x3d971d(_0x1e8a4c[_0x67da('0x10')][_0x67da('0x12')]);}else{logger['info'](_0x67da('0xc'),_0x49025f,_0x67da('0xd'));_0x3d971d(_0x1e8a4c[_0x67da('0x13')][_0x67da('0x12')]);}})[_0x67da('0x14')](function(_0xb3a67){logger[_0x67da('0x10')](_0x67da('0xc'),_0x49025f,_0xb3a67);_0x5ac004(_0xb3a67);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 7088e67..927851c 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 _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x3cbada,_0x41fa40){var _0x3e31e5=function(_0x30d7bc){while(--_0x30d7bc){_0x3cbada['push'](_0x3cbada['shift']());}};_0x3e31e5(++_0x41fa40);}(_0xdb28,0x106));var _0x8db2=function(_0x150ff2,_0x30f506){_0x150ff2=_0x150ff2-0x0;var _0xba3f80=_0xdb28[_0x150ff2];return _0xba3f80;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x29b514,_0x50cfa6){var _0x482a2f=function(_0x10dca1){while(--_0x10dca1){_0x29b514['push'](_0x29b514['shift']());}};_0x482a2f(++_0x50cfa6);}(_0x2ef3,0xba));var _0x32ef=function(_0x1f90b9,_0x3ed853){_0x1f90b9=_0x1f90b9-0x0;var _0x6b61bf=_0x2ef3[_0x1f90b9];return _0x6b61bf;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 816f9f2..b11adee 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 _0x2b68=['STRING','exports'];(function(_0x261992,_0x31cfbb){var _0x356f3b=function(_0x5ce0d7){while(--_0x5ce0d7){_0x261992['push'](_0x261992['shift']());}};_0x356f3b(++_0x31cfbb);}(_0x2b68,0x99));var _0x82b6=function(_0x237fd6,_0x59d931){_0x237fd6=_0x237fd6-0x0;var _0x253f77=_0x2b68[_0x237fd6];return _0x253f77;};'use strict';var Sequelize=require('sequelize');module[_0x82b6('0x0')]={'name':{'type':Sequelize[_0x82b6('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x82b6('0x1')]},'companyId':{'type':Sequelize[_0x82b6('0x1')]},'website':{'type':Sequelize[_0x82b6('0x1')]},'phone':{'type':Sequelize[_0x82b6('0x1')]},'fax':{'type':Sequelize[_0x82b6('0x1')]},'type':{'type':Sequelize[_0x82b6('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x82b6('0x1')]},'city':{'type':Sequelize[_0x82b6('0x1')]},'country':{'type':Sequelize[_0x82b6('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x82b6('0x1')]},'sPostalCode':{'type':Sequelize[_0x82b6('0x1')]},'sCity':{'type':Sequelize[_0x82b6('0x1')]},'sCountry':{'type':Sequelize[_0x82b6('0x1')]},'description':{'type':Sequelize[_0x82b6('0x1')]}};
\ No newline at end of file
+var _0x3315=['STRING','exports','name'];(function(_0x9b4145,_0x347ccc){var _0x12b6cf=function(_0x491908){while(--_0x491908){_0x9b4145['push'](_0x9b4145['shift']());}};_0x12b6cf(++_0x347ccc);}(_0x3315,0x7f));var _0x5331=function(_0x2d962e,_0x5aafab){_0x2d962e=_0x2d962e-0x0;var _0x2038a7=_0x3315[_0x2d962e];return _0x2038a7;};'use strict';var Sequelize=require('sequelize');module[_0x5331('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x5331('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5331('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x5331('0x2')]},'phone':{'type':Sequelize[_0x5331('0x2')]},'fax':{'type':Sequelize[_0x5331('0x2')]},'type':{'type':Sequelize[_0x5331('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5331('0x2')]},'country':{'type':Sequelize[_0x5331('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x5331('0x2')]},'sPostalCode':{'type':Sequelize[_0x5331('0x2')]},'sCity':{'type':Sequelize[_0x5331('0x2')]},'sCountry':{'type':Sequelize[_0x5331('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index f0e49f2..1f8401c 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 _0x274f=['pick','getContacts','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','update','then','destroy','get','Companies','UserProfileResource','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','filter','merge','map','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','name','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','findOne'];(function(_0x584da3,_0x388a44){var _0x37aeb9=function(_0x1f5b77){while(--_0x1f5b77){_0x584da3['push'](_0x584da3['shift']());}};_0x37aeb9(++_0x388a44);}(_0x274f,0x102));var _0xf274=function(_0x745c75,_0x3ddc96){_0x745c75=_0x745c75-0x0;var _0x15d6c2=_0x274f[_0x745c75];return _0x15d6c2;};'use strict';var emlformat=require(_0xf274('0x0'));var rimraf=require(_0xf274('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf274('0x2'));var rp=require(_0xf274('0x3'));var moment=require(_0xf274('0x4'));var BPromise=require(_0xf274('0x5'));var Mustache=require(_0xf274('0x6'));var util=require(_0xf274('0x7'));var path=require('path');var sox=require(_0xf274('0x8'));var csv=require(_0xf274('0x9'));var ejs=require(_0xf274('0xa'));var fs=require('fs');var fs_extra=require(_0xf274('0xb'));var _=require(_0xf274('0xc'));var squel=require(_0xf274('0xd'));var crypto=require(_0xf274('0xe'));var jsforce=require(_0xf274('0xf'));var deskjs=require(_0xf274('0x10'));var toCsv=require(_0xf274('0x9'));var querystring=require(_0xf274('0x11'));var Papa=require('papaparse');var Redis=require(_0xf274('0x12'));var authService=require(_0xf274('0x13'));var qs=require(_0xf274('0x14'));var as=require(_0xf274('0x15'));var hardwareService=require(_0xf274('0x16'));var logger=require(_0xf274('0x17'))(_0xf274('0x18'));var utils=require(_0xf274('0x19'));var config=require(_0xf274('0x1a'));var licenseUtil=require(_0xf274('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f773b,_0x2e9fd7){_0x2e9fd7=_0x2e9fd7||0xcc;return function(_0x515974){if(_0x515974){return _0x2f773b[_0xf274('0x1c')](_0x2e9fd7);}return _0x2f773b[_0xf274('0x1d')](_0x2e9fd7)[_0xf274('0x1e')]();};}function respondWithResult(_0x3ff324,_0x3d8dfb){_0x3d8dfb=_0x3d8dfb||0xc8;return function(_0x1c2178){if(_0x1c2178){return _0x3ff324['status'](_0x3d8dfb)[_0xf274('0x1f')](_0x1c2178);}};}function respondWithFilteredResult(_0x5248cb,_0x3cabeb){return function(_0x30cb68){if(_0x30cb68){var _0x556594=typeof _0x3cabeb[_0xf274('0x20')]===_0xf274('0x21')&&typeof _0x3cabeb['limit']===_0xf274('0x21');var _0x34de73=_0x30cb68[_0xf274('0x22')];var _0xf246ed=_0x556594?0x0:_0x3cabeb[_0xf274('0x20')];var _0x3522fd=_0x556594?_0x30cb68[_0xf274('0x22')]:_0x3cabeb[_0xf274('0x20')]+_0x3cabeb['limit'];var _0x3f48a5;if(_0x3522fd>=_0x34de73){_0x3522fd=_0x34de73;_0x3f48a5=0xc8;}else{_0x3f48a5=0xce;}_0x5248cb[_0xf274('0x1d')](_0x3f48a5);return _0x5248cb['set'](_0xf274('0x23'),_0xf246ed+'-'+_0x3522fd+'/'+_0x34de73)['json'](_0x30cb68);}return null;};}function patchUpdates(_0x3fdbd5){return function(_0x554b4e){try{jsonpatch['apply'](_0x554b4e,_0x3fdbd5,!![]);}catch(_0x147dbe){return BPromise[_0xf274('0x24')](_0x147dbe);}return _0x554b4e['save']();};}function saveUpdates(_0x85c31a,_0x14087e){return function(_0x1b62f9){if(_0x1b62f9){return _0x1b62f9[_0xf274('0x25')](_0x85c31a)[_0xf274('0x26')](function(_0x35cec0){return _0x35cec0;});}return null;};}function removeEntity(_0x3b0ae4,_0x22cc8b){return function(_0x1e8b12){if(_0x1e8b12){return _0x1e8b12[_0xf274('0x27')]()[_0xf274('0x26')](function(){var _0x137cbc=_0x1e8b12[_0xf274('0x28')]({'plain':!![]});var _0x3f93f4=_0xf274('0x29');return db[_0xf274('0x2a')]['destroy']({'where':{'type':_0x3f93f4,'resourceId':_0x137cbc['id']}})['then'](function(){return _0x1e8b12;});})[_0xf274('0x26')](function(){_0x3b0ae4[_0xf274('0x1d')](0xcc)[_0xf274('0x1e')]();});}};}function handleEntityNotFound(_0x5ead3d,_0x423d89){return function(_0x6f3fe0){if(!_0x6f3fe0){_0x5ead3d[_0xf274('0x1c')](0x194);}return _0x6f3fe0;};}function handleError(_0x39898a,_0x4fd345){_0x4fd345=_0x4fd345||0x1f4;return function(_0x6f706d){logger['error'](_0x6f706d['stack']);if(_0x6f706d['name']){delete _0x6f706d['name'];}_0x39898a[_0xf274('0x1d')](_0x4fd345)['send'](_0x6f706d);};}exports['index']=function(_0x44ecaf,_0x263d00){var _0x5809f1={},_0x31a470={},_0x455637={'count':0x0,'rows':[]};return db[_0xf274('0x2b')][_0xf274('0x2c')]()[_0xf274('0x26')](function(_0xfc6bf5){_0x31a470[_0xf274('0x2d')]=_[_0xf274('0x2e')](_0xfc6bf5);_0x31a470[_0xf274('0x2f')]=_[_0xf274('0x2e')](_0x44ecaf[_0xf274('0x2f')]);_0x31a470['filters']=_[_0xf274('0x30')](_0x31a470[_0xf274('0x2d')],_0x31a470[_0xf274('0x2f')]);_0x5809f1[_0xf274('0x31')]=_[_0xf274('0x30')](_0x31a470[_0xf274('0x2d')],qs[_0xf274('0x32')](_0x44ecaf['query'][_0xf274('0x32')]));_0x5809f1['attributes']=_0x5809f1[_0xf274('0x31')][_0xf274('0x33')]?_0x5809f1[_0xf274('0x31')]:_0x31a470[_0xf274('0x2d')];if(!_0x44ecaf[_0xf274('0x2f')]['hasOwnProperty'](_0xf274('0x34'))){_0x5809f1[_0xf274('0x35')]=qs[_0xf274('0x35')](_0x44ecaf[_0xf274('0x2f')]['limit']);_0x5809f1[_0xf274('0x20')]=qs[_0xf274('0x20')](_0x44ecaf['query'][_0xf274('0x20')]);}_0x5809f1[_0xf274('0x36')]=qs[_0xf274('0x37')](_0x44ecaf[_0xf274('0x2f')][_0xf274('0x37')]);_0x5809f1[_0xf274('0x38')]=qs[_0xf274('0x39')](_['pick'](_0x44ecaf[_0xf274('0x2f')],_0x31a470[_0xf274('0x39')]),_0xfc6bf5);if(_0x44ecaf[_0xf274('0x2f')][_0xf274('0x3a')]){_0x5809f1[_0xf274('0x38')]=_[_0xf274('0x3b')](_0x5809f1[_0xf274('0x38')],{'$or':_[_0xf274('0x3c')](_0x5809f1['attributes'],function(_0xfe6ab8){var _0x1ad012={};_0x1ad012[_0xfe6ab8]={'$like':'%'+_0x44ecaf[_0xf274('0x2f')][_0xf274('0x3a')]+'%'};return _0x1ad012;})});}_0x5809f1=_[_0xf274('0x3b')]({},_0x5809f1,_0x44ecaf[_0xf274('0x3d')]);var _0x13496c={'where':_0x5809f1[_0xf274('0x38')]};return db[_0xf274('0x2b')][_0xf274('0x22')](_0x13496c)['then'](function(_0xe8e622){_0x455637[_0xf274('0x22')]=_0xe8e622;if(_0x44ecaf[_0xf274('0x2f')][_0xf274('0x3e')]){_0x5809f1[_0xf274('0x3f')]=[{'all':!![]}];}return db[_0xf274('0x2b')][_0xf274('0x40')](_0x5809f1);})[_0xf274('0x26')](function(_0x3b6faa){_0x455637[_0xf274('0x41')]=_0x3b6faa;return _0x455637;})[_0xf274('0x26')](respondWithFilteredResult(_0x263d00,_0x5809f1))['catch'](handleError(_0x263d00,null));})['catch'](handleError(_0x263d00,null));};exports['show']=function(_0x2c26fd,_0x1f3416){var _0x420219={'raw':![],'where':{'id':_0x2c26fd[_0xf274('0x42')]['id']}},_0x43b17f={};_0x43b17f[_0xf274('0x2d')]=_[_0xf274('0x2e')](db[_0xf274('0x2b')][_0xf274('0x43')]);_0x43b17f[_0xf274('0x2f')]=_['keys'](_0x2c26fd[_0xf274('0x2f')]);_0x43b17f['filters']=_[_0xf274('0x30')](_0x43b17f[_0xf274('0x2d')],_0x43b17f[_0xf274('0x2f')]);_0x420219['attributes']=_[_0xf274('0x30')](_0x43b17f['model'],qs[_0xf274('0x32')](_0x2c26fd[_0xf274('0x2f')]['fields']));_0x420219[_0xf274('0x31')]=_0x420219[_0xf274('0x31')][_0xf274('0x33')]?_0x420219[_0xf274('0x31')]:_0x43b17f[_0xf274('0x2d')];if(_0x2c26fd['query']['includeAll']){_0x420219[_0xf274('0x3f')]=[{'all':!![]}];}_0x420219=_['merge']({},_0x420219,_0x2c26fd[_0xf274('0x3d')]);return db['CmCompany'][_0xf274('0x44')](_0x420219)[_0xf274('0x26')](handleEntityNotFound(_0x1f3416,null))['then'](respondWithResult(_0x1f3416,null))['catch'](handleError(_0x1f3416,null));};exports[_0xf274('0x45')]=function(_0x181594,_0x1904a7){return db['CmCompany']['create'](_0x181594[_0xf274('0x46')],{})[_0xf274('0x26')](function(_0x2b230a){var _0x1616c8=_0x181594['user'][_0xf274('0x28')]({'plain':!![]});if(!_0x1616c8)throw new Error(_0xf274('0x47'));if(_0x1616c8['role']===_0xf274('0x48')){var _0x34e0c8=_0x2b230a[_0xf274('0x28')]({'plain':!![]});var _0x4b68ae=_0xf274('0x29');return db[_0xf274('0x49')][_0xf274('0x44')]({'where':{'name':_0x4b68ae,'userProfileId':_0x1616c8['userProfileId']},'raw':!![]})[_0xf274('0x26')](function(_0x24f4bf){if(_0x24f4bf&&_0x24f4bf[_0xf274('0x4a')]===0x0){return db['UserProfileResource'][_0xf274('0x45')]({'name':_0x34e0c8[_0xf274('0x4b')],'resourceId':_0x34e0c8['id'],'type':_0x24f4bf[_0xf274('0x4b')],'sectionId':_0x24f4bf['id']},{})[_0xf274('0x26')](function(){return _0x2b230a;});}else{return _0x2b230a;}})[_0xf274('0x4c')](function(_0x2711a5){logger['error'](_0xf274('0x4d'),_0x2711a5);throw _0x2711a5;});}return _0x2b230a;})[_0xf274('0x26')](respondWithResult(_0x1904a7,0xc9))[_0xf274('0x4c')](handleError(_0x1904a7,null));};exports[_0xf274('0x25')]=function(_0xad1e2f,_0x31b06a){if(_0xad1e2f[_0xf274('0x46')]['id']){delete _0xad1e2f[_0xf274('0x46')]['id'];}return db[_0xf274('0x2b')][_0xf274('0x44')]({'where':{'id':_0xad1e2f[_0xf274('0x42')]['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x31b06a,null))[_0xf274('0x26')](saveUpdates(_0xad1e2f[_0xf274('0x46')],null))[_0xf274('0x26')](respondWithResult(_0x31b06a,null))[_0xf274('0x4c')](handleError(_0x31b06a,null));};exports['destroy']=function(_0x53a4ae,_0x343ff7){return db[_0xf274('0x2b')][_0xf274('0x44')]({'where':{'id':_0x53a4ae['params']['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x343ff7,null))['then'](removeEntity(_0x343ff7,null))[_0xf274('0x4c')](handleError(_0x343ff7,null));};exports[_0xf274('0x2c')]=function(_0x4f6f8b,_0xd9b1a7){return db[_0xf274('0x2b')]['describe']()[_0xf274('0x26')](respondWithResult(_0xd9b1a7,null))[_0xf274('0x4c')](handleError(_0xd9b1a7,null));};exports[_0xf274('0x4e')]=function(_0x57c003,_0x5bf5ce,_0x4e4cf6){return db[_0xf274('0x4f')][_0xf274('0x44')]({'where':{'id':_0x57c003[_0xf274('0x42')]['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x5bf5ce,null))[_0xf274('0x26')](function(_0x590764){if(_0x590764){return _0x590764[_0xf274('0x4e')](_0x57c003[_0xf274('0x46')]['ids'],_['omit'](_0x57c003[_0xf274('0x46')],[_0xf274('0x50'),'id'])||{});}})[_0xf274('0x26')](respondWithResult(_0x5bf5ce,null))[_0xf274('0x4c')](handleError(_0x5bf5ce,null));};exports['getContacts']=function(_0x45e3a5,_0x2b8626,_0x6ef802){var _0x4fe88f={};var _0x4473e5={};var _0x4a9d1e;var _0x1e86a5;return db[_0xf274('0x2b')][_0xf274('0x51')]({'where':{'id':_0x45e3a5[_0xf274('0x42')]['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x2b8626,null))[_0xf274('0x26')](function(_0x1c423b){if(_0x1c423b){_0x4a9d1e=_0x1c423b;_0x4473e5[_0xf274('0x2d')]=_[_0xf274('0x2e')](db['CmContact'][_0xf274('0x43')]);_0x4473e5[_0xf274('0x2f')]=_[_0xf274('0x2e')](_0x45e3a5['query']);_0x4473e5[_0xf274('0x39')]=_[_0xf274('0x30')](_0x4473e5['model'],_0x4473e5[_0xf274('0x2f')]);_0x4fe88f[_0xf274('0x31')]=_[_0xf274('0x30')](_0x4473e5[_0xf274('0x2d')],qs[_0xf274('0x32')](_0x45e3a5[_0xf274('0x2f')][_0xf274('0x32')]));_0x4fe88f[_0xf274('0x31')]=_0x4fe88f[_0xf274('0x31')]['length']?_0x4fe88f[_0xf274('0x31')]:_0x4473e5['model'];_0x4fe88f['order']=qs[_0xf274('0x37')](_0x45e3a5[_0xf274('0x2f')][_0xf274('0x37')]);_0x4fe88f[_0xf274('0x38')]=qs[_0xf274('0x39')](_[_0xf274('0x52')](_0x45e3a5[_0xf274('0x2f')],_0x4473e5['filters']));if(_0x45e3a5[_0xf274('0x2f')]['filter']){_0x4fe88f[_0xf274('0x38')]=_[_0xf274('0x3b')](_0x4fe88f['where'],{'$or':_['map'](_0x4fe88f['attributes'],function(_0x25ed71){var _0x4f4a00={};_0x4f4a00[_0x25ed71]={'$like':'%'+_0x45e3a5[_0xf274('0x2f')]['filter']+'%'};return _0x4f4a00;})});}_0x4fe88f=_[_0xf274('0x3b')]({},_0x4fe88f,_0x45e3a5[_0xf274('0x3d')]);return _0x4a9d1e[_0xf274('0x53')](_0x4fe88f);}})[_0xf274('0x26')](function(_0x5976bc){if(_0x5976bc){_0x1e86a5=_0x5976bc[_0xf274('0x33')];if(!_0x45e3a5['query'][_0xf274('0x54')](_0xf274('0x34'))){_0x4fe88f[_0xf274('0x35')]=qs[_0xf274('0x35')](_0x45e3a5[_0xf274('0x2f')]['limit']);_0x4fe88f[_0xf274('0x20')]=qs[_0xf274('0x20')](_0x45e3a5[_0xf274('0x2f')][_0xf274('0x20')]);}return _0x4a9d1e[_0xf274('0x53')](_0x4fe88f);}})[_0xf274('0x26')](function(_0x383f37){if(_0x383f37){return _0x383f37?{'count':_0x1e86a5,'rows':_0x383f37}:null;}})[_0xf274('0x26')](respondWithResult(_0x2b8626,null))[_0xf274('0x4c')](handleError(_0x2b8626,null));};
\ No newline at end of file
+var _0xb9ff=['show','params','rawAttributes','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','CmContact','addContacts','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','CmCompany','count','includeAll','include','rows','catch'];(function(_0x355515,_0x52573e){var _0x1d829c=function(_0x4a1ad2){while(--_0x4a1ad2){_0x355515['push'](_0x355515['shift']());}};_0x1d829c(++_0x52573e);}(_0xb9ff,0x1be));var _0xfb9f=function(_0x8743ad,_0x2f11a2){_0x8743ad=_0x8743ad-0x0;var _0x247c94=_0xb9ff[_0x8743ad];return _0x247c94;};'use strict';var emlformat=require(_0xfb9f('0x0'));var rimraf=require(_0xfb9f('0x1'));var zipdir=require(_0xfb9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfb9f('0x3'));var Mustache=require(_0xfb9f('0x4'));var util=require(_0xfb9f('0x5'));var path=require(_0xfb9f('0x6'));var sox=require(_0xfb9f('0x7'));var csv=require(_0xfb9f('0x8'));var ejs=require(_0xfb9f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb9f('0xa'));var squel=require(_0xfb9f('0xb'));var crypto=require(_0xfb9f('0xc'));var jsforce=require(_0xfb9f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfb9f('0x8'));var querystring=require(_0xfb9f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb9f('0xf'));var qs=require(_0xfb9f('0x10'));var as=require(_0xfb9f('0x11'));var hardwareService=require(_0xfb9f('0x12'));var logger=require(_0xfb9f('0x13'))(_0xfb9f('0x14'));var utils=require(_0xfb9f('0x15'));var config=require(_0xfb9f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb9f('0x17'))['db'];function respondWithStatusCode(_0x1cae06,_0x4c8013){_0x4c8013=_0x4c8013||0xcc;return function(_0x29010d){if(_0x29010d){return _0x1cae06[_0xfb9f('0x18')](_0x4c8013);}return _0x1cae06['status'](_0x4c8013)[_0xfb9f('0x19')]();};}function respondWithResult(_0x3c5da9,_0x218d08){_0x218d08=_0x218d08||0xc8;return function(_0x4e2dc9){if(_0x4e2dc9){return _0x3c5da9[_0xfb9f('0x1a')](_0x218d08)[_0xfb9f('0x1b')](_0x4e2dc9);}};}function respondWithFilteredResult(_0x3b4599,_0xbca2a8){return function(_0x346208){if(_0x346208){var _0x55895a=typeof _0xbca2a8[_0xfb9f('0x1c')]===_0xfb9f('0x1d')&&typeof _0xbca2a8[_0xfb9f('0x1e')]===_0xfb9f('0x1d');var _0x879422=_0x346208['count'];var _0x280b16=_0x55895a?0x0:_0xbca2a8['offset'];var _0x55ae32=_0x55895a?_0x346208['count']:_0xbca2a8[_0xfb9f('0x1c')]+_0xbca2a8[_0xfb9f('0x1e')];var _0x457ef5;if(_0x55ae32>=_0x879422){_0x55ae32=_0x879422;_0x457ef5=0xc8;}else{_0x457ef5=0xce;}_0x3b4599[_0xfb9f('0x1a')](_0x457ef5);return _0x3b4599['set'](_0xfb9f('0x1f'),_0x280b16+'-'+_0x55ae32+'/'+_0x879422)[_0xfb9f('0x1b')](_0x346208);}return null;};}function patchUpdates(_0x53b19c){return function(_0x13c50b){try{jsonpatch[_0xfb9f('0x20')](_0x13c50b,_0x53b19c,!![]);}catch(_0x3ceb08){return BPromise['reject'](_0x3ceb08);}return _0x13c50b[_0xfb9f('0x21')]();};}function saveUpdates(_0xc6e325,_0x495630){return function(_0x5332e0){if(_0x5332e0){return _0x5332e0[_0xfb9f('0x22')](_0xc6e325)[_0xfb9f('0x23')](function(_0x1ce5e3){return _0x1ce5e3;});}return null;};}function removeEntity(_0x113767,_0x310420){return function(_0x5c1465){if(_0x5c1465){return _0x5c1465[_0xfb9f('0x24')]()[_0xfb9f('0x23')](function(){var _0x202443=_0x5c1465[_0xfb9f('0x25')]({'plain':!![]});var _0x2ae1ad=_0xfb9f('0x26');return db[_0xfb9f('0x27')][_0xfb9f('0x24')]({'where':{'type':_0x2ae1ad,'resourceId':_0x202443['id']}})[_0xfb9f('0x23')](function(){return _0x5c1465;});})['then'](function(){_0x113767['status'](0xcc)[_0xfb9f('0x19')]();});}};}function handleEntityNotFound(_0x5d0812,_0x37178b){return function(_0x2a6ffa){if(!_0x2a6ffa){_0x5d0812[_0xfb9f('0x18')](0x194);}return _0x2a6ffa;};}function handleError(_0x41b8ac,_0x1835c9){_0x1835c9=_0x1835c9||0x1f4;return function(_0x11a69f){logger[_0xfb9f('0x28')](_0x11a69f[_0xfb9f('0x29')]);if(_0x11a69f[_0xfb9f('0x2a')]){delete _0x11a69f[_0xfb9f('0x2a')];}_0x41b8ac[_0xfb9f('0x1a')](_0x1835c9)[_0xfb9f('0x2b')](_0x11a69f);};}exports[_0xfb9f('0x2c')]=function(_0x15e3b8,_0x4a5a59){var _0x38227c={},_0x2caccc={},_0x125fa9={'count':0x0,'rows':[]};return db['CmCompany'][_0xfb9f('0x2d')]()[_0xfb9f('0x23')](function(_0x4caffc){_0x2caccc[_0xfb9f('0x2e')]=_[_0xfb9f('0x2f')](_0x4caffc);_0x2caccc[_0xfb9f('0x30')]=_[_0xfb9f('0x2f')](_0x15e3b8[_0xfb9f('0x30')]);_0x2caccc[_0xfb9f('0x31')]=_[_0xfb9f('0x32')](_0x2caccc[_0xfb9f('0x2e')],_0x2caccc[_0xfb9f('0x30')]);_0x38227c['attributes']=_['intersection'](_0x2caccc['model'],qs[_0xfb9f('0x33')](_0x15e3b8['query'][_0xfb9f('0x33')]));_0x38227c[_0xfb9f('0x34')]=_0x38227c[_0xfb9f('0x34')][_0xfb9f('0x35')]?_0x38227c[_0xfb9f('0x34')]:_0x2caccc[_0xfb9f('0x2e')];if(!_0x15e3b8['query'][_0xfb9f('0x36')](_0xfb9f('0x37'))){_0x38227c[_0xfb9f('0x1e')]=qs['limit'](_0x15e3b8['query']['limit']);_0x38227c[_0xfb9f('0x1c')]=qs[_0xfb9f('0x1c')](_0x15e3b8['query'][_0xfb9f('0x1c')]);}_0x38227c[_0xfb9f('0x38')]=qs[_0xfb9f('0x39')](_0x15e3b8[_0xfb9f('0x30')][_0xfb9f('0x39')]);_0x38227c[_0xfb9f('0x3a')]=qs['filters'](_[_0xfb9f('0x3b')](_0x15e3b8['query'],_0x2caccc['filters']),_0x4caffc);if(_0x15e3b8[_0xfb9f('0x30')][_0xfb9f('0x3c')]){_0x38227c[_0xfb9f('0x3a')]=_[_0xfb9f('0x3d')](_0x38227c[_0xfb9f('0x3a')],{'$or':_[_0xfb9f('0x3e')](_0x38227c[_0xfb9f('0x34')],function(_0x3dd83e){var _0x340916={};_0x340916[_0x3dd83e]={'$like':'%'+_0x15e3b8['query'][_0xfb9f('0x3c')]+'%'};return _0x340916;})});}_0x38227c=_['merge']({},_0x38227c,_0x15e3b8[_0xfb9f('0x3f')]);var _0x39ce9f={'where':_0x38227c['where']};return db[_0xfb9f('0x40')][_0xfb9f('0x41')](_0x39ce9f)[_0xfb9f('0x23')](function(_0x4b2c9e){_0x125fa9[_0xfb9f('0x41')]=_0x4b2c9e;if(_0x15e3b8[_0xfb9f('0x30')][_0xfb9f('0x42')]){_0x38227c[_0xfb9f('0x43')]=[{'all':!![]}];}return db[_0xfb9f('0x40')]['findAll'](_0x38227c);})[_0xfb9f('0x23')](function(_0x9fa60a){_0x125fa9[_0xfb9f('0x44')]=_0x9fa60a;return _0x125fa9;})['then'](respondWithFilteredResult(_0x4a5a59,_0x38227c))[_0xfb9f('0x45')](handleError(_0x4a5a59,null));})[_0xfb9f('0x45')](handleError(_0x4a5a59,null));};exports[_0xfb9f('0x46')]=function(_0x255e2f,_0x286713){var _0x42e094={'raw':![],'where':{'id':_0x255e2f[_0xfb9f('0x47')]['id']}},_0x243940={};_0x243940['model']=_[_0xfb9f('0x2f')](db[_0xfb9f('0x40')][_0xfb9f('0x48')]);_0x243940[_0xfb9f('0x30')]=_[_0xfb9f('0x2f')](_0x255e2f['query']);_0x243940[_0xfb9f('0x31')]=_[_0xfb9f('0x32')](_0x243940[_0xfb9f('0x2e')],_0x243940[_0xfb9f('0x30')]);_0x42e094[_0xfb9f('0x34')]=_[_0xfb9f('0x32')](_0x243940[_0xfb9f('0x2e')],qs[_0xfb9f('0x33')](_0x255e2f[_0xfb9f('0x30')][_0xfb9f('0x33')]));_0x42e094[_0xfb9f('0x34')]=_0x42e094[_0xfb9f('0x34')][_0xfb9f('0x35')]?_0x42e094[_0xfb9f('0x34')]:_0x243940[_0xfb9f('0x2e')];if(_0x255e2f[_0xfb9f('0x30')][_0xfb9f('0x42')]){_0x42e094[_0xfb9f('0x43')]=[{'all':!![]}];}_0x42e094=_[_0xfb9f('0x3d')]({},_0x42e094,_0x255e2f[_0xfb9f('0x3f')]);return db[_0xfb9f('0x40')][_0xfb9f('0x49')](_0x42e094)['then'](handleEntityNotFound(_0x286713,null))[_0xfb9f('0x23')](respondWithResult(_0x286713,null))[_0xfb9f('0x45')](handleError(_0x286713,null));};exports[_0xfb9f('0x4a')]=function(_0x41cd3d,_0x36e522){return db['CmCompany'][_0xfb9f('0x4a')](_0x41cd3d[_0xfb9f('0x4b')],{})[_0xfb9f('0x23')](function(_0x3b2719){var _0x456422=_0x41cd3d[_0xfb9f('0x4c')]['get']({'plain':!![]});if(!_0x456422)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x456422['role']===_0xfb9f('0x4c')){var _0x311ee1=_0x3b2719[_0xfb9f('0x25')]({'plain':!![]});var _0x1bfcd0=_0xfb9f('0x26');return db[_0xfb9f('0x4d')]['find']({'where':{'name':_0x1bfcd0,'userProfileId':_0x456422[_0xfb9f('0x4e')]},'raw':!![]})['then'](function(_0x30fefe){if(_0x30fefe&&_0x30fefe[_0xfb9f('0x4f')]===0x0){return db[_0xfb9f('0x27')][_0xfb9f('0x4a')]({'name':_0x311ee1[_0xfb9f('0x2a')],'resourceId':_0x311ee1['id'],'type':_0x30fefe[_0xfb9f('0x2a')],'sectionId':_0x30fefe['id']},{})['then'](function(){return _0x3b2719;});}else{return _0x3b2719;}})[_0xfb9f('0x45')](function(_0xa61db0){logger[_0xfb9f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa61db0);throw _0xa61db0;});}return _0x3b2719;})['then'](respondWithResult(_0x36e522,0xc9))[_0xfb9f('0x45')](handleError(_0x36e522,null));};exports[_0xfb9f('0x22')]=function(_0x280c0b,_0x171c24){if(_0x280c0b[_0xfb9f('0x4b')]['id']){delete _0x280c0b[_0xfb9f('0x4b')]['id'];}return db[_0xfb9f('0x40')][_0xfb9f('0x49')]({'where':{'id':_0x280c0b[_0xfb9f('0x47')]['id']}})['then'](handleEntityNotFound(_0x171c24,null))[_0xfb9f('0x23')](saveUpdates(_0x280c0b[_0xfb9f('0x4b')],null))['then'](respondWithResult(_0x171c24,null))[_0xfb9f('0x45')](handleError(_0x171c24,null));};exports[_0xfb9f('0x24')]=function(_0x3096dc,_0x36371a){return db['CmCompany'][_0xfb9f('0x49')]({'where':{'id':_0x3096dc[_0xfb9f('0x47')]['id']}})[_0xfb9f('0x23')](handleEntityNotFound(_0x36371a,null))[_0xfb9f('0x23')](removeEntity(_0x36371a,null))[_0xfb9f('0x45')](handleError(_0x36371a,null));};exports[_0xfb9f('0x2d')]=function(_0x240a89,_0x4a920f){return db[_0xfb9f('0x40')][_0xfb9f('0x2d')]()[_0xfb9f('0x23')](respondWithResult(_0x4a920f,null))['catch'](handleError(_0x4a920f,null));};exports['addContacts']=function(_0x80f03b,_0x58b562,_0x31eaf9){return db[_0xfb9f('0x50')][_0xfb9f('0x49')]({'where':{'id':_0x80f03b['params']['id']}})['then'](handleEntityNotFound(_0x58b562,null))[_0xfb9f('0x23')](function(_0x4db8f3){if(_0x4db8f3){return _0x4db8f3[_0xfb9f('0x51')](_0x80f03b[_0xfb9f('0x4b')][_0xfb9f('0x52')],_[_0xfb9f('0x53')](_0x80f03b['body'],[_0xfb9f('0x52'),'id'])||{});}})[_0xfb9f('0x23')](respondWithResult(_0x58b562,null))[_0xfb9f('0x45')](handleError(_0x58b562,null));};exports[_0xfb9f('0x54')]=function(_0x38cdf9,_0x25e4af,_0xfd353b){var _0x2e3176={};var _0x3505e6={};var _0x11225b;var _0x1c5c2e;return db[_0xfb9f('0x40')][_0xfb9f('0x55')]({'where':{'id':_0x38cdf9[_0xfb9f('0x47')]['id']}})[_0xfb9f('0x23')](handleEntityNotFound(_0x25e4af,null))['then'](function(_0x25e291){if(_0x25e291){_0x11225b=_0x25e291;_0x3505e6[_0xfb9f('0x2e')]=_['keys'](db['CmContact'][_0xfb9f('0x48')]);_0x3505e6[_0xfb9f('0x30')]=_[_0xfb9f('0x2f')](_0x38cdf9['query']);_0x3505e6[_0xfb9f('0x31')]=_[_0xfb9f('0x32')](_0x3505e6[_0xfb9f('0x2e')],_0x3505e6['query']);_0x2e3176[_0xfb9f('0x34')]=_[_0xfb9f('0x32')](_0x3505e6[_0xfb9f('0x2e')],qs[_0xfb9f('0x33')](_0x38cdf9[_0xfb9f('0x30')]['fields']));_0x2e3176[_0xfb9f('0x34')]=_0x2e3176[_0xfb9f('0x34')][_0xfb9f('0x35')]?_0x2e3176['attributes']:_0x3505e6[_0xfb9f('0x2e')];_0x2e3176[_0xfb9f('0x38')]=qs[_0xfb9f('0x39')](_0x38cdf9[_0xfb9f('0x30')][_0xfb9f('0x39')]);_0x2e3176['where']=qs[_0xfb9f('0x31')](_[_0xfb9f('0x3b')](_0x38cdf9['query'],_0x3505e6['filters']));if(_0x38cdf9['query']['filter']){_0x2e3176['where']=_['merge'](_0x2e3176[_0xfb9f('0x3a')],{'$or':_[_0xfb9f('0x3e')](_0x2e3176[_0xfb9f('0x34')],function(_0x24860a){var _0x153af9={};_0x153af9[_0x24860a]={'$like':'%'+_0x38cdf9[_0xfb9f('0x30')][_0xfb9f('0x3c')]+'%'};return _0x153af9;})});}_0x2e3176=_[_0xfb9f('0x3d')]({},_0x2e3176,_0x38cdf9[_0xfb9f('0x3f')]);return _0x11225b[_0xfb9f('0x54')](_0x2e3176);}})[_0xfb9f('0x23')](function(_0x1cf92f){if(_0x1cf92f){_0x1c5c2e=_0x1cf92f[_0xfb9f('0x35')];if(!_0x38cdf9['query']['hasOwnProperty'](_0xfb9f('0x37'))){_0x2e3176[_0xfb9f('0x1e')]=qs[_0xfb9f('0x1e')](_0x38cdf9['query'][_0xfb9f('0x1e')]);_0x2e3176[_0xfb9f('0x1c')]=qs[_0xfb9f('0x1c')](_0x38cdf9[_0xfb9f('0x30')][_0xfb9f('0x1c')]);}return _0x11225b[_0xfb9f('0x54')](_0x2e3176);}})[_0xfb9f('0x23')](function(_0x3ca102){if(_0x3ca102){return _0x3ca102?{'count':_0x1c5c2e,'rows':_0x3ca102}:null;}})[_0xfb9f('0x23')](respondWithResult(_0x25e4af,null))[_0xfb9f('0x45')](handleError(_0x25e4af,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index a604de5..c0db184 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 _0x2c89=['request-promise','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','util','api','moment','bluebird'];(function(_0x4d2aea,_0x4a8f11){var _0x1715b8=function(_0x50aadc){while(--_0x50aadc){_0x4d2aea['push'](_0x4d2aea['shift']());}};_0x1715b8(++_0x4a8f11);}(_0x2c89,0x193));var _0x92c8=function(_0x578eb4,_0x657262){_0x578eb4=_0x578eb4-0x0;var _0x49eca8=_0x2c89[_0x578eb4];return _0x49eca8;};'use strict';var _=require('lodash');var util=require(_0x92c8('0x0'));var logger=require('../../config/logger')(_0x92c8('0x1'));var moment=require(_0x92c8('0x2'));var BPromise=require(_0x92c8('0x3'));var rp=require(_0x92c8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92c8('0x5'));var config=require(_0x92c8('0x6'));var attributes=require('./cmCompany.attributes');module[_0x92c8('0x7')]=function(_0x5c7cdc,_0x522f04){return _0x5c7cdc[_0x92c8('0x8')](_0x92c8('0x9'),attributes,{'tableName':_0x92c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb90=['api','moment','request-promise','path','rimraf','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x9f0be5,_0x1e81b9){var _0x3fb280=function(_0x5b87c8){while(--_0x5b87c8){_0x9f0be5['push'](_0x9f0be5['shift']());}};_0x3fb280(++_0x1e81b9);}(_0xfb90,0x135));var _0x0fb9=function(_0x16adf1,_0x1273a5){_0x16adf1=_0x16adf1-0x0;var _0xc13362=_0xfb90[_0x16adf1];return _0xc13362;};'use strict';var _=require(_0x0fb9('0x0'));var util=require(_0x0fb9('0x1'));var logger=require(_0x0fb9('0x2'))(_0x0fb9('0x3'));var moment=require(_0x0fb9('0x4'));var BPromise=require('bluebird');var rp=require(_0x0fb9('0x5'));var fs=require('fs');var path=require(_0x0fb9('0x6'));var rimraf=require(_0x0fb9('0x7'));var config=require('../../config/environment');var attributes=require(_0x0fb9('0x8'));module[_0x0fb9('0x9')]=function(_0x375538,_0xf3f1ea){return _0x375538['define'](_0x0fb9('0xa'),attributes,{'tableName':_0x0fb9('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 f4f8bf3..111fcda 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 _0xadf6=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xadf6,0xb0));var _0x6adf=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xadf6[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x6adf('0x0'));var util=require(_0x6adf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6adf('0x2'));var fs=require('fs');var Redis=require(_0x6adf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6adf('0x4'));var logger=require(_0x6adf('0x5'))(_0x6adf('0x6'));var config=require(_0x6adf('0x7'));var jayson=require(_0x6adf('0x8'));var client=jayson[_0x6adf('0x9')][_0x6adf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6ccce7,_0x4bfb5f,_0x194109){return new BPromise(function(_0x3d61c7,_0x51cc1b){return client[_0x6adf('0xb')](_0x6ccce7,_0x194109)[_0x6adf('0xc')](function(_0x52351c){logger[_0x6adf('0xd')](_0x6adf('0xe'),_0x4bfb5f,_0x6adf('0xf'));logger[_0x6adf('0x10')](_0x6adf('0x11'),_0x4bfb5f,_0x6adf('0xf'),JSON[_0x6adf('0x12')](_0x52351c));if(_0x52351c[_0x6adf('0x13')]){if(_0x52351c[_0x6adf('0x13')][_0x6adf('0x14')]===0x1f4){logger['error'](_0x6adf('0xe'),_0x4bfb5f,_0x52351c[_0x6adf('0x13')][_0x6adf('0x15')]);return _0x51cc1b(_0x52351c[_0x6adf('0x13')]['message']);}logger[_0x6adf('0x13')]('CmCompany,\x20%s,\x20%s',_0x4bfb5f,_0x52351c[_0x6adf('0x13')][_0x6adf('0x15')]);return _0x3d61c7(_0x52351c[_0x6adf('0x13')][_0x6adf('0x15')]);}else{logger[_0x6adf('0xd')](_0x6adf('0xe'),_0x4bfb5f,_0x6adf('0xf'));_0x3d61c7(_0x52351c[_0x6adf('0x16')][_0x6adf('0x15')]);}})[_0x6adf('0x17')](function(_0x425dcb){logger['error'](_0x6adf('0xe'),_0x4bfb5f,_0x425dcb);_0x51cc1b(_0x425dcb);});});}
\ No newline at end of file
+var _0x17bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x17bd,0x175));var _0xd17b=function(_0x15ca10,_0x4607c4){_0x15ca10=_0x15ca10-0x0;var _0x1e634c=_0x17bd[_0x15ca10];return _0x1e634c;};'use strict';var _=require(_0xd17b('0x0'));var util=require(_0xd17b('0x1'));var moment=require(_0xd17b('0x2'));var BPromise=require(_0xd17b('0x3'));var rs=require(_0xd17b('0x4'));var fs=require('fs');var Redis=require(_0xd17b('0x5'));var db=require(_0xd17b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd17b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd17b('0x8'));var client=jayson[_0xd17b('0x9')][_0xd17b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dab3c,_0x39c343,_0x124a1d){return new BPromise(function(_0x47109b,_0x15e6a0){return client[_0xd17b('0xb')](_0x2dab3c,_0x124a1d)[_0xd17b('0xc')](function(_0x5a10ab){logger[_0xd17b('0xd')](_0xd17b('0xe'),_0x39c343,_0xd17b('0xf'));logger[_0xd17b('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x39c343,_0xd17b('0xf'),JSON[_0xd17b('0x11')](_0x5a10ab));if(_0x5a10ab[_0xd17b('0x12')]){if(_0x5a10ab['error'][_0xd17b('0x13')]===0x1f4){logger[_0xd17b('0x12')](_0xd17b('0xe'),_0x39c343,_0x5a10ab['error'][_0xd17b('0x14')]);return _0x15e6a0(_0x5a10ab[_0xd17b('0x12')][_0xd17b('0x14')]);}logger[_0xd17b('0x12')](_0xd17b('0xe'),_0x39c343,_0x5a10ab['error'][_0xd17b('0x14')]);return _0x47109b(_0x5a10ab['error'][_0xd17b('0x14')]);}else{logger[_0xd17b('0xd')](_0xd17b('0xe'),_0x39c343,_0xd17b('0xf'));_0x47109b(_0x5a10ab['result'][_0xd17b('0x14')]);}})[_0xd17b('0x15')](function(_0x56e756){logger[_0xd17b('0x12')](_0xd17b('0xe'),_0x39c343,_0x56e756);_0x15e6a0(_0x56e756);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 5d75bb0..deeb582 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 _0xa5ff=['put','/:id','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','getContacts','post','create','/:id/contacts','addContacts'];(function(_0x5ef3cf,_0x334435){var _0x126707=function(_0x363908){while(--_0x363908){_0x5ef3cf['push'](_0x5ef3cf['shift']());}};_0x126707(++_0x334435);}(_0xa5ff,0xa4));var _0xfa5f=function(_0x1fa463,_0x460713){_0x1fa463=_0x1fa463-0x0;var _0x1ec77b=_0xa5ff[_0x1fa463];return _0x1ec77b;};'use strict';var multer=require(_0xfa5f('0x0'));var util=require(_0xfa5f('0x1'));var path=require(_0xfa5f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa5f('0x3')]();var fs_extra=require(_0xfa5f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfa5f('0x5'));var config=require(_0xfa5f('0x6'));var controller=require('./cmCompany.controller');router[_0xfa5f('0x7')]('/',auth['isAuthenticated'](),controller[_0xfa5f('0x8')]);router[_0xfa5f('0x7')]('/describe',auth[_0xfa5f('0x9')](),controller[_0xfa5f('0xa')]);router[_0xfa5f('0x7')]('/:id',auth[_0xfa5f('0x9')](),controller['show']);router[_0xfa5f('0x7')]('/:id/contacts',auth[_0xfa5f('0x9')](),controller[_0xfa5f('0xb')]);router[_0xfa5f('0xc')]('/',auth[_0xfa5f('0x9')](),controller[_0xfa5f('0xd')]);router[_0xfa5f('0xc')](_0xfa5f('0xe'),auth[_0xfa5f('0x9')](),controller[_0xfa5f('0xf')]);router[_0xfa5f('0x10')](_0xfa5f('0x11'),auth[_0xfa5f('0x9')](),controller['update']);router[_0xfa5f('0x12')](_0xfa5f('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xfa5f('0x13')]=router;
\ No newline at end of file
+var _0x89bf=['../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xaf0197,_0x390c5d){var _0x168213=function(_0x315646){while(--_0x315646){_0xaf0197['push'](_0xaf0197['shift']());}};_0x168213(++_0x390c5d);}(_0x89bf,0xab));var _0xf89b=function(_0x58d43b,_0x92918c){_0x58d43b=_0x58d43b-0x0;var _0x1fbbbc=_0x89bf[_0x58d43b];return _0x1fbbbc;};'use strict';var multer=require(_0xf89b('0x0'));var util=require(_0xf89b('0x1'));var path=require(_0xf89b('0x2'));var timeout=require(_0xf89b('0x3'));var express=require(_0xf89b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf89b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf89b('0x6'));var controller=require(_0xf89b('0x7'));router[_0xf89b('0x8')]('/',auth[_0xf89b('0x9')](),controller['index']);router[_0xf89b('0x8')]('/describe',auth[_0xf89b('0x9')](),controller[_0xf89b('0xa')]);router[_0xf89b('0x8')](_0xf89b('0xb'),auth[_0xf89b('0x9')](),controller[_0xf89b('0xc')]);router['get']('/:id/contacts',auth[_0xf89b('0x9')](),controller[_0xf89b('0xd')]);router[_0xf89b('0xe')]('/',auth['isAuthenticated'](),controller[_0xf89b('0xf')]);router['post'](_0xf89b('0x10'),auth[_0xf89b('0x9')](),controller[_0xf89b('0x11')]);router[_0xf89b('0x12')](_0xf89b('0xb'),auth[_0xf89b('0x9')](),controller['update']);router[_0xf89b('0x13')](_0xf89b('0xb'),auth['isAuthenticated'](),controller[_0xf89b('0x14')]);module[_0xf89b('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index b6423ec..7f9f8db 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 _0x6d26=['DATE','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0x2dda1a,_0x1d9ba8){var _0x33dacb=function(_0x333139){while(--_0x333139){_0x2dda1a['push'](_0x2dda1a['shift']());}};_0x33dacb(++_0x1d9ba8);}(_0x6d26,0xa3));var _0x66d2=function(_0x3db4d2,_0x4a7632){_0x3db4d2=_0x3db4d2-0x0;var _0x53dbbb=_0x6d26[_0x3db4d2];return _0x53dbbb;};'use strict';var _=require(_0x66d2('0x0'));var Sequelize=require(_0x66d2('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x66d2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x66d2('0x2')]},'street':{'type':Sequelize[_0x66d2('0x2')]},'postalCode':{'type':Sequelize[_0x66d2('0x2')]},'city':{'type':Sequelize[_0x66d2('0x2')]},'country':{'type':Sequelize[_0x66d2('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x66d2('0x3')]},'phone':{'type':Sequelize[_0x66d2('0x2')]},'mobile':{'type':Sequelize[_0x66d2('0x2')]},'fax':{'type':Sequelize[_0x66d2('0x2')]},'email':{'type':Sequelize[_0x66d2('0x2')]},'url':{'type':Sequelize[_0x66d2('0x2')]},'facebook':{'type':Sequelize[_0x66d2('0x2')]},'fb_data':{'type':Sequelize[_0x66d2('0x2')]},'twitter':{'type':Sequelize[_0x66d2('0x2')]},'skype':{'type':Sequelize[_0x66d2('0x2')]},'teams':{'type':Sequelize[_0x66d2('0x2')]},'viber':{'type':Sequelize[_0x66d2('0x2')]},'line':{'type':Sequelize[_0x66d2('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x66d2('0x2')]},'UserId':{'type':Sequelize[_0x66d2('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x66d2('0x2')]},'priority':{'type':Sequelize[_0x66d2('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x66d2('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x66d2('0x2')]},'utcOffset':{'type':Sequelize[_0x66d2('0x4')]}};
\ No newline at end of file
+var _0x768b=['lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x150ed2,_0x1705e2){var _0x9668ba=function(_0x464398){while(--_0x464398){_0x150ed2['push'](_0x150ed2['shift']());}};_0x9668ba(++_0x1705e2);}(_0x768b,0x140));var _0xb768=function(_0x2f8fdf,_0x440bc3){_0x2f8fdf=_0x2f8fdf-0x0;var _0xc24053=_0x768b[_0x2f8fdf];return _0xc24053;};'use strict';var _=require(_0xb768('0x0'));var Sequelize=require(_0xb768('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xb768('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb768('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xb768('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xb768('0x2')]},'dateOfBirth':{'type':Sequelize[_0xb768('0x2')]},'description':{'type':Sequelize[_0xb768('0x3')]},'phone':{'type':Sequelize[_0xb768('0x2')]},'mobile':{'type':Sequelize[_0xb768('0x2')]},'fax':{'type':Sequelize[_0xb768('0x2')]},'email':{'type':Sequelize[_0xb768('0x2')]},'url':{'type':Sequelize[_0xb768('0x2')]},'facebook':{'type':Sequelize[_0xb768('0x2')]},'fb_data':{'type':Sequelize[_0xb768('0x2')]},'twitter':{'type':Sequelize[_0xb768('0x2')]},'skype':{'type':Sequelize[_0xb768('0x2')]},'teams':{'type':Sequelize[_0xb768('0x2')]},'viber':{'type':Sequelize[_0xb768('0x2')]},'line':{'type':Sequelize[_0xb768('0x2')]},'wechat':{'type':Sequelize[_0xb768('0x2')]},'telegram':{'type':Sequelize[_0xb768('0x2')]},'UserId':{'type':Sequelize[_0xb768('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb768('0x4')](0x2)[_0xb768('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb768('0x6')],'defaultValue':Sequelize[_0xb768('0x7')]},'dialTimezone':{'type':Sequelize[_0xb768('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index d566c24..46de3be 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 _0xbf3e=['get','isArray','tags','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','where','$or','push','ListId','spread','contact','all','show','Tags','tag','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','format','cf_%d','pickBy','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','findOne','Tag','filters','model','attributes','intersection','fields','order','sort','pick','filter','map','hasOwnProperty','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopper','item','PHONE','CmHopperId','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','CmContactId','toContactId','bulkCreate','rescheduleAdditionalPhones','hopperId','rawAttributes','nolimit','ContactId','options','include','rows','CmHopperHistory','getHopperFinals','includeAll','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','join','root','server/files/tmp','file','chmodSync','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','User','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csvUpdates','mail','chat','fax','whatsapp','voice','resolve','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','fullname','DESC','startCase','Account','closed','closedAt','disposition','secondDisposition','UserId','key','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Owner','flatten','sortBy','reverse','value','slice','moment','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','error','stack','name','send','describe','findAll','user','catch','CmContact','find','params','keys','startsWith','cf_','query','CmCustomField','length','columnName','displayName','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from'];(function(_0x57207d,_0x1edb04){var _0x35166a=function(_0x57067a){while(--_0x57067a){_0x57207d['push'](_0x57207d['shift']());}};_0x35166a(++_0x1edb04);}(_0xbf3e,0xc0));var _0xebf3=function(_0x1bd1c3,_0x1ed2d9){_0x1bd1c3=_0x1bd1c3-0x0;var _0x5a1e76=_0xbf3e[_0x1bd1c3];return _0x5a1e76;};'use strict';var moment=require(_0xebf3('0x0'));var BPromise=require('bluebird');var util=require(_0xebf3('0x1'));var path=require(_0xebf3('0x2'));var fs=require('fs');var _=require(_0xebf3('0x3'));var squel=require(_0xebf3('0x4'));var Papa=require(_0xebf3('0x5'));var Redis=require(_0xebf3('0x6'));var contacts=require(_0xebf3('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xebf3('0x8'));var shared=require('../../config/environment/shared');var db=require(_0xebf3('0x9'))['db'];config['redis']=_['defaults'](config[_0xebf3('0xa')],{'host':_0xebf3('0xb'),'port':0x18eb});var socket=require(_0xebf3('0xc'))(new Redis(config[_0xebf3('0xa')]));require(_0xebf3('0xd'))['register'](socket);function respondWithResult(_0x476b21,_0x24348f){_0x24348f=_0x24348f||0xc8;return function(_0x3578e1){if(_0x3578e1){return _0x476b21[_0xebf3('0xe')](_0x24348f)[_0xebf3('0xf')](_0x3578e1);}};}function respondWithFilteredResult(_0x2c0d1f,_0x12da59){return function(_0x2c7b9e){if(_0x2c7b9e){var _0x300e30=typeof _0x12da59[_0xebf3('0x10')]===_0xebf3('0x11')&&typeof _0x12da59['limit']===_0xebf3('0x11');var _0x420daf=_0x2c7b9e['count'];var _0x26e2a2=_0x300e30?0x0:_0x12da59[_0xebf3('0x10')];var _0xe2f0db=_0x300e30?_0x2c7b9e[_0xebf3('0x12')]:_0x12da59[_0xebf3('0x10')]+_0x12da59[_0xebf3('0x13')];var _0x2a64c2;if(_0xe2f0db>=_0x420daf){_0xe2f0db=_0x420daf;_0x2a64c2=0xc8;}else{_0x2a64c2=0xce;}_0x2c0d1f[_0xebf3('0xe')](_0x2a64c2);return _0x2c0d1f[_0xebf3('0x14')](_0xebf3('0x15'),_0x26e2a2+'-'+_0xe2f0db+'/'+_0x420daf)[_0xebf3('0xf')](_0x2c7b9e);}return null;};}function saveUpdates(_0xbb562a){return function(_0x3c4d83){if(_0x3c4d83){return _0x3c4d83[_0xebf3('0x16')](_0xbb562a)[_0xebf3('0x17')](function(_0x154799){return _0x154799;});}return null;};}function removeEntity(_0x3fa349){return function(_0x2140ce){if(_0x2140ce){return _0x2140ce[_0xebf3('0x18')]()[_0xebf3('0x17')](function(){_0x3fa349[_0xebf3('0xe')](0xcc)[_0xebf3('0x19')]();});}};}function handleEntityNotFound(_0x2c2db9){return function(_0x3e57fe){if(!_0x3e57fe){_0x2c2db9['sendStatus'](0x194);}return _0x3e57fe;};}function handleError(_0x1c9622,_0x29e7fb){_0x29e7fb=_0x29e7fb||0x1f4;return function(_0x2e1dfa){logger[_0xebf3('0x1a')](_0x2e1dfa[_0xebf3('0x1b')]);if(_0x2e1dfa[_0xebf3('0x1c')]){delete _0x2e1dfa[_0xebf3('0x1c')];}_0x1c9622[_0xebf3('0xe')](_0x29e7fb)[_0xebf3('0x1d')](_0x2e1dfa);};}exports['index']=function(_0x391861,_0x2d43cf){var _0x2c9dc9={};return contacts[_0xebf3('0x1e')]()[_0xebf3('0x17')](function(_0x2d4bf3){_0x2c9dc9=qs['getOptions'](_0x2d4bf3,_0x391861);return contacts[_0xebf3('0x1f')](_0x391861['query'],_0x391861[_0xebf3('0x20')],_0x2c9dc9,_0x2d4bf3);})['then'](respondWithFilteredResult(_0x2d43cf,_0x2c9dc9))[_0xebf3('0x21')](handleError(_0x2d43cf,null));};exports[_0xebf3('0x18')]=function(_0x333671,_0x253276){return db[_0xebf3('0x22')][_0xebf3('0x23')]({'where':{'id':_0x333671[_0xebf3('0x24')]['id']}})[_0xebf3('0x17')](handleEntityNotFound(_0x253276,null))[_0xebf3('0x17')](removeEntity(_0x253276,null))[_0xebf3('0x21')](handleError(_0x253276,null));};exports['describe']=function(_0x31592d,_0x2c72cc){return db[_0xebf3('0x22')][_0xebf3('0x1e')]()[_0xebf3('0x17')](function(_0x1d607d){delete _0x1d607d['tags'];for(var _0x4c2e52=0x0;_0x4c2e52
','Attachments','Title','Data','generateXOAuth2Token','toString','base64','lodash','moment','randomstring','util','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','split','length','slice','join','Anonymous','pop','isEmpty','test','html','replace','attachments','push','filename','_SRC'];(function(_0x2567c7,_0xf3cb9f){var _0x45fc2d=function(_0x1929f9){while(--_0x1929f9){_0x2567c7['push'](_0x2567c7['shift']());}};_0x45fc2d(++_0xf3cb9f);}(_0xd654,0xbb));var _0x4d65=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd654[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x4d65('0x0'));var moment=require(_0x4d65('0x1'));var random=require(_0x4d65('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x4d65('0x3'));var tnef=require('node-tnef');var logger=require(_0x4d65('0x4'))(_0x4d65('0x5'));var config=require(_0x4d65('0x6'));function getAddress(_0x5e5fe1){var _0x27fa5b=_[_0x4d65('0x7')](_0x5e5fe1[_0x4d65('0x8')]);return _0x27fa5b&&_0x27fa5b[_0x4d65('0x9')]?_0x27fa5b['address']:_0x4d65('0xa')+random[_0x4d65('0xb')](0x6)+_0x4d65('0xc');}function getFirstName(_0x31081d){var _0x1001c6=_[_0x4d65('0x7')](_0x31081d[_0x4d65('0x8')]);if(_0x1001c6&&_0x1001c6[_0x4d65('0xd')]){if(_0x1001c6['name']==_0x1001c6[_0x4d65('0x9')]){return _0x1001c6[_0x4d65('0xd')][_0x4d65('0xe')](0x0,_0x1001c6[_0x4d65('0xd')]['indexOf']('@'));}var _0x4d6974=_0x1001c6[_0x4d65('0xd')][_0x4d65('0xf')](/\s+/);return _0x4d6974[_0x4d65('0x10')]>0x1?_0x4d6974[_0x4d65('0x11')](0x0,-0x1)[_0x4d65('0x12')]('\x20'):_0x1001c6[_0x4d65('0xd')];}return _0x4d65('0x13');}function getLastName(_0x3b5da9){var _0x1dacd3=_[_0x4d65('0x7')](_0x3b5da9[_0x4d65('0x8')]);if(_0x1dacd3&&_0x1dacd3[_0x4d65('0xd')]){var _0x3139fa=_0x1dacd3[_0x4d65('0xd')][_0x4d65('0xf')](/\s+/);return _0x3139fa[_0x4d65('0x10')]>0x1?_0x3139fa[_0x4d65('0x14')]():'';}return'';}function getMails(_0x319c9c,_0x4d8011){var _0x3f9f02='';for(var _0xec97f1=0x0;_0xec97f1<_0x4d8011['value'][_0x4d65('0x10')];_0xec97f1+=0x1){if(_0x4d8011['value'][_0xec97f1][_0x4d65('0x9')]!==_0x319c9c){if(!_[_0x4d65('0x15')](_0x3f9f02)){_0x3f9f02+=',';}_0x3f9f02+=_0x4d8011['value'][_0xec97f1][_0x4d65('0xd')]||_0x4d8011[_0x4d65('0x8')][_0xec97f1]['address']||'';_0x3f9f02+='\x20<';_0x3f9f02+=_0x4d8011[_0x4d65('0x8')][_0xec97f1][_0x4d65('0x9')]?_0x4d8011['value'][_0xec97f1][_0x4d65('0x9')]:'anonymous'+random['generate'](0x6)+_0x4d65('0xc');_0x3f9f02+='>';}}return _0x3f9f02;}function parseEmail(_0x317c06,_0x746d97,_0x3e427f){if(_0x746d97['html']){var _0x3875d3=/