From: Andrea Amorese
Date: Tue, 15 Feb 2022 11:02:40 +0000 (+0100)
Subject: Built motion from commit f91e4f70.|2.5.50
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=93b6079f784816156aebcdbcb35e074467d7a5dc;p=motion2.git
Built motion from commit f91e4f70.|2.5.50
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9c03289..bb28656 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-02-15T10:08:07.323Z",
+ "time": "2022-02-15T10:49:29.076Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 97c24e9..b6e533b 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-02-15T10:08:07.323Z",
+ "time": "2022-02-15T10:49:29.076Z",
"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 bfcecb5..eb73f3c 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 _0x6e82=['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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','motionbar','jscripty','urlForward','bot'];(function(_0x2c6fb9,_0xc7d7c0){var _0x49fd5e=function(_0x3dcbaf){while(--_0x3dcbaf){_0x2c6fb9['push'](_0x2c6fb9['shift']());}};_0x49fd5e(++_0xc7d7c0);}(_0x6e82,0x13a));var _0x26e8=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x6e82[_0x1057a3];return _0x131cdb;};'use strict';var Sequelize=require(_0x26e8('0x0'));module[_0x26e8('0x1')]={'name':{'type':Sequelize[_0x26e8('0x2')],'get':function(_0x47a99a){return this[_0x26e8('0x3')]('action');}},'action':{'type':Sequelize[_0x26e8('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x26e8('0x5'),'integration',_0x26e8('0x6'),_0x26e8('0x7'),_0x26e8('0x8'),'browser',_0x26e8('0x9'),'script']],'msg':_0x26e8('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x26e8('0x4')](0x1000),'comment':_0x26e8('0xb')},'data2':{'type':Sequelize[_0x26e8('0x4')](0x1000),'comment':_0x26e8('0xc')},'data3':{'type':Sequelize['STRING'](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[_0x26e8('0x4')](0x1000),'comments':_0x26e8('0xd')},'data5':{'type':Sequelize[_0x26e8('0x4')](0x1000),'comments':_0x26e8('0xe')},'data6':{'type':Sequelize[_0x26e8('0x4')],'comments':_0x26e8('0xf')},'data7':{'type':Sequelize[_0x26e8('0x10')],'comments':_0x26e8('0x11')}};
\ No newline at end of file
+var _0xe7ce=['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','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7ce,0x1e5));var _0xee7c=function(_0x400b6b,_0x14f5fd){_0x400b6b=_0x400b6b-0x0;var _0x309f1b=_0xe7ce[_0x400b6b];return _0x309f1b;};'use strict';var Sequelize=require(_0xee7c('0x0'));module['exports']={'name':{'type':Sequelize[_0xee7c('0x1')],'get':function(_0x514773){return this[_0xee7c('0x2')](_0xee7c('0x3'));}},'action':{'type':Sequelize[_0xee7c('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xee7c('0x5'),_0xee7c('0x6'),_0xee7c('0x7'),_0xee7c('0x8'),_0xee7c('0x9'),_0xee7c('0xa'),_0xee7c('0xb'),_0xee7c('0xc')]],'msg':_0xee7c('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xee7c('0x4')](0x1000),'comment':_0xee7c('0xe')},'data3':{'type':Sequelize[_0xee7c('0x4')](0x1000),'comment':_0xee7c('0xf')},'data4':{'type':Sequelize[_0xee7c('0x4')](0x1000),'comments':_0xee7c('0x10')},'data5':{'type':Sequelize[_0xee7c('0x4')](0x1000),'comments':_0xee7c('0x11')},'data6':{'type':Sequelize[_0xee7c('0x4')],'comments':_0xee7c('0x12')},'data7':{'type':Sequelize['TEXT'],'comments':_0xee7c('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 860fe08..3529933 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 _0x1646=['Action','params','catch','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','limit','count','offset','Content-Range','json','reject','update','then','destroy','end','sendStatus','name','send','body'];(function(_0x583fcf,_0x3ecc68){var _0x1b5c24=function(_0x6ac052){while(--_0x6ac052){_0x583fcf['push'](_0x583fcf['shift']());}};_0x1b5c24(++_0x3ecc68);}(_0x1646,0x1d2));var _0x6164=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0x1646[_0x3f9584];return _0x9d54c;};'use strict';var emlformat=require(_0x6164('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6164('0x1'));var jsonpatch=require(_0x6164('0x2'));var rp=require(_0x6164('0x3'));var moment=require(_0x6164('0x4'));var BPromise=require(_0x6164('0x5'));var Mustache=require('mustache');var util=require(_0x6164('0x6'));var path=require('path');var sox=require(_0x6164('0x7'));var csv=require('to-csv');var ejs=require(_0x6164('0x8'));var fs=require('fs');var fs_extra=require(_0x6164('0x9'));var _=require(_0x6164('0xa'));var squel=require('squel');var crypto=require(_0x6164('0xb'));var jsforce=require(_0x6164('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6164('0xd'));var querystring=require(_0x6164('0xe'));var Papa=require(_0x6164('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6164('0x10'));var as=require(_0x6164('0x11'));var hardwareService=require(_0x6164('0x12'));var logger=require('../../config/logger')(_0x6164('0x13'));var utils=require(_0x6164('0x14'));var config=require(_0x6164('0x15'));var licenseUtil=require(_0x6164('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461cbe,_0x82127d){_0x82127d=_0x82127d||0xcc;return function(_0x3751bb){if(_0x3751bb){return _0x461cbe['sendStatus'](_0x82127d);}return _0x461cbe[_0x6164('0x17')](_0x82127d)['end']();};}function respondWithResult(_0x1f4aa1,_0x1c9f82){_0x1c9f82=_0x1c9f82||0xc8;return function(_0x23564a){if(_0x23564a){return _0x1f4aa1[_0x6164('0x17')](_0x1c9f82)['json'](_0x23564a);}};}function respondWithFilteredResult(_0x35d87d,_0x502286){return function(_0x2b7332){if(_0x2b7332){var _0x37763a=typeof _0x502286['offset']==='undefined'&&typeof _0x502286[_0x6164('0x18')]==='undefined';var _0x49d244=_0x2b7332[_0x6164('0x19')];var _0x912d5f=_0x37763a?0x0:_0x502286[_0x6164('0x1a')];var _0x599e20=_0x37763a?_0x2b7332[_0x6164('0x19')]:_0x502286[_0x6164('0x1a')]+_0x502286[_0x6164('0x18')];var _0x21c10e;if(_0x599e20>=_0x49d244){_0x599e20=_0x49d244;_0x21c10e=0xc8;}else{_0x21c10e=0xce;}_0x35d87d['status'](_0x21c10e);return _0x35d87d['set'](_0x6164('0x1b'),_0x912d5f+'-'+_0x599e20+'/'+_0x49d244)[_0x6164('0x1c')](_0x2b7332);}return null;};}function patchUpdates(_0x2d5323){return function(_0x161d8f){try{jsonpatch['apply'](_0x161d8f,_0x2d5323,!![]);}catch(_0x4e9adb){return BPromise[_0x6164('0x1d')](_0x4e9adb);}return _0x161d8f['save']();};}function saveUpdates(_0x54c459,_0x408995){return function(_0x3158f0){if(_0x3158f0){return _0x3158f0[_0x6164('0x1e')](_0x54c459)[_0x6164('0x1f')](function(_0x3ccaf2){return _0x3ccaf2;});}return null;};}function removeEntity(_0x403d7c,_0x4f2794){return function(_0xa2a30d){if(_0xa2a30d){return _0xa2a30d[_0x6164('0x20')]()[_0x6164('0x1f')](function(){_0x403d7c[_0x6164('0x17')](0xcc)[_0x6164('0x21')]();});}};}function handleEntityNotFound(_0x126c6b,_0x202fd5){return function(_0x24fa37){if(!_0x24fa37){_0x126c6b[_0x6164('0x22')](0x194);}return _0x24fa37;};}function handleError(_0x121c8b,_0x2d6844){_0x2d6844=_0x2d6844||0x1f4;return function(_0x4ba4c0){logger['error'](_0x4ba4c0['stack']);if(_0x4ba4c0[_0x6164('0x23')]){delete _0x4ba4c0[_0x6164('0x23')];}_0x121c8b[_0x6164('0x17')](_0x2d6844)[_0x6164('0x24')](_0x4ba4c0);};}exports[_0x6164('0x1e')]=function(_0x373cae,_0x595a9c){if(_0x373cae['body']['id']){delete _0x373cae[_0x6164('0x25')]['id'];}return db[_0x6164('0x26')]['find']({'where':{'id':_0x373cae[_0x6164('0x27')]['id']}})[_0x6164('0x1f')](handleEntityNotFound(_0x595a9c,null))['then'](saveUpdates(_0x373cae['body'],null))[_0x6164('0x1f')](respondWithResult(_0x595a9c,null))[_0x6164('0x28')](handleError(_0x595a9c,null));};exports[_0x6164('0x20')]=function(_0x5318cf,_0x215811){return db['Action'][_0x6164('0x29')]({'where':{'id':_0x5318cf[_0x6164('0x27')]['id']}})['then'](handleEntityNotFound(_0x215811,null))['then'](removeEntity(_0x215811,null))[_0x6164('0x28')](handleError(_0x215811,null));};
\ No newline at end of file
+var _0x6fc4=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf'];(function(_0x145318,_0x46e6b0){var _0x5cf535=function(_0x1ed56d){while(--_0x1ed56d){_0x145318['push'](_0x145318['shift']());}};_0x5cf535(++_0x46e6b0);}(_0x6fc4,0x68));var _0x46fc=function(_0x35906a,_0x9e0b54){_0x35906a=_0x35906a-0x0;var _0x43ba69=_0x6fc4[_0x35906a];return _0x43ba69;};'use strict';var emlformat=require(_0x46fc('0x0'));var rimraf=require(_0x46fc('0x1'));var zipdir=require(_0x46fc('0x2'));var jsonpatch=require(_0x46fc('0x3'));var rp=require(_0x46fc('0x4'));var moment=require(_0x46fc('0x5'));var BPromise=require(_0x46fc('0x6'));var Mustache=require(_0x46fc('0x7'));var util=require('util');var path=require(_0x46fc('0x8'));var sox=require(_0x46fc('0x9'));var csv=require(_0x46fc('0xa'));var ejs=require(_0x46fc('0xb'));var fs=require('fs');var fs_extra=require(_0x46fc('0xc'));var _=require('lodash');var squel=require(_0x46fc('0xd'));var crypto=require(_0x46fc('0xe'));var jsforce=require(_0x46fc('0xf'));var deskjs=require(_0x46fc('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x46fc('0x11'));var Redis=require(_0x46fc('0x12'));var authService=require(_0x46fc('0x13'));var qs=require(_0x46fc('0x14'));var as=require(_0x46fc('0x15'));var hardwareService=require(_0x46fc('0x16'));var logger=require(_0x46fc('0x17'))('api');var utils=require(_0x46fc('0x18'));var config=require(_0x46fc('0x19'));var licenseUtil=require(_0x46fc('0x1a'));var db=require(_0x46fc('0x1b'))['db'];function respondWithStatusCode(_0x8d7a87,_0xb2aa8d){_0xb2aa8d=_0xb2aa8d||0xcc;return function(_0x599f2f){if(_0x599f2f){return _0x8d7a87['sendStatus'](_0xb2aa8d);}return _0x8d7a87[_0x46fc('0x1c')](_0xb2aa8d)[_0x46fc('0x1d')]();};}function respondWithResult(_0x194389,_0x58313e){_0x58313e=_0x58313e||0xc8;return function(_0x4f839b){if(_0x4f839b){return _0x194389[_0x46fc('0x1c')](_0x58313e)[_0x46fc('0x1e')](_0x4f839b);}};}function respondWithFilteredResult(_0x89a9e9,_0x4215c8){return function(_0x87bdac){if(_0x87bdac){var _0x511dd=typeof _0x4215c8['offset']==='undefined'&&typeof _0x4215c8[_0x46fc('0x1f')]===_0x46fc('0x20');var _0x52b6af=_0x87bdac[_0x46fc('0x21')];var _0x2ab4b9=_0x511dd?0x0:_0x4215c8[_0x46fc('0x22')];var _0x16c1de=_0x511dd?_0x87bdac['count']:_0x4215c8[_0x46fc('0x22')]+_0x4215c8['limit'];var _0x53487b;if(_0x16c1de>=_0x52b6af){_0x16c1de=_0x52b6af;_0x53487b=0xc8;}else{_0x53487b=0xce;}_0x89a9e9[_0x46fc('0x1c')](_0x53487b);return _0x89a9e9[_0x46fc('0x23')](_0x46fc('0x24'),_0x2ab4b9+'-'+_0x16c1de+'/'+_0x52b6af)[_0x46fc('0x1e')](_0x87bdac);}return null;};}function patchUpdates(_0x5d764b){return function(_0x155b81){try{jsonpatch[_0x46fc('0x25')](_0x155b81,_0x5d764b,!![]);}catch(_0x5554fb){return BPromise[_0x46fc('0x26')](_0x5554fb);}return _0x155b81[_0x46fc('0x27')]();};}function saveUpdates(_0xe1f6ca,_0x532018){return function(_0xcc5b24){if(_0xcc5b24){return _0xcc5b24[_0x46fc('0x28')](_0xe1f6ca)['then'](function(_0x5b95d3){return _0x5b95d3;});}return null;};}function removeEntity(_0x8c3992,_0x50f970){return function(_0xff47f1){if(_0xff47f1){return _0xff47f1[_0x46fc('0x29')]()[_0x46fc('0x2a')](function(){_0x8c3992[_0x46fc('0x1c')](0xcc)[_0x46fc('0x1d')]();});}};}function handleEntityNotFound(_0x3c125d,_0x1b14e3){return function(_0x13b312){if(!_0x13b312){_0x3c125d[_0x46fc('0x2b')](0x194);}return _0x13b312;};}function handleError(_0xdd5bec,_0x4767b0){_0x4767b0=_0x4767b0||0x1f4;return function(_0x1cc0e0){logger[_0x46fc('0x2c')](_0x1cc0e0[_0x46fc('0x2d')]);if(_0x1cc0e0[_0x46fc('0x2e')]){delete _0x1cc0e0[_0x46fc('0x2e')];}_0xdd5bec[_0x46fc('0x1c')](_0x4767b0)[_0x46fc('0x2f')](_0x1cc0e0);};}exports[_0x46fc('0x28')]=function(_0x12d0dc,_0xc76869){if(_0x12d0dc['body']['id']){delete _0x12d0dc[_0x46fc('0x30')]['id'];}return db[_0x46fc('0x31')][_0x46fc('0x32')]({'where':{'id':_0x12d0dc['params']['id']}})[_0x46fc('0x2a')](handleEntityNotFound(_0xc76869,null))['then'](saveUpdates(_0x12d0dc[_0x46fc('0x30')],null))[_0x46fc('0x2a')](respondWithResult(_0xc76869,null))['catch'](handleError(_0xc76869,null));};exports[_0x46fc('0x29')]=function(_0x568257,_0x4459e7){return db[_0x46fc('0x31')]['find']({'where':{'id':_0x568257[_0x46fc('0x33')]['id']}})[_0x46fc('0x2a')](handleEntityNotFound(_0x4459e7,null))[_0x46fc('0x2a')](removeEntity(_0x4459e7,null))[_0x46fc('0x34')](handleError(_0x4459e7,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 92009a4..485b3f3 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 _0x269b=['path','../../config/environment','exports','define','Action','tools_actions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0x269b,0x1be));var _0xb269=function(_0x80531e,_0x980d08){_0x80531e=_0x80531e-0x0;var _0x36fcae=_0x269b[_0x80531e];return _0x36fcae;};'use strict';var _=require(_0xb269('0x0'));var util=require('util');var logger=require(_0xb269('0x1'))('api');var moment=require(_0xb269('0x2'));var BPromise=require(_0xb269('0x3'));var rp=require(_0xb269('0x4'));var fs=require('fs');var path=require(_0xb269('0x5'));var rimraf=require('rimraf');var config=require(_0xb269('0x6'));var attributes=require('./action.attributes');module[_0xb269('0x7')]=function(_0x4cc43a,_0x8d49db){return _0x4cc43a[_0xb269('0x8')](_0xb269('0x9'),attributes,{'tableName':_0xb269('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb77c=['moment','bluebird','request-promise','path','rimraf','./action.attributes','exports','define','Action','tools_actions','lodash','../../config/logger','api'];(function(_0x557f28,_0xc7a5a6){var _0x2ffa93=function(_0x57abe2){while(--_0x57abe2){_0x557f28['push'](_0x557f28['shift']());}};_0x2ffa93(++_0xc7a5a6);}(_0xb77c,0x101));var _0xcb77=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb77c[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xcb77('0x0'));var util=require('util');var logger=require(_0xcb77('0x1'))(_0xcb77('0x2'));var moment=require(_0xcb77('0x3'));var BPromise=require(_0xcb77('0x4'));var rp=require(_0xcb77('0x5'));var fs=require('fs');var path=require(_0xcb77('0x6'));var rimraf=require(_0xcb77('0x7'));var config=require('../../config/environment');var attributes=require(_0xcb77('0x8'));module[_0xcb77('0x9')]=function(_0x46c63f,_0x1b36d6){return _0x46c63f[_0xcb77('0xa')](_0xcb77('0xb'),attributes,{'tableName':_0xcb77('0xc'),'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 c247254..c5b1292 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x999d97,_0x53e0d6){var _0x397da4=function(_0x38a334){while(--_0x38a334){_0x999d97['push'](_0x999d97['shift']());}};_0x397da4(++_0x53e0d6);}(_0xabce,0x103));var _0xeabc=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xabce[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\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(_0x539309,_0x35f17d){var _0x2277b5=function(_0x17cf56){while(--_0x17cf56){_0x539309['push'](_0x539309['shift']());}};_0x2277b5(++_0x35f17d);}(_0x1261,0x144));var _0x1126=function(_0x53f3ad,_0x39163e){_0x53f3ad=_0x53f3ad-0x0;var _0x48b203=_0x1261[_0x53f3ad];return _0x48b203;};'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')]('Action,\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/action/index.js b/server/api/action/index.js
index 7a58819..bacd3e9 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 _0x89a1=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a99db,_0x1cece5){var _0x3aad62=function(_0x334cb7){while(--_0x334cb7){_0x5a99db['push'](_0x5a99db['shift']());}};_0x3aad62(++_0x1cece5);}(_0x89a1,0x80));var _0x189a=function(_0x58be55,_0x4f7096){_0x58be55=_0x58be55-0x0;var _0x351fce=_0x89a1[_0x58be55];return _0x351fce;};'use strict';var multer=require(_0x189a('0x0'));var util=require(_0x189a('0x1'));var path=require(_0x189a('0x2'));var timeout=require(_0x189a('0x3'));var express=require(_0x189a('0x4'));var router=express[_0x189a('0x5')]();var fs_extra=require(_0x189a('0x6'));var auth=require(_0x189a('0x7'));var interaction=require(_0x189a('0x8'));var config=require(_0x189a('0x9'));var controller=require(_0x189a('0xa'));router[_0x189a('0xb')](_0x189a('0xc'),auth[_0x189a('0xd')](),controller['update']);router[_0x189a('0xe')](_0x189a('0xc'),auth['isAuthenticated'](),controller[_0x189a('0xf')]);module[_0x189a('0x10')]=router;
\ No newline at end of file
+var _0x2113=['put','/:id','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x2bfe52,_0x43946e){var _0x1cf649=function(_0xc8300c){while(--_0xc8300c){_0x2bfe52['push'](_0x2bfe52['shift']());}};_0x1cf649(++_0x43946e);}(_0x2113,0x1c9));var _0x3211=function(_0xf0d997,_0x5848d5){_0xf0d997=_0xf0d997-0x0;var _0x5b64c5=_0x2113[_0xf0d997];return _0x5b64c5;};'use strict';var multer=require('multer');var util=require(_0x3211('0x0'));var path=require(_0x3211('0x1'));var timeout=require(_0x3211('0x2'));var express=require(_0x3211('0x3'));var router=express['Router']();var fs_extra=require(_0x3211('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3211('0x5'));var config=require(_0x3211('0x6'));var controller=require(_0x3211('0x7'));router[_0x3211('0x8')](_0x3211('0x9'),auth[_0x3211('0xa')](),controller[_0x3211('0xb')]);router[_0x3211('0xc')]('/:id',auth[_0x3211('0xa')](),controller[_0x3211('0xd')]);module[_0x3211('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index d2c04c6..2a404cc 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 _0x6aa7=['TEXT','sequelize','STRING'];(function(_0x5ccb02,_0x3588fb){var _0x52a833=function(_0x1b61d5){while(--_0x1b61d5){_0x5ccb02['push'](_0x5ccb02['shift']());}};_0x52a833(++_0x3588fb);}(_0x6aa7,0x178));var _0x76aa=function(_0x4be597,_0x3ab501){_0x4be597=_0x4be597-0x0;var _0x435456=_0x6aa7[_0x4be597];return _0x435456;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x76aa('0x1')]},'parent':{'type':Sequelize[_0x76aa('0x1')]},'table':{'type':Sequelize[_0x76aa('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x76aa('0x2')]}};
\ No newline at end of file
+var _0x6f47=['TEXT','exports','STRING'];(function(_0x456193,_0x136f3e){var _0x5e81f4=function(_0x35e937){while(--_0x35e937){_0x456193['push'](_0x456193['shift']());}};_0x5e81f4(++_0x136f3e);}(_0x6f47,0xc7));var _0x76f4=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x6f47[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index b20d34b..8325d91 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 _0xc42f=['savename','countTable','COUNT(*)','sequelize','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','count','set','json','apply','save','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','rows','show','params','includeAll','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','metric','field','function','replace','format','orderBy','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','right_join','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','MetricId','groupBy','DESC','alias','output','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports'];(function(_0x279a53,_0x5ea2a4){var _0x5b4d98=function(_0x4cbf60){while(--_0x4cbf60){_0x279a53['push'](_0x279a53['shift']());}};_0x5b4d98(++_0x5ea2a4);}(_0xc42f,0xb0));var _0xfc42=function(_0x67aa3,_0x32e741){_0x67aa3=_0x67aa3-0x0;var _0x32562e=_0xc42f[_0x67aa3];return _0x32562e;};'use strict';var emlformat=require(_0xfc42('0x0'));var rimraf=require(_0xfc42('0x1'));var zipdir=require(_0xfc42('0x2'));var jsonpatch=require(_0xfc42('0x3'));var rp=require(_0xfc42('0x4'));var moment=require('moment');var BPromise=require(_0xfc42('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfc42('0x6'));var sox=require(_0xfc42('0x7'));var csv=require(_0xfc42('0x8'));var ejs=require(_0xfc42('0x9'));var fs=require('fs');var fs_extra=require(_0xfc42('0xa'));var _=require('lodash');var squel=require(_0xfc42('0xb'));var crypto=require(_0xfc42('0xc'));var jsforce=require(_0xfc42('0xd'));var deskjs=require(_0xfc42('0xe'));var toCsv=require(_0xfc42('0x8'));var querystring=require(_0xfc42('0xf'));var Papa=require(_0xfc42('0x10'));var Redis=require('ioredis');var authService=require(_0xfc42('0x11'));var qs=require(_0xfc42('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc42('0x13'));var logger=require(_0xfc42('0x14'))(_0xfc42('0x15'));var utils=require(_0xfc42('0x16'));var config=require(_0xfc42('0x17'));var licenseUtil=require(_0xfc42('0x18'));var db=require(_0xfc42('0x19'))['db'];var dbH=require(_0xfc42('0x19'))[_0xfc42('0x1a')];function respondWithStatusCode(_0x29ec4a,_0xc1012a){_0xc1012a=_0xc1012a||0xcc;return function(_0x5dca62){if(_0x5dca62){return _0x29ec4a[_0xfc42('0x1b')](_0xc1012a);}return _0x29ec4a[_0xfc42('0x1c')](_0xc1012a)[_0xfc42('0x1d')]();};}function respondWithResult(_0xcde6fc,_0x4c0c6e){_0x4c0c6e=_0x4c0c6e||0xc8;return function(_0x998fb){if(_0x998fb){return _0xcde6fc[_0xfc42('0x1c')](_0x4c0c6e)['json'](_0x998fb);}};}function respondWithFilteredResult(_0x5eb7b1,_0x3d27b1){return function(_0x50dd56){if(_0x50dd56){var _0x5475bc=typeof _0x3d27b1[_0xfc42('0x1e')]===_0xfc42('0x1f')&&typeof _0x3d27b1['limit']===_0xfc42('0x1f');var _0x47e199=_0x50dd56[_0xfc42('0x20')];var _0xe755b0=_0x5475bc?0x0:_0x3d27b1['offset'];var _0xb60d1=_0x5475bc?_0x50dd56[_0xfc42('0x20')]:_0x3d27b1[_0xfc42('0x1e')]+_0x3d27b1['limit'];var _0x22b7ad;if(_0xb60d1>=_0x47e199){_0xb60d1=_0x47e199;_0x22b7ad=0xc8;}else{_0x22b7ad=0xce;}_0x5eb7b1['status'](_0x22b7ad);return _0x5eb7b1[_0xfc42('0x21')]('Content-Range',_0xe755b0+'-'+_0xb60d1+'/'+_0x47e199)[_0xfc42('0x22')](_0x50dd56);}return null;};}function patchUpdates(_0xd52a3b){return function(_0x68b7d9){try{jsonpatch[_0xfc42('0x23')](_0x68b7d9,_0xd52a3b,!![]);}catch(_0xc61ee6){return BPromise['reject'](_0xc61ee6);}return _0x68b7d9[_0xfc42('0x24')]();};}function saveUpdates(_0x21a64f,_0x213436){return function(_0x75845c){if(_0x75845c){return _0x75845c['update'](_0x21a64f)[_0xfc42('0x25')](function(_0x5cf637){return _0x5cf637;});}return null;};}function removeEntity(_0x337c0b,_0x4429d5){return function(_0x5c2b3c){if(_0x5c2b3c){return _0x5c2b3c[_0xfc42('0x26')]()[_0xfc42('0x25')](function(){var _0x1bd03d=_0x5c2b3c[_0xfc42('0x27')]({'plain':!![]});var _0x1af783=_0xfc42('0x28');return db[_0xfc42('0x29')][_0xfc42('0x26')]({'where':{'type':_0x1af783,'resourceId':_0x1bd03d['id']}})[_0xfc42('0x25')](function(){return _0x5c2b3c;});})[_0xfc42('0x25')](function(){_0x337c0b[_0xfc42('0x1c')](0xcc)[_0xfc42('0x1d')]();});}};}function handleEntityNotFound(_0x3a6eef,_0x59bd99){return function(_0x58891d){if(!_0x58891d){_0x3a6eef[_0xfc42('0x1b')](0x194);}return _0x58891d;};}function handleError(_0x40a462,_0x2d5d00){_0x2d5d00=_0x2d5d00||0x1f4;return function(_0x2eb221){logger[_0xfc42('0x2a')](_0x2eb221[_0xfc42('0x2b')]);if(_0x2eb221[_0xfc42('0x2c')]){delete _0x2eb221[_0xfc42('0x2c')];}_0x40a462[_0xfc42('0x1c')](_0x2d5d00)[_0xfc42('0x2d')](_0x2eb221);};}exports[_0xfc42('0x2e')]=function(_0x16aa41,_0x1bdf2c){var _0x16ae4b={},_0x580177={},_0x2c77cf={'count':0x0,'rows':[]};var _0x1003a6=_[_0xfc42('0x2f')](db[_0xfc42('0x30')][_0xfc42('0x31')],function(_0x41f743){return{'name':_0x41f743[_0xfc42('0x32')],'type':_0x41f743[_0xfc42('0x33')][_0xfc42('0x34')]};});_0x580177[_0xfc42('0x35')]=_[_0xfc42('0x2f')](_0x1003a6,_0xfc42('0x2c'));_0x580177[_0xfc42('0x36')]=_[_0xfc42('0x37')](_0x16aa41[_0xfc42('0x36')]);_0x580177[_0xfc42('0x38')]=_[_0xfc42('0x39')](_0x580177[_0xfc42('0x35')],_0x580177[_0xfc42('0x36')]);_0x16ae4b[_0xfc42('0x3a')]=_['intersection'](_0x580177[_0xfc42('0x35')],qs[_0xfc42('0x3b')](_0x16aa41[_0xfc42('0x36')][_0xfc42('0x3b')]));_0x16ae4b[_0xfc42('0x3a')]=_0x16ae4b[_0xfc42('0x3a')][_0xfc42('0x3c')]?_0x16ae4b[_0xfc42('0x3a')]:_0x580177[_0xfc42('0x35')];if(!_0x16aa41[_0xfc42('0x36')]['hasOwnProperty'](_0xfc42('0x3d'))){_0x16ae4b[_0xfc42('0x3e')]=qs[_0xfc42('0x3e')](_0x16aa41['query']['limit']);_0x16ae4b[_0xfc42('0x1e')]=qs['offset'](_0x16aa41[_0xfc42('0x36')][_0xfc42('0x1e')]);}_0x16ae4b[_0xfc42('0x3f')]=qs[_0xfc42('0x40')](_0x16aa41['query']['sort']);_0x16ae4b[_0xfc42('0x41')]=qs[_0xfc42('0x38')](_[_0xfc42('0x42')](_0x16aa41[_0xfc42('0x36')],_0x580177[_0xfc42('0x38')]),_0x1003a6);if(_0x16aa41['query'][_0xfc42('0x43')]){_0x16ae4b['where']=_['merge'](_0x16ae4b[_0xfc42('0x41')],{'$or':_[_0xfc42('0x2f')](_0x1003a6,function(_0x477bc2){if(_0x477bc2[_0xfc42('0x33')]!==_0xfc42('0x44')){var _0x88cfd0={};_0x88cfd0[_0x477bc2['name']]={'$like':'%'+_0x16aa41[_0xfc42('0x36')][_0xfc42('0x43')]+'%'};return _0x88cfd0;}})});}_0x16ae4b=_[_0xfc42('0x45')]({},_0x16ae4b,_0x16aa41['options']);var _0x535499={'where':_0x16ae4b[_0xfc42('0x41')]};return db[_0xfc42('0x30')][_0xfc42('0x20')](_0x535499)[_0xfc42('0x25')](function(_0xcf2e0d){_0x2c77cf['count']=_0xcf2e0d;if(_0x16aa41[_0xfc42('0x36')]['includeAll']){_0x16ae4b['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x16ae4b);})[_0xfc42('0x25')](function(_0x16e790){_0x2c77cf[_0xfc42('0x46')]=_0x16e790;return _0x2c77cf;})[_0xfc42('0x25')](respondWithFilteredResult(_0x1bdf2c,_0x16ae4b))['catch'](handleError(_0x1bdf2c,null));};exports[_0xfc42('0x47')]=function(_0x1cd1be,_0x42f2b2){var _0x34638f={'raw':![],'where':{'id':_0x1cd1be[_0xfc42('0x48')]['id']}},_0x1e954a={};_0x1e954a['model']=_[_0xfc42('0x37')](db[_0xfc42('0x30')][_0xfc42('0x31')]);_0x1e954a[_0xfc42('0x36')]=_[_0xfc42('0x37')](_0x1cd1be[_0xfc42('0x36')]);_0x1e954a[_0xfc42('0x38')]=_[_0xfc42('0x39')](_0x1e954a[_0xfc42('0x35')],_0x1e954a['query']);_0x34638f[_0xfc42('0x3a')]=_[_0xfc42('0x39')](_0x1e954a['model'],qs[_0xfc42('0x3b')](_0x1cd1be[_0xfc42('0x36')][_0xfc42('0x3b')]));_0x34638f[_0xfc42('0x3a')]=_0x34638f[_0xfc42('0x3a')][_0xfc42('0x3c')]?_0x34638f[_0xfc42('0x3a')]:_0x1e954a['model'];if(_0x1cd1be['query'][_0xfc42('0x49')]){_0x34638f[_0xfc42('0x4a')]=[{'all':!![]}];}_0x34638f=_['merge']({},_0x34638f,_0x1cd1be[_0xfc42('0x4b')]);return db[_0xfc42('0x30')][_0xfc42('0x4c')](_0x34638f)[_0xfc42('0x25')](handleEntityNotFound(_0x42f2b2,null))[_0xfc42('0x25')](respondWithResult(_0x42f2b2,null))['catch'](handleError(_0x42f2b2,null));};exports['create']=function(_0x297e09,_0x76d92){return db[_0xfc42('0x30')][_0xfc42('0x4d')](_0x297e09[_0xfc42('0x4e')],{})[_0xfc42('0x25')](function(_0x552d6f){var _0x33e13f=_0x297e09['user'][_0xfc42('0x27')]({'plain':!![]});if(!_0x33e13f)throw new Error(_0xfc42('0x4f'));if(_0x33e13f[_0xfc42('0x50')]===_0xfc42('0x51')){var _0x50b7b5=_0x552d6f['get']({'plain':!![]});var _0x587d6c='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x587d6c,'userProfileId':_0x33e13f[_0xfc42('0x52')]},'raw':!![]})['then'](function(_0x3387dc){if(_0x3387dc&&_0x3387dc[_0xfc42('0x53')]===0x0){return db[_0xfc42('0x29')][_0xfc42('0x4d')]({'name':_0x50b7b5[_0xfc42('0x2c')],'resourceId':_0x50b7b5['id'],'type':_0xfc42('0x28'),'sectionId':_0x3387dc['id']},{})['then'](function(){return _0x552d6f;});}else{return _0x552d6f;}})['catch'](function(_0x204345){logger['error'](_0xfc42('0x54'),_0x204345);throw _0x204345;});}return _0x552d6f;})[_0xfc42('0x25')](respondWithResult(_0x76d92,0xc9))['catch'](handleError(_0x76d92,null));};exports['update']=function(_0xe7ecd9,_0x4bb4e5){if(_0xe7ecd9['body']['id']){delete _0xe7ecd9[_0xfc42('0x4e')]['id'];}return db[_0xfc42('0x30')][_0xfc42('0x4c')]({'where':{'id':_0xe7ecd9[_0xfc42('0x48')]['id']}})[_0xfc42('0x25')](handleEntityNotFound(_0x4bb4e5,null))[_0xfc42('0x25')](saveUpdates(_0xe7ecd9[_0xfc42('0x4e')],null))[_0xfc42('0x25')](respondWithResult(_0x4bb4e5,null))[_0xfc42('0x55')](handleError(_0x4bb4e5,null));};exports[_0xfc42('0x26')]=function(_0x2230ba,_0x458aaf){return db['AnalyticCustomReport']['find']({'where':{'id':_0x2230ba[_0xfc42('0x48')]['id']}})[_0xfc42('0x25')](handleEntityNotFound(_0x458aaf,null))[_0xfc42('0x25')](removeEntity(_0x458aaf,null))[_0xfc42('0x55')](handleError(_0x458aaf,null));};exports[_0xfc42('0x56')]=function(_0x543df9,_0x4c940a){var _0x19595b=0xa;var _0x451afe=[_0xfc42('0x57'),_0xfc42('0x58'),'right_join',_0xfc42('0x59')];var _0x19bc07={'SUM':'SUM(%s)','COUNT':_0xfc42('0x5a'),'COUNT DISTINCT':_0xfc42('0x5b'),'MAX':_0xfc42('0x5c'),'MIN':_0xfc42('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfc42('0x5e'),'GROUP_CONCAT ASC':_0xfc42('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x462445={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xfc42('0x60'),'ROUND':_0xfc42('0x61'),'UNIX_TIMESTAMP':_0xfc42('0x62')};var _0x21c87c=function(_0x58ce23){return!_[_0xfc42('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xfc42('0x64'),_0xfc42('0x65')],_0x58ce23);};var _0x12e2cc=function(_0x1b2f80){if(!_0x1b2f80||!_0x1b2f80[_0xfc42('0x66')]['length']){return'';}for(var _0x406913='(',_0x4f34d3=0x0;_0x4f34d3<_0x1b2f80[_0xfc42('0x66')][_0xfc42('0x3c')];_0x4f34d3+=0x1){_0x4f34d3>0x0&&(_0x406913+='\x20'+_0x1b2f80[_0xfc42('0x67')]+'\x20');_0x406913+=_0x1b2f80['rules'][_0x4f34d3][_0xfc42('0x68')]?_0x12e2cc(_0x1b2f80[_0xfc42('0x66')][_0x4f34d3][_0xfc42('0x68')]):_0x1b2f80[_0xfc42('0x66')][_0x4f34d3]['field']+'\x20'+_0x1b2f80[_0xfc42('0x66')][_0x4f34d3][_0xfc42('0x69')]+(_0x21c87c(_0x1b2f80[_0xfc42('0x66')][_0x4f34d3][_0xfc42('0x69')])?'\x20'+_0x1b2f80[_0xfc42('0x66')][_0x4f34d3][_0xfc42('0x6a')]:'');}return _0x406913+')';};var _0x2dcd4d={'where':{'id':_0x543df9[_0xfc42('0x48')]['id']}},_0x11c720,_0x4534f0,_0x1be528,_0x166aca,_0x4285e6;_0x2dcd4d=_[_0xfc42('0x45')]({},_0x2dcd4d,_0x543df9[_0xfc42('0x4b')]);return db[_0xfc42('0x30')][_0xfc42('0x4c')](_0x2dcd4d)[_0xfc42('0x25')](function(_0x41e6ee){if(_0x41e6ee){_0x11c720=_0x41e6ee;return _0x41e6ee[_0xfc42('0x6b')]();}return null;})['then'](function(_0x387634){if(_0x387634){if(!_0x387634[_0xfc42('0x3c')]){throw new db[(_0xfc42('0x6c'))][(_0xfc42('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4534f0=_0x387634;return db[_0xfc42('0x6e')][_0xfc42('0x6f')]({'raw':!![]});}return null;})[_0xfc42('0x25')](function(_0xa5211d){if(_0xa5211d){_0x1be528=_[_0xfc42('0x70')](_0xa5211d,'id');var _0x5af06f;var _0x23cfde=squel[_0xfc42('0x71')]();_0x23cfde[_0xfc42('0x72')](_0x11c720[_0xfc42('0x73')]);for(var _0x5566d8=0x0;_0x5566d8<_0x4534f0[_0xfc42('0x3c')];_0x5566d8+=0x1){_0x5af06f=_0x4534f0[_0x5566d8]['MetricId']?_0x1be528[_0x4534f0[_0x5566d8]['MetricId']][_0xfc42('0x74')]:_0x4534f0[_0x5566d8][_0xfc42('0x75')];_0x5af06f=_0x4534f0[_0x5566d8][_0xfc42('0x76')]?_[_0xfc42('0x77')](_0x19bc07[_0x4534f0[_0x5566d8][_0xfc42('0x76')]],'%s',_0x5af06f):_0x5af06f;_0x5af06f=_0x4534f0[_0x5566d8][_0xfc42('0x78')]?_[_0xfc42('0x77')](_0x462445[_0x4534f0[_0x5566d8]['format']],'%s',_0x5af06f):_0x5af06f;if(_0x4534f0[_0x5566d8]['groupBy']){_0x23cfde[_0xfc42('0x68')](_0x5af06f);}_0x4534f0[_0x5566d8][_0xfc42('0x79')]&&_0x23cfde[_0xfc42('0x3f')](_0x5af06f,_0x4534f0[_0x5566d8][_0xfc42('0x79')]==='DESC'?![]:!![]);_0x23cfde[_0xfc42('0x75')](_0x5af06f,_0x4534f0[_0x5566d8]['alias']||_0x5af06f);}if(_0x11c720[_0xfc42('0x7a')]){_0x11c720[_0xfc42('0x7a')]=JSON[_0xfc42('0x7b')](_0x11c720['joins']);for(var _0x2e97af=0x0;_0x2e97af<_0x11c720[_0xfc42('0x7a')][_0xfc42('0x3c')];_0x2e97af+=0x1){if(_0x11c720[_0xfc42('0x7a')][_0x2e97af][_0xfc42('0x33')]&&_['includes'](_0x451afe,_0x11c720[_0xfc42('0x7a')][_0x2e97af][_0xfc42('0x33')])&&_0x11c720['joins'][_0x2e97af]['parentKey']&&_0x11c720[_0xfc42('0x7a')][_0x2e97af]['foreignTable']&&_0x11c720[_0xfc42('0x7a')][_0x2e97af][_0xfc42('0x7c')]){_0x23cfde[_0x11c720[_0xfc42('0x7a')][_0x2e97af][_0xfc42('0x33')]](_0x11c720[_0xfc42('0x7a')][_0x2e97af][_0xfc42('0x7d')],null,util['format'](_0xfc42('0x7e'),_0x11c720[_0xfc42('0x73')],_0x11c720[_0xfc42('0x7a')][_0x2e97af][_0xfc42('0x7f')],_0x11c720[_0xfc42('0x7a')][_0x2e97af]['foreignTable'],_0x11c720['joins'][_0x2e97af][_0xfc42('0x7c')]));}}}if(_0x11c720['conditions']){_0x11c720[_0xfc42('0x80')]=JSON['parse'](_0x11c720[_0xfc42('0x80')]);_0x23cfde[_0xfc42('0x41')](_0x12e2cc(_0x11c720[_0xfc42('0x80')]['group']));}_0x4285e6=_0x23cfde[_0xfc42('0x81')]();_0x23cfde[_0xfc42('0x3e')](_0x19595b);_0x23cfde[_0xfc42('0x1e')](0x0);logger[_0xfc42('0x82')](_0xfc42('0x83'),_0x23cfde[_0xfc42('0x84')]());return dbH['sequelize'][_0xfc42('0x36')](_0x23cfde[_0xfc42('0x84')](),{'type':dbH['sequelize'][_0xfc42('0x85')]['SELECT']});}})[_0xfc42('0x25')](respondWithResult(_0x4c940a,null))[_0xfc42('0x55')](handleError(_0x4c940a,null));};function runReport(_0x42eb6b,_0x860f01,_0x12903d){var _0x110135=_0x860f01[_0xfc42('0x2c')];var _0x3f0956=0xa;var _0x2e68e4=[_0xfc42('0x57'),_0xfc42('0x58'),_0xfc42('0x86'),_0xfc42('0x59')];var _0x4ee9ab={'SUM':_0xfc42('0x87'),'COUNT':_0xfc42('0x5a'),'COUNT DISTINCT':_0xfc42('0x5b'),'MAX':_0xfc42('0x5c'),'MIN':'MIN(%s)','AVG':_0xfc42('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfc42('0x5f'),'GROUP_CONCAT DESC':_0xfc42('0x89')};var _0x3e160a={'SEC_TO_TIME':_0xfc42('0x8a'),'DATE':_0xfc42('0x8b'),'HOUR':_0xfc42('0x60'),'ROUND':_0xfc42('0x61'),'UNIX_TIMESTAMP':_0xfc42('0x62')};var _0x10c5c3=function(_0xd3f2f4){return!_['includes']([_0xfc42('0x8c'),_0xfc42('0x8d'),_0xfc42('0x64'),_0xfc42('0x65')],_0xd3f2f4);};var _0x178579=function(_0xc36e49){if(!_0xc36e49||!_0xc36e49[_0xfc42('0x66')][_0xfc42('0x3c')]){return'';}for(var _0x1a4c4d='(',_0x386117=0x0;_0x386117<_0xc36e49[_0xfc42('0x66')][_0xfc42('0x3c')];_0x386117+=0x1){_0x386117>0x0&&(_0x1a4c4d+='\x20'+_0xc36e49['operator']+'\x20');_0x1a4c4d+=_0xc36e49[_0xfc42('0x66')][_0x386117]['group']?_0x178579(_0xc36e49['rules'][_0x386117][_0xfc42('0x68')]):_0xc36e49[_0xfc42('0x66')][_0x386117][_0xfc42('0x75')]+'\x20'+_0xc36e49[_0xfc42('0x66')][_0x386117][_0xfc42('0x69')]+(_0x10c5c3(_0xc36e49['rules'][_0x386117]['condition'])?'\x20'+_0xc36e49[_0xfc42('0x66')][_0x386117][_0xfc42('0x6a')]:'');}return _0x1a4c4d+')';};var _0x5ed4e1={'where':{'id':_0x42eb6b['id']}},_0x247b8d,_0x2f74be,_0x9085de,_0x32e87a,_0x4f9442;_0x5ed4e1=_[_0xfc42('0x45')]({},_0x5ed4e1,_0x12903d);return db[_0xfc42('0x30')][_0xfc42('0x4c')](_0x5ed4e1)[_0xfc42('0x25')](function(_0x364c77){if(_0x364c77){_0x247b8d=_0x364c77;return _0x364c77['getFields']();}return null;})[_0xfc42('0x25')](function(_0x24bc1a){if(_0x24bc1a){if(!_0x24bc1a[_0xfc42('0x3c')]){throw new db[(_0xfc42('0x6c'))][(_0xfc42('0x6d'))](_0xfc42('0x8e'),0x193);}_0x2f74be=_0x24bc1a;return db[_0xfc42('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xfc42('0x25')](function(_0x431af2){if(_0x431af2){_0x9085de=_[_0xfc42('0x70')](_0x431af2,'id');var _0x96a9ea;var _0x5602d3=squel[_0xfc42('0x71')]();_0x5602d3[_0xfc42('0x72')](_0x247b8d[_0xfc42('0x73')]);for(var _0x1563c9=0x0;_0x1563c9<_0x2f74be[_0xfc42('0x3c')];_0x1563c9+=0x1){_0x96a9ea=_0x2f74be[_0x1563c9]['MetricId']?_0x9085de[_0x2f74be[_0x1563c9][_0xfc42('0x8f')]][_0xfc42('0x74')]:_0x2f74be[_0x1563c9][_0xfc42('0x75')];_0x96a9ea=_0x2f74be[_0x1563c9][_0xfc42('0x76')]?_[_0xfc42('0x77')](_0x4ee9ab[_0x2f74be[_0x1563c9]['function']],'%s',_0x96a9ea):_0x96a9ea;_0x96a9ea=_0x2f74be[_0x1563c9][_0xfc42('0x78')]?_[_0xfc42('0x77')](_0x3e160a[_0x2f74be[_0x1563c9][_0xfc42('0x78')]],'%s',_0x96a9ea):_0x96a9ea;if(_0x2f74be[_0x1563c9][_0xfc42('0x90')]){_0x5602d3[_0xfc42('0x68')](_0x96a9ea);}_0x2f74be[_0x1563c9][_0xfc42('0x79')]&&_0x5602d3['order'](_0x96a9ea,_0x2f74be[_0x1563c9][_0xfc42('0x79')]===_0xfc42('0x91')?![]:!![]);_0x5602d3[_0xfc42('0x75')](_0x96a9ea,_0x2f74be[_0x1563c9][_0xfc42('0x92')]||_0x96a9ea);}if(_0x247b8d[_0xfc42('0x7a')]){_0x247b8d['joins']=JSON['parse'](_0x247b8d[_0xfc42('0x7a')]);for(var _0xa326af=0x0;_0xa326af<_0x247b8d[_0xfc42('0x7a')][_0xfc42('0x3c')];_0xa326af+=0x1){if(_0x247b8d[_0xfc42('0x7a')][_0xa326af][_0xfc42('0x33')]&&_[_0xfc42('0x63')](_0x2e68e4,_0x247b8d[_0xfc42('0x7a')][_0xa326af][_0xfc42('0x33')])&&_0x247b8d[_0xfc42('0x7a')][_0xa326af][_0xfc42('0x7f')]&&_0x247b8d['joins'][_0xa326af]['foreignTable']&&_0x247b8d[_0xfc42('0x7a')][_0xa326af]['foreignKey']){_0x5602d3[_0x247b8d[_0xfc42('0x7a')][_0xa326af][_0xfc42('0x33')]](_0x247b8d[_0xfc42('0x7a')][_0xa326af][_0xfc42('0x7d')],null,util['format'](_0xfc42('0x7e'),_0x247b8d[_0xfc42('0x73')],_0x247b8d['joins'][_0xa326af]['parentKey'],_0x247b8d[_0xfc42('0x7a')][_0xa326af][_0xfc42('0x7d')],_0x247b8d[_0xfc42('0x7a')][_0xa326af]['foreignKey']));}}}if(_0x247b8d['conditions']){_0x247b8d[_0xfc42('0x80')]=JSON[_0xfc42('0x7b')](_0x247b8d[_0xfc42('0x80')]);_0x5602d3['where'](_0x178579(_0x247b8d['conditions'][_0xfc42('0x68')]));}_0x4f9442=_0x5602d3[_0xfc42('0x81')]();_0x5602d3[_0xfc42('0x3e')](_0x3f0956);_0x5602d3[_0xfc42('0x1e')](0x0);return;}})[_0xfc42('0x25')](function(){if(_0x860f01[_0xfc42('0x93')]==='web'){return null;}var _0x43344f=_[_0xfc42('0x45')](_0x860f01,{'name':_0x860f01['fullPath']||_0x860f01[_0xfc42('0x2c')]||_0x247b8d[_0xfc42('0x2c')],'basename':_0x110135,'savename':util[_0xfc42('0x78')](_0xfc42('0x94'),_0x860f01[_0xfc42('0x2c')]||_0x247b8d[_0xfc42('0x2c')],require(_0xfc42('0x95'))[_0xfc42('0x96')](0x4),_0x860f01['output']||'csv'),'reportId':_0x247b8d['id'],'reportType':_0xfc42('0x97')});return db[_0xfc42('0x98')][_0xfc42('0x4d')](_0x43344f,{'raw':!![]});})['then'](function(_0x5e95b9){if(_0x247b8d[_0xfc42('0x73')]==='cdr'){_0x4f9442[_0xfc42('0x41')](_0x247b8d['table']+_0xfc42('0x99'),_0x860f01['startDate'],_0x860f01[_0xfc42('0x9a')]);}else{_0x4f9442[_0xfc42('0x41')](_0x247b8d['table']+_0xfc42('0x9b'),_0x860f01[_0xfc42('0x9c')],_0x860f01[_0xfc42('0x9a')]);}if(_0x5e95b9){logger[_0xfc42('0x9d')](_0xfc42('0x9e'),_0x4f9442['toString']());require('child_process')[_0xfc42('0x9f')](path[_0xfc42('0x57')](__dirname,_0xfc42('0xa0'),_0x5e95b9[_0xfc42('0x93')]),[_0x5e95b9['id'],_0x4f9442['toString'](),path[_0xfc42('0x57')](__dirname,_0xfc42('0xa1'),_0x5e95b9[_0xfc42('0xa2')]),_0x110135]);return _0x5e95b9;}else{var _0x51785d=squel['select']();_0x51785d[_0xfc42('0x72')]('('+_0x4f9442[_0xfc42('0x84')]()+')',_0xfc42('0xa3'));_0x51785d[_0xfc42('0x75')](_0xfc42('0xa4'),'count');_0x4f9442['limit'](_0x860f01[_0xfc42('0x3e')]||_0x3f0956);_0x4f9442[_0xfc42('0x1e')](_0x860f01['offset']||0x0);return dbH[_0xfc42('0xa5')][_0xfc42('0x36')](_0x51785d[_0xfc42('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0xfc42('0xa6')]})[_0xfc42('0x25')](function(_0x51a1f9){if(!_0x51a1f9[_0xfc42('0x3c')]){_0x32e87a=0x0;}else{_0x32e87a=_0x51a1f9[0x0]['count']||0x0;}return dbH[_0xfc42('0xa5')][_0xfc42('0x36')](_0x4f9442[_0xfc42('0x84')](),{'type':dbH[_0xfc42('0xa5')][_0xfc42('0x85')]['SELECT']});})[_0xfc42('0x25')](function(_0x544205){return{'rows':_0x544205||[],'count':_0x32e87a};});}});}exports[_0xfc42('0xa7')]=function(_0x5c68c3,_0x23187c){return runReport(_0x5c68c3[_0xfc42('0x48')],_0x5c68c3['query'],_0x5c68c3[_0xfc42('0x4b')])[_0xfc42('0x25')](respondWithResult(_0x23187c,null))[_0xfc42('0x55')](handleError(_0x23187c,null));};exports[_0xfc42('0xa8')]=runReport;exports[_0xfc42('0x36')]=function(_0x5a2cad,_0x57cbac){var _0x46da70=0xa;var _0x36e115=[_0xfc42('0x57'),_0xfc42('0x58'),'right_join',_0xfc42('0x59')];var _0x5cc276={'SUM':_0xfc42('0x87'),'COUNT':_0xfc42('0x5a'),'COUNT DISTINCT':_0xfc42('0x5b'),'MAX':_0xfc42('0x5c'),'MIN':_0xfc42('0x5d'),'AVG':_0xfc42('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfc42('0x5f'),'GROUP_CONCAT DESC':_0xfc42('0x89')};var _0x25da8d={'SEC_TO_TIME':_0xfc42('0x8a'),'DATE':_0xfc42('0x8b'),'HOUR':_0xfc42('0x60'),'ROUND':_0xfc42('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2909dc=function(_0x195832){return!_[_0xfc42('0x63')](['IS\x20NULL',_0xfc42('0x8d'),_0xfc42('0x64'),_0xfc42('0x65')],_0x195832);};var _0x53fa2d=function(_0x56ecf3){if(!_0x56ecf3||!_0x56ecf3[_0xfc42('0x66')][_0xfc42('0x3c')]){return'';}for(var _0x21c427='(',_0x589044=0x0;_0x589044<_0x56ecf3[_0xfc42('0x66')][_0xfc42('0x3c')];_0x589044+=0x1){_0x589044>0x0&&(_0x21c427+='\x20'+_0x56ecf3[_0xfc42('0x67')]+'\x20');_0x21c427+=_0x56ecf3['rules'][_0x589044][_0xfc42('0x68')]?_0x53fa2d(_0x56ecf3[_0xfc42('0x66')][_0x589044][_0xfc42('0x68')]):_0x56ecf3[_0xfc42('0x66')][_0x589044]['field']+'\x20'+_0x56ecf3['rules'][_0x589044][_0xfc42('0x69')]+(_0x2909dc(_0x56ecf3[_0xfc42('0x66')][_0x589044]['condition'])?'\x20'+_0x56ecf3[_0xfc42('0x66')][_0x589044][_0xfc42('0x6a')]:'');}return _0x21c427+')';};var _0x3a16d7={'where':{'id':_0x5a2cad[_0xfc42('0x48')]['id']}},_0x125610,_0x3b1c90,_0x36d390,_0x2794c1,_0x4815b0;_0x3a16d7=_[_0xfc42('0x45')]({},_0x3a16d7,_0x5a2cad[_0xfc42('0x4b')]);return db['AnalyticCustomReport'][_0xfc42('0x4c')](_0x3a16d7)['then'](function(_0x41fde2){if(_0x41fde2){_0x125610=_0x41fde2;return _0x41fde2['getFields']();}return null;})[_0xfc42('0x25')](function(_0x36bf2f){if(_0x36bf2f){if(!_0x36bf2f[_0xfc42('0x3c')]){throw new db[(_0xfc42('0x6c'))][(_0xfc42('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3b1c90=_0x36bf2f;return db[_0xfc42('0x6e')][_0xfc42('0x6f')]({'raw':!![]});}return null;})[_0xfc42('0x25')](function(_0x39f220){if(_0x39f220){_0x36d390=_[_0xfc42('0x70')](_0x39f220,'id');var _0x1cbedd;var _0x491fee=squel['select']();_0x491fee[_0xfc42('0x72')](_0x125610['table']);for(var _0x5a4191=0x0;_0x5a4191<_0x3b1c90[_0xfc42('0x3c')];_0x5a4191+=0x1){_0x1cbedd=_0x3b1c90[_0x5a4191][_0xfc42('0x8f')]?_0x36d390[_0x3b1c90[_0x5a4191]['MetricId']][_0xfc42('0x74')]:_0x3b1c90[_0x5a4191][_0xfc42('0x75')];_0x1cbedd=_0x3b1c90[_0x5a4191][_0xfc42('0x76')]?_[_0xfc42('0x77')](_0x5cc276[_0x3b1c90[_0x5a4191]['function']],'%s',_0x1cbedd):_0x1cbedd;_0x1cbedd=_0x3b1c90[_0x5a4191][_0xfc42('0x78')]?_[_0xfc42('0x77')](_0x25da8d[_0x3b1c90[_0x5a4191][_0xfc42('0x78')]],'%s',_0x1cbedd):_0x1cbedd;if(_0x3b1c90[_0x5a4191][_0xfc42('0x90')]){_0x491fee[_0xfc42('0x68')](_0x1cbedd);}_0x3b1c90[_0x5a4191][_0xfc42('0x79')]&&_0x491fee['order'](_0x1cbedd,_0x3b1c90[_0x5a4191][_0xfc42('0x79')]===_0xfc42('0x91')?![]:!![]);_0x491fee[_0xfc42('0x75')](_0x1cbedd,_0x3b1c90[_0x5a4191][_0xfc42('0x92')]||_0x1cbedd);}if(_0x125610[_0xfc42('0x7a')]){_0x125610[_0xfc42('0x7a')]=JSON['parse'](_0x125610[_0xfc42('0x7a')]);for(var _0x1baaec=0x0;_0x1baaec<_0x125610['joins']['length'];_0x1baaec+=0x1){if(_0x125610[_0xfc42('0x7a')][_0x1baaec][_0xfc42('0x33')]&&_['includes'](_0x36e115,_0x125610['joins'][_0x1baaec][_0xfc42('0x33')])&&_0x125610[_0xfc42('0x7a')][_0x1baaec][_0xfc42('0x7f')]&&_0x125610[_0xfc42('0x7a')][_0x1baaec][_0xfc42('0x7d')]&&_0x125610[_0xfc42('0x7a')][_0x1baaec]['foreignKey']){_0x491fee[_0x125610[_0xfc42('0x7a')][_0x1baaec]['type']](_0x125610['joins'][_0x1baaec][_0xfc42('0x7d')],null,util[_0xfc42('0x78')](_0xfc42('0x7e'),_0x125610[_0xfc42('0x73')],_0x125610[_0xfc42('0x7a')][_0x1baaec][_0xfc42('0x7f')],_0x125610[_0xfc42('0x7a')][_0x1baaec][_0xfc42('0x7d')],_0x125610[_0xfc42('0x7a')][_0x1baaec][_0xfc42('0x7c')]));}}}if(_0x125610[_0xfc42('0x80')]){_0x125610[_0xfc42('0x80')]=JSON[_0xfc42('0x7b')](_0x125610[_0xfc42('0x80')]);_0x491fee[_0xfc42('0x41')](_0x53fa2d(_0x125610['conditions'][_0xfc42('0x68')]));}_0x4815b0=_0x491fee[_0xfc42('0x81')]();_0x491fee[_0xfc42('0x3e')](_0x46da70);_0x491fee[_0xfc42('0x1e')](0x0);logger[_0xfc42('0x82')]('Limited\x20Query:',_0x491fee['toString']());return dbH[_0xfc42('0xa5')][_0xfc42('0x36')](_0x491fee['toString'](),{'type':dbH[_0xfc42('0xa5')]['QueryTypes'][_0xfc42('0xa6')]});}})[_0xfc42('0x25')](function(){return{'sql':_0x4815b0[_0xfc42('0x84')]()};})['then'](respondWithResult(_0x57cbac,null))[_0xfc42('0x55')](handleError(_0x57cbac,null));};
\ No newline at end of file
+var _0x7644=['value','clone','rimraf','zip-dir','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','offset','count','set','reject','save','update','destroy','then','get','UserProfileResource','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','SUM(%s)','COUNT(%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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','format','replace','orderBy','DESC','joins','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','cross_join','MAX(%s)','AVG(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','ValidationErrorItem','select','groupBy','alias','web','%s-%s.%s','output','csv','custom','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','savename','countTable','run','runReport'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7644,0x1d9));var _0x4764=function(_0x1d7571,_0x3f9a4e){_0x1d7571=_0x1d7571-0x0;var _0x1b3459=_0x7644[_0x1d7571];return _0x1b3459;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4764('0x0'));var zipdir=require(_0x4764('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4764('0x2'));var BPromise=require(_0x4764('0x3'));var Mustache=require('mustache');var util=require(_0x4764('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4764('0x5'));var ejs=require(_0x4764('0x6'));var fs=require('fs');var fs_extra=require(_0x4764('0x7'));var _=require(_0x4764('0x8'));var squel=require('squel');var crypto=require(_0x4764('0x9'));var jsforce=require(_0x4764('0xa'));var deskjs=require(_0x4764('0xb'));var toCsv=require(_0x4764('0x5'));var querystring=require(_0x4764('0xc'));var Papa=require(_0x4764('0xd'));var Redis=require('ioredis');var authService=require(_0x4764('0xe'));var qs=require(_0x4764('0xf'));var as=require(_0x4764('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4764('0x11'));var config=require(_0x4764('0x12'));var licenseUtil=require(_0x4764('0x13'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x32a7bf,_0x3740f7){_0x3740f7=_0x3740f7||0xcc;return function(_0x4b339f){if(_0x4b339f){return _0x32a7bf['sendStatus'](_0x3740f7);}return _0x32a7bf['status'](_0x3740f7)[_0x4764('0x14')]();};}function respondWithResult(_0x37f47f,_0x7610e3){_0x7610e3=_0x7610e3||0xc8;return function(_0x43386a){if(_0x43386a){return _0x37f47f[_0x4764('0x15')](_0x7610e3)[_0x4764('0x16')](_0x43386a);}};}function respondWithFilteredResult(_0x1ecbbf,_0x14cab3){return function(_0x4f7091){if(_0x4f7091){var _0x222d2d=typeof _0x14cab3['offset']===_0x4764('0x17')&&typeof _0x14cab3['limit']===_0x4764('0x17');var _0x3de95f=_0x4f7091['count'];var _0x18f491=_0x222d2d?0x0:_0x14cab3[_0x4764('0x18')];var _0x197d49=_0x222d2d?_0x4f7091[_0x4764('0x19')]:_0x14cab3[_0x4764('0x18')]+_0x14cab3['limit'];var _0x3dcb85;if(_0x197d49>=_0x3de95f){_0x197d49=_0x3de95f;_0x3dcb85=0xc8;}else{_0x3dcb85=0xce;}_0x1ecbbf[_0x4764('0x15')](_0x3dcb85);return _0x1ecbbf[_0x4764('0x1a')]('Content-Range',_0x18f491+'-'+_0x197d49+'/'+_0x3de95f)['json'](_0x4f7091);}return null;};}function patchUpdates(_0x3d348a){return function(_0x37c4b9){try{jsonpatch['apply'](_0x37c4b9,_0x3d348a,!![]);}catch(_0x3e5f72){return BPromise[_0x4764('0x1b')](_0x3e5f72);}return _0x37c4b9[_0x4764('0x1c')]();};}function saveUpdates(_0x5aaf24,_0x213525){return function(_0xeedecc){if(_0xeedecc){return _0xeedecc[_0x4764('0x1d')](_0x5aaf24)['then'](function(_0x35a47f){return _0x35a47f;});}return null;};}function removeEntity(_0x27d5f1,_0x5a6a4d){return function(_0x36fe91){if(_0x36fe91){return _0x36fe91[_0x4764('0x1e')]()[_0x4764('0x1f')](function(){var _0x46d4d=_0x36fe91[_0x4764('0x20')]({'plain':!![]});var _0x565429='CustomReports';return db[_0x4764('0x21')][_0x4764('0x1e')]({'where':{'type':_0x565429,'resourceId':_0x46d4d['id']}})[_0x4764('0x1f')](function(){return _0x36fe91;});})[_0x4764('0x1f')](function(){_0x27d5f1[_0x4764('0x15')](0xcc)[_0x4764('0x14')]();});}};}function handleEntityNotFound(_0x1f82da,_0x1a0701){return function(_0x125258){if(!_0x125258){_0x1f82da['sendStatus'](0x194);}return _0x125258;};}function handleError(_0x35d4c9,_0x133c3b){_0x133c3b=_0x133c3b||0x1f4;return function(_0x4f8114){logger[_0x4764('0x22')](_0x4f8114['stack']);if(_0x4f8114['name']){delete _0x4f8114[_0x4764('0x23')];}_0x35d4c9[_0x4764('0x15')](_0x133c3b)[_0x4764('0x24')](_0x4f8114);};}exports[_0x4764('0x25')]=function(_0x367e49,_0x49e5b0){var _0x1f0b81={},_0x4913f2={},_0x439aec={'count':0x0,'rows':[]};var _0x64421e=_[_0x4764('0x26')](db[_0x4764('0x27')][_0x4764('0x28')],function(_0x4dfa27){return{'name':_0x4dfa27[_0x4764('0x29')],'type':_0x4dfa27[_0x4764('0x2a')][_0x4764('0x2b')]};});_0x4913f2['model']=_[_0x4764('0x26')](_0x64421e,_0x4764('0x23'));_0x4913f2[_0x4764('0x2c')]=_['keys'](_0x367e49['query']);_0x4913f2[_0x4764('0x2d')]=_[_0x4764('0x2e')](_0x4913f2[_0x4764('0x2f')],_0x4913f2[_0x4764('0x2c')]);_0x1f0b81[_0x4764('0x30')]=_[_0x4764('0x2e')](_0x4913f2[_0x4764('0x2f')],qs[_0x4764('0x31')](_0x367e49[_0x4764('0x2c')][_0x4764('0x31')]));_0x1f0b81[_0x4764('0x30')]=_0x1f0b81[_0x4764('0x30')]['length']?_0x1f0b81['attributes']:_0x4913f2[_0x4764('0x2f')];if(!_0x367e49[_0x4764('0x2c')][_0x4764('0x32')](_0x4764('0x33'))){_0x1f0b81[_0x4764('0x34')]=qs[_0x4764('0x34')](_0x367e49['query'][_0x4764('0x34')]);_0x1f0b81[_0x4764('0x18')]=qs[_0x4764('0x18')](_0x367e49[_0x4764('0x2c')][_0x4764('0x18')]);}_0x1f0b81[_0x4764('0x35')]=qs['sort'](_0x367e49[_0x4764('0x2c')]['sort']);_0x1f0b81[_0x4764('0x36')]=qs[_0x4764('0x2d')](_[_0x4764('0x37')](_0x367e49[_0x4764('0x2c')],_0x4913f2[_0x4764('0x2d')]),_0x64421e);if(_0x367e49[_0x4764('0x2c')][_0x4764('0x38')]){_0x1f0b81['where']=_['merge'](_0x1f0b81[_0x4764('0x36')],{'$or':_[_0x4764('0x26')](_0x64421e,function(_0x1f2bbe){if(_0x1f2bbe[_0x4764('0x2a')]!==_0x4764('0x39')){var _0x4228cc={};_0x4228cc[_0x1f2bbe['name']]={'$like':'%'+_0x367e49[_0x4764('0x2c')][_0x4764('0x38')]+'%'};return _0x4228cc;}})});}_0x1f0b81=_[_0x4764('0x3a')]({},_0x1f0b81,_0x367e49[_0x4764('0x3b')]);var _0x315527={'where':_0x1f0b81[_0x4764('0x36')]};return db[_0x4764('0x27')][_0x4764('0x19')](_0x315527)[_0x4764('0x1f')](function(_0x497899){_0x439aec[_0x4764('0x19')]=_0x497899;if(_0x367e49['query'][_0x4764('0x3c')]){_0x1f0b81[_0x4764('0x3d')]=[{'all':!![]}];}return db[_0x4764('0x27')][_0x4764('0x3e')](_0x1f0b81);})['then'](function(_0x200e45){_0x439aec[_0x4764('0x3f')]=_0x200e45;return _0x439aec;})[_0x4764('0x1f')](respondWithFilteredResult(_0x49e5b0,_0x1f0b81))[_0x4764('0x40')](handleError(_0x49e5b0,null));};exports[_0x4764('0x41')]=function(_0xd993ca,_0x4e7d65){var _0x31e721={'raw':![],'where':{'id':_0xd993ca[_0x4764('0x42')]['id']}},_0x1ac7c2={};_0x1ac7c2[_0x4764('0x2f')]=_[_0x4764('0x43')](db[_0x4764('0x27')]['rawAttributes']);_0x1ac7c2[_0x4764('0x2c')]=_[_0x4764('0x43')](_0xd993ca[_0x4764('0x2c')]);_0x1ac7c2['filters']=_[_0x4764('0x2e')](_0x1ac7c2[_0x4764('0x2f')],_0x1ac7c2[_0x4764('0x2c')]);_0x31e721['attributes']=_[_0x4764('0x2e')](_0x1ac7c2['model'],qs[_0x4764('0x31')](_0xd993ca['query'][_0x4764('0x31')]));_0x31e721[_0x4764('0x30')]=_0x31e721[_0x4764('0x30')][_0x4764('0x44')]?_0x31e721['attributes']:_0x1ac7c2[_0x4764('0x2f')];if(_0xd993ca[_0x4764('0x2c')][_0x4764('0x3c')]){_0x31e721['include']=[{'all':!![]}];}_0x31e721=_[_0x4764('0x3a')]({},_0x31e721,_0xd993ca['options']);return db[_0x4764('0x27')]['find'](_0x31e721)['then'](handleEntityNotFound(_0x4e7d65,null))[_0x4764('0x1f')](respondWithResult(_0x4e7d65,null))[_0x4764('0x40')](handleError(_0x4e7d65,null));};exports[_0x4764('0x45')]=function(_0xd44e0,_0x88b3ce){return db[_0x4764('0x27')]['create'](_0xd44e0['body'],{})['then'](function(_0xec3975){var _0x1243d6=_0xd44e0['user'][_0x4764('0x20')]({'plain':!![]});if(!_0x1243d6)throw new Error(_0x4764('0x46'));if(_0x1243d6[_0x4764('0x47')]===_0x4764('0x48')){var _0x3f7a57=_0xec3975[_0x4764('0x20')]({'plain':!![]});var _0x16f8d5=_0x4764('0x49');return db[_0x4764('0x4a')][_0x4764('0x4b')]({'where':{'name':_0x16f8d5,'userProfileId':_0x1243d6[_0x4764('0x4c')]},'raw':!![]})[_0x4764('0x1f')](function(_0x37660c){if(_0x37660c&&_0x37660c[_0x4764('0x4d')]===0x0){return db[_0x4764('0x21')][_0x4764('0x45')]({'name':_0x3f7a57['name'],'resourceId':_0x3f7a57['id'],'type':'CustomReports','sectionId':_0x37660c['id']},{})[_0x4764('0x1f')](function(){return _0xec3975;});}else{return _0xec3975;}})[_0x4764('0x40')](function(_0x5448d9){logger[_0x4764('0x22')](_0x4764('0x4e'),_0x5448d9);throw _0x5448d9;});}return _0xec3975;})['then'](respondWithResult(_0x88b3ce,0xc9))[_0x4764('0x40')](handleError(_0x88b3ce,null));};exports[_0x4764('0x1d')]=function(_0x54ff9e,_0x3dd29f){if(_0x54ff9e[_0x4764('0x4f')]['id']){delete _0x54ff9e['body']['id'];}return db[_0x4764('0x27')][_0x4764('0x4b')]({'where':{'id':_0x54ff9e[_0x4764('0x42')]['id']}})[_0x4764('0x1f')](handleEntityNotFound(_0x3dd29f,null))['then'](saveUpdates(_0x54ff9e[_0x4764('0x4f')],null))[_0x4764('0x1f')](respondWithResult(_0x3dd29f,null))[_0x4764('0x40')](handleError(_0x3dd29f,null));};exports[_0x4764('0x1e')]=function(_0x3d52af,_0x5a42f1){return db[_0x4764('0x27')]['find']({'where':{'id':_0x3d52af[_0x4764('0x42')]['id']}})[_0x4764('0x1f')](handleEntityNotFound(_0x5a42f1,null))['then'](removeEntity(_0x5a42f1,null))[_0x4764('0x40')](handleError(_0x5a42f1,null));};exports[_0x4764('0x50')]=function(_0x1730ff,_0x53f3bf){var _0x11d06c=0xa;var _0x2cd92f=[_0x4764('0x51'),'left_join',_0x4764('0x52'),'cross_join'];var _0x39da8b={'SUM':_0x4764('0x53'),'COUNT':_0x4764('0x54'),'COUNT DISTINCT':_0x4764('0x55'),'MAX':'MAX(%s)','MIN':_0x4764('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4764('0x57'),'GROUP_CONCAT ASC':_0x4764('0x58'),'GROUP_CONCAT DESC':_0x4764('0x59')};var _0x1ca435={'SEC_TO_TIME':_0x4764('0x5a'),'DATE':_0x4764('0x5b'),'HOUR':_0x4764('0x5c'),'ROUND':_0x4764('0x5d'),'UNIX_TIMESTAMP':_0x4764('0x5e')};var _0x3c939f=function(_0x53639e){return!_['includes']([_0x4764('0x5f'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x4764('0x60')],_0x53639e);};var _0x3aec08=function(_0x4416f9){if(!_0x4416f9||!_0x4416f9['rules']['length']){return'';}for(var _0x21292c='(',_0x1c38f8=0x0;_0x1c38f8<_0x4416f9['rules'][_0x4764('0x44')];_0x1c38f8+=0x1){_0x1c38f8>0x0&&(_0x21292c+='\x20'+_0x4416f9['operator']+'\x20');_0x21292c+=_0x4416f9[_0x4764('0x61')][_0x1c38f8][_0x4764('0x62')]?_0x3aec08(_0x4416f9[_0x4764('0x61')][_0x1c38f8][_0x4764('0x62')]):_0x4416f9[_0x4764('0x61')][_0x1c38f8][_0x4764('0x63')]+'\x20'+_0x4416f9['rules'][_0x1c38f8][_0x4764('0x64')]+(_0x3c939f(_0x4416f9[_0x4764('0x61')][_0x1c38f8][_0x4764('0x64')])?'\x20'+_0x4416f9[_0x4764('0x61')][_0x1c38f8]['value']:'');}return _0x21292c+')';};var _0x7b4350={'where':{'id':_0x1730ff[_0x4764('0x42')]['id']}},_0x2b5956,_0x14abb7,_0x48f210,_0x18da37,_0x49b7a1;_0x7b4350=_[_0x4764('0x3a')]({},_0x7b4350,_0x1730ff[_0x4764('0x3b')]);return db[_0x4764('0x27')][_0x4764('0x4b')](_0x7b4350)[_0x4764('0x1f')](function(_0x41b2f6){if(_0x41b2f6){_0x2b5956=_0x41b2f6;return _0x41b2f6[_0x4764('0x65')]();}return null;})[_0x4764('0x1f')](function(_0x283ccf){if(_0x283ccf){if(!_0x283ccf['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x4764('0x66'),0x193);}_0x14abb7=_0x283ccf;return db[_0x4764('0x67')][_0x4764('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x58a186){if(_0x58a186){_0x48f210=_[_0x4764('0x68')](_0x58a186,'id');var _0x87469e;var _0x475639=squel['select']();_0x475639[_0x4764('0x69')](_0x2b5956['table']);for(var _0x1476a6=0x0;_0x1476a6<_0x14abb7['length'];_0x1476a6+=0x1){_0x87469e=_0x14abb7[_0x1476a6]['MetricId']?_0x48f210[_0x14abb7[_0x1476a6][_0x4764('0x6a')]][_0x4764('0x6b')]:_0x14abb7[_0x1476a6]['field'];_0x87469e=_0x14abb7[_0x1476a6][_0x4764('0x6c')]?_['replace'](_0x39da8b[_0x14abb7[_0x1476a6][_0x4764('0x6c')]],'%s',_0x87469e):_0x87469e;_0x87469e=_0x14abb7[_0x1476a6][_0x4764('0x6d')]?_[_0x4764('0x6e')](_0x1ca435[_0x14abb7[_0x1476a6][_0x4764('0x6d')]],'%s',_0x87469e):_0x87469e;if(_0x14abb7[_0x1476a6]['groupBy']){_0x475639['group'](_0x87469e);}_0x14abb7[_0x1476a6][_0x4764('0x6f')]&&_0x475639[_0x4764('0x35')](_0x87469e,_0x14abb7[_0x1476a6]['orderBy']===_0x4764('0x70')?![]:!![]);_0x475639[_0x4764('0x63')](_0x87469e,_0x14abb7[_0x1476a6]['alias']||_0x87469e);}if(_0x2b5956[_0x4764('0x71')]){_0x2b5956[_0x4764('0x71')]=JSON['parse'](_0x2b5956[_0x4764('0x71')]);for(var _0x346899=0x0;_0x346899<_0x2b5956[_0x4764('0x71')]['length'];_0x346899+=0x1){if(_0x2b5956[_0x4764('0x71')][_0x346899][_0x4764('0x2a')]&&_[_0x4764('0x72')](_0x2cd92f,_0x2b5956[_0x4764('0x71')][_0x346899][_0x4764('0x2a')])&&_0x2b5956['joins'][_0x346899][_0x4764('0x73')]&&_0x2b5956[_0x4764('0x71')][_0x346899][_0x4764('0x74')]&&_0x2b5956['joins'][_0x346899][_0x4764('0x75')]){_0x475639[_0x2b5956['joins'][_0x346899][_0x4764('0x2a')]](_0x2b5956['joins'][_0x346899][_0x4764('0x74')],null,util[_0x4764('0x6d')](_0x4764('0x76'),_0x2b5956[_0x4764('0x77')],_0x2b5956[_0x4764('0x71')][_0x346899][_0x4764('0x73')],_0x2b5956[_0x4764('0x71')][_0x346899][_0x4764('0x74')],_0x2b5956[_0x4764('0x71')][_0x346899][_0x4764('0x75')]));}}}if(_0x2b5956[_0x4764('0x78')]){_0x2b5956[_0x4764('0x78')]=JSON[_0x4764('0x79')](_0x2b5956[_0x4764('0x78')]);_0x475639[_0x4764('0x36')](_0x3aec08(_0x2b5956[_0x4764('0x78')]['group']));}_0x49b7a1=_0x475639['clone']();_0x475639[_0x4764('0x34')](_0x11d06c);_0x475639[_0x4764('0x18')](0x0);logger[_0x4764('0x7a')](_0x4764('0x7b'),_0x475639[_0x4764('0x7c')]());return dbH[_0x4764('0x7d')][_0x4764('0x2c')](_0x475639[_0x4764('0x7c')](),{'type':dbH['sequelize'][_0x4764('0x7e')][_0x4764('0x7f')]});}})[_0x4764('0x1f')](respondWithResult(_0x53f3bf,null))[_0x4764('0x40')](handleError(_0x53f3bf,null));};function runReport(_0x2ec29d,_0x2c30eb,_0x28a9e3){var _0x1df0c7=_0x2c30eb['name'];var _0x337be4=0xa;var _0x431681=[_0x4764('0x51'),_0x4764('0x80'),_0x4764('0x52'),_0x4764('0x81')];var _0x6cc7e6={'SUM':_0x4764('0x53'),'COUNT':_0x4764('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4764('0x82'),'MIN':_0x4764('0x56'),'AVG':_0x4764('0x83'),'GROUP_CONCAT':_0x4764('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4764('0x59')};var _0x17b5ff={'SEC_TO_TIME':_0x4764('0x5a'),'DATE':_0x4764('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x4764('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bea0a=function(_0x22c8ff){return!_[_0x4764('0x72')]([_0x4764('0x5f'),_0x4764('0x84'),_0x4764('0x85'),'IS\x20NOT\x20EMPTY'],_0x22c8ff);};var _0x1c520a=function(_0x272f47){if(!_0x272f47||!_0x272f47[_0x4764('0x61')]['length']){return'';}for(var _0x52e69f='(',_0x2bbbca=0x0;_0x2bbbca<_0x272f47[_0x4764('0x61')][_0x4764('0x44')];_0x2bbbca+=0x1){_0x2bbbca>0x0&&(_0x52e69f+='\x20'+_0x272f47[_0x4764('0x86')]+'\x20');_0x52e69f+=_0x272f47[_0x4764('0x61')][_0x2bbbca][_0x4764('0x62')]?_0x1c520a(_0x272f47[_0x4764('0x61')][_0x2bbbca][_0x4764('0x62')]):_0x272f47[_0x4764('0x61')][_0x2bbbca][_0x4764('0x63')]+'\x20'+_0x272f47[_0x4764('0x61')][_0x2bbbca][_0x4764('0x64')]+(_0x5bea0a(_0x272f47[_0x4764('0x61')][_0x2bbbca]['condition'])?'\x20'+_0x272f47['rules'][_0x2bbbca]['value']:'');}return _0x52e69f+')';};var _0x2f654b={'where':{'id':_0x2ec29d['id']}},_0x59a5da,_0x57156d,_0x5a3f6d,_0x518dfa,_0x378a1d;_0x2f654b=_[_0x4764('0x3a')]({},_0x2f654b,_0x28a9e3);return db[_0x4764('0x27')]['find'](_0x2f654b)[_0x4764('0x1f')](function(_0x65ba7f){if(_0x65ba7f){_0x59a5da=_0x65ba7f;return _0x65ba7f[_0x4764('0x65')]();}return null;})[_0x4764('0x1f')](function(_0x308cd5){if(_0x308cd5){if(!_0x308cd5[_0x4764('0x44')]){throw new db['Sequelize'][(_0x4764('0x87'))](_0x4764('0x66'),0x193);}_0x57156d=_0x308cd5;return db[_0x4764('0x67')][_0x4764('0x3e')]({'raw':!![]});}return null;})[_0x4764('0x1f')](function(_0x534003){if(_0x534003){_0x5a3f6d=_[_0x4764('0x68')](_0x534003,'id');var _0x3e37e5;var _0xce3fb6=squel[_0x4764('0x88')]();_0xce3fb6['from'](_0x59a5da[_0x4764('0x77')]);for(var _0x350dc5=0x0;_0x350dc5<_0x57156d[_0x4764('0x44')];_0x350dc5+=0x1){_0x3e37e5=_0x57156d[_0x350dc5][_0x4764('0x6a')]?_0x5a3f6d[_0x57156d[_0x350dc5][_0x4764('0x6a')]][_0x4764('0x6b')]:_0x57156d[_0x350dc5]['field'];_0x3e37e5=_0x57156d[_0x350dc5][_0x4764('0x6c')]?_['replace'](_0x6cc7e6[_0x57156d[_0x350dc5]['function']],'%s',_0x3e37e5):_0x3e37e5;_0x3e37e5=_0x57156d[_0x350dc5]['format']?_['replace'](_0x17b5ff[_0x57156d[_0x350dc5][_0x4764('0x6d')]],'%s',_0x3e37e5):_0x3e37e5;if(_0x57156d[_0x350dc5][_0x4764('0x89')]){_0xce3fb6[_0x4764('0x62')](_0x3e37e5);}_0x57156d[_0x350dc5][_0x4764('0x6f')]&&_0xce3fb6[_0x4764('0x35')](_0x3e37e5,_0x57156d[_0x350dc5][_0x4764('0x6f')]===_0x4764('0x70')?![]:!![]);_0xce3fb6[_0x4764('0x63')](_0x3e37e5,_0x57156d[_0x350dc5][_0x4764('0x8a')]||_0x3e37e5);}if(_0x59a5da[_0x4764('0x71')]){_0x59a5da[_0x4764('0x71')]=JSON['parse'](_0x59a5da[_0x4764('0x71')]);for(var _0x14f284=0x0;_0x14f284<_0x59a5da[_0x4764('0x71')][_0x4764('0x44')];_0x14f284+=0x1){if(_0x59a5da['joins'][_0x14f284][_0x4764('0x2a')]&&_[_0x4764('0x72')](_0x431681,_0x59a5da[_0x4764('0x71')][_0x14f284][_0x4764('0x2a')])&&_0x59a5da[_0x4764('0x71')][_0x14f284][_0x4764('0x73')]&&_0x59a5da[_0x4764('0x71')][_0x14f284][_0x4764('0x74')]&&_0x59a5da[_0x4764('0x71')][_0x14f284][_0x4764('0x75')]){_0xce3fb6[_0x59a5da['joins'][_0x14f284]['type']](_0x59a5da[_0x4764('0x71')][_0x14f284][_0x4764('0x74')],null,util[_0x4764('0x6d')](_0x4764('0x76'),_0x59a5da[_0x4764('0x77')],_0x59a5da[_0x4764('0x71')][_0x14f284]['parentKey'],_0x59a5da[_0x4764('0x71')][_0x14f284][_0x4764('0x74')],_0x59a5da['joins'][_0x14f284]['foreignKey']));}}}if(_0x59a5da['conditions']){_0x59a5da[_0x4764('0x78')]=JSON[_0x4764('0x79')](_0x59a5da[_0x4764('0x78')]);_0xce3fb6[_0x4764('0x36')](_0x1c520a(_0x59a5da[_0x4764('0x78')][_0x4764('0x62')]));}_0x378a1d=_0xce3fb6['clone']();_0xce3fb6[_0x4764('0x34')](_0x337be4);_0xce3fb6['offset'](0x0);return;}})[_0x4764('0x1f')](function(){if(_0x2c30eb['output']===_0x4764('0x8b')){return null;}var _0x156828=_[_0x4764('0x3a')](_0x2c30eb,{'name':_0x2c30eb['fullPath']||_0x2c30eb[_0x4764('0x23')]||_0x59a5da[_0x4764('0x23')],'basename':_0x1df0c7,'savename':util[_0x4764('0x6d')](_0x4764('0x8c'),_0x2c30eb[_0x4764('0x23')]||_0x59a5da[_0x4764('0x23')],require('randomstring')['generate'](0x4),_0x2c30eb[_0x4764('0x8d')]||_0x4764('0x8e')),'reportId':_0x59a5da['id'],'reportType':_0x4764('0x8f')});return db['AnalyticExtractedReport'][_0x4764('0x45')](_0x156828,{'raw':!![]});})['then'](function(_0x5ec505){if(_0x59a5da['table']==='cdr'){_0x378a1d[_0x4764('0x36')](_0x59a5da[_0x4764('0x77')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2c30eb['startDate'],_0x2c30eb[_0x4764('0x90')]);}else{_0x378a1d['where'](_0x59a5da['table']+_0x4764('0x91'),_0x2c30eb[_0x4764('0x92')],_0x2c30eb[_0x4764('0x90')]);}if(_0x5ec505){logger[_0x4764('0x93')](_0x4764('0x94'),_0x378a1d[_0x4764('0x7c')]());require(_0x4764('0x95'))[_0x4764('0x96')](path['join'](__dirname,'../../components/export/',_0x5ec505[_0x4764('0x8d')]),[_0x5ec505['id'],_0x378a1d[_0x4764('0x7c')](),path['join'](__dirname,'../../files/reports',_0x5ec505[_0x4764('0x97')]),_0x1df0c7]);return _0x5ec505;}else{var _0x2416a8=squel[_0x4764('0x88')]();_0x2416a8['from']('('+_0x378a1d[_0x4764('0x7c')]()+')',_0x4764('0x98'));_0x2416a8['field']('COUNT(*)',_0x4764('0x19'));_0x378a1d[_0x4764('0x34')](_0x2c30eb[_0x4764('0x34')]||_0x337be4);_0x378a1d['offset'](_0x2c30eb[_0x4764('0x18')]||0x0);return dbH[_0x4764('0x7d')][_0x4764('0x2c')](_0x2416a8['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']})[_0x4764('0x1f')](function(_0x536d7f){if(!_0x536d7f[_0x4764('0x44')]){_0x518dfa=0x0;}else{_0x518dfa=_0x536d7f[0x0][_0x4764('0x19')]||0x0;}return dbH[_0x4764('0x7d')][_0x4764('0x2c')](_0x378a1d['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x4764('0x7f')]});})['then'](function(_0xcb4180){return{'rows':_0xcb4180||[],'count':_0x518dfa};});}});}exports[_0x4764('0x99')]=function(_0x60bad2,_0x2250c0){return runReport(_0x60bad2['params'],_0x60bad2[_0x4764('0x2c')],_0x60bad2[_0x4764('0x3b')])[_0x4764('0x1f')](respondWithResult(_0x2250c0,null))[_0x4764('0x40')](handleError(_0x2250c0,null));};exports[_0x4764('0x9a')]=runReport;exports[_0x4764('0x2c')]=function(_0x4587c2,_0x3e0f55){var _0x1d9619=0xa;var _0x35b50a=[_0x4764('0x51'),_0x4764('0x80'),_0x4764('0x52'),_0x4764('0x81')];var _0x62508a={'SUM':_0x4764('0x53'),'COUNT':_0x4764('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4764('0x82'),'MIN':_0x4764('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4764('0x57'),'GROUP_CONCAT ASC':_0x4764('0x58'),'GROUP_CONCAT DESC':_0x4764('0x59')};var _0x5e2016={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x4764('0x5c'),'ROUND':_0x4764('0x5d'),'UNIX_TIMESTAMP':_0x4764('0x5e')};var _0x53874=function(_0x15abaa){return!_[_0x4764('0x72')]([_0x4764('0x5f'),_0x4764('0x84'),_0x4764('0x85'),_0x4764('0x60')],_0x15abaa);};var _0x20f9b6=function(_0x4306b6){if(!_0x4306b6||!_0x4306b6[_0x4764('0x61')][_0x4764('0x44')]){return'';}for(var _0x2a38f6='(',_0x1d7868=0x0;_0x1d7868<_0x4306b6['rules']['length'];_0x1d7868+=0x1){_0x1d7868>0x0&&(_0x2a38f6+='\x20'+_0x4306b6['operator']+'\x20');_0x2a38f6+=_0x4306b6['rules'][_0x1d7868]['group']?_0x20f9b6(_0x4306b6[_0x4764('0x61')][_0x1d7868][_0x4764('0x62')]):_0x4306b6[_0x4764('0x61')][_0x1d7868][_0x4764('0x63')]+'\x20'+_0x4306b6[_0x4764('0x61')][_0x1d7868]['condition']+(_0x53874(_0x4306b6[_0x4764('0x61')][_0x1d7868][_0x4764('0x64')])?'\x20'+_0x4306b6[_0x4764('0x61')][_0x1d7868][_0x4764('0x9b')]:'');}return _0x2a38f6+')';};var _0x195e80={'where':{'id':_0x4587c2[_0x4764('0x42')]['id']}},_0x4d6c8f,_0x40dc58,_0x2883fe,_0x576dd7,_0x1458a7;_0x195e80=_[_0x4764('0x3a')]({},_0x195e80,_0x4587c2[_0x4764('0x3b')]);return db[_0x4764('0x27')][_0x4764('0x4b')](_0x195e80)[_0x4764('0x1f')](function(_0x5755c6){if(_0x5755c6){_0x4d6c8f=_0x5755c6;return _0x5755c6[_0x4764('0x65')]();}return null;})['then'](function(_0x20090b){if(_0x20090b){if(!_0x20090b[_0x4764('0x44')]){throw new db['Sequelize']['ValidationErrorItem'](_0x4764('0x66'),0x193);}_0x40dc58=_0x20090b;return db[_0x4764('0x67')]['findAll']({'raw':!![]});}return null;})[_0x4764('0x1f')](function(_0x1d516a){if(_0x1d516a){_0x2883fe=_[_0x4764('0x68')](_0x1d516a,'id');var _0x2c124e;var _0x31d21f=squel['select']();_0x31d21f[_0x4764('0x69')](_0x4d6c8f[_0x4764('0x77')]);for(var _0x547f9b=0x0;_0x547f9b<_0x40dc58[_0x4764('0x44')];_0x547f9b+=0x1){_0x2c124e=_0x40dc58[_0x547f9b][_0x4764('0x6a')]?_0x2883fe[_0x40dc58[_0x547f9b]['MetricId']]['metric']:_0x40dc58[_0x547f9b][_0x4764('0x63')];_0x2c124e=_0x40dc58[_0x547f9b][_0x4764('0x6c')]?_[_0x4764('0x6e')](_0x62508a[_0x40dc58[_0x547f9b]['function']],'%s',_0x2c124e):_0x2c124e;_0x2c124e=_0x40dc58[_0x547f9b][_0x4764('0x6d')]?_['replace'](_0x5e2016[_0x40dc58[_0x547f9b][_0x4764('0x6d')]],'%s',_0x2c124e):_0x2c124e;if(_0x40dc58[_0x547f9b][_0x4764('0x89')]){_0x31d21f[_0x4764('0x62')](_0x2c124e);}_0x40dc58[_0x547f9b][_0x4764('0x6f')]&&_0x31d21f[_0x4764('0x35')](_0x2c124e,_0x40dc58[_0x547f9b][_0x4764('0x6f')]===_0x4764('0x70')?![]:!![]);_0x31d21f['field'](_0x2c124e,_0x40dc58[_0x547f9b]['alias']||_0x2c124e);}if(_0x4d6c8f[_0x4764('0x71')]){_0x4d6c8f[_0x4764('0x71')]=JSON[_0x4764('0x79')](_0x4d6c8f[_0x4764('0x71')]);for(var _0x4f8fb3=0x0;_0x4f8fb3<_0x4d6c8f[_0x4764('0x71')][_0x4764('0x44')];_0x4f8fb3+=0x1){if(_0x4d6c8f[_0x4764('0x71')][_0x4f8fb3]['type']&&_['includes'](_0x35b50a,_0x4d6c8f['joins'][_0x4f8fb3][_0x4764('0x2a')])&&_0x4d6c8f[_0x4764('0x71')][_0x4f8fb3][_0x4764('0x73')]&&_0x4d6c8f[_0x4764('0x71')][_0x4f8fb3][_0x4764('0x74')]&&_0x4d6c8f['joins'][_0x4f8fb3][_0x4764('0x75')]){_0x31d21f[_0x4d6c8f[_0x4764('0x71')][_0x4f8fb3][_0x4764('0x2a')]](_0x4d6c8f[_0x4764('0x71')][_0x4f8fb3]['foreignTable'],null,util[_0x4764('0x6d')](_0x4764('0x76'),_0x4d6c8f[_0x4764('0x77')],_0x4d6c8f[_0x4764('0x71')][_0x4f8fb3][_0x4764('0x73')],_0x4d6c8f[_0x4764('0x71')][_0x4f8fb3][_0x4764('0x74')],_0x4d6c8f[_0x4764('0x71')][_0x4f8fb3]['foreignKey']));}}}if(_0x4d6c8f[_0x4764('0x78')]){_0x4d6c8f[_0x4764('0x78')]=JSON['parse'](_0x4d6c8f[_0x4764('0x78')]);_0x31d21f[_0x4764('0x36')](_0x20f9b6(_0x4d6c8f[_0x4764('0x78')][_0x4764('0x62')]));}_0x1458a7=_0x31d21f[_0x4764('0x9c')]();_0x31d21f[_0x4764('0x34')](_0x1d9619);_0x31d21f[_0x4764('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x31d21f[_0x4764('0x7c')]());return dbH[_0x4764('0x7d')][_0x4764('0x2c')](_0x31d21f['toString'](),{'type':dbH[_0x4764('0x7d')]['QueryTypes'][_0x4764('0x7f')]});}})[_0x4764('0x1f')](function(){return{'sql':_0x1458a7[_0x4764('0x7c')]()};})[_0x4764('0x1f')](respondWithResult(_0x3e0f55,null))['catch'](handleError(_0x3e0f55,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index dc24b6f..183c0b9 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 _0xf955=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf955,0xf6));var _0x5f95=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xf955[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require('lodash');var util=require(_0x5f95('0x0'));var logger=require(_0x5f95('0x1'))(_0x5f95('0x2'));var moment=require(_0x5f95('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f95('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f95('0x5'));var config=require(_0x5f95('0x6'));var attributes=require(_0x5f95('0x7'));module['exports']=function(_0x290ca1,_0x3ac70c){return _0x290ca1[_0x5f95('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x5f95('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa986=['util','../../config/logger','moment','request-promise','rimraf','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0xcf450c,_0x53ea36){var _0x34a03b=function(_0x14ecb3){while(--_0x14ecb3){_0xcf450c['push'](_0xcf450c['shift']());}};_0x34a03b(++_0x53ea36);}(_0xa986,0x129));var _0x6a98=function(_0x417b2a,_0x3069f7){_0x417b2a=_0x417b2a-0x0;var _0x33ee18=_0xa986[_0x417b2a];return _0x33ee18;};'use strict';var _=require('lodash');var util=require(_0x6a98('0x0'));var logger=require(_0x6a98('0x1'))('api');var moment=require(_0x6a98('0x2'));var BPromise=require('bluebird');var rp=require(_0x6a98('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a98('0x4'));var config=require('../../config/environment');var attributes=require(_0x6a98('0x5'));module['exports']=function(_0x9b88bd,_0x4113ee){return _0x9b88bd[_0x6a98('0x6')](_0x6a98('0x7'),attributes,{'tableName':_0x6a98('0x8'),'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 519e766..d4fcabe 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 _0x5b30=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5b30,0xcb));var _0x05b3=function(_0x5f0225,_0x52631a){_0x5f0225=_0x5f0225-0x0;var _0x2cef4b=_0x5b30[_0x5f0225];return _0x2cef4b;};'use strict';var _=require(_0x05b3('0x0'));var util=require(_0x05b3('0x1'));var moment=require(_0x05b3('0x2'));var BPromise=require(_0x05b3('0x3'));var rs=require(_0x05b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x05b3('0x5'));var logger=require(_0x05b3('0x6'))(_0x05b3('0x7'));var config=require(_0x05b3('0x8'));var jayson=require(_0x05b3('0x9'));var client=jayson[_0x05b3('0xa')][_0x05b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x171fd8,_0x4899cd,_0x1d75f8){return new BPromise(function(_0x4f44d9,_0x184d42){return client[_0x05b3('0xc')](_0x171fd8,_0x1d75f8)[_0x05b3('0xd')](function(_0x167f12){logger[_0x05b3('0xe')](_0x05b3('0xf'),_0x4899cd,_0x05b3('0x10'));logger['debug'](_0x05b3('0x11'),_0x4899cd,_0x05b3('0x10'),JSON[_0x05b3('0x12')](_0x167f12));if(_0x167f12[_0x05b3('0x13')]){if(_0x167f12[_0x05b3('0x13')][_0x05b3('0x14')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4899cd,_0x167f12['error']['message']);return _0x184d42(_0x167f12[_0x05b3('0x13')][_0x05b3('0x15')]);}logger[_0x05b3('0x13')](_0x05b3('0xf'),_0x4899cd,_0x167f12[_0x05b3('0x13')]['message']);return _0x4f44d9(_0x167f12[_0x05b3('0x13')][_0x05b3('0x15')]);}else{logger[_0x05b3('0xe')](_0x05b3('0xf'),_0x4899cd,'request\x20sent');_0x4f44d9(_0x167f12[_0x05b3('0x16')]['message']);}})[_0x05b3('0x17')](function(_0x1c8fd8){logger['error'](_0x05b3('0xf'),_0x4899cd,_0x1c8fd8);_0x184d42(_0x1c8fd8);});});}
\ No newline at end of file
+var _0x8696=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment'];(function(_0xc971a4,_0x5b381c){var _0x4ebd6b=function(_0x371149){while(--_0x371149){_0xc971a4['push'](_0xc971a4['shift']());}};_0x4ebd6b(++_0x5b381c);}(_0x8696,0x11d));var _0x6869=function(_0x497c76,_0x4946bf){_0x497c76=_0x497c76-0x0;var _0x53e1fe=_0x8696[_0x497c76];return _0x53e1fe;};'use strict';var _=require(_0x6869('0x0'));var util=require(_0x6869('0x1'));var moment=require(_0x6869('0x2'));var BPromise=require(_0x6869('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6869('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6869('0x5'));var logger=require(_0x6869('0x6'))(_0x6869('0x7'));var config=require(_0x6869('0x8'));var jayson=require(_0x6869('0x9'));var client=jayson[_0x6869('0xa')][_0x6869('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38192e,_0x6e9eea,_0x43d997){return new BPromise(function(_0x50a062,_0xe0280e){return client[_0x6869('0xc')](_0x38192e,_0x43d997)[_0x6869('0xd')](function(_0x44692b){logger['info'](_0x6869('0xe'),_0x6e9eea,_0x6869('0xf'));logger[_0x6869('0x10')](_0x6869('0x11'),_0x6e9eea,_0x6869('0xf'),JSON[_0x6869('0x12')](_0x44692b));if(_0x44692b[_0x6869('0x13')]){if(_0x44692b['error']['code']===0x1f4){logger['error'](_0x6869('0xe'),_0x6e9eea,_0x44692b[_0x6869('0x13')][_0x6869('0x14')]);return _0xe0280e(_0x44692b[_0x6869('0x13')][_0x6869('0x14')]);}logger['error'](_0x6869('0xe'),_0x6e9eea,_0x44692b['error'][_0x6869('0x14')]);return _0x50a062(_0x44692b['error'][_0x6869('0x14')]);}else{logger[_0x6869('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x6e9eea,_0x6869('0xf'));_0x50a062(_0x44692b[_0x6869('0x16')][_0x6869('0x14')]);}})[_0x6869('0x17')](function(_0x44f708){logger[_0x6869('0x13')](_0x6869('0xe'),_0x6e9eea,_0x44f708);_0xe0280e(_0x44f708);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 7e4fa9f..ff57cd3 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 _0xba8f=['/:id','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','show','/:id/preview','isAuthenticated','preview','/:id/run','run','post','create','put'];(function(_0x100459,_0x4d4893){var _0x2c9d9e=function(_0x574097){while(--_0x574097){_0x100459['push'](_0x100459['shift']());}};_0x2c9d9e(++_0x4d4893);}(_0xba8f,0xea));var _0xfba8=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0xba8f[_0x4ffa64];return _0x5da001;};'use strict';var multer=require(_0xfba8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfba8('0x1'));var express=require(_0xfba8('0x2'));var router=express[_0xfba8('0x3')]();var fs_extra=require(_0xfba8('0x4'));var auth=require(_0xfba8('0x5'));var interaction=require(_0xfba8('0x6'));var config=require(_0xfba8('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xfba8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xfba8('0x9')]);router['get'](_0xfba8('0xa'),auth[_0xfba8('0xb')](),controller[_0xfba8('0xc')]);router[_0xfba8('0x8')](_0xfba8('0xd'),auth['isAuthenticated'](),controller[_0xfba8('0xe')]);router[_0xfba8('0x8')]('/:id/query',auth[_0xfba8('0xb')](),controller['query']);router[_0xfba8('0xf')]('/',auth[_0xfba8('0xb')](),controller[_0xfba8('0x10')]);router[_0xfba8('0x11')](_0xfba8('0x12'),auth['isAuthenticated'](),controller[_0xfba8('0x13')]);router['delete'](_0xfba8('0x12'),auth[_0xfba8('0xb')](),controller['destroy']);module[_0xfba8('0x14')]=router;
\ No newline at end of file
+var _0xa723=['run','/:id/query','query','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','/:id/run'];(function(_0x2b012b,_0x463e28){var _0x32c4cf=function(_0x5871f2){while(--_0x5871f2){_0x2b012b['push'](_0x2b012b['shift']());}};_0x32c4cf(++_0x463e28);}(_0xa723,0x111));var _0x3a72=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xa723[_0x5d8018];return _0x151ac4;};'use strict';var multer=require(_0x3a72('0x0'));var util=require(_0x3a72('0x1'));var path=require('path');var timeout=require(_0x3a72('0x2'));var express=require('express');var router=express[_0x3a72('0x3')]();var fs_extra=require(_0x3a72('0x4'));var auth=require(_0x3a72('0x5'));var interaction=require(_0x3a72('0x6'));var config=require(_0x3a72('0x7'));var controller=require(_0x3a72('0x8'));router[_0x3a72('0x9')]('/',auth[_0x3a72('0xa')](),controller[_0x3a72('0xb')]);router[_0x3a72('0x9')](_0x3a72('0xc'),auth[_0x3a72('0xa')](),controller['show']);router[_0x3a72('0x9')](_0x3a72('0xd'),auth['isAuthenticated'](),controller['preview']);router[_0x3a72('0x9')](_0x3a72('0xe'),auth['isAuthenticated'](),controller[_0x3a72('0xf')]);router[_0x3a72('0x9')](_0x3a72('0x10'),auth['isAuthenticated'](),controller[_0x3a72('0x11')]);router[_0x3a72('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3a72('0x13')]('/:id',auth[_0x3a72('0xa')](),controller[_0x3a72('0x14')]);router[_0x3a72('0x15')](_0x3a72('0xc'),auth[_0x3a72('0xa')](),controller[_0x3a72('0x16')]);module[_0x3a72('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 2d4a949..bb094ee 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x27308f,_0x38bdef){var _0x170edc=function(_0x7534f0){while(--_0x7534f0){_0x27308f['push'](_0x27308f['shift']());}};_0x170edc(++_0x38bdef);}(_0x98a8,0x12c));var _0x898a=function(_0x474092,_0x1f6725){_0x474092=_0x474092-0x0;var _0x22b1eb=_0x98a8[_0x474092];return _0x22b1eb;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x35213e,_0x2bae59){var _0x2cc141=function(_0x35d45b){while(--_0x35d45b){_0x35213e['push'](_0x35213e['shift']());}};_0x2cc141(++_0x2bae59);}(_0xabce,0x103));var _0xeabc=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xabce[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index a0d1df5..83c044c 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 _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x10af24,_0x22d03a){_0x10af24=_0x10af24-0x0;var _0x4bcd4a=_0xc6ac[_0x10af24];return _0x4bcd4a;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
+var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 6b58679..814fd6f 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 _0xb1f2=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports'];(function(_0x313047,_0x132c12){var _0x45ac45=function(_0x174e1b){while(--_0x174e1b){_0x313047['push'](_0x313047['shift']());}};_0x45ac45(++_0x132c12);}(_0xb1f2,0x129));var _0x2b1f=function(_0x144d0f,_0x1b1808){_0x144d0f=_0x144d0f-0x0;var _0x1c90c3=_0xb1f2[_0x144d0f];return _0x1c90c3;};'use strict';var _=require(_0x2b1f('0x0'));var util=require('util');var logger=require(_0x2b1f('0x1'))(_0x2b1f('0x2'));var moment=require(_0x2b1f('0x3'));var BPromise=require('bluebird');var rp=require(_0x2b1f('0x4'));var fs=require('fs');var path=require(_0x2b1f('0x5'));var rimraf=require(_0x2b1f('0x6'));var config=require(_0x2b1f('0x7'));var attributes=require(_0x2b1f('0x8'));module[_0x2b1f('0x9')]=function(_0x110406,_0x2dc53f){return _0x110406['define']('AnalyticDefaultReport',attributes,{'tableName':_0x2b1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc212=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x6cc31,_0x1b7e36){var _0xd14416=function(_0x22d9ad){while(--_0x22d9ad){_0x6cc31['push'](_0x6cc31['shift']());}};_0xd14416(++_0x1b7e36);}(_0xc212,0x19d));var _0x2c21=function(_0x4b738f,_0x5d2237){_0x4b738f=_0x4b738f-0x0;var _0x3c8b1f=_0xc212[_0x4b738f];return _0x3c8b1f;};'use strict';var _=require(_0x2c21('0x0'));var util=require(_0x2c21('0x1'));var logger=require(_0x2c21('0x2'))(_0x2c21('0x3'));var moment=require(_0x2c21('0x4'));var BPromise=require('bluebird');var rp=require(_0x2c21('0x5'));var fs=require('fs');var path=require(_0x2c21('0x6'));var rimraf=require(_0x2c21('0x7'));var config=require(_0x2c21('0x8'));var attributes=require(_0x2c21('0x9'));module[_0x2c21('0xa')]=function(_0x331c58,_0x3b81c5){return _0x331c58[_0x2c21('0xb')](_0x2c21('0xc'),attributes,{'tableName':_0x2c21('0xd'),'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 52651f1..5836eb4 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 _0x6d03=['client','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5a8fe4,_0x3eebe1){var _0x1d401c=function(_0x248a85){while(--_0x248a85){_0x5a8fe4['push'](_0x5a8fe4['shift']());}};_0x1d401c(++_0x3eebe1);}(_0x6d03,0x147));var _0x36d0=function(_0x89012e,_0x3b9442){_0x89012e=_0x89012e-0x0;var _0x57fb57=_0x6d03[_0x89012e];return _0x57fb57;};'use strict';var _=require(_0x36d0('0x0'));var util=require(_0x36d0('0x1'));var moment=require(_0x36d0('0x2'));var BPromise=require(_0x36d0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x36d0('0x5'));var logger=require(_0x36d0('0x6'))(_0x36d0('0x7'));var config=require(_0x36d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x36d0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c3d12,_0x26c4ee,_0x588636){return new BPromise(function(_0x432a3c,_0x5b9839){return client['request'](_0x4c3d12,_0x588636)[_0x36d0('0xa')](function(_0x14d5f7){logger['info'](_0x36d0('0xb'),_0x26c4ee,'request\x20sent');logger[_0x36d0('0xc')](_0x36d0('0xd'),_0x26c4ee,_0x36d0('0xe'),JSON[_0x36d0('0xf')](_0x14d5f7));if(_0x14d5f7['error']){if(_0x14d5f7[_0x36d0('0x10')][_0x36d0('0x11')]===0x1f4){logger[_0x36d0('0x10')](_0x36d0('0xb'),_0x26c4ee,_0x14d5f7[_0x36d0('0x10')][_0x36d0('0x12')]);return _0x5b9839(_0x14d5f7[_0x36d0('0x10')]['message']);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x26c4ee,_0x14d5f7[_0x36d0('0x10')][_0x36d0('0x12')]);return _0x432a3c(_0x14d5f7['error'][_0x36d0('0x12')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x26c4ee,_0x36d0('0xe'));_0x432a3c(_0x14d5f7[_0x36d0('0x13')]['message']);}})[_0x36d0('0x14')](function(_0x5da24b){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x26c4ee,_0x5da24b);_0x5b9839(_0x5da24b);});});}
\ No newline at end of file
+var _0xab1a=['rpc','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger'];(function(_0x514bd1,_0x25ea3e){var _0x58a281=function(_0x25567a){while(--_0x25567a){_0x514bd1['push'](_0x514bd1['shift']());}};_0x58a281(++_0x25ea3e);}(_0xab1a,0x6c));var _0xaab1=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xab1a[_0x39f34f];return _0x59fee1;};'use strict';var _=require(_0xaab1('0x0'));var util=require(_0xaab1('0x1'));var moment=require(_0xaab1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaab1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaab1('0x4'));var logger=require(_0xaab1('0x5'))(_0xaab1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaab1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44b9f0,_0x1850af,_0x2df386){return new BPromise(function(_0x4da149,_0x3b6f11){return client[_0xaab1('0x8')](_0x44b9f0,_0x2df386)[_0xaab1('0x9')](function(_0x9b8474){logger['info'](_0xaab1('0xa'),_0x1850af,_0xaab1('0xb'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1850af,'request\x20sent',JSON[_0xaab1('0xc')](_0x9b8474));if(_0x9b8474[_0xaab1('0xd')]){if(_0x9b8474['error'][_0xaab1('0xe')]===0x1f4){logger[_0xaab1('0xd')](_0xaab1('0xa'),_0x1850af,_0x9b8474[_0xaab1('0xd')][_0xaab1('0xf')]);return _0x3b6f11(_0x9b8474['error'][_0xaab1('0xf')]);}logger[_0xaab1('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1850af,_0x9b8474[_0xaab1('0xd')][_0xaab1('0xf')]);return _0x4da149(_0x9b8474['error']['message']);}else{logger[_0xaab1('0x10')](_0xaab1('0xa'),_0x1850af,_0xaab1('0xb'));_0x4da149(_0x9b8474[_0xaab1('0x11')][_0xaab1('0xf')]);}})[_0xaab1('0x12')](function(_0x1e65a6){logger['error'](_0xaab1('0xa'),_0x1850af,_0x1e65a6);_0x3b6f11(_0x1e65a6);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 0e61fee..21a8021 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 _0x871e=['get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x49596e,_0x3761ff){var _0x353f54=function(_0x390951){while(--_0x390951){_0x49596e['push'](_0x49596e['shift']());}};_0x353f54(++_0x3761ff);}(_0x871e,0x185));var _0xe871=function(_0x243ab9,_0x21f034){_0x243ab9=_0x243ab9-0x0;var _0x9091d1=_0x871e[_0x243ab9];return _0x9091d1;};'use strict';var multer=require(_0xe871('0x0'));var util=require(_0xe871('0x1'));var path=require('path');var timeout=require(_0xe871('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe871('0x3'));var interaction=require(_0xe871('0x4'));var config=require(_0xe871('0x5'));var controller=require(_0xe871('0x6'));router[_0xe871('0x7')]('/',auth[_0xe871('0x8')](),controller[_0xe871('0x9')]);router['get'](_0xe871('0xa'),auth['isAuthenticated'](),controller[_0xe871('0xb')]);router['get']('/:id/preview',auth[_0xe871('0x8')](),controller[_0xe871('0xc')]);router[_0xe871('0x7')](_0xe871('0xd'),auth['isAuthenticated'](),controller[_0xe871('0xe')]);router[_0xe871('0x7')](_0xe871('0xf'),auth['isAuthenticated'](),controller[_0xe871('0x10')]);router[_0xe871('0x11')]('/',auth[_0xe871('0x8')](),controller[_0xe871('0x12')]);router[_0xe871('0x13')]('/:id',auth[_0xe871('0x8')](),controller[_0xe871('0x14')]);router['delete'](_0xe871('0xa'),auth[_0xe871('0x8')](),controller[_0xe871('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xfcfc=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3817da,_0x1a324e){var _0x2e8245=function(_0x4e2640){while(--_0x4e2640){_0x3817da['push'](_0x3817da['shift']());}};_0x2e8245(++_0x1a324e);}(_0xfcfc,0x9b));var _0xcfcf=function(_0x51dbac,_0x1323ce){_0x51dbac=_0x51dbac-0x0;var _0x23c7d8=_0xfcfc[_0x51dbac];return _0x23c7d8;};'use strict';var multer=require(_0xcfcf('0x0'));var util=require(_0xcfcf('0x1'));var path=require('path');var timeout=require(_0xcfcf('0x2'));var express=require('express');var router=express[_0xcfcf('0x3')]();var fs_extra=require(_0xcfcf('0x4'));var auth=require(_0xcfcf('0x5'));var interaction=require(_0xcfcf('0x6'));var config=require(_0xcfcf('0x7'));var controller=require(_0xcfcf('0x8'));router[_0xcfcf('0x9')]('/',auth[_0xcfcf('0xa')](),controller[_0xcfcf('0xb')]);router[_0xcfcf('0x9')](_0xcfcf('0xc'),auth[_0xcfcf('0xa')](),controller[_0xcfcf('0xd')]);router[_0xcfcf('0x9')](_0xcfcf('0xe'),auth[_0xcfcf('0xa')](),controller['preview']);router[_0xcfcf('0x9')](_0xcfcf('0xf'),auth['isAuthenticated'](),controller[_0xcfcf('0x10')]);router[_0xcfcf('0x9')](_0xcfcf('0x11'),auth['isAuthenticated'](),controller['query']);router[_0xcfcf('0x12')]('/',auth[_0xcfcf('0xa')](),controller[_0xcfcf('0x13')]);router[_0xcfcf('0x14')](_0xcfcf('0xc'),auth[_0xcfcf('0xa')](),controller['update']);router['delete'](_0xcfcf('0xc'),auth[_0xcfcf('0xa')](),controller[_0xcfcf('0x15')]);module[_0xcfcf('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index da45918..6553f32 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 _0x494e=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','sequelize'];(function(_0x4dcd00,_0x569998){var _0x345dc5=function(_0x19deb7){while(--_0x19deb7){_0x4dcd00['push'](_0x4dcd00['shift']());}};_0x345dc5(++_0x569998);}(_0x494e,0x18b));var _0xe494=function(_0x236877,_0x4fca22){_0x236877=_0x236877-0x0;var _0x499490=_0x494e[_0x236877];return _0x499490;};'use strict';var Sequelize=require(_0xe494('0x0'));var moment=require('moment');module[_0xe494('0x1')]={'name':{'type':Sequelize[_0xe494('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xe494('0x3')](_0xe494('0x4'),_0xe494('0x5'),_0xe494('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xe494('0x7')]},'status':{'type':Sequelize[_0xe494('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xe494('0x3')](_0xe494('0x8'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe494('0x2')]}};
\ No newline at end of file
+var _0xba52=['DATE','Loading','manual','scheduled','INTEGER','sequelize','exports','STRING','ENUM','csv','xlsx'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0xba52,0x144));var _0x2ba5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xba52[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x2ba5('0x0'));var moment=require('moment');module[_0x2ba5('0x1')]={'name':{'type':Sequelize[_0x2ba5('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2ba5('0x3')](_0x2ba5('0x4'),'pdf',_0x2ba5('0x5')),'allowNull':![],'defaultValue':_0x2ba5('0x4')},'savename':{'type':Sequelize[_0x2ba5('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2ba5('0x6')]},'endDate':{'type':Sequelize[_0x2ba5('0x6')]},'status':{'type':Sequelize[_0x2ba5('0x2')],'defaultValue':_0x2ba5('0x7')},'type':{'type':Sequelize[_0x2ba5('0x3')](_0x2ba5('0x8'),_0x2ba5('0x9')),'allowNull':![],'defaultValue':_0x2ba5('0x8')},'reportId':{'type':Sequelize[_0x2ba5('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x2ba5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 53c98d0..970bc92 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 _0x8f9f=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','AnalyticExtractedReport','include','findAll','catch','show','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment'];(function(_0xd05cef,_0x1bbf5c){var _0x4e113e=function(_0x3d1bab){while(--_0x3d1bab){_0xd05cef['push'](_0xd05cef['shift']());}};_0x4e113e(++_0x1bbf5c);}(_0x8f9f,0x16e));var _0xf8f9=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x8f9f[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require(_0xf8f9('0x0'));var rimraf=require(_0xf8f9('0x1'));var zipdir=require(_0xf8f9('0x2'));var jsonpatch=require(_0xf8f9('0x3'));var rp=require(_0xf8f9('0x4'));var moment=require(_0xf8f9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf8f9('0x6'));var util=require(_0xf8f9('0x7'));var path=require(_0xf8f9('0x8'));var sox=require(_0xf8f9('0x9'));var csv=require(_0xf8f9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8f9('0xb'));var _=require(_0xf8f9('0xc'));var squel=require(_0xf8f9('0xd'));var crypto=require('crypto');var jsforce=require(_0xf8f9('0xe'));var deskjs=require(_0xf8f9('0xf'));var toCsv=require(_0xf8f9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8f9('0x10'));var authService=require(_0xf8f9('0x11'));var qs=require(_0xf8f9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8f9('0x13'))('api');var utils=require(_0xf8f9('0x14'));var config=require(_0xf8f9('0x15'));var licenseUtil=require(_0xf8f9('0x16'));var db=require(_0xf8f9('0x17'))['db'];function respondWithStatusCode(_0x59a68a,_0x18a084){_0x18a084=_0x18a084||0xcc;return function(_0x55ff73){if(_0x55ff73){return _0x59a68a[_0xf8f9('0x18')](_0x18a084);}return _0x59a68a[_0xf8f9('0x19')](_0x18a084)['end']();};}function respondWithResult(_0x4ae200,_0x2050f8){_0x2050f8=_0x2050f8||0xc8;return function(_0x581274){if(_0x581274){return _0x4ae200[_0xf8f9('0x19')](_0x2050f8)[_0xf8f9('0x1a')](_0x581274);}};}function respondWithFilteredResult(_0x3aed81,_0x378c61){return function(_0x4f9e67){if(_0x4f9e67){var _0x5acca7=typeof _0x378c61[_0xf8f9('0x1b')]===_0xf8f9('0x1c')&&typeof _0x378c61[_0xf8f9('0x1d')]===_0xf8f9('0x1c');var _0x4ef500=_0x4f9e67[_0xf8f9('0x1e')];var _0x3ddceb=_0x5acca7?0x0:_0x378c61[_0xf8f9('0x1b')];var _0x2ab7e8=_0x5acca7?_0x4f9e67[_0xf8f9('0x1e')]:_0x378c61[_0xf8f9('0x1b')]+_0x378c61[_0xf8f9('0x1d')];var _0x393884;if(_0x2ab7e8>=_0x4ef500){_0x2ab7e8=_0x4ef500;_0x393884=0xc8;}else{_0x393884=0xce;}_0x3aed81['status'](_0x393884);return _0x3aed81[_0xf8f9('0x1f')](_0xf8f9('0x20'),_0x3ddceb+'-'+_0x2ab7e8+'/'+_0x4ef500)[_0xf8f9('0x1a')](_0x4f9e67);}return null;};}function patchUpdates(_0x3d37d8){return function(_0x34e4f9){try{jsonpatch[_0xf8f9('0x21')](_0x34e4f9,_0x3d37d8,!![]);}catch(_0x432916){return BPromise[_0xf8f9('0x22')](_0x432916);}return _0x34e4f9[_0xf8f9('0x23')]();};}function saveUpdates(_0x24015d,_0x42f607){return function(_0x5bf161){if(_0x5bf161){return _0x5bf161[_0xf8f9('0x24')](_0x24015d)[_0xf8f9('0x25')](function(_0x1f9c3c){return _0x1f9c3c;});}return null;};}function removeEntity(_0x32a596,_0x30069b){return function(_0x554de7){if(_0x554de7){return _0x554de7[_0xf8f9('0x26')]()[_0xf8f9('0x25')](function(){var _0x5da347=_0x554de7['get']({'plain':!![]});var _0x4d06c0=_0xf8f9('0x27');return db[_0xf8f9('0x28')][_0xf8f9('0x26')]({'where':{'type':_0x4d06c0,'resourceId':_0x5da347['id']}})[_0xf8f9('0x25')](function(){return _0x554de7;});})[_0xf8f9('0x25')](function(){_0x32a596[_0xf8f9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49bd82,_0x89593e){return function(_0x473539){if(!_0x473539){_0x49bd82[_0xf8f9('0x18')](0x194);}return _0x473539;};}function handleError(_0x12e6aa,_0x390b36){_0x390b36=_0x390b36||0x1f4;return function(_0xae774){logger[_0xf8f9('0x29')](_0xae774[_0xf8f9('0x2a')]);if(_0xae774['name']){delete _0xae774[_0xf8f9('0x2b')];}_0x12e6aa[_0xf8f9('0x19')](_0x390b36)[_0xf8f9('0x2c')](_0xae774);};}exports['index']=function(_0x306e1b,_0x345c5e){var _0x4a757c={},_0x18cb68={},_0x58e93c={'count':0x0,'rows':[]};var _0x961512=_[_0xf8f9('0x2d')](db['AnalyticExtractedReport'][_0xf8f9('0x2e')],function(_0x407be7){return{'name':_0x407be7[_0xf8f9('0x2f')],'type':_0x407be7[_0xf8f9('0x30')][_0xf8f9('0x31')]};});_0x18cb68[_0xf8f9('0x32')]=_['map'](_0x961512,'name');_0x18cb68['query']=_['keys'](_0x306e1b[_0xf8f9('0x33')]);_0x18cb68[_0xf8f9('0x34')]=_['intersection'](_0x18cb68[_0xf8f9('0x32')],_0x18cb68[_0xf8f9('0x33')]);_0x4a757c[_0xf8f9('0x35')]=_[_0xf8f9('0x36')](_0x18cb68[_0xf8f9('0x32')],qs[_0xf8f9('0x37')](_0x306e1b[_0xf8f9('0x33')][_0xf8f9('0x37')]));_0x4a757c['attributes']=_0x4a757c[_0xf8f9('0x35')][_0xf8f9('0x38')]?_0x4a757c['attributes']:_0x18cb68['model'];if(!_0x306e1b[_0xf8f9('0x33')][_0xf8f9('0x39')](_0xf8f9('0x3a'))){_0x4a757c[_0xf8f9('0x1d')]=qs[_0xf8f9('0x1d')](_0x306e1b[_0xf8f9('0x33')][_0xf8f9('0x1d')]);_0x4a757c['offset']=qs[_0xf8f9('0x1b')](_0x306e1b[_0xf8f9('0x33')][_0xf8f9('0x1b')]);}_0x4a757c[_0xf8f9('0x3b')]=qs[_0xf8f9('0x3c')](_0x306e1b[_0xf8f9('0x33')]['sort']);_0x4a757c[_0xf8f9('0x3d')]=qs['filters'](_[_0xf8f9('0x3e')](_0x306e1b['query'],_0x18cb68[_0xf8f9('0x34')]),_0x961512);if(_0x306e1b[_0xf8f9('0x33')]['filter']){_0x4a757c[_0xf8f9('0x3d')]=_[_0xf8f9('0x3f')](_0x4a757c['where'],{'$or':_[_0xf8f9('0x2d')](_0x961512,function(_0x2b7a79){if(_0x2b7a79[_0xf8f9('0x30')]!==_0xf8f9('0x40')){var _0x3bf416={};_0x3bf416[_0x2b7a79[_0xf8f9('0x2b')]]={'$like':'%'+_0x306e1b[_0xf8f9('0x33')]['filter']+'%'};return _0x3bf416;}})});}_0x4a757c=_[_0xf8f9('0x3f')]({},_0x4a757c,_0x306e1b[_0xf8f9('0x41')]);var _0x50975a={'where':_0x4a757c['where']};return db[_0xf8f9('0x42')][_0xf8f9('0x1e')](_0x50975a)[_0xf8f9('0x25')](function(_0x1cabaf){_0x58e93c[_0xf8f9('0x1e')]=_0x1cabaf;if(_0x306e1b[_0xf8f9('0x33')]['includeAll']){_0x4a757c[_0xf8f9('0x43')]=[{'all':!![]}];}return db[_0xf8f9('0x42')][_0xf8f9('0x44')](_0x4a757c);})[_0xf8f9('0x25')](function(_0x117704){_0x58e93c['rows']=_0x117704;return _0x58e93c;})[_0xf8f9('0x25')](respondWithFilteredResult(_0x345c5e,_0x4a757c))[_0xf8f9('0x45')](handleError(_0x345c5e,null));};exports[_0xf8f9('0x46')]=function(_0xb5ca58,_0x2b6fd7){var _0x232512={'raw':!![],'where':{'id':_0xb5ca58[_0xf8f9('0x47')]['id']}},_0x2541b3={};_0x2541b3['model']=_[_0xf8f9('0x48')](db['AnalyticExtractedReport'][_0xf8f9('0x2e')]);_0x2541b3[_0xf8f9('0x33')]=_[_0xf8f9('0x48')](_0xb5ca58[_0xf8f9('0x33')]);_0x2541b3[_0xf8f9('0x34')]=_['intersection'](_0x2541b3[_0xf8f9('0x32')],_0x2541b3[_0xf8f9('0x33')]);_0x232512[_0xf8f9('0x35')]=_[_0xf8f9('0x36')](_0x2541b3[_0xf8f9('0x32')],qs['fields'](_0xb5ca58[_0xf8f9('0x33')][_0xf8f9('0x37')]));_0x232512['attributes']=_0x232512[_0xf8f9('0x35')][_0xf8f9('0x38')]?_0x232512[_0xf8f9('0x35')]:_0x2541b3[_0xf8f9('0x32')];if(_0xb5ca58['query'][_0xf8f9('0x49')]){_0x232512[_0xf8f9('0x43')]=[{'all':!![]}];}_0x232512=_[_0xf8f9('0x3f')]({},_0x232512,_0xb5ca58[_0xf8f9('0x41')]);return db[_0xf8f9('0x42')][_0xf8f9('0x4a')](_0x232512)[_0xf8f9('0x25')](handleEntityNotFound(_0x2b6fd7,null))[_0xf8f9('0x25')](respondWithResult(_0x2b6fd7,null))['catch'](handleError(_0x2b6fd7,null));};exports[_0xf8f9('0x4b')]=function(_0x129b71,_0x59a8ed){return db[_0xf8f9('0x42')][_0xf8f9('0x4b')](_0x129b71[_0xf8f9('0x4c')],{})[_0xf8f9('0x25')](function(_0x56fd57){var _0x3a9fa1=_0x129b71['user']['get']({'plain':!![]});if(!_0x3a9fa1)throw new Error(_0xf8f9('0x4d'));if(_0x3a9fa1[_0xf8f9('0x4e')]===_0xf8f9('0x4f')){var _0x430f35=_0x56fd57[_0xf8f9('0x50')]({'plain':!![]});var _0x1cacbe='ExtractedReports';return db[_0xf8f9('0x51')][_0xf8f9('0x4a')]({'where':{'name':_0x1cacbe,'userProfileId':_0x3a9fa1[_0xf8f9('0x52')]},'raw':!![]})[_0xf8f9('0x25')](function(_0x15c1b8){if(_0x15c1b8&&_0x15c1b8[_0xf8f9('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x430f35[_0xf8f9('0x2b')],'resourceId':_0x430f35['id'],'type':_0x15c1b8[_0xf8f9('0x2b')],'sectionId':_0x15c1b8['id']},{})[_0xf8f9('0x25')](function(){return _0x56fd57;});}else{return _0x56fd57;}})[_0xf8f9('0x45')](function(_0x496cc3){logger[_0xf8f9('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x496cc3);throw _0x496cc3;});}return _0x56fd57;})['then'](respondWithResult(_0x59a8ed,0xc9))[_0xf8f9('0x45')](handleError(_0x59a8ed,null));};exports[_0xf8f9('0x24')]=function(_0x29c8ad,_0xda29bb){if(_0x29c8ad[_0xf8f9('0x4c')]['id']){delete _0x29c8ad[_0xf8f9('0x4c')]['id'];}return db[_0xf8f9('0x42')][_0xf8f9('0x4a')]({'where':{'id':_0x29c8ad[_0xf8f9('0x47')]['id']}})[_0xf8f9('0x25')](handleEntityNotFound(_0xda29bb,null))[_0xf8f9('0x25')](saveUpdates(_0x29c8ad[_0xf8f9('0x4c')],null))[_0xf8f9('0x25')](respondWithResult(_0xda29bb,null))[_0xf8f9('0x45')](handleError(_0xda29bb,null));};exports['destroy']=function(_0x2e0674,_0x39c4fc){return db[_0xf8f9('0x42')][_0xf8f9('0x4a')]({'where':{'id':_0x2e0674[_0xf8f9('0x47')]['id']}})[_0xf8f9('0x25')](handleEntityNotFound(_0x39c4fc,null))['then'](removeEntity(_0x39c4fc,null))[_0xf8f9('0x45')](handleError(_0x39c4fc,null));};exports[_0xf8f9('0x54')]=function(_0x5e64c0,_0x520fc5,_0x5b4be2){return db[_0xf8f9('0x42')][_0xf8f9('0x4a')]({'where':{'id':_0x5e64c0[_0xf8f9('0x47')]['id']},'attributes':['name',_0xf8f9('0x55'),_0xf8f9('0x56'),_0xf8f9('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x520fc5,null))[_0xf8f9('0x25')](function(_0x192dcd){if(_0x192dcd){if(!fs[_0xf8f9('0x58')](path[_0xf8f9('0x59')](config[_0xf8f9('0x5a')],_0xf8f9('0x5b'),_0x192dcd[_0xf8f9('0x56')]))){throw new db[(_0xf8f9('0x5c'))][(_0xf8f9('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5e64c0[_0xf8f9('0x33')][_0xf8f9('0x5e')]){return _0x520fc5[_0xf8f9('0x18')](0xc8);}return _0x520fc5['download'](path[_0xf8f9('0x59')](config['root'],_0xf8f9('0x5b'),_0x192dcd['savename']),util['format'](_0xf8f9('0x5f'),_0x192dcd[_0xf8f9('0x55')]||_0x192dcd['name'],_0x192dcd[_0xf8f9('0x57')][_0xf8f9('0x60')]()));}})[_0xf8f9('0x45')](handleError(_0x520fc5,null));};
\ No newline at end of file
+var _0x0863=['find','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','ExtractedReports','destroy','error','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','findAll','rows','catch','show','params','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0x0863,0x6b));var _0x3086=function(_0x14a98e,_0x4f2bff){_0x14a98e=_0x14a98e-0x0;var _0x28b77a=_0x0863[_0x14a98e];return _0x28b77a;};'use strict';var emlformat=require(_0x3086('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3086('0x1'));var rp=require(_0x3086('0x2'));var moment=require(_0x3086('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3086('0x4'));var util=require(_0x3086('0x5'));var path=require('path');var sox=require(_0x3086('0x6'));var csv=require('to-csv');var ejs=require(_0x3086('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3086('0x8'));var squel=require(_0x3086('0x9'));var crypto=require('crypto');var jsforce=require(_0x3086('0xa'));var deskjs=require(_0x3086('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3086('0xc'));var Redis=require(_0x3086('0xd'));var authService=require(_0x3086('0xe'));var qs=require(_0x3086('0xf'));var as=require(_0x3086('0x10'));var hardwareService=require(_0x3086('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x3086('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3086('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b30a9,_0x113803){_0x113803=_0x113803||0xcc;return function(_0x29dc9c){if(_0x29dc9c){return _0x5b30a9[_0x3086('0x14')](_0x113803);}return _0x5b30a9['status'](_0x113803)[_0x3086('0x15')]();};}function respondWithResult(_0x48a03a,_0x4f62bf){_0x4f62bf=_0x4f62bf||0xc8;return function(_0x189b00){if(_0x189b00){return _0x48a03a[_0x3086('0x16')](_0x4f62bf)['json'](_0x189b00);}};}function respondWithFilteredResult(_0xe9eb18,_0x5c74c2){return function(_0x277824){if(_0x277824){var _0x1d337c=typeof _0x5c74c2[_0x3086('0x17')]===_0x3086('0x18')&&typeof _0x5c74c2[_0x3086('0x19')]===_0x3086('0x18');var _0x14f586=_0x277824['count'];var _0x179357=_0x1d337c?0x0:_0x5c74c2[_0x3086('0x17')];var _0x16a316=_0x1d337c?_0x277824[_0x3086('0x1a')]:_0x5c74c2[_0x3086('0x17')]+_0x5c74c2['limit'];var _0x373734;if(_0x16a316>=_0x14f586){_0x16a316=_0x14f586;_0x373734=0xc8;}else{_0x373734=0xce;}_0xe9eb18[_0x3086('0x16')](_0x373734);return _0xe9eb18[_0x3086('0x1b')](_0x3086('0x1c'),_0x179357+'-'+_0x16a316+'/'+_0x14f586)[_0x3086('0x1d')](_0x277824);}return null;};}function patchUpdates(_0x50ba19){return function(_0x4c38e4){try{jsonpatch[_0x3086('0x1e')](_0x4c38e4,_0x50ba19,!![]);}catch(_0x45e099){return BPromise['reject'](_0x45e099);}return _0x4c38e4[_0x3086('0x1f')]();};}function saveUpdates(_0x54d5d8,_0x590c3d){return function(_0x54edc6){if(_0x54edc6){return _0x54edc6[_0x3086('0x20')](_0x54d5d8)[_0x3086('0x21')](function(_0x34ccc8){return _0x34ccc8;});}return null;};}function removeEntity(_0x30f9f5,_0xb7006a){return function(_0x1c21a1){if(_0x1c21a1){return _0x1c21a1['destroy']()[_0x3086('0x21')](function(){var _0x5321a5=_0x1c21a1['get']({'plain':!![]});var _0x30ea28=_0x3086('0x22');return db['UserProfileResource'][_0x3086('0x23')]({'where':{'type':_0x30ea28,'resourceId':_0x5321a5['id']}})[_0x3086('0x21')](function(){return _0x1c21a1;});})[_0x3086('0x21')](function(){_0x30f9f5['status'](0xcc)[_0x3086('0x15')]();});}};}function handleEntityNotFound(_0xa52203,_0x452495){return function(_0x240940){if(!_0x240940){_0xa52203[_0x3086('0x14')](0x194);}return _0x240940;};}function handleError(_0xf4f3ea,_0x1e785d){_0x1e785d=_0x1e785d||0x1f4;return function(_0x25bb4e){logger[_0x3086('0x24')](_0x25bb4e['stack']);if(_0x25bb4e[_0x3086('0x25')]){delete _0x25bb4e[_0x3086('0x25')];}_0xf4f3ea[_0x3086('0x16')](_0x1e785d)['send'](_0x25bb4e);};}exports[_0x3086('0x26')]=function(_0x4b6398,_0x2beb0a){var _0x3e38eb={},_0x513c02={},_0x1cf8ca={'count':0x0,'rows':[]};var _0x5eff1a=_[_0x3086('0x27')](db[_0x3086('0x28')][_0x3086('0x29')],function(_0x6237f9){return{'name':_0x6237f9[_0x3086('0x2a')],'type':_0x6237f9[_0x3086('0x2b')]['key']};});_0x513c02[_0x3086('0x2c')]=_[_0x3086('0x27')](_0x5eff1a,_0x3086('0x25'));_0x513c02['query']=_[_0x3086('0x2d')](_0x4b6398['query']);_0x513c02[_0x3086('0x2e')]=_[_0x3086('0x2f')](_0x513c02[_0x3086('0x2c')],_0x513c02[_0x3086('0x30')]);_0x3e38eb[_0x3086('0x31')]=_['intersection'](_0x513c02['model'],qs[_0x3086('0x32')](_0x4b6398[_0x3086('0x30')][_0x3086('0x32')]));_0x3e38eb[_0x3086('0x31')]=_0x3e38eb[_0x3086('0x31')][_0x3086('0x33')]?_0x3e38eb[_0x3086('0x31')]:_0x513c02[_0x3086('0x2c')];if(!_0x4b6398['query'][_0x3086('0x34')](_0x3086('0x35'))){_0x3e38eb[_0x3086('0x19')]=qs[_0x3086('0x19')](_0x4b6398[_0x3086('0x30')][_0x3086('0x19')]);_0x3e38eb[_0x3086('0x17')]=qs[_0x3086('0x17')](_0x4b6398[_0x3086('0x30')][_0x3086('0x17')]);}_0x3e38eb[_0x3086('0x36')]=qs[_0x3086('0x37')](_0x4b6398[_0x3086('0x30')][_0x3086('0x37')]);_0x3e38eb[_0x3086('0x38')]=qs[_0x3086('0x2e')](_[_0x3086('0x39')](_0x4b6398[_0x3086('0x30')],_0x513c02['filters']),_0x5eff1a);if(_0x4b6398['query']['filter']){_0x3e38eb[_0x3086('0x38')]=_['merge'](_0x3e38eb[_0x3086('0x38')],{'$or':_[_0x3086('0x27')](_0x5eff1a,function(_0x8c6bd6){if(_0x8c6bd6[_0x3086('0x2b')]!=='VIRTUAL'){var _0x777308={};_0x777308[_0x8c6bd6['name']]={'$like':'%'+_0x4b6398[_0x3086('0x30')]['filter']+'%'};return _0x777308;}})});}_0x3e38eb=_[_0x3086('0x3a')]({},_0x3e38eb,_0x4b6398['options']);var _0x4db292={'where':_0x3e38eb[_0x3086('0x38')]};return db[_0x3086('0x28')][_0x3086('0x1a')](_0x4db292)[_0x3086('0x21')](function(_0x200f56){_0x1cf8ca['count']=_0x200f56;if(_0x4b6398[_0x3086('0x30')][_0x3086('0x3b')]){_0x3e38eb[_0x3086('0x3c')]=[{'all':!![]}];}return db[_0x3086('0x28')][_0x3086('0x3d')](_0x3e38eb);})[_0x3086('0x21')](function(_0x345e12){_0x1cf8ca[_0x3086('0x3e')]=_0x345e12;return _0x1cf8ca;})[_0x3086('0x21')](respondWithFilteredResult(_0x2beb0a,_0x3e38eb))[_0x3086('0x3f')](handleError(_0x2beb0a,null));};exports[_0x3086('0x40')]=function(_0xa538fc,_0x425e28){var _0x4dd991={'raw':!![],'where':{'id':_0xa538fc[_0x3086('0x41')]['id']}},_0x40c995={};_0x40c995[_0x3086('0x2c')]=_[_0x3086('0x2d')](db[_0x3086('0x28')][_0x3086('0x29')]);_0x40c995[_0x3086('0x30')]=_['keys'](_0xa538fc['query']);_0x40c995[_0x3086('0x2e')]=_[_0x3086('0x2f')](_0x40c995['model'],_0x40c995[_0x3086('0x30')]);_0x4dd991[_0x3086('0x31')]=_[_0x3086('0x2f')](_0x40c995[_0x3086('0x2c')],qs[_0x3086('0x32')](_0xa538fc['query'][_0x3086('0x32')]));_0x4dd991[_0x3086('0x31')]=_0x4dd991[_0x3086('0x31')][_0x3086('0x33')]?_0x4dd991[_0x3086('0x31')]:_0x40c995['model'];if(_0xa538fc[_0x3086('0x30')][_0x3086('0x3b')]){_0x4dd991[_0x3086('0x3c')]=[{'all':!![]}];}_0x4dd991=_['merge']({},_0x4dd991,_0xa538fc[_0x3086('0x42')]);return db[_0x3086('0x28')]['find'](_0x4dd991)['then'](handleEntityNotFound(_0x425e28,null))[_0x3086('0x21')](respondWithResult(_0x425e28,null))[_0x3086('0x3f')](handleError(_0x425e28,null));};exports[_0x3086('0x43')]=function(_0xcb9eea,_0x2e1d62){return db[_0x3086('0x28')]['create'](_0xcb9eea['body'],{})[_0x3086('0x21')](function(_0x228393){var _0x34c448=_0xcb9eea[_0x3086('0x44')][_0x3086('0x45')]({'plain':!![]});if(!_0x34c448)throw new Error(_0x3086('0x46'));if(_0x34c448[_0x3086('0x47')]===_0x3086('0x44')){var _0x40cb32=_0x228393[_0x3086('0x45')]({'plain':!![]});var _0x5d278b=_0x3086('0x22');return db[_0x3086('0x48')]['find']({'where':{'name':_0x5d278b,'userProfileId':_0x34c448[_0x3086('0x49')]},'raw':!![]})['then'](function(_0x1df449){if(_0x1df449&&_0x1df449[_0x3086('0x4a')]===0x0){return db[_0x3086('0x4b')][_0x3086('0x43')]({'name':_0x40cb32['name'],'resourceId':_0x40cb32['id'],'type':_0x1df449[_0x3086('0x25')],'sectionId':_0x1df449['id']},{})[_0x3086('0x21')](function(){return _0x228393;});}else{return _0x228393;}})[_0x3086('0x3f')](function(_0x59ed06){logger[_0x3086('0x24')](_0x3086('0x4c'),_0x59ed06);throw _0x59ed06;});}return _0x228393;})['then'](respondWithResult(_0x2e1d62,0xc9))[_0x3086('0x3f')](handleError(_0x2e1d62,null));};exports[_0x3086('0x20')]=function(_0x10f15d,_0x36bc65){if(_0x10f15d[_0x3086('0x4d')]['id']){delete _0x10f15d[_0x3086('0x4d')]['id'];}return db[_0x3086('0x28')]['find']({'where':{'id':_0x10f15d[_0x3086('0x41')]['id']}})[_0x3086('0x21')](handleEntityNotFound(_0x36bc65,null))[_0x3086('0x21')](saveUpdates(_0x10f15d['body'],null))[_0x3086('0x21')](respondWithResult(_0x36bc65,null))['catch'](handleError(_0x36bc65,null));};exports['destroy']=function(_0xccb577,_0x204591){return db[_0x3086('0x28')]['find']({'where':{'id':_0xccb577[_0x3086('0x41')]['id']}})[_0x3086('0x21')](handleEntityNotFound(_0x204591,null))['then'](removeEntity(_0x204591,null))[_0x3086('0x3f')](handleError(_0x204591,null));};exports[_0x3086('0x4e')]=function(_0x12649c,_0x3648de,_0x17b918){return db[_0x3086('0x28')][_0x3086('0x4f')]({'where':{'id':_0x12649c['params']['id']},'attributes':[_0x3086('0x25'),_0x3086('0x50'),_0x3086('0x51'),_0x3086('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x3648de,null))[_0x3086('0x21')](function(_0x2a4372){if(_0x2a4372){if(!fs[_0x3086('0x53')](path[_0x3086('0x54')](config[_0x3086('0x55')],_0x3086('0x56'),_0x2a4372[_0x3086('0x51')]))){throw new db[(_0x3086('0x57'))][(_0x3086('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x12649c[_0x3086('0x30')][_0x3086('0x59')]){return _0x3648de[_0x3086('0x14')](0xc8);}return _0x3648de[_0x3086('0x4e')](path[_0x3086('0x54')](config['root'],'server/files/reports',_0x2a4372[_0x3086('0x51')]),util[_0x3086('0x5a')](_0x3086('0x5b'),_0x2a4372[_0x3086('0x50')]||_0x2a4372['name'],_0x2a4372['output'][_0x3086('0x5c')]()));}})[_0x3086('0x3f')](handleError(_0x3648de,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 89622f9..c577021 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 _0x8672=['request-promise','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x12e509,_0x503590){var _0x5eddc9=function(_0xe9dfac){while(--_0xe9dfac){_0x12e509['push'](_0x12e509['shift']());}};_0x5eddc9(++_0x503590);}(_0x8672,0x7f));var _0x2867=function(_0xb4fe77,_0x56b48d){_0xb4fe77=_0xb4fe77-0x0;var _0x400ebe=_0x8672[_0xb4fe77];return _0x400ebe;};'use strict';var _=require(_0x2867('0x0'));var util=require('util');var logger=require(_0x2867('0x1'))(_0x2867('0x2'));var moment=require(_0x2867('0x3'));var BPromise=require(_0x2867('0x4'));var rp=require(_0x2867('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2867('0x6'));var config=require(_0x2867('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x2867('0x8')]=function(_0x4b3fd2,_0x182fd1){return _0x4b3fd2['define'](_0x2867('0x9'),attributes,{'tableName':_0x2867('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x135d=['./analyticExtractedReport.attributes','define','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x577294,_0x1daa10){var _0x19b5b1=function(_0x4eb18a){while(--_0x4eb18a){_0x577294['push'](_0x577294['shift']());}};_0x19b5b1(++_0x1daa10);}(_0x135d,0x1b0));var _0xd135=function(_0x22ed83,_0x206a0d){_0x22ed83=_0x22ed83-0x0;var _0x5351cd=_0x135d[_0x22ed83];return _0x5351cd;};'use strict';var _=require(_0xd135('0x0'));var util=require(_0xd135('0x1'));var logger=require('../../config/logger')(_0xd135('0x2'));var moment=require(_0xd135('0x3'));var BPromise=require(_0xd135('0x4'));var rp=require(_0xd135('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd135('0x6'));var config=require(_0xd135('0x7'));var attributes=require(_0xd135('0x8'));module['exports']=function(_0x349dde,_0x18dbbe){return _0x349dde[_0xd135('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xd135('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 6f62521..8494450 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 _0x1780=['stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x1780,0xbf));var _0x0178=function(_0x237688,_0x414d07){_0x237688=_0x237688-0x0;var _0x592899=_0x1780[_0x237688];return _0x592899;};'use strict';var _=require(_0x0178('0x0'));var util=require('util');var moment=require(_0x0178('0x1'));var BPromise=require(_0x0178('0x2'));var rs=require(_0x0178('0x3'));var fs=require('fs');var Redis=require(_0x0178('0x4'));var db=require(_0x0178('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0178('0x6'))(_0x0178('0x7'));var config=require(_0x0178('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0178('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eb438,_0x31e42c,_0x205526){return new BPromise(function(_0x5212a3,_0x9b546d){return client[_0x0178('0xa')](_0x2eb438,_0x205526)[_0x0178('0xb')](function(_0x6be057){logger[_0x0178('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x31e42c,_0x0178('0xd'));logger[_0x0178('0xe')](_0x0178('0xf'),_0x31e42c,_0x0178('0xd'),JSON[_0x0178('0x10')](_0x6be057));if(_0x6be057['error']){if(_0x6be057[_0x0178('0x11')][_0x0178('0x12')]===0x1f4){logger[_0x0178('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x31e42c,_0x6be057[_0x0178('0x11')][_0x0178('0x13')]);return _0x9b546d(_0x6be057[_0x0178('0x11')][_0x0178('0x13')]);}logger[_0x0178('0x11')](_0x0178('0x14'),_0x31e42c,_0x6be057[_0x0178('0x11')][_0x0178('0x13')]);return _0x5212a3(_0x6be057[_0x0178('0x11')][_0x0178('0x13')]);}else{logger[_0x0178('0xc')](_0x0178('0x14'),_0x31e42c,_0x0178('0xd'));_0x5212a3(_0x6be057[_0x0178('0x15')][_0x0178('0x13')]);}})[_0x0178('0x16')](function(_0x2fb26f){logger['error'](_0x0178('0x14'),_0x31e42c,_0x2fb26f);_0x9b546d(_0x2fb26f);});});}
\ No newline at end of file
+var _0xcabd=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3e32a8,_0x255953){var _0x2997b0=function(_0x2d564a){while(--_0x2d564a){_0x3e32a8['push'](_0x3e32a8['shift']());}};_0x2997b0(++_0x255953);}(_0xcabd,0x1e8));var _0xdcab=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xcabd[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0xdcab('0x0'));var util=require(_0xdcab('0x1'));var moment=require(_0xdcab('0x2'));var BPromise=require(_0xdcab('0x3'));var rs=require(_0xdcab('0x4'));var fs=require('fs');var Redis=require(_0xdcab('0x5'));var db=require(_0xdcab('0x6'))['db'];var utils=require(_0xdcab('0x7'));var logger=require(_0xdcab('0x8'))(_0xdcab('0x9'));var config=require('../../config/environment');var jayson=require(_0xdcab('0xa'));var client=jayson[_0xdcab('0xb')][_0xdcab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f4eac,_0x2dc7d7,_0x115008){return new BPromise(function(_0xc70bae,_0x169c61){return client[_0xdcab('0xd')](_0x5f4eac,_0x115008)[_0xdcab('0xe')](function(_0x44f73c){logger[_0xdcab('0xf')](_0xdcab('0x10'),_0x2dc7d7,_0xdcab('0x11'));logger[_0xdcab('0x12')](_0xdcab('0x13'),_0x2dc7d7,_0xdcab('0x11'),JSON[_0xdcab('0x14')](_0x44f73c));if(_0x44f73c[_0xdcab('0x15')]){if(_0x44f73c[_0xdcab('0x15')][_0xdcab('0x16')]===0x1f4){logger['error'](_0xdcab('0x10'),_0x2dc7d7,_0x44f73c[_0xdcab('0x15')][_0xdcab('0x17')]);return _0x169c61(_0x44f73c['error'][_0xdcab('0x17')]);}logger[_0xdcab('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2dc7d7,_0x44f73c[_0xdcab('0x15')]['message']);return _0xc70bae(_0x44f73c[_0xdcab('0x15')]['message']);}else{logger[_0xdcab('0xf')](_0xdcab('0x10'),_0x2dc7d7,'request\x20sent');_0xc70bae(_0x44f73c['result'][_0xdcab('0x17')]);}})['catch'](function(_0x3457f1){logger['error'](_0xdcab('0x10'),_0x2dc7d7,_0x3457f1);_0x169c61(_0x3457f1);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index d7f3450..6cfc5ce 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 _0x72f6=['show','/:id/download','download','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','get','isAuthenticated','index'];(function(_0x22d2b2,_0x57c90c){var _0x593c59=function(_0x4b52fe){while(--_0x4b52fe){_0x22d2b2['push'](_0x22d2b2['shift']());}};_0x593c59(++_0x57c90c);}(_0x72f6,0xf4));var _0x672f=function(_0x31198f,_0x1a84aa){_0x31198f=_0x31198f-0x0;var _0x3de401=_0x72f6[_0x31198f];return _0x3de401;};'use strict';var multer=require('multer');var util=require(_0x672f('0x0'));var path=require(_0x672f('0x1'));var timeout=require(_0x672f('0x2'));var express=require('express');var router=express[_0x672f('0x3')]();var fs_extra=require(_0x672f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x672f('0x5')]('/',auth[_0x672f('0x6')](),controller[_0x672f('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x672f('0x8')]);router[_0x672f('0x5')](_0x672f('0x9'),auth[_0x672f('0x6')](),controller[_0x672f('0xa')]);router[_0x672f('0xb')]('/',auth['isAuthenticated'](),controller[_0x672f('0xc')]);router['put'](_0x672f('0xd'),auth['isAuthenticated'](),controller[_0x672f('0xe')]);router[_0x672f('0xf')](_0x672f('0xd'),auth[_0x672f('0x6')](),controller[_0x672f('0x10')]);module[_0x672f('0x11')]=router;
\ No newline at end of file
+var _0x87ad=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util'];(function(_0x2f9026,_0x3b954b){var _0x2dec99=function(_0x21ca70){while(--_0x21ca70){_0x2f9026['push'](_0x2f9026['shift']());}};_0x2dec99(++_0x3b954b);}(_0x87ad,0x148));var _0xd87a=function(_0x30bf39,_0x5b6a73){_0x30bf39=_0x30bf39-0x0;var _0x545684=_0x87ad[_0x30bf39];return _0x545684;};'use strict';var multer=require(_0xd87a('0x0'));var util=require(_0xd87a('0x1'));var path=require(_0xd87a('0x2'));var timeout=require(_0xd87a('0x3'));var express=require(_0xd87a('0x4'));var router=express[_0xd87a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd87a('0x6'));var config=require(_0xd87a('0x7'));var controller=require(_0xd87a('0x8'));router[_0xd87a('0x9')]('/',auth[_0xd87a('0xa')](),controller[_0xd87a('0xb')]);router[_0xd87a('0x9')](_0xd87a('0xc'),auth[_0xd87a('0xa')](),controller[_0xd87a('0xd')]);router['get'](_0xd87a('0xe'),auth[_0xd87a('0xa')](),controller[_0xd87a('0xf')]);router[_0xd87a('0x10')]('/',auth[_0xd87a('0xa')](),controller[_0xd87a('0x11')]);router[_0xd87a('0x12')](_0xd87a('0xc'),auth[_0xd87a('0xa')](),controller['update']);router[_0xd87a('0x13')](_0xd87a('0xc'),auth[_0xd87a('0xa')](),controller[_0xd87a('0x14')]);module[_0xd87a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 23b7799..c06aa1f 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 _0xe2dc=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x195686,_0xd329df){var _0xaf27a1=function(_0x5a3ba8){while(--_0x5a3ba8){_0x195686['push'](_0x195686['shift']());}};_0xaf27a1(++_0xd329df);}(_0xe2dc,0x1b7));var _0xce2d=function(_0x20bda4,_0x197ab4){_0x20bda4=_0x20bda4-0x0;var _0x4d2124=_0xe2dc[_0x20bda4];return _0x4d2124;};'use strict';var Sequelize=require(_0xce2d('0x0'));module[_0xce2d('0x1')]={'field':{'type':Sequelize[_0xce2d('0x2')]},'alias':{'type':Sequelize[_0xce2d('0x3')]},'function':{'type':Sequelize[_0xce2d('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xce2d('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xce2d('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x7fb9=['STRING','BOOLEAN','exports','TEXT'];(function(_0x229fa7,_0xcf12a5){var _0x26ee05=function(_0x4924db){while(--_0x4924db){_0x229fa7['push'](_0x229fa7['shift']());}};_0x26ee05(++_0xcf12a5);}(_0x7fb9,0x6a));var _0x97fb=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x7fb9[_0x53cf8e];return _0x459197;};'use strict';var Sequelize=require('sequelize');module[_0x97fb('0x0')]={'field':{'type':Sequelize[_0x97fb('0x1')]},'alias':{'type':Sequelize[_0x97fb('0x2')]},'function':{'type':Sequelize[_0x97fb('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x97fb('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x97fb('0x2')]},'custom':{'type':Sequelize[_0x97fb('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 38b33a9..f787746 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 _0x0b42=['key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','intersection','create','body','catch','bulkCreate','find','destroy','ids','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','name','index','map','AnalyticFieldReport','fieldName','type'];(function(_0x62c17,_0x4f37eb){var _0x4fd74e=function(_0x216917){while(--_0x216917){_0x62c17['push'](_0x62c17['shift']());}};_0x4fd74e(++_0x4f37eb);}(_0x0b42,0x116));var _0x20b4=function(_0x1ed686,_0xd5d5e5){_0x1ed686=_0x1ed686-0x0;var _0x564882=_0x0b42[_0x1ed686];return _0x564882;};'use strict';var emlformat=require(_0x20b4('0x0'));var rimraf=require(_0x20b4('0x1'));var zipdir=require(_0x20b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20b4('0x3'));var moment=require(_0x20b4('0x4'));var BPromise=require(_0x20b4('0x5'));var Mustache=require('mustache');var util=require(_0x20b4('0x6'));var path=require(_0x20b4('0x7'));var sox=require(_0x20b4('0x8'));var csv=require('to-csv');var ejs=require(_0x20b4('0x9'));var fs=require('fs');var fs_extra=require(_0x20b4('0xa'));var _=require(_0x20b4('0xb'));var squel=require(_0x20b4('0xc'));var crypto=require(_0x20b4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x20b4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x20b4('0xf'));var Redis=require(_0x20b4('0x10'));var authService=require(_0x20b4('0x11'));var qs=require(_0x20b4('0x12'));var as=require(_0x20b4('0x13'));var hardwareService=require(_0x20b4('0x14'));var logger=require('../../config/logger')(_0x20b4('0x15'));var utils=require(_0x20b4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x20b4('0x17'));var db=require(_0x20b4('0x18'))['db'];function respondWithStatusCode(_0x4a52db,_0x2c3f23){_0x2c3f23=_0x2c3f23||0xcc;return function(_0x58524c){if(_0x58524c){return _0x4a52db[_0x20b4('0x19')](_0x2c3f23);}return _0x4a52db[_0x20b4('0x1a')](_0x2c3f23)[_0x20b4('0x1b')]();};}function respondWithResult(_0x4dda9d,_0x47d3e5){_0x47d3e5=_0x47d3e5||0xc8;return function(_0x2a8929){if(_0x2a8929){return _0x4dda9d[_0x20b4('0x1a')](_0x47d3e5)[_0x20b4('0x1c')](_0x2a8929);}};}function respondWithFilteredResult(_0x3dec75,_0x1571f5){return function(_0x52e003){if(_0x52e003){var _0x578b9e=typeof _0x1571f5['offset']===_0x20b4('0x1d')&&typeof _0x1571f5[_0x20b4('0x1e')]===_0x20b4('0x1d');var _0x4414a6=_0x52e003[_0x20b4('0x1f')];var _0x107ce9=_0x578b9e?0x0:_0x1571f5[_0x20b4('0x20')];var _0x1f2f8a=_0x578b9e?_0x52e003[_0x20b4('0x1f')]:_0x1571f5[_0x20b4('0x20')]+_0x1571f5[_0x20b4('0x1e')];var _0x1901c5;if(_0x1f2f8a>=_0x4414a6){_0x1f2f8a=_0x4414a6;_0x1901c5=0xc8;}else{_0x1901c5=0xce;}_0x3dec75[_0x20b4('0x1a')](_0x1901c5);return _0x3dec75[_0x20b4('0x21')](_0x20b4('0x22'),_0x107ce9+'-'+_0x1f2f8a+'/'+_0x4414a6)[_0x20b4('0x1c')](_0x52e003);}return null;};}function patchUpdates(_0x3c0ba3){return function(_0x3266e2){try{jsonpatch[_0x20b4('0x23')](_0x3266e2,_0x3c0ba3,!![]);}catch(_0xb0c3c2){return BPromise[_0x20b4('0x24')](_0xb0c3c2);}return _0x3266e2[_0x20b4('0x25')]();};}function saveUpdates(_0x1d7259,_0x576bd5){return function(_0x38288a){if(_0x38288a){return _0x38288a[_0x20b4('0x26')](_0x1d7259)[_0x20b4('0x27')](function(_0x1771b5){return _0x1771b5;});}return null;};}function removeEntity(_0x2b77c9,_0x2de46d){return function(_0x1030ed){if(_0x1030ed){return _0x1030ed['destroy']()[_0x20b4('0x27')](function(){_0x2b77c9['status'](0xcc)[_0x20b4('0x1b')]();});}};}function handleEntityNotFound(_0x21d218,_0x929a7b){return function(_0x1b3b05){if(!_0x1b3b05){_0x21d218[_0x20b4('0x19')](0x194);}return _0x1b3b05;};}function handleError(_0x541bc7,_0x3b1d60){_0x3b1d60=_0x3b1d60||0x1f4;return function(_0x524662){logger['error'](_0x524662['stack']);if(_0x524662[_0x20b4('0x28')]){delete _0x524662['name'];}_0x541bc7[_0x20b4('0x1a')](_0x3b1d60)['send'](_0x524662);};}exports[_0x20b4('0x29')]=function(_0x5810fd,_0x3d815a){var _0x4598f4={},_0x17047e={},_0x37a394={'count':0x0,'rows':[]};var _0x3200a1=_[_0x20b4('0x2a')](db[_0x20b4('0x2b')]['rawAttributes'],function(_0x535aad){return{'name':_0x535aad[_0x20b4('0x2c')],'type':_0x535aad[_0x20b4('0x2d')][_0x20b4('0x2e')]};});_0x17047e[_0x20b4('0x2f')]=_['map'](_0x3200a1,_0x20b4('0x28'));_0x17047e['query']=_[_0x20b4('0x30')](_0x5810fd[_0x20b4('0x31')]);_0x17047e[_0x20b4('0x32')]=_['intersection'](_0x17047e['model'],_0x17047e[_0x20b4('0x31')]);_0x4598f4[_0x20b4('0x33')]=_['intersection'](_0x17047e[_0x20b4('0x2f')],qs[_0x20b4('0x34')](_0x5810fd[_0x20b4('0x31')][_0x20b4('0x34')]));_0x4598f4[_0x20b4('0x33')]=_0x4598f4[_0x20b4('0x33')][_0x20b4('0x35')]?_0x4598f4[_0x20b4('0x33')]:_0x17047e[_0x20b4('0x2f')];if(!_0x5810fd['query'][_0x20b4('0x36')](_0x20b4('0x37'))){_0x4598f4[_0x20b4('0x1e')]=qs[_0x20b4('0x1e')](_0x5810fd[_0x20b4('0x31')][_0x20b4('0x1e')]);_0x4598f4[_0x20b4('0x20')]=qs[_0x20b4('0x20')](_0x5810fd[_0x20b4('0x31')][_0x20b4('0x20')]);}_0x4598f4[_0x20b4('0x38')]=qs[_0x20b4('0x39')](_0x5810fd['query']['sort']);_0x4598f4['where']=qs[_0x20b4('0x32')](_['pick'](_0x5810fd['query'],_0x17047e['filters']),_0x3200a1);if(_0x5810fd[_0x20b4('0x31')][_0x20b4('0x3a')]){_0x4598f4[_0x20b4('0x3b')]=_[_0x20b4('0x3c')](_0x4598f4[_0x20b4('0x3b')],{'$or':_[_0x20b4('0x2a')](_0x3200a1,function(_0x4505ef){if(_0x4505ef[_0x20b4('0x2d')]!==_0x20b4('0x3d')){var _0x4d8d9d={};_0x4d8d9d[_0x4505ef[_0x20b4('0x28')]]={'$like':'%'+_0x5810fd['query'][_0x20b4('0x3a')]+'%'};return _0x4d8d9d;}})});}_0x4598f4=_['merge']({},_0x4598f4,_0x5810fd[_0x20b4('0x3e')]);var _0x2e8297={'where':_0x4598f4[_0x20b4('0x3b')]};return db[_0x20b4('0x2b')]['count'](_0x2e8297)[_0x20b4('0x27')](function(_0x5795fe){_0x37a394['count']=_0x5795fe;if(_0x5810fd[_0x20b4('0x31')][_0x20b4('0x3f')]){_0x4598f4[_0x20b4('0x40')]=[{'all':!![]}];}return db[_0x20b4('0x2b')][_0x20b4('0x41')](_0x4598f4);})['then'](function(_0x5c9246){_0x37a394[_0x20b4('0x42')]=_0x5c9246;return _0x37a394;})['then'](respondWithFilteredResult(_0x3d815a,_0x4598f4))['catch'](handleError(_0x3d815a,null));};exports['show']=function(_0x1387dd,_0x217c77){var _0x409320={'raw':![],'where':{'id':_0x1387dd[_0x20b4('0x43')]['id']}},_0x3201d8={};_0x3201d8['model']=_[_0x20b4('0x30')](db[_0x20b4('0x2b')][_0x20b4('0x44')]);_0x3201d8['query']=_[_0x20b4('0x30')](_0x1387dd['query']);_0x3201d8[_0x20b4('0x32')]=_[_0x20b4('0x45')](_0x3201d8['model'],_0x3201d8[_0x20b4('0x31')]);_0x409320[_0x20b4('0x33')]=_[_0x20b4('0x45')](_0x3201d8[_0x20b4('0x2f')],qs['fields'](_0x1387dd[_0x20b4('0x31')]['fields']));_0x409320[_0x20b4('0x33')]=_0x409320[_0x20b4('0x33')][_0x20b4('0x35')]?_0x409320[_0x20b4('0x33')]:_0x3201d8['model'];if(_0x1387dd[_0x20b4('0x31')][_0x20b4('0x3f')]){_0x409320[_0x20b4('0x40')]=[{'all':!![]}];}_0x409320=_[_0x20b4('0x3c')]({},_0x409320,_0x1387dd[_0x20b4('0x3e')]);return db['AnalyticFieldReport']['find'](_0x409320)[_0x20b4('0x27')](handleEntityNotFound(_0x217c77,null))[_0x20b4('0x27')](respondWithResult(_0x217c77,null))['catch'](handleError(_0x217c77,null));};exports[_0x20b4('0x46')]=function(_0x4f1960,_0x10ce57){return db[_0x20b4('0x2b')]['create'](_0x4f1960[_0x20b4('0x47')],{})[_0x20b4('0x27')](respondWithResult(_0x10ce57,0xc9))[_0x20b4('0x48')](handleError(_0x10ce57,null));};exports[_0x20b4('0x49')]=function(_0x5fe0c5,_0x348ea5){return db[_0x20b4('0x2b')][_0x20b4('0x49')](_0x5fe0c5['body'],{'raw':![],'individualHooks':!![]})[_0x20b4('0x27')](respondWithResult(_0x348ea5,0xc9))[_0x20b4('0x48')](handleError(_0x348ea5,null));};exports['update']=function(_0x4fad48,_0x342972){if(_0x4fad48[_0x20b4('0x47')]['id']){delete _0x4fad48['body']['id'];}return db[_0x20b4('0x2b')][_0x20b4('0x4a')]({'where':{'id':_0x4fad48[_0x20b4('0x43')]['id']}})[_0x20b4('0x27')](handleEntityNotFound(_0x342972,null))[_0x20b4('0x27')](saveUpdates(_0x4fad48['body'],null))[_0x20b4('0x27')](respondWithResult(_0x342972,null))[_0x20b4('0x48')](handleError(_0x342972,null));};exports['destroy']=function(_0x5847ec,_0x9fdb7b){return db[_0x20b4('0x2b')]['find']({'where':{'id':_0x5847ec[_0x20b4('0x43')]['id']}})[_0x20b4('0x27')](handleEntityNotFound(_0x9fdb7b,null))[_0x20b4('0x27')](removeEntity(_0x9fdb7b,null))['catch'](handleError(_0x9fdb7b,null));};exports['bulkDestroy']=function(_0x202914,_0x5c77d3){return db[_0x20b4('0x2b')][_0x20b4('0x4b')]({'where':{'id':_0x202914[_0x20b4('0x31')][_0x20b4('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x20b4('0x27')](respondWithResult(_0x5c77d3,0xcc))[_0x20b4('0x48')](handleError(_0x5c77d3,null));};exports['addFields']=function(_0x1ed014,_0x32ee7d,_0x3a4c4c){return db[_0x20b4('0x4d')][_0x20b4('0x4e')]({'where':{'id':_0x1ed014['params']['id']}})[_0x20b4('0x27')](handleEntityNotFound(_0x32ee7d,null))[_0x20b4('0x27')](function(_0x539f27){if(_0x539f27){return db['sequelize'][_0x20b4('0x4f')](function(_0x2369ec){return db[_0x20b4('0x2b')]['destroy']({'where':{'CustomReportId':_0x1ed014[_0x20b4('0x43')]['id']},'transaction':_0x2369ec})[_0x20b4('0x27')](function(_0x45a6a6){var _0x490af9=_[_0x20b4('0x2a')](_0x1ed014[_0x20b4('0x47')],function(_0x333caf){delete _0x333caf['id'];_0x333caf[_0x20b4('0x50')]=_0x1ed014[_0x20b4('0x43')]['id'];return _0x333caf;});return db[_0x20b4('0x2b')]['bulkCreate'](_0x490af9,{'transaction':_0x2369ec});});})[_0x20b4('0x27')](function(){return db[_0x20b4('0x2b')][_0x20b4('0x41')]({'where':{'CustomReportId':_0x1ed014[_0x20b4('0x43')]['id']}});});}})[_0x20b4('0x27')](respondWithResult(_0x32ee7d,null))['catch'](handleError(_0x32ee7d,null));};
\ No newline at end of file
+var _0xdece=['reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x12e36c,_0x40c53e){var _0x2cbc51=function(_0xdd0876){while(--_0xdd0876){_0x12e36c['push'](_0x12e36c['shift']());}};_0x2cbc51(++_0x40c53e);}(_0xdece,0x88));var _0xedec=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xdece[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xedec('0x0'));var rimraf=require(_0xedec('0x1'));var zipdir=require(_0xedec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedec('0x3'));var moment=require(_0xedec('0x4'));var BPromise=require(_0xedec('0x5'));var Mustache=require(_0xedec('0x6'));var util=require(_0xedec('0x7'));var path=require('path');var sox=require(_0xedec('0x8'));var csv=require('to-csv');var ejs=require(_0xedec('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xedec('0xa'));var crypto=require('crypto');var jsforce=require(_0xedec('0xb'));var deskjs=require(_0xedec('0xc'));var toCsv=require(_0xedec('0xd'));var querystring=require(_0xedec('0xe'));var Papa=require(_0xedec('0xf'));var Redis=require(_0xedec('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xedec('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedec('0x12'));var logger=require(_0xedec('0x13'))(_0xedec('0x14'));var utils=require(_0xedec('0x15'));var config=require(_0xedec('0x16'));var licenseUtil=require(_0xedec('0x17'));var db=require(_0xedec('0x18'))['db'];function respondWithStatusCode(_0x845205,_0xa01f69){_0xa01f69=_0xa01f69||0xcc;return function(_0x582359){if(_0x582359){return _0x845205[_0xedec('0x19')](_0xa01f69);}return _0x845205['status'](_0xa01f69)[_0xedec('0x1a')]();};}function respondWithResult(_0x474a9a,_0x9d306b){_0x9d306b=_0x9d306b||0xc8;return function(_0x4f8d6a){if(_0x4f8d6a){return _0x474a9a[_0xedec('0x1b')](_0x9d306b)[_0xedec('0x1c')](_0x4f8d6a);}};}function respondWithFilteredResult(_0x43c0df,_0xc4afdb){return function(_0x20bd56){if(_0x20bd56){var _0x37ad98=typeof _0xc4afdb[_0xedec('0x1d')]==='undefined'&&typeof _0xc4afdb['limit']===_0xedec('0x1e');var _0x3c1029=_0x20bd56[_0xedec('0x1f')];var _0x24e30f=_0x37ad98?0x0:_0xc4afdb[_0xedec('0x1d')];var _0x388f65=_0x37ad98?_0x20bd56[_0xedec('0x1f')]:_0xc4afdb[_0xedec('0x1d')]+_0xc4afdb[_0xedec('0x20')];var _0x3d27ae;if(_0x388f65>=_0x3c1029){_0x388f65=_0x3c1029;_0x3d27ae=0xc8;}else{_0x3d27ae=0xce;}_0x43c0df[_0xedec('0x1b')](_0x3d27ae);return _0x43c0df[_0xedec('0x21')](_0xedec('0x22'),_0x24e30f+'-'+_0x388f65+'/'+_0x3c1029)[_0xedec('0x1c')](_0x20bd56);}return null;};}function patchUpdates(_0x382acc){return function(_0xe86e21){try{jsonpatch[_0xedec('0x23')](_0xe86e21,_0x382acc,!![]);}catch(_0x1f9912){return BPromise[_0xedec('0x24')](_0x1f9912);}return _0xe86e21[_0xedec('0x25')]();};}function saveUpdates(_0x3edafd,_0x343551){return function(_0x4459d0){if(_0x4459d0){return _0x4459d0[_0xedec('0x26')](_0x3edafd)[_0xedec('0x27')](function(_0x2e629f){return _0x2e629f;});}return null;};}function removeEntity(_0x4573a2,_0x444ac1){return function(_0x6aeca4){if(_0x6aeca4){return _0x6aeca4[_0xedec('0x28')]()[_0xedec('0x27')](function(){_0x4573a2[_0xedec('0x1b')](0xcc)[_0xedec('0x1a')]();});}};}function handleEntityNotFound(_0x42b4cf,_0x19265b){return function(_0x4b84f7){if(!_0x4b84f7){_0x42b4cf[_0xedec('0x19')](0x194);}return _0x4b84f7;};}function handleError(_0x36be0e,_0x14f470){_0x14f470=_0x14f470||0x1f4;return function(_0x3d0866){logger[_0xedec('0x29')](_0x3d0866[_0xedec('0x2a')]);if(_0x3d0866['name']){delete _0x3d0866[_0xedec('0x2b')];}_0x36be0e[_0xedec('0x1b')](_0x14f470)[_0xedec('0x2c')](_0x3d0866);};}exports[_0xedec('0x2d')]=function(_0x399b8c,_0x52bdf5){var _0x5a60a1={},_0x521ae3={},_0x189c67={'count':0x0,'rows':[]};var _0x258fc7=_[_0xedec('0x2e')](db[_0xedec('0x2f')]['rawAttributes'],function(_0x565abd){return{'name':_0x565abd[_0xedec('0x30')],'type':_0x565abd[_0xedec('0x31')][_0xedec('0x32')]};});_0x521ae3[_0xedec('0x33')]=_['map'](_0x258fc7,_0xedec('0x2b'));_0x521ae3[_0xedec('0x34')]=_[_0xedec('0x35')](_0x399b8c[_0xedec('0x34')]);_0x521ae3[_0xedec('0x36')]=_[_0xedec('0x37')](_0x521ae3[_0xedec('0x33')],_0x521ae3[_0xedec('0x34')]);_0x5a60a1[_0xedec('0x38')]=_[_0xedec('0x37')](_0x521ae3['model'],qs[_0xedec('0x39')](_0x399b8c[_0xedec('0x34')]['fields']));_0x5a60a1[_0xedec('0x38')]=_0x5a60a1[_0xedec('0x38')][_0xedec('0x3a')]?_0x5a60a1['attributes']:_0x521ae3['model'];if(!_0x399b8c['query']['hasOwnProperty'](_0xedec('0x3b'))){_0x5a60a1[_0xedec('0x20')]=qs['limit'](_0x399b8c[_0xedec('0x34')][_0xedec('0x20')]);_0x5a60a1[_0xedec('0x1d')]=qs[_0xedec('0x1d')](_0x399b8c[_0xedec('0x34')]['offset']);}_0x5a60a1['order']=qs[_0xedec('0x3c')](_0x399b8c['query']['sort']);_0x5a60a1[_0xedec('0x3d')]=qs[_0xedec('0x36')](_[_0xedec('0x3e')](_0x399b8c['query'],_0x521ae3['filters']),_0x258fc7);if(_0x399b8c['query'][_0xedec('0x3f')]){_0x5a60a1[_0xedec('0x3d')]=_['merge'](_0x5a60a1[_0xedec('0x3d')],{'$or':_[_0xedec('0x2e')](_0x258fc7,function(_0x196e25){if(_0x196e25[_0xedec('0x31')]!==_0xedec('0x40')){var _0x1881e7={};_0x1881e7[_0x196e25[_0xedec('0x2b')]]={'$like':'%'+_0x399b8c[_0xedec('0x34')][_0xedec('0x3f')]+'%'};return _0x1881e7;}})});}_0x5a60a1=_[_0xedec('0x41')]({},_0x5a60a1,_0x399b8c[_0xedec('0x42')]);var _0xb46ed0={'where':_0x5a60a1[_0xedec('0x3d')]};return db[_0xedec('0x2f')][_0xedec('0x1f')](_0xb46ed0)[_0xedec('0x27')](function(_0xe5c1d7){_0x189c67['count']=_0xe5c1d7;if(_0x399b8c[_0xedec('0x34')][_0xedec('0x43')]){_0x5a60a1[_0xedec('0x44')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xedec('0x45')](_0x5a60a1);})[_0xedec('0x27')](function(_0x2fe060){_0x189c67[_0xedec('0x46')]=_0x2fe060;return _0x189c67;})[_0xedec('0x27')](respondWithFilteredResult(_0x52bdf5,_0x5a60a1))[_0xedec('0x47')](handleError(_0x52bdf5,null));};exports[_0xedec('0x48')]=function(_0x4c2968,_0x4b6a34){var _0x1e936e={'raw':![],'where':{'id':_0x4c2968['params']['id']}},_0x4eecb2={};_0x4eecb2[_0xedec('0x33')]=_['keys'](db['AnalyticFieldReport'][_0xedec('0x49')]);_0x4eecb2['query']=_[_0xedec('0x35')](_0x4c2968[_0xedec('0x34')]);_0x4eecb2[_0xedec('0x36')]=_[_0xedec('0x37')](_0x4eecb2[_0xedec('0x33')],_0x4eecb2[_0xedec('0x34')]);_0x1e936e[_0xedec('0x38')]=_['intersection'](_0x4eecb2[_0xedec('0x33')],qs[_0xedec('0x39')](_0x4c2968[_0xedec('0x34')][_0xedec('0x39')]));_0x1e936e['attributes']=_0x1e936e[_0xedec('0x38')]['length']?_0x1e936e[_0xedec('0x38')]:_0x4eecb2[_0xedec('0x33')];if(_0x4c2968['query'][_0xedec('0x43')]){_0x1e936e[_0xedec('0x44')]=[{'all':!![]}];}_0x1e936e=_[_0xedec('0x41')]({},_0x1e936e,_0x4c2968[_0xedec('0x42')]);return db[_0xedec('0x2f')][_0xedec('0x4a')](_0x1e936e)['then'](handleEntityNotFound(_0x4b6a34,null))[_0xedec('0x27')](respondWithResult(_0x4b6a34,null))[_0xedec('0x47')](handleError(_0x4b6a34,null));};exports[_0xedec('0x4b')]=function(_0x1c99db,_0x2791c9){return db[_0xedec('0x2f')][_0xedec('0x4b')](_0x1c99db[_0xedec('0x4c')],{})[_0xedec('0x27')](respondWithResult(_0x2791c9,0xc9))[_0xedec('0x47')](handleError(_0x2791c9,null));};exports[_0xedec('0x4d')]=function(_0x1e558f,_0xd0b174){return db[_0xedec('0x2f')][_0xedec('0x4d')](_0x1e558f['body'],{'raw':![],'individualHooks':!![]})[_0xedec('0x27')](respondWithResult(_0xd0b174,0xc9))[_0xedec('0x47')](handleError(_0xd0b174,null));};exports[_0xedec('0x26')]=function(_0x3779d1,_0x599fd5){if(_0x3779d1[_0xedec('0x4c')]['id']){delete _0x3779d1['body']['id'];}return db[_0xedec('0x2f')]['find']({'where':{'id':_0x3779d1[_0xedec('0x4e')]['id']}})[_0xedec('0x27')](handleEntityNotFound(_0x599fd5,null))['then'](saveUpdates(_0x3779d1['body'],null))[_0xedec('0x27')](respondWithResult(_0x599fd5,null))['catch'](handleError(_0x599fd5,null));};exports['destroy']=function(_0x347fa9,_0x231aef){return db[_0xedec('0x2f')][_0xedec('0x4a')]({'where':{'id':_0x347fa9[_0xedec('0x4e')]['id']}})[_0xedec('0x27')](handleEntityNotFound(_0x231aef,null))[_0xedec('0x27')](removeEntity(_0x231aef,null))['catch'](handleError(_0x231aef,null));};exports[_0xedec('0x4f')]=function(_0x49406c,_0x457128){return db[_0xedec('0x2f')][_0xedec('0x28')]({'where':{'id':_0x49406c[_0xedec('0x34')][_0xedec('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xedec('0x27')](respondWithResult(_0x457128,0xcc))['catch'](handleError(_0x457128,null));};exports[_0xedec('0x51')]=function(_0x3b2dea,_0x52a80c,_0x41d0db){return db[_0xedec('0x52')]['findOne']({'where':{'id':_0x3b2dea['params']['id']}})[_0xedec('0x27')](handleEntityNotFound(_0x52a80c,null))[_0xedec('0x27')](function(_0x499793){if(_0x499793){return db[_0xedec('0x53')][_0xedec('0x54')](function(_0x3501e3){return db['AnalyticFieldReport'][_0xedec('0x28')]({'where':{'CustomReportId':_0x3b2dea[_0xedec('0x4e')]['id']},'transaction':_0x3501e3})['then'](function(_0x34821b){var _0x44b794=_[_0xedec('0x2e')](_0x3b2dea[_0xedec('0x4c')],function(_0x418266){delete _0x418266['id'];_0x418266[_0xedec('0x55')]=_0x3b2dea[_0xedec('0x4e')]['id'];return _0x418266;});return db[_0xedec('0x2f')]['bulkCreate'](_0x44b794,{'transaction':_0x3501e3});});})[_0xedec('0x27')](function(){return db[_0xedec('0x2f')]['findAll']({'where':{'CustomReportId':_0x3b2dea[_0xedec('0x4e')]['id']}});});}})['then'](respondWithResult(_0x52a80c,null))[_0xedec('0x47')](handleError(_0x52a80c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 6258a7a..1f000ec 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 _0x0a75=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','define','analytics_report_fields','lodash'];(function(_0x13483d,_0x21b059){var _0x14a692=function(_0x89c3ea){while(--_0x89c3ea){_0x13483d['push'](_0x13483d['shift']());}};_0x14a692(++_0x21b059);}(_0x0a75,0x83));var _0x50a7=function(_0xaf4c6e,_0x43c2e3){_0xaf4c6e=_0xaf4c6e-0x0;var _0x3a349b=_0x0a75[_0xaf4c6e];return _0x3a349b;};'use strict';var _=require(_0x50a7('0x0'));var util=require(_0x50a7('0x1'));var logger=require(_0x50a7('0x2'))(_0x50a7('0x3'));var moment=require(_0x50a7('0x4'));var BPromise=require(_0x50a7('0x5'));var rp=require(_0x50a7('0x6'));var fs=require('fs');var path=require(_0x50a7('0x7'));var rimraf=require(_0x50a7('0x8'));var config=require('../../config/environment');var attributes=require(_0x50a7('0x9'));module['exports']=function(_0x297375,_0x293ea2){return _0x297375[_0x50a7('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x50a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb386=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x4aef74,_0x168464){var _0x4adfdc=function(_0x3e7ea9){while(--_0x3e7ea9){_0x4aef74['push'](_0x4aef74['shift']());}};_0x4adfdc(++_0x168464);}(_0xb386,0x178));var _0x6b38=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xb386[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x6b38('0x0'));var util=require(_0x6b38('0x1'));var logger=require(_0x6b38('0x2'))(_0x6b38('0x3'));var moment=require(_0x6b38('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b38('0x5'));var fs=require('fs');var path=require(_0x6b38('0x6'));var rimraf=require('rimraf');var config=require(_0x6b38('0x7'));var attributes=require(_0x6b38('0x8'));module[_0x6b38('0x9')]=function(_0x20ac0f,_0x50ef99){return _0x20ac0f[_0x6b38('0xa')](_0x6b38('0xb'),attributes,{'tableName':_0x6b38('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 5d73e13..61562e1 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 _0x34c3=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x322d1f,_0xbe7b8){var _0x2b51c1=function(_0x16af9c){while(--_0x16af9c){_0x322d1f['push'](_0x322d1f['shift']());}};_0x2b51c1(++_0xbe7b8);}(_0x34c3,0xff));var _0x334c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x34c3[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x334c('0x0'));var util=require(_0x334c('0x1'));var moment=require(_0x334c('0x2'));var BPromise=require(_0x334c('0x3'));var rs=require(_0x334c('0x4'));var fs=require('fs');var Redis=require(_0x334c('0x5'));var db=require(_0x334c('0x6'))['db'];var utils=require(_0x334c('0x7'));var logger=require(_0x334c('0x8'))('rpc');var config=require(_0x334c('0x9'));var jayson=require(_0x334c('0xa'));var client=jayson[_0x334c('0xb')][_0x334c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28de1e,_0x3a4fe3,_0x1df281){return new BPromise(function(_0x1b89d0,_0x10dac6){return client[_0x334c('0xd')](_0x28de1e,_0x1df281)[_0x334c('0xe')](function(_0x35b687){logger[_0x334c('0xf')](_0x334c('0x10'),_0x3a4fe3,_0x334c('0x11'));logger[_0x334c('0x12')](_0x334c('0x13'),_0x3a4fe3,_0x334c('0x11'),JSON[_0x334c('0x14')](_0x35b687));if(_0x35b687['error']){if(_0x35b687[_0x334c('0x15')]['code']===0x1f4){logger[_0x334c('0x15')](_0x334c('0x10'),_0x3a4fe3,_0x35b687['error'][_0x334c('0x16')]);return _0x10dac6(_0x35b687[_0x334c('0x15')]['message']);}logger[_0x334c('0x15')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3a4fe3,_0x35b687[_0x334c('0x15')]['message']);return _0x1b89d0(_0x35b687[_0x334c('0x15')][_0x334c('0x16')]);}else{logger[_0x334c('0xf')](_0x334c('0x10'),_0x3a4fe3,_0x334c('0x11'));_0x1b89d0(_0x35b687['result'][_0x334c('0x16')]);}})[_0x334c('0x17')](function(_0x231ffd){logger[_0x334c('0x15')](_0x334c('0x10'),_0x3a4fe3,_0x231ffd);_0x10dac6(_0x231ffd);});});}
\ No newline at end of file
+var _0xdc00=['client','then','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5e8415,_0x39b7e6){var _0x419be0=function(_0x513dbf){while(--_0x513dbf){_0x5e8415['push'](_0x5e8415['shift']());}};_0x419be0(++_0x39b7e6);}(_0xdc00,0x1ec));var _0x0dc0=function(_0xc5403e,_0xf70a94){_0xc5403e=_0xc5403e-0x0;var _0x44c421=_0xdc00[_0xc5403e];return _0x44c421;};'use strict';var _=require(_0x0dc0('0x0'));var util=require(_0x0dc0('0x1'));var moment=require(_0x0dc0('0x2'));var BPromise=require(_0x0dc0('0x3'));var rs=require(_0x0dc0('0x4'));var fs=require('fs');var Redis=require(_0x0dc0('0x5'));var db=require(_0x0dc0('0x6'))['db'];var utils=require(_0x0dc0('0x7'));var logger=require(_0x0dc0('0x8'))(_0x0dc0('0x9'));var config=require(_0x0dc0('0xa'));var jayson=require(_0x0dc0('0xb'));var client=jayson[_0x0dc0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1589a2,_0x3ff2db,_0x3624ff){return new BPromise(function(_0x44c32c,_0x51e4ff){return client['request'](_0x1589a2,_0x3624ff)[_0x0dc0('0xd')](function(_0x518e36){logger['info'](_0x0dc0('0xe'),_0x3ff2db,'request\x20sent');logger['debug'](_0x0dc0('0xf'),_0x3ff2db,_0x0dc0('0x10'),JSON[_0x0dc0('0x11')](_0x518e36));if(_0x518e36[_0x0dc0('0x12')]){if(_0x518e36[_0x0dc0('0x12')][_0x0dc0('0x13')]===0x1f4){logger[_0x0dc0('0x12')](_0x0dc0('0xe'),_0x3ff2db,_0x518e36['error']['message']);return _0x51e4ff(_0x518e36[_0x0dc0('0x12')]['message']);}logger[_0x0dc0('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ff2db,_0x518e36[_0x0dc0('0x12')]['message']);return _0x44c32c(_0x518e36[_0x0dc0('0x12')][_0x0dc0('0x14')]);}else{logger[_0x0dc0('0x15')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ff2db,_0x0dc0('0x10'));_0x44c32c(_0x518e36[_0x0dc0('0x16')]['message']);}})[_0x0dc0('0x17')](function(_0x3696b1){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3ff2db,_0x3696b1);_0x51e4ff(_0x3696b1);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index c4e2790..da135ea 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(_0x3e8e11,_0x6753dd){var _0x290f86=function(_0x56ad82){while(--_0x56ad82){_0x3e8e11['push'](_0x3e8e11['shift']());}};_0x290f86(++_0x6753dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x4f5bd3,_0x48122a){var _0x2e30b1=function(_0x3f1046){while(--_0x3f1046){_0x4f5bd3['push'](_0x4f5bd3['shift']());}};_0x2e30b1(++_0x48122a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 82bc030..ac43a66 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 _0x5ff3=['STRING','exports','name','TEXT'];(function(_0x17d7bb,_0x323777){var _0x51e6f5=function(_0x13200e){while(--_0x13200e){_0x17d7bb['push'](_0x17d7bb['shift']());}};_0x51e6f5(++_0x323777);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3ceba3,_0x4d07ae){_0x3ceba3=_0x3ceba3-0x0;var _0x5da943=_0x5ff3[_0x3ceba3];return _0x5da943;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35ff('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x35ff('0x2')]},'description':{'type':Sequelize[_0x35ff('0x3')]}};
\ No newline at end of file
+var _0x2c1b=['TEXT','sequelize','exports','STRING','name'];(function(_0x282ed6,_0x1244f6){var _0x1f85ca=function(_0x2083b6){while(--_0x2083b6){_0x282ed6['push'](_0x282ed6['shift']());}};_0x1f85ca(++_0x1244f6);}(_0x2c1b,0xb0));var _0xb2c1=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x2c1b[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0xb2c1('0x0'));module[_0xb2c1('0x1')]={'name':{'type':Sequelize[_0xb2c1('0x2')],'allowNull':![],'unique':_0xb2c1('0x3')},'table':{'type':Sequelize[_0xb2c1('0x2')]},'metric':{'type':Sequelize[_0xb2c1('0x4')]},'description':{'type':Sequelize[_0xb2c1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 0546533..ea01aa7 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 _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x5aba01,_0x11a9ed){var _0x1b6c10=function(_0x3089f2){while(--_0x3089f2){_0x5aba01['push'](_0x5aba01['shift']());}};_0x1b6c10(++_0x11a9ed);}(_0x4b84,0x1cc));var _0x44b8=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0x4b84[_0x127a60];return _0xc1f6a3;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
+var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x2d7c4a,_0x2249d2){var _0x16d915=function(_0x2194d4){while(--_0x2194d4){_0x2d7c4a['push'](_0x2d7c4a['shift']());}};_0x16d915(++_0x2249d2);}(_0xabce,0x103));var _0xeabc=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xabce[_0x4d07cc];return _0x42de3b;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index d2524ff..45fbfd1 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 _0x598a=['util','../../config/logger','api','moment','request-promise','./analyticMetric.attributes','exports','define','lodash'];(function(_0x153aae,_0x28cf2c){var _0xb918f7=function(_0x26d167){while(--_0x26d167){_0x153aae['push'](_0x153aae['shift']());}};_0xb918f7(++_0x28cf2c);}(_0x598a,0xfb));var _0xa598=function(_0x160101,_0x845589){_0x160101=_0x160101-0x0;var _0x4ea259=_0x598a[_0x160101];return _0x4ea259;};'use strict';var _=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var logger=require(_0xa598('0x2'))(_0xa598('0x3'));var moment=require(_0xa598('0x4'));var BPromise=require('bluebird');var rp=require(_0xa598('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa598('0x6'));module[_0xa598('0x7')]=function(_0x41ebaa,_0x2b0ef0){return _0x41ebaa[_0xa598('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c7b=['path','rimraf','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','moment','request-promise'];(function(_0x44187c,_0x2c5fb0){var _0x58e801=function(_0x2ca665){while(--_0x2ca665){_0x44187c['push'](_0x44187c['shift']());}};_0x58e801(++_0x2c5fb0);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x583844,_0x25b60b){_0x583844=_0x583844-0x0;var _0x1f4c29=_0x6c7b[_0x583844];return _0x1f4c29;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb6c7('0x1'));var BPromise=require('bluebird');var rp=require(_0xb6c7('0x2'));var fs=require('fs');var path=require(_0xb6c7('0x3'));var rimraf=require(_0xb6c7('0x4'));var config=require('../../config/environment');var attributes=require(_0xb6c7('0x5'));module[_0xb6c7('0x6')]=function(_0xfe3eb9,_0x219abc){return _0xfe3eb9[_0xb6c7('0x7')]('AnalyticMetric',attributes,{'tableName':_0xb6c7('0x8'),'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 93fa5b3..6ea3e98 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 _0x07f5=['message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x52180b,_0x43e91a){var _0x1abd3c=function(_0x13b4b8){while(--_0x13b4b8){_0x52180b['push'](_0x52180b['shift']());}};_0x1abd3c(++_0x43e91a);}(_0x07f5,0x1e6));var _0x507f=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x07f5[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x507f('0x0'));var util=require('util');var moment=require(_0x507f('0x1'));var BPromise=require('bluebird');var rs=require(_0x507f('0x2'));var fs=require('fs');var Redis=require(_0x507f('0x3'));var db=require(_0x507f('0x4'))['db'];var utils=require(_0x507f('0x5'));var logger=require(_0x507f('0x6'))(_0x507f('0x7'));var config=require(_0x507f('0x8'));var jayson=require(_0x507f('0x9'));var client=jayson['client'][_0x507f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cdc6b,_0x3bb1f4,_0x294714){return new BPromise(function(_0x3c971d,_0x3fc78d){return client[_0x507f('0xb')](_0x1cdc6b,_0x294714)[_0x507f('0xc')](function(_0x212687){logger[_0x507f('0xd')](_0x507f('0xe'),_0x3bb1f4,_0x507f('0xf'));logger[_0x507f('0x10')](_0x507f('0x11'),_0x3bb1f4,_0x507f('0xf'),JSON['stringify'](_0x212687));if(_0x212687['error']){if(_0x212687[_0x507f('0x12')][_0x507f('0x13')]===0x1f4){logger['error'](_0x507f('0xe'),_0x3bb1f4,_0x212687['error'][_0x507f('0x14')]);return _0x3fc78d(_0x212687['error'][_0x507f('0x14')]);}logger['error'](_0x507f('0xe'),_0x3bb1f4,_0x212687[_0x507f('0x12')]['message']);return _0x3c971d(_0x212687[_0x507f('0x12')][_0x507f('0x14')]);}else{logger[_0x507f('0xd')](_0x507f('0xe'),_0x3bb1f4,_0x507f('0xf'));_0x3c971d(_0x212687[_0x507f('0x15')][_0x507f('0x14')]);}})['catch'](function(_0x5640d1){logger[_0x507f('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3bb1f4,_0x5640d1);_0x3fc78d(_0x5640d1);});});}
\ No newline at end of file
+var _0x0e3f=['then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x594c6d,_0x4d984f){var _0x522757=function(_0x4ec408){while(--_0x4ec408){_0x594c6d['push'](_0x594c6d['shift']());}};_0x522757(++_0x4d984f);}(_0x0e3f,0x9d));var _0xf0e3=function(_0x119d13,_0x24b117){_0x119d13=_0x119d13-0x0;var _0x4e55ff=_0x0e3f[_0x119d13];return _0x4e55ff;};'use strict';var _=require('lodash');var util=require(_0xf0e3('0x0'));var moment=require(_0xf0e3('0x1'));var BPromise=require(_0xf0e3('0x2'));var rs=require(_0xf0e3('0x3'));var fs=require('fs');var Redis=require(_0xf0e3('0x4'));var db=require(_0xf0e3('0x5'))['db'];var utils=require(_0xf0e3('0x6'));var logger=require(_0xf0e3('0x7'))('rpc');var config=require(_0xf0e3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf0e3('0x9')][_0xf0e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa4f1ae,_0x373c87,_0x427685){return new BPromise(function(_0x49ff2f,_0x51ad08){return client['request'](_0xa4f1ae,_0x427685)[_0xf0e3('0xb')](function(_0x540a0f){logger[_0xf0e3('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x373c87,_0xf0e3('0xd'));logger[_0xf0e3('0xe')](_0xf0e3('0xf'),_0x373c87,'request\x20sent',JSON['stringify'](_0x540a0f));if(_0x540a0f[_0xf0e3('0x10')]){if(_0x540a0f['error']['code']===0x1f4){logger['error'](_0xf0e3('0x11'),_0x373c87,_0x540a0f[_0xf0e3('0x10')][_0xf0e3('0x12')]);return _0x51ad08(_0x540a0f['error'][_0xf0e3('0x12')]);}logger['error'](_0xf0e3('0x11'),_0x373c87,_0x540a0f[_0xf0e3('0x10')]['message']);return _0x49ff2f(_0x540a0f[_0xf0e3('0x10')][_0xf0e3('0x12')]);}else{logger[_0xf0e3('0xc')](_0xf0e3('0x11'),_0x373c87,_0xf0e3('0xd'));_0x49ff2f(_0x540a0f[_0xf0e3('0x13')][_0xf0e3('0x12')]);}})[_0xf0e3('0x14')](function(_0x11a8b1){logger[_0xf0e3('0x10')](_0xf0e3('0x11'),_0x373c87,_0x11a8b1);_0x51ad08(_0x11a8b1);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index f67fdfa..3eca815 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 _0x294b=['../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x117356,_0x245b01){var _0x2a4f5a=function(_0x81ffef){while(--_0x81ffef){_0x117356['push'](_0x117356['shift']());}};_0x2a4f5a(++_0x245b01);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb294('0x0'));var util=require('util');var path=require(_0xb294('0x1'));var timeout=require(_0xb294('0x2'));var express=require(_0xb294('0x3'));var router=express[_0xb294('0x4')]();var fs_extra=require(_0xb294('0x5'));var auth=require(_0xb294('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb294('0x7'));router[_0xb294('0x8')]('/',auth[_0xb294('0x9')](),controller[_0xb294('0xa')]);router[_0xb294('0x8')]('/:id',auth[_0xb294('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb294('0xb')]);router[_0xb294('0xc')](_0xb294('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb294('0xd'),auth[_0xb294('0x9')](),controller[_0xb294('0xe')]);module[_0xb294('0xf')]=router;
\ No newline at end of file
+var _0xb491=['express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5c265d,_0x4351a4){var _0x1e348d=function(_0x34162b){while(--_0x34162b){_0x5c265d['push'](_0x5c265d['shift']());}};_0x1e348d(++_0x4351a4);}(_0xb491,0x18c));var _0x1b49=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb491[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var path=require(_0x1b49('0x2'));var timeout=require(_0x1b49('0x3'));var express=require(_0x1b49('0x4'));var router=express[_0x1b49('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1b49('0x6'));var interaction=require(_0x1b49('0x7'));var config=require('../../config/environment');var controller=require(_0x1b49('0x8'));router[_0x1b49('0x9')]('/',auth[_0x1b49('0xa')](),controller['index']);router[_0x1b49('0x9')]('/:id',auth[_0x1b49('0xa')](),controller[_0x1b49('0xb')]);router[_0x1b49('0xc')]('/',auth[_0x1b49('0xa')](),controller[_0x1b49('0xd')]);router[_0x1b49('0xe')](_0x1b49('0xf'),auth[_0x1b49('0xa')](),controller[_0x1b49('0x10')]);router[_0x1b49('0x11')](_0x1b49('0xf'),auth[_0x1b49('0xa')](),controller[_0x1b49('0x12')]);module[_0x1b49('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index ba9cb7d..8c21b5c 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 _0x8a6f=['TEXT','sequelize'];(function(_0x4e38c1,_0xf156d){var _0x42dbf9=function(_0x133b51){while(--_0x133b51){_0x4e38c1['push'](_0x4e38c1['shift']());}};_0x42dbf9(++_0xf156d);}(_0x8a6f,0x1a5));var _0xf8a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a6f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf8a6('0x0'));module['exports']={'tree':{'type':Sequelize[_0xf8a6('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xfe43=['TEXT','sequelize'];(function(_0x20eb8d,_0x133ef8){var _0x231423=function(_0x6571f1){while(--_0x6571f1){_0x20eb8d['push'](_0x20eb8d['shift']());}};_0x231423(++_0x133ef8);}(_0xfe43,0x10f));var _0x3fe4=function(_0x3aa97d,_0x1734c5){_0x3aa97d=_0x3aa97d-0x0;var _0x59bf69=_0xfe43[_0x3aa97d];return _0x59bf69;};'use strict';var Sequelize=require(_0x3fe4('0x0'));module['exports']={'tree':{'type':Sequelize[_0x3fe4('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 33d75d9..86b8ef7 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 _0x76b7=['sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','include','findAll','rows','show','keys','includeAll','options','find','catch','create','body','params','eml-format','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x49873b,_0x26c041){var _0x4df91d=function(_0x4015d3){while(--_0x4015d3){_0x49873b['push'](_0x49873b['shift']());}};_0x4df91d(++_0x26c041);}(_0x76b7,0x128));var _0x776b=function(_0x16d29b,_0xa7e430){_0x16d29b=_0x16d29b-0x0;var _0x103f9d=_0x76b7[_0x16d29b];return _0x103f9d;};'use strict';var emlformat=require(_0x776b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x776b('0x1'));var rp=require(_0x776b('0x2'));var moment=require(_0x776b('0x3'));var BPromise=require(_0x776b('0x4'));var Mustache=require(_0x776b('0x5'));var util=require(_0x776b('0x6'));var path=require(_0x776b('0x7'));var sox=require(_0x776b('0x8'));var csv=require(_0x776b('0x9'));var ejs=require(_0x776b('0xa'));var fs=require('fs');var fs_extra=require(_0x776b('0xb'));var _=require(_0x776b('0xc'));var squel=require(_0x776b('0xd'));var crypto=require(_0x776b('0xe'));var jsforce=require(_0x776b('0xf'));var deskjs=require(_0x776b('0x10'));var toCsv=require(_0x776b('0x9'));var querystring=require(_0x776b('0x11'));var Papa=require(_0x776b('0x12'));var Redis=require('ioredis');var authService=require(_0x776b('0x13'));var qs=require(_0x776b('0x14'));var as=require(_0x776b('0x15'));var hardwareService=require(_0x776b('0x16'));var logger=require(_0x776b('0x17'))(_0x776b('0x18'));var utils=require(_0x776b('0x19'));var config=require(_0x776b('0x1a'));var licenseUtil=require(_0x776b('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcd81a4,_0x14037a){_0x14037a=_0x14037a||0xcc;return function(_0x4db86a){if(_0x4db86a){return _0xcd81a4[_0x776b('0x1c')](_0x14037a);}return _0xcd81a4['status'](_0x14037a)[_0x776b('0x1d')]();};}function respondWithResult(_0x46b729,_0x409aaa){_0x409aaa=_0x409aaa||0xc8;return function(_0x27fcbf){if(_0x27fcbf){return _0x46b729[_0x776b('0x1e')](_0x409aaa)[_0x776b('0x1f')](_0x27fcbf);}};}function respondWithFilteredResult(_0x222ff4,_0x2a0b7e){return function(_0x18a397){if(_0x18a397){var _0x41f5c9=typeof _0x2a0b7e['offset']===_0x776b('0x20')&&typeof _0x2a0b7e[_0x776b('0x21')]===_0x776b('0x20');var _0x1461ac=_0x18a397['count'];var _0x5effef=_0x41f5c9?0x0:_0x2a0b7e[_0x776b('0x22')];var _0x352225=_0x41f5c9?_0x18a397[_0x776b('0x23')]:_0x2a0b7e['offset']+_0x2a0b7e[_0x776b('0x21')];var _0x52fd98;if(_0x352225>=_0x1461ac){_0x352225=_0x1461ac;_0x52fd98=0xc8;}else{_0x52fd98=0xce;}_0x222ff4[_0x776b('0x1e')](_0x52fd98);return _0x222ff4[_0x776b('0x24')](_0x776b('0x25'),_0x5effef+'-'+_0x352225+'/'+_0x1461ac)[_0x776b('0x1f')](_0x18a397);}return null;};}function patchUpdates(_0x2f2406){return function(_0x560ca8){try{jsonpatch['apply'](_0x560ca8,_0x2f2406,!![]);}catch(_0x4416e4){return BPromise[_0x776b('0x26')](_0x4416e4);}return _0x560ca8[_0x776b('0x27')]();};}function saveUpdates(_0x10b6e7,_0x3bafe2){return function(_0x51c555){if(_0x51c555){return _0x51c555[_0x776b('0x28')](_0x10b6e7)[_0x776b('0x29')](function(_0x1dc2e3){return _0x1dc2e3;});}return null;};}function removeEntity(_0x3916f9,_0x17da71){return function(_0x4ed3d0){if(_0x4ed3d0){return _0x4ed3d0[_0x776b('0x2a')]()[_0x776b('0x29')](function(){_0x3916f9[_0x776b('0x1e')](0xcc)[_0x776b('0x1d')]();});}};}function handleEntityNotFound(_0x56dd23,_0x25a090){return function(_0x3ac0a7){if(!_0x3ac0a7){_0x56dd23[_0x776b('0x1c')](0x194);}return _0x3ac0a7;};}function handleError(_0x11b7b9,_0x21ccfc){_0x21ccfc=_0x21ccfc||0x1f4;return function(_0x3d4c46){logger[_0x776b('0x2b')](_0x3d4c46[_0x776b('0x2c')]);if(_0x3d4c46[_0x776b('0x2d')]){delete _0x3d4c46[_0x776b('0x2d')];}_0x11b7b9[_0x776b('0x1e')](_0x21ccfc)[_0x776b('0x2e')](_0x3d4c46);};}exports[_0x776b('0x2f')]=function(_0x1aaecc,_0x2dd71b){var _0x4f8c4d={},_0x423a88={},_0x2328ed={'count':0x0,'rows':[]};var _0x5ecbd2=_['map'](db[_0x776b('0x30')][_0x776b('0x31')],function(_0x4b6c70){return{'name':_0x4b6c70[_0x776b('0x32')],'type':_0x4b6c70[_0x776b('0x33')][_0x776b('0x34')]};});_0x423a88[_0x776b('0x35')]=_[_0x776b('0x36')](_0x5ecbd2,_0x776b('0x2d'));_0x423a88[_0x776b('0x37')]=_['keys'](_0x1aaecc[_0x776b('0x37')]);_0x423a88['filters']=_[_0x776b('0x38')](_0x423a88[_0x776b('0x35')],_0x423a88[_0x776b('0x37')]);_0x4f8c4d['attributes']=_['intersection'](_0x423a88[_0x776b('0x35')],qs[_0x776b('0x39')](_0x1aaecc['query'][_0x776b('0x39')]));_0x4f8c4d[_0x776b('0x3a')]=_0x4f8c4d[_0x776b('0x3a')][_0x776b('0x3b')]?_0x4f8c4d[_0x776b('0x3a')]:_0x423a88[_0x776b('0x35')];if(!_0x1aaecc['query']['hasOwnProperty'](_0x776b('0x3c'))){_0x4f8c4d[_0x776b('0x21')]=qs['limit'](_0x1aaecc[_0x776b('0x37')][_0x776b('0x21')]);_0x4f8c4d[_0x776b('0x22')]=qs[_0x776b('0x22')](_0x1aaecc[_0x776b('0x37')][_0x776b('0x22')]);}_0x4f8c4d[_0x776b('0x3d')]=qs[_0x776b('0x3e')](_0x1aaecc[_0x776b('0x37')]['sort']);_0x4f8c4d[_0x776b('0x3f')]=qs[_0x776b('0x40')](_[_0x776b('0x41')](_0x1aaecc[_0x776b('0x37')],_0x423a88[_0x776b('0x40')]),_0x5ecbd2);if(_0x1aaecc[_0x776b('0x37')]['filter']){_0x4f8c4d['where']=_['merge'](_0x4f8c4d[_0x776b('0x3f')],{'$or':_[_0x776b('0x36')](_0x5ecbd2,function(_0x2f534c){if(_0x2f534c[_0x776b('0x33')]!==_0x776b('0x42')){var _0x326b06={};_0x326b06[_0x2f534c[_0x776b('0x2d')]]={'$like':'%'+_0x1aaecc['query'][_0x776b('0x43')]+'%'};return _0x326b06;}})});}_0x4f8c4d=_[_0x776b('0x44')]({},_0x4f8c4d,_0x1aaecc['options']);var _0xd8f003={'where':_0x4f8c4d[_0x776b('0x3f')]};return db[_0x776b('0x30')][_0x776b('0x23')](_0xd8f003)[_0x776b('0x29')](function(_0x11c292){_0x2328ed[_0x776b('0x23')]=_0x11c292;if(_0x1aaecc['query']['includeAll']){_0x4f8c4d[_0x776b('0x45')]=[{'all':!![]}];}return db[_0x776b('0x30')][_0x776b('0x46')](_0x4f8c4d);})[_0x776b('0x29')](function(_0x1e07a3){_0x2328ed[_0x776b('0x47')]=_0x1e07a3;return _0x2328ed;})[_0x776b('0x29')](respondWithFilteredResult(_0x2dd71b,_0x4f8c4d))['catch'](handleError(_0x2dd71b,null));};exports[_0x776b('0x48')]=function(_0x4793d5,_0x295c54){var _0x5afdc6={'raw':!![],'where':{'id':_0x4793d5['params']['id']}},_0x9c9be7={};_0x9c9be7['model']=_[_0x776b('0x49')](db[_0x776b('0x30')][_0x776b('0x31')]);_0x9c9be7[_0x776b('0x37')]=_['keys'](_0x4793d5[_0x776b('0x37')]);_0x9c9be7['filters']=_['intersection'](_0x9c9be7[_0x776b('0x35')],_0x9c9be7[_0x776b('0x37')]);_0x5afdc6['attributes']=_[_0x776b('0x38')](_0x9c9be7[_0x776b('0x35')],qs['fields'](_0x4793d5['query'][_0x776b('0x39')]));_0x5afdc6[_0x776b('0x3a')]=_0x5afdc6['attributes'][_0x776b('0x3b')]?_0x5afdc6[_0x776b('0x3a')]:_0x9c9be7[_0x776b('0x35')];if(_0x4793d5['query'][_0x776b('0x4a')]){_0x5afdc6[_0x776b('0x45')]=[{'all':!![]}];}_0x5afdc6=_[_0x776b('0x44')]({},_0x5afdc6,_0x4793d5[_0x776b('0x4b')]);return db[_0x776b('0x30')][_0x776b('0x4c')](_0x5afdc6)[_0x776b('0x29')](handleEntityNotFound(_0x295c54,null))['then'](respondWithResult(_0x295c54,null))[_0x776b('0x4d')](handleError(_0x295c54,null));};exports[_0x776b('0x4e')]=function(_0x274ffa,_0x5629d2){return db['AnalyticTreeReport'][_0x776b('0x4e')](_0x274ffa[_0x776b('0x4f')],{})[_0x776b('0x29')](respondWithResult(_0x5629d2,0xc9))[_0x776b('0x4d')](handleError(_0x5629d2,null));};exports[_0x776b('0x28')]=function(_0x259573,_0x7fa115){if(_0x259573[_0x776b('0x4f')]['id']){delete _0x259573[_0x776b('0x4f')]['id'];}return db[_0x776b('0x30')][_0x776b('0x4c')]({'where':{'id':_0x259573[_0x776b('0x50')]['id']}})[_0x776b('0x29')](handleEntityNotFound(_0x7fa115,null))[_0x776b('0x29')](saveUpdates(_0x259573['body'],null))[_0x776b('0x29')](respondWithResult(_0x7fa115,null))['catch'](handleError(_0x7fa115,null));};exports[_0x776b('0x2a')]=function(_0x57e87d,_0x4027f5){return db['AnalyticTreeReport']['find']({'where':{'id':_0x57e87d[_0x776b('0x50')]['id']}})[_0x776b('0x29')](handleEntityNotFound(_0x4027f5,null))['then'](removeEntity(_0x4027f5,null))[_0x776b('0x4d')](handleError(_0x4027f5,null));};
\ No newline at end of file
+var _0x084d=['end','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy'];(function(_0xe1bdfa,_0x5371ce){var _0x28daee=function(_0x3d0cbb){while(--_0x3d0cbb){_0xe1bdfa['push'](_0xe1bdfa['shift']());}};_0x28daee(++_0x5371ce);}(_0x084d,0x1f0));var _0xd084=function(_0x1ac0e4,_0x561600){_0x1ac0e4=_0x1ac0e4-0x0;var _0x3e0a05=_0x084d[_0x1ac0e4];return _0x3e0a05;};'use strict';var emlformat=require(_0xd084('0x0'));var rimraf=require(_0xd084('0x1'));var zipdir=require(_0xd084('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd084('0x3'));var moment=require(_0xd084('0x4'));var BPromise=require(_0xd084('0x5'));var Mustache=require(_0xd084('0x6'));var util=require(_0xd084('0x7'));var path=require(_0xd084('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd084('0x9'));var fs=require('fs');var fs_extra=require(_0xd084('0xa'));var _=require(_0xd084('0xb'));var squel=require(_0xd084('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd084('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd084('0xe'));var Papa=require(_0xd084('0xf'));var Redis=require('ioredis');var authService=require(_0xd084('0x10'));var qs=require(_0xd084('0x11'));var as=require(_0xd084('0x12'));var hardwareService=require(_0xd084('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd084('0x14'));var config=require(_0xd084('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd084('0x16'))['db'];function respondWithStatusCode(_0x4c7d89,_0xf40a57){_0xf40a57=_0xf40a57||0xcc;return function(_0x1cf598){if(_0x1cf598){return _0x4c7d89['sendStatus'](_0xf40a57);}return _0x4c7d89[_0xd084('0x17')](_0xf40a57)['end']();};}function respondWithResult(_0xedc714,_0x2e7157){_0x2e7157=_0x2e7157||0xc8;return function(_0x444924){if(_0x444924){return _0xedc714[_0xd084('0x17')](_0x2e7157)[_0xd084('0x18')](_0x444924);}};}function respondWithFilteredResult(_0x4e7450,_0x387e5e){return function(_0x43e7f1){if(_0x43e7f1){var _0x2545a4=typeof _0x387e5e[_0xd084('0x19')]===_0xd084('0x1a')&&typeof _0x387e5e[_0xd084('0x1b')]===_0xd084('0x1a');var _0x236794=_0x43e7f1[_0xd084('0x1c')];var _0x5dea67=_0x2545a4?0x0:_0x387e5e['offset'];var _0x1f26d1=_0x2545a4?_0x43e7f1[_0xd084('0x1c')]:_0x387e5e[_0xd084('0x19')]+_0x387e5e[_0xd084('0x1b')];var _0x5689e1;if(_0x1f26d1>=_0x236794){_0x1f26d1=_0x236794;_0x5689e1=0xc8;}else{_0x5689e1=0xce;}_0x4e7450['status'](_0x5689e1);return _0x4e7450[_0xd084('0x1d')](_0xd084('0x1e'),_0x5dea67+'-'+_0x1f26d1+'/'+_0x236794)[_0xd084('0x18')](_0x43e7f1);}return null;};}function patchUpdates(_0x360104){return function(_0x3d44f9){try{jsonpatch[_0xd084('0x1f')](_0x3d44f9,_0x360104,!![]);}catch(_0x52848f){return BPromise['reject'](_0x52848f);}return _0x3d44f9[_0xd084('0x20')]();};}function saveUpdates(_0x316ba1,_0x4a0085){return function(_0x1e1121){if(_0x1e1121){return _0x1e1121[_0xd084('0x21')](_0x316ba1)[_0xd084('0x22')](function(_0xe1042b){return _0xe1042b;});}return null;};}function removeEntity(_0x3b5854,_0x24aec5){return function(_0x4e01d1){if(_0x4e01d1){return _0x4e01d1[_0xd084('0x23')]()[_0xd084('0x22')](function(){_0x3b5854[_0xd084('0x17')](0xcc)[_0xd084('0x24')]();});}};}function handleEntityNotFound(_0x4320a1,_0xa4dbde){return function(_0x8d790){if(!_0x8d790){_0x4320a1[_0xd084('0x25')](0x194);}return _0x8d790;};}function handleError(_0x1cc951,_0x299e6a){_0x299e6a=_0x299e6a||0x1f4;return function(_0x24cf17){logger[_0xd084('0x26')](_0x24cf17[_0xd084('0x27')]);if(_0x24cf17['name']){delete _0x24cf17[_0xd084('0x28')];}_0x1cc951[_0xd084('0x17')](_0x299e6a)[_0xd084('0x29')](_0x24cf17);};}exports[_0xd084('0x2a')]=function(_0x10ef6c,_0x410b0a){var _0x2478f1={},_0x23c9f0={},_0x13d9bd={'count':0x0,'rows':[]};var _0x30ff7a=_[_0xd084('0x2b')](db[_0xd084('0x2c')][_0xd084('0x2d')],function(_0x1bfa50){return{'name':_0x1bfa50[_0xd084('0x2e')],'type':_0x1bfa50[_0xd084('0x2f')][_0xd084('0x30')]};});_0x23c9f0[_0xd084('0x31')]=_[_0xd084('0x2b')](_0x30ff7a,'name');_0x23c9f0['query']=_[_0xd084('0x32')](_0x10ef6c[_0xd084('0x33')]);_0x23c9f0[_0xd084('0x34')]=_['intersection'](_0x23c9f0[_0xd084('0x31')],_0x23c9f0[_0xd084('0x33')]);_0x2478f1[_0xd084('0x35')]=_[_0xd084('0x36')](_0x23c9f0['model'],qs[_0xd084('0x37')](_0x10ef6c['query'][_0xd084('0x37')]));_0x2478f1[_0xd084('0x35')]=_0x2478f1[_0xd084('0x35')][_0xd084('0x38')]?_0x2478f1['attributes']:_0x23c9f0[_0xd084('0x31')];if(!_0x10ef6c['query'][_0xd084('0x39')](_0xd084('0x3a'))){_0x2478f1[_0xd084('0x1b')]=qs[_0xd084('0x1b')](_0x10ef6c[_0xd084('0x33')][_0xd084('0x1b')]);_0x2478f1[_0xd084('0x19')]=qs['offset'](_0x10ef6c[_0xd084('0x33')][_0xd084('0x19')]);}_0x2478f1[_0xd084('0x3b')]=qs[_0xd084('0x3c')](_0x10ef6c[_0xd084('0x33')][_0xd084('0x3c')]);_0x2478f1[_0xd084('0x3d')]=qs[_0xd084('0x34')](_['pick'](_0x10ef6c[_0xd084('0x33')],_0x23c9f0[_0xd084('0x34')]),_0x30ff7a);if(_0x10ef6c['query'][_0xd084('0x3e')]){_0x2478f1[_0xd084('0x3d')]=_[_0xd084('0x3f')](_0x2478f1[_0xd084('0x3d')],{'$or':_[_0xd084('0x2b')](_0x30ff7a,function(_0x1e87be){if(_0x1e87be['type']!==_0xd084('0x40')){var _0x41b5fa={};_0x41b5fa[_0x1e87be[_0xd084('0x28')]]={'$like':'%'+_0x10ef6c[_0xd084('0x33')][_0xd084('0x3e')]+'%'};return _0x41b5fa;}})});}_0x2478f1=_['merge']({},_0x2478f1,_0x10ef6c[_0xd084('0x41')]);var _0xbb210a={'where':_0x2478f1[_0xd084('0x3d')]};return db['AnalyticTreeReport']['count'](_0xbb210a)['then'](function(_0x519a7c){_0x13d9bd['count']=_0x519a7c;if(_0x10ef6c[_0xd084('0x33')]['includeAll']){_0x2478f1[_0xd084('0x42')]=[{'all':!![]}];}return db[_0xd084('0x2c')][_0xd084('0x43')](_0x2478f1);})[_0xd084('0x22')](function(_0x176424){_0x13d9bd[_0xd084('0x44')]=_0x176424;return _0x13d9bd;})[_0xd084('0x22')](respondWithFilteredResult(_0x410b0a,_0x2478f1))[_0xd084('0x45')](handleError(_0x410b0a,null));};exports[_0xd084('0x46')]=function(_0x522012,_0xa49f24){var _0x4d2fb6={'raw':!![],'where':{'id':_0x522012[_0xd084('0x47')]['id']}},_0x52fc6a={};_0x52fc6a[_0xd084('0x31')]=_[_0xd084('0x32')](db[_0xd084('0x2c')]['rawAttributes']);_0x52fc6a['query']=_[_0xd084('0x32')](_0x522012[_0xd084('0x33')]);_0x52fc6a['filters']=_[_0xd084('0x36')](_0x52fc6a[_0xd084('0x31')],_0x52fc6a[_0xd084('0x33')]);_0x4d2fb6[_0xd084('0x35')]=_[_0xd084('0x36')](_0x52fc6a[_0xd084('0x31')],qs[_0xd084('0x37')](_0x522012[_0xd084('0x33')][_0xd084('0x37')]));_0x4d2fb6[_0xd084('0x35')]=_0x4d2fb6[_0xd084('0x35')][_0xd084('0x38')]?_0x4d2fb6[_0xd084('0x35')]:_0x52fc6a[_0xd084('0x31')];if(_0x522012[_0xd084('0x33')][_0xd084('0x48')]){_0x4d2fb6['include']=[{'all':!![]}];}_0x4d2fb6=_[_0xd084('0x3f')]({},_0x4d2fb6,_0x522012['options']);return db['AnalyticTreeReport'][_0xd084('0x49')](_0x4d2fb6)['then'](handleEntityNotFound(_0xa49f24,null))[_0xd084('0x22')](respondWithResult(_0xa49f24,null))[_0xd084('0x45')](handleError(_0xa49f24,null));};exports[_0xd084('0x4a')]=function(_0x2b8862,_0x19b951){return db[_0xd084('0x2c')][_0xd084('0x4a')](_0x2b8862[_0xd084('0x4b')],{})['then'](respondWithResult(_0x19b951,0xc9))[_0xd084('0x45')](handleError(_0x19b951,null));};exports[_0xd084('0x21')]=function(_0xf738dd,_0x334c42){if(_0xf738dd['body']['id']){delete _0xf738dd[_0xd084('0x4b')]['id'];}return db[_0xd084('0x2c')][_0xd084('0x49')]({'where':{'id':_0xf738dd[_0xd084('0x47')]['id']}})['then'](handleEntityNotFound(_0x334c42,null))[_0xd084('0x22')](saveUpdates(_0xf738dd[_0xd084('0x4b')],null))[_0xd084('0x22')](respondWithResult(_0x334c42,null))[_0xd084('0x45')](handleError(_0x334c42,null));};exports['destroy']=function(_0x3460ea,_0x373db8){return db[_0xd084('0x2c')][_0xd084('0x49')]({'where':{'id':_0x3460ea[_0xd084('0x47')]['id']}})[_0xd084('0x22')](handleEntityNotFound(_0x373db8,null))[_0xd084('0x22')](removeEntity(_0x373db8,null))[_0xd084('0x45')](handleError(_0x373db8,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 1acd0a8..f968ce5 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 _0x03e3=['api','moment','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','util'];(function(_0x408357,_0x56042b){var _0x55812f=function(_0x622bf0){while(--_0x622bf0){_0x408357['push'](_0x408357['shift']());}};_0x55812f(++_0x56042b);}(_0x03e3,0xfb));var _0x303e=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x03e3[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0x303e('0x0'));var logger=require('../../config/logger')(_0x303e('0x1'));var moment=require(_0x303e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x303e('0x3'));var rimraf=require(_0x303e('0x4'));var config=require(_0x303e('0x5'));var attributes=require(_0x303e('0x6'));module[_0x303e('0x7')]=function(_0x13eea0,_0x5e58d4){return _0x13eea0[_0x303e('0x8')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x157f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees'];(function(_0x5e07a7,_0x1438b3){var _0x22ced5=function(_0x7c975b){while(--_0x7c975b){_0x5e07a7['push'](_0x5e07a7['shift']());}};_0x22ced5(++_0x1438b3);}(_0x157f,0x1e0));var _0xf157=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x157f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0xf157('0x0'));var logger=require(_0xf157('0x1'))(_0xf157('0x2'));var moment=require(_0xf157('0x3'));var BPromise=require(_0xf157('0x4'));var rp=require(_0xf157('0x5'));var fs=require('fs');var path=require(_0xf157('0x6'));var rimraf=require(_0xf157('0x7'));var config=require('../../config/environment');var attributes=require(_0xf157('0x8'));module[_0xf157('0x9')]=function(_0xe96228,_0x39e4f5){return _0xe96228['define'](_0xf157('0xa'),attributes,{'tableName':_0xf157('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 9b80d3e..7f7624a 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4ee5d3,_0x432589){var _0x3a0562=function(_0x442e4a){while(--_0x442e4a){_0x4ee5d3['push'](_0x4ee5d3['shift']());}};_0x3a0562(++_0x432589);}(_0x2ef3,0xba));var _0x32ef=function(_0xd20e6,_0x1fd952){_0xd20e6=_0xd20e6-0x0;var _0x179c35=_0x2ef3[_0xd20e6];return _0x179c35;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xd91551,_0x52d19c){var _0x4a387c=function(_0x1207a4){while(--_0x1207a4){_0xd91551['push'](_0xd91551['shift']());}};_0x4a387c(++_0x52d19c);}(_0x2ef3,0xba));var _0x32ef=function(_0x313d17,_0x6ca19){_0x313d17=_0x313d17-0x0;var _0x1030d7=_0x2ef3[_0x313d17];return _0x1030d7;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index dd9dbe6..682f5ae 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 _0x007a=['get','index','/:id','post','put','isAuthenticated','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x007a,0x1b1));var _0xa007=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0x007a[_0x6dd5c];return _0x5a87fa;};'use strict';var multer=require(_0xa007('0x0'));var util=require(_0xa007('0x1'));var path=require(_0xa007('0x2'));var timeout=require(_0xa007('0x3'));var express=require('express');var router=express[_0xa007('0x4')]();var fs_extra=require(_0xa007('0x5'));var auth=require(_0xa007('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa007('0x7'));var controller=require(_0xa007('0x8'));router[_0xa007('0x9')]('/',auth['isAuthenticated'](),controller[_0xa007('0xa')]);router[_0xa007('0x9')](_0xa007('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa007('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa007('0xd')](_0xa007('0xb'),auth[_0xa007('0xe')](),controller['update']);router[_0xa007('0xf')](_0xa007('0xb'),auth[_0xa007('0xe')](),controller[_0xa007('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xde5b=['post','create','put','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde5b,0x15b));var _0xbde5=function(_0x3164df,_0x422e0b){_0x3164df=_0x3164df-0x0;var _0x55a888=_0xde5b[_0x3164df];return _0x55a888;};'use strict';var multer=require(_0xbde5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbde5('0x1'));var express=require(_0xbde5('0x2'));var router=express[_0xbde5('0x3')]();var fs_extra=require(_0xbde5('0x4'));var auth=require(_0xbde5('0x5'));var interaction=require(_0xbde5('0x6'));var config=require(_0xbde5('0x7'));var controller=require(_0xbde5('0x8'));router[_0xbde5('0x9')]('/',auth[_0xbde5('0xa')](),controller[_0xbde5('0xb')]);router[_0xbde5('0x9')](_0xbde5('0xc'),auth[_0xbde5('0xa')](),controller['show']);router[_0xbde5('0xd')]('/',auth[_0xbde5('0xa')](),controller[_0xbde5('0xe')]);router[_0xbde5('0xf')](_0xbde5('0xc'),auth[_0xbde5('0xa')](),controller['update']);router[_0xbde5('0x10')](_0xbde5('0xc'),auth[_0xbde5('0xa')](),controller[_0xbde5('0x11')]);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 cae0e2e..c82275a 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 _0x8781=['sequelize','exports','STRING'];(function(_0x284d0c,_0x2c902b){var _0x195652=function(_0x56518f){while(--_0x56518f){_0x284d0c['push'](_0x284d0c['shift']());}};_0x195652(++_0x2c902b);}(_0x8781,0x1c8));var _0x1878=function(_0xcdd7f6,_0x1b6b9f){_0xcdd7f6=_0xcdd7f6-0x0;var _0xd3cd3f=_0x8781[_0xcdd7f6];return _0xd3cd3f;};'use strict';var Sequelize=require(_0x1878('0x0'));module[_0x1878('0x1')]={'name':{'type':Sequelize[_0x1878('0x2')]},'basename':{'type':Sequelize[_0x1878('0x2')]},'type':{'type':Sequelize[_0x1878('0x2')]}};
\ No newline at end of file
+var _0x53d5=['STRING','sequelize','exports'];(function(_0x596a28,_0x4cab9a){var _0x1bcb1f=function(_0xf9dda7){while(--_0xf9dda7){_0x596a28['push'](_0x596a28['shift']());}};_0x1bcb1f(++_0x4cab9a);}(_0x53d5,0x1cc));var _0x553d=function(_0x32f109,_0x1f1b71){_0x32f109=_0x32f109-0x0;var _0x550dc7=_0x53d5[_0x32f109];return _0x550dc7;};'use strict';var Sequelize=require(_0x553d('0x0'));module[_0x553d('0x1')]={'name':{'type':Sequelize[_0x553d('0x2')]},'basename':{'type':Sequelize[_0x553d('0x2')]},'type':{'type':Sequelize[_0x553d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 78a6139..25c8e86 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 _0xc497=['sort','where','pick','filter','merge','VIRTUAL','options','include','show','params','includeAll','find','catch','clone','keys','get','omit','createdAt','updatedAt','body','originalname','file','filename','type','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','basename','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','name','send','index','map','Attachment','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x586d8c,_0x32da99){var _0x173163=function(_0x530cac){while(--_0x530cac){_0x586d8c['push'](_0x586d8c['shift']());}};_0x173163(++_0x32da99);}(_0xc497,0x1ce));var _0x7c49=function(_0xc13260,_0x1e7b6a){_0xc13260=_0xc13260-0x0;var _0x2277ca=_0xc497[_0xc13260];return _0x2277ca;};'use strict';var emlformat=require(_0x7c49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c49('0x1'));var jsonpatch=require(_0x7c49('0x2'));var rp=require('request-promise');var moment=require(_0x7c49('0x3'));var BPromise=require(_0x7c49('0x4'));var Mustache=require('mustache');var util=require(_0x7c49('0x5'));var path=require(_0x7c49('0x6'));var sox=require(_0x7c49('0x7'));var csv=require(_0x7c49('0x8'));var ejs=require(_0x7c49('0x9'));var fs=require('fs');var fs_extra=require(_0x7c49('0xa'));var _=require(_0x7c49('0xb'));var squel=require(_0x7c49('0xc'));var crypto=require('crypto');var jsforce=require(_0x7c49('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c49('0xe'));var Papa=require(_0x7c49('0xf'));var Redis=require(_0x7c49('0x10'));var authService=require(_0x7c49('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7c49('0x12'));var hardwareService=require(_0x7c49('0x13'));var logger=require(_0x7c49('0x14'))('api');var utils=require(_0x7c49('0x15'));var config=require(_0x7c49('0x16'));var licenseUtil=require(_0x7c49('0x17'));var db=require(_0x7c49('0x18'))['db'];function respondWithStatusCode(_0x217b2c,_0x5ef8ef){_0x5ef8ef=_0x5ef8ef||0xcc;return function(_0x3e5aca){if(_0x3e5aca){return _0x217b2c[_0x7c49('0x19')](_0x5ef8ef);}return _0x217b2c[_0x7c49('0x1a')](_0x5ef8ef)[_0x7c49('0x1b')]();};}function respondWithResult(_0x1f8bdd,_0x23f1b5){_0x23f1b5=_0x23f1b5||0xc8;return function(_0x268539){if(_0x268539){return _0x1f8bdd['status'](_0x23f1b5)[_0x7c49('0x1c')](_0x268539);}};}function respondWithFilteredResult(_0x102c93,_0x472e42){return function(_0x2360f7){if(_0x2360f7){var _0x38d317=typeof _0x472e42[_0x7c49('0x1d')]===_0x7c49('0x1e')&&typeof _0x472e42['limit']===_0x7c49('0x1e');var _0x15c6dc=_0x2360f7[_0x7c49('0x1f')];var _0x3b240e=_0x38d317?0x0:_0x472e42[_0x7c49('0x1d')];var _0x279bdc=_0x38d317?_0x2360f7['count']:_0x472e42[_0x7c49('0x1d')]+_0x472e42[_0x7c49('0x20')];var _0x2989b9;if(_0x279bdc>=_0x15c6dc){_0x279bdc=_0x15c6dc;_0x2989b9=0xc8;}else{_0x2989b9=0xce;}_0x102c93['status'](_0x2989b9);return _0x102c93['set']('Content-Range',_0x3b240e+'-'+_0x279bdc+'/'+_0x15c6dc)[_0x7c49('0x1c')](_0x2360f7);}return null;};}function patchUpdates(_0x1c0608){return function(_0x296432){try{jsonpatch[_0x7c49('0x21')](_0x296432,_0x1c0608,!![]);}catch(_0x4dc42a){return BPromise[_0x7c49('0x22')](_0x4dc42a);}return _0x296432[_0x7c49('0x23')]();};}function saveUpdates(_0x2a63cb,_0x51f8a2){return function(_0x357478){if(_0x357478){return _0x357478[_0x7c49('0x24')](_0x2a63cb)['then'](function(_0x3f2ae2){return _0x3f2ae2;});}return null;};}function removeEntity(_0x54451c,_0x143ced){return function(_0x4f34a4){if(_0x4f34a4){return _0x4f34a4['destroy']()[_0x7c49('0x25')](function(){_0x54451c[_0x7c49('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xec9ee9,_0x3e9a12){return function(_0x3ca358){if(!_0x3ca358){_0xec9ee9[_0x7c49('0x19')](0x194);}return _0x3ca358;};}function handleError(_0x591088,_0x1d2177){_0x1d2177=_0x1d2177||0x1f4;return function(_0x58da52){logger['error'](_0x58da52['stack']);if(_0x58da52[_0x7c49('0x26')]){delete _0x58da52['name'];}_0x591088['status'](_0x1d2177)[_0x7c49('0x27')](_0x58da52);};}exports[_0x7c49('0x28')]=function(_0x1002b6,_0x442231){var _0x45aaa5={},_0x3a323f={},_0x52a258={'count':0x0,'rows':[]};var _0x155772=_[_0x7c49('0x29')](db[_0x7c49('0x2a')][_0x7c49('0x2b')],function(_0x27c233){return{'name':_0x27c233['fieldName'],'type':_0x27c233['type'][_0x7c49('0x2c')]};});_0x3a323f[_0x7c49('0x2d')]=_[_0x7c49('0x29')](_0x155772,_0x7c49('0x26'));_0x3a323f[_0x7c49('0x2e')]=_['keys'](_0x1002b6[_0x7c49('0x2e')]);_0x3a323f[_0x7c49('0x2f')]=_[_0x7c49('0x30')](_0x3a323f[_0x7c49('0x2d')],_0x3a323f[_0x7c49('0x2e')]);_0x45aaa5['attributes']=_[_0x7c49('0x30')](_0x3a323f['model'],qs[_0x7c49('0x31')](_0x1002b6[_0x7c49('0x2e')][_0x7c49('0x31')]));_0x45aaa5[_0x7c49('0x32')]=_0x45aaa5[_0x7c49('0x32')][_0x7c49('0x33')]?_0x45aaa5[_0x7c49('0x32')]:_0x3a323f['model'];if(!_0x1002b6[_0x7c49('0x2e')][_0x7c49('0x34')](_0x7c49('0x35'))){_0x45aaa5['limit']=qs['limit'](_0x1002b6[_0x7c49('0x2e')][_0x7c49('0x20')]);_0x45aaa5[_0x7c49('0x1d')]=qs['offset'](_0x1002b6[_0x7c49('0x2e')][_0x7c49('0x1d')]);}_0x45aaa5['order']=qs[_0x7c49('0x36')](_0x1002b6[_0x7c49('0x2e')][_0x7c49('0x36')]);_0x45aaa5[_0x7c49('0x37')]=qs[_0x7c49('0x2f')](_[_0x7c49('0x38')](_0x1002b6['query'],_0x3a323f[_0x7c49('0x2f')]),_0x155772);if(_0x1002b6[_0x7c49('0x2e')][_0x7c49('0x39')]){_0x45aaa5[_0x7c49('0x37')]=_[_0x7c49('0x3a')](_0x45aaa5[_0x7c49('0x37')],{'$or':_[_0x7c49('0x29')](_0x155772,function(_0x11e0c0){if(_0x11e0c0['type']!==_0x7c49('0x3b')){var _0x2ca840={};_0x2ca840[_0x11e0c0[_0x7c49('0x26')]]={'$like':'%'+_0x1002b6[_0x7c49('0x2e')][_0x7c49('0x39')]+'%'};return _0x2ca840;}})});}_0x45aaa5=_[_0x7c49('0x3a')]({},_0x45aaa5,_0x1002b6[_0x7c49('0x3c')]);var _0x582422={'where':_0x45aaa5['where']};return db[_0x7c49('0x2a')]['count'](_0x582422)[_0x7c49('0x25')](function(_0x133d26){_0x52a258[_0x7c49('0x1f')]=_0x133d26;if(_0x1002b6[_0x7c49('0x2e')]['includeAll']){_0x45aaa5[_0x7c49('0x3d')]=[{'all':!![]}];}return db[_0x7c49('0x2a')]['findAll'](_0x45aaa5);})[_0x7c49('0x25')](function(_0x5a5c1a){_0x52a258['rows']=_0x5a5c1a;return _0x52a258;})[_0x7c49('0x25')](respondWithFilteredResult(_0x442231,_0x45aaa5))['catch'](handleError(_0x442231,null));};exports[_0x7c49('0x3e')]=function(_0x44bf48,_0x56c853){var _0x51fd07={'raw':!![],'where':{'id':_0x44bf48[_0x7c49('0x3f')]['id']}},_0xcd9c5a={};_0xcd9c5a[_0x7c49('0x2d')]=_['keys'](db['Attachment'][_0x7c49('0x2b')]);_0xcd9c5a[_0x7c49('0x2e')]=_['keys'](_0x44bf48[_0x7c49('0x2e')]);_0xcd9c5a[_0x7c49('0x2f')]=_[_0x7c49('0x30')](_0xcd9c5a[_0x7c49('0x2d')],_0xcd9c5a[_0x7c49('0x2e')]);_0x51fd07[_0x7c49('0x32')]=_['intersection'](_0xcd9c5a[_0x7c49('0x2d')],qs['fields'](_0x44bf48[_0x7c49('0x2e')][_0x7c49('0x31')]));_0x51fd07[_0x7c49('0x32')]=_0x51fd07[_0x7c49('0x32')]['length']?_0x51fd07[_0x7c49('0x32')]:_0xcd9c5a[_0x7c49('0x2d')];if(_0x44bf48[_0x7c49('0x2e')][_0x7c49('0x40')]){_0x51fd07[_0x7c49('0x3d')]=[{'all':!![]}];}_0x51fd07=_[_0x7c49('0x3a')]({},_0x51fd07,_0x44bf48['options']);return db[_0x7c49('0x2a')][_0x7c49('0x41')](_0x51fd07)[_0x7c49('0x25')](handleEntityNotFound(_0x56c853,null))[_0x7c49('0x25')](respondWithResult(_0x56c853,null))[_0x7c49('0x42')](handleError(_0x56c853,null));};exports[_0x7c49('0x43')]=function(_0x5052fb,_0x293006){var _0x1c0501={'where':{'id':_0x5052fb[_0x7c49('0x3f')]['id']}},_0xf0c61c={};_0xf0c61c[_0x7c49('0x2d')]=_[_0x7c49('0x44')](db[_0x7c49('0x2a')][_0x7c49('0x2b')]);_0x1c0501[_0x7c49('0x32')]=_[_0x7c49('0x30')](_0xf0c61c['model'],qs['fields'](_0x5052fb[_0x7c49('0x2e')][_0x7c49('0x31')]));_0x1c0501['attributes']=_0x1c0501[_0x7c49('0x32')][_0x7c49('0x33')]?_0x1c0501['attributes']:_0xf0c61c['model'];if(_0x5052fb[_0x7c49('0x2e')][_0x7c49('0x40')]){_0x1c0501[_0x7c49('0x3d')]=[{'all':!![]}];}_0x1c0501=_[_0x7c49('0x3a')]({},_0x1c0501,_0x5052fb[_0x7c49('0x3c')]);return db['Attachment']['find'](_0x1c0501)[_0x7c49('0x25')](handleEntityNotFound(_0x293006,null))[_0x7c49('0x25')](function(_0xd6b98d){if(_0xd6b98d){var _0x136c51=_0xd6b98d[_0x7c49('0x45')]({'plain':!![]});_0x136c51=qs[_0x7c49('0x46')](_0x136c51,['id',_0x7c49('0x47'),_0x7c49('0x48')]);_0x5052fb[_0x7c49('0x49')]=_[_0x7c49('0x46')](_0x5052fb[_0x7c49('0x49')],['id',_0x7c49('0x47'),_0x7c49('0x48')]);return db['Attachment']['create'](_[_0x7c49('0x3a')](_0x136c51,_0x5052fb[_0x7c49('0x49')]),{'include':_0x5052fb[_0x7c49('0x2e')][_0x7c49('0x40')]?[{'all':!![]}]:undefined});}})[_0x7c49('0x25')](respondWithResult(_0x293006,0xc9))[_0x7c49('0x42')](handleError(_0x293006,null));};exports[_0x7c49('0x24')]=function(_0x8990e5,_0x4f4aac){if(_0x8990e5[_0x7c49('0x49')]['id']){delete _0x8990e5[_0x7c49('0x49')]['id'];}return db[_0x7c49('0x2a')][_0x7c49('0x41')]({'where':{'id':_0x8990e5['params']['id']}})[_0x7c49('0x25')](handleEntityNotFound(_0x4f4aac,null))['then'](saveUpdates(_0x8990e5[_0x7c49('0x49')],null))[_0x7c49('0x25')](respondWithResult(_0x4f4aac,null))['catch'](handleError(_0x4f4aac,null));};exports['destroy']=function(_0x33ae61,_0x1e1458){return db[_0x7c49('0x2a')]['find']({'where':{'id':_0x33ae61[_0x7c49('0x3f')]['id']}})[_0x7c49('0x25')](handleEntityNotFound(_0x1e1458,null))[_0x7c49('0x25')](removeEntity(_0x1e1458,null))[_0x7c49('0x42')](handleError(_0x1e1458,null));};exports['create']=function(_0x57ab6f,_0x83fbc,_0x3372d8){_0x57ab6f[_0x7c49('0x49')][_0x7c49('0x26')]=_0x57ab6f['file'][_0x7c49('0x4a')];_0x57ab6f['body']['basename']=_0x57ab6f[_0x7c49('0x4b')][_0x7c49('0x4c')];_0x57ab6f[_0x7c49('0x49')][_0x7c49('0x4d')]=_0x57ab6f[_0x7c49('0x4b')][_0x7c49('0x4e')];return db['Attachment']['create'](_0x57ab6f[_0x7c49('0x49')])[_0x7c49('0x25')](respondWithResult(_0x83fbc,0xc9))[_0x7c49('0x42')](handleError(_0x83fbc,null));};exports[_0x7c49('0x4f')]=function(_0x36ae3f,_0x3fa8b2,_0x83d7f2){return db[_0x7c49('0x2a')]['findOne']({'where':{'id':_0x36ae3f['params']['id']},'raw':!![]})[_0x7c49('0x25')](handleEntityNotFound(_0x3fa8b2,null))[_0x7c49('0x25')](function(_0x504c82){if(_0x504c82){var _0x5602d4=_0x504c82[_0x7c49('0x50')]!==null;var _0x47f9a4=path['join'](config[_0x7c49('0x51')],_0x7c49('0x52'));if(_0x5602d4){_0x47f9a4=path['join'](_0x47f9a4,_0x7c49('0x53'));}var _0x19929=path[_0x7c49('0x54')](_0x47f9a4,_0x504c82[_0x7c49('0x55')]);return _0x3fa8b2[_0x7c49('0x4f')](_0x19929);}})[_0x7c49('0x42')](handleError(_0x3fa8b2,null));};
\ No newline at end of file
+var _0xbf83=['set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','filter','merge','VIRTUAL','options','include','Attachment','rows','show','params','includeAll','find','catch','clone','omit','createdAt','updatedAt','body','create','file','basename','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count'];(function(_0x184b97,_0x4a6a57){var _0x35b5e2=function(_0x29f22b){while(--_0x29f22b){_0x184b97['push'](_0x184b97['shift']());}};_0x35b5e2(++_0x4a6a57);}(_0xbf83,0x8d));var _0x3bf8=function(_0x5307b8,_0x4eea1a){_0x5307b8=_0x5307b8-0x0;var _0x3e206b=_0xbf83[_0x5307b8];return _0x3e206b;};'use strict';var emlformat=require(_0x3bf8('0x0'));var rimraf=require(_0x3bf8('0x1'));var zipdir=require(_0x3bf8('0x2'));var jsonpatch=require(_0x3bf8('0x3'));var rp=require(_0x3bf8('0x4'));var moment=require(_0x3bf8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3bf8('0x6'));var util=require(_0x3bf8('0x7'));var path=require(_0x3bf8('0x8'));var sox=require('sox');var csv=require(_0x3bf8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bf8('0xa'));var squel=require(_0x3bf8('0xb'));var crypto=require(_0x3bf8('0xc'));var jsforce=require(_0x3bf8('0xd'));var deskjs=require(_0x3bf8('0xe'));var toCsv=require(_0x3bf8('0x9'));var querystring=require(_0x3bf8('0xf'));var Papa=require('papaparse');var Redis=require(_0x3bf8('0x10'));var authService=require(_0x3bf8('0x11'));var qs=require(_0x3bf8('0x12'));var as=require(_0x3bf8('0x13'));var hardwareService=require(_0x3bf8('0x14'));var logger=require('../../config/logger')(_0x3bf8('0x15'));var utils=require('../../config/utils');var config=require(_0x3bf8('0x16'));var licenseUtil=require(_0x3bf8('0x17'));var db=require(_0x3bf8('0x18'))['db'];function respondWithStatusCode(_0x1258c9,_0x2ea2f2){_0x2ea2f2=_0x2ea2f2||0xcc;return function(_0x2f1e62){if(_0x2f1e62){return _0x1258c9[_0x3bf8('0x19')](_0x2ea2f2);}return _0x1258c9[_0x3bf8('0x1a')](_0x2ea2f2)['end']();};}function respondWithResult(_0x1d8339,_0x22ee50){_0x22ee50=_0x22ee50||0xc8;return function(_0x34f941){if(_0x34f941){return _0x1d8339[_0x3bf8('0x1a')](_0x22ee50)['json'](_0x34f941);}};}function respondWithFilteredResult(_0x38a4bf,_0x23ce13){return function(_0x558ded){if(_0x558ded){var _0xfef83d=typeof _0x23ce13[_0x3bf8('0x1b')]==='undefined'&&typeof _0x23ce13[_0x3bf8('0x1c')]===_0x3bf8('0x1d');var _0x202eb0=_0x558ded['count'];var _0x4ed680=_0xfef83d?0x0:_0x23ce13[_0x3bf8('0x1b')];var _0x44ede6=_0xfef83d?_0x558ded[_0x3bf8('0x1e')]:_0x23ce13[_0x3bf8('0x1b')]+_0x23ce13[_0x3bf8('0x1c')];var _0x3eae09;if(_0x44ede6>=_0x202eb0){_0x44ede6=_0x202eb0;_0x3eae09=0xc8;}else{_0x3eae09=0xce;}_0x38a4bf[_0x3bf8('0x1a')](_0x3eae09);return _0x38a4bf[_0x3bf8('0x1f')](_0x3bf8('0x20'),_0x4ed680+'-'+_0x44ede6+'/'+_0x202eb0)[_0x3bf8('0x21')](_0x558ded);}return null;};}function patchUpdates(_0x4f273b){return function(_0x425dea){try{jsonpatch[_0x3bf8('0x22')](_0x425dea,_0x4f273b,!![]);}catch(_0x2559e4){return BPromise['reject'](_0x2559e4);}return _0x425dea[_0x3bf8('0x23')]();};}function saveUpdates(_0x5e197b,_0x50724a){return function(_0x147024){if(_0x147024){return _0x147024[_0x3bf8('0x24')](_0x5e197b)[_0x3bf8('0x25')](function(_0x2291a8){return _0x2291a8;});}return null;};}function removeEntity(_0x50515a,_0x1540da){return function(_0x50c971){if(_0x50c971){return _0x50c971[_0x3bf8('0x26')]()[_0x3bf8('0x25')](function(){_0x50515a[_0x3bf8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a8c29,_0x22f07c){return function(_0x23f9f9){if(!_0x23f9f9){_0x9a8c29[_0x3bf8('0x19')](0x194);}return _0x23f9f9;};}function handleError(_0x202051,_0x352ad4){_0x352ad4=_0x352ad4||0x1f4;return function(_0xf51695){logger[_0x3bf8('0x27')](_0xf51695[_0x3bf8('0x28')]);if(_0xf51695[_0x3bf8('0x29')]){delete _0xf51695[_0x3bf8('0x29')];}_0x202051[_0x3bf8('0x1a')](_0x352ad4)['send'](_0xf51695);};}exports['index']=function(_0x5d61a4,_0x321daa){var _0x3b8c40={},_0x39187a={},_0x31f615={'count':0x0,'rows':[]};var _0x272f6b=_[_0x3bf8('0x2a')](db['Attachment'][_0x3bf8('0x2b')],function(_0x5bfdda){return{'name':_0x5bfdda[_0x3bf8('0x2c')],'type':_0x5bfdda[_0x3bf8('0x2d')][_0x3bf8('0x2e')]};});_0x39187a[_0x3bf8('0x2f')]=_[_0x3bf8('0x2a')](_0x272f6b,_0x3bf8('0x29'));_0x39187a[_0x3bf8('0x30')]=_[_0x3bf8('0x31')](_0x5d61a4[_0x3bf8('0x30')]);_0x39187a['filters']=_['intersection'](_0x39187a[_0x3bf8('0x2f')],_0x39187a[_0x3bf8('0x30')]);_0x3b8c40[_0x3bf8('0x32')]=_[_0x3bf8('0x33')](_0x39187a[_0x3bf8('0x2f')],qs[_0x3bf8('0x34')](_0x5d61a4[_0x3bf8('0x30')][_0x3bf8('0x34')]));_0x3b8c40['attributes']=_0x3b8c40[_0x3bf8('0x32')][_0x3bf8('0x35')]?_0x3b8c40[_0x3bf8('0x32')]:_0x39187a[_0x3bf8('0x2f')];if(!_0x5d61a4[_0x3bf8('0x30')][_0x3bf8('0x36')]('nolimit')){_0x3b8c40[_0x3bf8('0x1c')]=qs[_0x3bf8('0x1c')](_0x5d61a4[_0x3bf8('0x30')]['limit']);_0x3b8c40[_0x3bf8('0x1b')]=qs['offset'](_0x5d61a4[_0x3bf8('0x30')][_0x3bf8('0x1b')]);}_0x3b8c40[_0x3bf8('0x37')]=qs['sort'](_0x5d61a4['query']['sort']);_0x3b8c40[_0x3bf8('0x38')]=qs[_0x3bf8('0x39')](_['pick'](_0x5d61a4[_0x3bf8('0x30')],_0x39187a['filters']),_0x272f6b);if(_0x5d61a4[_0x3bf8('0x30')][_0x3bf8('0x3a')]){_0x3b8c40[_0x3bf8('0x38')]=_[_0x3bf8('0x3b')](_0x3b8c40['where'],{'$or':_[_0x3bf8('0x2a')](_0x272f6b,function(_0x4c6b9a){if(_0x4c6b9a['type']!==_0x3bf8('0x3c')){var _0x1d327f={};_0x1d327f[_0x4c6b9a[_0x3bf8('0x29')]]={'$like':'%'+_0x5d61a4[_0x3bf8('0x30')][_0x3bf8('0x3a')]+'%'};return _0x1d327f;}})});}_0x3b8c40=_['merge']({},_0x3b8c40,_0x5d61a4[_0x3bf8('0x3d')]);var _0x831d63={'where':_0x3b8c40['where']};return db['Attachment']['count'](_0x831d63)['then'](function(_0x29abcc){_0x31f615[_0x3bf8('0x1e')]=_0x29abcc;if(_0x5d61a4[_0x3bf8('0x30')]['includeAll']){_0x3b8c40[_0x3bf8('0x3e')]=[{'all':!![]}];}return db[_0x3bf8('0x3f')]['findAll'](_0x3b8c40);})['then'](function(_0x12c27f){_0x31f615[_0x3bf8('0x40')]=_0x12c27f;return _0x31f615;})['then'](respondWithFilteredResult(_0x321daa,_0x3b8c40))['catch'](handleError(_0x321daa,null));};exports[_0x3bf8('0x41')]=function(_0x2bb2bc,_0x3aef44){var _0x2b0dfc={'raw':!![],'where':{'id':_0x2bb2bc[_0x3bf8('0x42')]['id']}},_0x3e7bba={};_0x3e7bba[_0x3bf8('0x2f')]=_['keys'](db[_0x3bf8('0x3f')][_0x3bf8('0x2b')]);_0x3e7bba[_0x3bf8('0x30')]=_['keys'](_0x2bb2bc[_0x3bf8('0x30')]);_0x3e7bba[_0x3bf8('0x39')]=_['intersection'](_0x3e7bba['model'],_0x3e7bba[_0x3bf8('0x30')]);_0x2b0dfc[_0x3bf8('0x32')]=_[_0x3bf8('0x33')](_0x3e7bba[_0x3bf8('0x2f')],qs[_0x3bf8('0x34')](_0x2bb2bc['query'][_0x3bf8('0x34')]));_0x2b0dfc[_0x3bf8('0x32')]=_0x2b0dfc['attributes'][_0x3bf8('0x35')]?_0x2b0dfc['attributes']:_0x3e7bba[_0x3bf8('0x2f')];if(_0x2bb2bc['query'][_0x3bf8('0x43')]){_0x2b0dfc[_0x3bf8('0x3e')]=[{'all':!![]}];}_0x2b0dfc=_['merge']({},_0x2b0dfc,_0x2bb2bc[_0x3bf8('0x3d')]);return db[_0x3bf8('0x3f')][_0x3bf8('0x44')](_0x2b0dfc)['then'](handleEntityNotFound(_0x3aef44,null))[_0x3bf8('0x25')](respondWithResult(_0x3aef44,null))[_0x3bf8('0x45')](handleError(_0x3aef44,null));};exports[_0x3bf8('0x46')]=function(_0x1946d1,_0x26d769){var _0x50799f={'where':{'id':_0x1946d1[_0x3bf8('0x42')]['id']}},_0x31260a={};_0x31260a['model']=_['keys'](db[_0x3bf8('0x3f')]['rawAttributes']);_0x50799f[_0x3bf8('0x32')]=_[_0x3bf8('0x33')](_0x31260a[_0x3bf8('0x2f')],qs[_0x3bf8('0x34')](_0x1946d1[_0x3bf8('0x30')]['fields']));_0x50799f[_0x3bf8('0x32')]=_0x50799f[_0x3bf8('0x32')][_0x3bf8('0x35')]?_0x50799f[_0x3bf8('0x32')]:_0x31260a['model'];if(_0x1946d1[_0x3bf8('0x30')]['includeAll']){_0x50799f['include']=[{'all':!![]}];}_0x50799f=_['merge']({},_0x50799f,_0x1946d1[_0x3bf8('0x3d')]);return db[_0x3bf8('0x3f')][_0x3bf8('0x44')](_0x50799f)[_0x3bf8('0x25')](handleEntityNotFound(_0x26d769,null))[_0x3bf8('0x25')](function(_0x20c6bd){if(_0x20c6bd){var _0x5e1fb0=_0x20c6bd['get']({'plain':!![]});_0x5e1fb0=qs[_0x3bf8('0x47')](_0x5e1fb0,['id',_0x3bf8('0x48'),_0x3bf8('0x49')]);_0x1946d1['body']=_[_0x3bf8('0x47')](_0x1946d1[_0x3bf8('0x4a')],['id',_0x3bf8('0x48'),_0x3bf8('0x49')]);return db[_0x3bf8('0x3f')][_0x3bf8('0x4b')](_[_0x3bf8('0x3b')](_0x5e1fb0,_0x1946d1[_0x3bf8('0x4a')]),{'include':_0x1946d1[_0x3bf8('0x30')][_0x3bf8('0x43')]?[{'all':!![]}]:undefined});}})[_0x3bf8('0x25')](respondWithResult(_0x26d769,0xc9))[_0x3bf8('0x45')](handleError(_0x26d769,null));};exports[_0x3bf8('0x24')]=function(_0xe01761,_0x2f22a3){if(_0xe01761['body']['id']){delete _0xe01761[_0x3bf8('0x4a')]['id'];}return db[_0x3bf8('0x3f')][_0x3bf8('0x44')]({'where':{'id':_0xe01761[_0x3bf8('0x42')]['id']}})[_0x3bf8('0x25')](handleEntityNotFound(_0x2f22a3,null))['then'](saveUpdates(_0xe01761[_0x3bf8('0x4a')],null))[_0x3bf8('0x25')](respondWithResult(_0x2f22a3,null))[_0x3bf8('0x45')](handleError(_0x2f22a3,null));};exports[_0x3bf8('0x26')]=function(_0x11567b,_0x5763ee){return db[_0x3bf8('0x3f')][_0x3bf8('0x44')]({'where':{'id':_0x11567b[_0x3bf8('0x42')]['id']}})[_0x3bf8('0x25')](handleEntityNotFound(_0x5763ee,null))['then'](removeEntity(_0x5763ee,null))[_0x3bf8('0x45')](handleError(_0x5763ee,null));};exports[_0x3bf8('0x4b')]=function(_0x70880,_0x3f580f,_0x4e7d3e){_0x70880['body']['name']=_0x70880[_0x3bf8('0x4c')]['originalname'];_0x70880[_0x3bf8('0x4a')][_0x3bf8('0x4d')]=_0x70880[_0x3bf8('0x4c')][_0x3bf8('0x4e')];_0x70880['body'][_0x3bf8('0x2d')]=_0x70880[_0x3bf8('0x4c')]['mimetype'];return db[_0x3bf8('0x3f')][_0x3bf8('0x4b')](_0x70880[_0x3bf8('0x4a')])[_0x3bf8('0x25')](respondWithResult(_0x3f580f,0xc9))[_0x3bf8('0x45')](handleError(_0x3f580f,null));};exports['download']=function(_0x1b957a,_0x5b8323,_0x24d01a){return db['Attachment'][_0x3bf8('0x4f')]({'where':{'id':_0x1b957a[_0x3bf8('0x42')]['id']},'raw':!![]})[_0x3bf8('0x25')](handleEntityNotFound(_0x5b8323,null))[_0x3bf8('0x25')](function(_0xe351ce){if(_0xe351ce){var _0x2f93ca=_0xe351ce[_0x3bf8('0x50')]!==null;var _0x48e8fd=path[_0x3bf8('0x51')](config[_0x3bf8('0x52')],_0x3bf8('0x53'));if(_0x2f93ca){_0x48e8fd=path['join'](_0x48e8fd,_0x3bf8('0x54'));}var _0x2a0b0a=path['join'](_0x48e8fd,_0xe351ce[_0x3bf8('0x4d')]);return _0x5b8323[_0x3bf8('0x55')](_0x2a0b0a);}})[_0x3bf8('0x45')](handleError(_0x5b8323,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 938f5c1..d5369d6 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 _0x849d=['attachments','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x849d,0xb7));var _0xd849=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x849d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd849('0x0'));var util=require('util');var logger=require(_0xd849('0x1'))(_0xd849('0x2'));var moment=require(_0xd849('0x3'));var BPromise=require(_0xd849('0x4'));var rp=require(_0xd849('0x5'));var fs=require('fs');var path=require(_0xd849('0x6'));var rimraf=require(_0xd849('0x7'));var config=require(_0xd849('0x8'));var attributes=require(_0xd849('0x9'));module[_0xd849('0xa')]=function(_0x1f65b5,_0x51e462){return _0x1f65b5[_0xd849('0xb')](_0xd849('0xc'),attributes,{'tableName':_0xd849('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x741e=['path','../../config/environment','./attachment.attributes','define','attachments','util','api','bluebird','request-promise'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x741e,0x188));var _0xe741=function(_0x1d6118,_0x3fd686){_0x1d6118=_0x1d6118-0x0;var _0x4da1bc=_0x741e[_0x1d6118];return _0x4da1bc;};'use strict';var _=require('lodash');var util=require(_0xe741('0x0'));var logger=require('../../config/logger')(_0xe741('0x1'));var moment=require('moment');var BPromise=require(_0xe741('0x2'));var rp=require(_0xe741('0x3'));var fs=require('fs');var path=require(_0xe741('0x4'));var rimraf=require('rimraf');var config=require(_0xe741('0x5'));var attributes=require(_0xe741('0x6'));module['exports']=function(_0x3b8eae,_0xc63e0d){return _0x3b8eae[_0xe741('0x7')]('Attachment',attributes,{'tableName':_0xe741('0x8'),'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 2233a8f..1323abe 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 _0x780f=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','body','options','raw','then','stringify'];(function(_0x88da3c,_0x247311){var _0x245c9a=function(_0x4d003c){while(--_0x4d003c){_0x88da3c['push'](_0x88da3c['shift']());}};_0x245c9a(++_0x247311);}(_0x780f,0x6c));var _0xf780=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0x780f[_0x33bcdb];return _0x18a9bf;};'use strict';var _=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var moment=require(_0xf780('0x2'));var BPromise=require(_0xf780('0x3'));var rs=require(_0xf780('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf780('0x5'));var logger=require(_0xf780('0x6'))(_0xf780('0x7'));var config=require(_0xf780('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf780('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd856,_0x93539d,_0x1c3fdc){return new BPromise(function(_0xa12d00,_0x44f14c){return client[_0xf780('0xa')](_0x1bd856,_0x1c3fdc)['then'](function(_0x2c8221){logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));logger[_0xf780('0xe')](_0xf780('0xf'),_0x93539d,_0xf780('0xd'),JSON['stringify'](_0x2c8221));if(_0x2c8221['error']){if(_0x2c8221[_0xf780('0x10')][_0xf780('0x11')]===0x1f4){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x2c8221['error'][_0xf780('0x12')]);return _0x44f14c(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}logger[_0xf780('0x10')]('Attachment,\x20%s,\x20%s',_0x93539d,_0x2c8221[_0xf780('0x10')]['message']);return _0xa12d00(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}else{logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));_0xa12d00(_0x2c8221[_0xf780('0x13')][_0xf780('0x12')]);}})['catch'](function(_0x450198){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x450198);_0x44f14c(_0x450198);});});}exports[_0xf780('0x14')]=function(_0x5d5a81){var _0x188554=this;return new Promise(function(_0x53dfee,_0x3ede41){return db[_0xf780('0x15')]['create'](_0x5d5a81[_0xf780('0x16')],{'raw':_0x5d5a81[_0xf780('0x17')]?_0x5d5a81['options'][_0xf780('0x18')]===undefined?!![]:![]:!![]})[_0xf780('0x19')](function(_0x3c7054){logger[_0xf780('0xb')](_0xf780('0x14'),_0x5d5a81);logger[_0xf780('0xe')]('CreateAttachment',_0x5d5a81,JSON[_0xf780('0x1a')](_0x3c7054));_0x53dfee(_0x3c7054);})['catch'](function(_0x5853ea){logger[_0xf780('0x10')](_0xf780('0x14'),_0x5853ea[_0xf780('0x12')],_0x5d5a81);_0x3ede41(_0x188554['error'](0x1f4,_0x5853ea[_0xf780('0x12')]));});});};
\ No newline at end of file
+var _0x2504=['catch','CreateAttachment','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','Attachment,\x20%s,\x20%s','message','result'];(function(_0x4b08fa,_0x1e020b){var _0x45a873=function(_0x752a4c){while(--_0x752a4c){_0x4b08fa['push'](_0x4b08fa['shift']());}};_0x45a873(++_0x1e020b);}(_0x2504,0xee));var _0x4250=function(_0x205d04,_0x8a59df){_0x205d04=_0x205d04-0x0;var _0x511f43=_0x2504[_0x205d04];return _0x511f43;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var moment=require(_0x4250('0x2'));var BPromise=require(_0x4250('0x3'));var rs=require(_0x4250('0x4'));var fs=require('fs');var Redis=require(_0x4250('0x5'));var db=require(_0x4250('0x6'))['db'];var utils=require(_0x4250('0x7'));var logger=require(_0x4250('0x8'))(_0x4250('0x9'));var config=require(_0x4250('0xa'));var jayson=require(_0x4250('0xb'));var client=jayson['client'][_0x4250('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e177e,_0x5a5286,_0x370998){return new BPromise(function(_0x477312,_0x1a3b57){return client[_0x4250('0xd')](_0x4e177e,_0x370998)[_0x4250('0xe')](function(_0x51ea6f){logger[_0x4250('0xf')]('Attachment,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'));logger[_0x4250('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'),JSON['stringify'](_0x51ea6f));if(_0x51ea6f['error']){if(_0x51ea6f[_0x4250('0x12')][_0x4250('0x13')]===0x1f4){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')]['message']);return _0x1a3b57(_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);}logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);return _0x477312(_0x51ea6f['error'][_0x4250('0x15')]);}else{logger[_0x4250('0xf')](_0x4250('0x14'),_0x5a5286,_0x4250('0x10'));_0x477312(_0x51ea6f[_0x4250('0x16')][_0x4250('0x15')]);}})[_0x4250('0x17')](function(_0x4e70fc){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x4e70fc);_0x1a3b57(_0x4e70fc);});});}exports[_0x4250('0x18')]=function(_0x17a8a9){var _0x369010=this;return new Promise(function(_0x30e48c,_0x14d590){return db['Attachment'][_0x4250('0x19')](_0x17a8a9['body'],{'raw':_0x17a8a9['options']?_0x17a8a9[_0x4250('0x1a')][_0x4250('0x1b')]===undefined?!![]:![]:!![]})[_0x4250('0xe')](function(_0x42c331){logger[_0x4250('0xf')](_0x4250('0x18'),_0x17a8a9);logger[_0x4250('0x11')](_0x4250('0x18'),_0x17a8a9,JSON[_0x4250('0x1c')](_0x42c331));_0x30e48c(_0x42c331);})[_0x4250('0x17')](function(_0x728862){logger[_0x4250('0x12')]('CreateAttachment',_0x728862[_0x4250('0x15')],_0x17a8a9);_0x14d590(_0x369010[_0x4250('0x12')](0x1f4,_0x728862[_0x4250('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index aaed215..68455c3 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x51c033,_0x106532){var _0x37685c=function(_0x1e9a4a){while(--_0x1e9a4a){_0x51c033['push'](_0x51c033['shift']());}};_0x37685c(++_0x106532);}(_0xb10b,0x12a));var _0xbb10=function(_0x4efdfd,_0x4a27df){_0x4efdfd=_0x4efdfd-0x0;var _0x2b413=_0xb10b[_0x4efdfd];return _0x2b413;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index aba2a4d..fdd4b04 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 _0xaaa9=['minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','password','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','blockDuration','adSsoEnabled','findOne','role','blockedAt','user','then','name','domain','disabled','add'];(function(_0x3eae5e,_0x1064b6){var _0x1f8630=function(_0xac81c4){while(--_0xac81c4){_0x3eae5e['push'](_0x3eae5e['shift']());}};_0x1f8630(++_0x1064b6);}(_0xaaa9,0x98));var _0x9aaa=function(_0x1e0e3e,_0x26487f){_0x1e0e3e=_0x1e0e3e-0x0;var _0x64695=_0xaaa9[_0x1e0e3e];return _0x64695;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x9aaa('0x0'))[_0x9aaa('0x1')];var moment=require(_0x9aaa('0x2'));var ActiveDirectory=require(_0x9aaa('0x3'));var BPromise=require(_0x9aaa('0x4'));var util=require(_0x9aaa('0x5'));var db=require(_0x9aaa('0x6'))['db'];var authService=require(_0x9aaa('0x7'));var utils=require(_0x9aaa('0x8'));var config=require(_0x9aaa('0x9'));var logger=require(_0x9aaa('0xa'))(_0x9aaa('0xb'));function isActiveDirectoryConfigured(_0x17f37e){var _0xea111b=![];if(typeof _0x17f37e[_0x9aaa('0xc')]!==_0x9aaa('0xd')){_0xea111b=_0x17f37e[_0x9aaa('0xc')]['baseDN']&&_0x17f37e[_0x9aaa('0xc')]['url']&&_0x17f37e['activedirectory']['domain'];}return _0xea111b;}function adAuthenticate(_0x22bfcf,_0x249d87,_0x13d6f0){return new BPromise(function(_0x3394c0,_0x55e866){try{var _0x564bff=new ActiveDirectory(_0x22bfcf);_0x564bff[_0x9aaa('0xe')](_0x249d87,_0x13d6f0,function(_0x107f55,_0x1fd7a9){if(_0x107f55){logger[_0x9aaa('0xf')](_0x9aaa('0x10'),_0x249d87,util[_0x9aaa('0x11')](_0x107f55,{'showHidden':![],'depth':null}));_0x55e866(_0x9aaa('0x12'));}else if(!_0x1fd7a9){logger[_0x9aaa('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x249d87);_0x55e866(_0x9aaa('0x12'));}else{_0x3394c0(_0x1fd7a9);}});}catch(_0x5629b8){_0x55e866(_0x5629b8);}});}function ActiveDirectoryAuthenticate(_0x4d2108,_0x3d42ae,_0x441e7c,_0x1259fb){var _0x224d47,_0x282755;if(!isActiveDirectoryConfigured(config)){logger[_0x9aaa('0xf')](_0x9aaa('0x13'),_0x3d42ae);return _0x1259fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x9aaa('0x14')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x9aaa('0x15')],'raw':!![]})['then'](function(_0x126155){_0x224d47=_0x126155;if(!_0x224d47[_0x9aaa('0x16')]){logger[_0x9aaa('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x3d42ae);throw new Error(_0x9aaa('0x12'));}return _0x4d2108[_0x9aaa('0x17')]({'logging':!![],'attributes':['id','name','password','salt',_0x9aaa('0x18'),'disabled','blocked',_0x9aaa('0x19'),'online'],'where':{'name':_0x3d42ae,'role':{'$or':['admin',_0x9aaa('0x1a'),'agent']},'adSsoEnabled':!![]}});})[_0x9aaa('0x1b')](function(_0x4dec4d){if(!_0x4dec4d||_0x4dec4d&&_0x4dec4d[_0x9aaa('0x1c')]!==_0x3d42ae){throw new Error(_0x9aaa('0x12'));}_0x282755=_0x4dec4d;var _0x407d60=_0x282755[_0x9aaa('0x1c')]+'@'+config[_0x9aaa('0xc')][_0x9aaa('0x1d')];return adAuthenticate(config[_0x9aaa('0xc')],_0x407d60,_0x441e7c);})[_0x9aaa('0x1b')](function(_0x320e88){if(_0x282755[_0x9aaa('0x1e')]){throw new Error(_0x9aaa('0x12'));}if(_0x224d47['blockDuration']>0x0){if(_0x282755['blocked']){if(moment(_0x282755[_0x9aaa('0x19')])[_0x9aaa('0x1f')](_0x224d47[_0x9aaa('0x15')],_0x9aaa('0x20'))>moment()){throw new Error(_0x9aaa('0x12'));}return utils[_0x9aaa('0x21')](_0x282755,0x0,![],null)[_0x9aaa('0x1b')](function(){return utils[_0x9aaa('0x22')](_0x282755);})[_0x9aaa('0x1b')](function(){return _0x1259fb(null,_0x282755);});}else{return utils[_0x9aaa('0x22')](_0x282755)[_0x9aaa('0x1b')](function(){return _0x1259fb(null,_0x282755);});}}else{return utils[_0x9aaa('0x22')](_0x282755)[_0x9aaa('0x1b')](function(){return _0x1259fb(null,_0x282755);});}})[_0x9aaa('0x23')](function(_0x288b7d){return _0x1259fb(null,![],_0x288b7d);});}function handleError(_0xbdc98c,_0x199b06,_0x3dd3c6){return _0xbdc98c[_0x9aaa('0x24')](_0x199b06||0x1f4)[_0x9aaa('0x25')]({'message':_0x3dd3c6?_0x3dd3c6['message']||_0x3dd3c6:''});}exports[_0x9aaa('0x26')]=function(_0x2af9bd,_0x3142c6,_0x90335d){passport[_0x9aaa('0xe')](_0x9aaa('0x27'),function(_0xcb7925,_0x495605,_0x2a69be){var _0x17fb4c=_0xcb7925||_0x2a69be;if(_0x17fb4c){return handleError(_0x3142c6,0x191,_0x17fb4c);}if(!_0x495605){return handleError(_0x3142c6,0x194,{'message':_0x9aaa('0x28')});}else{var _0x37e4d1={'payload':{'id':_0x495605['id'],'role':_0x495605[_0x9aaa('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0x9aaa('0x29')](_0x37e4d1)[_0x9aaa('0x1b')](function(_0x626224){_0x3142c6[_0x9aaa('0x2a')]({'id':_0x495605['id'],'token':_0x626224,'statusCall':'','isAlreadyLogged':_0x495605[_0x9aaa('0x2b')]});});}})(_0x2af9bd,_0x3142c6,_0x90335d);};passport[_0x9aaa('0x2c')]('ad-login',new LocalStrategy({'usernameField':_0x9aaa('0x1c'),'passwordField':_0x9aaa('0x2d')},function(_0x2bb65d,_0x547040,_0x486102){return ActiveDirectoryAuthenticate(db['User'],_0x2bb65d,_0x547040,_0x486102);}));
\ No newline at end of file
+var _0xb32f=['findOne','adSsoEnabled','blockDuration','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','then','name','getLicense','catch','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','api','activedirectory','baseDN','url','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting'];(function(_0x35a771,_0x3577ff){var _0x3b977e=function(_0x21a06a){while(--_0x21a06a){_0x35a771['push'](_0x35a771['shift']());}};_0x3b977e(++_0x3577ff);}(_0xb32f,0x144));var _0xfb32=function(_0x2b0d9f,_0x20409d){_0x2b0d9f=_0x2b0d9f-0x0;var _0x21ad80=_0xb32f[_0x2b0d9f];return _0x21ad80;};'use strict';var passport=require(_0xfb32('0x0'));var LocalStrategy=require('passport-local')[_0xfb32('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xfb32('0x2'));var BPromise=require(_0xfb32('0x3'));var util=require(_0xfb32('0x4'));var db=require(_0xfb32('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xfb32('0x6'));var config=require(_0xfb32('0x7'));var logger=require('../../config/logger')(_0xfb32('0x8'));function isActiveDirectoryConfigured(_0x26b978){var _0x1e408f=![];if(typeof _0x26b978[_0xfb32('0x9')]!=='undefined'){_0x1e408f=_0x26b978[_0xfb32('0x9')][_0xfb32('0xa')]&&_0x26b978[_0xfb32('0x9')][_0xfb32('0xb')]&&_0x26b978[_0xfb32('0x9')]['domain'];}return _0x1e408f;}function adAuthenticate(_0x25fc81,_0x4025d0,_0x1fa551){return new BPromise(function(_0x3356de,_0x5b211e){try{var _0x96ede8=new ActiveDirectory(_0x25fc81);_0x96ede8[_0xfb32('0xc')](_0x4025d0,_0x1fa551,function(_0x5469d0,_0x3753da){if(_0x5469d0){logger['error'](_0xfb32('0xd'),_0x4025d0,util[_0xfb32('0xe')](_0x5469d0,{'showHidden':![],'depth':null}));_0x5b211e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x3753da){logger[_0xfb32('0xf')](_0xfb32('0x10'),_0x4025d0);_0x5b211e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3356de(_0x3753da);}});}catch(_0x453e08){_0x5b211e(_0x453e08);}});}function ActiveDirectoryAuthenticate(_0x30354b,_0x19ec16,_0x45c9ac,_0x187899){var _0x2ec2ba,_0x3c4d6c;if(!isActiveDirectoryConfigured(config)){logger[_0xfb32('0xf')](_0xfb32('0x11'),_0x19ec16);return _0x187899(null,![],{'message':_0xfb32('0x12')});}return db[_0xfb32('0x13')][_0xfb32('0x14')]({'where':{'id':0x1},'attributes':[_0xfb32('0x15'),_0xfb32('0x16')],'raw':!![]})['then'](function(_0x5153e3){_0x2ec2ba=_0x5153e3;if(!_0x2ec2ba[_0xfb32('0x15')]){logger[_0xfb32('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x19ec16);throw new Error(_0xfb32('0x12'));}return _0x30354b[_0xfb32('0x14')]({'logging':!![],'attributes':['id','name',_0xfb32('0x17'),_0xfb32('0x18'),_0xfb32('0x19'),_0xfb32('0x1a'),_0xfb32('0x1b'),_0xfb32('0x1c'),_0xfb32('0x1d')],'where':{'name':_0x19ec16,'role':{'$or':[_0xfb32('0x1e'),'user',_0xfb32('0x1f')]},'adSsoEnabled':!![]}});})[_0xfb32('0x20')](function(_0x677cd0){if(!_0x677cd0||_0x677cd0&&_0x677cd0[_0xfb32('0x21')]!==_0x19ec16){throw new Error(_0xfb32('0x12'));}_0x3c4d6c=_0x677cd0;var _0x3ac3c7=_0x3c4d6c['name']+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0xfb32('0x9')],_0x3ac3c7,_0x45c9ac);})[_0xfb32('0x20')](function(_0x4732f4){if(_0x3c4d6c['disabled']){throw new Error(_0xfb32('0x12'));}if(_0x2ec2ba[_0xfb32('0x16')]>0x0){if(_0x3c4d6c[_0xfb32('0x1b')]){if(moment(_0x3c4d6c[_0xfb32('0x1c')])['add'](_0x2ec2ba[_0xfb32('0x16')],'minutes')>moment()){throw new Error(_0xfb32('0x12'));}return utils['clearBlockUser'](_0x3c4d6c,0x0,![],null)[_0xfb32('0x20')](function(){return utils['getLicense'](_0x3c4d6c);})['then'](function(){return _0x187899(null,_0x3c4d6c);});}else{return utils[_0xfb32('0x22')](_0x3c4d6c)[_0xfb32('0x20')](function(){return _0x187899(null,_0x3c4d6c);});}}else{return utils[_0xfb32('0x22')](_0x3c4d6c)[_0xfb32('0x20')](function(){return _0x187899(null,_0x3c4d6c);});}})[_0xfb32('0x23')](function(_0x5c9590){return _0x187899(null,![],_0x5c9590);});}function handleError(_0x2a78a2,_0x121f2e,_0x14e45b){return _0x2a78a2['status'](_0x121f2e||0x1f4)[_0xfb32('0x24')]({'message':_0x14e45b?_0x14e45b['message']||_0x14e45b:''});}exports[_0xfb32('0x25')]=function(_0x69152b,_0x5f3594,_0x52096f){passport[_0xfb32('0xc')](_0xfb32('0x26'),function(_0x2ce318,_0x23829e,_0x5d8723){var _0x1ceb9b=_0x2ce318||_0x5d8723;if(_0x1ceb9b){return handleError(_0x5f3594,0x191,_0x1ceb9b);}if(!_0x23829e){return handleError(_0x5f3594,0x194,{'message':_0xfb32('0x27')});}else{var _0x4ecf4d={'payload':{'id':_0x23829e['id'],'role':_0x23829e[_0xfb32('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4ecf4d)['then'](function(_0x56fc2c){_0x5f3594[_0xfb32('0x28')]({'id':_0x23829e['id'],'token':_0x56fc2c,'statusCall':'','isAlreadyLogged':_0x23829e[_0xfb32('0x1d')]});});}})(_0x69152b,_0x5f3594,_0x52096f);};passport[_0xfb32('0x29')]('ad-login',new LocalStrategy({'usernameField':_0xfb32('0x21'),'passwordField':'password'},function(_0x269be9,_0x541dd6,_0x5a9dc3){return ActiveDirectoryAuthenticate(db[_0xfb32('0x2a')],_0x269be9,_0x541dd6,_0x5a9dc3);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 99b2875..172143d 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 _0xe9cc=['./authActiveDirectory.controller','post','login','Router'];(function(_0x1b354c,_0x21bbf5){var _0x314909=function(_0x48da4a){while(--_0x48da4a){_0x1b354c['push'](_0x1b354c['shift']());}};_0x314909(++_0x21bbf5);}(_0xe9cc,0x1b7));var _0xce9c=function(_0x62d66f,_0x3b3b37){_0x62d66f=_0x62d66f-0x0;var _0x332827=_0xe9cc[_0x62d66f];return _0x332827;};'use strict';var express=require('express');var router=express[_0xce9c('0x0')]();var controller=require(_0xce9c('0x1'));router[_0xce9c('0x2')]('/',controller[_0xce9c('0x3')]);module['exports']=router;
\ No newline at end of file
+var _0xadc0=['post','login','exports','Router'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0xadc0,0x13f));var _0x0adc=function(_0x11d919,_0x494442){_0x11d919=_0x11d919-0x0;var _0x39fbdb=_0xadc0[_0x11d919];return _0x39fbdb;};'use strict';var express=require('express');var router=express[_0x0adc('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0x0adc('0x1')]('/',controller[_0x0adc('0x2')]);module[_0x0adc('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index c2538eb..2a1ceec 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x5b369a,_0x242eb5){var _0x404a31=function(_0xf4bb24){while(--_0xf4bb24){_0x5b369a['push'](_0x5b369a['shift']());}};_0x404a31(++_0x242eb5);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x7a54,0x106));var _0x47a5=function(_0x235b64,_0x32587d){_0x235b64=_0x235b64-0x0;var _0x228ffe=_0x7a54[_0x235b64];return _0x228ffe;};'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 528c2f7..4f56a14 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 _0xb9da=['express','passport','Router','./authGoogle.controller','../../components/auth/service','get','login','isMiddleware','setTokenCookie','exports'];(function(_0x36e796,_0x4beeb7){var _0x2ee739=function(_0x18a18d){while(--_0x18a18d){_0x36e796['push'](_0x36e796['shift']());}};_0x2ee739(++_0x4beeb7);}(_0xb9da,0x1d6));var _0xab9d=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0xb9da[_0x1e48d3];return _0x2852b1;};'use strict';var express=require(_0xab9d('0x0'));var passport=require(_0xab9d('0x1'));var router=express[_0xab9d('0x2')]();var controller=require(_0xab9d('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0xab9d('0x4'));router[_0xab9d('0x5')]('/',controller[_0xab9d('0x6')]);router[_0xab9d('0x5')]('/callback',controller['callback'],authService[_0xab9d('0x7')],userController[_0xab9d('0x6')],authService[_0xab9d('0x8')]);module[_0xab9d('0x9')]=router;
\ No newline at end of file
+var _0x394e=['isMiddleware','login','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback'];(function(_0x37192f,_0x596c39){var _0x508e86=function(_0x2719c0){while(--_0x2719c0){_0x37192f['push'](_0x37192f['shift']());}};_0x508e86(++_0x596c39);}(_0x394e,0x88));var _0xe394=function(_0x5e275e,_0x190a72){_0x5e275e=_0x5e275e-0x0;var _0x969919=_0x394e[_0x5e275e];return _0x969919;};'use strict';var express=require(_0xe394('0x0'));var passport=require(_0xe394('0x1'));var router=express['Router']();var controller=require(_0xe394('0x2'));var userController=require(_0xe394('0x3'));var authService=require(_0xe394('0x4'));router[_0xe394('0x5')]('/',controller['login']);router[_0xe394('0x5')](_0xe394('0x6'),controller[_0xe394('0x7')],authService[_0xe394('0x8')],userController[_0xe394('0x9')],authService[_0xe394('0xa')]);module[_0xe394('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 0238955..75932d2 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 _0xccc6=['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','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','User','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','salt','role','disabled','blocked','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','add','clearBlockUser','minutes','getLicense','catch','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires'];(function(_0x56e2a9,_0x12ca68){var _0x586c9d=function(_0x55473d){while(--_0x55473d){_0x56e2a9['push'](_0x56e2a9['shift']());}};_0x586c9d(++_0x12ca68);}(_0xccc6,0x1c3));var _0x6ccc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xccc6[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x6ccc('0x0'));var passport=require(_0x6ccc('0x1'));var LocalStrategy=require(_0x6ccc('0x2'))[_0x6ccc('0x3')];var jayson=require(_0x6ccc('0x4'));var _=require(_0x6ccc('0x5'));var rs=require(_0x6ccc('0x6'));var moment=require(_0x6ccc('0x7'));var db=require(_0x6ccc('0x8'))['db'];var authService=require(_0x6ccc('0x9'));var utils=require(_0x6ccc('0xa'));var client=jayson[_0x6ccc('0xb')]['http']({'port':0x232b});function localAuthenticate(_0x3b994a,_0x2ef2a7,_0x343962,_0x3320a6){var _0x11b8a6,_0x497b3e;return db[_0x6ccc('0xc')][_0x6ccc('0xd')]({'where':{'id':0x1},'attributes':[_0x6ccc('0xe'),_0x6ccc('0xf')],'raw':!![]})[_0x6ccc('0x10')](function(_0x327fb6){_0x11b8a6=_0x327fb6;return _0x3b994a[_0x6ccc('0xd')]({'attributes':['id','name','password',_0x6ccc('0x11'),_0x6ccc('0x12'),_0x6ccc('0x13'),_0x6ccc('0x14'),_0x6ccc('0x15'),'loginAttempts'],'where':{'name':_0x2ef2a7,'role':{'$or':[_0x6ccc('0x16'),_0x6ccc('0x17'),_0x6ccc('0x18')]}}});})['then'](function(_0x11cc4c){if(!_0x11cc4c||_0x11cc4c&&_0x11cc4c[_0x6ccc('0x19')]!==_0x2ef2a7){throw new Error(_0x6ccc('0x1a'));}else{_0x497b3e=_0x11cc4c;return _0x497b3e;}})['then'](function(){_0x497b3e['authenticate'](_0x343962,function(_0x472421,_0x13a541){var _0x420db4=_0x497b3e[_0x6ccc('0x1b')]+0x1;if(_0x472421){return _0x3320a6(_0x472421);}else if(!_0x13a541){if(_0x497b3e[_0x6ccc('0x13')]){return _0x3320a6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x11b8a6['allowedLoginAttempts']>0x0){if(_0x497b3e[_0x6ccc('0x14')]){if(_0x11b8a6[_0x6ccc('0xf')]>0x0){if(moment(_0x497b3e['blockedAt'])[_0x6ccc('0x1c')](_0x11b8a6[_0x6ccc('0xf')],'minutes')>moment()){return _0x3320a6(null,![],{'message':_0x6ccc('0x1a')});}else{return utils[_0x6ccc('0x1d')](_0x497b3e,_0x420db4,![],null)[_0x6ccc('0x10')](function(){return _0x3320a6(null,![],{'message':_0x6ccc('0x1a')});});}}else{return _0x3320a6(null,![],{'message':_0x6ccc('0x1a')});}}else{if(_0x420db4>=_0x11b8a6[_0x6ccc('0xe')]){return utils[_0x6ccc('0x1d')](_0x497b3e,0x0,!![],moment())['then'](function(){return _0x3320a6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x6ccc('0x1d')](_0x497b3e,_0x420db4,![],null)['then'](function(){return _0x3320a6(null,![],{'message':_0x6ccc('0x1a')});});}}}else{return _0x3320a6(null,![],{'message':_0x6ccc('0x1a')});}}else{if(_0x497b3e[_0x6ccc('0x13')]){return _0x3320a6(null,![],{'message':_0x6ccc('0x1a')});}else if(_0x11b8a6[_0x6ccc('0xe')]>0x0){if(_0x497b3e['blocked']){if(_0x11b8a6['blockDuration']>0x0){if(moment(_0x497b3e[_0x6ccc('0x15')])['add'](_0x11b8a6[_0x6ccc('0xf')],_0x6ccc('0x1e'))>moment()){return _0x3320a6(null,![],{'message':_0x6ccc('0x1a')});}else{return utils[_0x6ccc('0x1d')](_0x497b3e,0x0,![],null)[_0x6ccc('0x10')](function(){return utils[_0x6ccc('0x1f')](_0x497b3e);})[_0x6ccc('0x10')](function(){return _0x3320a6(null,_0x497b3e);});}}else{return _0x3320a6(null,![],{'message':_0x6ccc('0x1a')});}}else{return utils[_0x6ccc('0x1d')](_0x497b3e,0x0,![],null)[_0x6ccc('0x10')](function(){return utils[_0x6ccc('0x1f')](_0x497b3e);})[_0x6ccc('0x10')](function(){return _0x3320a6(null,_0x497b3e);})[_0x6ccc('0x20')](function(_0x11253a){return _0x3320a6(null,![],_0x11253a);});}}else{if(_0x497b3e['blocked']){return _0x3320a6(null,![],{'message':_0x6ccc('0x1a')});}else{return utils[_0x6ccc('0x1f')](_0x497b3e)[_0x6ccc('0x10')](function(){return _0x3320a6(null,_0x497b3e);});}}}});})['catch'](function(_0x2ed3c5){return _0x3320a6(null,![],_0x2ed3c5);});}function sendServiceMail(_0x347f47){return db['MailAccount'][_0x6ccc('0x21')]({'where':{'service':!![]},'attributes':['id',_0x6ccc('0x19'),_0x6ccc('0x22')],'include':[{'model':db[_0x6ccc('0x23')],'as':_0x6ccc('0x24'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0x6ccc('0x10')](function(_0x34eb1d){if(!_0x34eb1d){throw new Error(_0x6ccc('0x25'));}var _0x3eeb34=_0x34eb1d[_0x6ccc('0x26')]();var _0x4c26f6={'account':_0x3eeb34,'message':_[_0x6ccc('0x27')]({'from':util['format'](_0x6ccc('0x28'),_0x34eb1d['name'],_0x34eb1d[_0x6ccc('0x22')]||_0x34eb1d[_0x6ccc('0x24')][_0x6ccc('0x17')])},_0x347f47)};return client['request']('SendMail',_0x4c26f6);})[_0x6ccc('0x10')](function(_0x154acb){if(_0x154acb[_0x6ccc('0x29')]){throw new Error(util[_0x6ccc('0x2a')](_0x6ccc('0x2b'),_0x154acb[_0x6ccc('0x29')][_0x6ccc('0x2c')]||JSON[_0x6ccc('0x2d')](_0x154acb[_0x6ccc('0x29')])));}return!![];});}function handleError(_0x35bb3f,_0x4ed962,_0x232a32){return _0x35bb3f[_0x6ccc('0x2e')](_0x4ed962||0x1f4)[_0x6ccc('0x2f')]({'message':_0x232a32?_0x232a32[_0x6ccc('0x2c')]||_0x232a32:''});}exports[_0x6ccc('0x30')]=function(_0x24df1c,_0xa3ab55,_0x5e900b){passport[_0x6ccc('0x31')](_0x6ccc('0x32'),function(_0x1fccdb,_0x47cc25,_0x3cb8dc){var _0x2634df=_0x1fccdb||_0x3cb8dc;if(_0x2634df){return handleError(_0xa3ab55,0x191,_0x2634df);}if(!_0x47cc25){return handleError(_0xa3ab55,0x194,{'message':_0x6ccc('0x33')});}else{var _0x335797={'payload':{'id':_0x47cc25['id'],'role':_0x47cc25[_0x6ccc('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x6ccc('0x34')](_0x335797)[_0x6ccc('0x10')](function(_0x5bdce1){_0xa3ab55[_0x6ccc('0x35')]({'id':_0x47cc25['id'],'token':_0x5bdce1,'statusCall':'','isAlreadyLogged':_0x47cc25[_0x6ccc('0x36')]});});}})(_0x24df1c,_0xa3ab55,_0x5e900b);};exports[_0x6ccc('0x37')]=function(_0x43ac83,_0x3da01c){if(!_0x43ac83[_0x6ccc('0x38')]['email']){return handleError(_0x3da01c,0x1f4,{'message':_0x6ccc('0x39')});}var _0x5ad9ac=rs[_0x6ccc('0x3a')]();_0x43ac83[_0x6ccc('0x38')][_0x6ccc('0x22')]=_0x43ac83[_0x6ccc('0x38')][_0x6ccc('0x22')][_0x6ccc('0x3b')]()[_0x6ccc('0x3c')]();var _0x283336;return db[_0x6ccc('0xc')][_0x6ccc('0xd')]({'where':{'id':0x1},'attributes':[_0x6ccc('0xe'),_0x6ccc('0xf')],'raw':!![]})[_0x6ccc('0x10')](function(_0x439a98){_0x283336=_0x439a98;return db['User'][_0x6ccc('0x21')]({'where':{'email':_0x43ac83[_0x6ccc('0x38')][_0x6ccc('0x22')]}});})[_0x6ccc('0x10')](function(_0x510a65){if(!_0x510a65){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x510a65[_0x6ccc('0x13')]){throw new Error(_0x6ccc('0x3d'));}if(_0x510a65[_0x6ccc('0x14')]){if(moment(_0x510a65[_0x6ccc('0x15')])[_0x6ccc('0x1c')](_0x283336[_0x6ccc('0xf')],_0x6ccc('0x1e'))>moment()){throw new Error(_0x6ccc('0x3e'));}else{_0x510a65[_0x6ccc('0x14')]=![];_0x510a65[_0x6ccc('0x15')]=null;}}_0x510a65[_0x6ccc('0x3f')]=_0x5ad9ac;_0x510a65[_0x6ccc('0x40')]=Date['now']()+0x36ee80;return _0x510a65[_0x6ccc('0x41')]();})[_0x6ccc('0x10')](function(){return sendServiceMail({'to':_0x43ac83['body'][_0x6ccc('0x22')],'subject':_0x6ccc('0x42'),'text':_0x6ccc('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x6ccc('0x44')+_0x43ac83[_0x6ccc('0x45')][_0x6ccc('0x46')]+_0x6ccc('0x47')+_0x5ad9ac+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x6ccc('0x10')](function(){_0x3da01c[_0x6ccc('0x2e')](0xc8)[_0x6ccc('0x2f')]({'message':_0x6ccc('0x48')});})['catch'](function(_0x36ac23){return handleError(_0x3da01c,0x1f4,_0x36ac23);});};exports[_0x6ccc('0x49')]=function(_0x37e44b,_0x5d27dc){return db[_0x6ccc('0x4a')][_0x6ccc('0x21')]({'where':{'resetPasswordToken':_0x37e44b['params'][_0x6ccc('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x6ccc('0x4c')]()}}})[_0x6ccc('0x10')](function(_0x1de321){if(!_0x1de321){throw new Error(_0x6ccc('0x4d'));}return db[_0x6ccc('0xc')][_0x6ccc('0xd')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x6ccc('0x10')](function(_0x22659f){if(_0x22659f[_0x6ccc('0x4e')])authService[_0x6ccc('0x4f')](_0x37e44b[_0x6ccc('0x38')][_0x6ccc('0x50')]);if(!_0x22659f[_0x6ccc('0x51')]||!_0x1de321[_0x6ccc('0x52')])return _0x1de321;authService['validatePasswordHistory'](_0x37e44b[_0x6ccc('0x38')][_0x6ccc('0x50')],_0x1de321[_0x6ccc('0x52')],_0x22659f[_0x6ccc('0x53')]);return _0x1de321;})[_0x6ccc('0x10')](function(){_0x1de321[_0x6ccc('0x50')]=_0x37e44b[_0x6ccc('0x38')]['password'];_0x1de321['resetPasswordToken']=null;_0x1de321[_0x6ccc('0x40')]=null;return _0x1de321[_0x6ccc('0x41')]();});})['then'](function(){_0x5d27dc[_0x6ccc('0x2e')](0xc8)[_0x6ccc('0x2f')]({'message':_0x6ccc('0x54')});})[_0x6ccc('0x20')](function(_0x497aaa){return handleError(_0x5d27dc,0x1f4,_0x497aaa);});};passport[_0x6ccc('0x55')](_0x6ccc('0x32'),new LocalStrategy({'usernameField':_0x6ccc('0x19'),'passwordField':_0x6ccc('0x50')},function(_0x138269,_0x599008,_0x16c2d8){return localAuthenticate(db[_0x6ccc('0x4a')],_0x138269,_0x599008,_0x16c2d8);}));
\ No newline at end of file
+var _0x7a1c=['MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','Smtp','user','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','signToken','json','Email\x20parameter\x20is\x20missing','body','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','resetPasswordExpires','Password\x20reset!','use','local-login','util','passport','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','findOne','name','password','salt','role','disabled','blocked','blockedAt','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email'];(function(_0x2b4378,_0xe0fba4){var _0x443c5f=function(_0x1fa8d7){while(--_0x1fa8d7){_0x2b4378['push'](_0x2b4378['shift']());}};_0x443c5f(++_0xe0fba4);}(_0x7a1c,0x1f2));var _0xc7a1=function(_0x3c8daa,_0x5ae824){_0x3c8daa=_0x3c8daa-0x0;var _0x5585a8=_0x7a1c[_0x3c8daa];return _0x5585a8;};'use strict';var util=require(_0xc7a1('0x0'));var passport=require(_0xc7a1('0x1'));var LocalStrategy=require('passport-local')[_0xc7a1('0x2')];var jayson=require('jayson/promise');var _=require(_0xc7a1('0x3'));var rs=require(_0xc7a1('0x4'));var moment=require(_0xc7a1('0x5'));var db=require(_0xc7a1('0x6'))['db'];var authService=require(_0xc7a1('0x7'));var utils=require(_0xc7a1('0x8'));var client=jayson['client'][_0xc7a1('0x9')]({'port':0x232b});function localAuthenticate(_0xb3213c,_0x1c926b,_0x351849,_0x76b3f1){var _0x44245c,_0x171d2b;return db[_0xc7a1('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xc7a1('0xb'),_0xc7a1('0xc')],'raw':!![]})['then'](function(_0xcb46b4){_0x44245c=_0xcb46b4;return _0xb3213c[_0xc7a1('0xd')]({'attributes':['id',_0xc7a1('0xe'),_0xc7a1('0xf'),_0xc7a1('0x10'),_0xc7a1('0x11'),_0xc7a1('0x12'),_0xc7a1('0x13'),_0xc7a1('0x14'),'loginAttempts'],'where':{'name':_0x1c926b,'role':{'$or':['admin','user',_0xc7a1('0x15')]}}});})[_0xc7a1('0x16')](function(_0x403c72){if(!_0x403c72||_0x403c72&&_0x403c72[_0xc7a1('0xe')]!==_0x1c926b){throw new Error(_0xc7a1('0x17'));}else{_0x171d2b=_0x403c72;return _0x171d2b;}})[_0xc7a1('0x16')](function(){_0x171d2b[_0xc7a1('0x18')](_0x351849,function(_0x40601e,_0x46e9f3){var _0xe2ead7=_0x171d2b[_0xc7a1('0x19')]+0x1;if(_0x40601e){return _0x76b3f1(_0x40601e);}else if(!_0x46e9f3){if(_0x171d2b[_0xc7a1('0x12')]){return _0x76b3f1(null,![],{'message':_0xc7a1('0x17')});}else if(_0x44245c[_0xc7a1('0xb')]>0x0){if(_0x171d2b['blocked']){if(_0x44245c[_0xc7a1('0xc')]>0x0){if(moment(_0x171d2b[_0xc7a1('0x14')])[_0xc7a1('0x1a')](_0x44245c[_0xc7a1('0xc')],_0xc7a1('0x1b'))>moment()){return _0x76b3f1(null,![],{'message':_0xc7a1('0x17')});}else{return utils[_0xc7a1('0x1c')](_0x171d2b,_0xe2ead7,![],null)['then'](function(){return _0x76b3f1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x76b3f1(null,![],{'message':_0xc7a1('0x17')});}}else{if(_0xe2ead7>=_0x44245c['allowedLoginAttempts']){return utils['clearBlockUser'](_0x171d2b,0x0,!![],moment())[_0xc7a1('0x16')](function(){return _0x76b3f1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xc7a1('0x1c')](_0x171d2b,_0xe2ead7,![],null)[_0xc7a1('0x16')](function(){return _0x76b3f1(null,![],{'message':_0xc7a1('0x17')});});}}}else{return _0x76b3f1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x171d2b['disabled']){return _0x76b3f1(null,![],{'message':_0xc7a1('0x17')});}else if(_0x44245c['allowedLoginAttempts']>0x0){if(_0x171d2b['blocked']){if(_0x44245c[_0xc7a1('0xc')]>0x0){if(moment(_0x171d2b[_0xc7a1('0x14')])[_0xc7a1('0x1a')](_0x44245c[_0xc7a1('0xc')],'minutes')>moment()){return _0x76b3f1(null,![],{'message':_0xc7a1('0x17')});}else{return utils[_0xc7a1('0x1c')](_0x171d2b,0x0,![],null)[_0xc7a1('0x16')](function(){return utils[_0xc7a1('0x1d')](_0x171d2b);})[_0xc7a1('0x16')](function(){return _0x76b3f1(null,_0x171d2b);});}}else{return _0x76b3f1(null,![],{'message':_0xc7a1('0x17')});}}else{return utils['clearBlockUser'](_0x171d2b,0x0,![],null)[_0xc7a1('0x16')](function(){return utils[_0xc7a1('0x1d')](_0x171d2b);})[_0xc7a1('0x16')](function(){return _0x76b3f1(null,_0x171d2b);})[_0xc7a1('0x1e')](function(_0x39fc10){return _0x76b3f1(null,![],_0x39fc10);});}}else{if(_0x171d2b[_0xc7a1('0x13')]){return _0x76b3f1(null,![],{'message':_0xc7a1('0x17')});}else{return utils['getLicense'](_0x171d2b)[_0xc7a1('0x16')](function(){return _0x76b3f1(null,_0x171d2b);});}}}});})['catch'](function(_0x2af105){return _0x76b3f1(null,![],_0x2af105);});}function sendServiceMail(_0x2ad708){return db[_0xc7a1('0x1f')][_0xc7a1('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc7a1('0xe'),_0xc7a1('0x21')],'include':[{'model':db[_0xc7a1('0x22')],'as':'Smtp','include':[{'model':db[_0xc7a1('0x23')],'as':_0xc7a1('0x23')}]}]})['then'](function(_0x4d0c5d){if(!_0x4d0c5d){throw new Error(_0xc7a1('0x24'));}var _0x2ce2af=_0x4d0c5d[_0xc7a1('0x25')]();var _0x13b31a={'account':_0x2ce2af,'message':_[_0xc7a1('0x26')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x4d0c5d[_0xc7a1('0xe')],_0x4d0c5d['email']||_0x4d0c5d[_0xc7a1('0x27')][_0xc7a1('0x28')])},_0x2ad708)};return client[_0xc7a1('0x29')](_0xc7a1('0x2a'),_0x13b31a);})[_0xc7a1('0x16')](function(_0x2e848){if(_0x2e848[_0xc7a1('0x2b')]){throw new Error(util[_0xc7a1('0x2c')](_0xc7a1('0x2d'),_0x2e848[_0xc7a1('0x2b')][_0xc7a1('0x2e')]||JSON['stringify'](_0x2e848['error'])));}return!![];});}function handleError(_0x296647,_0x5d79cf,_0x140b8b){return _0x296647['status'](_0x5d79cf||0x1f4)[_0xc7a1('0x2f')]({'message':_0x140b8b?_0x140b8b[_0xc7a1('0x2e')]||_0x140b8b:''});}exports['login']=function(_0x5011da,_0x4a5bfc,_0x286add){passport[_0xc7a1('0x18')]('local-login',function(_0x3f3420,_0x26defd,_0x1c5c99){var _0x456f88=_0x3f3420||_0x1c5c99;if(_0x456f88){return handleError(_0x4a5bfc,0x191,_0x456f88);}if(!_0x26defd){return handleError(_0x4a5bfc,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x56399a={'payload':{'id':_0x26defd['id'],'role':_0x26defd[_0xc7a1('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xc7a1('0x30')](_0x56399a)[_0xc7a1('0x16')](function(_0xda0843){_0x4a5bfc[_0xc7a1('0x31')]({'id':_0x26defd['id'],'token':_0xda0843,'statusCall':'','isAlreadyLogged':_0x26defd['online']});});}})(_0x5011da,_0x4a5bfc,_0x286add);};exports['forgot']=function(_0x17a149,_0x304f89){if(!_0x17a149['body']['email']){return handleError(_0x304f89,0x1f4,{'message':_0xc7a1('0x32')});}var _0x31fa89=rs['generate']();_0x17a149[_0xc7a1('0x33')][_0xc7a1('0x21')]=_0x17a149['body'][_0xc7a1('0x21')]['trim']()['toLowerCase']();var _0x578793;return db[_0xc7a1('0xa')][_0xc7a1('0xd')]({'where':{'id':0x1},'attributes':[_0xc7a1('0xb'),_0xc7a1('0xc')],'raw':!![]})['then'](function(_0xdf0e16){_0x578793=_0xdf0e16;return db[_0xc7a1('0x34')][_0xc7a1('0x20')]({'where':{'email':_0x17a149['body'][_0xc7a1('0x21')]}});})['then'](function(_0x303364){if(!_0x303364){throw new Error(_0xc7a1('0x35'));}if(_0x303364[_0xc7a1('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x303364['blocked']){if(moment(_0x303364[_0xc7a1('0x14')])[_0xc7a1('0x1a')](_0x578793[_0xc7a1('0xc')],_0xc7a1('0x1b'))>moment()){throw new Error(_0xc7a1('0x36'));}else{_0x303364[_0xc7a1('0x13')]=![];_0x303364[_0xc7a1('0x14')]=null;}}_0x303364[_0xc7a1('0x37')]=_0x31fa89;_0x303364['resetPasswordExpires']=Date[_0xc7a1('0x38')]()+0x36ee80;return _0x303364[_0xc7a1('0x39')]();})[_0xc7a1('0x16')](function(){return sendServiceMail({'to':_0x17a149[_0xc7a1('0x33')]['email'],'subject':_0xc7a1('0x3a'),'text':_0xc7a1('0x3b')+_0xc7a1('0x3c')+_0xc7a1('0x3d')+_0x17a149['headers'][_0xc7a1('0x3e')]+_0xc7a1('0x3f')+_0x31fa89+'\x0a\x0a'+_0xc7a1('0x40')});})['then'](function(){_0x304f89[_0xc7a1('0x41')](0xc8)[_0xc7a1('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0xc7a1('0x1e')](function(_0x15a0e9){return handleError(_0x304f89,0x1f4,_0x15a0e9);});};exports['reset']=function(_0x261e77,_0x680c67){return db['User'][_0xc7a1('0x20')]({'where':{'resetPasswordToken':_0x261e77[_0xc7a1('0x42')][_0xc7a1('0x43')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xc7a1('0x16')](function(_0xb1fee1){if(!_0xb1fee1){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xc7a1('0xd')]({'attributes':['id',_0xc7a1('0x44'),_0xc7a1('0x45'),_0xc7a1('0x46')]})[_0xc7a1('0x16')](function(_0x54a3ec){if(_0x54a3ec['securePassword'])authService['validatePasswordPattern'](_0x261e77[_0xc7a1('0x33')][_0xc7a1('0xf')]);if(!_0x54a3ec[_0xc7a1('0x45')]||!_0xb1fee1[_0xc7a1('0x47')])return _0xb1fee1;authService['validatePasswordHistory'](_0x261e77['body'][_0xc7a1('0xf')],_0xb1fee1['previousPasswords'],_0x54a3ec['passwordHistoryLimit']);return _0xb1fee1;})[_0xc7a1('0x16')](function(){_0xb1fee1[_0xc7a1('0xf')]=_0x261e77[_0xc7a1('0x33')][_0xc7a1('0xf')];_0xb1fee1[_0xc7a1('0x37')]=null;_0xb1fee1[_0xc7a1('0x48')]=null;return _0xb1fee1[_0xc7a1('0x39')]();});})['then'](function(){_0x680c67[_0xc7a1('0x41')](0xc8)[_0xc7a1('0x2f')]({'message':_0xc7a1('0x49')});})[_0xc7a1('0x1e')](function(_0x32eb29){return handleError(_0x680c67,0x1f4,_0x32eb29);});};passport[_0xc7a1('0x4a')](_0xc7a1('0x4b'),new LocalStrategy({'usernameField':_0xc7a1('0xe'),'passwordField':_0xc7a1('0xf')},function(_0x55cc79,_0x1a7152,_0x1b8fa0){return localAuthenticate(db[_0xc7a1('0x34')],_0x55cc79,_0x1a7152,_0x1b8fa0);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 5bd37c5..2bae492 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 _0xf082=['exports','express','Router','forgot'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf082,0x191));var _0x2f08=function(_0x1e4d2c,_0x3408e4){_0x1e4d2c=_0x1e4d2c-0x0;var _0x4a4b32=_0xf082[_0x1e4d2c];return _0x4a4b32;};'use strict';var express=require(_0x2f08('0x0'));var router=express[_0x2f08('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router['post']('/forgot',controller[_0x2f08('0x2')]);router['post']('/reset/:token',controller['reset']);module[_0x2f08('0x3')]=router;
\ No newline at end of file
+var _0x8ad7=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x4688aa,_0x20b48e){var _0x57f8ff=function(_0x9ffa16){while(--_0x9ffa16){_0x4688aa['push'](_0x4688aa['shift']());}};_0x57f8ff(++_0x20b48e);}(_0x8ad7,0x1df));var _0x78ad=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x8ad7[_0x29d94e];return _0x106237;};'use strict';var express=require(_0x78ad('0x0'));var router=express[_0x78ad('0x1')]();var controller=require(_0x78ad('0x2'));router[_0x78ad('0x3')]('/',controller['login']);router[_0x78ad('0x3')]('/forgot',controller['forgot']);router[_0x78ad('0x3')](_0x78ad('0x4'),controller[_0x78ad('0x5')]);module[_0x78ad('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 0b0d505..5b5409d 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 _0x371b=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x554809,_0x34aa71){var _0x50e32f=function(_0x31eb05){while(--_0x31eb05){_0x554809['push'](_0x554809['shift']());}};_0x50e32f(++_0x34aa71);}(_0x371b,0x1d6));var _0xb371=function(_0x1f2dda,_0x539c5f){_0x1f2dda=_0x1f2dda-0x0;var _0x29b49e=_0x371b[_0x1f2dda];return _0x29b49e;};'use strict';var Sequelize=require(_0xb371('0x0'));module[_0xb371('0x1')]={'name':{'type':Sequelize[_0xb371('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb371('0x2')]},'description':{'type':Sequelize[_0xb371('0x2')]},'status':{'type':Sequelize[_0xb371('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb371('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x91a3=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x268744,_0x470583){var _0x498ec8=function(_0x515774){while(--_0x515774){_0x268744['push'](_0x268744['shift']());}};_0x498ec8(++_0x470583);}(_0x91a3,0xf9));var _0x391a=function(_0x4f3be4,_0x1a1270){_0x4f3be4=_0x4f3be4-0x0;var _0x1d16c9=_0x91a3[_0x4f3be4];return _0x1d16c9;};'use strict';var Sequelize=require(_0x391a('0x0'));module[_0x391a('0x1')]={'name':{'type':Sequelize[_0x391a('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x391a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x391a('0x4')],'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 a07487e..558b13b 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 _0x42da=['findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','options','include','findAll','rows','params','keys','find','create','body','catch','addConditions','Condition','ids','omit','getConditions','sort','hasOwnProperty','addActions','Action','getActions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42da,0x1e7));var _0xa42d=function(_0x1d76af,_0x35fbe7){_0x1d76af=_0x1d76af-0x0;var _0x17c203=_0x42da[_0x1d76af];return _0x17c203;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa42d('0x0'));var zipdir=require(_0xa42d('0x1'));var jsonpatch=require(_0xa42d('0x2'));var rp=require(_0xa42d('0x3'));var moment=require(_0xa42d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa42d('0x5'));var util=require(_0xa42d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa42d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa42d('0x8'));var _=require(_0xa42d('0x9'));var squel=require(_0xa42d('0xa'));var crypto=require(_0xa42d('0xb'));var jsforce=require(_0xa42d('0xc'));var deskjs=require(_0xa42d('0xd'));var toCsv=require(_0xa42d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa42d('0xe'));var authService=require(_0xa42d('0xf'));var qs=require(_0xa42d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa42d('0x11'));var logger=require(_0xa42d('0x12'))(_0xa42d('0x13'));var utils=require(_0xa42d('0x14'));var config=require(_0xa42d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa42d('0x16'))['db'];function respondWithStatusCode(_0x5ee7de,_0x3683a2){_0x3683a2=_0x3683a2||0xcc;return function(_0x495965){if(_0x495965){return _0x5ee7de[_0xa42d('0x17')](_0x3683a2);}return _0x5ee7de[_0xa42d('0x18')](_0x3683a2)[_0xa42d('0x19')]();};}function respondWithResult(_0x3f1f9f,_0x1716b9){_0x1716b9=_0x1716b9||0xc8;return function(_0x447e5d){if(_0x447e5d){return _0x3f1f9f[_0xa42d('0x18')](_0x1716b9)[_0xa42d('0x1a')](_0x447e5d);}};}function respondWithFilteredResult(_0x2db61b,_0x1f16ba){return function(_0x579837){if(_0x579837){var _0x2e2213=typeof _0x1f16ba[_0xa42d('0x1b')]===_0xa42d('0x1c')&&typeof _0x1f16ba[_0xa42d('0x1d')]==='undefined';var _0x379816=_0x579837[_0xa42d('0x1e')];var _0x24e149=_0x2e2213?0x0:_0x1f16ba[_0xa42d('0x1b')];var _0x8b021c=_0x2e2213?_0x579837[_0xa42d('0x1e')]:_0x1f16ba[_0xa42d('0x1b')]+_0x1f16ba[_0xa42d('0x1d')];var _0x2e4203;if(_0x8b021c>=_0x379816){_0x8b021c=_0x379816;_0x2e4203=0xc8;}else{_0x2e4203=0xce;}_0x2db61b[_0xa42d('0x18')](_0x2e4203);return _0x2db61b['set'](_0xa42d('0x1f'),_0x24e149+'-'+_0x8b021c+'/'+_0x379816)['json'](_0x579837);}return null;};}function patchUpdates(_0x4f64ad){return function(_0x402a59){try{jsonpatch[_0xa42d('0x20')](_0x402a59,_0x4f64ad,!![]);}catch(_0x46b2b2){return BPromise['reject'](_0x46b2b2);}return _0x402a59[_0xa42d('0x21')]();};}function saveUpdates(_0x10a94c,_0x25e473){return function(_0x356da0){if(_0x356da0){return _0x356da0[_0xa42d('0x22')](_0x10a94c)[_0xa42d('0x23')](function(_0x23d48c){return _0x23d48c;});}return null;};}function removeEntity(_0x512d75,_0x511e2b){return function(_0x2d1969){if(_0x2d1969){return _0x2d1969[_0xa42d('0x24')]()[_0xa42d('0x23')](function(){_0x512d75['status'](0xcc)[_0xa42d('0x19')]();});}};}function handleEntityNotFound(_0x549f3c,_0x379f23){return function(_0x263778){if(!_0x263778){_0x549f3c[_0xa42d('0x17')](0x194);}return _0x263778;};}function handleError(_0x5ebc38,_0x5e4995){_0x5e4995=_0x5e4995||0x1f4;return function(_0x5b2c1e){logger[_0xa42d('0x25')](_0x5b2c1e[_0xa42d('0x26')]);if(_0x5b2c1e[_0xa42d('0x27')]){delete _0x5b2c1e[_0xa42d('0x27')];}_0x5ebc38[_0xa42d('0x18')](_0x5e4995)[_0xa42d('0x28')](_0x5b2c1e);};}exports[_0xa42d('0x29')]=function(_0x513fd4,_0x16a1ef){var _0x4d6bca={},_0x45ab0b={},_0x54ae0b={'count':0x0,'rows':[]};var _0x16aa8e=_['map'](db[_0xa42d('0x2a')][_0xa42d('0x2b')],function(_0x5ba461){return{'name':_0x5ba461[_0xa42d('0x2c')],'type':_0x5ba461[_0xa42d('0x2d')]['key']};});_0x45ab0b[_0xa42d('0x2e')]=_[_0xa42d('0x2f')](_0x16aa8e,_0xa42d('0x27'));_0x45ab0b[_0xa42d('0x30')]=_['keys'](_0x513fd4[_0xa42d('0x30')]);_0x45ab0b[_0xa42d('0x31')]=_[_0xa42d('0x32')](_0x45ab0b['model'],_0x45ab0b[_0xa42d('0x30')]);_0x4d6bca[_0xa42d('0x33')]=_['intersection'](_0x45ab0b[_0xa42d('0x2e')],qs[_0xa42d('0x34')](_0x513fd4[_0xa42d('0x30')]['fields']));_0x4d6bca[_0xa42d('0x33')]=_0x4d6bca[_0xa42d('0x33')][_0xa42d('0x35')]?_0x4d6bca[_0xa42d('0x33')]:_0x45ab0b[_0xa42d('0x2e')];if(!_0x513fd4['query']['hasOwnProperty'](_0xa42d('0x36'))){_0x4d6bca[_0xa42d('0x1d')]=qs[_0xa42d('0x1d')](_0x513fd4[_0xa42d('0x30')]['limit']);_0x4d6bca['offset']=qs[_0xa42d('0x1b')](_0x513fd4[_0xa42d('0x30')][_0xa42d('0x1b')]);}_0x4d6bca[_0xa42d('0x37')]=qs['sort'](_0x513fd4[_0xa42d('0x30')]['sort']);_0x4d6bca[_0xa42d('0x38')]=qs[_0xa42d('0x31')](_[_0xa42d('0x39')](_0x513fd4['query'],_0x45ab0b[_0xa42d('0x31')]),_0x16aa8e);if(_0x513fd4[_0xa42d('0x30')][_0xa42d('0x3a')]){_0x4d6bca['where']=_[_0xa42d('0x3b')](_0x4d6bca[_0xa42d('0x38')],{'$or':_[_0xa42d('0x2f')](_0x16aa8e,function(_0x83fcf9){if(_0x83fcf9['type']!=='VIRTUAL'){var _0x7d8f2f={};_0x7d8f2f[_0x83fcf9['name']]={'$like':'%'+_0x513fd4[_0xa42d('0x30')][_0xa42d('0x3a')]+'%'};return _0x7d8f2f;}})});}_0x4d6bca=_['merge']({},_0x4d6bca,_0x513fd4[_0xa42d('0x3c')]);var _0x275663={'where':_0x4d6bca['where']};return db[_0xa42d('0x2a')][_0xa42d('0x1e')](_0x275663)[_0xa42d('0x23')](function(_0x14580b){_0x54ae0b['count']=_0x14580b;if(_0x513fd4[_0xa42d('0x30')]['includeAll']){_0x4d6bca[_0xa42d('0x3d')]=[{'all':!![]}];}return db['Automation'][_0xa42d('0x3e')](_0x4d6bca);})['then'](function(_0x49bc39){_0x54ae0b[_0xa42d('0x3f')]=_0x49bc39;return _0x54ae0b;})[_0xa42d('0x23')](respondWithFilteredResult(_0x16a1ef,_0x4d6bca))['catch'](handleError(_0x16a1ef,null));};exports['show']=function(_0x1e6bce,_0x2f1d5a){var _0x1cd1c7={'raw':![],'where':{'id':_0x1e6bce[_0xa42d('0x40')]['id']}},_0x5adbb5={};_0x5adbb5[_0xa42d('0x2e')]=_['keys'](db[_0xa42d('0x2a')]['rawAttributes']);_0x5adbb5[_0xa42d('0x30')]=_[_0xa42d('0x41')](_0x1e6bce[_0xa42d('0x30')]);_0x5adbb5[_0xa42d('0x31')]=_[_0xa42d('0x32')](_0x5adbb5['model'],_0x5adbb5['query']);_0x1cd1c7[_0xa42d('0x33')]=_[_0xa42d('0x32')](_0x5adbb5['model'],qs[_0xa42d('0x34')](_0x1e6bce[_0xa42d('0x30')][_0xa42d('0x34')]));_0x1cd1c7[_0xa42d('0x33')]=_0x1cd1c7['attributes']['length']?_0x1cd1c7['attributes']:_0x5adbb5['model'];if(_0x1e6bce['query']['includeAll']){_0x1cd1c7[_0xa42d('0x3d')]=[{'all':!![]}];}_0x1cd1c7=_[_0xa42d('0x3b')]({},_0x1cd1c7,_0x1e6bce[_0xa42d('0x3c')]);return db[_0xa42d('0x2a')][_0xa42d('0x42')](_0x1cd1c7)['then'](handleEntityNotFound(_0x2f1d5a,null))[_0xa42d('0x23')](respondWithResult(_0x2f1d5a,null))['catch'](handleError(_0x2f1d5a,null));};exports[_0xa42d('0x43')]=function(_0x36b901,_0x1f520d){return db[_0xa42d('0x2a')][_0xa42d('0x43')](_0x36b901[_0xa42d('0x44')],{})[_0xa42d('0x23')](respondWithResult(_0x1f520d,0xc9))[_0xa42d('0x45')](handleError(_0x1f520d,null));};exports[_0xa42d('0x22')]=function(_0x44e417,_0x39dc17){if(_0x44e417[_0xa42d('0x44')]['id']){delete _0x44e417[_0xa42d('0x44')]['id'];}return db[_0xa42d('0x2a')][_0xa42d('0x42')]({'where':{'id':_0x44e417['params']['id']}})[_0xa42d('0x23')](handleEntityNotFound(_0x39dc17,null))[_0xa42d('0x23')](saveUpdates(_0x44e417[_0xa42d('0x44')],null))[_0xa42d('0x23')](respondWithResult(_0x39dc17,null))['catch'](handleError(_0x39dc17,null));};exports[_0xa42d('0x24')]=function(_0x42d0ec,_0x4bdd23){return db['Automation'][_0xa42d('0x42')]({'where':{'id':_0x42d0ec[_0xa42d('0x40')]['id']}})[_0xa42d('0x23')](handleEntityNotFound(_0x4bdd23,null))['then'](removeEntity(_0x4bdd23,null))[_0xa42d('0x45')](handleError(_0x4bdd23,null));};exports[_0xa42d('0x46')]=function(_0x1881aa,_0xd069c2,_0x3775c7){return db[_0xa42d('0x47')][_0xa42d('0x42')]({'where':{'id':_0x1881aa['params']['id']}})[_0xa42d('0x23')](handleEntityNotFound(_0xd069c2,null))[_0xa42d('0x23')](function(_0x150478){if(_0x150478){return _0x150478['addConditions'](_0x1881aa[_0xa42d('0x44')][_0xa42d('0x48')],_[_0xa42d('0x49')](_0x1881aa[_0xa42d('0x44')],[_0xa42d('0x48'),'id'])||{});}})[_0xa42d('0x23')](respondWithResult(_0xd069c2,null))[_0xa42d('0x45')](handleError(_0xd069c2,null));};exports[_0xa42d('0x4a')]=function(_0x1d2cb8,_0x625588,_0x470eb9){var _0x1ca1a9={};var _0x31be36={};var _0x2bf330;var _0xf1b8d6;return db['Automation']['findOne']({'where':{'id':_0x1d2cb8[_0xa42d('0x40')]['id']}})[_0xa42d('0x23')](handleEntityNotFound(_0x625588,null))[_0xa42d('0x23')](function(_0x30913d){if(_0x30913d){_0x2bf330=_0x30913d;_0x31be36['model']=_[_0xa42d('0x41')](db[_0xa42d('0x47')][_0xa42d('0x2b')]);_0x31be36[_0xa42d('0x30')]=_['keys'](_0x1d2cb8[_0xa42d('0x30')]);_0x31be36['filters']=_[_0xa42d('0x32')](_0x31be36['model'],_0x31be36[_0xa42d('0x30')]);_0x1ca1a9[_0xa42d('0x33')]=_['intersection'](_0x31be36[_0xa42d('0x2e')],qs[_0xa42d('0x34')](_0x1d2cb8['query'][_0xa42d('0x34')]));_0x1ca1a9[_0xa42d('0x33')]=_0x1ca1a9[_0xa42d('0x33')][_0xa42d('0x35')]?_0x1ca1a9['attributes']:_0x31be36[_0xa42d('0x2e')];_0x1ca1a9[_0xa42d('0x37')]=qs[_0xa42d('0x4b')](_0x1d2cb8[_0xa42d('0x30')][_0xa42d('0x4b')]);_0x1ca1a9[_0xa42d('0x38')]=qs[_0xa42d('0x31')](_[_0xa42d('0x39')](_0x1d2cb8['query'],_0x31be36[_0xa42d('0x31')]));if(_0x1d2cb8[_0xa42d('0x30')][_0xa42d('0x3a')]){_0x1ca1a9[_0xa42d('0x38')]=_[_0xa42d('0x3b')](_0x1ca1a9[_0xa42d('0x38')],{'$or':_[_0xa42d('0x2f')](_0x1ca1a9['attributes'],function(_0x5610cd){var _0x508b60={};_0x508b60[_0x5610cd]={'$like':'%'+_0x1d2cb8[_0xa42d('0x30')][_0xa42d('0x3a')]+'%'};return _0x508b60;})});}_0x1ca1a9=_[_0xa42d('0x3b')]({},_0x1ca1a9,_0x1d2cb8[_0xa42d('0x3c')]);return _0x2bf330[_0xa42d('0x4a')](_0x1ca1a9);}})['then'](function(_0x48d78f){if(_0x48d78f){_0xf1b8d6=_0x48d78f['length'];if(!_0x1d2cb8[_0xa42d('0x30')][_0xa42d('0x4c')](_0xa42d('0x36'))){_0x1ca1a9[_0xa42d('0x1d')]=qs['limit'](_0x1d2cb8[_0xa42d('0x30')][_0xa42d('0x1d')]);_0x1ca1a9[_0xa42d('0x1b')]=qs[_0xa42d('0x1b')](_0x1d2cb8[_0xa42d('0x30')][_0xa42d('0x1b')]);}return _0x2bf330['getConditions'](_0x1ca1a9);}})[_0xa42d('0x23')](function(_0x4e2d7e){if(_0x4e2d7e){return _0x4e2d7e?{'count':_0xf1b8d6,'rows':_0x4e2d7e}:null;}})['then'](respondWithResult(_0x625588,null))[_0xa42d('0x45')](handleError(_0x625588,null));};exports[_0xa42d('0x4d')]=function(_0x4d79f6,_0x27d87a,_0x490ee1){return db[_0xa42d('0x4e')][_0xa42d('0x42')]({'where':{'id':_0x4d79f6['params']['id']}})[_0xa42d('0x23')](handleEntityNotFound(_0x27d87a,null))[_0xa42d('0x23')](function(_0x4b4b16){if(_0x4b4b16){return _0x4b4b16[_0xa42d('0x4d')](_0x4d79f6['body'][_0xa42d('0x48')],_[_0xa42d('0x49')](_0x4d79f6[_0xa42d('0x44')],[_0xa42d('0x48'),'id'])||{});}})['then'](respondWithResult(_0x27d87a,null))[_0xa42d('0x45')](handleError(_0x27d87a,null));};exports[_0xa42d('0x4f')]=function(_0x3bca18,_0x2ebe0d,_0x19a70f){var _0x5b0a69={};var _0x380748={};var _0x4b41c1;var _0xbe65c5;return db['Automation'][_0xa42d('0x50')]({'where':{'id':_0x3bca18[_0xa42d('0x40')]['id']}})[_0xa42d('0x23')](handleEntityNotFound(_0x2ebe0d,null))['then'](function(_0x2b833f){if(_0x2b833f){_0x4b41c1=_0x2b833f;_0x380748['model']=_[_0xa42d('0x41')](db['Action'][_0xa42d('0x2b')]);_0x380748[_0xa42d('0x30')]=_[_0xa42d('0x41')](_0x3bca18[_0xa42d('0x30')]);_0x380748['filters']=_['intersection'](_0x380748[_0xa42d('0x2e')],_0x380748[_0xa42d('0x30')]);_0x5b0a69[_0xa42d('0x33')]=_['intersection'](_0x380748[_0xa42d('0x2e')],qs['fields'](_0x3bca18[_0xa42d('0x30')][_0xa42d('0x34')]));_0x5b0a69['attributes']=_0x5b0a69['attributes'][_0xa42d('0x35')]?_0x5b0a69[_0xa42d('0x33')]:_0x380748[_0xa42d('0x2e')];_0x5b0a69[_0xa42d('0x37')]=qs[_0xa42d('0x4b')](_0x3bca18[_0xa42d('0x30')][_0xa42d('0x4b')]);_0x5b0a69[_0xa42d('0x38')]=qs[_0xa42d('0x31')](_['pick'](_0x3bca18[_0xa42d('0x30')],_0x380748[_0xa42d('0x31')]));if(_0x3bca18[_0xa42d('0x30')][_0xa42d('0x3a')]){_0x5b0a69[_0xa42d('0x38')]=_[_0xa42d('0x3b')](_0x5b0a69[_0xa42d('0x38')],{'$or':_['map'](_0x5b0a69[_0xa42d('0x33')],function(_0x1bcf12){var _0x1b12ed={};_0x1b12ed[_0x1bcf12]={'$like':'%'+_0x3bca18['query']['filter']+'%'};return _0x1b12ed;})});}_0x5b0a69=_[_0xa42d('0x3b')]({},_0x5b0a69,_0x3bca18[_0xa42d('0x3c')]);return _0x4b41c1['getActions'](_0x5b0a69);}})[_0xa42d('0x23')](function(_0x1e23e8){if(_0x1e23e8){_0xbe65c5=_0x1e23e8['length'];if(!_0x3bca18[_0xa42d('0x30')]['hasOwnProperty'](_0xa42d('0x36'))){_0x5b0a69[_0xa42d('0x1d')]=qs[_0xa42d('0x1d')](_0x3bca18[_0xa42d('0x30')][_0xa42d('0x1d')]);_0x5b0a69[_0xa42d('0x1b')]=qs[_0xa42d('0x1b')](_0x3bca18['query'][_0xa42d('0x1b')]);}return _0x4b41c1[_0xa42d('0x4f')](_0x5b0a69);}})[_0xa42d('0x23')](function(_0x8d5e21){if(_0x8d5e21){return _0x8d5e21?{'count':_0xbe65c5,'rows':_0x8d5e21}:null;}})[_0xa42d('0x23')](respondWithResult(_0x2ebe0d,null))[_0xa42d('0x45')](handleError(_0x2ebe0d,null));};
\ No newline at end of file
+var _0xd769=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','then','end','stack','name','index','map','Automation','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','params','find','create','body','update','catch','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x32cd29,_0x29f6bb){var _0x2f7e6e=function(_0x20a924){while(--_0x20a924){_0x32cd29['push'](_0x32cd29['shift']());}};_0x2f7e6e(++_0x29f6bb);}(_0xd769,0xa5));var _0x9d76=function(_0x234459,_0x8da0cc){_0x234459=_0x234459-0x0;var _0x2a73fb=_0xd769[_0x234459];return _0x2a73fb;};'use strict';var emlformat=require(_0x9d76('0x0'));var rimraf=require(_0x9d76('0x1'));var zipdir=require(_0x9d76('0x2'));var jsonpatch=require(_0x9d76('0x3'));var rp=require('request-promise');var moment=require(_0x9d76('0x4'));var BPromise=require(_0x9d76('0x5'));var Mustache=require(_0x9d76('0x6'));var util=require(_0x9d76('0x7'));var path=require(_0x9d76('0x8'));var sox=require(_0x9d76('0x9'));var csv=require(_0x9d76('0xa'));var ejs=require(_0x9d76('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d76('0xc'));var squel=require(_0x9d76('0xd'));var crypto=require(_0x9d76('0xe'));var jsforce=require(_0x9d76('0xf'));var deskjs=require(_0x9d76('0x10'));var toCsv=require(_0x9d76('0xa'));var querystring=require(_0x9d76('0x11'));var Papa=require(_0x9d76('0x12'));var Redis=require(_0x9d76('0x13'));var authService=require(_0x9d76('0x14'));var qs=require(_0x9d76('0x15'));var as=require(_0x9d76('0x16'));var hardwareService=require(_0x9d76('0x17'));var logger=require(_0x9d76('0x18'))(_0x9d76('0x19'));var utils=require('../../config/utils');var config=require(_0x9d76('0x1a'));var licenseUtil=require(_0x9d76('0x1b'));var db=require(_0x9d76('0x1c'))['db'];function respondWithStatusCode(_0x2fca46,_0x4ce83d){_0x4ce83d=_0x4ce83d||0xcc;return function(_0x439174){if(_0x439174){return _0x2fca46[_0x9d76('0x1d')](_0x4ce83d);}return _0x2fca46[_0x9d76('0x1e')](_0x4ce83d)['end']();};}function respondWithResult(_0x397549,_0x18ed7f){_0x18ed7f=_0x18ed7f||0xc8;return function(_0x201248){if(_0x201248){return _0x397549['status'](_0x18ed7f)['json'](_0x201248);}};}function respondWithFilteredResult(_0x3f21ea,_0x27e7e2){return function(_0x2fcb04){if(_0x2fcb04){var _0x35a0e5=typeof _0x27e7e2['offset']==='undefined'&&typeof _0x27e7e2[_0x9d76('0x1f')]===_0x9d76('0x20');var _0x557a14=_0x2fcb04['count'];var _0x270cf7=_0x35a0e5?0x0:_0x27e7e2[_0x9d76('0x21')];var _0xa09e9f=_0x35a0e5?_0x2fcb04[_0x9d76('0x22')]:_0x27e7e2['offset']+_0x27e7e2[_0x9d76('0x1f')];var _0xa4bd1e;if(_0xa09e9f>=_0x557a14){_0xa09e9f=_0x557a14;_0xa4bd1e=0xc8;}else{_0xa4bd1e=0xce;}_0x3f21ea[_0x9d76('0x1e')](_0xa4bd1e);return _0x3f21ea[_0x9d76('0x23')](_0x9d76('0x24'),_0x270cf7+'-'+_0xa09e9f+'/'+_0x557a14)[_0x9d76('0x25')](_0x2fcb04);}return null;};}function patchUpdates(_0x44393f){return function(_0x127cd5){try{jsonpatch[_0x9d76('0x26')](_0x127cd5,_0x44393f,!![]);}catch(_0x4086ef){return BPromise[_0x9d76('0x27')](_0x4086ef);}return _0x127cd5[_0x9d76('0x28')]();};}function saveUpdates(_0x5aecc6,_0x47c16a){return function(_0x9b81ce){if(_0x9b81ce){return _0x9b81ce['update'](_0x5aecc6)[_0x9d76('0x29')](function(_0x1a9c89){return _0x1a9c89;});}return null;};}function removeEntity(_0x13dd62,_0x2267e6){return function(_0x440bdc){if(_0x440bdc){return _0x440bdc['destroy']()[_0x9d76('0x29')](function(){_0x13dd62[_0x9d76('0x1e')](0xcc)[_0x9d76('0x2a')]();});}};}function handleEntityNotFound(_0x5ddee7,_0x20ced7){return function(_0x46b60d){if(!_0x46b60d){_0x5ddee7[_0x9d76('0x1d')](0x194);}return _0x46b60d;};}function handleError(_0x2e0dc6,_0x4b359f){_0x4b359f=_0x4b359f||0x1f4;return function(_0x4e9632){logger['error'](_0x4e9632[_0x9d76('0x2b')]);if(_0x4e9632[_0x9d76('0x2c')]){delete _0x4e9632[_0x9d76('0x2c')];}_0x2e0dc6[_0x9d76('0x1e')](_0x4b359f)['send'](_0x4e9632);};}exports[_0x9d76('0x2d')]=function(_0x9bb288,_0x439099){var _0x4677f9={},_0x2d1039={},_0x5b3cd8={'count':0x0,'rows':[]};var _0x1e175a=_[_0x9d76('0x2e')](db[_0x9d76('0x2f')][_0x9d76('0x30')],function(_0x16bd94){return{'name':_0x16bd94[_0x9d76('0x31')],'type':_0x16bd94[_0x9d76('0x32')]['key']};});_0x2d1039[_0x9d76('0x33')]=_[_0x9d76('0x2e')](_0x1e175a,_0x9d76('0x2c'));_0x2d1039['query']=_[_0x9d76('0x34')](_0x9bb288['query']);_0x2d1039[_0x9d76('0x35')]=_[_0x9d76('0x36')](_0x2d1039[_0x9d76('0x33')],_0x2d1039['query']);_0x4677f9[_0x9d76('0x37')]=_[_0x9d76('0x36')](_0x2d1039[_0x9d76('0x33')],qs[_0x9d76('0x38')](_0x9bb288['query'][_0x9d76('0x38')]));_0x4677f9['attributes']=_0x4677f9[_0x9d76('0x37')][_0x9d76('0x39')]?_0x4677f9[_0x9d76('0x37')]:_0x2d1039[_0x9d76('0x33')];if(!_0x9bb288['query'][_0x9d76('0x3a')](_0x9d76('0x3b'))){_0x4677f9[_0x9d76('0x1f')]=qs[_0x9d76('0x1f')](_0x9bb288[_0x9d76('0x3c')][_0x9d76('0x1f')]);_0x4677f9[_0x9d76('0x21')]=qs[_0x9d76('0x21')](_0x9bb288[_0x9d76('0x3c')][_0x9d76('0x21')]);}_0x4677f9[_0x9d76('0x3d')]=qs[_0x9d76('0x3e')](_0x9bb288[_0x9d76('0x3c')][_0x9d76('0x3e')]);_0x4677f9['where']=qs['filters'](_[_0x9d76('0x3f')](_0x9bb288['query'],_0x2d1039[_0x9d76('0x35')]),_0x1e175a);if(_0x9bb288[_0x9d76('0x3c')][_0x9d76('0x40')]){_0x4677f9[_0x9d76('0x41')]=_[_0x9d76('0x42')](_0x4677f9[_0x9d76('0x41')],{'$or':_['map'](_0x1e175a,function(_0x373cea){if(_0x373cea[_0x9d76('0x32')]!=='VIRTUAL'){var _0x1ab9d9={};_0x1ab9d9[_0x373cea[_0x9d76('0x2c')]]={'$like':'%'+_0x9bb288[_0x9d76('0x3c')][_0x9d76('0x40')]+'%'};return _0x1ab9d9;}})});}_0x4677f9=_['merge']({},_0x4677f9,_0x9bb288[_0x9d76('0x43')]);var _0x2f73={'where':_0x4677f9[_0x9d76('0x41')]};return db[_0x9d76('0x2f')][_0x9d76('0x22')](_0x2f73)[_0x9d76('0x29')](function(_0x5c05fa){_0x5b3cd8['count']=_0x5c05fa;if(_0x9bb288[_0x9d76('0x3c')][_0x9d76('0x44')]){_0x4677f9[_0x9d76('0x45')]=[{'all':!![]}];}return db[_0x9d76('0x2f')][_0x9d76('0x46')](_0x4677f9);})['then'](function(_0x1f0656){_0x5b3cd8['rows']=_0x1f0656;return _0x5b3cd8;})[_0x9d76('0x29')](respondWithFilteredResult(_0x439099,_0x4677f9))['catch'](handleError(_0x439099,null));};exports['show']=function(_0x235810,_0x4d7440){var _0x2960d1={'raw':![],'where':{'id':_0x235810[_0x9d76('0x47')]['id']}},_0x3e24ee={};_0x3e24ee['model']=_[_0x9d76('0x34')](db[_0x9d76('0x2f')][_0x9d76('0x30')]);_0x3e24ee[_0x9d76('0x3c')]=_[_0x9d76('0x34')](_0x235810[_0x9d76('0x3c')]);_0x3e24ee[_0x9d76('0x35')]=_['intersection'](_0x3e24ee['model'],_0x3e24ee['query']);_0x2960d1[_0x9d76('0x37')]=_[_0x9d76('0x36')](_0x3e24ee[_0x9d76('0x33')],qs[_0x9d76('0x38')](_0x235810[_0x9d76('0x3c')][_0x9d76('0x38')]));_0x2960d1[_0x9d76('0x37')]=_0x2960d1[_0x9d76('0x37')][_0x9d76('0x39')]?_0x2960d1[_0x9d76('0x37')]:_0x3e24ee[_0x9d76('0x33')];if(_0x235810[_0x9d76('0x3c')][_0x9d76('0x44')]){_0x2960d1[_0x9d76('0x45')]=[{'all':!![]}];}_0x2960d1=_[_0x9d76('0x42')]({},_0x2960d1,_0x235810[_0x9d76('0x43')]);return db['Automation'][_0x9d76('0x48')](_0x2960d1)[_0x9d76('0x29')](handleEntityNotFound(_0x4d7440,null))['then'](respondWithResult(_0x4d7440,null))['catch'](handleError(_0x4d7440,null));};exports[_0x9d76('0x49')]=function(_0x3c55e1,_0x42220a){return db[_0x9d76('0x2f')][_0x9d76('0x49')](_0x3c55e1[_0x9d76('0x4a')],{})[_0x9d76('0x29')](respondWithResult(_0x42220a,0xc9))['catch'](handleError(_0x42220a,null));};exports[_0x9d76('0x4b')]=function(_0x58be18,_0x364e31){if(_0x58be18[_0x9d76('0x4a')]['id']){delete _0x58be18['body']['id'];}return db[_0x9d76('0x2f')][_0x9d76('0x48')]({'where':{'id':_0x58be18['params']['id']}})[_0x9d76('0x29')](handleEntityNotFound(_0x364e31,null))['then'](saveUpdates(_0x58be18[_0x9d76('0x4a')],null))['then'](respondWithResult(_0x364e31,null))[_0x9d76('0x4c')](handleError(_0x364e31,null));};exports['destroy']=function(_0x11992c,_0x198e18){return db[_0x9d76('0x2f')][_0x9d76('0x48')]({'where':{'id':_0x11992c['params']['id']}})[_0x9d76('0x29')](handleEntityNotFound(_0x198e18,null))[_0x9d76('0x29')](removeEntity(_0x198e18,null))[_0x9d76('0x4c')](handleError(_0x198e18,null));};exports[_0x9d76('0x4d')]=function(_0x2473b0,_0x588633,_0x6365ea){return db[_0x9d76('0x4e')][_0x9d76('0x48')]({'where':{'id':_0x2473b0[_0x9d76('0x47')]['id']}})['then'](handleEntityNotFound(_0x588633,null))['then'](function(_0x3b7499){if(_0x3b7499){return _0x3b7499[_0x9d76('0x4d')](_0x2473b0[_0x9d76('0x4a')][_0x9d76('0x4f')],_[_0x9d76('0x50')](_0x2473b0[_0x9d76('0x4a')],[_0x9d76('0x4f'),'id'])||{});}})[_0x9d76('0x29')](respondWithResult(_0x588633,null))[_0x9d76('0x4c')](handleError(_0x588633,null));};exports[_0x9d76('0x51')]=function(_0x58a2ff,_0x444bee,_0x43eee9){var _0x532554={};var _0x5a3a1b={};var _0x36d272;var _0x2f28b9;return db[_0x9d76('0x2f')]['findOne']({'where':{'id':_0x58a2ff[_0x9d76('0x47')]['id']}})[_0x9d76('0x29')](handleEntityNotFound(_0x444bee,null))[_0x9d76('0x29')](function(_0x32a7ac){if(_0x32a7ac){_0x36d272=_0x32a7ac;_0x5a3a1b[_0x9d76('0x33')]=_['keys'](db[_0x9d76('0x4e')][_0x9d76('0x30')]);_0x5a3a1b[_0x9d76('0x3c')]=_[_0x9d76('0x34')](_0x58a2ff[_0x9d76('0x3c')]);_0x5a3a1b[_0x9d76('0x35')]=_[_0x9d76('0x36')](_0x5a3a1b[_0x9d76('0x33')],_0x5a3a1b[_0x9d76('0x3c')]);_0x532554[_0x9d76('0x37')]=_[_0x9d76('0x36')](_0x5a3a1b['model'],qs['fields'](_0x58a2ff[_0x9d76('0x3c')][_0x9d76('0x38')]));_0x532554[_0x9d76('0x37')]=_0x532554[_0x9d76('0x37')]['length']?_0x532554[_0x9d76('0x37')]:_0x5a3a1b[_0x9d76('0x33')];_0x532554['order']=qs[_0x9d76('0x3e')](_0x58a2ff[_0x9d76('0x3c')][_0x9d76('0x3e')]);_0x532554[_0x9d76('0x41')]=qs[_0x9d76('0x35')](_[_0x9d76('0x3f')](_0x58a2ff['query'],_0x5a3a1b[_0x9d76('0x35')]));if(_0x58a2ff[_0x9d76('0x3c')]['filter']){_0x532554[_0x9d76('0x41')]=_[_0x9d76('0x42')](_0x532554[_0x9d76('0x41')],{'$or':_[_0x9d76('0x2e')](_0x532554['attributes'],function(_0x410902){var _0x460348={};_0x460348[_0x410902]={'$like':'%'+_0x58a2ff[_0x9d76('0x3c')][_0x9d76('0x40')]+'%'};return _0x460348;})});}_0x532554=_['merge']({},_0x532554,_0x58a2ff[_0x9d76('0x43')]);return _0x36d272[_0x9d76('0x51')](_0x532554);}})[_0x9d76('0x29')](function(_0x23cd29){if(_0x23cd29){_0x2f28b9=_0x23cd29[_0x9d76('0x39')];if(!_0x58a2ff[_0x9d76('0x3c')][_0x9d76('0x3a')](_0x9d76('0x3b'))){_0x532554[_0x9d76('0x1f')]=qs[_0x9d76('0x1f')](_0x58a2ff[_0x9d76('0x3c')][_0x9d76('0x1f')]);_0x532554['offset']=qs[_0x9d76('0x21')](_0x58a2ff['query'][_0x9d76('0x21')]);}return _0x36d272[_0x9d76('0x51')](_0x532554);}})[_0x9d76('0x29')](function(_0x1ad2f2){if(_0x1ad2f2){return _0x1ad2f2?{'count':_0x2f28b9,'rows':_0x1ad2f2}:null;}})['then'](respondWithResult(_0x444bee,null))[_0x9d76('0x4c')](handleError(_0x444bee,null));};exports[_0x9d76('0x52')]=function(_0x3a5386,_0x308a3c,_0x152a68){return db[_0x9d76('0x53')][_0x9d76('0x48')]({'where':{'id':_0x3a5386[_0x9d76('0x47')]['id']}})[_0x9d76('0x29')](handleEntityNotFound(_0x308a3c,null))[_0x9d76('0x29')](function(_0x201324){if(_0x201324){return _0x201324[_0x9d76('0x52')](_0x3a5386['body'][_0x9d76('0x4f')],_[_0x9d76('0x50')](_0x3a5386[_0x9d76('0x4a')],[_0x9d76('0x4f'),'id'])||{});}})[_0x9d76('0x29')](respondWithResult(_0x308a3c,null))[_0x9d76('0x4c')](handleError(_0x308a3c,null));};exports[_0x9d76('0x54')]=function(_0x5a7da4,_0x5e80a2,_0x23bffe){var _0xc005c5={};var _0x1f37a4={};var _0x4b07f5;var _0x75214b;return db[_0x9d76('0x2f')][_0x9d76('0x55')]({'where':{'id':_0x5a7da4[_0x9d76('0x47')]['id']}})[_0x9d76('0x29')](handleEntityNotFound(_0x5e80a2,null))[_0x9d76('0x29')](function(_0x4942b0){if(_0x4942b0){_0x4b07f5=_0x4942b0;_0x1f37a4[_0x9d76('0x33')]=_[_0x9d76('0x34')](db[_0x9d76('0x53')][_0x9d76('0x30')]);_0x1f37a4[_0x9d76('0x3c')]=_[_0x9d76('0x34')](_0x5a7da4['query']);_0x1f37a4[_0x9d76('0x35')]=_[_0x9d76('0x36')](_0x1f37a4[_0x9d76('0x33')],_0x1f37a4[_0x9d76('0x3c')]);_0xc005c5[_0x9d76('0x37')]=_[_0x9d76('0x36')](_0x1f37a4[_0x9d76('0x33')],qs[_0x9d76('0x38')](_0x5a7da4[_0x9d76('0x3c')][_0x9d76('0x38')]));_0xc005c5[_0x9d76('0x37')]=_0xc005c5[_0x9d76('0x37')][_0x9d76('0x39')]?_0xc005c5[_0x9d76('0x37')]:_0x1f37a4[_0x9d76('0x33')];_0xc005c5['order']=qs[_0x9d76('0x3e')](_0x5a7da4[_0x9d76('0x3c')][_0x9d76('0x3e')]);_0xc005c5[_0x9d76('0x41')]=qs[_0x9d76('0x35')](_[_0x9d76('0x3f')](_0x5a7da4[_0x9d76('0x3c')],_0x1f37a4['filters']));if(_0x5a7da4[_0x9d76('0x3c')][_0x9d76('0x40')]){_0xc005c5[_0x9d76('0x41')]=_[_0x9d76('0x42')](_0xc005c5[_0x9d76('0x41')],{'$or':_[_0x9d76('0x2e')](_0xc005c5['attributes'],function(_0x502595){var _0x48e23d={};_0x48e23d[_0x502595]={'$like':'%'+_0x5a7da4[_0x9d76('0x3c')][_0x9d76('0x40')]+'%'};return _0x48e23d;})});}_0xc005c5=_['merge']({},_0xc005c5,_0x5a7da4[_0x9d76('0x43')]);return _0x4b07f5['getActions'](_0xc005c5);}})[_0x9d76('0x29')](function(_0x296ef4){if(_0x296ef4){_0x75214b=_0x296ef4['length'];if(!_0x5a7da4[_0x9d76('0x3c')][_0x9d76('0x3a')]('nolimit')){_0xc005c5['limit']=qs[_0x9d76('0x1f')](_0x5a7da4['query'][_0x9d76('0x1f')]);_0xc005c5[_0x9d76('0x21')]=qs[_0x9d76('0x21')](_0x5a7da4[_0x9d76('0x3c')]['offset']);}return _0x4b07f5[_0x9d76('0x54')](_0xc005c5);}})[_0x9d76('0x29')](function(_0x1fd1fd){if(_0x1fd1fd){return _0x1fd1fd?{'count':_0x75214b,'rows':_0x1fd1fd}:null;}})[_0x9d76('0x29')](respondWithResult(_0x5e80a2,null))[_0x9d76('0x4c')](handleError(_0x5e80a2,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 35c80ee..4118eba 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 _0x0e47=['path','rimraf','../../config/environment','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e47,0x1b3));var _0x70e4=function(_0x40baf1,_0x39a1e3){_0x40baf1=_0x40baf1-0x0;var _0x293477=_0x0e47[_0x40baf1];return _0x293477;};'use strict';var _=require(_0x70e4('0x0'));var util=require(_0x70e4('0x1'));var logger=require(_0x70e4('0x2'))(_0x70e4('0x3'));var moment=require(_0x70e4('0x4'));var BPromise=require(_0x70e4('0x5'));var rp=require(_0x70e4('0x6'));var fs=require('fs');var path=require(_0x70e4('0x7'));var rimraf=require(_0x70e4('0x8'));var config=require(_0x70e4('0x9'));var attributes=require('./automation.attributes');module['exports']=function(_0x2592e3,_0xa6288c){return _0x2592e3[_0x70e4('0xa')](_0x70e4('0xb'),attributes,{'tableName':_0x70e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9357=['define','tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports'];(function(_0x3c2666,_0x15fd23){var _0x10c814=function(_0x4660c0){while(--_0x4660c0){_0x3c2666['push'](_0x3c2666['shift']());}};_0x10c814(++_0x15fd23);}(_0x9357,0xe9));var _0x7935=function(_0x4b131a,_0x6bd404){_0x4b131a=_0x4b131a-0x0;var _0x1bdc07=_0x9357[_0x4b131a];return _0x1bdc07;};'use strict';var _=require(_0x7935('0x0'));var util=require('util');var logger=require(_0x7935('0x1'))(_0x7935('0x2'));var moment=require(_0x7935('0x3'));var BPromise=require(_0x7935('0x4'));var rp=require(_0x7935('0x5'));var fs=require('fs');var path=require(_0x7935('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7935('0x7'));module[_0x7935('0x8')]=function(_0x52f1a3,_0x42924b){return _0x52f1a3[_0x7935('0x9')]('Automation',attributes,{'tableName':_0x7935('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 67713b3..b3d5b50 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 _0xa5dd=['request','then','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1990da,_0x566d31){var _0x2dab2c=function(_0x19c48a){while(--_0x19c48a){_0x1990da['push'](_0x1990da['shift']());}};_0x2dab2c(++_0x566d31);}(_0xa5dd,0x101));var _0xda5d=function(_0x2e4790,_0x15d4ed){_0x2e4790=_0x2e4790-0x0;var _0x324230=_0xa5dd[_0x2e4790];return _0x324230;};'use strict';var _=require(_0xda5d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xda5d('0x1'));var rs=require(_0xda5d('0x2'));var fs=require('fs');var Redis=require(_0xda5d('0x3'));var db=require(_0xda5d('0x4'))['db'];var utils=require(_0xda5d('0x5'));var logger=require('../../config/logger')(_0xda5d('0x6'));var config=require(_0xda5d('0x7'));var jayson=require(_0xda5d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x461283,_0x91cf4e,_0x432097){return new BPromise(function(_0x402aa8,_0x1c1e2d){return client[_0xda5d('0x9')](_0x461283,_0x432097)[_0xda5d('0xa')](function(_0x3d5c69){logger['info']('Automation,\x20%s,\x20%s',_0x91cf4e,_0xda5d('0xb'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x91cf4e,_0xda5d('0xb'),JSON[_0xda5d('0xc')](_0x3d5c69));if(_0x3d5c69['error']){if(_0x3d5c69[_0xda5d('0xd')][_0xda5d('0xe')]===0x1f4){logger[_0xda5d('0xd')]('Automation,\x20%s,\x20%s',_0x91cf4e,_0x3d5c69['error'][_0xda5d('0xf')]);return _0x1c1e2d(_0x3d5c69[_0xda5d('0xd')][_0xda5d('0xf')]);}logger[_0xda5d('0xd')](_0xda5d('0x10'),_0x91cf4e,_0x3d5c69[_0xda5d('0xd')][_0xda5d('0xf')]);return _0x402aa8(_0x3d5c69['error']['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x91cf4e,'request\x20sent');_0x402aa8(_0x3d5c69[_0xda5d('0x11')][_0xda5d('0xf')]);}})[_0xda5d('0x12')](function(_0x388f40){logger[_0xda5d('0xd')](_0xda5d('0x10'),_0x91cf4e,_0x388f40);_0x1c1e2d(_0x388f40);});});}
\ No newline at end of file
+var _0x5c96=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x435758,_0x723d44){var _0x4b0087=function(_0x38b019){while(--_0x38b019){_0x435758['push'](_0x435758['shift']());}};_0x4b0087(++_0x723d44);}(_0x5c96,0x133));var _0x65c9=function(_0x50f72b,_0x32cb7f){_0x50f72b=_0x50f72b-0x0;var _0x21fdef=_0x5c96[_0x50f72b];return _0x21fdef;};'use strict';var _=require(_0x65c9('0x0'));var util=require(_0x65c9('0x1'));var moment=require(_0x65c9('0x2'));var BPromise=require(_0x65c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65c9('0x4'));var db=require(_0x65c9('0x5'))['db'];var utils=require(_0x65c9('0x6'));var logger=require(_0x65c9('0x7'))(_0x65c9('0x8'));var config=require(_0x65c9('0x9'));var jayson=require(_0x65c9('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x502c63,_0x4eb25b,_0x1a9b93){return new BPromise(function(_0x10a355,_0x1c679d){return client['request'](_0x502c63,_0x1a9b93)[_0x65c9('0xb')](function(_0x3249da){logger[_0x65c9('0xc')](_0x65c9('0xd'),_0x4eb25b,_0x65c9('0xe'));logger[_0x65c9('0xf')](_0x65c9('0x10'),_0x4eb25b,'request\x20sent',JSON['stringify'](_0x3249da));if(_0x3249da['error']){if(_0x3249da[_0x65c9('0x11')][_0x65c9('0x12')]===0x1f4){logger[_0x65c9('0x11')](_0x65c9('0xd'),_0x4eb25b,_0x3249da[_0x65c9('0x11')]['message']);return _0x1c679d(_0x3249da[_0x65c9('0x11')][_0x65c9('0x13')]);}logger[_0x65c9('0x11')](_0x65c9('0xd'),_0x4eb25b,_0x3249da['error'][_0x65c9('0x13')]);return _0x10a355(_0x3249da[_0x65c9('0x11')][_0x65c9('0x13')]);}else{logger[_0x65c9('0xc')](_0x65c9('0xd'),_0x4eb25b,_0x65c9('0xe'));_0x10a355(_0x3249da[_0x65c9('0x14')][_0x65c9('0x13')]);}})[_0x65c9('0x15')](function(_0x25c0e9){logger[_0x65c9('0x11')](_0x65c9('0xd'),_0x4eb25b,_0x25c0e9);_0x1c679d(_0x25c0e9);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 98b403f..99532f0 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 _0x9f94=['addActions','put','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConditions','/:id/actions','getActions','post','/:id/conditions','addConditions'];(function(_0x4c6e38,_0x4902c7){var _0x472a16=function(_0x3ba24a){while(--_0x3ba24a){_0x4c6e38['push'](_0x4c6e38['shift']());}};_0x472a16(++_0x4902c7);}(_0x9f94,0x1e7));var _0x49f9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9f94[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var path=require(_0x49f9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x49f9('0x3')]();var fs_extra=require(_0x49f9('0x4'));var auth=require(_0x49f9('0x5'));var interaction=require(_0x49f9('0x6'));var config=require(_0x49f9('0x7'));var controller=require('./automation.controller');router[_0x49f9('0x8')]('/',auth[_0x49f9('0x9')](),controller[_0x49f9('0xa')]);router[_0x49f9('0x8')](_0x49f9('0xb'),auth[_0x49f9('0x9')](),controller[_0x49f9('0xc')]);router[_0x49f9('0x8')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x49f9('0xd')]);router['get'](_0x49f9('0xe'),auth[_0x49f9('0x9')](),controller[_0x49f9('0xf')]);router['post']('/',auth[_0x49f9('0x9')](),controller['create']);router[_0x49f9('0x10')](_0x49f9('0x11'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x12')]);router['post']('/:id/actions',auth[_0x49f9('0x9')](),controller[_0x49f9('0x13')]);router[_0x49f9('0x14')](_0x49f9('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x49f9('0xb'),auth['isAuthenticated'](),controller[_0x49f9('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xab55=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','create','post','addConditions','/:id/actions','addActions','put','delete','destroy'];(function(_0x46e749,_0x9b62a){var _0x1b776f=function(_0xe39362){while(--_0xe39362){_0x46e749['push'](_0x46e749['shift']());}};_0x1b776f(++_0x9b62a);}(_0xab55,0x139));var _0x5ab5=function(_0x86d299,_0x53bd07){_0x86d299=_0x86d299-0x0;var _0x44f0b3=_0xab55[_0x86d299];return _0x44f0b3;};'use strict';var multer=require(_0x5ab5('0x0'));var util=require(_0x5ab5('0x1'));var path=require(_0x5ab5('0x2'));var timeout=require(_0x5ab5('0x3'));var express=require('express');var router=express[_0x5ab5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ab5('0x5'));var interaction=require(_0x5ab5('0x6'));var config=require(_0x5ab5('0x7'));var controller=require(_0x5ab5('0x8'));router[_0x5ab5('0x9')]('/',auth[_0x5ab5('0xa')](),controller[_0x5ab5('0xb')]);router[_0x5ab5('0x9')](_0x5ab5('0xc'),auth[_0x5ab5('0xa')](),controller[_0x5ab5('0xd')]);router[_0x5ab5('0x9')](_0x5ab5('0xe'),auth[_0x5ab5('0xa')](),controller[_0x5ab5('0xf')]);router[_0x5ab5('0x9')]('/:id/actions',auth[_0x5ab5('0xa')](),controller[_0x5ab5('0x10')]);router['post']('/',auth[_0x5ab5('0xa')](),controller[_0x5ab5('0x11')]);router[_0x5ab5('0x12')](_0x5ab5('0xe'),auth[_0x5ab5('0xa')](),controller[_0x5ab5('0x13')]);router[_0x5ab5('0x12')](_0x5ab5('0x14'),auth['isAuthenticated'](),controller[_0x5ab5('0x15')]);router[_0x5ab5('0x16')](_0x5ab5('0xc'),auth[_0x5ab5('0xa')](),controller['update']);router[_0x5ab5('0x17')]('/:id',auth[_0x5ab5('0xa')](),controller[_0x5ab5('0x18')]);module[_0x5ab5('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index c14c450..f8003ce 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 _0xf41e=['exports','STRING','name','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0x49fb45,_0x4cc16c){var _0x5d7dbc=function(_0x967546){while(--_0x967546){_0x49fb45['push'](_0x49fb45['shift']());}};_0x5d7dbc(++_0x4cc16c);}(_0xf41e,0x167));var _0xef41=function(_0x9a1fc,_0x461fd8){_0x9a1fc=_0x9a1fc-0x0;var _0x6969a3=_0xf41e[_0x9a1fc];return _0x6969a3;};'use strict';var Sequelize=require(_0xef41('0x0'));module[_0xef41('0x1')]={'name':{'type':Sequelize[_0xef41('0x2')],'unique':_0xef41('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xef41('0x4')](_0xef41('0x5')),'allowNull':![],'defaultValue':_0xef41('0x5')},'description':{'type':Sequelize[_0xef41('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xef41('0x6')](0x4)[_0xef41('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xef41('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef41('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xef41('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef41('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xef41('0x6')](0x5)[_0xef41('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef41('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef41('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef41('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xef41('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xef41('0x6')](0x5)[_0xef41('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef41('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xef41('0x6')](0x3)[_0xef41('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xef41('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xef41('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xef41('0x4')]('always',_0xef41('0x11'),_0xef41('0x12')),'defaultValue':_0xef41('0x13')},'dialAMDActive':{'type':Sequelize[_0xef41('0x14')],'defaultValue':0x0,'comment':_0xef41('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xef41('0x6')](0x9)[_0xef41('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xef41('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xef41('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xef41('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xef41('0x6')](0x9)[_0xef41('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xef41('0x6')](0x9)[_0xef41('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xef41('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xef41('0x6')](0x9)[_0xef41('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xef41('0x6')](0x9)[_0xef41('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xef41('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xef41('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xef41('0x6')](0x9)[_0xef41('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xef41('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xef41('0x4')](_0xef41('0x1b'),_0xef41('0x1c')),'defaultValue':_0xef41('0x1b')},'dialPrefix':{'type':Sequelize[_0xef41('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xef41('0x6')](0x3)[_0xef41('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xef41('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xef41('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xef41('0x6')](0x3)[_0xef41('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef41('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xef41('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xef41('0x6')](0x3)[_0xef41('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xef41('0x6')](0x5)[_0xef41('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xef41('0x6')](0x3)[_0xef41('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef41('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef41('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xef41('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef41('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xef41('0x6')](0x3)[_0xef41('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef41('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xef41('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef41('0x23')}};
\ No newline at end of file
+var _0xd250=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x458656,_0x4292d8){var _0x24e475=function(_0x15f497){while(--_0x15f497){_0x458656['push'](_0x458656['shift']());}};_0x24e475(++_0x4292d8);}(_0xd250,0x70));var _0x0d25=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0xd250[_0x3817a9];return _0x443f30;};'use strict';var Sequelize=require(_0x0d25('0x0'));module[_0x0d25('0x1')]={'name':{'type':Sequelize[_0x0d25('0x2')],'unique':_0x0d25('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0d25('0x4')](_0x0d25('0x5')),'allowNull':![],'defaultValue':_0x0d25('0x5')},'description':{'type':Sequelize[_0x0d25('0x2')]},'active':{'type':Sequelize[_0x0d25('0x6')],'defaultValue':0x0,'comment':_0x0d25('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0d25('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0d25('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0d25('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0d25('0x9')](0x3)[_0x0d25('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d25('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0d25('0x9')](0x3)[_0x0d25('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0d25('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d25('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x0d25('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d25('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0d25('0x9')](0x5)[_0x0d25('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0d25('0x9')](0x3)[_0x0d25('0xa')],'defaultValue':0x3,'comment':_0x0d25('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0d25('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d25('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0d25('0x10')},'dialTimezone':{'type':Sequelize[_0x0d25('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0d25('0x2')],'defaultValue':_0x0d25('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x0d25('0x4')](_0x0d25('0x12'),_0x0d25('0x13'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0d25('0x6')],'defaultValue':0x0,'comment':_0x0d25('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0d25('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0d25('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0d25('0x9')](0x9)[_0x0d25('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0d25('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0d25('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0d25('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x0d25('0x9')](0x9)[_0x0d25('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0d25('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0d25('0x9')](0x9)[_0x0d25('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0d25('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0d25('0x9')](0x9)[_0x0d25('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0d25('0x9')](0x5)[_0x0d25('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0d25('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0d25('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0d25('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0d25('0x4')](_0x0d25('0x1c'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0d25('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0d25('0x9')](0x3)[_0x0d25('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0d25('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0d25('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0d25('0x9')](0x5)[_0x0d25('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d25('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x0d25('0x9')](0x3)[_0x0d25('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0d25('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d25('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0d25('0x9')](0x3)[_0x0d25('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d25('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0d25('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d25('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0d25('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0d25('0x9')](0x5)[_0x0d25('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d25('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0d25('0x9')](0x3)[_0x0d25('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d25('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0d25('0x9')](0x5)[_0x0d25('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d25('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index bfa9b95..d777208 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 _0x69cd=['fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','Campaign','params','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','getHoppers','findOne','nolimit','CampaignId','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','mustache','util','to-csv','ejs'];(function(_0x931b59,_0x455da1){var _0x49d207=function(_0x1c2cd7){while(--_0x1c2cd7){_0x931b59['push'](_0x931b59['shift']());}};_0x49d207(++_0x455da1);}(_0x69cd,0x104));var _0xd69c=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x69cd[_0x2abc3d];return _0x252745;};'use strict';var emlformat=require(_0xd69c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd69c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd69c('0x2'));var util=require(_0xd69c('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0xd69c('0x4'));var ejs=require(_0xd69c('0x5'));var fs=require('fs');var fs_extra=require(_0xd69c('0x6'));var _=require(_0xd69c('0x7'));var squel=require(_0xd69c('0x8'));var crypto=require(_0xd69c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd69c('0xa'));var toCsv=require(_0xd69c('0x4'));var querystring=require(_0xd69c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd69c('0xc'));var qs=require(_0xd69c('0xd'));var as=require(_0xd69c('0xe'));var hardwareService=require(_0xd69c('0xf'));var logger=require(_0xd69c('0x10'))('api');var utils=require(_0xd69c('0x11'));var config=require(_0xd69c('0x12'));var licenseUtil=require(_0xd69c('0x13'));var db=require(_0xd69c('0x14'))['db'];function respondWithStatusCode(_0x2a6b58,_0x577b3a){_0x577b3a=_0x577b3a||0xcc;return function(_0x167409){if(_0x167409){return _0x2a6b58[_0xd69c('0x15')](_0x577b3a);}return _0x2a6b58[_0xd69c('0x16')](_0x577b3a)[_0xd69c('0x17')]();};}function respondWithResult(_0xfe03c7,_0x468d1c){_0x468d1c=_0x468d1c||0xc8;return function(_0x222009){if(_0x222009){return _0xfe03c7[_0xd69c('0x16')](_0x468d1c)[_0xd69c('0x18')](_0x222009);}};}function respondWithFilteredResult(_0x2cbcd7,_0x21a0ce){return function(_0x414058){if(_0x414058){var _0x1515e1=typeof _0x21a0ce['offset']===_0xd69c('0x19')&&typeof _0x21a0ce[_0xd69c('0x1a')]===_0xd69c('0x19');var _0x380345=_0x414058['count'];var _0x118c66=_0x1515e1?0x0:_0x21a0ce[_0xd69c('0x1b')];var _0x5f0b85=_0x1515e1?_0x414058[_0xd69c('0x1c')]:_0x21a0ce[_0xd69c('0x1b')]+_0x21a0ce[_0xd69c('0x1a')];var _0x425b1d;if(_0x5f0b85>=_0x380345){_0x5f0b85=_0x380345;_0x425b1d=0xc8;}else{_0x425b1d=0xce;}_0x2cbcd7[_0xd69c('0x16')](_0x425b1d);return _0x2cbcd7[_0xd69c('0x1d')]('Content-Range',_0x118c66+'-'+_0x5f0b85+'/'+_0x380345)[_0xd69c('0x18')](_0x414058);}return null;};}function patchUpdates(_0x477a8f){return function(_0x3a98a2){try{jsonpatch[_0xd69c('0x1e')](_0x3a98a2,_0x477a8f,!![]);}catch(_0x12058f){return BPromise[_0xd69c('0x1f')](_0x12058f);}return _0x3a98a2['save']();};}function saveUpdates(_0x10d2ad,_0x4c48df){return function(_0x5a4bc8){if(_0x5a4bc8){return _0x5a4bc8['update'](_0x10d2ad)[_0xd69c('0x20')](function(_0x192e06){return _0x192e06;});}return null;};}function removeEntity(_0x5035bd,_0x357b5e){return function(_0x962112){if(_0x962112){return _0x962112[_0xd69c('0x21')]()['then'](function(){var _0x3a3143=_0x962112[_0xd69c('0x22')]({'plain':!![]});var _0x3cc560=_0xd69c('0x23');return db[_0xd69c('0x24')][_0xd69c('0x21')]({'where':{'type':_0x3cc560,'resourceId':_0x3a3143['id']}})[_0xd69c('0x20')](function(){return _0x962112;});})[_0xd69c('0x20')](function(){_0x5035bd[_0xd69c('0x16')](0xcc)[_0xd69c('0x17')]();});}};}function handleEntityNotFound(_0x24f84c,_0x5c6cf6){return function(_0x279483){if(!_0x279483){_0x24f84c[_0xd69c('0x15')](0x194);}return _0x279483;};}function handleError(_0x515cea,_0xd14b5e){_0xd14b5e=_0xd14b5e||0x1f4;return function(_0x3ff026){logger[_0xd69c('0x25')](_0x3ff026[_0xd69c('0x26')]);if(_0x3ff026[_0xd69c('0x27')]){delete _0x3ff026[_0xd69c('0x27')];}_0x515cea['status'](_0xd14b5e)['send'](_0x3ff026);};}exports[_0xd69c('0x28')]=function(_0x52b2d9,_0x308533){var _0x260e14={},_0x14e05d={},_0x106201={'count':0x0,'rows':[]};var _0x78a67f=_[_0xd69c('0x29')](db['Campaign'][_0xd69c('0x2a')],function(_0x8edb7c){return{'name':_0x8edb7c[_0xd69c('0x2b')],'type':_0x8edb7c[_0xd69c('0x2c')]['key']};});_0x14e05d[_0xd69c('0x2d')]=_[_0xd69c('0x29')](_0x78a67f,_0xd69c('0x27'));_0x14e05d[_0xd69c('0x2e')]=_[_0xd69c('0x2f')](_0x52b2d9[_0xd69c('0x2e')]);_0x14e05d[_0xd69c('0x30')]=_['intersection'](_0x14e05d[_0xd69c('0x2d')],_0x14e05d[_0xd69c('0x2e')]);_0x260e14[_0xd69c('0x31')]=_[_0xd69c('0x32')](_0x14e05d['model'],qs[_0xd69c('0x33')](_0x52b2d9[_0xd69c('0x2e')][_0xd69c('0x33')]));_0x260e14['attributes']=_0x260e14[_0xd69c('0x31')][_0xd69c('0x34')]?_0x260e14[_0xd69c('0x31')]:_0x14e05d[_0xd69c('0x2d')];if(!_0x52b2d9[_0xd69c('0x2e')][_0xd69c('0x35')]('nolimit')){_0x260e14[_0xd69c('0x1a')]=qs[_0xd69c('0x1a')](_0x52b2d9[_0xd69c('0x2e')][_0xd69c('0x1a')]);_0x260e14[_0xd69c('0x1b')]=qs[_0xd69c('0x1b')](_0x52b2d9[_0xd69c('0x2e')]['offset']);}_0x260e14[_0xd69c('0x36')]=qs[_0xd69c('0x37')](_0x52b2d9[_0xd69c('0x2e')][_0xd69c('0x37')]);_0x260e14['where']=qs[_0xd69c('0x30')](_[_0xd69c('0x38')](_0x52b2d9[_0xd69c('0x2e')],_0x14e05d['filters']),_0x78a67f);if(_0x52b2d9[_0xd69c('0x2e')][_0xd69c('0x39')]){_0x260e14['where']=_[_0xd69c('0x3a')](_0x260e14[_0xd69c('0x3b')],{'$or':_[_0xd69c('0x29')](_0x78a67f,function(_0x5063cf){if(_0x5063cf[_0xd69c('0x2c')]!==_0xd69c('0x3c')){var _0x58a93f={};_0x58a93f[_0x5063cf[_0xd69c('0x27')]]={'$like':'%'+_0x52b2d9[_0xd69c('0x2e')][_0xd69c('0x39')]+'%'};return _0x58a93f;}})});}_0x260e14=_[_0xd69c('0x3a')]({},_0x260e14,_0x52b2d9[_0xd69c('0x3d')]);var _0x2323b9={'where':_0x260e14[_0xd69c('0x3b')]};return db['Campaign'][_0xd69c('0x1c')](_0x2323b9)[_0xd69c('0x20')](function(_0x159c24){_0x106201[_0xd69c('0x1c')]=_0x159c24;if(_0x52b2d9[_0xd69c('0x2e')]['includeAll']){_0x260e14['include']=[{'all':!![]}];}return db[_0xd69c('0x3e')]['findAll'](_0x260e14);})[_0xd69c('0x20')](function(_0x3d7fc9){_0x106201['rows']=_0x3d7fc9;return _0x106201;})[_0xd69c('0x20')](respondWithFilteredResult(_0x308533,_0x260e14))['catch'](handleError(_0x308533,null));};exports['show']=function(_0x388b98,_0xa74d2d){var _0x5e0196={'raw':![],'where':{'id':_0x388b98[_0xd69c('0x3f')]['id']}},_0x27b528={};_0x27b528[_0xd69c('0x2d')]=_['keys'](db[_0xd69c('0x3e')][_0xd69c('0x2a')]);_0x27b528[_0xd69c('0x2e')]=_[_0xd69c('0x2f')](_0x388b98[_0xd69c('0x2e')]);_0x27b528[_0xd69c('0x30')]=_[_0xd69c('0x32')](_0x27b528[_0xd69c('0x2d')],_0x27b528[_0xd69c('0x2e')]);_0x5e0196[_0xd69c('0x31')]=_[_0xd69c('0x32')](_0x27b528[_0xd69c('0x2d')],qs[_0xd69c('0x33')](_0x388b98['query'][_0xd69c('0x33')]));_0x5e0196[_0xd69c('0x31')]=_0x5e0196['attributes'][_0xd69c('0x34')]?_0x5e0196[_0xd69c('0x31')]:_0x27b528[_0xd69c('0x2d')];if(_0x388b98['query'][_0xd69c('0x40')]){_0x5e0196[_0xd69c('0x41')]=[{'all':!![]}];}_0x5e0196=_[_0xd69c('0x3a')]({},_0x5e0196,_0x388b98['options']);return db[_0xd69c('0x3e')][_0xd69c('0x42')](_0x5e0196)[_0xd69c('0x20')](handleEntityNotFound(_0xa74d2d,null))[_0xd69c('0x20')](respondWithResult(_0xa74d2d,null))[_0xd69c('0x43')](handleError(_0xa74d2d,null));};exports[_0xd69c('0x44')]=function(_0x5542c4,_0x45ff12){return db[_0xd69c('0x3e')][_0xd69c('0x44')](_0x5542c4[_0xd69c('0x45')],{})[_0xd69c('0x20')](function(_0x210999){var _0xa53459=_0x5542c4[_0xd69c('0x46')][_0xd69c('0x22')]({'plain':!![]});if(!_0xa53459)throw new Error(_0xd69c('0x47'));if(_0xa53459[_0xd69c('0x48')]==='user'){var _0x56e8ca=_0x210999[_0xd69c('0x22')]({'plain':!![]});var _0x314f1f=_0xd69c('0x23');return db[_0xd69c('0x49')][_0xd69c('0x42')]({'where':{'name':_0x314f1f,'userProfileId':_0xa53459[_0xd69c('0x4a')]},'raw':!![]})[_0xd69c('0x20')](function(_0x5be2fb){if(_0x5be2fb&&_0x5be2fb[_0xd69c('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x56e8ca[_0xd69c('0x27')],'resourceId':_0x56e8ca['id'],'type':_0x5be2fb['name'],'sectionId':_0x5be2fb['id']},{})['then'](function(){return _0x210999;});}else{return _0x210999;}})['catch'](function(_0x1d479f){logger[_0xd69c('0x25')](_0xd69c('0x4c'),_0x1d479f);throw _0x1d479f;});}return _0x210999;})[_0xd69c('0x20')](respondWithResult(_0x45ff12,0xc9))[_0xd69c('0x43')](handleError(_0x45ff12,null));};exports[_0xd69c('0x4d')]=function(_0x435dca,_0x16580e){var _0x18fa47={'where':{'id':_0x435dca[_0xd69c('0x3f')]['id']}},_0x10ba30={};_0x10ba30[_0xd69c('0x2d')]=_[_0xd69c('0x2f')](db['Campaign'][_0xd69c('0x2a')]);_0x18fa47['attributes']=_['intersection'](_0x10ba30[_0xd69c('0x2d')],qs[_0xd69c('0x33')](_0x435dca[_0xd69c('0x2e')][_0xd69c('0x33')]));_0x18fa47[_0xd69c('0x31')]=_0x18fa47['attributes'][_0xd69c('0x34')]?_0x18fa47[_0xd69c('0x31')]:_0x10ba30[_0xd69c('0x2d')];if(_0x435dca[_0xd69c('0x2e')]['includeAll']){_0x18fa47[_0xd69c('0x41')]=[{'all':!![]}];}_0x18fa47=_[_0xd69c('0x3a')]({},_0x18fa47,_0x435dca['options']);return db[_0xd69c('0x3e')][_0xd69c('0x42')](_0x18fa47)[_0xd69c('0x20')](handleEntityNotFound(_0x16580e,null))['then'](function(_0x15f4a4){if(_0x15f4a4){var _0x1ee7b0=_0x15f4a4['get']({'plain':!![]});_0x1ee7b0=qs[_0xd69c('0x4e')](_0x1ee7b0,['id',_0xd69c('0x4f'),'updatedAt']);_0x435dca[_0xd69c('0x45')]=_[_0xd69c('0x4e')](_0x435dca[_0xd69c('0x45')],['id','createdAt',_0xd69c('0x50')]);return db['Campaign'][_0xd69c('0x44')](_[_0xd69c('0x3a')](_0x1ee7b0,_0x435dca[_0xd69c('0x45')]),{'include':_0x435dca[_0xd69c('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0xd69c('0x20')](function(_0x34ba9b){var _0x58f787=_0x435dca[_0xd69c('0x46')]['get']({'plain':!![]});if(!_0x58f787)throw new Error(_0xd69c('0x47'));if(_0x58f787['role']==='user'){var _0x309ea3=_0x34ba9b[_0xd69c('0x22')]({'plain':!![]});var _0x35c14a=_0xd69c('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x35c14a,'userProfileId':_0x58f787[_0xd69c('0x4a')]},'raw':!![]})['then'](function(_0x222817){if(_0x222817&&_0x222817[_0xd69c('0x4b')]===0x0){return db[_0xd69c('0x24')][_0xd69c('0x44')]({'name':_0x309ea3[_0xd69c('0x27')],'resourceId':_0x309ea3['id'],'type':_0x222817[_0xd69c('0x27')],'sectionId':_0x222817['id']},{})['then'](function(){return _0x34ba9b;});}else{return _0x34ba9b;}})['catch'](function(_0x5d543a){logger[_0xd69c('0x25')](_0xd69c('0x4c'),_0x5d543a);throw _0x5d543a;});}return _0x34ba9b;});}})['then'](respondWithResult(_0x16580e,0xc9))[_0xd69c('0x43')](handleError(_0x16580e,null));};exports[_0xd69c('0x51')]=function(_0xc5e200,_0x41a797){if(_0xc5e200[_0xd69c('0x45')]['id']){delete _0xc5e200[_0xd69c('0x45')]['id'];}return db[_0xd69c('0x3e')][_0xd69c('0x42')]({'where':{'id':_0xc5e200[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x41a797,null))[_0xd69c('0x20')](saveUpdates(_0xc5e200[_0xd69c('0x45')],null))[_0xd69c('0x20')](respondWithResult(_0x41a797,null))[_0xd69c('0x43')](handleError(_0x41a797,null));};exports[_0xd69c('0x21')]=function(_0x3c2461,_0x44bbe0){return db[_0xd69c('0x3e')][_0xd69c('0x42')]({'where':{'id':_0x3c2461[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x44bbe0,null))[_0xd69c('0x20')](removeEntity(_0x44bbe0,null))[_0xd69c('0x43')](handleError(_0x44bbe0,null));};exports[_0xd69c('0x52')]=function(_0x542d67,_0x41e693,_0x18a641){var _0x512a9f={'raw':!![],'where':{}};var _0x5988eb={};var _0x664804={'count':0x0,'rows':[]};return db[_0xd69c('0x3e')][_0xd69c('0x53')]({'where':{'id':_0x542d67[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x41e693,null))[_0xd69c('0x20')](function(_0x43b9b0){if(_0x43b9b0){_0x5988eb[_0xd69c('0x2d')]=_[_0xd69c('0x2f')](db['CmHopper'][_0xd69c('0x2a')]);_0x5988eb[_0xd69c('0x2e')]=_['keys'](_0x542d67[_0xd69c('0x2e')]);_0x5988eb[_0xd69c('0x30')]=_[_0xd69c('0x32')](_0x5988eb[_0xd69c('0x2d')],_0x5988eb[_0xd69c('0x2e')]);_0x512a9f['attributes']=_[_0xd69c('0x32')](_0x5988eb['model'],qs['fields'](_0x542d67[_0xd69c('0x2e')][_0xd69c('0x33')]));_0x512a9f[_0xd69c('0x31')]=_0x512a9f[_0xd69c('0x31')]['length']?_0x512a9f[_0xd69c('0x31')]:_0x5988eb['model'];if(!_0x542d67['query'][_0xd69c('0x35')](_0xd69c('0x54'))){_0x512a9f[_0xd69c('0x1a')]=qs[_0xd69c('0x1a')](_0x542d67[_0xd69c('0x2e')]['limit']);_0x512a9f[_0xd69c('0x1b')]=qs['offset'](_0x542d67['query'][_0xd69c('0x1b')]);}_0x512a9f[_0xd69c('0x36')]=qs[_0xd69c('0x37')](_0x542d67[_0xd69c('0x2e')][_0xd69c('0x37')]);_0x512a9f['where']=qs[_0xd69c('0x30')](_[_0xd69c('0x38')](_0x542d67[_0xd69c('0x2e')],_0x5988eb[_0xd69c('0x30')]));_0x512a9f[_0xd69c('0x3b')][_0xd69c('0x55')]=_0x43b9b0['id'];if(_0x542d67[_0xd69c('0x2e')][_0xd69c('0x39')]){_0x512a9f[_0xd69c('0x3b')]=_[_0xd69c('0x3a')](_0x512a9f[_0xd69c('0x3b')],{'$or':_[_0xd69c('0x29')](_0x512a9f['attributes'],function(_0x1a2e72){var _0x22edd7={};_0x22edd7[_0x1a2e72]={'$like':'%'+_0x542d67[_0xd69c('0x2e')]['filter']+'%'};return _0x22edd7;})});}_0x512a9f=_['merge']({},_0x512a9f,_0x542d67[_0xd69c('0x3d')]);return db['CmHopper']['count']({'where':_0x512a9f[_0xd69c('0x3b')]})['then'](function(_0x570bcc){_0x664804[_0xd69c('0x1c')]=_0x570bcc;if(_0x542d67[_0xd69c('0x2e')][_0xd69c('0x40')]){_0x512a9f[_0xd69c('0x41')]=[{'all':!![]}];}return db[_0xd69c('0x56')][_0xd69c('0x57')](_0x512a9f);})[_0xd69c('0x20')](function(_0x1f7fae){_0x664804[_0xd69c('0x58')]=_0x1f7fae;return _0x664804;});}})[_0xd69c('0x20')](respondWithFilteredResult(_0x41e693,_0x512a9f))[_0xd69c('0x43')](handleError(_0x41e693,null));};exports[_0xd69c('0x59')]=function(_0xfc90a2,_0x1e92e8,_0x4f68c1){var _0x33772a={'raw':!![],'where':{}};var _0x47c39a={};var _0x3a1425={'count':0x0,'rows':[]};return db['Campaign'][_0xd69c('0x53')]({'where':{'id':_0xfc90a2[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x1e92e8,null))['then'](function(_0x1c6629){if(_0x1c6629){_0x47c39a[_0xd69c('0x2d')]=_['keys'](db[_0xd69c('0x5a')][_0xd69c('0x2a')]);_0x47c39a[_0xd69c('0x2e')]=_[_0xd69c('0x2f')](_0xfc90a2['query']);_0x47c39a[_0xd69c('0x30')]=_[_0xd69c('0x32')](_0x47c39a[_0xd69c('0x2d')],_0x47c39a['query']);_0x33772a[_0xd69c('0x31')]=_[_0xd69c('0x32')](_0x47c39a[_0xd69c('0x2d')],qs[_0xd69c('0x33')](_0xfc90a2[_0xd69c('0x2e')]['fields']));_0x33772a['attributes']=_0x33772a[_0xd69c('0x31')]['length']?_0x33772a[_0xd69c('0x31')]:_0x47c39a[_0xd69c('0x2d')];if(!_0xfc90a2[_0xd69c('0x2e')][_0xd69c('0x35')](_0xd69c('0x54'))){_0x33772a['limit']=qs[_0xd69c('0x1a')](_0xfc90a2[_0xd69c('0x2e')][_0xd69c('0x1a')]);_0x33772a[_0xd69c('0x1b')]=qs[_0xd69c('0x1b')](_0xfc90a2[_0xd69c('0x2e')][_0xd69c('0x1b')]);}_0x33772a[_0xd69c('0x36')]=qs[_0xd69c('0x37')](_0xfc90a2['query']['sort']);_0x33772a[_0xd69c('0x3b')]=qs['filters'](_[_0xd69c('0x38')](_0xfc90a2[_0xd69c('0x2e')],_0x47c39a[_0xd69c('0x30')]));_0x33772a[_0xd69c('0x3b')]['CampaignId']=_0x1c6629['id'];if(_0xfc90a2[_0xd69c('0x2e')]['filter']){_0x33772a[_0xd69c('0x3b')]=_[_0xd69c('0x3a')](_0x33772a['where'],{'$or':_[_0xd69c('0x29')](_0x33772a[_0xd69c('0x31')],function(_0x1013bd){var _0x1aa5a3={};_0x1aa5a3[_0x1013bd]={'$like':'%'+_0xfc90a2[_0xd69c('0x2e')][_0xd69c('0x39')]+'%'};return _0x1aa5a3;})});}_0x33772a=_[_0xd69c('0x3a')]({},_0x33772a,_0xfc90a2[_0xd69c('0x3d')]);return db[_0xd69c('0x5a')][_0xd69c('0x1c')]({'where':_0x33772a['where']})[_0xd69c('0x20')](function(_0x4d63e4){_0x3a1425[_0xd69c('0x1c')]=_0x4d63e4;if(_0xfc90a2[_0xd69c('0x2e')][_0xd69c('0x40')]){_0x33772a[_0xd69c('0x41')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x33772a);})['then'](function(_0x390462){_0x3a1425[_0xd69c('0x58')]=_0x390462;return _0x3a1425;});}})[_0xd69c('0x20')](respondWithFilteredResult(_0x1e92e8,_0x33772a))[_0xd69c('0x43')](handleError(_0x1e92e8,null));};exports[_0xd69c('0x5b')]=function(_0x38eedb,_0x3608cb,_0x588217){var _0x5a2c14={'raw':!![],'where':{}};var _0x2a3bc1={};var _0xe519e7={'count':0x0,'rows':[]};return db[_0xd69c('0x3e')][_0xd69c('0x53')]({'where':{'id':_0x38eedb[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x3608cb,null))[_0xd69c('0x20')](function(_0x1a0626){if(_0x1a0626){_0x2a3bc1[_0xd69c('0x2d')]=_[_0xd69c('0x2f')](db[_0xd69c('0x5c')][_0xd69c('0x2a')]);_0x2a3bc1[_0xd69c('0x2e')]=_['keys'](_0x38eedb[_0xd69c('0x2e')]);_0x2a3bc1[_0xd69c('0x30')]=_['intersection'](_0x2a3bc1[_0xd69c('0x2d')],_0x2a3bc1[_0xd69c('0x2e')]);_0x5a2c14['attributes']=_[_0xd69c('0x32')](_0x2a3bc1[_0xd69c('0x2d')],qs[_0xd69c('0x33')](_0x38eedb['query'][_0xd69c('0x33')]));_0x5a2c14['attributes']=_0x5a2c14[_0xd69c('0x31')][_0xd69c('0x34')]?_0x5a2c14[_0xd69c('0x31')]:_0x2a3bc1[_0xd69c('0x2d')];if(!_0x38eedb[_0xd69c('0x2e')][_0xd69c('0x35')]('nolimit')){_0x5a2c14[_0xd69c('0x1a')]=qs[_0xd69c('0x1a')](_0x38eedb[_0xd69c('0x2e')]['limit']);_0x5a2c14[_0xd69c('0x1b')]=qs[_0xd69c('0x1b')](_0x38eedb[_0xd69c('0x2e')][_0xd69c('0x1b')]);}_0x5a2c14['order']=qs['sort'](_0x38eedb[_0xd69c('0x2e')][_0xd69c('0x37')]);_0x5a2c14[_0xd69c('0x3b')]=qs[_0xd69c('0x30')](_['pick'](_0x38eedb['query'],_0x2a3bc1[_0xd69c('0x30')]));_0x5a2c14[_0xd69c('0x3b')][_0xd69c('0x55')]=_0x1a0626['id'];if(_0x38eedb[_0xd69c('0x2e')]['filter']){_0x5a2c14[_0xd69c('0x3b')]=_[_0xd69c('0x3a')](_0x5a2c14[_0xd69c('0x3b')],{'$or':_[_0xd69c('0x29')](_0x5a2c14[_0xd69c('0x31')],function(_0x79c2ef){var _0x18f393={};_0x18f393[_0x79c2ef]={'$like':'%'+_0x38eedb['query'][_0xd69c('0x39')]+'%'};return _0x18f393;})});}_0x5a2c14=_['merge']({},_0x5a2c14,_0x38eedb[_0xd69c('0x3d')]);return db[_0xd69c('0x5c')][_0xd69c('0x1c')]({'where':_0x5a2c14[_0xd69c('0x3b')]})[_0xd69c('0x20')](function(_0xf15126){_0xe519e7[_0xd69c('0x1c')]=_0xf15126;if(_0x38eedb[_0xd69c('0x2e')]['includeAll']){_0x5a2c14[_0xd69c('0x41')]=[{'all':!![]}];}return db[_0xd69c('0x5c')][_0xd69c('0x57')](_0x5a2c14);})[_0xd69c('0x20')](function(_0x1723eb){_0xe519e7[_0xd69c('0x58')]=_0x1723eb;return _0xe519e7;});}})[_0xd69c('0x20')](respondWithFilteredResult(_0x3608cb,_0x5a2c14))[_0xd69c('0x43')](handleError(_0x3608cb,null));};exports[_0xd69c('0x5d')]=function(_0x27db0a,_0x3e3bb3,_0x509b17){var _0xde2c6c={'raw':!![],'where':{}};var _0x54e5a4={};var _0xb2a30f={'count':0x0,'rows':[]};return db[_0xd69c('0x3e')][_0xd69c('0x53')]({'where':{'id':_0x27db0a[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x3e3bb3,null))[_0xd69c('0x20')](function(_0x411518){if(_0x411518){_0x54e5a4[_0xd69c('0x2d')]=_[_0xd69c('0x2f')](db[_0xd69c('0x5e')][_0xd69c('0x2a')]);_0x54e5a4['query']=_[_0xd69c('0x2f')](_0x27db0a[_0xd69c('0x2e')]);_0x54e5a4[_0xd69c('0x30')]=_['intersection'](_0x54e5a4[_0xd69c('0x2d')],_0x54e5a4[_0xd69c('0x2e')]);_0xde2c6c[_0xd69c('0x31')]=_[_0xd69c('0x32')](_0x54e5a4[_0xd69c('0x2d')],qs['fields'](_0x27db0a[_0xd69c('0x2e')][_0xd69c('0x33')]));_0xde2c6c['attributes']=_0xde2c6c['attributes'][_0xd69c('0x34')]?_0xde2c6c[_0xd69c('0x31')]:_0x54e5a4[_0xd69c('0x2d')];if(!_0x27db0a[_0xd69c('0x2e')][_0xd69c('0x35')]('nolimit')){_0xde2c6c[_0xd69c('0x1a')]=qs[_0xd69c('0x1a')](_0x27db0a[_0xd69c('0x2e')][_0xd69c('0x1a')]);_0xde2c6c[_0xd69c('0x1b')]=qs['offset'](_0x27db0a['query'][_0xd69c('0x1b')]);}_0xde2c6c[_0xd69c('0x36')]=qs[_0xd69c('0x37')](_0x27db0a[_0xd69c('0x2e')]['sort']);_0xde2c6c[_0xd69c('0x3b')]=qs[_0xd69c('0x30')](_[_0xd69c('0x38')](_0x27db0a['query'],_0x54e5a4[_0xd69c('0x30')]));_0xde2c6c[_0xd69c('0x3b')][_0xd69c('0x55')]=_0x411518['id'];if(_0x27db0a[_0xd69c('0x2e')][_0xd69c('0x39')]){_0xde2c6c[_0xd69c('0x3b')]=_[_0xd69c('0x3a')](_0xde2c6c[_0xd69c('0x3b')],{'$or':_[_0xd69c('0x29')](_0xde2c6c[_0xd69c('0x31')],function(_0x317668){var _0x24967b={};_0x24967b[_0x317668]={'$like':'%'+_0x27db0a['query']['filter']+'%'};return _0x24967b;})});}_0xde2c6c=_['merge']({},_0xde2c6c,_0x27db0a[_0xd69c('0x3d')]);return db[_0xd69c('0x5e')][_0xd69c('0x1c')]({'where':_0xde2c6c[_0xd69c('0x3b')]})[_0xd69c('0x20')](function(_0x3e0652){_0xb2a30f[_0xd69c('0x1c')]=_0x3e0652;if(_0x27db0a[_0xd69c('0x2e')][_0xd69c('0x40')]){_0xde2c6c[_0xd69c('0x41')]=[{'all':!![]}];}return db[_0xd69c('0x5e')][_0xd69c('0x57')](_0xde2c6c);})[_0xd69c('0x20')](function(_0x4c6c0a){_0xb2a30f['rows']=_0x4c6c0a;return _0xb2a30f;});}})[_0xd69c('0x20')](respondWithFilteredResult(_0x3e3bb3,_0xde2c6c))[_0xd69c('0x43')](handleError(_0x3e3bb3,null));};exports[_0xd69c('0x5f')]=function(_0x4da491,_0x40db1f,_0x36c402){var _0x2bc95b={};var _0x2558ad={};var _0x4e57f2;var _0x343204;return db[_0xd69c('0x3e')][_0xd69c('0x53')]({'where':{'id':_0x4da491[_0xd69c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x40db1f,null))[_0xd69c('0x20')](function(_0x77edbe){if(_0x77edbe){_0x4e57f2=_0x77edbe;_0x2558ad[_0xd69c('0x2d')]=_['keys'](db[_0xd69c('0x60')][_0xd69c('0x2a')]);_0x2558ad[_0xd69c('0x2e')]=_[_0xd69c('0x2f')](_0x4da491[_0xd69c('0x2e')]);_0x2558ad[_0xd69c('0x30')]=_['intersection'](_0x2558ad[_0xd69c('0x2d')],_0x2558ad[_0xd69c('0x2e')]);_0x2bc95b['attributes']=_['intersection'](_0x2558ad[_0xd69c('0x2d')],qs[_0xd69c('0x33')](_0x4da491[_0xd69c('0x2e')][_0xd69c('0x33')]));_0x2bc95b[_0xd69c('0x31')]=_0x2bc95b[_0xd69c('0x31')]['length']?_0x2bc95b[_0xd69c('0x31')]:_0x2558ad[_0xd69c('0x2d')];_0x2bc95b[_0xd69c('0x36')]=qs['sort'](_0x4da491[_0xd69c('0x2e')][_0xd69c('0x37')]);_0x2bc95b[_0xd69c('0x3b')]=qs[_0xd69c('0x30')](_[_0xd69c('0x38')](_0x4da491[_0xd69c('0x2e')],_0x2558ad[_0xd69c('0x30')]));if(_0x4da491[_0xd69c('0x2e')][_0xd69c('0x39')]){_0x2bc95b[_0xd69c('0x3b')]=_['merge'](_0x2bc95b['where'],{'$or':_[_0xd69c('0x29')](_0x2bc95b[_0xd69c('0x31')],function(_0x5c0ade){var _0x1c33f1={};_0x1c33f1[_0x5c0ade]={'$like':'%'+_0x4da491['query'][_0xd69c('0x39')]+'%'};return _0x1c33f1;})});}_0x2bc95b=_[_0xd69c('0x3a')]({},_0x2bc95b,_0x4da491[_0xd69c('0x3d')]);return _0x4e57f2['getLists'](_0x2bc95b);}})[_0xd69c('0x20')](function(_0x502c50){if(_0x502c50){_0x343204=_0x502c50['length'];if(!_0x4da491[_0xd69c('0x2e')][_0xd69c('0x35')](_0xd69c('0x54'))){_0x2bc95b[_0xd69c('0x1a')]=qs[_0xd69c('0x1a')](_0x4da491[_0xd69c('0x2e')][_0xd69c('0x1a')]);_0x2bc95b[_0xd69c('0x1b')]=qs[_0xd69c('0x1b')](_0x4da491[_0xd69c('0x2e')]['offset']);}return _0x4e57f2[_0xd69c('0x5f')](_0x2bc95b);}})[_0xd69c('0x20')](function(_0x39606f){if(_0x39606f){return _0x39606f?{'count':_0x343204,'rows':_0x39606f}:null;}})[_0xd69c('0x20')](respondWithResult(_0x40db1f,null))[_0xd69c('0x43')](handleError(_0x40db1f,null));};exports[_0xd69c('0x61')]=function(_0x3064f7,_0x1b45e4,_0x192b9b){var _0x307bd4,_0x2ef17e;return db['Campaign'][_0xd69c('0x42')]({'where':{'id':_0x3064f7[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x1b45e4,null))['then'](function(_0x3eab92){if(_0x3eab92){_0x2ef17e=_0x3eab92;return _0x3eab92[_0xd69c('0x61')](_0x3064f7[_0xd69c('0x45')][_0xd69c('0x62')],_[_0xd69c('0x4e')](_0x3064f7[_0xd69c('0x45')],[_0xd69c('0x62'),'id'])||{});}return null;})[_0xd69c('0x63')](function(_0xb5bbc){var _0x289892;_0x307bd4=_0xb5bbc||[];var _0x1b7104=[];if(_0xb5bbc){for(var _0x50d10a=0x0;_0x50d10a<_0xb5bbc[_0xd69c('0x34')];_0x50d10a+=0x1){var _0x30ef82=_0xb5bbc[_0x50d10a]['get']({'plain':!![]});_0x2ef17e[_0xd69c('0x64')]=_0x3064f7[_0xd69c('0x45')][_0xd69c('0x64')]?_0x3064f7[_0xd69c('0x45')]['dialCheckDuplicateType']:_0x2ef17e[_0xd69c('0x64')];switch(_0x2ef17e[_0xd69c('0x64')]){case'always':_0x289892=squel[_0xd69c('0x65')]()[_0xd69c('0x66')](_0xd69c('0x67'))[_0xd69c('0x68')]([_0xd69c('0x69'),_0xd69c('0x6a'),_0xd69c('0x6b'),_0xd69c('0x6c'),_0xd69c('0x55'),_0xd69c('0x4f'),_0xd69c('0x50')],squel[_0xd69c('0x6d')]()['field'](_0xd69c('0x69'),_0xd69c('0x69'))[_0xd69c('0x6e')]('NOW()',_0xd69c('0x6a'))[_0xd69c('0x6e')]('id','ContactId')[_0xd69c('0x6e')](_0x30ef82[_0xd69c('0x6f')][_0xd69c('0x70')](),_0xd69c('0x6c'))['field'](_0x3064f7['params']['id'][_0xd69c('0x70')](),_0xd69c('0x55'))[_0xd69c('0x6e')](_0xd69c('0x71'),_0xd69c('0x4f'))[_0xd69c('0x6e')]('NOW()',_0xd69c('0x50'))[_0xd69c('0x72')](_0xd69c('0x73'))[_0xd69c('0x3b')](_0xd69c('0x74'))['where'](_0xd69c('0x75'),_0x30ef82[_0xd69c('0x6f')]['toString']())[_0xd69c('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0xd69c('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd69c('0x6d')]()[_0xd69c('0x6e')](_0xd69c('0x76'))[_0xd69c('0x72')](_0xd69c('0x77'))[_0xd69c('0x3b')](_0xd69c('0x78'),_0x3064f7[_0xd69c('0x3f')]['id'][_0xd69c('0x70')]()))[_0xd69c('0x3b')](_0xd69c('0x79'),squel[_0xd69c('0x6d')]()['field'](_0xd69c('0x7a'))[_0xd69c('0x72')](_0xd69c('0x67'))[_0xd69c('0x3b')](_0xd69c('0x78'),_0x3064f7[_0xd69c('0x3f')]['id'][_0xd69c('0x70')]())))[_0xd69c('0x70')]();break;case _0xd69c('0x7b'):_0x289892=squel['insert']()[_0xd69c('0x66')]('cm_hopper')[_0xd69c('0x68')]([_0xd69c('0x69'),'scheduledAt','ContactId',_0xd69c('0x6c'),_0xd69c('0x55'),_0xd69c('0x4f'),'updatedAt'],squel[_0xd69c('0x6d')]()[_0xd69c('0x6e')](_0xd69c('0x69'),_0xd69c('0x69'))[_0xd69c('0x6e')]('NOW()',_0xd69c('0x6a'))['field']('id',_0xd69c('0x6b'))[_0xd69c('0x6e')](_0x30ef82[_0xd69c('0x6f')][_0xd69c('0x70')](),_0xd69c('0x6c'))[_0xd69c('0x6e')](_0x3064f7[_0xd69c('0x3f')]['id']['toString'](),_0xd69c('0x55'))[_0xd69c('0x6e')]('NOW()',_0xd69c('0x4f'))['field'](_0xd69c('0x71'),_0xd69c('0x50'))[_0xd69c('0x72')](_0xd69c('0x73'))[_0xd69c('0x3b')](_0xd69c('0x74'))[_0xd69c('0x3b')]('ListId\x20=\x20?',_0x30ef82[_0xd69c('0x6f')][_0xd69c('0x70')]())['where'](_0xd69c('0x7c'))[_0xd69c('0x3b')](_0xd69c('0x79'),squel[_0xd69c('0x6d')]()[_0xd69c('0x6e')](_0xd69c('0x7a'))[_0xd69c('0x72')](_0xd69c('0x67'))[_0xd69c('0x3b')]('CampaignId\x20=\x20?',_0x3064f7[_0xd69c('0x3f')]['id'][_0xd69c('0x70')]())))['toString']();break;default:_0x289892=squel['insert']()[_0xd69c('0x66')]('cm_hopper')[_0xd69c('0x68')]([_0xd69c('0x69'),_0xd69c('0x6a'),_0xd69c('0x6b'),_0xd69c('0x6c'),_0xd69c('0x55'),'createdAt',_0xd69c('0x50')],squel[_0xd69c('0x6d')]()['field'](_0xd69c('0x69'),_0xd69c('0x69'))['field'](_0xd69c('0x71'),_0xd69c('0x6a'))[_0xd69c('0x6e')]('id',_0xd69c('0x6b'))[_0xd69c('0x6e')](_0x30ef82[_0xd69c('0x6f')]['toString'](),_0xd69c('0x6c'))['field'](_0x3064f7[_0xd69c('0x3f')]['id'][_0xd69c('0x70')](),_0xd69c('0x55'))[_0xd69c('0x6e')](_0xd69c('0x71'),_0xd69c('0x4f'))[_0xd69c('0x6e')](_0xd69c('0x71'),_0xd69c('0x50'))['from'](_0xd69c('0x73'))['where'](_0xd69c('0x74'))['where'](_0xd69c('0x75'),_0x30ef82[_0xd69c('0x6f')][_0xd69c('0x70')]())[_0xd69c('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0xd69c('0x70')]();}_0x1b7104[_0xd69c('0x7d')](db[_0xd69c('0x7e')][_0xd69c('0x2e')](_0x289892));}return BPromise[_0xd69c('0x7f')](_0x1b7104);}})[_0xd69c('0x20')](function(){return _0x307bd4;})[_0xd69c('0x20')](respondWithResult(_0x1b45e4,null))[_0xd69c('0x43')](handleError(_0x1b45e4,null));};exports[_0xd69c('0x80')]=function(_0x59887c,_0x4adfe2,_0x5b5cf7){return db['Campaign']['find']({'where':{'id':_0x59887c[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x4adfe2,null))['then'](function(_0x32c695){if(_0x32c695){return _0x32c695[_0xd69c('0x80')](_0x59887c['query'][_0xd69c('0x62')]);}})[_0xd69c('0x20')](function(_0x1c0841){if(_0x1c0841){return db['CmHopper'][_0xd69c('0x21')]({'where':{'ListId':_0x59887c[_0xd69c('0x2e')][_0xd69c('0x62')],'CampaignId':_0x59887c[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](function(){return _0x1c0841;});}})['then'](respondWithStatusCode(_0x4adfe2,null))[_0xd69c('0x43')](handleError(_0x4adfe2,null));};exports[_0xd69c('0x81')]=function(_0x29fc1a,_0xf350a8,_0x3d0cbd){var _0x2bbeaa={};var _0x19832b={};var _0x3b841f;var _0x49ccb3;return db[_0xd69c('0x3e')][_0xd69c('0x53')]({'where':{'id':_0x29fc1a['params']['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0xf350a8,null))[_0xd69c('0x20')](function(_0x4565de){if(_0x4565de){_0x3b841f=_0x4565de;_0x19832b[_0xd69c('0x2d')]=_[_0xd69c('0x2f')](db['CmList'][_0xd69c('0x2a')]);_0x19832b[_0xd69c('0x2e')]=_[_0xd69c('0x2f')](_0x29fc1a['query']);_0x19832b[_0xd69c('0x30')]=_[_0xd69c('0x32')](_0x19832b['model'],_0x19832b[_0xd69c('0x2e')]);_0x2bbeaa[_0xd69c('0x31')]=_[_0xd69c('0x32')](_0x19832b['model'],qs[_0xd69c('0x33')](_0x29fc1a[_0xd69c('0x2e')][_0xd69c('0x33')]));_0x2bbeaa[_0xd69c('0x31')]=_0x2bbeaa[_0xd69c('0x31')]['length']?_0x2bbeaa['attributes']:_0x19832b[_0xd69c('0x2d')];_0x2bbeaa[_0xd69c('0x36')]=qs[_0xd69c('0x37')](_0x29fc1a[_0xd69c('0x2e')]['sort']);_0x2bbeaa['where']=qs[_0xd69c('0x30')](_[_0xd69c('0x38')](_0x29fc1a[_0xd69c('0x2e')],_0x19832b[_0xd69c('0x30')]));if(_0x29fc1a[_0xd69c('0x2e')][_0xd69c('0x39')]){_0x2bbeaa['where']=_[_0xd69c('0x3a')](_0x2bbeaa[_0xd69c('0x3b')],{'$or':_['map'](_0x2bbeaa['attributes'],function(_0x268edf){var _0x208e25={};_0x208e25[_0x268edf]={'$like':'%'+_0x29fc1a[_0xd69c('0x2e')][_0xd69c('0x39')]+'%'};return _0x208e25;})});}_0x2bbeaa=_[_0xd69c('0x3a')]({},_0x2bbeaa,_0x29fc1a[_0xd69c('0x3d')]);return _0x3b841f[_0xd69c('0x81')](_0x2bbeaa);}})['then'](function(_0x169b9f){if(_0x169b9f){_0x49ccb3=_0x169b9f[_0xd69c('0x34')];if(!_0x29fc1a[_0xd69c('0x2e')][_0xd69c('0x35')](_0xd69c('0x54'))){_0x2bbeaa[_0xd69c('0x1a')]=qs[_0xd69c('0x1a')](_0x29fc1a['query'][_0xd69c('0x1a')]);_0x2bbeaa[_0xd69c('0x1b')]=qs[_0xd69c('0x1b')](_0x29fc1a[_0xd69c('0x2e')][_0xd69c('0x1b')]);}return _0x3b841f[_0xd69c('0x81')](_0x2bbeaa);}})[_0xd69c('0x20')](function(_0x1f4f7f){if(_0x1f4f7f){return _0x1f4f7f?{'count':_0x49ccb3,'rows':_0x1f4f7f}:null;}})[_0xd69c('0x20')](respondWithResult(_0xf350a8,null))[_0xd69c('0x43')](handleError(_0xf350a8,null));};exports[_0xd69c('0x82')]=function(_0x3c5571,_0x2fa41e,_0x5ebf7b){var _0x5a6f77,_0x940df9;return db['Campaign'][_0xd69c('0x42')]({'where':{'id':_0x3c5571[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x2fa41e,null))[_0xd69c('0x20')](function(_0x267b8e){if(_0x267b8e){_0x940df9=_0x267b8e;return _0x267b8e[_0xd69c('0x82')](_0x3c5571[_0xd69c('0x45')][_0xd69c('0x62')],_[_0xd69c('0x4e')](_0x3c5571[_0xd69c('0x45')],[_0xd69c('0x62'),'id'])||{});}return null;})['spread'](function(_0x121be9){var _0xb9f4e2;_0x5a6f77=_0x121be9||[];var _0x4f6868=[];if(_0x121be9){for(var _0x36debc=0x0;_0x36debc<_0x121be9['length'];_0x36debc+=0x1){var _0xcdbfd3=_0x121be9[_0x36debc][_0xd69c('0x22')]({'plain':!![]});_0xb9f4e2=squel['insert']()[_0xd69c('0x66')](_0xd69c('0x83'))[_0xd69c('0x68')]([_0xd69c('0x69'),_0xd69c('0x6b'),_0xd69c('0x6c'),_0xd69c('0x55'),_0xd69c('0x4f'),_0xd69c('0x50')],squel[_0xd69c('0x6d')]()[_0xd69c('0x6e')](_0xd69c('0x69'),_0xd69c('0x69'))[_0xd69c('0x6e')]('id',_0xd69c('0x6b'))[_0xd69c('0x6e')](_0xcdbfd3['CmListId']['toString'](),_0xd69c('0x6c'))[_0xd69c('0x6e')](_0x3c5571['params']['id'][_0xd69c('0x70')](),_0xd69c('0x55'))[_0xd69c('0x6e')](_0xd69c('0x71'),'createdAt')['field'](_0xd69c('0x71'),'updatedAt')[_0xd69c('0x72')](_0xd69c('0x73'))[_0xd69c('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0xd69c('0x75'),_0xcdbfd3[_0xd69c('0x6f')][_0xd69c('0x70')]())[_0xd69c('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x4f6868[_0xd69c('0x7d')](db['sequelize']['query'](_0xb9f4e2));}return BPromise[_0xd69c('0x7f')](_0x4f6868);}})[_0xd69c('0x20')](function(){return _0x5a6f77;})['then'](respondWithResult(_0x2fa41e,null))['catch'](handleError(_0x2fa41e,null));};exports['removeBlackLists']=function(_0x9ace3c,_0x1985aa,_0x7fba43){return db[_0xd69c('0x3e')][_0xd69c('0x42')]({'where':{'id':_0x9ace3c[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](handleEntityNotFound(_0x1985aa,null))['then'](function(_0x143376){if(_0x143376){return _0x143376[_0xd69c('0x84')](_0x9ace3c[_0xd69c('0x2e')][_0xd69c('0x62')]);}})['then'](function(_0x252189){if(_0x252189){return db[_0xd69c('0x5e')][_0xd69c('0x21')]({'where':{'ListId':_0x9ace3c[_0xd69c('0x2e')][_0xd69c('0x62')],'CampaignId':_0x9ace3c[_0xd69c('0x3f')]['id']}})[_0xd69c('0x20')](function(){return _0x252189;});}})[_0xd69c('0x20')](respondWithStatusCode(_0x1985aa,null))[_0xd69c('0x43')](handleError(_0x1985aa,null));};
\ No newline at end of file
+var _0x0cef=['moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','IvrCampaigns','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','Campaign','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','update','getHoppers','findOne','CmHopper','hasOwnProperty','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','addLists','ids','omit','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ListId','select','NOW()','field','ContactId','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','fromQuery','deletedAt\x20IS\x20NULL','sequelize','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','request-promise'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x0cef,0x18c));var _0xf0ce=function(_0x329fac,_0x43b216){_0x329fac=_0x329fac-0x0;var _0x42b353=_0x0cef[_0x329fac];return _0x42b353;};'use strict';var emlformat=require(_0xf0ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ce('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0ce('0x2'));var moment=require(_0xf0ce('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0ce('0x4'));var util=require(_0xf0ce('0x5'));var path=require('path');var sox=require(_0xf0ce('0x6'));var csv=require(_0xf0ce('0x7'));var ejs=require(_0xf0ce('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ce('0x9'));var _=require('lodash');var squel=require(_0xf0ce('0xa'));var crypto=require(_0xf0ce('0xb'));var jsforce=require(_0xf0ce('0xc'));var deskjs=require(_0xf0ce('0xd'));var toCsv=require(_0xf0ce('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ce('0xe'));var Redis=require(_0xf0ce('0xf'));var authService=require(_0xf0ce('0x10'));var qs=require(_0xf0ce('0x11'));var as=require(_0xf0ce('0x12'));var hardwareService=require(_0xf0ce('0x13'));var logger=require(_0xf0ce('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf0ce('0x15'));var licenseUtil=require(_0xf0ce('0x16'));var db=require(_0xf0ce('0x17'))['db'];function respondWithStatusCode(_0x4c601e,_0x181a73){_0x181a73=_0x181a73||0xcc;return function(_0x480cf0){if(_0x480cf0){return _0x4c601e[_0xf0ce('0x18')](_0x181a73);}return _0x4c601e[_0xf0ce('0x19')](_0x181a73)['end']();};}function respondWithResult(_0x49ea92,_0x309918){_0x309918=_0x309918||0xc8;return function(_0xa3c5e0){if(_0xa3c5e0){return _0x49ea92[_0xf0ce('0x19')](_0x309918)[_0xf0ce('0x1a')](_0xa3c5e0);}};}function respondWithFilteredResult(_0x2b9a83,_0x238af2){return function(_0x3b383a){if(_0x3b383a){var _0x5a4a55=typeof _0x238af2[_0xf0ce('0x1b')]===_0xf0ce('0x1c')&&typeof _0x238af2[_0xf0ce('0x1d')]===_0xf0ce('0x1c');var _0x5751f4=_0x3b383a[_0xf0ce('0x1e')];var _0x19d346=_0x5a4a55?0x0:_0x238af2[_0xf0ce('0x1b')];var _0xa9e0f6=_0x5a4a55?_0x3b383a[_0xf0ce('0x1e')]:_0x238af2[_0xf0ce('0x1b')]+_0x238af2['limit'];var _0x2fea94;if(_0xa9e0f6>=_0x5751f4){_0xa9e0f6=_0x5751f4;_0x2fea94=0xc8;}else{_0x2fea94=0xce;}_0x2b9a83[_0xf0ce('0x19')](_0x2fea94);return _0x2b9a83[_0xf0ce('0x1f')]('Content-Range',_0x19d346+'-'+_0xa9e0f6+'/'+_0x5751f4)[_0xf0ce('0x1a')](_0x3b383a);}return null;};}function patchUpdates(_0x25dcad){return function(_0x311e65){try{jsonpatch[_0xf0ce('0x20')](_0x311e65,_0x25dcad,!![]);}catch(_0x47a4e3){return BPromise[_0xf0ce('0x21')](_0x47a4e3);}return _0x311e65[_0xf0ce('0x22')]();};}function saveUpdates(_0x31016c,_0x33c75c){return function(_0x46314b){if(_0x46314b){return _0x46314b['update'](_0x31016c)[_0xf0ce('0x23')](function(_0x3fb6f7){return _0x3fb6f7;});}return null;};}function removeEntity(_0x3b4af7,_0x41fe71){return function(_0xa0d91){if(_0xa0d91){return _0xa0d91[_0xf0ce('0x24')]()[_0xf0ce('0x23')](function(){var _0x4753d4=_0xa0d91['get']({'plain':!![]});var _0x85647=_0xf0ce('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x85647,'resourceId':_0x4753d4['id']}})['then'](function(){return _0xa0d91;});})[_0xf0ce('0x23')](function(){_0x3b4af7[_0xf0ce('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12fe8d,_0xedb5d2){return function(_0x49170f){if(!_0x49170f){_0x12fe8d['sendStatus'](0x194);}return _0x49170f;};}function handleError(_0x295a4d,_0x3a8a35){_0x3a8a35=_0x3a8a35||0x1f4;return function(_0x1e5c55){logger['error'](_0x1e5c55['stack']);if(_0x1e5c55[_0xf0ce('0x26')]){delete _0x1e5c55[_0xf0ce('0x26')];}_0x295a4d[_0xf0ce('0x19')](_0x3a8a35)[_0xf0ce('0x27')](_0x1e5c55);};}exports['index']=function(_0x50ed91,_0x8aeb90){var _0x462697={},_0x28889d={},_0x436700={'count':0x0,'rows':[]};var _0x350d90=_[_0xf0ce('0x28')](db['Campaign'][_0xf0ce('0x29')],function(_0x3baa92){return{'name':_0x3baa92[_0xf0ce('0x2a')],'type':_0x3baa92[_0xf0ce('0x2b')]['key']};});_0x28889d['model']=_[_0xf0ce('0x28')](_0x350d90,_0xf0ce('0x26'));_0x28889d[_0xf0ce('0x2c')]=_[_0xf0ce('0x2d')](_0x50ed91[_0xf0ce('0x2c')]);_0x28889d[_0xf0ce('0x2e')]=_[_0xf0ce('0x2f')](_0x28889d[_0xf0ce('0x30')],_0x28889d[_0xf0ce('0x2c')]);_0x462697[_0xf0ce('0x31')]=_[_0xf0ce('0x2f')](_0x28889d['model'],qs['fields'](_0x50ed91['query'][_0xf0ce('0x32')]));_0x462697['attributes']=_0x462697[_0xf0ce('0x31')][_0xf0ce('0x33')]?_0x462697[_0xf0ce('0x31')]:_0x28889d['model'];if(!_0x50ed91[_0xf0ce('0x2c')]['hasOwnProperty'](_0xf0ce('0x34'))){_0x462697['limit']=qs[_0xf0ce('0x1d')](_0x50ed91[_0xf0ce('0x2c')][_0xf0ce('0x1d')]);_0x462697[_0xf0ce('0x1b')]=qs[_0xf0ce('0x1b')](_0x50ed91['query'][_0xf0ce('0x1b')]);}_0x462697[_0xf0ce('0x35')]=qs['sort'](_0x50ed91['query'][_0xf0ce('0x36')]);_0x462697[_0xf0ce('0x37')]=qs[_0xf0ce('0x2e')](_[_0xf0ce('0x38')](_0x50ed91[_0xf0ce('0x2c')],_0x28889d[_0xf0ce('0x2e')]),_0x350d90);if(_0x50ed91['query'][_0xf0ce('0x39')]){_0x462697[_0xf0ce('0x37')]=_[_0xf0ce('0x3a')](_0x462697['where'],{'$or':_[_0xf0ce('0x28')](_0x350d90,function(_0x3a8937){if(_0x3a8937[_0xf0ce('0x2b')]!=='VIRTUAL'){var _0x12e76a={};_0x12e76a[_0x3a8937[_0xf0ce('0x26')]]={'$like':'%'+_0x50ed91[_0xf0ce('0x2c')][_0xf0ce('0x39')]+'%'};return _0x12e76a;}})});}_0x462697=_['merge']({},_0x462697,_0x50ed91[_0xf0ce('0x3b')]);var _0x3883d5={'where':_0x462697[_0xf0ce('0x37')]};return db[_0xf0ce('0x3c')][_0xf0ce('0x1e')](_0x3883d5)[_0xf0ce('0x23')](function(_0x23a7e6){_0x436700[_0xf0ce('0x1e')]=_0x23a7e6;if(_0x50ed91[_0xf0ce('0x2c')][_0xf0ce('0x3d')]){_0x462697[_0xf0ce('0x3e')]=[{'all':!![]}];}return db[_0xf0ce('0x3c')][_0xf0ce('0x3f')](_0x462697);})['then'](function(_0x56d459){_0x436700[_0xf0ce('0x40')]=_0x56d459;return _0x436700;})[_0xf0ce('0x23')](respondWithFilteredResult(_0x8aeb90,_0x462697))[_0xf0ce('0x41')](handleError(_0x8aeb90,null));};exports['show']=function(_0x279637,_0x56a579){var _0x4faeef={'raw':![],'where':{'id':_0x279637[_0xf0ce('0x42')]['id']}},_0x2a4c81={};_0x2a4c81[_0xf0ce('0x30')]=_[_0xf0ce('0x2d')](db[_0xf0ce('0x3c')][_0xf0ce('0x29')]);_0x2a4c81[_0xf0ce('0x2c')]=_[_0xf0ce('0x2d')](_0x279637['query']);_0x2a4c81[_0xf0ce('0x2e')]=_[_0xf0ce('0x2f')](_0x2a4c81[_0xf0ce('0x30')],_0x2a4c81[_0xf0ce('0x2c')]);_0x4faeef[_0xf0ce('0x31')]=_[_0xf0ce('0x2f')](_0x2a4c81[_0xf0ce('0x30')],qs[_0xf0ce('0x32')](_0x279637[_0xf0ce('0x2c')][_0xf0ce('0x32')]));_0x4faeef[_0xf0ce('0x31')]=_0x4faeef['attributes']['length']?_0x4faeef[_0xf0ce('0x31')]:_0x2a4c81[_0xf0ce('0x30')];if(_0x279637['query'][_0xf0ce('0x3d')]){_0x4faeef[_0xf0ce('0x3e')]=[{'all':!![]}];}_0x4faeef=_[_0xf0ce('0x3a')]({},_0x4faeef,_0x279637['options']);return db[_0xf0ce('0x3c')][_0xf0ce('0x43')](_0x4faeef)[_0xf0ce('0x23')](handleEntityNotFound(_0x56a579,null))[_0xf0ce('0x23')](respondWithResult(_0x56a579,null))[_0xf0ce('0x41')](handleError(_0x56a579,null));};exports[_0xf0ce('0x44')]=function(_0xbbe2d6,_0x200aef){return db[_0xf0ce('0x3c')][_0xf0ce('0x44')](_0xbbe2d6[_0xf0ce('0x45')],{})['then'](function(_0xe6a51e){var _0x17ce38=_0xbbe2d6[_0xf0ce('0x46')]['get']({'plain':!![]});if(!_0x17ce38)throw new Error(_0xf0ce('0x47'));if(_0x17ce38[_0xf0ce('0x48')]==='user'){var _0x57c51e=_0xe6a51e[_0xf0ce('0x49')]({'plain':!![]});var _0x2c5a10=_0xf0ce('0x25');return db[_0xf0ce('0x4a')]['find']({'where':{'name':_0x2c5a10,'userProfileId':_0x17ce38[_0xf0ce('0x4b')]},'raw':!![]})[_0xf0ce('0x23')](function(_0x295196){if(_0x295196&&_0x295196[_0xf0ce('0x4c')]===0x0){return db[_0xf0ce('0x4d')]['create']({'name':_0x57c51e[_0xf0ce('0x26')],'resourceId':_0x57c51e['id'],'type':_0x295196[_0xf0ce('0x26')],'sectionId':_0x295196['id']},{})[_0xf0ce('0x23')](function(){return _0xe6a51e;});}else{return _0xe6a51e;}})[_0xf0ce('0x41')](function(_0x4503fb){logger[_0xf0ce('0x4e')](_0xf0ce('0x4f'),_0x4503fb);throw _0x4503fb;});}return _0xe6a51e;})[_0xf0ce('0x23')](respondWithResult(_0x200aef,0xc9))[_0xf0ce('0x41')](handleError(_0x200aef,null));};exports[_0xf0ce('0x50')]=function(_0x5cc436,_0x1a5ca1){var _0x22a453={'where':{'id':_0x5cc436[_0xf0ce('0x42')]['id']}},_0x22c612={};_0x22c612['model']=_[_0xf0ce('0x2d')](db[_0xf0ce('0x3c')][_0xf0ce('0x29')]);_0x22a453[_0xf0ce('0x31')]=_[_0xf0ce('0x2f')](_0x22c612['model'],qs[_0xf0ce('0x32')](_0x5cc436[_0xf0ce('0x2c')][_0xf0ce('0x32')]));_0x22a453['attributes']=_0x22a453[_0xf0ce('0x31')][_0xf0ce('0x33')]?_0x22a453[_0xf0ce('0x31')]:_0x22c612[_0xf0ce('0x30')];if(_0x5cc436['query']['includeAll']){_0x22a453['include']=[{'all':!![]}];}_0x22a453=_[_0xf0ce('0x3a')]({},_0x22a453,_0x5cc436[_0xf0ce('0x3b')]);return db[_0xf0ce('0x3c')][_0xf0ce('0x43')](_0x22a453)[_0xf0ce('0x23')](handleEntityNotFound(_0x1a5ca1,null))[_0xf0ce('0x23')](function(_0x584b6e){if(_0x584b6e){var _0x1588a3=_0x584b6e[_0xf0ce('0x49')]({'plain':!![]});_0x1588a3=qs['omit'](_0x1588a3,['id',_0xf0ce('0x51'),'updatedAt']);_0x5cc436['body']=_['omit'](_0x5cc436[_0xf0ce('0x45')],['id','createdAt',_0xf0ce('0x52')]);return db[_0xf0ce('0x3c')][_0xf0ce('0x44')](_[_0xf0ce('0x3a')](_0x1588a3,_0x5cc436[_0xf0ce('0x45')]),{'include':_0x5cc436['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf0ce('0x23')](function(_0x7d135f){var _0xe5d3c3=_0x5cc436['user']['get']({'plain':!![]});if(!_0xe5d3c3)throw new Error(_0xf0ce('0x47'));if(_0xe5d3c3['role']===_0xf0ce('0x46')){var _0x2ee2d6=_0x7d135f[_0xf0ce('0x49')]({'plain':!![]});var _0xa70ba6='IvrCampaigns';return db[_0xf0ce('0x4a')][_0xf0ce('0x43')]({'where':{'name':_0xa70ba6,'userProfileId':_0xe5d3c3[_0xf0ce('0x4b')]},'raw':!![]})[_0xf0ce('0x23')](function(_0x5b5712){if(_0x5b5712&&_0x5b5712['autoAssociation']===0x0){return db[_0xf0ce('0x4d')][_0xf0ce('0x44')]({'name':_0x2ee2d6[_0xf0ce('0x26')],'resourceId':_0x2ee2d6['id'],'type':_0x5b5712[_0xf0ce('0x26')],'sectionId':_0x5b5712['id']},{})['then'](function(){return _0x7d135f;});}else{return _0x7d135f;}})[_0xf0ce('0x41')](function(_0x1da3bc){logger[_0xf0ce('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1da3bc);throw _0x1da3bc;});}return _0x7d135f;});}})[_0xf0ce('0x23')](respondWithResult(_0x1a5ca1,0xc9))[_0xf0ce('0x41')](handleError(_0x1a5ca1,null));};exports[_0xf0ce('0x53')]=function(_0x3c3810,_0x2a32ce){if(_0x3c3810[_0xf0ce('0x45')]['id']){delete _0x3c3810[_0xf0ce('0x45')]['id'];}return db[_0xf0ce('0x3c')][_0xf0ce('0x43')]({'where':{'id':_0x3c3810[_0xf0ce('0x42')]['id']}})[_0xf0ce('0x23')](handleEntityNotFound(_0x2a32ce,null))[_0xf0ce('0x23')](saveUpdates(_0x3c3810[_0xf0ce('0x45')],null))[_0xf0ce('0x23')](respondWithResult(_0x2a32ce,null))[_0xf0ce('0x41')](handleError(_0x2a32ce,null));};exports[_0xf0ce('0x24')]=function(_0x417c9c,_0x29b4da){return db[_0xf0ce('0x3c')]['find']({'where':{'id':_0x417c9c['params']['id']}})[_0xf0ce('0x23')](handleEntityNotFound(_0x29b4da,null))[_0xf0ce('0x23')](removeEntity(_0x29b4da,null))['catch'](handleError(_0x29b4da,null));};exports[_0xf0ce('0x54')]=function(_0x4e8c5b,_0x41989e,_0x2b5678){var _0x3a3905={'raw':!![],'where':{}};var _0x1a1ca2={};var _0x4211d9={'count':0x0,'rows':[]};return db[_0xf0ce('0x3c')][_0xf0ce('0x55')]({'where':{'id':_0x4e8c5b[_0xf0ce('0x42')]['id']}})[_0xf0ce('0x23')](handleEntityNotFound(_0x41989e,null))[_0xf0ce('0x23')](function(_0x39c89b){if(_0x39c89b){_0x1a1ca2[_0xf0ce('0x30')]=_[_0xf0ce('0x2d')](db[_0xf0ce('0x56')]['rawAttributes']);_0x1a1ca2[_0xf0ce('0x2c')]=_[_0xf0ce('0x2d')](_0x4e8c5b['query']);_0x1a1ca2[_0xf0ce('0x2e')]=_[_0xf0ce('0x2f')](_0x1a1ca2[_0xf0ce('0x30')],_0x1a1ca2[_0xf0ce('0x2c')]);_0x3a3905[_0xf0ce('0x31')]=_[_0xf0ce('0x2f')](_0x1a1ca2['model'],qs[_0xf0ce('0x32')](_0x4e8c5b[_0xf0ce('0x2c')]['fields']));_0x3a3905['attributes']=_0x3a3905['attributes'][_0xf0ce('0x33')]?_0x3a3905[_0xf0ce('0x31')]:_0x1a1ca2[_0xf0ce('0x30')];if(!_0x4e8c5b[_0xf0ce('0x2c')][_0xf0ce('0x57')]('nolimit')){_0x3a3905[_0xf0ce('0x1d')]=qs[_0xf0ce('0x1d')](_0x4e8c5b[_0xf0ce('0x2c')][_0xf0ce('0x1d')]);_0x3a3905['offset']=qs[_0xf0ce('0x1b')](_0x4e8c5b[_0xf0ce('0x2c')][_0xf0ce('0x1b')]);}_0x3a3905['order']=qs[_0xf0ce('0x36')](_0x4e8c5b[_0xf0ce('0x2c')][_0xf0ce('0x36')]);_0x3a3905[_0xf0ce('0x37')]=qs[_0xf0ce('0x2e')](_['pick'](_0x4e8c5b[_0xf0ce('0x2c')],_0x1a1ca2['filters']));_0x3a3905[_0xf0ce('0x37')]['CampaignId']=_0x39c89b['id'];if(_0x4e8c5b['query'][_0xf0ce('0x39')]){_0x3a3905[_0xf0ce('0x37')]=_['merge'](_0x3a3905['where'],{'$or':_['map'](_0x3a3905[_0xf0ce('0x31')],function(_0xc4049a){var _0x152fc5={};_0x152fc5[_0xc4049a]={'$like':'%'+_0x4e8c5b[_0xf0ce('0x2c')][_0xf0ce('0x39')]+'%'};return _0x152fc5;})});}_0x3a3905=_[_0xf0ce('0x3a')]({},_0x3a3905,_0x4e8c5b['options']);return db[_0xf0ce('0x56')]['count']({'where':_0x3a3905[_0xf0ce('0x37')]})['then'](function(_0x1a0635){_0x4211d9[_0xf0ce('0x1e')]=_0x1a0635;if(_0x4e8c5b[_0xf0ce('0x2c')][_0xf0ce('0x3d')]){_0x3a3905[_0xf0ce('0x3e')]=[{'all':!![]}];}return db[_0xf0ce('0x56')][_0xf0ce('0x3f')](_0x3a3905);})['then'](function(_0x411b37){_0x4211d9[_0xf0ce('0x40')]=_0x411b37;return _0x4211d9;});}})[_0xf0ce('0x23')](respondWithFilteredResult(_0x41989e,_0x3a3905))[_0xf0ce('0x41')](handleError(_0x41989e,null));};exports[_0xf0ce('0x58')]=function(_0x15fd9c,_0x100210,_0x58ee7e){var _0x65d13={'raw':!![],'where':{}};var _0x57c149={};var _0x148c16={'count':0x0,'rows':[]};return db[_0xf0ce('0x3c')][_0xf0ce('0x55')]({'where':{'id':_0x15fd9c[_0xf0ce('0x42')]['id']}})[_0xf0ce('0x23')](handleEntityNotFound(_0x100210,null))[_0xf0ce('0x23')](function(_0x2ad789){if(_0x2ad789){_0x57c149['model']=_[_0xf0ce('0x2d')](db[_0xf0ce('0x59')]['rawAttributes']);_0x57c149['query']=_['keys'](_0x15fd9c['query']);_0x57c149[_0xf0ce('0x2e')]=_['intersection'](_0x57c149[_0xf0ce('0x30')],_0x57c149[_0xf0ce('0x2c')]);_0x65d13[_0xf0ce('0x31')]=_[_0xf0ce('0x2f')](_0x57c149[_0xf0ce('0x30')],qs[_0xf0ce('0x32')](_0x15fd9c[_0xf0ce('0x2c')][_0xf0ce('0x32')]));_0x65d13[_0xf0ce('0x31')]=_0x65d13[_0xf0ce('0x31')][_0xf0ce('0x33')]?_0x65d13['attributes']:_0x57c149['model'];if(!_0x15fd9c['query'][_0xf0ce('0x57')]('nolimit')){_0x65d13['limit']=qs['limit'](_0x15fd9c[_0xf0ce('0x2c')][_0xf0ce('0x1d')]);_0x65d13[_0xf0ce('0x1b')]=qs[_0xf0ce('0x1b')](_0x15fd9c[_0xf0ce('0x2c')][_0xf0ce('0x1b')]);}_0x65d13[_0xf0ce('0x35')]=qs['sort'](_0x15fd9c[_0xf0ce('0x2c')][_0xf0ce('0x36')]);_0x65d13[_0xf0ce('0x37')]=qs['filters'](_[_0xf0ce('0x38')](_0x15fd9c[_0xf0ce('0x2c')],_0x57c149[_0xf0ce('0x2e')]));_0x65d13[_0xf0ce('0x37')]['CampaignId']=_0x2ad789['id'];if(_0x15fd9c[_0xf0ce('0x2c')][_0xf0ce('0x39')]){_0x65d13[_0xf0ce('0x37')]=_[_0xf0ce('0x3a')](_0x65d13[_0xf0ce('0x37')],{'$or':_[_0xf0ce('0x28')](_0x65d13[_0xf0ce('0x31')],function(_0xfa4507){var _0x520c48={};_0x520c48[_0xfa4507]={'$like':'%'+_0x15fd9c[_0xf0ce('0x2c')][_0xf0ce('0x39')]+'%'};return _0x520c48;})});}_0x65d13=_[_0xf0ce('0x3a')]({},_0x65d13,_0x15fd9c[_0xf0ce('0x3b')]);return db[_0xf0ce('0x59')][_0xf0ce('0x1e')]({'where':_0x65d13[_0xf0ce('0x37')]})[_0xf0ce('0x23')](function(_0x373b7e){_0x148c16[_0xf0ce('0x1e')]=_0x373b7e;if(_0x15fd9c[_0xf0ce('0x2c')]['includeAll']){_0x65d13['include']=[{'all':!![]}];}return db[_0xf0ce('0x59')][_0xf0ce('0x3f')](_0x65d13);})[_0xf0ce('0x23')](function(_0x5ef406){_0x148c16['rows']=_0x5ef406;return _0x148c16;});}})[_0xf0ce('0x23')](respondWithFilteredResult(_0x100210,_0x65d13))['catch'](handleError(_0x100210,null));};exports[_0xf0ce('0x5a')]=function(_0x4d4c60,_0x4ea0a7,_0x3d66d1){var _0x15d916={'raw':!![],'where':{}};var _0x2e5550={};var _0x1b51aa={'count':0x0,'rows':[]};return db[_0xf0ce('0x3c')][_0xf0ce('0x55')]({'where':{'id':_0x4d4c60[_0xf0ce('0x42')]['id']}})['then'](handleEntityNotFound(_0x4ea0a7,null))[_0xf0ce('0x23')](function(_0x5dd0c){if(_0x5dd0c){_0x2e5550[_0xf0ce('0x30')]=_[_0xf0ce('0x2d')](db[_0xf0ce('0x5b')]['rawAttributes']);_0x2e5550[_0xf0ce('0x2c')]=_[_0xf0ce('0x2d')](_0x4d4c60[_0xf0ce('0x2c')]);_0x2e5550[_0xf0ce('0x2e')]=_[_0xf0ce('0x2f')](_0x2e5550['model'],_0x2e5550[_0xf0ce('0x2c')]);_0x15d916[_0xf0ce('0x31')]=_[_0xf0ce('0x2f')](_0x2e5550[_0xf0ce('0x30')],qs[_0xf0ce('0x32')](_0x4d4c60['query'][_0xf0ce('0x32')]));_0x15d916[_0xf0ce('0x31')]=_0x15d916['attributes'][_0xf0ce('0x33')]?_0x15d916[_0xf0ce('0x31')]:_0x2e5550[_0xf0ce('0x30')];if(!_0x4d4c60['query'][_0xf0ce('0x57')](_0xf0ce('0x34'))){_0x15d916[_0xf0ce('0x1d')]=qs[_0xf0ce('0x1d')](_0x4d4c60[_0xf0ce('0x2c')][_0xf0ce('0x1d')]);_0x15d916['offset']=qs[_0xf0ce('0x1b')](_0x4d4c60[_0xf0ce('0x2c')][_0xf0ce('0x1b')]);}_0x15d916['order']=qs['sort'](_0x4d4c60[_0xf0ce('0x2c')][_0xf0ce('0x36')]);_0x15d916[_0xf0ce('0x37')]=qs['filters'](_[_0xf0ce('0x38')](_0x4d4c60['query'],_0x2e5550[_0xf0ce('0x2e')]));_0x15d916['where'][_0xf0ce('0x5c')]=_0x5dd0c['id'];if(_0x4d4c60[_0xf0ce('0x2c')][_0xf0ce('0x39')]){_0x15d916[_0xf0ce('0x37')]=_['merge'](_0x15d916['where'],{'$or':_[_0xf0ce('0x28')](_0x15d916[_0xf0ce('0x31')],function(_0x36546d){var _0x120107={};_0x120107[_0x36546d]={'$like':'%'+_0x4d4c60[_0xf0ce('0x2c')]['filter']+'%'};return _0x120107;})});}_0x15d916=_[_0xf0ce('0x3a')]({},_0x15d916,_0x4d4c60[_0xf0ce('0x3b')]);return db[_0xf0ce('0x5b')][_0xf0ce('0x1e')]({'where':_0x15d916[_0xf0ce('0x37')]})[_0xf0ce('0x23')](function(_0x16af92){_0x1b51aa[_0xf0ce('0x1e')]=_0x16af92;if(_0x4d4c60['query']['includeAll']){_0x15d916[_0xf0ce('0x3e')]=[{'all':!![]}];}return db[_0xf0ce('0x5b')][_0xf0ce('0x3f')](_0x15d916);})[_0xf0ce('0x23')](function(_0x5b0654){_0x1b51aa[_0xf0ce('0x40')]=_0x5b0654;return _0x1b51aa;});}})[_0xf0ce('0x23')](respondWithFilteredResult(_0x4ea0a7,_0x15d916))['catch'](handleError(_0x4ea0a7,null));};exports['getHopperBlacks']=function(_0x33ffd2,_0x564ed1,_0x45dc14){var _0x3e255e={'raw':!![],'where':{}};var _0x595a8f={};var _0x218d57={'count':0x0,'rows':[]};return db['Campaign'][_0xf0ce('0x55')]({'where':{'id':_0x33ffd2[_0xf0ce('0x42')]['id']}})[_0xf0ce('0x23')](handleEntityNotFound(_0x564ed1,null))['then'](function(_0x582ccd){if(_0x582ccd){_0x595a8f[_0xf0ce('0x30')]=_[_0xf0ce('0x2d')](db[_0xf0ce('0x5d')][_0xf0ce('0x29')]);_0x595a8f[_0xf0ce('0x2c')]=_[_0xf0ce('0x2d')](_0x33ffd2[_0xf0ce('0x2c')]);_0x595a8f['filters']=_[_0xf0ce('0x2f')](_0x595a8f[_0xf0ce('0x30')],_0x595a8f[_0xf0ce('0x2c')]);_0x3e255e['attributes']=_[_0xf0ce('0x2f')](_0x595a8f[_0xf0ce('0x30')],qs[_0xf0ce('0x32')](_0x33ffd2[_0xf0ce('0x2c')]['fields']));_0x3e255e['attributes']=_0x3e255e[_0xf0ce('0x31')][_0xf0ce('0x33')]?_0x3e255e[_0xf0ce('0x31')]:_0x595a8f[_0xf0ce('0x30')];if(!_0x33ffd2[_0xf0ce('0x2c')][_0xf0ce('0x57')](_0xf0ce('0x34'))){_0x3e255e[_0xf0ce('0x1d')]=qs[_0xf0ce('0x1d')](_0x33ffd2['query'][_0xf0ce('0x1d')]);_0x3e255e[_0xf0ce('0x1b')]=qs[_0xf0ce('0x1b')](_0x33ffd2[_0xf0ce('0x2c')][_0xf0ce('0x1b')]);}_0x3e255e['order']=qs[_0xf0ce('0x36')](_0x33ffd2['query'][_0xf0ce('0x36')]);_0x3e255e[_0xf0ce('0x37')]=qs[_0xf0ce('0x2e')](_[_0xf0ce('0x38')](_0x33ffd2[_0xf0ce('0x2c')],_0x595a8f[_0xf0ce('0x2e')]));_0x3e255e[_0xf0ce('0x37')][_0xf0ce('0x5c')]=_0x582ccd['id'];if(_0x33ffd2[_0xf0ce('0x2c')]['filter']){_0x3e255e[_0xf0ce('0x37')]=_[_0xf0ce('0x3a')](_0x3e255e[_0xf0ce('0x37')],{'$or':_['map'](_0x3e255e['attributes'],function(_0xab93f4){var _0x3480f1={};_0x3480f1[_0xab93f4]={'$like':'%'+_0x33ffd2[_0xf0ce('0x2c')]['filter']+'%'};return _0x3480f1;})});}_0x3e255e=_['merge']({},_0x3e255e,_0x33ffd2[_0xf0ce('0x3b')]);return db[_0xf0ce('0x5d')]['count']({'where':_0x3e255e[_0xf0ce('0x37')]})[_0xf0ce('0x23')](function(_0x39a306){_0x218d57[_0xf0ce('0x1e')]=_0x39a306;if(_0x33ffd2['query'][_0xf0ce('0x3d')]){_0x3e255e[_0xf0ce('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf0ce('0x3f')](_0x3e255e);})[_0xf0ce('0x23')](function(_0x207132){_0x218d57[_0xf0ce('0x40')]=_0x207132;return _0x218d57;});}})[_0xf0ce('0x23')](respondWithFilteredResult(_0x564ed1,_0x3e255e))[_0xf0ce('0x41')](handleError(_0x564ed1,null));};exports[_0xf0ce('0x5e')]=function(_0x4105de,_0x3b5e6f,_0x2d8dec){var _0x5424d4={};var _0x58ba5c={};var _0x373937;var _0x7624ed;return db[_0xf0ce('0x3c')][_0xf0ce('0x55')]({'where':{'id':_0x4105de[_0xf0ce('0x42')]['id']}})['then'](handleEntityNotFound(_0x3b5e6f,null))[_0xf0ce('0x23')](function(_0x3593d5){if(_0x3593d5){_0x373937=_0x3593d5;_0x58ba5c[_0xf0ce('0x30')]=_[_0xf0ce('0x2d')](db['CmList']['rawAttributes']);_0x58ba5c[_0xf0ce('0x2c')]=_[_0xf0ce('0x2d')](_0x4105de[_0xf0ce('0x2c')]);_0x58ba5c[_0xf0ce('0x2e')]=_[_0xf0ce('0x2f')](_0x58ba5c[_0xf0ce('0x30')],_0x58ba5c['query']);_0x5424d4[_0xf0ce('0x31')]=_[_0xf0ce('0x2f')](_0x58ba5c[_0xf0ce('0x30')],qs[_0xf0ce('0x32')](_0x4105de[_0xf0ce('0x2c')][_0xf0ce('0x32')]));_0x5424d4[_0xf0ce('0x31')]=_0x5424d4['attributes'][_0xf0ce('0x33')]?_0x5424d4[_0xf0ce('0x31')]:_0x58ba5c[_0xf0ce('0x30')];_0x5424d4[_0xf0ce('0x35')]=qs[_0xf0ce('0x36')](_0x4105de[_0xf0ce('0x2c')]['sort']);_0x5424d4[_0xf0ce('0x37')]=qs[_0xf0ce('0x2e')](_[_0xf0ce('0x38')](_0x4105de[_0xf0ce('0x2c')],_0x58ba5c['filters']));if(_0x4105de[_0xf0ce('0x2c')]['filter']){_0x5424d4[_0xf0ce('0x37')]=_['merge'](_0x5424d4[_0xf0ce('0x37')],{'$or':_[_0xf0ce('0x28')](_0x5424d4[_0xf0ce('0x31')],function(_0x243af1){var _0x58e601={};_0x58e601[_0x243af1]={'$like':'%'+_0x4105de[_0xf0ce('0x2c')]['filter']+'%'};return _0x58e601;})});}_0x5424d4=_['merge']({},_0x5424d4,_0x4105de[_0xf0ce('0x3b')]);return _0x373937[_0xf0ce('0x5e')](_0x5424d4);}})[_0xf0ce('0x23')](function(_0x1a1325){if(_0x1a1325){_0x7624ed=_0x1a1325[_0xf0ce('0x33')];if(!_0x4105de['query']['hasOwnProperty'](_0xf0ce('0x34'))){_0x5424d4['limit']=qs[_0xf0ce('0x1d')](_0x4105de[_0xf0ce('0x2c')][_0xf0ce('0x1d')]);_0x5424d4['offset']=qs[_0xf0ce('0x1b')](_0x4105de[_0xf0ce('0x2c')]['offset']);}return _0x373937[_0xf0ce('0x5e')](_0x5424d4);}})[_0xf0ce('0x23')](function(_0x4b39c3){if(_0x4b39c3){return _0x4b39c3?{'count':_0x7624ed,'rows':_0x4b39c3}:null;}})[_0xf0ce('0x23')](respondWithResult(_0x3b5e6f,null))[_0xf0ce('0x41')](handleError(_0x3b5e6f,null));};exports[_0xf0ce('0x5f')]=function(_0x1b8ea6,_0xfdc08d,_0x3adfac){var _0x194f4b,_0x27701e;return db['Campaign'][_0xf0ce('0x43')]({'where':{'id':_0x1b8ea6[_0xf0ce('0x42')]['id']}})['then'](handleEntityNotFound(_0xfdc08d,null))[_0xf0ce('0x23')](function(_0x1e601b){if(_0x1e601b){_0x27701e=_0x1e601b;return _0x1e601b[_0xf0ce('0x5f')](_0x1b8ea6[_0xf0ce('0x45')][_0xf0ce('0x60')],_[_0xf0ce('0x61')](_0x1b8ea6[_0xf0ce('0x45')],[_0xf0ce('0x60'),'id'])||{});}return null;})[_0xf0ce('0x62')](function(_0x5413a4){var _0x2a0b5e;_0x194f4b=_0x5413a4||[];var _0x23f73e=[];if(_0x5413a4){for(var _0x115556=0x0;_0x115556<_0x5413a4[_0xf0ce('0x33')];_0x115556+=0x1){var _0x11b7ac=_0x5413a4[_0x115556]['get']({'plain':!![]});_0x27701e['dialCheckDuplicateType']=_0x1b8ea6[_0xf0ce('0x45')]['dialCheckDuplicateType']?_0x1b8ea6[_0xf0ce('0x45')][_0xf0ce('0x63')]:_0x27701e[_0xf0ce('0x63')];switch(_0x27701e[_0xf0ce('0x63')]){case _0xf0ce('0x64'):_0x2a0b5e=squel[_0xf0ce('0x65')]()[_0xf0ce('0x66')](_0xf0ce('0x67'))['fromQuery']([_0xf0ce('0x68'),'scheduledAt','ContactId',_0xf0ce('0x69'),_0xf0ce('0x5c'),_0xf0ce('0x51'),_0xf0ce('0x52')],squel[_0xf0ce('0x6a')]()['field']('phone',_0xf0ce('0x68'))['field'](_0xf0ce('0x6b'),'scheduledAt')[_0xf0ce('0x6c')]('id',_0xf0ce('0x6d'))['field'](_0x11b7ac[_0xf0ce('0x6e')][_0xf0ce('0x6f')](),_0xf0ce('0x69'))[_0xf0ce('0x6c')](_0x1b8ea6[_0xf0ce('0x42')]['id'][_0xf0ce('0x6f')](),_0xf0ce('0x5c'))[_0xf0ce('0x6c')](_0xf0ce('0x6b'),'createdAt')[_0xf0ce('0x6c')](_0xf0ce('0x6b'),_0xf0ce('0x52'))[_0xf0ce('0x70')](_0xf0ce('0x71'))[_0xf0ce('0x37')]('deletedAt\x20IS\x20NULL')[_0xf0ce('0x37')](_0xf0ce('0x72'),_0x11b7ac['CmListId']['toString']())[_0xf0ce('0x37')](_0xf0ce('0x73'))['where'](_0xf0ce('0x74'),squel[_0xf0ce('0x6a')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xf0ce('0x75'))[_0xf0ce('0x37')](_0xf0ce('0x76'),_0x1b8ea6['params']['id'][_0xf0ce('0x6f')]()))[_0xf0ce('0x37')](_0xf0ce('0x74'),squel[_0xf0ce('0x6a')]()[_0xf0ce('0x6c')](_0xf0ce('0x77'))[_0xf0ce('0x70')](_0xf0ce('0x67'))[_0xf0ce('0x37')]('CampaignId\x20=\x20?',_0x1b8ea6[_0xf0ce('0x42')]['id']['toString']())))['toString']();break;case _0xf0ce('0x78'):_0x2a0b5e=squel[_0xf0ce('0x65')]()[_0xf0ce('0x66')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0xf0ce('0x6d'),_0xf0ce('0x69'),_0xf0ce('0x5c'),'createdAt',_0xf0ce('0x52')],squel[_0xf0ce('0x6a')]()['field'](_0xf0ce('0x68'),_0xf0ce('0x68'))[_0xf0ce('0x6c')](_0xf0ce('0x6b'),_0xf0ce('0x79'))[_0xf0ce('0x6c')]('id',_0xf0ce('0x6d'))[_0xf0ce('0x6c')](_0x11b7ac['CmListId'][_0xf0ce('0x6f')](),_0xf0ce('0x69'))[_0xf0ce('0x6c')](_0x1b8ea6[_0xf0ce('0x42')]['id']['toString'](),'CampaignId')[_0xf0ce('0x6c')](_0xf0ce('0x6b'),_0xf0ce('0x51'))['field'](_0xf0ce('0x6b'),_0xf0ce('0x52'))[_0xf0ce('0x70')](_0xf0ce('0x71'))[_0xf0ce('0x37')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x11b7ac['CmListId'][_0xf0ce('0x6f')]())[_0xf0ce('0x37')](_0xf0ce('0x73'))[_0xf0ce('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf0ce('0x6a')]()[_0xf0ce('0x6c')](_0xf0ce('0x77'))[_0xf0ce('0x70')](_0xf0ce('0x67'))['where'](_0xf0ce('0x76'),_0x1b8ea6['params']['id']['toString']())))[_0xf0ce('0x6f')]();break;default:_0x2a0b5e=squel['insert']()[_0xf0ce('0x66')](_0xf0ce('0x67'))[_0xf0ce('0x7a')](['phone','scheduledAt',_0xf0ce('0x6d'),_0xf0ce('0x69'),'CampaignId',_0xf0ce('0x51'),_0xf0ce('0x52')],squel[_0xf0ce('0x6a')]()[_0xf0ce('0x6c')](_0xf0ce('0x68'),_0xf0ce('0x68'))[_0xf0ce('0x6c')](_0xf0ce('0x6b'),_0xf0ce('0x79'))['field']('id',_0xf0ce('0x6d'))[_0xf0ce('0x6c')](_0x11b7ac[_0xf0ce('0x6e')]['toString'](),_0xf0ce('0x69'))[_0xf0ce('0x6c')](_0x1b8ea6[_0xf0ce('0x42')]['id'][_0xf0ce('0x6f')](),'CampaignId')[_0xf0ce('0x6c')]('NOW()',_0xf0ce('0x51'))[_0xf0ce('0x6c')]('NOW()',_0xf0ce('0x52'))[_0xf0ce('0x70')](_0xf0ce('0x71'))['where'](_0xf0ce('0x7b'))[_0xf0ce('0x37')](_0xf0ce('0x72'),_0x11b7ac[_0xf0ce('0x6e')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xf0ce('0x6f')]();}_0x23f73e['push'](db[_0xf0ce('0x7c')]['query'](_0x2a0b5e));}return BPromise[_0xf0ce('0x7d')](_0x23f73e);}})[_0xf0ce('0x23')](function(){return _0x194f4b;})[_0xf0ce('0x23')](respondWithResult(_0xfdc08d,null))[_0xf0ce('0x41')](handleError(_0xfdc08d,null));};exports[_0xf0ce('0x7e')]=function(_0x9152ba,_0x56b5bb,_0x5dcdc6){return db[_0xf0ce('0x3c')][_0xf0ce('0x43')]({'where':{'id':_0x9152ba[_0xf0ce('0x42')]['id']}})['then'](handleEntityNotFound(_0x56b5bb,null))[_0xf0ce('0x23')](function(_0x3e8022){if(_0x3e8022){return _0x3e8022[_0xf0ce('0x7e')](_0x9152ba['query'][_0xf0ce('0x60')]);}})[_0xf0ce('0x23')](function(_0x348752){if(_0x348752){return db[_0xf0ce('0x56')]['destroy']({'where':{'ListId':_0x9152ba['query'][_0xf0ce('0x60')],'CampaignId':_0x9152ba[_0xf0ce('0x42')]['id']}})[_0xf0ce('0x23')](function(){return _0x348752;});}})[_0xf0ce('0x23')](respondWithStatusCode(_0x56b5bb,null))[_0xf0ce('0x41')](handleError(_0x56b5bb,null));};exports['getBlackLists']=function(_0xb994b8,_0x5b85f1,_0x3d37e5){var _0x167372={};var _0xa51720={};var _0x560d4c;var _0x263f11;return db[_0xf0ce('0x3c')][_0xf0ce('0x55')]({'where':{'id':_0xb994b8[_0xf0ce('0x42')]['id']}})[_0xf0ce('0x23')](handleEntityNotFound(_0x5b85f1,null))[_0xf0ce('0x23')](function(_0x47acb5){if(_0x47acb5){_0x560d4c=_0x47acb5;_0xa51720[_0xf0ce('0x30')]=_[_0xf0ce('0x2d')](db[_0xf0ce('0x7f')]['rawAttributes']);_0xa51720['query']=_[_0xf0ce('0x2d')](_0xb994b8[_0xf0ce('0x2c')]);_0xa51720['filters']=_[_0xf0ce('0x2f')](_0xa51720[_0xf0ce('0x30')],_0xa51720[_0xf0ce('0x2c')]);_0x167372[_0xf0ce('0x31')]=_[_0xf0ce('0x2f')](_0xa51720[_0xf0ce('0x30')],qs['fields'](_0xb994b8['query']['fields']));_0x167372[_0xf0ce('0x31')]=_0x167372[_0xf0ce('0x31')][_0xf0ce('0x33')]?_0x167372[_0xf0ce('0x31')]:_0xa51720[_0xf0ce('0x30')];_0x167372[_0xf0ce('0x35')]=qs[_0xf0ce('0x36')](_0xb994b8[_0xf0ce('0x2c')][_0xf0ce('0x36')]);_0x167372[_0xf0ce('0x37')]=qs[_0xf0ce('0x2e')](_['pick'](_0xb994b8['query'],_0xa51720[_0xf0ce('0x2e')]));if(_0xb994b8[_0xf0ce('0x2c')][_0xf0ce('0x39')]){_0x167372[_0xf0ce('0x37')]=_[_0xf0ce('0x3a')](_0x167372[_0xf0ce('0x37')],{'$or':_[_0xf0ce('0x28')](_0x167372[_0xf0ce('0x31')],function(_0x30556f){var _0x4d6bc3={};_0x4d6bc3[_0x30556f]={'$like':'%'+_0xb994b8['query'][_0xf0ce('0x39')]+'%'};return _0x4d6bc3;})});}_0x167372=_['merge']({},_0x167372,_0xb994b8[_0xf0ce('0x3b')]);return _0x560d4c[_0xf0ce('0x80')](_0x167372);}})[_0xf0ce('0x23')](function(_0x5beadc){if(_0x5beadc){_0x263f11=_0x5beadc[_0xf0ce('0x33')];if(!_0xb994b8[_0xf0ce('0x2c')][_0xf0ce('0x57')](_0xf0ce('0x34'))){_0x167372[_0xf0ce('0x1d')]=qs['limit'](_0xb994b8['query'][_0xf0ce('0x1d')]);_0x167372[_0xf0ce('0x1b')]=qs[_0xf0ce('0x1b')](_0xb994b8[_0xf0ce('0x2c')][_0xf0ce('0x1b')]);}return _0x560d4c['getBlackLists'](_0x167372);}})[_0xf0ce('0x23')](function(_0x26d99e){if(_0x26d99e){return _0x26d99e?{'count':_0x263f11,'rows':_0x26d99e}:null;}})[_0xf0ce('0x23')](respondWithResult(_0x5b85f1,null))[_0xf0ce('0x41')](handleError(_0x5b85f1,null));};exports['addBlackLists']=function(_0x2ec435,_0xe68ad9,_0x48a5af){var _0x3d263a,_0x5c532e;return db[_0xf0ce('0x3c')][_0xf0ce('0x43')]({'where':{'id':_0x2ec435[_0xf0ce('0x42')]['id']}})[_0xf0ce('0x23')](handleEntityNotFound(_0xe68ad9,null))[_0xf0ce('0x23')](function(_0x1fb9cf){if(_0x1fb9cf){_0x5c532e=_0x1fb9cf;return _0x1fb9cf[_0xf0ce('0x81')](_0x2ec435['body']['ids'],_[_0xf0ce('0x61')](_0x2ec435[_0xf0ce('0x45')],[_0xf0ce('0x60'),'id'])||{});}return null;})[_0xf0ce('0x62')](function(_0x22b660){var _0x21798c;_0x3d263a=_0x22b660||[];var _0x5cb2c1=[];if(_0x22b660){for(var _0x4040a8=0x0;_0x4040a8<_0x22b660[_0xf0ce('0x33')];_0x4040a8+=0x1){var _0x5c2599=_0x22b660[_0x4040a8]['get']({'plain':!![]});_0x21798c=squel['insert']()['into'](_0xf0ce('0x82'))['fromQuery']([_0xf0ce('0x68'),'ContactId',_0xf0ce('0x69'),_0xf0ce('0x5c'),'createdAt',_0xf0ce('0x52')],squel['select']()[_0xf0ce('0x6c')](_0xf0ce('0x68'),'phone')[_0xf0ce('0x6c')]('id',_0xf0ce('0x6d'))['field'](_0x5c2599[_0xf0ce('0x6e')]['toString'](),_0xf0ce('0x69'))[_0xf0ce('0x6c')](_0x2ec435[_0xf0ce('0x42')]['id'][_0xf0ce('0x6f')](),_0xf0ce('0x5c'))[_0xf0ce('0x6c')](_0xf0ce('0x6b'),_0xf0ce('0x51'))[_0xf0ce('0x6c')](_0xf0ce('0x6b'),_0xf0ce('0x52'))['from']('cm_contacts')['where'](_0xf0ce('0x7b'))[_0xf0ce('0x37')](_0xf0ce('0x72'),_0x5c2599[_0xf0ce('0x6e')][_0xf0ce('0x6f')]())[_0xf0ce('0x37')](_0xf0ce('0x73')))[_0xf0ce('0x6f')]();_0x5cb2c1[_0xf0ce('0x83')](db['sequelize']['query'](_0x21798c));}return BPromise['all'](_0x5cb2c1);}})[_0xf0ce('0x23')](function(){return _0x3d263a;})[_0xf0ce('0x23')](respondWithResult(_0xe68ad9,null))[_0xf0ce('0x41')](handleError(_0xe68ad9,null));};exports[_0xf0ce('0x84')]=function(_0x3a6431,_0x4b91de,_0x319bb2){return db[_0xf0ce('0x3c')][_0xf0ce('0x43')]({'where':{'id':_0x3a6431[_0xf0ce('0x42')]['id']}})[_0xf0ce('0x23')](handleEntityNotFound(_0x4b91de,null))['then'](function(_0x543533){if(_0x543533){return _0x543533['removeBlackLists'](_0x3a6431[_0xf0ce('0x2c')][_0xf0ce('0x60')]);}})[_0xf0ce('0x23')](function(_0x5743ad){if(_0x5743ad){return db[_0xf0ce('0x5d')][_0xf0ce('0x24')]({'where':{'ListId':_0x3a6431['query']['ids'],'CampaignId':_0x3a6431[_0xf0ce('0x42')]['id']}})[_0xf0ce('0x23')](function(){return _0x5743ad;});}})['then'](respondWithStatusCode(_0x4b91de,null))['catch'](handleError(_0x4b91de,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 3e46107..2a640ea 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(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0x7a54,0x106));var _0x47a5=function(_0x717224,_0x2808a9){_0x717224=_0x717224-0x0;var _0x18ec06=_0x7a54[_0x717224];return _0x18ec06;};'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 c5e607c..982fd15 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 _0x7d86=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','lodash','moment'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x7d86,0x86));var _0x67d8=function(_0x2fd871,_0x5ef012){_0x2fd871=_0x2fd871-0x0;var _0x58c191=_0x7d86[_0x2fd871];return _0x58c191;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var moment=require(_0x67d8('0x1'));var BPromise=require(_0x67d8('0x2'));var rs=require(_0x67d8('0x3'));var fs=require('fs');var Redis=require(_0x67d8('0x4'));var db=require(_0x67d8('0x5'))['db'];var utils=require(_0x67d8('0x6'));var logger=require(_0x67d8('0x7'))('rpc');var config=require(_0x67d8('0x8'));var jayson=require(_0x67d8('0x9'));var client=jayson[_0x67d8('0xa')][_0x67d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2485fa,_0x282b7a,_0x30c690){return new BPromise(function(_0x16e834,_0x31726a){return client[_0x67d8('0xc')](_0x2485fa,_0x30c690)[_0x67d8('0xd')](function(_0x6bc54c){logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));logger[_0x67d8('0x11')](_0x67d8('0x12'),_0x282b7a,_0x67d8('0x10'),JSON[_0x67d8('0x13')](_0x6bc54c));if(_0x6bc54c[_0x67d8('0x14')]){if(_0x6bc54c[_0x67d8('0x14')]['code']===0x1f4){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')]['message']);return _0x31726a(_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);}logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);return _0x16e834(_0x6bc54c[_0x67d8('0x14')]['message']);}else{logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));_0x16e834(_0x6bc54c['result'][_0x67d8('0x15')]);}})[_0x67d8('0x16')](function(_0x4b2795){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x4b2795);_0x31726a(_0x4b2795);});});}exports[_0x67d8('0x17')]=function(_0xefaaea){var _0x23328d=this;return new Promise(function(_0x2a9e66,_0x5117d0){return db[_0x67d8('0x18')][_0x67d8('0x19')]({'raw':_0xefaaea[_0x67d8('0x1a')]?_0xefaaea[_0x67d8('0x1a')][_0x67d8('0x1b')]===undefined?!![]:![]:!![],'where':_0xefaaea['options']?_0xefaaea[_0x67d8('0x1a')][_0x67d8('0x1c')]||null:null,'attributes':_0xefaaea['options']?_0xefaaea['options'][_0x67d8('0x1d')]||null:null,'limit':_0xefaaea['options']?_0xefaaea[_0x67d8('0x1a')][_0x67d8('0x1e')]||null:null,'include':_0xefaaea[_0x67d8('0x1a')]?_0xefaaea['options']['include']?_[_0x67d8('0x1f')](_0xefaaea[_0x67d8('0x1a')][_0x67d8('0x20')],function(_0x3949ce){return{'model':db[_0x3949ce[_0x67d8('0x21')]],'as':_0x3949ce['as'],'attributes':_0x3949ce['attributes'],'include':_0x3949ce[_0x67d8('0x20')]?_[_0x67d8('0x1f')](_0x3949ce['include'],function(_0x509ee9){return{'model':db[_0x509ee9[_0x67d8('0x21')]],'as':_0x509ee9['as'],'attributes':_0x509ee9[_0x67d8('0x1d')],'include':_0x509ee9['include']?_[_0x67d8('0x1f')](_0x509ee9[_0x67d8('0x20')],function(_0x4de8ae){return{'model':db[_0x4de8ae['model']],'as':_0x4de8ae['as'],'attributes':_0x4de8ae[_0x67d8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x67d8('0xd')](function(_0x5873f5){logger[_0x67d8('0xe')](_0x67d8('0x17'),_0xefaaea);logger['debug'](_0x67d8('0x17'),_0xefaaea,JSON['stringify'](_0x5873f5));_0x2a9e66(_0x5873f5);})[_0x67d8('0x16')](function(_0x8531f3){logger[_0x67d8('0x14')]('GetCampaign',_0x8531f3['message'],_0xefaaea);_0x5117d0(_0x23328d['error'](0x1f4,_0x8531f3[_0x67d8('0x15')]));});});};
\ No newline at end of file
+var _0xfa2f=['attributes','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model'];(function(_0x23eac6,_0x4f118d){var _0x4dd58b=function(_0x2418ad){while(--_0x2418ad){_0x23eac6['push'](_0x23eac6['shift']());}};_0x4dd58b(++_0x4f118d);}(_0xfa2f,0xe8));var _0xffa2=function(_0x6a672d,_0x1750e4){_0x6a672d=_0x6a672d-0x0;var _0x3a7e4b=_0xfa2f[_0x6a672d];return _0x3a7e4b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xffa2('0x0'));var BPromise=require('bluebird');var rs=require(_0xffa2('0x1'));var fs=require('fs');var Redis=require(_0xffa2('0x2'));var db=require(_0xffa2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xffa2('0x4'))(_0xffa2('0x5'));var config=require(_0xffa2('0x6'));var jayson=require(_0xffa2('0x7'));var client=jayson[_0xffa2('0x8')][_0xffa2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x215134,_0x489257,_0x4c6406){return new BPromise(function(_0x34cf1b,_0x20a710){return client[_0xffa2('0xa')](_0x215134,_0x4c6406)[_0xffa2('0xb')](function(_0x3462ae){logger[_0xffa2('0xc')](_0xffa2('0xd'),_0x489257,'request\x20sent');logger[_0xffa2('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x489257,'request\x20sent',JSON[_0xffa2('0xf')](_0x3462ae));if(_0x3462ae[_0xffa2('0x10')]){if(_0x3462ae[_0xffa2('0x10')][_0xffa2('0x11')]===0x1f4){logger[_0xffa2('0x10')]('Campaign,\x20%s,\x20%s',_0x489257,_0x3462ae[_0xffa2('0x10')][_0xffa2('0x12')]);return _0x20a710(_0x3462ae[_0xffa2('0x10')][_0xffa2('0x12')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x489257,_0x3462ae[_0xffa2('0x10')][_0xffa2('0x12')]);return _0x34cf1b(_0x3462ae[_0xffa2('0x10')]['message']);}else{logger[_0xffa2('0xc')](_0xffa2('0xd'),_0x489257,_0xffa2('0x13'));_0x34cf1b(_0x3462ae[_0xffa2('0x14')][_0xffa2('0x12')]);}})[_0xffa2('0x15')](function(_0x892043){logger['error'](_0xffa2('0xd'),_0x489257,_0x892043);_0x20a710(_0x892043);});});}exports[_0xffa2('0x16')]=function(_0x923abf){var _0x2ae03f=this;return new Promise(function(_0x2b71e7,_0x4e396f){return db[_0xffa2('0x17')][_0xffa2('0x18')]({'raw':_0x923abf[_0xffa2('0x19')]?_0x923abf[_0xffa2('0x19')][_0xffa2('0x1a')]===undefined?!![]:![]:!![],'where':_0x923abf[_0xffa2('0x19')]?_0x923abf['options'][_0xffa2('0x1b')]||null:null,'attributes':_0x923abf[_0xffa2('0x19')]?_0x923abf[_0xffa2('0x19')]['attributes']||null:null,'limit':_0x923abf[_0xffa2('0x19')]?_0x923abf['options'][_0xffa2('0x1c')]||null:null,'include':_0x923abf[_0xffa2('0x19')]?_0x923abf[_0xffa2('0x19')][_0xffa2('0x1d')]?_[_0xffa2('0x1e')](_0x923abf[_0xffa2('0x19')][_0xffa2('0x1d')],function(_0x251a0d){return{'model':db[_0x251a0d[_0xffa2('0x1f')]],'as':_0x251a0d['as'],'attributes':_0x251a0d[_0xffa2('0x20')],'include':_0x251a0d['include']?_[_0xffa2('0x1e')](_0x251a0d[_0xffa2('0x1d')],function(_0x4d97a3){return{'model':db[_0x4d97a3[_0xffa2('0x1f')]],'as':_0x4d97a3['as'],'attributes':_0x4d97a3[_0xffa2('0x20')],'include':_0x4d97a3[_0xffa2('0x1d')]?_[_0xffa2('0x1e')](_0x4d97a3[_0xffa2('0x1d')],function(_0x3fb328){return{'model':db[_0x3fb328[_0xffa2('0x1f')]],'as':_0x3fb328['as'],'attributes':_0x3fb328[_0xffa2('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d4376){logger[_0xffa2('0xc')](_0xffa2('0x16'),_0x923abf);logger['debug'](_0xffa2('0x16'),_0x923abf,JSON[_0xffa2('0xf')](_0x2d4376));_0x2b71e7(_0x2d4376);})[_0xffa2('0x15')](function(_0x48e67b){logger[_0xffa2('0x10')](_0xffa2('0x16'),_0x48e67b[_0xffa2('0x12')],_0x923abf);_0x4e396f(_0x2ae03f[_0xffa2('0x10')](0x1f4,_0x48e67b[_0xffa2('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 054d8c5..1a46ab1 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 _0xaf43=['getLists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','delete','destroy','/:id/blacklists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x4db141,_0x74de9b){var _0x4e8b56=function(_0x2dc06f){while(--_0x2dc06f){_0x4db141['push'](_0x4db141['shift']());}};_0x4e8b56(++_0x74de9b);}(_0xaf43,0x182));var _0x3af4=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xaf43[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require(_0x3af4('0x0'));var path=require(_0x3af4('0x1'));var timeout=require(_0x3af4('0x2'));var express=require(_0x3af4('0x3'));var router=express[_0x3af4('0x4')]();var fs_extra=require(_0x3af4('0x5'));var auth=require(_0x3af4('0x6'));var interaction=require(_0x3af4('0x7'));var config=require(_0x3af4('0x8'));var controller=require(_0x3af4('0x9'));router[_0x3af4('0xa')]('/',auth['isAuthenticated'](),controller[_0x3af4('0xb')]);router[_0x3af4('0xa')](_0x3af4('0xc'),auth[_0x3af4('0xd')](),controller['show']);router['get'](_0x3af4('0xe'),auth['isAuthenticated'](),controller[_0x3af4('0xf')]);router[_0x3af4('0xa')](_0x3af4('0x10'),auth[_0x3af4('0xd')](),controller[_0x3af4('0x11')]);router[_0x3af4('0xa')](_0x3af4('0x12'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x3af4('0xa')](_0x3af4('0x13'),auth[_0x3af4('0xd')](),controller[_0x3af4('0x14')]);router['get'](_0x3af4('0x15'),auth[_0x3af4('0xd')](),controller[_0x3af4('0x16')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x3af4('0x17')]);router[_0x3af4('0x18')]('/',auth[_0x3af4('0xd')](),controller[_0x3af4('0x19')]);router['post'](_0x3af4('0x1a'),auth[_0x3af4('0xd')](),controller[_0x3af4('0x1b')]);router[_0x3af4('0x18')](_0x3af4('0x15'),auth[_0x3af4('0xd')](),controller[_0x3af4('0x1c')]);router[_0x3af4('0x18')]('/:id/blacklists',auth[_0x3af4('0xd')](),controller[_0x3af4('0x1d')]);router['put'](_0x3af4('0xc'),auth[_0x3af4('0xd')](),controller['update']);router[_0x3af4('0x1e')](_0x3af4('0xc'),auth['isAuthenticated'](),controller[_0x3af4('0x1f')]);router[_0x3af4('0x1e')](_0x3af4('0x15'),auth[_0x3af4('0xd')](),controller['removeLists']);router[_0x3af4('0x1e')](_0x3af4('0x20'),auth[_0x3af4('0xd')](),controller['removeBlackLists']);module[_0x3af4('0x21')]=router;
\ No newline at end of file
+var _0xd5bf=['getBlackLists','post','create','/:id/clone','clone','addBlackLists','put','update','destroy','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists'];(function(_0x3c5658,_0x2fb0e6){var _0x3697b8=function(_0x474343){while(--_0x474343){_0x3c5658['push'](_0x3c5658['shift']());}};_0x3697b8(++_0x2fb0e6);}(_0xd5bf,0x66));var _0xfd5b=function(_0x58ea6b,_0xe690c){_0x58ea6b=_0x58ea6b-0x0;var _0x2f28ba=_0xd5bf[_0x58ea6b];return _0x2f28ba;};'use strict';var multer=require(_0xfd5b('0x0'));var util=require(_0xfd5b('0x1'));var path=require(_0xfd5b('0x2'));var timeout=require(_0xfd5b('0x3'));var express=require(_0xfd5b('0x4'));var router=express[_0xfd5b('0x5')]();var fs_extra=require(_0xfd5b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfd5b('0x7'));var controller=require(_0xfd5b('0x8'));router[_0xfd5b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfd5b('0x9')](_0xfd5b('0xa'),auth[_0xfd5b('0xb')](),controller['show']);router[_0xfd5b('0x9')](_0xfd5b('0xc'),auth['isAuthenticated'](),controller[_0xfd5b('0xd')]);router[_0xfd5b('0x9')]('/:id/hopper_histories',auth[_0xfd5b('0xb')](),controller['getHopperHistories']);router[_0xfd5b('0x9')]('/:id/hopper_finals',auth[_0xfd5b('0xb')](),controller['getHopperFinals']);router[_0xfd5b('0x9')](_0xfd5b('0xe'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xfd5b('0x9')](_0xfd5b('0xf'),auth['isAuthenticated'](),controller[_0xfd5b('0x10')]);router[_0xfd5b('0x9')](_0xfd5b('0x11'),auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x12')]);router[_0xfd5b('0x13')]('/',auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x14')]);router[_0xfd5b('0x13')](_0xfd5b('0x15'),auth['isAuthenticated'](),controller[_0xfd5b('0x16')]);router[_0xfd5b('0x13')](_0xfd5b('0xf'),auth[_0xfd5b('0xb')](),controller['addLists']);router[_0xfd5b('0x13')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xfd5b('0x17')]);router[_0xfd5b('0x18')](_0xfd5b('0xa'),auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x19')]);router['delete']('/:id',auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x1a')]);router[_0xfd5b('0x1b')](_0xfd5b('0xf'),auth[_0xfd5b('0xb')](),controller['removeLists']);router[_0xfd5b('0x1b')](_0xfd5b('0x11'),auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x1c')]);module[_0xfd5b('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 4d771f9..eb07028 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 _0x9a86=['VIRTUAL','key','sequelize','exports','STRING','TEXT'];(function(_0x570426,_0x1d8a31){var _0x1814e9=function(_0x520be5){while(--_0x520be5){_0x570426['push'](_0x570426['shift']());}};_0x1814e9(++_0x1d8a31);}(_0x9a86,0x134));var _0x69a8=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x9a86[_0x52e363];return _0x3fc2b5;};'use strict';var Sequelize=require(_0x69a8('0x0'));module[_0x69a8('0x1')]={'key':{'type':Sequelize[_0x69a8('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x69a8('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x69a8('0x4')],'get':function(){return this['getDataValue'](_0x69a8('0x5'));}}};
\ No newline at end of file
+var _0x4e44=['sequelize','exports','STRING','getDataValue','key'];(function(_0xc717ed,_0x273018){var _0x4ef7c3=function(_0x5c2d32){while(--_0x5c2d32){_0xc717ed['push'](_0xc717ed['shift']());}};_0x4ef7c3(++_0x273018);}(_0x4e44,0x1d1));var _0x44e4=function(_0x421468,_0x4d4e39){_0x421468=_0x421468-0x0;var _0x257f7b=_0x4e44[_0x421468];return _0x257f7b;};'use strict';var Sequelize=require(_0x44e4('0x0'));module[_0x44e4('0x1')]={'key':{'type':Sequelize[_0x44e4('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x44e4('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x44e4('0x3')](_0x44e4('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index feb2c36..8b163f9 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 _0xbc94=['UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','options','catch','body','find','params','destroy','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','get','CannedAnswers'];(function(_0x5dcdbe,_0x9ac399){var _0x5d5749=function(_0x1d2cb9){while(--_0x1d2cb9){_0x5dcdbe['push'](_0x5dcdbe['shift']());}};_0x5d5749(++_0x9ac399);}(_0xbc94,0x91));var _0x4bc9=function(_0x4ea31e,_0x45cc3d){_0x4ea31e=_0x4ea31e-0x0;var _0x151f45=_0xbc94[_0x4ea31e];return _0x151f45;};'use strict';var emlformat=require(_0x4bc9('0x0'));var rimraf=require(_0x4bc9('0x1'));var zipdir=require(_0x4bc9('0x2'));var jsonpatch=require(_0x4bc9('0x3'));var rp=require(_0x4bc9('0x4'));var moment=require(_0x4bc9('0x5'));var BPromise=require(_0x4bc9('0x6'));var Mustache=require(_0x4bc9('0x7'));var util=require(_0x4bc9('0x8'));var path=require('path');var sox=require(_0x4bc9('0x9'));var csv=require(_0x4bc9('0xa'));var ejs=require(_0x4bc9('0xb'));var fs=require('fs');var fs_extra=require(_0x4bc9('0xc'));var _=require(_0x4bc9('0xd'));var squel=require(_0x4bc9('0xe'));var crypto=require(_0x4bc9('0xf'));var jsforce=require(_0x4bc9('0x10'));var deskjs=require(_0x4bc9('0x11'));var toCsv=require(_0x4bc9('0xa'));var querystring=require(_0x4bc9('0x12'));var Papa=require('papaparse');var Redis=require(_0x4bc9('0x13'));var authService=require(_0x4bc9('0x14'));var qs=require(_0x4bc9('0x15'));var as=require(_0x4bc9('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4bc9('0x17'))(_0x4bc9('0x18'));var utils=require('../../config/utils');var config=require(_0x4bc9('0x19'));var licenseUtil=require(_0x4bc9('0x1a'));var db=require(_0x4bc9('0x1b'))['db'];function respondWithStatusCode(_0xae82a2,_0x3d0dc3){_0x3d0dc3=_0x3d0dc3||0xcc;return function(_0xff5907){if(_0xff5907){return _0xae82a2[_0x4bc9('0x1c')](_0x3d0dc3);}return _0xae82a2['status'](_0x3d0dc3)[_0x4bc9('0x1d')]();};}function respondWithResult(_0x5f0945,_0x26d66e){_0x26d66e=_0x26d66e||0xc8;return function(_0x52edfc){if(_0x52edfc){return _0x5f0945[_0x4bc9('0x1e')](_0x26d66e)[_0x4bc9('0x1f')](_0x52edfc);}};}function respondWithFilteredResult(_0x520d0c,_0x1f1128){return function(_0x2a67d7){if(_0x2a67d7){var _0xeac865=typeof _0x1f1128[_0x4bc9('0x20')]===_0x4bc9('0x21')&&typeof _0x1f1128[_0x4bc9('0x22')]===_0x4bc9('0x21');var _0x5b919a=_0x2a67d7['count'];var _0xf0337f=_0xeac865?0x0:_0x1f1128[_0x4bc9('0x20')];var _0x2f6dc4=_0xeac865?_0x2a67d7[_0x4bc9('0x23')]:_0x1f1128[_0x4bc9('0x20')]+_0x1f1128[_0x4bc9('0x22')];var _0x3f5e92;if(_0x2f6dc4>=_0x5b919a){_0x2f6dc4=_0x5b919a;_0x3f5e92=0xc8;}else{_0x3f5e92=0xce;}_0x520d0c[_0x4bc9('0x1e')](_0x3f5e92);return _0x520d0c['set']('Content-Range',_0xf0337f+'-'+_0x2f6dc4+'/'+_0x5b919a)[_0x4bc9('0x1f')](_0x2a67d7);}return null;};}function patchUpdates(_0x4ac760){return function(_0x429c93){try{jsonpatch[_0x4bc9('0x24')](_0x429c93,_0x4ac760,!![]);}catch(_0x139a5d){return BPromise[_0x4bc9('0x25')](_0x139a5d);}return _0x429c93[_0x4bc9('0x26')]();};}function saveUpdates(_0x5120ac,_0x57ed2f){return function(_0xb2b199){if(_0xb2b199){return _0xb2b199[_0x4bc9('0x27')](_0x5120ac)[_0x4bc9('0x28')](function(_0x4f9512){return _0x4f9512;});}return null;};}function removeEntity(_0x41bea8,_0x20e70e){return function(_0x3c1c99){if(_0x3c1c99){return _0x3c1c99['destroy']()[_0x4bc9('0x28')](function(){var _0x5cd713=_0x3c1c99[_0x4bc9('0x29')]({'plain':!![]});var _0x11ced2=_0x4bc9('0x2a');return db[_0x4bc9('0x2b')]['destroy']({'where':{'type':_0x11ced2,'resourceId':_0x5cd713['id']}})[_0x4bc9('0x28')](function(){return _0x3c1c99;});})[_0x4bc9('0x28')](function(){_0x41bea8[_0x4bc9('0x1e')](0xcc)[_0x4bc9('0x1d')]();});}};}function handleEntityNotFound(_0x9e74cb,_0x3ec36f){return function(_0x5dd87d){if(!_0x5dd87d){_0x9e74cb[_0x4bc9('0x1c')](0x194);}return _0x5dd87d;};}function handleError(_0x36185a,_0x450f86){_0x450f86=_0x450f86||0x1f4;return function(_0xae98e0){logger[_0x4bc9('0x2c')](_0xae98e0[_0x4bc9('0x2d')]);if(_0xae98e0[_0x4bc9('0x2e')]){delete _0xae98e0['name'];}_0x36185a[_0x4bc9('0x1e')](_0x450f86)[_0x4bc9('0x2f')](_0xae98e0);};}exports[_0x4bc9('0x30')]=function(_0x1d78b4,_0x36023e){var _0x59b7d8={},_0x35c974={},_0x11b1ec={'count':0x0,'rows':[]};var _0x219620=_[_0x4bc9('0x31')](db[_0x4bc9('0x32')][_0x4bc9('0x33')],function(_0x1c84e4){return{'name':_0x1c84e4[_0x4bc9('0x34')],'type':_0x1c84e4[_0x4bc9('0x35')]['key']};});_0x35c974[_0x4bc9('0x36')]=_[_0x4bc9('0x31')](_0x219620,'name');_0x35c974[_0x4bc9('0x37')]=_[_0x4bc9('0x38')](_0x1d78b4[_0x4bc9('0x37')]);_0x35c974[_0x4bc9('0x39')]=_[_0x4bc9('0x3a')](_0x35c974['model'],_0x35c974[_0x4bc9('0x37')]);_0x59b7d8[_0x4bc9('0x3b')]=_['intersection'](_0x35c974[_0x4bc9('0x36')],qs[_0x4bc9('0x3c')](_0x1d78b4['query'][_0x4bc9('0x3c')]));_0x59b7d8[_0x4bc9('0x3b')]=_0x59b7d8['attributes'][_0x4bc9('0x3d')]?_0x59b7d8[_0x4bc9('0x3b')]:_0x35c974[_0x4bc9('0x36')];if(!_0x1d78b4[_0x4bc9('0x37')][_0x4bc9('0x3e')](_0x4bc9('0x3f'))){_0x59b7d8[_0x4bc9('0x22')]=qs[_0x4bc9('0x22')](_0x1d78b4[_0x4bc9('0x37')]['limit']);_0x59b7d8[_0x4bc9('0x20')]=qs[_0x4bc9('0x20')](_0x1d78b4[_0x4bc9('0x37')][_0x4bc9('0x20')]);}_0x59b7d8['order']=qs[_0x4bc9('0x40')](_0x1d78b4[_0x4bc9('0x37')][_0x4bc9('0x40')]);_0x59b7d8[_0x4bc9('0x41')]=qs[_0x4bc9('0x39')](_[_0x4bc9('0x42')](_0x1d78b4[_0x4bc9('0x37')],_0x35c974[_0x4bc9('0x39')]),_0x219620);if(_0x1d78b4['query'][_0x4bc9('0x43')]){_0x59b7d8[_0x4bc9('0x41')]=_[_0x4bc9('0x44')](_0x59b7d8[_0x4bc9('0x41')],{'$or':[{'key':{'$like':'%'+_0x1d78b4['query'][_0x4bc9('0x43')]+'%'}},{'value':{'$like':'%'+_0x1d78b4[_0x4bc9('0x37')][_0x4bc9('0x43')]+'%'}}]});}_0x59b7d8=_[_0x4bc9('0x44')]({},_0x59b7d8,_0x1d78b4['options']);var _0xe1590={'where':_0x59b7d8[_0x4bc9('0x41')]};return db[_0x4bc9('0x32')][_0x4bc9('0x23')](_0xe1590)[_0x4bc9('0x28')](function(_0x5d2cab){_0x11b1ec[_0x4bc9('0x23')]=_0x5d2cab;if(_0x1d78b4[_0x4bc9('0x37')][_0x4bc9('0x45')]){_0x59b7d8[_0x4bc9('0x46')]=[{'all':!![]}];}return db[_0x4bc9('0x32')][_0x4bc9('0x47')](_0x59b7d8);})[_0x4bc9('0x28')](function(_0x26d003){_0x11b1ec[_0x4bc9('0x48')]=_0x26d003;return _0x11b1ec;})['then'](respondWithFilteredResult(_0x36023e,_0x59b7d8))['catch'](handleError(_0x36023e,null));};exports[_0x4bc9('0x49')]=function(_0x2e09d6,_0x561242){var _0x290d51={'raw':!![],'where':{'id':_0x2e09d6['params']['id']}},_0x4a67e6={};_0x4a67e6[_0x4bc9('0x36')]=_[_0x4bc9('0x38')](db[_0x4bc9('0x32')][_0x4bc9('0x33')]);_0x4a67e6[_0x4bc9('0x37')]=_['keys'](_0x2e09d6[_0x4bc9('0x37')]);_0x4a67e6[_0x4bc9('0x39')]=_[_0x4bc9('0x3a')](_0x4a67e6[_0x4bc9('0x36')],_0x4a67e6[_0x4bc9('0x37')]);_0x290d51[_0x4bc9('0x3b')]=_['intersection'](_0x4a67e6[_0x4bc9('0x36')],qs['fields'](_0x2e09d6[_0x4bc9('0x37')]['fields']));_0x290d51[_0x4bc9('0x3b')]=_0x290d51[_0x4bc9('0x3b')]['length']?_0x290d51[_0x4bc9('0x3b')]:_0x4a67e6[_0x4bc9('0x36')];if(_0x2e09d6['query'][_0x4bc9('0x45')]){_0x290d51[_0x4bc9('0x46')]=[{'all':!![]}];}_0x290d51=_[_0x4bc9('0x44')]({},_0x290d51,_0x2e09d6[_0x4bc9('0x4a')]);return db[_0x4bc9('0x32')]['find'](_0x290d51)[_0x4bc9('0x28')](handleEntityNotFound(_0x561242,null))[_0x4bc9('0x28')](respondWithResult(_0x561242,null))[_0x4bc9('0x4b')](handleError(_0x561242,null));};exports[_0x4bc9('0x27')]=function(_0x206776,_0xad5e44){if(_0x206776[_0x4bc9('0x4c')]['id']){delete _0x206776[_0x4bc9('0x4c')]['id'];}return db[_0x4bc9('0x32')][_0x4bc9('0x4d')]({'where':{'id':_0x206776[_0x4bc9('0x4e')]['id']}})[_0x4bc9('0x28')](handleEntityNotFound(_0xad5e44,null))[_0x4bc9('0x28')](saveUpdates(_0x206776['body'],null))[_0x4bc9('0x28')](respondWithResult(_0xad5e44,null))[_0x4bc9('0x4b')](handleError(_0xad5e44,null));};exports[_0x4bc9('0x4f')]=function(_0x52b003,_0xbff035){return db[_0x4bc9('0x32')][_0x4bc9('0x4d')]({'where':{'id':_0x52b003[_0x4bc9('0x4e')]['id']}})[_0x4bc9('0x28')](handleEntityNotFound(_0xbff035,null))[_0x4bc9('0x28')](removeEntity(_0xbff035,null))['catch'](handleError(_0xbff035,null));};exports[_0x4bc9('0x50')]=function(_0x1926ac,_0x28aa9c){var _0x336d5a={'key':_0x1926ac[_0x4bc9('0x4c')][_0x4bc9('0x51')]};if(_0x1926ac['body']['MailAccountId']){_0x336d5a[_0x4bc9('0x52')]=_0x1926ac[_0x4bc9('0x4c')]['MailAccountId'];}else if(_0x1926ac[_0x4bc9('0x4c')][_0x4bc9('0x53')]){_0x336d5a[_0x4bc9('0x53')]=_0x1926ac[_0x4bc9('0x4c')]['SmsAccountId'];}else if(_0x1926ac[_0x4bc9('0x4c')][_0x4bc9('0x54')]){_0x336d5a[_0x4bc9('0x54')]=_0x1926ac[_0x4bc9('0x4c')][_0x4bc9('0x54')];}else if(_0x1926ac[_0x4bc9('0x4c')][_0x4bc9('0x55')]){_0x336d5a[_0x4bc9('0x55')]=_0x1926ac[_0x4bc9('0x4c')][_0x4bc9('0x55')];}return db[_0x4bc9('0x32')][_0x4bc9('0x4d')]({'where':_0x336d5a})[_0x4bc9('0x28')](function(_0x8e8671){if(_0x8e8671){throw new db[(_0x4bc9('0x56'))][(_0x4bc9('0x57'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x4bc9('0x32')]['create'](_0x1926ac[_0x4bc9('0x4c')]);})[_0x4bc9('0x28')](function(_0x52b193){var _0x296699=_0x1926ac[_0x4bc9('0x58')][_0x4bc9('0x29')]({'plain':!![]});if(!_0x296699)throw new Error(_0x4bc9('0x59'));if(_0x296699[_0x4bc9('0x5a')]===_0x4bc9('0x58')){var _0x4382a9=_0x52b193[_0x4bc9('0x29')]({'plain':!![]});return db[_0x4bc9('0x5b')][_0x4bc9('0x4d')]({'where':{'name':_0x4bc9('0x2a'),'userProfileId':_0x296699[_0x4bc9('0x5c')]},'raw':!![]})[_0x4bc9('0x28')](function(_0x3858fd){if(_0x3858fd&&_0x3858fd[_0x4bc9('0x5d')]===0x0){return db[_0x4bc9('0x2b')][_0x4bc9('0x50')]({'name':_0x4382a9[_0x4bc9('0x2e')],'resourceId':_0x4382a9['id'],'type':_0x3858fd[_0x4bc9('0x2e')],'sectionId':_0x3858fd['id']},{})[_0x4bc9('0x28')](function(){return _0x52b193;});}else{return _0x52b193;}})[_0x4bc9('0x4b')](function(_0x7ec10a){logger[_0x4bc9('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7ec10a);throw _0x7ec10a;});}return _0x52b193;})[_0x4bc9('0x28')](respondWithResult(_0x28aa9c,0xc9))['catch'](handleError(_0x28aa9c,null));};
\ No newline at end of file
+var _0x375e=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','findAll','show','include','find','catch','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','CannedAnswer','fieldName','type','key','model','map','keys','query','intersection','attributes'];(function(_0x19e425,_0x7f53c0){var _0x220e1d=function(_0x824c8){while(--_0x824c8){_0x19e425['push'](_0x19e425['shift']());}};_0x220e1d(++_0x7f53c0);}(_0x375e,0xce));var _0xe375=function(_0x4608c4,_0x51d3c5){_0x4608c4=_0x4608c4-0x0;var _0x4266db=_0x375e[_0x4608c4];return _0x4266db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe375('0x0'));var zipdir=require(_0xe375('0x1'));var jsonpatch=require(_0xe375('0x2'));var rp=require(_0xe375('0x3'));var moment=require(_0xe375('0x4'));var BPromise=require(_0xe375('0x5'));var Mustache=require(_0xe375('0x6'));var util=require('util');var path=require(_0xe375('0x7'));var sox=require(_0xe375('0x8'));var csv=require(_0xe375('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe375('0xa'));var squel=require(_0xe375('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe375('0xc'));var toCsv=require(_0xe375('0x9'));var querystring=require(_0xe375('0xd'));var Papa=require(_0xe375('0xe'));var Redis=require(_0xe375('0xf'));var authService=require(_0xe375('0x10'));var qs=require(_0xe375('0x11'));var as=require(_0xe375('0x12'));var hardwareService=require(_0xe375('0x13'));var logger=require(_0xe375('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xe375('0x15'));var licenseUtil=require(_0xe375('0x16'));var db=require(_0xe375('0x17'))['db'];function respondWithStatusCode(_0x2df643,_0x28cbff){_0x28cbff=_0x28cbff||0xcc;return function(_0x4359c5){if(_0x4359c5){return _0x2df643[_0xe375('0x18')](_0x28cbff);}return _0x2df643[_0xe375('0x19')](_0x28cbff)['end']();};}function respondWithResult(_0x23ebd4,_0x192ed2){_0x192ed2=_0x192ed2||0xc8;return function(_0x5a10a5){if(_0x5a10a5){return _0x23ebd4['status'](_0x192ed2)['json'](_0x5a10a5);}};}function respondWithFilteredResult(_0x16d786,_0xb0cb41){return function(_0x5400ad){if(_0x5400ad){var _0x15cde3=typeof _0xb0cb41[_0xe375('0x1a')]==='undefined'&&typeof _0xb0cb41['limit']===_0xe375('0x1b');var _0x5a36b2=_0x5400ad['count'];var _0x1e77b2=_0x15cde3?0x0:_0xb0cb41[_0xe375('0x1a')];var _0x35501a=_0x15cde3?_0x5400ad['count']:_0xb0cb41[_0xe375('0x1a')]+_0xb0cb41[_0xe375('0x1c')];var _0x1eafd1;if(_0x35501a>=_0x5a36b2){_0x35501a=_0x5a36b2;_0x1eafd1=0xc8;}else{_0x1eafd1=0xce;}_0x16d786['status'](_0x1eafd1);return _0x16d786['set'](_0xe375('0x1d'),_0x1e77b2+'-'+_0x35501a+'/'+_0x5a36b2)['json'](_0x5400ad);}return null;};}function patchUpdates(_0x305ad2){return function(_0x5d5f25){try{jsonpatch[_0xe375('0x1e')](_0x5d5f25,_0x305ad2,!![]);}catch(_0x357405){return BPromise[_0xe375('0x1f')](_0x357405);}return _0x5d5f25[_0xe375('0x20')]();};}function saveUpdates(_0xaca4fa,_0xcd5c35){return function(_0x2e4836){if(_0x2e4836){return _0x2e4836[_0xe375('0x21')](_0xaca4fa)[_0xe375('0x22')](function(_0x57a9c7){return _0x57a9c7;});}return null;};}function removeEntity(_0x5be3ef,_0xadf026){return function(_0x344977){if(_0x344977){return _0x344977[_0xe375('0x23')]()[_0xe375('0x22')](function(){var _0x173ea6=_0x344977[_0xe375('0x24')]({'plain':!![]});var _0x331af1=_0xe375('0x25');return db[_0xe375('0x26')]['destroy']({'where':{'type':_0x331af1,'resourceId':_0x173ea6['id']}})['then'](function(){return _0x344977;});})[_0xe375('0x22')](function(){_0x5be3ef[_0xe375('0x19')](0xcc)[_0xe375('0x27')]();});}};}function handleEntityNotFound(_0x46279d,_0x466613){return function(_0x2a6e90){if(!_0x2a6e90){_0x46279d[_0xe375('0x18')](0x194);}return _0x2a6e90;};}function handleError(_0x3e1402,_0x35dbb3){_0x35dbb3=_0x35dbb3||0x1f4;return function(_0x1fd4d4){logger[_0xe375('0x28')](_0x1fd4d4[_0xe375('0x29')]);if(_0x1fd4d4[_0xe375('0x2a')]){delete _0x1fd4d4[_0xe375('0x2a')];}_0x3e1402[_0xe375('0x19')](_0x35dbb3)[_0xe375('0x2b')](_0x1fd4d4);};}exports[_0xe375('0x2c')]=function(_0x35b2d3,_0x4dc744){var _0x4b1db6={},_0x42c86f={},_0x35d044={'count':0x0,'rows':[]};var _0x2e00be=_['map'](db[_0xe375('0x2d')]['rawAttributes'],function(_0x4453aa){return{'name':_0x4453aa[_0xe375('0x2e')],'type':_0x4453aa[_0xe375('0x2f')][_0xe375('0x30')]};});_0x42c86f[_0xe375('0x31')]=_[_0xe375('0x32')](_0x2e00be,_0xe375('0x2a'));_0x42c86f['query']=_[_0xe375('0x33')](_0x35b2d3[_0xe375('0x34')]);_0x42c86f['filters']=_[_0xe375('0x35')](_0x42c86f[_0xe375('0x31')],_0x42c86f[_0xe375('0x34')]);_0x4b1db6[_0xe375('0x36')]=_[_0xe375('0x35')](_0x42c86f['model'],qs[_0xe375('0x37')](_0x35b2d3[_0xe375('0x34')][_0xe375('0x37')]));_0x4b1db6[_0xe375('0x36')]=_0x4b1db6[_0xe375('0x36')][_0xe375('0x38')]?_0x4b1db6[_0xe375('0x36')]:_0x42c86f[_0xe375('0x31')];if(!_0x35b2d3['query'][_0xe375('0x39')](_0xe375('0x3a'))){_0x4b1db6[_0xe375('0x1c')]=qs[_0xe375('0x1c')](_0x35b2d3['query'][_0xe375('0x1c')]);_0x4b1db6[_0xe375('0x1a')]=qs[_0xe375('0x1a')](_0x35b2d3['query'][_0xe375('0x1a')]);}_0x4b1db6[_0xe375('0x3b')]=qs['sort'](_0x35b2d3['query'][_0xe375('0x3c')]);_0x4b1db6[_0xe375('0x3d')]=qs[_0xe375('0x3e')](_[_0xe375('0x3f')](_0x35b2d3[_0xe375('0x34')],_0x42c86f[_0xe375('0x3e')]),_0x2e00be);if(_0x35b2d3['query']['filter']){_0x4b1db6[_0xe375('0x3d')]=_['merge'](_0x4b1db6[_0xe375('0x3d')],{'$or':[{'key':{'$like':'%'+_0x35b2d3[_0xe375('0x34')][_0xe375('0x40')]+'%'}},{'value':{'$like':'%'+_0x35b2d3[_0xe375('0x34')][_0xe375('0x40')]+'%'}}]});}_0x4b1db6=_[_0xe375('0x41')]({},_0x4b1db6,_0x35b2d3[_0xe375('0x42')]);var _0x48181c={'where':_0x4b1db6['where']};return db[_0xe375('0x2d')][_0xe375('0x43')](_0x48181c)[_0xe375('0x22')](function(_0x54690f){_0x35d044[_0xe375('0x43')]=_0x54690f;if(_0x35b2d3[_0xe375('0x34')]['includeAll']){_0x4b1db6['include']=[{'all':!![]}];}return db[_0xe375('0x2d')][_0xe375('0x44')](_0x4b1db6);})[_0xe375('0x22')](function(_0xccf7be){_0x35d044['rows']=_0xccf7be;return _0x35d044;})['then'](respondWithFilteredResult(_0x4dc744,_0x4b1db6))['catch'](handleError(_0x4dc744,null));};exports[_0xe375('0x45')]=function(_0x116386,_0x5e6c3c){var _0x43168e={'raw':!![],'where':{'id':_0x116386['params']['id']}},_0xa02bc5={};_0xa02bc5[_0xe375('0x31')]=_[_0xe375('0x33')](db[_0xe375('0x2d')]['rawAttributes']);_0xa02bc5[_0xe375('0x34')]=_[_0xe375('0x33')](_0x116386['query']);_0xa02bc5['filters']=_['intersection'](_0xa02bc5[_0xe375('0x31')],_0xa02bc5[_0xe375('0x34')]);_0x43168e['attributes']=_['intersection'](_0xa02bc5[_0xe375('0x31')],qs[_0xe375('0x37')](_0x116386['query'][_0xe375('0x37')]));_0x43168e['attributes']=_0x43168e[_0xe375('0x36')][_0xe375('0x38')]?_0x43168e[_0xe375('0x36')]:_0xa02bc5[_0xe375('0x31')];if(_0x116386[_0xe375('0x34')]['includeAll']){_0x43168e[_0xe375('0x46')]=[{'all':!![]}];}_0x43168e=_[_0xe375('0x41')]({},_0x43168e,_0x116386[_0xe375('0x42')]);return db['CannedAnswer'][_0xe375('0x47')](_0x43168e)['then'](handleEntityNotFound(_0x5e6c3c,null))[_0xe375('0x22')](respondWithResult(_0x5e6c3c,null))[_0xe375('0x48')](handleError(_0x5e6c3c,null));};exports[_0xe375('0x21')]=function(_0x2dd315,_0x30be62){if(_0x2dd315[_0xe375('0x49')]['id']){delete _0x2dd315[_0xe375('0x49')]['id'];}return db[_0xe375('0x2d')][_0xe375('0x47')]({'where':{'id':_0x2dd315[_0xe375('0x4a')]['id']}})[_0xe375('0x22')](handleEntityNotFound(_0x30be62,null))[_0xe375('0x22')](saveUpdates(_0x2dd315[_0xe375('0x49')],null))['then'](respondWithResult(_0x30be62,null))[_0xe375('0x48')](handleError(_0x30be62,null));};exports['destroy']=function(_0x3453c2,_0x1aa059){return db[_0xe375('0x2d')][_0xe375('0x47')]({'where':{'id':_0x3453c2[_0xe375('0x4a')]['id']}})[_0xe375('0x22')](handleEntityNotFound(_0x1aa059,null))['then'](removeEntity(_0x1aa059,null))[_0xe375('0x48')](handleError(_0x1aa059,null));};exports[_0xe375('0x4b')]=function(_0x2051b2,_0xba38f8){var _0x1c8129={'key':_0x2051b2[_0xe375('0x49')][_0xe375('0x30')]};if(_0x2051b2[_0xe375('0x49')]['MailAccountId']){_0x1c8129['MailAccountId']=_0x2051b2['body'][_0xe375('0x4c')];}else if(_0x2051b2['body'][_0xe375('0x4d')]){_0x1c8129[_0xe375('0x4d')]=_0x2051b2[_0xe375('0x49')][_0xe375('0x4d')];}else if(_0x2051b2[_0xe375('0x49')][_0xe375('0x4e')]){_0x1c8129[_0xe375('0x4e')]=_0x2051b2[_0xe375('0x49')][_0xe375('0x4e')];}else if(_0x2051b2['body'][_0xe375('0x4f')]){_0x1c8129[_0xe375('0x4f')]=_0x2051b2[_0xe375('0x49')][_0xe375('0x4f')];}return db['CannedAnswer']['find']({'where':_0x1c8129})[_0xe375('0x22')](function(_0x388e2f){if(_0x388e2f){throw new db['Sequelize'][(_0xe375('0x50'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0xe375('0x4b')](_0x2051b2[_0xe375('0x49')]);})[_0xe375('0x22')](function(_0x5d4f42){var _0x43beff=_0x2051b2[_0xe375('0x51')]['get']({'plain':!![]});if(!_0x43beff)throw new Error(_0xe375('0x52'));if(_0x43beff[_0xe375('0x53')]===_0xe375('0x51')){var _0xe8cc0=_0x5d4f42[_0xe375('0x24')]({'plain':!![]});return db[_0xe375('0x54')][_0xe375('0x47')]({'where':{'name':_0xe375('0x25'),'userProfileId':_0x43beff['userProfileId']},'raw':!![]})['then'](function(_0x3cd573){if(_0x3cd573&&_0x3cd573[_0xe375('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0xe8cc0[_0xe375('0x2a')],'resourceId':_0xe8cc0['id'],'type':_0x3cd573[_0xe375('0x2a')],'sectionId':_0x3cd573['id']},{})[_0xe375('0x22')](function(){return _0x5d4f42;});}else{return _0x5d4f42;}})[_0xe375('0x48')](function(_0x4426f4){logger[_0xe375('0x28')](_0xe375('0x56'),_0x4426f4);throw _0x4426f4;});}return _0x5d4f42;})['then'](respondWithResult(_0xba38f8,0xc9))[_0xe375('0x48')](handleError(_0xba38f8,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 9743aee..12a3ecc 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 _0x92f1=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports','define','CannedAnswer'];(function(_0x3697ed,_0x137549){var _0x42d361=function(_0x303934){while(--_0x303934){_0x3697ed['push'](_0x3697ed['shift']());}};_0x42d361(++_0x137549);}(_0x92f1,0x1a3));var _0x192f=function(_0x39e18d,_0xe721e8){_0x39e18d=_0x39e18d-0x0;var _0x5e0034=_0x92f1[_0x39e18d];return _0x5e0034;};'use strict';var _=require(_0x192f('0x0'));var util=require(_0x192f('0x1'));var logger=require(_0x192f('0x2'))(_0x192f('0x3'));var moment=require('moment');var BPromise=require(_0x192f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x192f('0x5'));var rimraf=require('rimraf');var config=require(_0x192f('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x192f('0x7')]=function(_0x29fbba,_0x277897){return _0x29fbba[_0x192f('0x8')](_0x192f('0x9'),attributes,{'tableName':_0x192f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x192f('0xb'),'collate':_0x192f('0xc')});};
\ No newline at end of file
+var _0x58a7=['bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0xe16d05,_0x26fd6){var _0x45ff26=function(_0x1d449e){while(--_0x1d449e){_0xe16d05['push'](_0xe16d05['shift']());}};_0x45ff26(++_0x26fd6);}(_0x58a7,0xf7));var _0x758a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x58a7[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x758a('0x0'));var util=require(_0x758a('0x1'));var logger=require(_0x758a('0x2'))(_0x758a('0x3'));var moment=require(_0x758a('0x4'));var BPromise=require(_0x758a('0x5'));var rp=require(_0x758a('0x6'));var fs=require('fs');var path=require(_0x758a('0x7'));var rimraf=require('rimraf');var config=require(_0x758a('0x8'));var attributes=require(_0x758a('0x9'));module[_0x758a('0xa')]=function(_0x294cf3,_0x5a34af){return _0x294cf3['define'](_0x758a('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x758a('0xc'),'collate':_0x758a('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index c8b082d..bc50ae3 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(_0x22f52b,_0x39cdfd){var _0x45c6ab=function(_0x326a20){while(--_0x326a20){_0x22f52b['push'](_0x22f52b['shift']());}};_0x45c6ab(++_0x39cdfd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x2994aa,_0x3dda68){var _0x5ce4c7=function(_0xe498d4){while(--_0xe498d4){_0x2994aa['push'](_0x2994aa['shift']());}};_0x5ce4c7(++_0x3dda68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 9b26281..098136e 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 _0x6a4a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','multer'];(function(_0x120042,_0x1dcb92){var _0x2f13ee=function(_0x1ab9ab){while(--_0x1ab9ab){_0x120042['push'](_0x120042['shift']());}};_0x2f13ee(++_0x1dcb92);}(_0x6a4a,0xb3));var _0xa6a4=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x6a4a[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0xa6a4('0x0'));var util=require(_0xa6a4('0x1'));var path=require(_0xa6a4('0x2'));var timeout=require(_0xa6a4('0x3'));var express=require(_0xa6a4('0x4'));var router=express['Router']();var fs_extra=require(_0xa6a4('0x5'));var auth=require(_0xa6a4('0x6'));var interaction=require(_0xa6a4('0x7'));var config=require(_0xa6a4('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xa6a4('0x9')](),controller['index']);router[_0xa6a4('0xa')](_0xa6a4('0xb'),auth[_0xa6a4('0x9')](),controller[_0xa6a4('0xc')]);router[_0xa6a4('0xd')]('/',auth[_0xa6a4('0x9')](),controller[_0xa6a4('0xe')]);router[_0xa6a4('0xf')](_0xa6a4('0xb'),auth[_0xa6a4('0x9')](),controller['update']);router[_0xa6a4('0x10')](_0xa6a4('0xb'),auth['isAuthenticated'](),controller[_0xa6a4('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xaf8e=['post','create','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x101116,_0xe71b75){var _0x25d117=function(_0x37b252){while(--_0x37b252){_0x101116['push'](_0x101116['shift']());}};_0x25d117(++_0xe71b75);}(_0xaf8e,0x169));var _0xeaf8=function(_0x2f809e,_0x187553){_0x2f809e=_0x2f809e-0x0;var _0x3dd8dd=_0xaf8e[_0x2f809e];return _0x3dd8dd;};'use strict';var multer=require(_0xeaf8('0x0'));var util=require(_0xeaf8('0x1'));var path=require('path');var timeout=require(_0xeaf8('0x2'));var express=require(_0xeaf8('0x3'));var router=express[_0xeaf8('0x4')]();var fs_extra=require(_0xeaf8('0x5'));var auth=require(_0xeaf8('0x6'));var interaction=require(_0xeaf8('0x7'));var config=require(_0xeaf8('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xeaf8('0x9')](_0xeaf8('0xa'),auth[_0xeaf8('0xb')](),controller[_0xeaf8('0xc')]);router[_0xeaf8('0xd')]('/',auth[_0xeaf8('0xb')](),controller[_0xeaf8('0xe')]);router['put']('/:id',auth[_0xeaf8('0xb')](),controller['update']);router[_0xeaf8('0xf')](_0xeaf8('0xa'),auth[_0xeaf8('0xb')](),controller['destroy']);module[_0xeaf8('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index dfbf303..7d495b9 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 _0x61be=['exports','DATE','STRING','sequelize'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x61be,0x1d7));var _0xe61b=function(_0x91abdd,_0x4e7e7d){_0x91abdd=_0x91abdd-0x0;var _0x3779ad=_0x61be[_0x91abdd];return _0x3779ad;};'use strict';var Sequelize=require(_0xe61b('0x0'));module[_0xe61b('0x1')]={'calldate':{'type':Sequelize[_0xe61b('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xe61b('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe61b('0x3')]},'dstchannel':{'type':Sequelize[_0xe61b('0x3')]},'lastapp':{'type':Sequelize[_0xe61b('0x3')]},'lastdata':{'type':Sequelize[_0xe61b('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe61b('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe61b('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xe61b('0x3')]},'sequence':{'type':Sequelize[_0xe61b('0x3')]},'peeraccount':{'type':Sequelize[_0xe61b('0x3')]},'type':{'type':Sequelize[_0xe61b('0x3')]},'tag':{'type':Sequelize[_0xe61b('0x3')]}};
\ No newline at end of file
+var _0x58e9=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x5371ef,_0x7fa109){var _0x46b1ee=function(_0x1ea254){while(--_0x1ea254){_0x5371ef['push'](_0x5371ef['shift']());}};_0x46b1ee(++_0x7fa109);}(_0x58e9,0x15e));var _0x958e=function(_0x56da45,_0x114642){_0x56da45=_0x56da45-0x0;var _0x31ccb0=_0x58e9[_0x56da45];return _0x31ccb0;};'use strict';var Sequelize=require(_0x958e('0x0'));module[_0x958e('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x958e('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x958e('0x3')]},'dst':{'type':Sequelize[_0x958e('0x3')]},'dcontext':{'type':Sequelize[_0x958e('0x3')]},'channel':{'type':Sequelize[_0x958e('0x3')]},'dstchannel':{'type':Sequelize[_0x958e('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x958e('0x3')]},'duration':{'type':Sequelize[_0x958e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x958e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x958e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x958e('0x3')]},'userfield':{'type':Sequelize[_0x958e('0x3')]},'uniqueid':{'type':Sequelize[_0x958e('0x3')]},'linkedid':{'type':Sequelize[_0x958e('0x3')]},'sequence':{'type':Sequelize[_0x958e('0x3')]},'peeraccount':{'type':Sequelize[_0x958e('0x3')]},'type':{'type':Sequelize[_0x958e('0x3')]},'tag':{'type':Sequelize[_0x958e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index b175175..f3f256a 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 _0x1af3=['../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4f0302,_0x5affd5){var _0x52988f=function(_0x53dc1f){while(--_0x53dc1f){_0x4f0302['push'](_0x4f0302['shift']());}};_0x52988f(++_0x5affd5);}(_0x1af3,0x1ca));var _0x31af=function(_0x42020e,_0x4b92fb){_0x42020e=_0x42020e-0x0;var _0x561551=_0x1af3[_0x42020e];return _0x561551;};'use strict';var emlformat=require(_0x31af('0x0'));var rimraf=require(_0x31af('0x1'));var zipdir=require(_0x31af('0x2'));var jsonpatch=require(_0x31af('0x3'));var rp=require(_0x31af('0x4'));var moment=require(_0x31af('0x5'));var BPromise=require(_0x31af('0x6'));var Mustache=require(_0x31af('0x7'));var util=require(_0x31af('0x8'));var path=require(_0x31af('0x9'));var sox=require('sox');var csv=require(_0x31af('0xa'));var ejs=require(_0x31af('0xb'));var fs=require('fs');var fs_extra=require(_0x31af('0xc'));var _=require(_0x31af('0xd'));var squel=require('squel');var crypto=require(_0x31af('0xe'));var jsforce=require(_0x31af('0xf'));var deskjs=require(_0x31af('0x10'));var toCsv=require('to-csv');var querystring=require(_0x31af('0x11'));var Papa=require(_0x31af('0x12'));var Redis=require(_0x31af('0x13'));var authService=require(_0x31af('0x14'));var qs=require(_0x31af('0x15'));var as=require(_0x31af('0x16'));var hardwareService=require(_0x31af('0x17'));var logger=require(_0x31af('0x18'))('api');var utils=require(_0x31af('0x19'));var config=require(_0x31af('0x1a'));var licenseUtil=require(_0x31af('0x1b'));var db=require(_0x31af('0x1c'))['db'];function respondWithStatusCode(_0x144406,_0x481f20){_0x481f20=_0x481f20||0xcc;return function(_0x358fb4){if(_0x358fb4){return _0x144406[_0x31af('0x1d')](_0x481f20);}return _0x144406['status'](_0x481f20)['end']();};}function respondWithResult(_0x2a4727,_0x46a494){_0x46a494=_0x46a494||0xc8;return function(_0x14c57e){if(_0x14c57e){return _0x2a4727[_0x31af('0x1e')](_0x46a494)[_0x31af('0x1f')](_0x14c57e);}};}function respondWithFilteredResult(_0x1d35fa,_0x369934){return function(_0x37c275){if(_0x37c275){var _0xd431e4=typeof _0x369934[_0x31af('0x20')]===_0x31af('0x21')&&typeof _0x369934['limit']===_0x31af('0x21');var _0xd33b3f=_0x37c275[_0x31af('0x22')];var _0x477ada=_0xd431e4?0x0:_0x369934[_0x31af('0x20')];var _0x30a112=_0xd431e4?_0x37c275[_0x31af('0x22')]:_0x369934[_0x31af('0x20')]+_0x369934[_0x31af('0x23')];var _0x550870;if(_0x30a112>=_0xd33b3f){_0x30a112=_0xd33b3f;_0x550870=0xc8;}else{_0x550870=0xce;}_0x1d35fa[_0x31af('0x1e')](_0x550870);return _0x1d35fa[_0x31af('0x24')](_0x31af('0x25'),_0x477ada+'-'+_0x30a112+'/'+_0xd33b3f)[_0x31af('0x1f')](_0x37c275);}return null;};}function patchUpdates(_0x414ad8){return function(_0x5d96ca){try{jsonpatch[_0x31af('0x26')](_0x5d96ca,_0x414ad8,!![]);}catch(_0x46b03e){return BPromise[_0x31af('0x27')](_0x46b03e);}return _0x5d96ca[_0x31af('0x28')]();};}function saveUpdates(_0x394d13,_0x14c3f9){return function(_0x1ddfba){if(_0x1ddfba){return _0x1ddfba[_0x31af('0x29')](_0x394d13)[_0x31af('0x2a')](function(_0x6634e3){return _0x6634e3;});}return null;};}function removeEntity(_0x40aa32,_0x1a67e3){return function(_0x3a98d3){if(_0x3a98d3){return _0x3a98d3[_0x31af('0x2b')]()[_0x31af('0x2a')](function(){_0x40aa32['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d3832,_0x20a50c){return function(_0x2b3bad){if(!_0x2b3bad){_0x5d3832['sendStatus'](0x194);}return _0x2b3bad;};}function handleError(_0x4c958,_0x8f9f60){_0x8f9f60=_0x8f9f60||0x1f4;return function(_0x49812a){logger[_0x31af('0x2c')](_0x49812a[_0x31af('0x2d')]);if(_0x49812a['name']){delete _0x49812a[_0x31af('0x2e')];}_0x4c958[_0x31af('0x1e')](_0x8f9f60)[_0x31af('0x2f')](_0x49812a);};}exports[_0x31af('0x30')]=function(_0x3326a7,_0x5a1f41){var _0xb1f5b1={},_0x3eb61f={},_0x1e6df8={'count':0x0,'rows':[]};var _0x1f4eae=_[_0x31af('0x31')](db[_0x31af('0x32')][_0x31af('0x33')],function(_0x231438){return{'name':_0x231438[_0x31af('0x34')],'type':_0x231438[_0x31af('0x35')][_0x31af('0x36')]};});_0x3eb61f[_0x31af('0x37')]=_['map'](_0x1f4eae,_0x31af('0x2e'));_0x3eb61f[_0x31af('0x38')]=_['keys'](_0x3326a7['query']);_0x3eb61f['filters']=_[_0x31af('0x39')](_0x3eb61f['model'],_0x3eb61f[_0x31af('0x38')]);_0xb1f5b1[_0x31af('0x3a')]=_[_0x31af('0x39')](_0x3eb61f[_0x31af('0x37')],qs[_0x31af('0x3b')](_0x3326a7[_0x31af('0x38')]['fields']));_0xb1f5b1[_0x31af('0x3a')]=_0xb1f5b1[_0x31af('0x3a')][_0x31af('0x3c')]?_0xb1f5b1[_0x31af('0x3a')]:_0x3eb61f[_0x31af('0x37')];if(!_0x3326a7[_0x31af('0x38')][_0x31af('0x3d')](_0x31af('0x3e'))){_0xb1f5b1['limit']=qs[_0x31af('0x23')](_0x3326a7['query'][_0x31af('0x23')]);_0xb1f5b1[_0x31af('0x20')]=qs[_0x31af('0x20')](_0x3326a7[_0x31af('0x38')][_0x31af('0x20')]);}_0xb1f5b1['order']=qs['sort'](_0x3326a7['query'][_0x31af('0x3f')]);_0xb1f5b1[_0x31af('0x40')]=qs[_0x31af('0x41')](_[_0x31af('0x42')](_0x3326a7[_0x31af('0x38')],_0x3eb61f[_0x31af('0x41')]),_0x1f4eae);if(_0x3326a7[_0x31af('0x38')][_0x31af('0x43')]){_0xb1f5b1['where']=_[_0x31af('0x44')](_0xb1f5b1[_0x31af('0x40')],{'$or':_[_0x31af('0x31')](_0x1f4eae,function(_0x2a5cde){if(_0x2a5cde[_0x31af('0x35')]!==_0x31af('0x45')){var _0x32d1b9={};_0x32d1b9[_0x2a5cde[_0x31af('0x2e')]]={'$like':'%'+_0x3326a7[_0x31af('0x38')]['filter']+'%'};return _0x32d1b9;}})});}_0xb1f5b1=_[_0x31af('0x44')]({},_0xb1f5b1,_0x3326a7['options']);var _0x447a01={'where':_0xb1f5b1['where']};return db['Cdr'][_0x31af('0x22')](_0x447a01)[_0x31af('0x2a')](function(_0x110f38){_0x1e6df8[_0x31af('0x22')]=_0x110f38;if(_0x3326a7[_0x31af('0x38')][_0x31af('0x46')]){_0xb1f5b1[_0x31af('0x47')]=[{'all':!![]}];}return db['Cdr'][_0x31af('0x48')](_0xb1f5b1);})[_0x31af('0x2a')](function(_0xb53565){_0x1e6df8['rows']=_0xb53565;return _0x1e6df8;})[_0x31af('0x2a')](respondWithFilteredResult(_0x5a1f41,_0xb1f5b1))[_0x31af('0x49')](handleError(_0x5a1f41,null));};exports[_0x31af('0x4a')]=function(_0x23942b,_0x34205a){var _0x57da2c={'raw':!![],'where':{'id':_0x23942b[_0x31af('0x4b')]['id']}},_0x12357c={};_0x12357c[_0x31af('0x37')]=_[_0x31af('0x4c')](db['Cdr'][_0x31af('0x33')]);_0x12357c[_0x31af('0x38')]=_['keys'](_0x23942b[_0x31af('0x38')]);_0x12357c[_0x31af('0x41')]=_[_0x31af('0x39')](_0x12357c[_0x31af('0x37')],_0x12357c[_0x31af('0x38')]);_0x57da2c[_0x31af('0x3a')]=_[_0x31af('0x39')](_0x12357c[_0x31af('0x37')],qs[_0x31af('0x3b')](_0x23942b[_0x31af('0x38')]['fields']));_0x57da2c['attributes']=_0x57da2c[_0x31af('0x3a')]['length']?_0x57da2c[_0x31af('0x3a')]:_0x12357c[_0x31af('0x37')];if(_0x23942b[_0x31af('0x38')]['includeAll']){_0x57da2c['include']=[{'all':!![]}];}_0x57da2c=_[_0x31af('0x44')]({},_0x57da2c,_0x23942b['options']);return db[_0x31af('0x32')][_0x31af('0x4d')](_0x57da2c)[_0x31af('0x2a')](handleEntityNotFound(_0x34205a,null))[_0x31af('0x2a')](respondWithResult(_0x34205a,null))['catch'](handleError(_0x34205a,null));};exports['create']=function(_0x407386,_0x3acff1){return db[_0x31af('0x32')][_0x31af('0x4e')](_0x407386['body'],{})[_0x31af('0x2a')](respondWithResult(_0x3acff1,0xc9))[_0x31af('0x49')](handleError(_0x3acff1,null));};exports[_0x31af('0x29')]=function(_0x4ad7a6,_0x5a1cbe){if(_0x4ad7a6[_0x31af('0x4f')]['id']){delete _0x4ad7a6[_0x31af('0x4f')]['id'];}return db[_0x31af('0x32')][_0x31af('0x4d')]({'where':{'id':_0x4ad7a6[_0x31af('0x4b')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x5a1cbe,null))[_0x31af('0x2a')](saveUpdates(_0x4ad7a6[_0x31af('0x4f')],null))[_0x31af('0x2a')](respondWithResult(_0x5a1cbe,null))[_0x31af('0x49')](handleError(_0x5a1cbe,null));};exports['destroy']=function(_0x441362,_0x29de7e){return db[_0x31af('0x32')][_0x31af('0x4d')]({'where':{'id':_0x441362[_0x31af('0x4b')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x29de7e,null))[_0x31af('0x2a')](removeEntity(_0x29de7e,null))[_0x31af('0x49')](handleError(_0x29de7e,null));};exports[_0x31af('0x50')]=function(_0x25369b,_0x3bfbae){return db[_0x31af('0x32')][_0x31af('0x50')]()[_0x31af('0x2a')](respondWithResult(_0x3bfbae,null))['catch'](handleError(_0x3bfbae,null));};
\ No newline at end of file
+var _0xfd0f=['moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','VIRTUAL','options','findAll','catch','show','params','keys','intersection','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x2300fa,_0x41c382){var _0x11fef0=function(_0x597ffb){while(--_0x597ffb){_0x2300fa['push'](_0x2300fa['shift']());}};_0x11fef0(++_0x41c382);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x5e871e,_0x4844ba){_0x5e871e=_0x5e871e-0x0;var _0x5086a9=_0xfd0f[_0x5e871e];return _0x5086a9;};'use strict';var emlformat=require(_0xffd0('0x0'));var rimraf=require(_0xffd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffd0('0x2'));var rp=require(_0xffd0('0x3'));var moment=require(_0xffd0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xffd0('0x5'));var util=require('util');var path=require(_0xffd0('0x6'));var sox=require(_0xffd0('0x7'));var csv=require(_0xffd0('0x8'));var ejs=require(_0xffd0('0x9'));var fs=require('fs');var fs_extra=require(_0xffd0('0xa'));var _=require(_0xffd0('0xb'));var squel=require(_0xffd0('0xc'));var crypto=require(_0xffd0('0xd'));var jsforce=require(_0xffd0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xffd0('0x8'));var querystring=require(_0xffd0('0xf'));var Papa=require(_0xffd0('0x10'));var Redis=require(_0xffd0('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xffd0('0x12'));var hardwareService=require(_0xffd0('0x13'));var logger=require(_0xffd0('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xffd0('0x15'));var licenseUtil=require(_0xffd0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa6e1ad,_0xaf12c1){_0xaf12c1=_0xaf12c1||0xcc;return function(_0x2ca16d){if(_0x2ca16d){return _0xa6e1ad['sendStatus'](_0xaf12c1);}return _0xa6e1ad[_0xffd0('0x17')](_0xaf12c1)[_0xffd0('0x18')]();};}function respondWithResult(_0x5be5aa,_0x3cf549){_0x3cf549=_0x3cf549||0xc8;return function(_0x48fc60){if(_0x48fc60){return _0x5be5aa['status'](_0x3cf549)[_0xffd0('0x19')](_0x48fc60);}};}function respondWithFilteredResult(_0x5c799c,_0x321ceb){return function(_0x2e030d){if(_0x2e030d){var _0x15e710=typeof _0x321ceb[_0xffd0('0x1a')]===_0xffd0('0x1b')&&typeof _0x321ceb['limit']==='undefined';var _0x285c52=_0x2e030d[_0xffd0('0x1c')];var _0x2e9463=_0x15e710?0x0:_0x321ceb[_0xffd0('0x1a')];var _0x409b90=_0x15e710?_0x2e030d[_0xffd0('0x1c')]:_0x321ceb[_0xffd0('0x1a')]+_0x321ceb[_0xffd0('0x1d')];var _0x684579;if(_0x409b90>=_0x285c52){_0x409b90=_0x285c52;_0x684579=0xc8;}else{_0x684579=0xce;}_0x5c799c[_0xffd0('0x17')](_0x684579);return _0x5c799c[_0xffd0('0x1e')](_0xffd0('0x1f'),_0x2e9463+'-'+_0x409b90+'/'+_0x285c52)[_0xffd0('0x19')](_0x2e030d);}return null;};}function patchUpdates(_0x19c523){return function(_0x3deed6){try{jsonpatch[_0xffd0('0x20')](_0x3deed6,_0x19c523,!![]);}catch(_0x5219ca){return BPromise['reject'](_0x5219ca);}return _0x3deed6[_0xffd0('0x21')]();};}function saveUpdates(_0x13c117,_0x4fbb72){return function(_0x4f3cb3){if(_0x4f3cb3){return _0x4f3cb3[_0xffd0('0x22')](_0x13c117)['then'](function(_0x10467e){return _0x10467e;});}return null;};}function removeEntity(_0x329864,_0x2c8d64){return function(_0x38f25f){if(_0x38f25f){return _0x38f25f[_0xffd0('0x23')]()[_0xffd0('0x24')](function(){_0x329864[_0xffd0('0x17')](0xcc)[_0xffd0('0x18')]();});}};}function handleEntityNotFound(_0x2e3046,_0x169036){return function(_0x278ba8){if(!_0x278ba8){_0x2e3046[_0xffd0('0x25')](0x194);}return _0x278ba8;};}function handleError(_0x24f135,_0x481c52){_0x481c52=_0x481c52||0x1f4;return function(_0x480322){logger[_0xffd0('0x26')](_0x480322['stack']);if(_0x480322['name']){delete _0x480322[_0xffd0('0x27')];}_0x24f135[_0xffd0('0x17')](_0x481c52)[_0xffd0('0x28')](_0x480322);};}exports[_0xffd0('0x29')]=function(_0x3f5423,_0x22c7fb){var _0x4f8d9c={},_0x14ded1={},_0x4e7367={'count':0x0,'rows':[]};var _0x5c4adb=_['map'](db[_0xffd0('0x2a')][_0xffd0('0x2b')],function(_0x3b71ac){return{'name':_0x3b71ac[_0xffd0('0x2c')],'type':_0x3b71ac[_0xffd0('0x2d')][_0xffd0('0x2e')]};});_0x14ded1['model']=_['map'](_0x5c4adb,'name');_0x14ded1[_0xffd0('0x2f')]=_['keys'](_0x3f5423[_0xffd0('0x2f')]);_0x14ded1[_0xffd0('0x30')]=_['intersection'](_0x14ded1[_0xffd0('0x31')],_0x14ded1['query']);_0x4f8d9c['attributes']=_['intersection'](_0x14ded1[_0xffd0('0x31')],qs[_0xffd0('0x32')](_0x3f5423[_0xffd0('0x2f')][_0xffd0('0x32')]));_0x4f8d9c[_0xffd0('0x33')]=_0x4f8d9c['attributes'][_0xffd0('0x34')]?_0x4f8d9c[_0xffd0('0x33')]:_0x14ded1['model'];if(!_0x3f5423[_0xffd0('0x2f')][_0xffd0('0x35')](_0xffd0('0x36'))){_0x4f8d9c[_0xffd0('0x1d')]=qs[_0xffd0('0x1d')](_0x3f5423[_0xffd0('0x2f')]['limit']);_0x4f8d9c[_0xffd0('0x1a')]=qs[_0xffd0('0x1a')](_0x3f5423['query'][_0xffd0('0x1a')]);}_0x4f8d9c[_0xffd0('0x37')]=qs['sort'](_0x3f5423[_0xffd0('0x2f')][_0xffd0('0x38')]);_0x4f8d9c['where']=qs[_0xffd0('0x30')](_['pick'](_0x3f5423[_0xffd0('0x2f')],_0x14ded1[_0xffd0('0x30')]),_0x5c4adb);if(_0x3f5423['query'][_0xffd0('0x39')]){_0x4f8d9c[_0xffd0('0x3a')]=_[_0xffd0('0x3b')](_0x4f8d9c[_0xffd0('0x3a')],{'$or':_[_0xffd0('0x3c')](_0x5c4adb,function(_0x158efc){if(_0x158efc[_0xffd0('0x2d')]!==_0xffd0('0x3d')){var _0x1cdd8f={};_0x1cdd8f[_0x158efc[_0xffd0('0x27')]]={'$like':'%'+_0x3f5423[_0xffd0('0x2f')][_0xffd0('0x39')]+'%'};return _0x1cdd8f;}})});}_0x4f8d9c=_[_0xffd0('0x3b')]({},_0x4f8d9c,_0x3f5423[_0xffd0('0x3e')]);var _0x5aa4d3={'where':_0x4f8d9c[_0xffd0('0x3a')]};return db[_0xffd0('0x2a')]['count'](_0x5aa4d3)[_0xffd0('0x24')](function(_0xea6cbd){_0x4e7367[_0xffd0('0x1c')]=_0xea6cbd;if(_0x3f5423[_0xffd0('0x2f')]['includeAll']){_0x4f8d9c['include']=[{'all':!![]}];}return db[_0xffd0('0x2a')][_0xffd0('0x3f')](_0x4f8d9c);})[_0xffd0('0x24')](function(_0xc0aa){_0x4e7367['rows']=_0xc0aa;return _0x4e7367;})[_0xffd0('0x24')](respondWithFilteredResult(_0x22c7fb,_0x4f8d9c))[_0xffd0('0x40')](handleError(_0x22c7fb,null));};exports[_0xffd0('0x41')]=function(_0x3bd3e3,_0x237a71){var _0x46833e={'raw':!![],'where':{'id':_0x3bd3e3[_0xffd0('0x42')]['id']}},_0x9558c0={};_0x9558c0[_0xffd0('0x31')]=_[_0xffd0('0x43')](db[_0xffd0('0x2a')][_0xffd0('0x2b')]);_0x9558c0[_0xffd0('0x2f')]=_[_0xffd0('0x43')](_0x3bd3e3[_0xffd0('0x2f')]);_0x9558c0[_0xffd0('0x30')]=_[_0xffd0('0x44')](_0x9558c0[_0xffd0('0x31')],_0x9558c0[_0xffd0('0x2f')]);_0x46833e[_0xffd0('0x33')]=_[_0xffd0('0x44')](_0x9558c0['model'],qs[_0xffd0('0x32')](_0x3bd3e3[_0xffd0('0x2f')][_0xffd0('0x32')]));_0x46833e[_0xffd0('0x33')]=_0x46833e[_0xffd0('0x33')][_0xffd0('0x34')]?_0x46833e[_0xffd0('0x33')]:_0x9558c0[_0xffd0('0x31')];if(_0x3bd3e3[_0xffd0('0x2f')]['includeAll']){_0x46833e[_0xffd0('0x45')]=[{'all':!![]}];}_0x46833e=_[_0xffd0('0x3b')]({},_0x46833e,_0x3bd3e3[_0xffd0('0x3e')]);return db[_0xffd0('0x2a')][_0xffd0('0x46')](_0x46833e)['then'](handleEntityNotFound(_0x237a71,null))['then'](respondWithResult(_0x237a71,null))['catch'](handleError(_0x237a71,null));};exports[_0xffd0('0x47')]=function(_0xcae782,_0x5b3515){return db[_0xffd0('0x2a')][_0xffd0('0x47')](_0xcae782[_0xffd0('0x48')],{})[_0xffd0('0x24')](respondWithResult(_0x5b3515,0xc9))[_0xffd0('0x40')](handleError(_0x5b3515,null));};exports[_0xffd0('0x22')]=function(_0x3b70a7,_0x2c0ffd){if(_0x3b70a7[_0xffd0('0x48')]['id']){delete _0x3b70a7[_0xffd0('0x48')]['id'];}return db[_0xffd0('0x2a')][_0xffd0('0x46')]({'where':{'id':_0x3b70a7[_0xffd0('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c0ffd,null))['then'](saveUpdates(_0x3b70a7[_0xffd0('0x48')],null))[_0xffd0('0x24')](respondWithResult(_0x2c0ffd,null))[_0xffd0('0x40')](handleError(_0x2c0ffd,null));};exports['destroy']=function(_0x35b42e,_0x4bde7d){return db[_0xffd0('0x2a')][_0xffd0('0x46')]({'where':{'id':_0x35b42e[_0xffd0('0x42')]['id']}})[_0xffd0('0x24')](handleEntityNotFound(_0x4bde7d,null))['then'](removeEntity(_0x4bde7d,null))['catch'](handleError(_0x4bde7d,null));};exports['describe']=function(_0x2a0302,_0x24a18d){return db[_0xffd0('0x2a')][_0xffd0('0x49')]()[_0xffd0('0x24')](respondWithResult(_0x24a18d,null))[_0xffd0('0x40')](handleError(_0x24a18d,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index e8e6fa9..968a812 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4f5ba9,_0x507e88){var _0x357bc2=function(_0xa85006){while(--_0xa85006){_0x4f5ba9['push'](_0x4f5ba9['shift']());}};_0x357bc2(++_0x507e88);}(_0x7a54,0x106));var _0x47a5=function(_0x16a73a,_0x4df5bf){_0x16a73a=_0x16a73a-0x0;var _0x1c614f=_0x7a54[_0x16a73a];return _0x1c614f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5cd25f,_0x5baf7e){var _0x30e390=function(_0x313003){while(--_0x313003){_0x5cd25f['push'](_0x5cd25f['shift']());}};_0x30e390(++_0x5baf7e);}(_0x7a54,0x106));var _0x47a5=function(_0x53567a,_0xe0ae6b){_0x53567a=_0x53567a-0x0;var _0x2697d0=_0x7a54[_0x53567a];return _0x2697d0;};'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 4b7ed5b..c728261 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 _0x1c81=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0xad9e64,_0x3ec5cc){var _0x1efabb=function(_0x9e10a2){while(--_0x9e10a2){_0xad9e64['push'](_0xad9e64['shift']());}};_0x1efabb(++_0x3ec5cc);}(_0x1c81,0xe9));var _0x11c8=function(_0x1c2323,_0x9770ee){_0x1c2323=_0x1c2323-0x0;var _0x3e5ed9=_0x1c81[_0x1c2323];return _0x3e5ed9;};'use strict';var _=require(_0x11c8('0x0'));var util=require(_0x11c8('0x1'));var moment=require(_0x11c8('0x2'));var BPromise=require(_0x11c8('0x3'));var rs=require(_0x11c8('0x4'));var fs=require('fs');var Redis=require(_0x11c8('0x5'));var db=require(_0x11c8('0x6'))['db'];var utils=require(_0x11c8('0x7'));var logger=require(_0x11c8('0x8'))('rpc');var config=require(_0x11c8('0x9'));var jayson=require(_0x11c8('0xa'));var client=jayson[_0x11c8('0xb')][_0x11c8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x64d97a,_0x4e32e0,_0x2aa354){return new BPromise(function(_0x4a514b,_0x51ab93){return client[_0x11c8('0xd')](_0x64d97a,_0x2aa354)['then'](function(_0x4f7391){logger[_0x11c8('0xe')](_0x11c8('0xf'),_0x4e32e0,_0x11c8('0x10'));logger[_0x11c8('0x11')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4e32e0,_0x11c8('0x10'),JSON['stringify'](_0x4f7391));if(_0x4f7391[_0x11c8('0x12')]){if(_0x4f7391[_0x11c8('0x12')][_0x11c8('0x13')]===0x1f4){logger['error'](_0x11c8('0xf'),_0x4e32e0,_0x4f7391['error'][_0x11c8('0x14')]);return _0x51ab93(_0x4f7391[_0x11c8('0x12')][_0x11c8('0x14')]);}logger[_0x11c8('0x12')](_0x11c8('0xf'),_0x4e32e0,_0x4f7391[_0x11c8('0x12')][_0x11c8('0x14')]);return _0x4a514b(_0x4f7391[_0x11c8('0x12')]['message']);}else{logger[_0x11c8('0xe')](_0x11c8('0xf'),_0x4e32e0,_0x11c8('0x10'));_0x4a514b(_0x4f7391['result'][_0x11c8('0x14')]);}})['catch'](function(_0x15d150){logger[_0x11c8('0x12')](_0x11c8('0xf'),_0x4e32e0,_0x15d150);_0x51ab93(_0x15d150);});});}
\ No newline at end of file
+var _0xaef8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3ee7e2,_0x15cf09){var _0x1c1f18=function(_0x3426e0){while(--_0x3426e0){_0x3ee7e2['push'](_0x3ee7e2['shift']());}};_0x1c1f18(++_0x15cf09);}(_0xaef8,0x94));var _0x8aef=function(_0x15b042,_0x23fd98){_0x15b042=_0x15b042-0x0;var _0x440fb0=_0xaef8[_0x15b042];return _0x440fb0;};'use strict';var _=require(_0x8aef('0x0'));var util=require(_0x8aef('0x1'));var moment=require(_0x8aef('0x2'));var BPromise=require(_0x8aef('0x3'));var rs=require(_0x8aef('0x4'));var fs=require('fs');var Redis=require(_0x8aef('0x5'));var db=require(_0x8aef('0x6'))['db'];var utils=require(_0x8aef('0x7'));var logger=require(_0x8aef('0x8'))(_0x8aef('0x9'));var config=require(_0x8aef('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36eacb,_0x597d1a,_0x3bde61){return new BPromise(function(_0x191f54,_0x89cddf){return client['request'](_0x36eacb,_0x3bde61)[_0x8aef('0xc')](function(_0x7d5a39){logger[_0x8aef('0xd')]('Cdr,\x20%s,\x20%s',_0x597d1a,_0x8aef('0xe'));logger[_0x8aef('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x597d1a,_0x8aef('0xe'),JSON[_0x8aef('0x10')](_0x7d5a39));if(_0x7d5a39[_0x8aef('0x11')]){if(_0x7d5a39[_0x8aef('0x11')][_0x8aef('0x12')]===0x1f4){logger[_0x8aef('0x11')](_0x8aef('0x13'),_0x597d1a,_0x7d5a39[_0x8aef('0x11')][_0x8aef('0x14')]);return _0x89cddf(_0x7d5a39['error'][_0x8aef('0x14')]);}logger[_0x8aef('0x11')](_0x8aef('0x13'),_0x597d1a,_0x7d5a39[_0x8aef('0x11')]['message']);return _0x191f54(_0x7d5a39[_0x8aef('0x11')][_0x8aef('0x14')]);}else{logger[_0x8aef('0xd')](_0x8aef('0x13'),_0x597d1a,_0x8aef('0xe'));_0x191f54(_0x7d5a39['result']['message']);}})[_0x8aef('0x15')](function(_0x3b7df2){logger[_0x8aef('0x11')](_0x8aef('0x13'),_0x597d1a,_0x3b7df2);_0x89cddf(_0x3b7df2);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index ebbd6ca..6926b86 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(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 _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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2c96ba8..881c463 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 _0xf857=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x133e62,_0x315390){var _0x8f88af=function(_0x32d220){while(--_0x32d220){_0x133e62['push'](_0x133e62['shift']());}};_0x8f88af(++_0x315390);}(_0xf857,0x166));var _0x7f85=function(_0x26d509,_0x2870f6){_0x26d509=_0x26d509-0x0;var _0x2a26be=_0xf857[_0x26d509];return _0x2a26be;};'use strict';var Sequelize=require('sequelize');module[_0x7f85('0x0')]={'priority':{'type':Sequelize[_0x7f85('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7f85('0x2')],'allowNull':![],'defaultValue':_0x7f85('0x3')},'appdata':{'type':Sequelize[_0x7f85('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7f85('0x2')],'defaultValue':_0x7f85('0x5')}};
\ No newline at end of file
+var _0x3d6f=['exports','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x3d6f,0x6d));var _0xf3d6=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0x3d6f[_0xb66df];return _0x42a702;};'use strict';var Sequelize=require(_0xf3d6('0x0'));module[_0xf3d6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf3d6('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf3d6('0x3')]()},'description':{'type':Sequelize[_0xf3d6('0x2')]},'interval':{'type':Sequelize[_0xf3d6('0x2')],'defaultValue':_0xf3d6('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index fc6498a..5b64c90 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 _0x0269=['fields','length','includeAll','include','merge','find','catch','update','body','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes'];(function(_0x1a2e2c,_0x4f69a3){var _0x31075e=function(_0x4a51ea){while(--_0x4a51ea){_0x1a2e2c['push'](_0x1a2e2c['shift']());}};_0x31075e(++_0x4f69a3);}(_0x0269,0x135));var _0x9026=function(_0x2bd31e,_0x365971){_0x2bd31e=_0x2bd31e-0x0;var _0x26fe2c=_0x0269[_0x2bd31e];return _0x26fe2c;};'use strict';var emlformat=require(_0x9026('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9026('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9026('0x2'));var moment=require('moment');var BPromise=require(_0x9026('0x3'));var Mustache=require(_0x9026('0x4'));var util=require(_0x9026('0x5'));var path=require(_0x9026('0x6'));var sox=require('sox');var csv=require(_0x9026('0x7'));var ejs=require(_0x9026('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9026('0x9'));var crypto=require(_0x9026('0xa'));var jsforce=require(_0x9026('0xb'));var deskjs=require(_0x9026('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9026('0xd'));var Papa=require(_0x9026('0xe'));var Redis=require(_0x9026('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9026('0x10'));var as=require(_0x9026('0x11'));var hardwareService=require(_0x9026('0x12'));var logger=require('../../config/logger')(_0x9026('0x13'));var utils=require('../../config/utils');var config=require(_0x9026('0x14'));var licenseUtil=require(_0x9026('0x15'));var db=require(_0x9026('0x16'))['db'];function respondWithStatusCode(_0x2148f0,_0x40f526){_0x40f526=_0x40f526||0xcc;return function(_0x40b5dd){if(_0x40b5dd){return _0x2148f0[_0x9026('0x17')](_0x40f526);}return _0x2148f0['status'](_0x40f526)[_0x9026('0x18')]();};}function respondWithResult(_0x4ee699,_0x385afc){_0x385afc=_0x385afc||0xc8;return function(_0x2612cd){if(_0x2612cd){return _0x4ee699[_0x9026('0x19')](_0x385afc)[_0x9026('0x1a')](_0x2612cd);}};}function respondWithFilteredResult(_0x11c0d1,_0x421ee2){return function(_0x142465){if(_0x142465){var _0x1eb679=typeof _0x421ee2['offset']===_0x9026('0x1b')&&typeof _0x421ee2[_0x9026('0x1c')]==='undefined';var _0xc68011=_0x142465[_0x9026('0x1d')];var _0x15b3ab=_0x1eb679?0x0:_0x421ee2[_0x9026('0x1e')];var _0x1d1613=_0x1eb679?_0x142465[_0x9026('0x1d')]:_0x421ee2[_0x9026('0x1e')]+_0x421ee2[_0x9026('0x1c')];var _0x52edf1;if(_0x1d1613>=_0xc68011){_0x1d1613=_0xc68011;_0x52edf1=0xc8;}else{_0x52edf1=0xce;}_0x11c0d1[_0x9026('0x19')](_0x52edf1);return _0x11c0d1['set'](_0x9026('0x1f'),_0x15b3ab+'-'+_0x1d1613+'/'+_0xc68011)['json'](_0x142465);}return null;};}function patchUpdates(_0x2a9bf0){return function(_0x1b03af){try{jsonpatch[_0x9026('0x20')](_0x1b03af,_0x2a9bf0,!![]);}catch(_0x22a77c){return BPromise[_0x9026('0x21')](_0x22a77c);}return _0x1b03af[_0x9026('0x22')]();};}function saveUpdates(_0x71a263,_0x39f515){return function(_0x12e0b3){if(_0x12e0b3){return _0x12e0b3['update'](_0x71a263)['then'](function(_0x7b962){return _0x7b962;});}return null;};}function removeEntity(_0x134221,_0x2968fb){return function(_0x82a8e0){if(_0x82a8e0){return _0x82a8e0[_0x9026('0x23')]()[_0x9026('0x24')](function(){_0x134221[_0x9026('0x19')](0xcc)[_0x9026('0x18')]();});}};}function handleEntityNotFound(_0x775596,_0x4293df){return function(_0xde5c83){if(!_0xde5c83){_0x775596[_0x9026('0x17')](0x194);}return _0xde5c83;};}function handleError(_0x38fd9c,_0x2ace13){_0x2ace13=_0x2ace13||0x1f4;return function(_0x28dba4){logger[_0x9026('0x25')](_0x28dba4[_0x9026('0x26')]);if(_0x28dba4[_0x9026('0x27')]){delete _0x28dba4[_0x9026('0x27')];}_0x38fd9c['status'](_0x2ace13)[_0x9026('0x28')](_0x28dba4);};}exports[_0x9026('0x29')]=function(_0x30c988,_0x103ce7){var _0x17dc25={'raw':!![],'where':{'id':_0x30c988[_0x9026('0x2a')]['id']}},_0x3cead8={};_0x3cead8[_0x9026('0x2b')]=_[_0x9026('0x2c')](db[_0x9026('0x2d')][_0x9026('0x2e')]);_0x3cead8['query']=_[_0x9026('0x2c')](_0x30c988[_0x9026('0x2f')]);_0x3cead8[_0x9026('0x30')]=_[_0x9026('0x31')](_0x3cead8[_0x9026('0x2b')],_0x3cead8[_0x9026('0x2f')]);_0x17dc25[_0x9026('0x32')]=_['intersection'](_0x3cead8[_0x9026('0x2b')],qs['fields'](_0x30c988[_0x9026('0x2f')][_0x9026('0x33')]));_0x17dc25[_0x9026('0x32')]=_0x17dc25[_0x9026('0x32')][_0x9026('0x34')]?_0x17dc25[_0x9026('0x32')]:_0x3cead8['model'];if(_0x30c988[_0x9026('0x2f')][_0x9026('0x35')]){_0x17dc25[_0x9026('0x36')]=[{'all':!![]}];}_0x17dc25=_[_0x9026('0x37')]({},_0x17dc25,_0x30c988['options']);return db[_0x9026('0x2d')][_0x9026('0x38')](_0x17dc25)['then'](handleEntityNotFound(_0x103ce7,null))[_0x9026('0x24')](respondWithResult(_0x103ce7,null))[_0x9026('0x39')](handleError(_0x103ce7,null));};exports[_0x9026('0x3a')]=function(_0xe63aad,_0x333e59){if(_0xe63aad[_0x9026('0x3b')]['id']){delete _0xe63aad[_0x9026('0x3b')]['id'];}return db[_0x9026('0x2d')]['find']({'where':{'id':_0xe63aad[_0x9026('0x2a')]['id']}})[_0x9026('0x24')](handleEntityNotFound(_0x333e59,null))['then'](saveUpdates(_0xe63aad[_0x9026('0x3b')],null))[_0x9026('0x24')](respondWithResult(_0x333e59,null))[_0x9026('0x39')](handleError(_0x333e59,null));};exports[_0x9026('0x23')]=function(_0xa251a,_0x240f8a){return db[_0x9026('0x2d')][_0x9026('0x38')]({'where':{'id':_0xa251a['params']['id']}})[_0x9026('0x24')](handleEntityNotFound(_0x240f8a,null))[_0x9026('0x24')](removeEntity(_0x240f8a,null))[_0x9026('0x39')](handleError(_0x240f8a,null));};
\ No newline at end of file
+var _0x4ad3=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1d3019,_0x8dbbd5){var _0x36458e=function(_0x5d60db){while(--_0x5d60db){_0x1d3019['push'](_0x1d3019['shift']());}};_0x36458e(++_0x8dbbd5);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x4ad3[_0x5180c3];return _0x55c975;};'use strict';var emlformat=require(_0x34ad('0x0'));var rimraf=require(_0x34ad('0x1'));var zipdir=require(_0x34ad('0x2'));var jsonpatch=require(_0x34ad('0x3'));var rp=require(_0x34ad('0x4'));var moment=require(_0x34ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x34ad('0x6'));var util=require(_0x34ad('0x7'));var path=require(_0x34ad('0x8'));var sox=require(_0x34ad('0x9'));var csv=require(_0x34ad('0xa'));var ejs=require(_0x34ad('0xb'));var fs=require('fs');var fs_extra=require(_0x34ad('0xc'));var _=require(_0x34ad('0xd'));var squel=require(_0x34ad('0xe'));var crypto=require(_0x34ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x34ad('0xa'));var querystring=require(_0x34ad('0x10'));var Papa=require(_0x34ad('0x11'));var Redis=require(_0x34ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x34ad('0x13'));var as=require(_0x34ad('0x14'));var hardwareService=require(_0x34ad('0x15'));var logger=require(_0x34ad('0x16'))(_0x34ad('0x17'));var utils=require(_0x34ad('0x18'));var config=require(_0x34ad('0x19'));var licenseUtil=require(_0x34ad('0x1a'));var db=require(_0x34ad('0x1b'))['db'];function respondWithStatusCode(_0x377c90,_0x14c9fd){_0x14c9fd=_0x14c9fd||0xcc;return function(_0x1be906){if(_0x1be906){return _0x377c90[_0x34ad('0x1c')](_0x14c9fd);}return _0x377c90[_0x34ad('0x1d')](_0x14c9fd)[_0x34ad('0x1e')]();};}function respondWithResult(_0xc64e62,_0x558097){_0x558097=_0x558097||0xc8;return function(_0x4764e9){if(_0x4764e9){return _0xc64e62[_0x34ad('0x1d')](_0x558097)[_0x34ad('0x1f')](_0x4764e9);}};}function respondWithFilteredResult(_0x5e2a1d,_0x21a78c){return function(_0x262123){if(_0x262123){var _0x38a15e=typeof _0x21a78c[_0x34ad('0x20')]===_0x34ad('0x21')&&typeof _0x21a78c['limit']===_0x34ad('0x21');var _0x4daa5c=_0x262123[_0x34ad('0x22')];var _0x294326=_0x38a15e?0x0:_0x21a78c[_0x34ad('0x20')];var _0x7036e0=_0x38a15e?_0x262123[_0x34ad('0x22')]:_0x21a78c['offset']+_0x21a78c[_0x34ad('0x23')];var _0x3a2cd5;if(_0x7036e0>=_0x4daa5c){_0x7036e0=_0x4daa5c;_0x3a2cd5=0xc8;}else{_0x3a2cd5=0xce;}_0x5e2a1d[_0x34ad('0x1d')](_0x3a2cd5);return _0x5e2a1d[_0x34ad('0x24')](_0x34ad('0x25'),_0x294326+'-'+_0x7036e0+'/'+_0x4daa5c)[_0x34ad('0x1f')](_0x262123);}return null;};}function patchUpdates(_0x3c178a){return function(_0x45557e){try{jsonpatch[_0x34ad('0x26')](_0x45557e,_0x3c178a,!![]);}catch(_0x55140c){return BPromise[_0x34ad('0x27')](_0x55140c);}return _0x45557e['save']();};}function saveUpdates(_0x1c2d49,_0x493f73){return function(_0x154ee8){if(_0x154ee8){return _0x154ee8[_0x34ad('0x28')](_0x1c2d49)[_0x34ad('0x29')](function(_0x1c2fa5){return _0x1c2fa5;});}return null;};}function removeEntity(_0x737c2d,_0x4a06a7){return function(_0x5a8379){if(_0x5a8379){return _0x5a8379[_0x34ad('0x2a')]()['then'](function(){_0x737c2d[_0x34ad('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d5495,_0x34d2ae){return function(_0x3df4ca){if(!_0x3df4ca){_0x5d5495[_0x34ad('0x1c')](0x194);}return _0x3df4ca;};}function handleError(_0x3cb657,_0x17fc51){_0x17fc51=_0x17fc51||0x1f4;return function(_0x320b6a){logger[_0x34ad('0x2b')](_0x320b6a[_0x34ad('0x2c')]);if(_0x320b6a[_0x34ad('0x2d')]){delete _0x320b6a[_0x34ad('0x2d')];}_0x3cb657['status'](_0x17fc51)[_0x34ad('0x2e')](_0x320b6a);};}exports[_0x34ad('0x2f')]=function(_0x23bb04,_0x31b880){var _0x2bcdc3={'raw':!![],'where':{'id':_0x23bb04[_0x34ad('0x30')]['id']}},_0x1b2387={};_0x1b2387[_0x34ad('0x31')]=_[_0x34ad('0x32')](db[_0x34ad('0x33')][_0x34ad('0x34')]);_0x1b2387[_0x34ad('0x35')]=_[_0x34ad('0x32')](_0x23bb04[_0x34ad('0x35')]);_0x1b2387[_0x34ad('0x36')]=_[_0x34ad('0x37')](_0x1b2387['model'],_0x1b2387[_0x34ad('0x35')]);_0x2bcdc3['attributes']=_[_0x34ad('0x37')](_0x1b2387[_0x34ad('0x31')],qs[_0x34ad('0x38')](_0x23bb04[_0x34ad('0x35')]['fields']));_0x2bcdc3[_0x34ad('0x39')]=_0x2bcdc3[_0x34ad('0x39')][_0x34ad('0x3a')]?_0x2bcdc3[_0x34ad('0x39')]:_0x1b2387['model'];if(_0x23bb04['query']['includeAll']){_0x2bcdc3[_0x34ad('0x3b')]=[{'all':!![]}];}_0x2bcdc3=_[_0x34ad('0x3c')]({},_0x2bcdc3,_0x23bb04[_0x34ad('0x3d')]);return db[_0x34ad('0x33')][_0x34ad('0x3e')](_0x2bcdc3)['then'](handleEntityNotFound(_0x31b880,null))[_0x34ad('0x29')](respondWithResult(_0x31b880,null))[_0x34ad('0x3f')](handleError(_0x31b880,null));};exports[_0x34ad('0x28')]=function(_0x2a3330,_0x1b79b3){if(_0x2a3330[_0x34ad('0x40')]['id']){delete _0x2a3330[_0x34ad('0x40')]['id'];}return db[_0x34ad('0x33')][_0x34ad('0x3e')]({'where':{'id':_0x2a3330[_0x34ad('0x30')]['id']}})[_0x34ad('0x29')](handleEntityNotFound(_0x1b79b3,null))[_0x34ad('0x29')](saveUpdates(_0x2a3330[_0x34ad('0x40')],null))[_0x34ad('0x29')](respondWithResult(_0x1b79b3,null))[_0x34ad('0x3f')](handleError(_0x1b79b3,null));};exports[_0x34ad('0x2a')]=function(_0x41a5a2,_0x23e15b){return db[_0x34ad('0x33')][_0x34ad('0x3e')]({'where':{'id':_0x41a5a2['params']['id']}})['then'](handleEntityNotFound(_0x23e15b,null))[_0x34ad('0x29')](removeEntity(_0x23e15b,null))[_0x34ad('0x3f')](handleError(_0x23e15b,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 8e41777..d7f5e3d 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 _0x3182=['ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','../../config/environment','exports','define'];(function(_0xf2bab5,_0x1d6f3b){var _0x2f17bc=function(_0x305fbb){while(--_0x305fbb){_0xf2bab5['push'](_0xf2bab5['shift']());}};_0x2f17bc(++_0x1d6f3b);}(_0x3182,0x99));var _0x2318=function(_0x1fd173,_0x22b599){_0x1fd173=_0x1fd173-0x0;var _0x18bd7b=_0x3182[_0x1fd173];return _0x18bd7b;};'use strict';var _=require(_0x2318('0x0'));var util=require('util');var logger=require(_0x2318('0x1'))('api');var moment=require(_0x2318('0x2'));var BPromise=require('bluebird');var rp=require(_0x2318('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2318('0x4'));var attributes=require('./chatApplication.attributes');module[_0x2318('0x5')]=function(_0x2125b9,_0xe140e9){return _0x2125b9[_0x2318('0x6')](_0x2318('0x7'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2318('0x8'),'collate':_0x2318('0x9')});};
\ No newline at end of file
+var _0xa3d4=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x3d731a,_0x50aa07){var _0x4413b2=function(_0x1746d6){while(--_0x1746d6){_0x3d731a['push'](_0x3d731a['shift']());}};_0x4413b2(++_0x50aa07);}(_0xa3d4,0x12e));var _0x4a3d=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xa3d4[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0x4a3d('0x0'));var logger=require(_0x4a3d('0x1'))(_0x4a3d('0x2'));var moment=require('moment');var BPromise=require(_0x4a3d('0x3'));var rp=require(_0x4a3d('0x4'));var fs=require('fs');var path=require(_0x4a3d('0x5'));var rimraf=require(_0x4a3d('0x6'));var config=require(_0x4a3d('0x7'));var attributes=require(_0x4a3d('0x8'));module[_0x4a3d('0x9')]=function(_0x5bb9d0,_0x486c9b){return _0x5bb9d0[_0x4a3d('0xa')](_0x4a3d('0xb'),attributes,{'tableName':_0x4a3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a3d('0xd'),'collate':_0x4a3d('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index a7245ce..bc439fb 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 _0x01b5=['error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x57bea4,_0x5bd929){var _0x961b47=function(_0x31f438){while(--_0x31f438){_0x57bea4['push'](_0x57bea4['shift']());}};_0x961b47(++_0x5bd929);}(_0x01b5,0xdb));var _0x501b=function(_0x5ef221,_0x110fd8){_0x5ef221=_0x5ef221-0x0;var _0x2f66bc=_0x01b5[_0x5ef221];return _0x2f66bc;};'use strict';var _=require(_0x501b('0x0'));var util=require(_0x501b('0x1'));var moment=require('moment');var BPromise=require(_0x501b('0x2'));var rs=require(_0x501b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x501b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x501b('0x5'))(_0x501b('0x6'));var config=require(_0x501b('0x7'));var jayson=require(_0x501b('0x8'));var client=jayson[_0x501b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2891dc,_0x17ee7f,_0x55a38b){return new BPromise(function(_0xf75529,_0x40d722){return client[_0x501b('0xa')](_0x2891dc,_0x55a38b)['then'](function(_0x1c061b){logger[_0x501b('0xb')](_0x501b('0xc'),_0x17ee7f,'request\x20sent');logger['debug'](_0x501b('0xd'),_0x17ee7f,_0x501b('0xe'),JSON['stringify'](_0x1c061b));if(_0x1c061b[_0x501b('0xf')]){if(_0x1c061b[_0x501b('0xf')][_0x501b('0x10')]===0x1f4){logger[_0x501b('0xf')](_0x501b('0xc'),_0x17ee7f,_0x1c061b[_0x501b('0xf')][_0x501b('0x11')]);return _0x40d722(_0x1c061b['error'][_0x501b('0x11')]);}logger[_0x501b('0xf')](_0x501b('0xc'),_0x17ee7f,_0x1c061b[_0x501b('0xf')][_0x501b('0x11')]);return _0xf75529(_0x1c061b['error'][_0x501b('0x11')]);}else{logger['info'](_0x501b('0xc'),_0x17ee7f,_0x501b('0xe'));_0xf75529(_0x1c061b['result']['message']);}})['catch'](function(_0x1f2031){logger[_0x501b('0xf')](_0x501b('0xc'),_0x17ee7f,_0x1f2031);_0x40d722(_0x1f2031);});});}
\ No newline at end of file
+var _0xd6d8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring'];(function(_0x3863ab,_0xf0364){var _0x330834=function(_0x18ae83){while(--_0x18ae83){_0x3863ab['push'](_0x3863ab['shift']());}};_0x330834(++_0xf0364);}(_0xd6d8,0x147));var _0x8d6d=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xd6d8[_0xffa198];return _0x1e4b50;};'use strict';var _=require('lodash');var util=require(_0x8d6d('0x0'));var moment=require('moment');var BPromise=require(_0x8d6d('0x1'));var rs=require(_0x8d6d('0x2'));var fs=require('fs');var Redis=require(_0x8d6d('0x3'));var db=require(_0x8d6d('0x4'))['db'];var utils=require(_0x8d6d('0x5'));var logger=require(_0x8d6d('0x6'))(_0x8d6d('0x7'));var config=require(_0x8d6d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8d6d('0x9')][_0x8d6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40f6ee,_0x377bca,_0x249d87){return new BPromise(function(_0x1017e4,_0x3d8e10){return client[_0x8d6d('0xb')](_0x40f6ee,_0x249d87)[_0x8d6d('0xc')](function(_0x5f15b){logger[_0x8d6d('0xd')](_0x8d6d('0xe'),_0x377bca,_0x8d6d('0xf'));logger[_0x8d6d('0x10')](_0x8d6d('0x11'),_0x377bca,'request\x20sent',JSON['stringify'](_0x5f15b));if(_0x5f15b[_0x8d6d('0x12')]){if(_0x5f15b[_0x8d6d('0x12')][_0x8d6d('0x13')]===0x1f4){logger[_0x8d6d('0x12')](_0x8d6d('0xe'),_0x377bca,_0x5f15b[_0x8d6d('0x12')]['message']);return _0x3d8e10(_0x5f15b['error'][_0x8d6d('0x14')]);}logger[_0x8d6d('0x12')]('ChatApplication,\x20%s,\x20%s',_0x377bca,_0x5f15b[_0x8d6d('0x12')][_0x8d6d('0x14')]);return _0x1017e4(_0x5f15b[_0x8d6d('0x12')][_0x8d6d('0x14')]);}else{logger[_0x8d6d('0xd')](_0x8d6d('0xe'),_0x377bca,_0x8d6d('0xf'));_0x1017e4(_0x5f15b['result'][_0x8d6d('0x14')]);}})[_0x8d6d('0x15')](function(_0x263e4a){logger[_0x8d6d('0x12')](_0x8d6d('0xe'),_0x377bca,_0x263e4a);_0x3d8e10(_0x263e4a);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 75b758c..3d83585 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 _0x1c9e=['fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x1f2e5e,_0x36db41){var _0x16fcdb=function(_0x37fae9){while(--_0x37fae9){_0x1f2e5e['push'](_0x1f2e5e['shift']());}};_0x16fcdb(++_0x36db41);}(_0x1c9e,0xcc));var _0xe1c9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1c9e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe1c9('0x0'));var util=require(_0xe1c9('0x1'));var path=require(_0xe1c9('0x2'));var timeout=require(_0xe1c9('0x3'));var express=require(_0xe1c9('0x4'));var router=express[_0xe1c9('0x5')]();var fs_extra=require(_0xe1c9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe1c9('0x7'));var config=require(_0xe1c9('0x8'));var controller=require('./chatApplication.controller');router[_0xe1c9('0x9')](_0xe1c9('0xa'),auth[_0xe1c9('0xb')](),controller[_0xe1c9('0xc')]);router['put'](_0xe1c9('0xa'),auth[_0xe1c9('0xb')](),controller[_0xe1c9('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe1c9('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x149d=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','update'];(function(_0x585db0,_0x8c8694){var _0x56584c=function(_0x40a718){while(--_0x40a718){_0x585db0['push'](_0x585db0['shift']());}};_0x56584c(++_0x8c8694);}(_0x149d,0x99));var _0xd149=function(_0x139e8d,_0xa2de80){_0x139e8d=_0x139e8d-0x0;var _0x40e60f=_0x149d[_0x139e8d];return _0x40e60f;};'use strict';var multer=require(_0xd149('0x0'));var util=require(_0xd149('0x1'));var path=require(_0xd149('0x2'));var timeout=require(_0xd149('0x3'));var express=require(_0xd149('0x4'));var router=express['Router']();var fs_extra=require(_0xd149('0x5'));var auth=require(_0xd149('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd149('0x7'));var controller=require('./chatApplication.controller');router[_0xd149('0x8')]('/:id',auth[_0xd149('0x9')](),controller['show']);router['put'](_0xd149('0xa'),auth[_0xd149('0x9')](),controller[_0xd149('0xb')]);router[_0xd149('0xc')](_0xd149('0xa'),auth[_0xd149('0x9')](),controller[_0xd149('0xd')]);module[_0xd149('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 6c49546..656a4c2 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 _0x7bd5=['BOOLEAN','sequelize','STRING'];(function(_0xac8d0e,_0x5abac1){var _0x4aa882=function(_0x39dd3b){while(--_0x39dd3b){_0xac8d0e['push'](_0xac8d0e['shift']());}};_0x4aa882(++_0x5abac1);}(_0x7bd5,0x8e));var _0x57bd=function(_0x56c162,_0x68d55f){_0x56c162=_0x56c162-0x0;var _0x40a60f=_0x7bd5[_0x56c162];return _0x40a60f;};'use strict';var Sequelize=require(_0x57bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x57bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x57bd('0x1')]},'write':{'type':Sequelize[_0x57bd('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x69f8=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2f0c67,_0x253265){var _0x1199ae=function(_0x1dbbc4){while(--_0x1dbbc4){_0x2f0c67['push'](_0x2f0c67['shift']());}};_0x1199ae(++_0x253265);}(_0x69f8,0x14c));var _0x869f=function(_0x4d5aa4,_0x4acef5){_0x4d5aa4=_0x4d5aa4-0x0;var _0x1cab74=_0x69f8[_0x4d5aa4];return _0x1cab74;};'use strict';var Sequelize=require(_0x869f('0x0'));module[_0x869f('0x1')]={'name':{'type':Sequelize[_0x869f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x869f('0x2')]},'write':{'type':Sequelize[_0x869f('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 d2d829c..f3c6b1a 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 _0xe862=['stack','name','index','map','ChatGroup','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','findOne','User','pick','filter','where','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','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','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error'];(function(_0x3c22f7,_0x1fb12a){var _0x537f59=function(_0x471688){while(--_0x471688){_0x3c22f7['push'](_0x3c22f7['shift']());}};_0x537f59(++_0x1fb12a);}(_0xe862,0x1bd));var _0x2e86=function(_0x312580,_0xe57338){_0x312580=_0x312580-0x0;var _0xb6953a=_0xe862[_0x312580];return _0xb6953a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e86('0x0'));var jsonpatch=require(_0x2e86('0x1'));var rp=require(_0x2e86('0x2'));var moment=require(_0x2e86('0x3'));var BPromise=require(_0x2e86('0x4'));var Mustache=require('mustache');var util=require(_0x2e86('0x5'));var path=require(_0x2e86('0x6'));var sox=require('sox');var csv=require(_0x2e86('0x7'));var ejs=require(_0x2e86('0x8'));var fs=require('fs');var fs_extra=require(_0x2e86('0x9'));var _=require(_0x2e86('0xa'));var squel=require(_0x2e86('0xb'));var crypto=require(_0x2e86('0xc'));var jsforce=require(_0x2e86('0xd'));var deskjs=require(_0x2e86('0xe'));var toCsv=require(_0x2e86('0x7'));var querystring=require(_0x2e86('0xf'));var Papa=require('papaparse');var Redis=require(_0x2e86('0x10'));var authService=require(_0x2e86('0x11'));var qs=require(_0x2e86('0x12'));var as=require(_0x2e86('0x13'));var hardwareService=require(_0x2e86('0x14'));var logger=require(_0x2e86('0x15'))(_0x2e86('0x16'));var utils=require(_0x2e86('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x2e86('0x18')](config[_0x2e86('0x19')],{'host':_0x2e86('0x1a'),'port':0x18eb});var socket=require(_0x2e86('0x1b'))(new Redis(config[_0x2e86('0x19')]));require(_0x2e86('0x1c'))[_0x2e86('0x1d')](socket);function respondWithStatusCode(_0xa4c51c,_0x1cf598){_0x1cf598=_0x1cf598||0xcc;return function(_0x41e96c){if(_0x41e96c){return _0xa4c51c[_0x2e86('0x1e')](_0x1cf598);}return _0xa4c51c['status'](_0x1cf598)['end']();};}function respondWithResult(_0xdd668a,_0x12800f){_0x12800f=_0x12800f||0xc8;return function(_0x287c5c){if(_0x287c5c){return _0xdd668a[_0x2e86('0x1f')](_0x12800f)[_0x2e86('0x20')](_0x287c5c);}};}function respondWithFilteredResult(_0xc71391,_0x378ab7){return function(_0x3eca9f){if(_0x3eca9f){var _0x5d30b2=typeof _0x378ab7[_0x2e86('0x21')]===_0x2e86('0x22')&&typeof _0x378ab7[_0x2e86('0x23')]===_0x2e86('0x22');var _0x1e6b64=_0x3eca9f[_0x2e86('0x24')];var _0x289020=_0x5d30b2?0x0:_0x378ab7[_0x2e86('0x21')];var _0x2be622=_0x5d30b2?_0x3eca9f[_0x2e86('0x24')]:_0x378ab7[_0x2e86('0x21')]+_0x378ab7[_0x2e86('0x23')];var _0x4693f;if(_0x2be622>=_0x1e6b64){_0x2be622=_0x1e6b64;_0x4693f=0xc8;}else{_0x4693f=0xce;}_0xc71391['status'](_0x4693f);return _0xc71391[_0x2e86('0x25')](_0x2e86('0x26'),_0x289020+'-'+_0x2be622+'/'+_0x1e6b64)['json'](_0x3eca9f);}return null;};}function patchUpdates(_0x52ea96){return function(_0x516b61){try{jsonpatch['apply'](_0x516b61,_0x52ea96,!![]);}catch(_0x5721cc){return BPromise['reject'](_0x5721cc);}return _0x516b61[_0x2e86('0x27')]();};}function saveUpdates(_0x1ef1af,_0x260542){return function(_0x3265d7){if(_0x3265d7){return _0x3265d7[_0x2e86('0x28')](_0x1ef1af)[_0x2e86('0x29')](function(_0xdd82d1){return _0xdd82d1;});}return null;};}function removeEntity(_0x2de7b6,_0x43b258){return function(_0x46917a){if(_0x46917a){return _0x46917a[_0x2e86('0x2a')]()[_0x2e86('0x29')](function(){_0x2de7b6['status'](0xcc)[_0x2e86('0x2b')]();});}};}function handleEntityNotFound(_0x6fe03f,_0x26af74){return function(_0x4422d8){if(!_0x4422d8){_0x6fe03f[_0x2e86('0x1e')](0x194);}return _0x4422d8;};}function handleError(_0x4c1e4f,_0x57e137){_0x57e137=_0x57e137||0x1f4;return function(_0x2a4025){logger[_0x2e86('0x2c')](_0x2a4025[_0x2e86('0x2d')]);if(_0x2a4025[_0x2e86('0x2e')]){delete _0x2a4025[_0x2e86('0x2e')];}_0x4c1e4f['status'](_0x57e137)['send'](_0x2a4025);};}exports[_0x2e86('0x2f')]=function(_0x4459e8,_0x15e0b6){var _0x826efd={},_0x3ec655={},_0x3903e1={'count':0x0,'rows':[]};var _0x3ab52b=_[_0x2e86('0x30')](db[_0x2e86('0x31')]['rawAttributes'],function(_0x3f31b5){return{'name':_0x3f31b5[_0x2e86('0x32')],'type':_0x3f31b5[_0x2e86('0x33')]['key']};});_0x3ec655[_0x2e86('0x34')]=_['map'](_0x3ab52b,_0x2e86('0x2e'));_0x3ec655[_0x2e86('0x35')]=_['keys'](_0x4459e8[_0x2e86('0x35')]);_0x3ec655['filters']=_['intersection'](_0x3ec655[_0x2e86('0x34')],_0x3ec655[_0x2e86('0x35')]);_0x826efd[_0x2e86('0x36')]=_[_0x2e86('0x37')](_0x3ec655[_0x2e86('0x34')],qs[_0x2e86('0x38')](_0x4459e8[_0x2e86('0x35')][_0x2e86('0x38')]));_0x826efd[_0x2e86('0x36')]=_0x826efd[_0x2e86('0x36')][_0x2e86('0x39')]?_0x826efd['attributes']:_0x3ec655[_0x2e86('0x34')];if(!_0x4459e8[_0x2e86('0x35')][_0x2e86('0x3a')](_0x2e86('0x3b'))){_0x826efd[_0x2e86('0x23')]=qs['limit'](_0x4459e8[_0x2e86('0x35')]['limit']);_0x826efd[_0x2e86('0x21')]=qs['offset'](_0x4459e8[_0x2e86('0x35')]['offset']);}_0x826efd[_0x2e86('0x3c')]=qs[_0x2e86('0x3d')](_0x4459e8[_0x2e86('0x35')][_0x2e86('0x3d')]);_0x826efd['where']=qs[_0x2e86('0x3e')](_['pick'](_0x4459e8[_0x2e86('0x35')],_0x3ec655[_0x2e86('0x3e')]),_0x3ab52b);if(_0x4459e8[_0x2e86('0x35')]['filter']){_0x826efd['where']=_[_0x2e86('0x3f')](_0x826efd['where'],{'$or':_[_0x2e86('0x30')](_0x3ab52b,function(_0xf65895){if(_0xf65895[_0x2e86('0x33')]!==_0x2e86('0x40')){var _0x4f1b85={};_0x4f1b85[_0xf65895['name']]={'$like':'%'+_0x4459e8[_0x2e86('0x35')]['filter']+'%'};return _0x4f1b85;}})});}_0x826efd=_[_0x2e86('0x3f')]({},_0x826efd,_0x4459e8[_0x2e86('0x41')]);var _0x4fab0e={'where':_0x826efd['where']};return db[_0x2e86('0x31')][_0x2e86('0x24')](_0x4fab0e)[_0x2e86('0x29')](function(_0x18e978){_0x3903e1[_0x2e86('0x24')]=_0x18e978;if(_0x4459e8['query'][_0x2e86('0x42')]){_0x826efd[_0x2e86('0x43')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x826efd);})['then'](function(_0x217e00){_0x3903e1[_0x2e86('0x44')]=_0x217e00;return _0x3903e1;})[_0x2e86('0x29')](respondWithFilteredResult(_0x15e0b6,_0x826efd))[_0x2e86('0x45')](handleError(_0x15e0b6,null));};exports[_0x2e86('0x46')]=function(_0x16cff0,_0x273d66){var _0x46201d={'raw':!![],'where':{'id':_0x16cff0[_0x2e86('0x47')]['id']}},_0x45e994={};_0x45e994[_0x2e86('0x34')]=_[_0x2e86('0x48')](db[_0x2e86('0x31')][_0x2e86('0x49')]);_0x45e994['query']=_[_0x2e86('0x48')](_0x16cff0[_0x2e86('0x35')]);_0x45e994[_0x2e86('0x3e')]=_[_0x2e86('0x37')](_0x45e994[_0x2e86('0x34')],_0x45e994['query']);_0x46201d[_0x2e86('0x36')]=_[_0x2e86('0x37')](_0x45e994[_0x2e86('0x34')],qs['fields'](_0x16cff0['query'][_0x2e86('0x38')]));_0x46201d['attributes']=_0x46201d[_0x2e86('0x36')][_0x2e86('0x39')]?_0x46201d[_0x2e86('0x36')]:_0x45e994[_0x2e86('0x34')];if(_0x16cff0['query'][_0x2e86('0x42')]){_0x46201d['include']=[{'all':!![]}];}_0x46201d=_[_0x2e86('0x3f')]({},_0x46201d,_0x16cff0[_0x2e86('0x41')]);return db[_0x2e86('0x31')]['find'](_0x46201d)[_0x2e86('0x29')](handleEntityNotFound(_0x273d66,null))[_0x2e86('0x29')](respondWithResult(_0x273d66,null))[_0x2e86('0x45')](handleError(_0x273d66,null));};exports[_0x2e86('0x4a')]=function(_0x2436fc,_0x34aae3){return db[_0x2e86('0x31')][_0x2e86('0x4a')](_0x2436fc[_0x2e86('0x4b')],{})['then'](respondWithResult(_0x34aae3,0xc9))[_0x2e86('0x45')](handleError(_0x34aae3,null));};exports['update']=function(_0x20e817,_0x4c5de9){if(_0x20e817[_0x2e86('0x4b')]['id']){delete _0x20e817[_0x2e86('0x4b')]['id'];}return db[_0x2e86('0x31')]['find']({'where':{'id':_0x20e817['params']['id']}})[_0x2e86('0x29')](handleEntityNotFound(_0x4c5de9,null))[_0x2e86('0x29')](saveUpdates(_0x20e817[_0x2e86('0x4b')],null))['then'](respondWithResult(_0x4c5de9,null))['catch'](handleError(_0x4c5de9,null));};exports[_0x2e86('0x2a')]=function(_0x2404ca,_0x26fdaa){return db['ChatGroup'][_0x2e86('0x4c')]({'where':{'id':_0x2404ca[_0x2e86('0x47')]['id']}})[_0x2e86('0x29')](handleEntityNotFound(_0x26fdaa,null))[_0x2e86('0x29')](removeEntity(_0x26fdaa,null))['catch'](handleError(_0x26fdaa,null));};exports[_0x2e86('0x4d')]=function(_0x4052ee,_0x254199){return db['ChatGroup'][_0x2e86('0x4d')]()[_0x2e86('0x29')](respondWithResult(_0x254199,null))[_0x2e86('0x45')](handleError(_0x254199,null));};exports[_0x2e86('0x4e')]=function(_0x297ac8,_0xf93667,_0x20e00e){return db[_0x2e86('0x4f')][_0x2e86('0x24')]({'where':{'ChatGroupId':_0x297ac8[_0x2e86('0x47')]['id'],'ToId':_0x297ac8['user']['id'],'read':![]}})[_0x2e86('0x29')](function(_0x43de4f){return{'id':_[_0x2e86('0x50')](_0x297ac8['params']['id']),'count':_0x43de4f};})[_0x2e86('0x29')](respondWithResult(_0xf93667,null))[_0x2e86('0x45')](handleError(_0xf93667,null));};exports['addMembers']=function(_0x3b03ef,_0x50d3fc,_0x496427){return db['ChatGroup'][_0x2e86('0x4c')]({'where':{'id':_0x3b03ef[_0x2e86('0x47')]['id']}})['then'](handleEntityNotFound(_0x50d3fc,null))['then'](function(_0x2c3e3a){if(_0x2c3e3a){return _0x2c3e3a[_0x2e86('0x51')](_0x3b03ef['body']['ids'],_[_0x2e86('0x52')](_0x3b03ef['body'],[_0x2e86('0x53'),'id'])||{});}})[_0x2e86('0x29')](respondWithResult(_0x50d3fc,null))[_0x2e86('0x45')](handleError(_0x50d3fc,null));};exports[_0x2e86('0x54')]=function(_0x54b40b,_0x14a6cc,_0x11924e){var _0x14d8ae={};var _0x21f225={};var _0x2df404;var _0x2eb1e7;return db[_0x2e86('0x31')][_0x2e86('0x55')]({'where':{'id':_0x54b40b[_0x2e86('0x47')]['id']}})[_0x2e86('0x29')](handleEntityNotFound(_0x14a6cc,null))[_0x2e86('0x29')](function(_0x1c615f){if(_0x1c615f){_0x2df404=_0x1c615f;_0x21f225[_0x2e86('0x34')]=_['keys'](db[_0x2e86('0x56')]['rawAttributes']);_0x21f225['query']=_[_0x2e86('0x48')](_0x54b40b[_0x2e86('0x35')]);_0x21f225[_0x2e86('0x3e')]=_[_0x2e86('0x37')](_0x21f225[_0x2e86('0x34')],_0x21f225[_0x2e86('0x35')]);_0x14d8ae[_0x2e86('0x36')]=_[_0x2e86('0x37')](_0x21f225[_0x2e86('0x34')],qs['fields'](_0x54b40b[_0x2e86('0x35')][_0x2e86('0x38')]));_0x14d8ae[_0x2e86('0x36')]=_0x14d8ae[_0x2e86('0x36')]['length']?_0x14d8ae[_0x2e86('0x36')]:_0x21f225[_0x2e86('0x34')];_0x14d8ae[_0x2e86('0x3c')]=qs[_0x2e86('0x3d')](_0x54b40b[_0x2e86('0x35')][_0x2e86('0x3d')]);_0x14d8ae['where']=qs[_0x2e86('0x3e')](_[_0x2e86('0x57')](_0x54b40b[_0x2e86('0x35')],_0x21f225[_0x2e86('0x3e')]));if(_0x54b40b[_0x2e86('0x35')][_0x2e86('0x58')]){_0x14d8ae[_0x2e86('0x59')]=_[_0x2e86('0x3f')](_0x14d8ae[_0x2e86('0x59')],{'$or':_[_0x2e86('0x30')](_0x14d8ae[_0x2e86('0x36')],function(_0x82a207){var _0x3369b6={};_0x3369b6[_0x82a207]={'$like':'%'+_0x54b40b[_0x2e86('0x35')][_0x2e86('0x58')]+'%'};return _0x3369b6;})});}_0x14d8ae=_[_0x2e86('0x3f')]({},_0x14d8ae,_0x54b40b[_0x2e86('0x41')]);return _0x2df404[_0x2e86('0x54')](_0x14d8ae);}})[_0x2e86('0x29')](function(_0x3a618d){if(_0x3a618d){_0x2eb1e7=_0x3a618d['length'];if(!_0x54b40b[_0x2e86('0x35')][_0x2e86('0x3a')](_0x2e86('0x3b'))){_0x14d8ae[_0x2e86('0x23')]=qs[_0x2e86('0x23')](_0x54b40b['query'][_0x2e86('0x23')]);_0x14d8ae[_0x2e86('0x21')]=qs[_0x2e86('0x21')](_0x54b40b[_0x2e86('0x35')][_0x2e86('0x21')]);}return _0x2df404['getMembers'](_0x14d8ae);}})['then'](function(_0xa6cfae){if(_0xa6cfae){return _0xa6cfae?{'count':_0x2eb1e7,'rows':_0xa6cfae}:null;}})['then'](respondWithResult(_0x14a6cc,null))[_0x2e86('0x45')](handleError(_0x14a6cc,null));};exports['removeMembers']=function(_0x1c7686,_0x3aa5a2,_0xe59ab1){return db[_0x2e86('0x31')][_0x2e86('0x4c')]({'where':{'id':_0x1c7686[_0x2e86('0x47')]['id']}})[_0x2e86('0x29')](handleEntityNotFound(_0x3aa5a2,null))[_0x2e86('0x29')](function(_0x340b4b){if(_0x340b4b){return _0x340b4b[_0x2e86('0x5a')](_0x1c7686[_0x2e86('0x35')][_0x2e86('0x53')]);}})['then'](respondWithStatusCode(_0x3aa5a2,null))['catch'](handleError(_0x3aa5a2,null));};exports[_0x2e86('0x5b')]=function(_0x139723,_0xfe2a15,_0x4dd6ed){if(_0x139723[_0x2e86('0x4b')]['id']){delete _0x139723[_0x2e86('0x4b')]['id'];}return db[_0x2e86('0x31')][_0x2e86('0x4c')]({'where':{'id':_0x139723[_0x2e86('0x47')]['id']}})['then'](handleEntityNotFound(_0xfe2a15,null))['then'](function(_0x1b740b){if(_0x1b740b){_0x139723[_0x2e86('0x4b')][_0x2e86('0x5c')]=_0x1b740b['id'];return db[_0x2e86('0x4f')][_0x2e86('0x4a')](_0x139723[_0x2e86('0x4b')]);}})['then'](respondWithResult(_0xfe2a15,null))['catch'](handleError(_0xfe2a15,null));};exports[_0x2e86('0x5d')]=function(_0xb3b4a5,_0x35408a,_0x56b33a){var _0x368261={};var _0x4176bd={};var _0x36d5cf;var _0x4e4621;return db[_0x2e86('0x31')][_0x2e86('0x55')]({'where':{'id':_0xb3b4a5[_0x2e86('0x47')]['id']}})[_0x2e86('0x29')](handleEntityNotFound(_0x35408a,null))[_0x2e86('0x29')](function(_0x2c2e33){if(_0x2c2e33){_0x36d5cf=_0x2c2e33;_0x4176bd[_0x2e86('0x34')]=_['keys'](db[_0x2e86('0x4f')][_0x2e86('0x49')]);_0x4176bd['query']=_['keys'](_0xb3b4a5[_0x2e86('0x35')]);_0x4176bd[_0x2e86('0x3e')]=_[_0x2e86('0x37')](_0x4176bd[_0x2e86('0x34')],_0x4176bd[_0x2e86('0x35')]);_0x368261[_0x2e86('0x36')]=_[_0x2e86('0x37')](_0x4176bd[_0x2e86('0x34')],qs['fields'](_0xb3b4a5[_0x2e86('0x35')][_0x2e86('0x38')]));_0x368261['attributes']=_0x368261[_0x2e86('0x36')][_0x2e86('0x39')]?_0x368261[_0x2e86('0x36')]:_0x4176bd['model'];_0x368261[_0x2e86('0x3c')]=qs[_0x2e86('0x3d')](_0xb3b4a5[_0x2e86('0x35')]['sort']);_0x368261[_0x2e86('0x59')]=qs['filters'](_[_0x2e86('0x57')](_0xb3b4a5[_0x2e86('0x35')],_0x4176bd[_0x2e86('0x3e')]));if(_0xb3b4a5['query'][_0x2e86('0x58')]){_0x368261[_0x2e86('0x59')]=_['merge'](_0x368261[_0x2e86('0x59')],{'$or':_[_0x2e86('0x30')](_0x368261['attributes'],function(_0x4d649a){var _0x4a8893={};_0x4a8893[_0x4d649a]={'$like':'%'+_0xb3b4a5[_0x2e86('0x35')]['filter']+'%'};return _0x4a8893;})});}if(_0xb3b4a5[_0x2e86('0x35')]['$gte']){var _0x3ac2df=_0xb3b4a5[_0x2e86('0x35')][_0x2e86('0x5e')][_0x2e86('0x5f')](',');var _0x186ac9={};_0x186ac9[_0x3ac2df[0x0]]={'$gte':moment(_0x3ac2df[0x1])[_0x2e86('0x60')](_0x2e86('0x61'))};_0x368261[_0x2e86('0x59')]=_[_0x2e86('0x3f')](_0x368261[_0x2e86('0x59')],_0x186ac9);}_0x368261=_[_0x2e86('0x3f')]({},_0x368261,_0xb3b4a5[_0x2e86('0x41')]);return _0x36d5cf[_0x2e86('0x5d')](_0x368261);}})[_0x2e86('0x29')](function(_0x11c739){if(_0x11c739){_0x4e4621=_0x11c739[_0x2e86('0x39')];if(!_0xb3b4a5[_0x2e86('0x35')][_0x2e86('0x3a')](_0x2e86('0x3b'))){_0x368261['limit']=qs['limit'](_0xb3b4a5['query'][_0x2e86('0x23')]);_0x368261[_0x2e86('0x21')]=qs[_0x2e86('0x21')](_0xb3b4a5[_0x2e86('0x35')][_0x2e86('0x21')]);}return _0x36d5cf[_0x2e86('0x5d')](_0x368261);}})['then'](function(_0x181a9c){if(_0x181a9c){return _0x181a9c?{'count':_0x4e4621,'rows':_0x181a9c}:null;}})['then'](respondWithResult(_0x35408a,null))[_0x2e86('0x45')](handleError(_0x35408a,null));};
\ No newline at end of file
+var _0xa991=['ids','omit','getMembers','findOne','length','order','hasOwnProperty','removeMembers','ChatGroupId','ChatInternalMessage','create','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatGroup.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','find','body','describe','getUnread','user','toInteger'];(function(_0x1cbaac,_0x4ab388){var _0x285d9a=function(_0x36fa09){while(--_0x36fa09){_0x1cbaac['push'](_0x1cbaac['shift']());}};_0x285d9a(++_0x4ab388);}(_0xa991,0xcc));var _0x1a99=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xa991[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require(_0x1a99('0x0'));var rimraf=require(_0x1a99('0x1'));var zipdir=require(_0x1a99('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a99('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a99('0x4'));var util=require(_0x1a99('0x5'));var path=require(_0x1a99('0x6'));var sox=require(_0x1a99('0x7'));var csv=require(_0x1a99('0x8'));var ejs=require(_0x1a99('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a99('0xa'));var crypto=require(_0x1a99('0xb'));var jsforce=require(_0x1a99('0xc'));var deskjs=require(_0x1a99('0xd'));var toCsv=require(_0x1a99('0x8'));var querystring=require(_0x1a99('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1a99('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a99('0x10'));var logger=require(_0x1a99('0x11'))(_0x1a99('0x12'));var utils=require(_0x1a99('0x13'));var config=require(_0x1a99('0x14'));var licenseUtil=require(_0x1a99('0x15'));var db=require(_0x1a99('0x16'))['db'];config['redis']=_[_0x1a99('0x17')](config[_0x1a99('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a99('0x19'))(new Redis(config[_0x1a99('0x18')]));require(_0x1a99('0x1a'))[_0x1a99('0x1b')](socket);function respondWithStatusCode(_0x43158c,_0x1fcb5e){_0x1fcb5e=_0x1fcb5e||0xcc;return function(_0x5f13f2){if(_0x5f13f2){return _0x43158c['sendStatus'](_0x1fcb5e);}return _0x43158c[_0x1a99('0x1c')](_0x1fcb5e)[_0x1a99('0x1d')]();};}function respondWithResult(_0x1bfeb5,_0x2824ae){_0x2824ae=_0x2824ae||0xc8;return function(_0xa7cca9){if(_0xa7cca9){return _0x1bfeb5[_0x1a99('0x1c')](_0x2824ae)['json'](_0xa7cca9);}};}function respondWithFilteredResult(_0x458b79,_0x3dec8e){return function(_0x3dd208){if(_0x3dd208){var _0x5df970=typeof _0x3dec8e[_0x1a99('0x1e')]==='undefined'&&typeof _0x3dec8e['limit']===_0x1a99('0x1f');var _0x34a6e5=_0x3dd208[_0x1a99('0x20')];var _0x10b31a=_0x5df970?0x0:_0x3dec8e[_0x1a99('0x1e')];var _0x45eb5e=_0x5df970?_0x3dd208[_0x1a99('0x20')]:_0x3dec8e[_0x1a99('0x1e')]+_0x3dec8e[_0x1a99('0x21')];var _0x508ee0;if(_0x45eb5e>=_0x34a6e5){_0x45eb5e=_0x34a6e5;_0x508ee0=0xc8;}else{_0x508ee0=0xce;}_0x458b79[_0x1a99('0x1c')](_0x508ee0);return _0x458b79[_0x1a99('0x22')](_0x1a99('0x23'),_0x10b31a+'-'+_0x45eb5e+'/'+_0x34a6e5)[_0x1a99('0x24')](_0x3dd208);}return null;};}function patchUpdates(_0x46b495){return function(_0x15837e){try{jsonpatch[_0x1a99('0x25')](_0x15837e,_0x46b495,!![]);}catch(_0x4b7b3c){return BPromise[_0x1a99('0x26')](_0x4b7b3c);}return _0x15837e[_0x1a99('0x27')]();};}function saveUpdates(_0x29d004,_0x378e9f){return function(_0x2396d7){if(_0x2396d7){return _0x2396d7[_0x1a99('0x28')](_0x29d004)[_0x1a99('0x29')](function(_0x26186d){return _0x26186d;});}return null;};}function removeEntity(_0x35637c,_0x463a81){return function(_0x38bd62){if(_0x38bd62){return _0x38bd62[_0x1a99('0x2a')]()[_0x1a99('0x29')](function(){_0x35637c[_0x1a99('0x1c')](0xcc)[_0x1a99('0x1d')]();});}};}function handleEntityNotFound(_0x48c3e4,_0xe93dec){return function(_0x3b1132){if(!_0x3b1132){_0x48c3e4['sendStatus'](0x194);}return _0x3b1132;};}function handleError(_0x1b6677,_0x45e0ae){_0x45e0ae=_0x45e0ae||0x1f4;return function(_0x18b907){logger[_0x1a99('0x2b')](_0x18b907[_0x1a99('0x2c')]);if(_0x18b907[_0x1a99('0x2d')]){delete _0x18b907[_0x1a99('0x2d')];}_0x1b6677[_0x1a99('0x1c')](_0x45e0ae)[_0x1a99('0x2e')](_0x18b907);};}exports['index']=function(_0x46fe97,_0x5aaf0d){var _0x1d2571={},_0x5c9a43={},_0x4c65bb={'count':0x0,'rows':[]};var _0x256696=_[_0x1a99('0x2f')](db[_0x1a99('0x30')][_0x1a99('0x31')],function(_0x3869ed){return{'name':_0x3869ed[_0x1a99('0x32')],'type':_0x3869ed[_0x1a99('0x33')][_0x1a99('0x34')]};});_0x5c9a43[_0x1a99('0x35')]=_[_0x1a99('0x2f')](_0x256696,_0x1a99('0x2d'));_0x5c9a43[_0x1a99('0x36')]=_[_0x1a99('0x37')](_0x46fe97[_0x1a99('0x36')]);_0x5c9a43['filters']=_[_0x1a99('0x38')](_0x5c9a43[_0x1a99('0x35')],_0x5c9a43['query']);_0x1d2571[_0x1a99('0x39')]=_[_0x1a99('0x38')](_0x5c9a43['model'],qs[_0x1a99('0x3a')](_0x46fe97['query']['fields']));_0x1d2571[_0x1a99('0x39')]=_0x1d2571[_0x1a99('0x39')]['length']?_0x1d2571['attributes']:_0x5c9a43['model'];if(!_0x46fe97[_0x1a99('0x36')]['hasOwnProperty'](_0x1a99('0x3b'))){_0x1d2571['limit']=qs[_0x1a99('0x21')](_0x46fe97[_0x1a99('0x36')]['limit']);_0x1d2571[_0x1a99('0x1e')]=qs[_0x1a99('0x1e')](_0x46fe97[_0x1a99('0x36')][_0x1a99('0x1e')]);}_0x1d2571['order']=qs[_0x1a99('0x3c')](_0x46fe97[_0x1a99('0x36')]['sort']);_0x1d2571[_0x1a99('0x3d')]=qs[_0x1a99('0x3e')](_['pick'](_0x46fe97[_0x1a99('0x36')],_0x5c9a43[_0x1a99('0x3e')]),_0x256696);if(_0x46fe97[_0x1a99('0x36')][_0x1a99('0x3f')]){_0x1d2571[_0x1a99('0x3d')]=_[_0x1a99('0x40')](_0x1d2571[_0x1a99('0x3d')],{'$or':_[_0x1a99('0x2f')](_0x256696,function(_0x1e6cc1){if(_0x1e6cc1[_0x1a99('0x33')]!=='VIRTUAL'){var _0x3afd5e={};_0x3afd5e[_0x1e6cc1[_0x1a99('0x2d')]]={'$like':'%'+_0x46fe97[_0x1a99('0x36')][_0x1a99('0x3f')]+'%'};return _0x3afd5e;}})});}_0x1d2571=_[_0x1a99('0x40')]({},_0x1d2571,_0x46fe97[_0x1a99('0x41')]);var _0xc0a6d1={'where':_0x1d2571[_0x1a99('0x3d')]};return db[_0x1a99('0x30')]['count'](_0xc0a6d1)[_0x1a99('0x29')](function(_0xd0d9fb){_0x4c65bb['count']=_0xd0d9fb;if(_0x46fe97[_0x1a99('0x36')][_0x1a99('0x42')]){_0x1d2571[_0x1a99('0x43')]=[{'all':!![]}];}return db[_0x1a99('0x30')][_0x1a99('0x44')](_0x1d2571);})[_0x1a99('0x29')](function(_0x2ee4cd){_0x4c65bb['rows']=_0x2ee4cd;return _0x4c65bb;})[_0x1a99('0x29')](respondWithFilteredResult(_0x5aaf0d,_0x1d2571))[_0x1a99('0x45')](handleError(_0x5aaf0d,null));};exports[_0x1a99('0x46')]=function(_0x4a73f3,_0x18f78c){var _0x166262={'raw':!![],'where':{'id':_0x4a73f3[_0x1a99('0x47')]['id']}},_0x1c1a0e={};_0x1c1a0e[_0x1a99('0x35')]=_[_0x1a99('0x37')](db['ChatGroup']['rawAttributes']);_0x1c1a0e[_0x1a99('0x36')]=_[_0x1a99('0x37')](_0x4a73f3[_0x1a99('0x36')]);_0x1c1a0e['filters']=_[_0x1a99('0x38')](_0x1c1a0e[_0x1a99('0x35')],_0x1c1a0e[_0x1a99('0x36')]);_0x166262['attributes']=_[_0x1a99('0x38')](_0x1c1a0e[_0x1a99('0x35')],qs[_0x1a99('0x3a')](_0x4a73f3[_0x1a99('0x36')][_0x1a99('0x3a')]));_0x166262['attributes']=_0x166262['attributes']['length']?_0x166262[_0x1a99('0x39')]:_0x1c1a0e['model'];if(_0x4a73f3[_0x1a99('0x36')][_0x1a99('0x42')]){_0x166262[_0x1a99('0x43')]=[{'all':!![]}];}_0x166262=_[_0x1a99('0x40')]({},_0x166262,_0x4a73f3[_0x1a99('0x41')]);return db['ChatGroup'][_0x1a99('0x48')](_0x166262)['then'](handleEntityNotFound(_0x18f78c,null))[_0x1a99('0x29')](respondWithResult(_0x18f78c,null))[_0x1a99('0x45')](handleError(_0x18f78c,null));};exports['create']=function(_0x37a991,_0x10c394){return db[_0x1a99('0x30')]['create'](_0x37a991[_0x1a99('0x49')],{})[_0x1a99('0x29')](respondWithResult(_0x10c394,0xc9))[_0x1a99('0x45')](handleError(_0x10c394,null));};exports[_0x1a99('0x28')]=function(_0xfa2d95,_0x144f43){if(_0xfa2d95[_0x1a99('0x49')]['id']){delete _0xfa2d95['body']['id'];}return db[_0x1a99('0x30')]['find']({'where':{'id':_0xfa2d95[_0x1a99('0x47')]['id']}})[_0x1a99('0x29')](handleEntityNotFound(_0x144f43,null))[_0x1a99('0x29')](saveUpdates(_0xfa2d95[_0x1a99('0x49')],null))[_0x1a99('0x29')](respondWithResult(_0x144f43,null))[_0x1a99('0x45')](handleError(_0x144f43,null));};exports[_0x1a99('0x2a')]=function(_0xc46271,_0x2a36f2){return db['ChatGroup']['find']({'where':{'id':_0xc46271[_0x1a99('0x47')]['id']}})[_0x1a99('0x29')](handleEntityNotFound(_0x2a36f2,null))['then'](removeEntity(_0x2a36f2,null))[_0x1a99('0x45')](handleError(_0x2a36f2,null));};exports[_0x1a99('0x4a')]=function(_0x221f62,_0x2784d7){return db['ChatGroup']['describe']()[_0x1a99('0x29')](respondWithResult(_0x2784d7,null))[_0x1a99('0x45')](handleError(_0x2784d7,null));};exports[_0x1a99('0x4b')]=function(_0x163434,_0x445dbf,_0x206afe){return db['ChatInternalMessage'][_0x1a99('0x20')]({'where':{'ChatGroupId':_0x163434[_0x1a99('0x47')]['id'],'ToId':_0x163434[_0x1a99('0x4c')]['id'],'read':![]}})[_0x1a99('0x29')](function(_0x2fb32a){return{'id':_[_0x1a99('0x4d')](_0x163434[_0x1a99('0x47')]['id']),'count':_0x2fb32a};})[_0x1a99('0x29')](respondWithResult(_0x445dbf,null))[_0x1a99('0x45')](handleError(_0x445dbf,null));};exports['addMembers']=function(_0x5363f6,_0x5e7ee9,_0x2b26bf){return db[_0x1a99('0x30')][_0x1a99('0x48')]({'where':{'id':_0x5363f6[_0x1a99('0x47')]['id']}})[_0x1a99('0x29')](handleEntityNotFound(_0x5e7ee9,null))[_0x1a99('0x29')](function(_0x59e7c5){if(_0x59e7c5){return _0x59e7c5['addMembers'](_0x5363f6[_0x1a99('0x49')][_0x1a99('0x4e')],_[_0x1a99('0x4f')](_0x5363f6[_0x1a99('0x49')],['ids','id'])||{});}})[_0x1a99('0x29')](respondWithResult(_0x5e7ee9,null))[_0x1a99('0x45')](handleError(_0x5e7ee9,null));};exports[_0x1a99('0x50')]=function(_0xf1b6c8,_0x1e5a66,_0x701fed){var _0x352509={};var _0x4a1ce8={};var _0x173ddf;var _0x54b1ac;return db[_0x1a99('0x30')][_0x1a99('0x51')]({'where':{'id':_0xf1b6c8[_0x1a99('0x47')]['id']}})[_0x1a99('0x29')](handleEntityNotFound(_0x1e5a66,null))['then'](function(_0x52204d){if(_0x52204d){_0x173ddf=_0x52204d;_0x4a1ce8[_0x1a99('0x35')]=_[_0x1a99('0x37')](db['User'][_0x1a99('0x31')]);_0x4a1ce8[_0x1a99('0x36')]=_[_0x1a99('0x37')](_0xf1b6c8[_0x1a99('0x36')]);_0x4a1ce8[_0x1a99('0x3e')]=_[_0x1a99('0x38')](_0x4a1ce8[_0x1a99('0x35')],_0x4a1ce8[_0x1a99('0x36')]);_0x352509[_0x1a99('0x39')]=_[_0x1a99('0x38')](_0x4a1ce8[_0x1a99('0x35')],qs[_0x1a99('0x3a')](_0xf1b6c8[_0x1a99('0x36')]['fields']));_0x352509[_0x1a99('0x39')]=_0x352509[_0x1a99('0x39')][_0x1a99('0x52')]?_0x352509[_0x1a99('0x39')]:_0x4a1ce8[_0x1a99('0x35')];_0x352509[_0x1a99('0x53')]=qs['sort'](_0xf1b6c8[_0x1a99('0x36')]['sort']);_0x352509[_0x1a99('0x3d')]=qs[_0x1a99('0x3e')](_['pick'](_0xf1b6c8[_0x1a99('0x36')],_0x4a1ce8[_0x1a99('0x3e')]));if(_0xf1b6c8[_0x1a99('0x36')][_0x1a99('0x3f')]){_0x352509[_0x1a99('0x3d')]=_[_0x1a99('0x40')](_0x352509[_0x1a99('0x3d')],{'$or':_[_0x1a99('0x2f')](_0x352509[_0x1a99('0x39')],function(_0x32f584){var _0x141853={};_0x141853[_0x32f584]={'$like':'%'+_0xf1b6c8[_0x1a99('0x36')][_0x1a99('0x3f')]+'%'};return _0x141853;})});}_0x352509=_[_0x1a99('0x40')]({},_0x352509,_0xf1b6c8[_0x1a99('0x41')]);return _0x173ddf[_0x1a99('0x50')](_0x352509);}})['then'](function(_0x1b8f80){if(_0x1b8f80){_0x54b1ac=_0x1b8f80[_0x1a99('0x52')];if(!_0xf1b6c8['query'][_0x1a99('0x54')](_0x1a99('0x3b'))){_0x352509[_0x1a99('0x21')]=qs[_0x1a99('0x21')](_0xf1b6c8['query'][_0x1a99('0x21')]);_0x352509[_0x1a99('0x1e')]=qs['offset'](_0xf1b6c8[_0x1a99('0x36')][_0x1a99('0x1e')]);}return _0x173ddf[_0x1a99('0x50')](_0x352509);}})['then'](function(_0x53fac6){if(_0x53fac6){return _0x53fac6?{'count':_0x54b1ac,'rows':_0x53fac6}:null;}})[_0x1a99('0x29')](respondWithResult(_0x1e5a66,null))[_0x1a99('0x45')](handleError(_0x1e5a66,null));};exports[_0x1a99('0x55')]=function(_0x2b946b,_0xaf4ec7,_0x5730f5){return db[_0x1a99('0x30')][_0x1a99('0x48')]({'where':{'id':_0x2b946b[_0x1a99('0x47')]['id']}})[_0x1a99('0x29')](handleEntityNotFound(_0xaf4ec7,null))['then'](function(_0x2891e6){if(_0x2891e6){return _0x2891e6[_0x1a99('0x55')](_0x2b946b[_0x1a99('0x36')]['ids']);}})[_0x1a99('0x29')](respondWithStatusCode(_0xaf4ec7,null))[_0x1a99('0x45')](handleError(_0xaf4ec7,null));};exports['addMessage']=function(_0x9d4f8e,_0xf6b6f6,_0x3c0247){if(_0x9d4f8e['body']['id']){delete _0x9d4f8e[_0x1a99('0x49')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x9d4f8e['params']['id']}})[_0x1a99('0x29')](handleEntityNotFound(_0xf6b6f6,null))[_0x1a99('0x29')](function(_0xe0807){if(_0xe0807){_0x9d4f8e['body'][_0x1a99('0x56')]=_0xe0807['id'];return db[_0x1a99('0x57')][_0x1a99('0x58')](_0x9d4f8e[_0x1a99('0x49')]);}})[_0x1a99('0x29')](respondWithResult(_0xf6b6f6,null))[_0x1a99('0x45')](handleError(_0xf6b6f6,null));};exports['getMessages']=function(_0x35dc66,_0x613599,_0xcb5f78){var _0xe99cd={};var _0x5b1ef7={};var _0x16c1d8;var _0x40a402;return db[_0x1a99('0x30')][_0x1a99('0x51')]({'where':{'id':_0x35dc66[_0x1a99('0x47')]['id']}})[_0x1a99('0x29')](handleEntityNotFound(_0x613599,null))[_0x1a99('0x29')](function(_0x17fb4c){if(_0x17fb4c){_0x16c1d8=_0x17fb4c;_0x5b1ef7[_0x1a99('0x35')]=_[_0x1a99('0x37')](db[_0x1a99('0x57')][_0x1a99('0x31')]);_0x5b1ef7[_0x1a99('0x36')]=_[_0x1a99('0x37')](_0x35dc66[_0x1a99('0x36')]);_0x5b1ef7[_0x1a99('0x3e')]=_[_0x1a99('0x38')](_0x5b1ef7[_0x1a99('0x35')],_0x5b1ef7[_0x1a99('0x36')]);_0xe99cd[_0x1a99('0x39')]=_[_0x1a99('0x38')](_0x5b1ef7['model'],qs[_0x1a99('0x3a')](_0x35dc66[_0x1a99('0x36')]['fields']));_0xe99cd['attributes']=_0xe99cd[_0x1a99('0x39')][_0x1a99('0x52')]?_0xe99cd[_0x1a99('0x39')]:_0x5b1ef7[_0x1a99('0x35')];_0xe99cd[_0x1a99('0x53')]=qs['sort'](_0x35dc66['query'][_0x1a99('0x3c')]);_0xe99cd[_0x1a99('0x3d')]=qs[_0x1a99('0x3e')](_[_0x1a99('0x59')](_0x35dc66[_0x1a99('0x36')],_0x5b1ef7[_0x1a99('0x3e')]));if(_0x35dc66[_0x1a99('0x36')][_0x1a99('0x3f')]){_0xe99cd[_0x1a99('0x3d')]=_['merge'](_0xe99cd[_0x1a99('0x3d')],{'$or':_[_0x1a99('0x2f')](_0xe99cd[_0x1a99('0x39')],function(_0x59cb6f){var _0x5a15e2={};_0x5a15e2[_0x59cb6f]={'$like':'%'+_0x35dc66['query'][_0x1a99('0x3f')]+'%'};return _0x5a15e2;})});}if(_0x35dc66[_0x1a99('0x36')][_0x1a99('0x5a')]){var _0x5d4ae5=_0x35dc66[_0x1a99('0x36')][_0x1a99('0x5a')]['split'](',');var _0x34396d={};_0x34396d[_0x5d4ae5[0x0]]={'$gte':moment(_0x5d4ae5[0x1])[_0x1a99('0x5b')](_0x1a99('0x5c'))};_0xe99cd[_0x1a99('0x3d')]=_['merge'](_0xe99cd[_0x1a99('0x3d')],_0x34396d);}_0xe99cd=_[_0x1a99('0x40')]({},_0xe99cd,_0x35dc66[_0x1a99('0x41')]);return _0x16c1d8[_0x1a99('0x5d')](_0xe99cd);}})['then'](function(_0x1c756b){if(_0x1c756b){_0x40a402=_0x1c756b[_0x1a99('0x52')];if(!_0x35dc66[_0x1a99('0x36')]['hasOwnProperty'](_0x1a99('0x3b'))){_0xe99cd[_0x1a99('0x21')]=qs[_0x1a99('0x21')](_0x35dc66[_0x1a99('0x36')]['limit']);_0xe99cd[_0x1a99('0x1e')]=qs['offset'](_0x35dc66['query']['offset']);}return _0x16c1d8['getMessages'](_0xe99cd);}})[_0x1a99('0x29')](function(_0x1beaf9){if(_0x1beaf9){return _0x1beaf9?{'count':_0x40a402,'rows':_0x1beaf9}:null;}})[_0x1a99('0x29')](respondWithResult(_0x613599,null))[_0x1a99('0x45')](handleError(_0x613599,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index ae91e56..0885aba 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 _0x745d=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x463a6e,_0x1b47b5){var _0x51d8c6=function(_0x21f507){while(--_0x21f507){_0x463a6e['push'](_0x463a6e['shift']());}};_0x51d8c6(++_0x1b47b5);}(_0x745d,0xec));var _0xd745=function(_0x51f4fa,_0x55f229){_0x51f4fa=_0x51f4fa-0x0;var _0x11c00d=_0x745d[_0x51f4fa];return _0x11c00d;};'use strict';var EventEmitter=require(_0xd745('0x0'));var ChatGroup=require(_0xd745('0x1'))['db'][_0xd745('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd745('0x3')](0x0);var events={'afterCreate':_0xd745('0x4'),'afterUpdate':'update','afterDestroy':_0xd745('0x5')};function emitEvent(_0x998674){return function(_0x3565bf,_0x2c3e6a,_0x373f2e){ChatGroupEvents[_0xd745('0x6')](_0x998674+':'+_0x3565bf['id'],_0x3565bf);ChatGroupEvents[_0xd745('0x6')](_0x998674,_0x3565bf);_0x373f2e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xd745('0x7')](e,emitEvent(event));}}module[_0xd745('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x442b=['ChatGroup','save','update','remove','emit','hook','exports','events'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0x442b,0x6f));var _0xb442=function(_0x6e3d2,_0x373346){_0x6e3d2=_0x6e3d2-0x0;var _0x4ed099=_0x442b[_0x6e3d2];return _0x4ed099;};'use strict';var EventEmitter=require(_0xb442('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xb442('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb442('0x2'),'afterUpdate':_0xb442('0x3'),'afterDestroy':_0xb442('0x4')};function emitEvent(_0x4ce07e){return function(_0x5c02d3,_0x3278d4,_0xc91d1c){ChatGroupEvents['emit'](_0x4ce07e+':'+_0x5c02d3['id'],_0x5c02d3);ChatGroupEvents[_0xb442('0x5')](_0x4ce07e,_0x5c02d3);_0xc91d1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xb442('0x6')](e,emitEvent(event));}}module[_0xb442('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 361e414..57c89ac 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 _0x438b=['./chatGroup.attributes','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xa82c60,_0x3f05bf){var _0x291fef=function(_0x31feda){while(--_0x31feda){_0xa82c60['push'](_0xa82c60['shift']());}};_0x291fef(++_0x3f05bf);}(_0x438b,0xc3));var _0xb438=function(_0x3ac810,_0x592ce5){_0x3ac810=_0x3ac810-0x0;var _0x2a2257=_0x438b[_0x3ac810];return _0x2a2257;};'use strict';var _=require(_0xb438('0x0'));var util=require(_0xb438('0x1'));var logger=require(_0xb438('0x2'))(_0xb438('0x3'));var moment=require(_0xb438('0x4'));var BPromise=require(_0xb438('0x5'));var rp=require(_0xb438('0x6'));var fs=require('fs');var path=require(_0xb438('0x7'));var rimraf=require('rimraf');var config=require(_0xb438('0x8'));var attributes=require(_0xb438('0x9'));module['exports']=function(_0x1b8207,_0x2ab4a8){return _0x1b8207[_0xb438('0xa')]('ChatGroup',attributes,{'tableName':_0xb438('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd167=['rimraf','define','ChatGroup','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x29c409,_0x30d61d){var _0x43e24f=function(_0x3c9ab6){while(--_0x3c9ab6){_0x29c409['push'](_0x29c409['shift']());}};_0x43e24f(++_0x30d61d);}(_0xd167,0x193));var _0x7d16=function(_0x4cea78,_0x3ce1d5){_0x4cea78=_0x4cea78-0x0;var _0x5c9a6e=_0xd167[_0x4cea78];return _0x5c9a6e;};'use strict';var _=require(_0x7d16('0x0'));var util=require(_0x7d16('0x1'));var logger=require(_0x7d16('0x2'))('api');var moment=require(_0x7d16('0x3'));var BPromise=require(_0x7d16('0x4'));var rp=require(_0x7d16('0x5'));var fs=require('fs');var path=require(_0x7d16('0x6'));var rimraf=require(_0x7d16('0x7'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module['exports']=function(_0x3642f2,_0x3f2063){return _0x3642f2[_0x7d16('0x8')](_0x7d16('0x9'),attributes,{'tableName':'chat_groups','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 2bd6998..69b5ece 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 _0x8910=['./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','localhost','socket.io-emitter','redis'];(function(_0x2063bc,_0x1aa93b){var _0x2b352b=function(_0x4650aa){while(--_0x4650aa){_0x2063bc['push'](_0x2063bc['shift']());}};_0x2b352b(++_0x1aa93b);}(_0x8910,0x1ef));var _0x0891=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x8910[_0x44cb92];return _0x56b9e6;};'use strict';var _=require(_0x0891('0x0'));var util=require(_0x0891('0x1'));var moment=require(_0x0891('0x2'));var BPromise=require(_0x0891('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0891('0x4'));var db=require(_0x0891('0x5'))['db'];var utils=require(_0x0891('0x6'));var logger=require(_0x0891('0x7'))(_0x0891('0x8'));var config=require(_0x0891('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0891('0xa')]['http']({'port':0x232a});config['redis']=_[_0x0891('0xb')](config['redis'],{'host':_0x0891('0xc'),'port':0x18eb});var socket=require(_0x0891('0xd'))(new Redis(config[_0x0891('0xe')]));require(_0x0891('0xf'))[_0x0891('0x10')](socket);function respondWithRpcPromise(_0x14535b,_0x1f1f9d,_0x442477){return new BPromise(function(_0xea4569,_0x436c2e){return client[_0x0891('0x11')](_0x14535b,_0x442477)[_0x0891('0x12')](function(_0x3f6906){logger[_0x0891('0x13')]('ChatGroup,\x20%s,\x20%s',_0x1f1f9d,_0x0891('0x14'));logger[_0x0891('0x15')](_0x0891('0x16'),_0x1f1f9d,_0x0891('0x14'),JSON[_0x0891('0x17')](_0x3f6906));if(_0x3f6906[_0x0891('0x18')]){if(_0x3f6906[_0x0891('0x18')][_0x0891('0x19')]===0x1f4){logger[_0x0891('0x18')](_0x0891('0x1a'),_0x1f1f9d,_0x3f6906[_0x0891('0x18')][_0x0891('0x1b')]);return _0x436c2e(_0x3f6906[_0x0891('0x18')][_0x0891('0x1b')]);}logger[_0x0891('0x18')](_0x0891('0x1a'),_0x1f1f9d,_0x3f6906[_0x0891('0x18')][_0x0891('0x1b')]);return _0xea4569(_0x3f6906[_0x0891('0x18')][_0x0891('0x1b')]);}else{logger[_0x0891('0x13')](_0x0891('0x1a'),_0x1f1f9d,_0x0891('0x14'));_0xea4569(_0x3f6906[_0x0891('0x1c')][_0x0891('0x1b')]);}})[_0x0891('0x1d')](function(_0x18d5d8){logger[_0x0891('0x18')]('ChatGroup,\x20%s,\x20%s',_0x1f1f9d,_0x18d5d8);_0x436c2e(_0x18d5d8);});});}
\ No newline at end of file
+var _0xf0a2=['randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','socket.io-emitter','request','then','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','lodash','util','moment','bluebird'];(function(_0x3f7560,_0x3ebbab){var _0x3c3cf6=function(_0x452e3c){while(--_0x452e3c){_0x3f7560['push'](_0x3f7560['shift']());}};_0x3c3cf6(++_0x3ebbab);}(_0xf0a2,0x1ca));var _0x2f0a=function(_0x3de807,_0x578002){_0x3de807=_0x3de807-0x0;var _0x228899=_0xf0a2[_0x3de807];return _0x228899;};'use strict';var _=require(_0x2f0a('0x0'));var util=require(_0x2f0a('0x1'));var moment=require(_0x2f0a('0x2'));var BPromise=require(_0x2f0a('0x3'));var rs=require(_0x2f0a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f0a('0x5'))['db'];var utils=require(_0x2f0a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f0a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2f0a('0x8')]['http']({'port':0x232a});config[_0x2f0a('0x9')]=_['defaults'](config[_0x2f0a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f0a('0xa'))(new Redis(config[_0x2f0a('0x9')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x3175ed,_0x1679c0,_0x3c0831){return new BPromise(function(_0xb541b5,_0x2f13ab){return client[_0x2f0a('0xb')](_0x3175ed,_0x3c0831)[_0x2f0a('0xc')](function(_0x196550){logger['info'](_0x2f0a('0xd'),_0x1679c0,'request\x20sent');logger[_0x2f0a('0xe')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1679c0,_0x2f0a('0xf'),JSON[_0x2f0a('0x10')](_0x196550));if(_0x196550['error']){if(_0x196550[_0x2f0a('0x11')]['code']===0x1f4){logger[_0x2f0a('0x11')](_0x2f0a('0xd'),_0x1679c0,_0x196550[_0x2f0a('0x11')][_0x2f0a('0x12')]);return _0x2f13ab(_0x196550[_0x2f0a('0x11')][_0x2f0a('0x12')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x1679c0,_0x196550['error'][_0x2f0a('0x12')]);return _0xb541b5(_0x196550['error'][_0x2f0a('0x12')]);}else{logger[_0x2f0a('0x13')](_0x2f0a('0xd'),_0x1679c0,_0x2f0a('0xf'));_0xb541b5(_0x196550[_0x2f0a('0x14')][_0x2f0a('0x12')]);}})['catch'](function(_0x4e56d8){logger[_0x2f0a('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1679c0,_0x4e56d8);_0x2f13ab(_0x4e56d8);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index a93d2d8..71f67c5 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 _0x8532=['./chatGroup.events','save','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x346411,_0x548a5b){var _0x4bf222=function(_0x17de11){while(--_0x17de11){_0x346411['push'](_0x346411['shift']());}};_0x4bf222(++_0x548a5b);}(_0x8532,0x144));var _0x2853=function(_0x45969a,_0x17f84d){_0x45969a=_0x45969a-0x0;var _0x187203=_0x8532[_0x45969a];return _0x187203;};'use strict';var ChatGroupEvents=require(_0x2853('0x0'));var events=[_0x2853('0x1'),_0x2853('0x2'),_0x2853('0x3')];function createListener(_0x103418,_0x150597){return function(_0x1f95a1){_0x150597[_0x2853('0x4')](_0x103418,_0x1f95a1);};}function removeListener(_0x488f56,_0x5e4e38){return function(){ChatGroupEvents[_0x2853('0x5')](_0x488f56,_0x5e4e38);};}exports[_0x2853('0x6')]=function(_0x24a0ba){for(var _0x50887f=0x0,_0x19ad60=events[_0x2853('0x7')];_0x50887f<_0x19ad60;_0x50887f++){var _0x20ef00=events[_0x50887f];var _0x14e39e=createListener(_0x2853('0x8')+_0x20ef00,_0x24a0ba);ChatGroupEvents['on'](_0x20ef00,_0x14e39e);}};
\ No newline at end of file
+var _0x2fe5=['chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2fe5,0x158));var _0x52fe=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2fe5[_0x59ee6f];return _0x4c0979;};'use strict';var ChatGroupEvents=require(_0x52fe('0x0'));var events=[_0x52fe('0x1'),_0x52fe('0x2'),_0x52fe('0x3')];function createListener(_0x6a4d6e,_0x41ef29){return function(_0x522d89){_0x41ef29[_0x52fe('0x4')](_0x6a4d6e,_0x522d89);};}function removeListener(_0x474b6c,_0x55bf66){return function(){ChatGroupEvents[_0x52fe('0x5')](_0x474b6c,_0x55bf66);};}exports['register']=function(_0x453342){for(var _0x1c6757=0x0,_0x4d554e=events['length'];_0x1c6757<_0x4d554e;_0x1c6757++){var _0x2ac307=events[_0x1c6757];var _0x2fc944=createListener(_0x52fe('0x6')+_0x2ac307,_0x453342);ChatGroupEvents['on'](_0x2ac307,_0x2fc944);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index a5eea79..4021e7e 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 _0x8011=['/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','/:id/messages','addMessage','put','update','delete','removeMembers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','get'];(function(_0x5ed5b6,_0x2b98e1){var _0x353dce=function(_0x521604){while(--_0x521604){_0x5ed5b6['push'](_0x5ed5b6['shift']());}};_0x353dce(++_0x2b98e1);}(_0x8011,0x1ed));var _0x1801=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x8011[_0x55e08b];return _0xd1a7ff;};'use strict';var multer=require(_0x1801('0x0'));var util=require(_0x1801('0x1'));var path=require(_0x1801('0x2'));var timeout=require(_0x1801('0x3'));var express=require(_0x1801('0x4'));var router=express['Router']();var fs_extra=require(_0x1801('0x5'));var auth=require(_0x1801('0x6'));var interaction=require(_0x1801('0x7'));var config=require('../../config/environment');var controller=require(_0x1801('0x8'));router['get']('/',auth[_0x1801('0x9')](),controller['index']);router[_0x1801('0xa')](_0x1801('0xb'),auth[_0x1801('0x9')](),controller[_0x1801('0xc')]);router['get'](_0x1801('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x1801('0xa')](_0x1801('0xe'),auth[_0x1801('0x9')](),controller[_0x1801('0xf')]);router['get'](_0x1801('0x10'),auth[_0x1801('0x9')](),controller[_0x1801('0x11')]);router[_0x1801('0xa')]('/:id/messages',auth[_0x1801('0x9')](),controller[_0x1801('0x12')]);router[_0x1801('0x13')]('/',auth[_0x1801('0x9')](),controller[_0x1801('0x14')]);router[_0x1801('0x13')](_0x1801('0x10'),auth[_0x1801('0x9')](),controller['addMembers']);router[_0x1801('0x13')](_0x1801('0x15'),auth[_0x1801('0x9')](),controller[_0x1801('0x16')]);router[_0x1801('0x17')](_0x1801('0xd'),auth[_0x1801('0x9')](),controller[_0x1801('0x18')]);router['delete'](_0x1801('0xd'),auth[_0x1801('0x9')](),controller['destroy']);router[_0x1801('0x19')](_0x1801('0x10'),auth[_0x1801('0x9')](),controller[_0x1801('0x1a')]);module[_0x1801('0x1b')]=router;
\ No newline at end of file
+var _0xc423=['describe','/:id','show','get','/:id/members','/:id/messages','getMessages','create','post','addMessage','put','delete','destroy','removeMembers','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xc423,0x102));var _0x3c42=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xc423[_0x2be8c2];return _0x97f531;};'use strict';var multer=require('multer');var util=require(_0x3c42('0x0'));var path=require(_0x3c42('0x1'));var timeout=require('connect-timeout');var express=require(_0x3c42('0x2'));var router=express[_0x3c42('0x3')]();var fs_extra=require(_0x3c42('0x4'));var auth=require(_0x3c42('0x5'));var interaction=require(_0x3c42('0x6'));var config=require(_0x3c42('0x7'));var controller=require(_0x3c42('0x8'));router['get']('/',auth[_0x3c42('0x9')](),controller[_0x3c42('0xa')]);router['get'](_0x3c42('0xb'),auth[_0x3c42('0x9')](),controller[_0x3c42('0xc')]);router['get'](_0x3c42('0xd'),auth[_0x3c42('0x9')](),controller[_0x3c42('0xe')]);router[_0x3c42('0xf')]('/:id/unread',auth[_0x3c42('0x9')](),controller['getUnread']);router[_0x3c42('0xf')](_0x3c42('0x10'),auth[_0x3c42('0x9')](),controller['getMembers']);router[_0x3c42('0xf')](_0x3c42('0x11'),auth[_0x3c42('0x9')](),controller[_0x3c42('0x12')]);router['post']('/',auth[_0x3c42('0x9')](),controller[_0x3c42('0x13')]);router['post'](_0x3c42('0x10'),auth[_0x3c42('0x9')](),controller['addMembers']);router[_0x3c42('0x14')]('/:id/messages',auth[_0x3c42('0x9')](),controller[_0x3c42('0x15')]);router[_0x3c42('0x16')](_0x3c42('0xd'),auth[_0x3c42('0x9')](),controller['update']);router[_0x3c42('0x17')](_0x3c42('0xd'),auth[_0x3c42('0x9')](),controller[_0x3c42('0x18')]);router[_0x3c42('0x17')](_0x3c42('0x10'),auth[_0x3c42('0x9')](),controller[_0x3c42('0x19')]);module[_0x3c42('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 4d669da..183bef0 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 _0xb846=['STRING','DATE','out','BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xb846,0x1d0));var _0x6b84=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb846[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x6b84('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6b84('0x1')]},'ratingType':{'type':Sequelize[_0x6b84('0x2')](_0x6b84('0x3'),_0x6b84('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x6b84('0x5')]},'mailTranscript':{'type':Sequelize[_0x6b84('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6b84('0x7')]},'disposition':{'type':Sequelize[_0x6b84('0x6')]},'secondDisposition':{'type':Sequelize[_0x6b84('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x6b84('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x6b84('0x6')]},'osVersion':{'type':Sequelize[_0x6b84('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x6b84('0x5')]},'customerIp':{'type':Sequelize[_0x6b84('0x6')]},'formData':{'type':Sequelize[_0x6b84('0x5')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6b84('0x2')]('in',_0x6b84('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6b84('0x6')]},'customerPort':{'type':Sequelize[_0x6b84('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x6b84('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x6b84('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe3db=['star','thumb','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','exports','INTEGER','ENUM'];(function(_0x1c8d89,_0x3efad2){var _0x43027e=function(_0x158284){while(--_0x158284){_0x1c8d89['push'](_0x1c8d89['shift']());}};_0x43027e(++_0x3efad2);}(_0xe3db,0xc8));var _0xbe3d=function(_0xc722b6,_0x43d258){_0xc722b6=_0xc722b6-0x0;var _0x4f6ed9=_0xe3db[_0xc722b6];return _0x4f6ed9;};'use strict';var Sequelize=require(_0xbe3d('0x0'));module[_0xbe3d('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xbe3d('0x2')]},'ratingType':{'type':Sequelize[_0xbe3d('0x3')](_0xbe3d('0x4'),_0xbe3d('0x5')),'defaultValue':_0xbe3d('0x4')},'ratingMessage':{'type':Sequelize[_0xbe3d('0x6')]},'pathTranscript':{'type':Sequelize[_0xbe3d('0x6')]},'mailTranscript':{'type':Sequelize[_0xbe3d('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xbe3d('0x8')]},'disposition':{'type':Sequelize[_0xbe3d('0x7')]},'secondDisposition':{'type':Sequelize[_0xbe3d('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbe3d('0x7')]},'browserName':{'type':Sequelize[_0xbe3d('0x7')]},'browserVersion':{'type':Sequelize[_0xbe3d('0x7')]},'osName':{'type':Sequelize[_0xbe3d('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xbe3d('0x7')]},'deviceVendor':{'type':Sequelize[_0xbe3d('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xbe3d('0x7')]},'formData':{'type':Sequelize[_0xbe3d('0x6')](_0xbe3d('0x9'))},'read1stAt':{'type':Sequelize[_0xbe3d('0x8')]},'lastMsgAt':{'type':Sequelize[_0xbe3d('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xbe3d('0x3')]('in',_0xbe3d('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xbe3d('0x7')]},'customerPort':{'type':Sequelize[_0xbe3d('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xbe3d('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xbe3d('0xb')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4482a40..ab5be28 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 _0x9f62=['findAll','getMyMessages','addTags','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','firstName','lastName','read','Account','Owner','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','downloadInteraction.ejs','.pdf','err','zip-dir','moment','bluebird','mustache','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','stack','name','send','render','merge','body','contact','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','talking','answered','unmanaged','abandoned','total','UserId','closed','waiting','disposition','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','user','sequelize','toString','ChatInteraction','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','o.fullname','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','includeAll','include','find','create','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','ValidationError','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','nolimit','sort','$gte','options'];(function(_0x3bfd1c,_0x40e285){var _0x22527d=function(_0x21f04a){while(--_0x21f04a){_0x3bfd1c['push'](_0x3bfd1c['shift']());}};_0x22527d(++_0x40e285);}(_0x9f62,0x154));var _0x29f6=function(_0x257097,_0x46a074){_0x257097=_0x257097-0x0;var _0x38d0e7=_0x9f62[_0x257097];return _0x38d0e7;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x29f6('0x0'));var rp=require('request-promise');var moment=require(_0x29f6('0x1'));var BPromise=require(_0x29f6('0x2'));var Mustache=require(_0x29f6('0x3'));var util=require('util');var path=require('path');var ejs=require(_0x29f6('0x4'));var fs=require('fs');var _=require(_0x29f6('0x5'));var squel=require(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0x29f6('0x8'));var pdf=require(_0x29f6('0x9'));var logger=require(_0x29f6('0xa'))(_0x29f6('0xb'));var config=require(_0x29f6('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x29f6('0xd'),'port':0x18eb});var socket=require(_0x29f6('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x29f6('0xf')](socket);var jayson=require(_0x29f6('0x10'));var client=jayson['client'][_0x29f6('0x11')]({'port':0x232b});var client9004=jayson[_0x29f6('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5b9b6a,_0x559585,_0x57b2d2,_0x2ae0e4){return new BPromise(function(_0x55cf4,_0x189344){var _0x11a1fd=_0x2ae0e4||client;return _0x11a1fd[_0x29f6('0x13')](_0x5b9b6a,_0x57b2d2)[_0x29f6('0x14')](function(_0x35d2e2){logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));logger[_0x29f6('0x18')](_0x29f6('0x19'),_0x559585,_0x29f6('0x17'),JSON[_0x29f6('0x1a')](_0x35d2e2));if(_0x35d2e2[_0x29f6('0x1b')]){if(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x559585,_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x189344(_0x35d2e2[_0x29f6('0x1b')]['message']);}logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x35d2e2['error'][_0x29f6('0x1d')]);return _0x55cf4(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);}else{logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));_0x55cf4(_0x35d2e2['result'][_0x29f6('0x1d')]);}})['catch'](function(_0x4acb15){logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x4acb15);_0x189344(_0x4acb15);});});}function respondWithStatusCode(_0x39c6b3,_0xafb5dd){_0xafb5dd=_0xafb5dd||0xcc;return function(_0x54ddeb){if(_0x54ddeb){return _0x39c6b3[_0x29f6('0x1e')](_0xafb5dd);}return _0x39c6b3['status'](_0xafb5dd)[_0x29f6('0x1f')]();};}function respondWithResult(_0xcce041,_0x4200cc){_0x4200cc=_0x4200cc||0xc8;return function(_0x1b80aa){if(_0x1b80aa){return _0xcce041['status'](_0x4200cc)[_0x29f6('0x20')](_0x1b80aa);}};}function respondWithFilteredResult(_0x4d494f,_0x47c385){return function(_0x1401fb){if(_0x1401fb){var _0x45f792=typeof _0x47c385[_0x29f6('0x21')]===_0x29f6('0x22')&&typeof _0x47c385[_0x29f6('0x23')]===_0x29f6('0x22');var _0x23c630=_0x1401fb['count'];var _0x2183b7=_0x45f792?0x0:_0x47c385[_0x29f6('0x21')];var _0x1ab8d8=_0x45f792?_0x1401fb[_0x29f6('0x24')]:_0x47c385[_0x29f6('0x21')]+_0x47c385[_0x29f6('0x23')];var _0x3790f5;if(_0x1ab8d8>=_0x23c630){_0x1ab8d8=_0x23c630;_0x3790f5=0xc8;}else{_0x3790f5=0xce;}_0x4d494f[_0x29f6('0x25')](_0x3790f5);return _0x4d494f[_0x29f6('0x26')](_0x29f6('0x27'),_0x2183b7+'-'+_0x1ab8d8+'/'+_0x23c630)[_0x29f6('0x20')](_0x1401fb);}return null;};}function saveUpdates(_0x1c3f0b){return function(_0x40c830){if(_0x40c830){return _0x40c830[_0x29f6('0x28')](_0x1c3f0b)[_0x29f6('0x14')](function(_0x218931){return _0x218931;});}return null;};}function removeEntity(_0x3a7249){return function(_0x5492c2){if(_0x5492c2){return _0x5492c2['destroy']()[_0x29f6('0x14')](function(){_0x3a7249['status'](0xcc)[_0x29f6('0x1f')]();});}};}function handleEntityNotFound(_0xc8d2c5){return function(_0x1e1bb6){if(!_0x1e1bb6){_0xc8d2c5[_0x29f6('0x1e')](0x194);}return _0x1e1bb6;};}function handleError(_0x5e5d89,_0x53e11f){_0x53e11f=_0x53e11f||0x1f4;return function(_0x1bde69){logger[_0x29f6('0x1b')](_0x1bde69[_0x29f6('0x29')]);if(_0x1bde69[_0x29f6('0x2a')]){delete _0x1bde69[_0x29f6('0x2a')];}_0x5e5d89[_0x29f6('0x25')](_0x53e11f)[_0x29f6('0x2b')](_0x1bde69);};}function getMustacheRender(_0x1c3f0f,_0xad83a3){return Mustache[_0x29f6('0x2c')](_0x1c3f0f,_[_0x29f6('0x2d')](_0xad83a3[_0x29f6('0x2e')],{'contact':_0xad83a3[_0x29f6('0x2f')],'message':_0xad83a3[_0x29f6('0x1d')],'agent':_0xad83a3['agent'],'interaction':_0xad83a3['interaction'],'account':_0xad83a3[_0x29f6('0x30')]}))||'';}function getInteractionUsers(_0x44cf19,_0x1cd62a){return new BPromise(function(_0x5416dc,_0x3e1e25){try{if(_0x1cd62a[_0x44cf19['id']]){_0x44cf19[_0x29f6('0x31')]=_[_0x29f6('0x32')](_0x1cd62a[_0x44cf19['id']],function(_0x27d945){return{'id':_0x27d945['id'],'fullname':_0x27d945[_0x29f6('0x33')]};});}}catch(_0x48fbd1){_0x3e1e25(_0x48fbd1);}_0x5416dc(_0x44cf19);});}function getInteractionTags(_0x7695ee,_0x2ad06f){return new BPromise(function(_0x2c3441,_0x1b51cc){try{if(_0x7695ee['TagIds']){_0x7695ee[_0x29f6('0x34')]=[];_0x7695ee[_0x29f6('0x35')][_0x29f6('0x36')](',')[_0x29f6('0x37')](function(_0x5ddc09){_0x7695ee['Tags'][_0x29f6('0x38')](_0x2ad06f[_0x5ddc09]);});}delete _0x7695ee['TagIds'];}catch(_0x10f077){_0x1b51cc(_0x10f077);}_0x2c3441(_0x7695ee);});}function updateChatInteraction(_0x551411,_0x3a1a75,_0x537210){return new BPromise(function(_0x34b1ea,_0x11fb2d){return getInteractionUsers(_0x551411,_0x537210)['then'](function(_0x1431fc){return getInteractionTags(_0x1431fc,_0x3a1a75);})['then'](function(_0x3f3475){return getStateInteraction(_0x3f3475);})[_0x29f6('0x14')](function(_0x4aea11){_0x34b1ea(_0x4aea11);})[_0x29f6('0x39')](function(_0xc6a6b1){_0x11fb2d(_0xc6a6b1);});});}function getStateInteraction(_0x2cad42){return new BPromise(function(_0x1e9d5a){_0x2cad42['waiting']=0x0;_0x2cad42[_0x29f6('0x3a')]=0x0;_0x2cad42[_0x29f6('0x3b')]=0x0;_0x2cad42[_0x29f6('0x3c')]=0x0;_0x2cad42[_0x29f6('0x3d')]=0x0;_0x2cad42[_0x29f6('0x3e')]=0x0;if(!_0x2cad42['closed']&&!_0x2cad42[_0x29f6('0x3f')]){_0x2cad42['waiting']+=0x1;}if(!_0x2cad42[_0x29f6('0x40')]&&_0x2cad42['UserId']){_0x2cad42[_0x29f6('0x3a')]+=0x1;if(_0x2cad42[_0x29f6('0x41')]){_0x2cad42['waiting']-=0x1;}}if(_0x2cad42[_0x29f6('0x40')]&&_0x2cad42[_0x29f6('0x42')]===_0x29f6('0x3d')){_0x2cad42[_0x29f6('0x3d')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42[_0x29f6('0x40')]&&!_0x2cad42[_0x29f6('0x3f')]&&_0x2cad42['disposition']){_0x2cad42[_0x29f6('0x3c')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42['closed']&&_0x2cad42['UserId']){_0x2cad42['answered']+=0x1;if(_0x2cad42[_0x29f6('0x3a')]){_0x2cad42[_0x29f6('0x3a')]-=0x1;}}_0x2cad42[_0x29f6('0x3e')]+=0x1;_0x1e9d5a(_0x2cad42);});}exports[_0x29f6('0x43')]=function(_0x19fd60,_0x270842){var _0x29b3f6={},_0x155ffb={},_0x352119={'count':0x0,'rows':[]};var _0x1bde93=_['map'](db['ChatInteraction'][_0x29f6('0x44')],function(_0x450e76){return{'name':_0x450e76[_0x29f6('0x45')],'type':_0x450e76[_0x29f6('0x46')]['key']};});_0x155ffb[_0x29f6('0x47')]=_[_0x29f6('0x32')](_0x1bde93,'name');_0x155ffb[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x19fd60[_0x29f6('0x48')]);_0x155ffb[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],_0x155ffb[_0x29f6('0x48')]);_0x29b3f6[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x19fd60[_0x29f6('0x48')]['fields']));_0x29b3f6[_0x29f6('0x4c')]=_0x29b3f6[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x29b3f6[_0x29f6('0x4c')]:_0x155ffb[_0x29f6('0x47')];if(!_0x19fd60['query'][_0x29f6('0x4f')]('nolimit')){_0x29b3f6['limit']=qs[_0x29f6('0x23')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x23')]);_0x29b3f6[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x19fd60['query'][_0x29f6('0x21')]);}_0x29b3f6[_0x29f6('0x50')]=qs['sort'](_0x19fd60[_0x29f6('0x48')]['sort']);_0x29b3f6[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x19fd60[_0x29f6('0x48')],_0x155ffb['filters']),_0x1bde93);var _0x199060=[];var _0xaa915c=squel[_0x29f6('0x53')]()[_0x29f6('0x54')]('id')[_0x29f6('0x54')](_0x29f6('0x2a'))[_0x29f6('0x54')]('color')[_0x29f6('0x55')](_0x29f6('0x56'));var _0x3bca11=squel[_0x29f6('0x53')]()[_0x29f6('0x54')](_0x29f6('0x57'))[_0x29f6('0x54')](_0x29f6('0x58'))[_0x29f6('0x54')](_0x29f6('0x59'))['from']('user_has_chat_interactions','ui')[_0x29f6('0x5a')](_0x29f6('0x5b'),'u',_0x29f6('0x5c'));var _0x5ab84e=squel[_0x29f6('0x53')]()['from']('chat_interactions','i')[_0x29f6('0x5a')](_0x29f6('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x29f6('0x5b'),'o',_0x29f6('0x5e'))[_0x29f6('0x5a')]('chat_websites','a',_0x29f6('0x5f'))[_0x29f6('0x5a')](_0x29f6('0x60'),'me',_0x29f6('0x61'))[_0x29f6('0x5a')](_0x29f6('0x62'),'it',_0x29f6('0x63'))[_0x29f6('0x5a')](_0x29f6('0x56'),'t',_0x29f6('0x64'));var _0x2d4c8d=squel[_0x29f6('0x65')]();var _0x434e04=[];var _0x5078d1=squel['expr']();var _0x2bd7d9;if(_0x19fd60['query'][_0x29f6('0x66')]){_0x2bd7d9=as[_0x29f6('0x67')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x66')]);var _0x2f757b=_0x2bd7d9['sqlOperator'];for(var _0x56c442=0x0;_0x56c442<_0x2bd7d9[_0x29f6('0x68')][_0x29f6('0x4e')];_0x56c442++){var _0x293f9d=_0x2bd7d9[_0x29f6('0x68')][_0x56c442];var _0x56342e='i';var _0x32291b=_['find'](_0x1bde93,['name',_0x293f9d[_0x29f6('0x54')]]);if(!_0x32291b){switch(_0x293f9d[_0x29f6('0x54')]){case'unreadMessages':if(_0x293f9d[_0x29f6('0x69')]==0x1){_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d['field']+_0x29f6('0x6b'));}else{_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d[_0x29f6('0x54')]+_0x29f6('0x6c'));}break;case _0x29f6('0x6d'):if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){if(_0x293f9d['value'][_0x29f6('0x36')]('\x20')['length']>0x1){_0x2d4c8d[_0x2f757b](_0x29f6('0x70'),qs['getFullTextValue'](_0x293f9d['value']),null);}else{var _0x1a3357='%'+_0x293f9d[_0x29f6('0x69')]+'%';_0x2d4c8d[_0x2f757b](_0x29f6('0x71'),_0x1a3357,_0x1a3357,_0x1a3357);}}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x72')]);_0x293f9d[_0x29f6('0x54')]='ContactId';_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b[_0x29f6('0x46')],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x76'):var _0x56f3cb=_0x293f9d[_0x29f6('0x69')][_0x29f6('0x36')](',')[_0x29f6('0x32')](function(_0x456578){return Number(_0x456578);});_0x56f3cb[_0x29f6('0x37')](function(_0x122a1a){_0x5078d1['or'](_0x29f6('0x77'),'%,'+_0x122a1a+',%');});_0x434e04=_[_0x29f6('0x78')](_0x434e04,_0x56f3cb);break;case'User':if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){_0x2d4c8d[_0x2f757b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x293f9d[_0x29f6('0x69')]+'%',null);}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x3f')]);_0x293f9d['field']=_0x29f6('0x3f');_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e['text'],_0x411f3e['value'][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x2e'):_0x411f3e=as[_0x29f6('0x73')]('me',null,_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')]['start'],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);break;}}else{var _0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}}}else{var _0x478ed0=_(_0x19fd60[_0x29f6('0x48')])[_0x29f6('0x49')]()[_0x29f6('0x32')](function(_0x1f401c){return _[_0x29f6('0x79')](_0x1bde93,[_0x29f6('0x2a'),_0x1f401c])?_0x1f401c:undefined;})['compact']()[_0x29f6('0x69')]();if(!_['isEmpty'](_0x478ed0)){_0x478ed0['forEach'](function(_0x4f9907){if(_0x4f9907===_0x29f6('0x7a')){_0x5ab84e['where'](_0x29f6('0x7b'),[][_0x29f6('0x7c')](_0x19fd60[_0x29f6('0x48')][_0x4f9907]));}else if(_0x4f9907===_0x29f6('0x7d')){var _0x8a5e58=JSON[_0x29f6('0x7e')](_0x19fd60[_0x29f6('0x48')][_0x4f9907])['$gte'];var _0x3a23f3=JSON['parse'](_0x19fd60[_0x29f6('0x48')][_0x4f9907])[_0x29f6('0x7f')];_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x80'),_0x8a5e58,_0x3a23f3);}else{if(_0x19fd60[_0x29f6('0x48')][_0x4f9907]===_0x29f6('0x81')){_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x82'));}else{_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x83'),_0x19fd60[_0x29f6('0x48')][_0x4f9907]);}}});}if(_0x19fd60[_0x29f6('0x48')]['read']){if(_0x19fd60['query']['read']==0x1){_0x5ab84e[_0x29f6('0x6a')](_0x29f6('0x84'));}else{_0x5ab84e['having'](_0x29f6('0x85'));}}if(_0x19fd60['query'][_0x29f6('0x86')]){_0x434e04=_[_0x29f6('0x87')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')])?_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]:new Array(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]);_0x434e04[_0x29f6('0x37')](function(_0xa2ab9e){_0x5078d1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa2ab9e+',%');});}if(_0x19fd60[_0x29f6('0x48')]['filter']){var _0x16bb3c=_0x19fd60[_0x29f6('0x48')][_0x29f6('0x88')][_0x29f6('0x89')]('\x5c','\x5c\x5c')[_0x29f6('0x89')](/'/g,'\x27\x27');if(qs[_0x29f6('0x8a')](_0x16bb3c)){_0x2d4c8d['or'](_0x29f6('0x8b'),_0x16bb3c+'%');}else{_0x2d4c8d['or'](_0x29f6('0x8c'),qs['getFullTextValue'](_0x16bb3c))['or'](_0x29f6('0x8d'),_0x16bb3c+'%');}}}_0x5ab84e[_0x29f6('0x51')](_0x2d4c8d);_0x5ab84e['group']('i.id');var _0x216f51={'type':db[_0x29f6('0x8e')][_0x29f6('0x8f')][_0x29f6('0x90')],'raw':!![]};var _0x467dd2=_0x5ab84e[_0x29f6('0x91')]();_0x467dd2[_0x29f6('0x54')](_0x29f6('0x92'));_0x467dd2[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));if(_0x29b3f6[_0x29f6('0x50')]){_0x29b3f6['order']['forEach'](function(_0x2e2f16){var _0x180658=_0x2e2f16[0x0]==='contactName'?_0x2e2f16[0x0]:'i.'+_0x2e2f16[0x0];_0x5ab84e[_0x29f6('0x50')](_0x180658,_0x2e2f16[0x1]===_0x29f6('0x95')?![]:!![]);});}if(!_[_0x29f6('0x96')](_0x434e04)){_0x5ab84e[_0x29f6('0x6a')](_0x5078d1);_0x467dd2[_0x29f6('0x51')](_0x29f6('0x97'),_0x434e04);}BPromise[_0x29f6('0x98')]()['then'](function(){if(!_0x2bd7d9){if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return;_0x467dd2[_0x29f6('0x51')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x99'));return;}if(_0x19fd60['user'][_0x29f6('0x9a')]!==_0x29f6('0x9b'))return;return _0x19fd60['user'][_0x29f6('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x405124){if(_[_0x29f6('0x96')](_0x405124)){_0x467dd2[_0x29f6('0x51')](_0x29f6('0x9d'));_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x9d'));}else{_0x467dd2['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));_0x5ab84e[_0x29f6('0x51')]('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));}});})['then'](function(){if(_0x19fd60[_0x29f6('0x9e')][_0x29f6('0x9a')]===_0x29f6('0x9b')&&!_0x2bd7d9&&!_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return[];return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x467dd2['toString'](),_0x216f51);})[_0x29f6('0x14')](function(_0x365b6d){_0x352119[_0x29f6('0x24')]=_0x365b6d['length'];if(_0x352119['count']===0x0)return[];return db['sequelize']['query'](_0xaa915c[_0x29f6('0xa0')](),_0x216f51)['then'](function(_0x537a8d){_0x199060=_['keyBy'](_0x537a8d,'id');_0x216f51=_[_0x29f6('0x2d')](_0x216f51,{'model':db[_0x29f6('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x4d')]){_0x29b3f6[_0x29f6('0x4c')]['forEach'](function(_0x28cf80){_0x5ab84e['field']('i.'+_0x28cf80);});}else{_0x5ab84e[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));_0x5ab84e[_0x29f6('0x54')]('a.key','Account.key');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa2'),_0x29f6('0xa3'));_0x5ab84e['field'](_0x29f6('0xa4'),_0x29f6('0xa5'));_0x5ab84e['field'](_0x29f6('0xa6'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa7'),_0x29f6('0xa8'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa9'),_0x29f6('0xaa'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xab'),_0x29f6('0xac'));_0x5ab84e['field'](_0x29f6('0xad'),'Contact.phone');_0x5ab84e['field']('c.mobile',_0x29f6('0xae'));_0x5ab84e[_0x29f6('0x54')]('c.fax','Contact.fax');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xaf'),'Owner.fullname');_0x5ab84e['field']('o.internal','Owner.internal');_0x5ab84e[_0x29f6('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x29f6('0x35'));}if(_0x29b3f6[_0x29f6('0x23')])_0x5ab84e['limit'](_0x29b3f6[_0x29f6('0x23')]);if(_0x29b3f6[_0x29f6('0x21')])_0x5ab84e['offset'](_0x29b3f6[_0x29f6('0x21')]);return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x5ab84e[_0x29f6('0xa0')](),_0x216f51);})[_0x29f6('0x14')](function(_0x399328){if(_0x399328[_0x29f6('0x4e')]>0x0)_0x3bca11[_0x29f6('0x51')](_0x29f6('0xb0'),_[_0x29f6('0x32')](_0x399328,'id'));return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x3bca11[_0x29f6('0xa0')](),_0x216f51)[_0x29f6('0x14')](function(_0x5076ed){var _0x24757e=_[_0x29f6('0xb1')](_0x5076ed,_0x29f6('0xb2'));var _0x264617=[];_0x399328[_0x29f6('0x37')](function(_0x3569f7){_0x264617[_0x29f6('0x38')](updateChatInteraction(_0x3569f7,_0x199060,_0x24757e));});return BPromise['all'](_0x264617);});});})[_0x29f6('0x14')](function(_0x4ec09d){_0x352119[_0x29f6('0xb3')]=_0x4ec09d;return _0x352119;})[_0x29f6('0x14')](respondWithFilteredResult(_0x270842,_0x29b3f6))[_0x29f6('0x39')](handleError(_0x270842,null));};exports[_0x29f6('0xb4')]=function(_0x43c44d,_0x63517e){var _0x2dc960={'raw':![],'where':{'id':_0x43c44d[_0x29f6('0xb5')]['id']}},_0x312a6f={};_0x312a6f['model']=_[_0x29f6('0x49')](db[_0x29f6('0xa1')]['rawAttributes']);_0x312a6f['query']=_[_0x29f6('0x49')](_0x43c44d[_0x29f6('0x48')]);_0x312a6f[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x312a6f['model'],_0x312a6f[_0x29f6('0x48')]);_0x2dc960[_0x29f6('0x4c')]=_['intersection'](_0x312a6f[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x43c44d[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x2dc960[_0x29f6('0x4c')]=_0x2dc960[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2dc960[_0x29f6('0x4c')]:_0x312a6f[_0x29f6('0x47')];if(_0x43c44d[_0x29f6('0x48')][_0x29f6('0xb6')]){_0x2dc960[_0x29f6('0xb7')]=[{'all':!![]}];}_0x2dc960=_[_0x29f6('0x2d')]({},_0x2dc960,_0x43c44d['options']);return db[_0x29f6('0xa1')][_0x29f6('0xb8')](_0x2dc960)[_0x29f6('0x14')](handleEntityNotFound(_0x63517e,null))[_0x29f6('0x14')](respondWithResult(_0x63517e,null))['catch'](handleError(_0x63517e,null));};exports[_0x29f6('0xb9')]=function(_0x2ffad1,_0x37ea1b){return db['ChatInteraction'][_0x29f6('0xb9')](_0x2ffad1[_0x29f6('0x2e')],{})['then'](respondWithResult(_0x37ea1b,0xc9))[_0x29f6('0x39')](handleError(_0x37ea1b,null));};exports[_0x29f6('0x28')]=function(_0x26f030,_0x247bce){if(_0x26f030[_0x29f6('0x2e')]['id']){delete _0x26f030[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x26f030[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x247bce,null))[_0x29f6('0x14')](saveUpdates(_0x26f030['body'],null))['then'](respondWithResult(_0x247bce,null))[_0x29f6('0x39')](handleError(_0x247bce,null));};exports[_0x29f6('0xba')]=function(_0x1621b7,_0x1f0e72){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x1621b7[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1f0e72,null))['then'](removeEntity(_0x1f0e72,null))['catch'](handleError(_0x1f0e72,null));};exports['describe']=function(_0x1fd477,_0x45dfd1){return db[_0x29f6('0xa1')][_0x29f6('0xbb')]()['then'](respondWithResult(_0x45dfd1,null))[_0x29f6('0x39')](handleError(_0x45dfd1,null));};exports[_0x29f6('0xbc')]=function(_0x4f2471,_0x1ef540){var _0x5a51c0=_0x4f2471[_0x29f6('0xb5')]['id'];var _0x2a2e0e;var _0xaccfb7;var _0x19c10d;return db['ChatInteraction'][_0x29f6('0xbd')]({'where':{'id':_0x5a51c0}})['then'](function(_0x47785a){_0x2a2e0e=_0x47785a;return db[_0x29f6('0xbe')][_0x29f6('0xbd')]({'where':{'id':_0x47785a[_0x29f6('0x7a')]},'attributes':['id',_0x29f6('0xbf'),_0x29f6('0xc0'),'vidaooTopic','vidaooNote',_0x29f6('0xc1')],'raw':!![]});})['then'](function(_0x5db958){if(_0x5db958&&_0x5db958[_0x29f6('0xbf')]&&_0x5db958['vidaooEscalation']){_0xaccfb7=_0x5db958;var _0x67c30a={'interaction':{'id':_0x5a51c0},'agent':{'id':_0x4f2471[_0x29f6('0x9e')]['id'],'name':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x2a')],'fullname':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x33')],'email':_0x4f2471['user'][_0x29f6('0xc2')]},'contact':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x2f')],'account':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x30')]};var _0x1cec09={'rejectUnauthorized':![],'method':_0x29f6('0xc3'),'url':_0x29f6('0xc4'),'headers':{'X-APIKEY':_0x5db958[_0x29f6('0xbf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4f2471[_0x29f6('0x9e')][_0x29f6('0xc2')]],'buttons':null,'topic':_0xaccfb7['vidaooTopic'],'note':_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc6')])?null:getMustacheRender(_0xaccfb7['vidaooNote'],_0x67c30a),'metadata':null},'redirect':_0x29f6('0xc7'),'json':!![]};try{if(!_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc1')])){var _0x50d48d=getMustacheRender(_0xaccfb7['vidaooMetadata'],_0x67c30a);var _0x1413a5=JSON[_0x29f6('0x7e')](_0x50d48d);_0x1cec09[_0x29f6('0x2e')][_0x29f6('0xc8')]=_0x1413a5;}}catch(_0x2b6357){throw new db[(_0x29f6('0x8e'))]['ValidationError'](_0x29f6('0xc9'));}return rp(_0x1cec09);}else{throw new db[(_0x29f6('0x8e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x231f26){_0x19c10d=_0x231f26;if(_0x19c10d['id']){var _0x578d49={'body':_0x19c10d[_0x29f6('0xca')],'ChatWebsiteId':_0xaccfb7['id'],'ChatInteractionId':_0x2a2e0e['id'],'direction':'out','UserId':_0x4f2471[_0x29f6('0x9e')]['id']};return db[_0x29f6('0xcb')][_0x29f6('0xb9')](_0x578d49,{});}else{throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x29f6('0x14')](function(){return _0x2a2e0e['updateAttributes']({'vidaooSessionId':_0x19c10d['id']});})[_0x29f6('0x14')](respondWithResult(_0x1ef540,null))[_0x29f6('0x39')](handleError(_0x1ef540,null));};exports[_0x29f6('0xcd')]=function(_0x19d1cb,_0x478660){if(_0x19d1cb[_0x29f6('0x2e')]['id']){delete _0x19d1cb[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x19d1cb[_0x29f6('0xb5')]['id']},'include':[{'model':db['CmContact'],'as':_0x29f6('0x6d')}]})[_0x29f6('0x14')](handleEntityNotFound(_0x478660,null))['then'](saveUpdates(_0x19d1cb[_0x29f6('0x2e')],null))['then'](respondWithResult(_0x478660,null))[_0x29f6('0x39')](handleError(_0x478660,null));};exports[_0x29f6('0xce')]=function(_0x52c66d,_0x955f7){if(_0x52c66d[_0x29f6('0x2e')]['id']){delete _0x52c66d['body']['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x52c66d[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](function(_0x352a07){if(!_0x352a07){logger[_0x29f6('0x1b')](_0x29f6('0xcf'),_0x29f6('0xce'),0x194,'entity\x20not\x20found');_0x955f7[_0x29f6('0x1e')](0x194);}else{if(_0x352a07[_0x29f6('0x3f')]){throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Interaction\x20already\x20assigned');}}return _0x352a07;})[_0x29f6('0x14')](function(_0x10648e){if(_0x10648e){return _0x10648e[_0x29f6('0x28')]({'closed':_0x52c66d[_0x29f6('0x2e')][_0x29f6('0x40')],'disposition':_0x52c66d['body']['disposition']})[_0x29f6('0x14')](function(_0x1b3b27){return _0x1b3b27;});}})['then'](function(){return respondWithRpcPromise(_0x29f6('0xd0'),'abandon',_0x52c66d['body'],client9004);})[_0x29f6('0x14')](respondWithResult(_0x955f7,null))['catch'](handleError(_0x955f7,null));};exports[_0x29f6('0xd1')]=function(_0x24a7fb,_0x454c4c){_0x24a7fb[_0x29f6('0x2e')]['name']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd3')];_0x24a7fb[_0x29f6('0x2e')][_0x29f6('0xd4')]=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd5')];_0x24a7fb['body']['type']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd6')];return db[_0x29f6('0xd7')][_0x29f6('0xb9')](_0x24a7fb[_0x29f6('0x2e')])[_0x29f6('0x14')](respondWithResult(_0x454c4c,0xc9))[_0x29f6('0x39')](handleError(_0x454c4c,null));};exports[_0x29f6('0xd8')]=function(_0x3d131a,_0x2bc181){return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d131a[_0x29f6('0xb5')]['id']},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null))[_0x29f6('0x14')](function(_0x583f5f){if(_0x583f5f){if(_0x583f5f[_0x29f6('0x40')]){return _0x2bc181[_0x29f6('0x25')](0x193)[_0x29f6('0x20')]({'status':0x193,'message':_0x29f6('0xd9')});}return db[_0x29f6('0xd7')]['findOne']({'where':{'id':_0x3d131a[_0x29f6('0x48')][_0x29f6('0xda')]},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null));}})['then'](function(_0x2378b8){if(_0x2378b8){var _0x2a5414=_0x2378b8[_0x29f6('0xdb')]!==null;var _0x189048=path['join'](config[_0x29f6('0xdc')],'server/files/attachments/');if(_0x2a5414){_0x189048=path[_0x29f6('0xdd')](_0x189048,'offline-chat/');}var _0x2aa18b=path[_0x29f6('0xdd')](_0x189048,_0x2378b8[_0x29f6('0xd4')]);return _0x2bc181[_0x29f6('0xde')](_0x2aa18b);}})['catch'](handleError(_0x2bc181,null));};exports[_0x29f6('0xdf')]=function(_0x2216ef,_0x4577ee){var _0x2ef994=null;var _0x28e4c5=null;var _0x168724=null;if(_0x2216ef[_0x29f6('0x2e')]['id']){delete _0x2216ef[_0x29f6('0x2e')]['id'];}if(_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')]){_0x168724=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server/files/chat/upload/',util[_0x29f6('0xe1')](_0x29f6('0xe2'),Date[_0x29f6('0xe3')]()));_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe4')]=_0x168724;}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x2216ef[_0x29f6('0xb5')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x29f6('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x29f6('0x14')](handleEntityNotFound(_0x4577ee,null))['then'](saveUpdates(_0x2216ef[_0x29f6('0x2e')],null))[_0x29f6('0x14')](function(_0x4a3381){if(_0x4a3381){_0x2ef994=_0x4a3381;return db[_0x29f6('0xbe')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994[_0x29f6('0x7a')]}});}})[_0x29f6('0x14')](function(_0xdb766a){if(_0xdb766a){_0x28e4c5=_0xdb766a;return db[_0x29f6('0xe6')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994['ContactId']}});}})[_0x29f6('0x14')](function(_0x37735f){if(_0x37735f){if(_0x168724){var _0x399aed=null;for(var _0xe432b0=0x1;_0xe432b0<_0x2ef994[_0x29f6('0xe5')][_0x29f6('0x4e')];++_0xe432b0){_0x399aed=_0x2ef994['Messages'][_0xe432b0];var _0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):_0x29f6('0xe9');var _0x46a5da=_0x2216ef['body'][_0x29f6('0xea')]||util['format']('%s%d',_0x29f6('0xeb'),_0x399aed[_0x29f6('0x72')]);switch(_0x28e4c5[_0x29f6('0xec')]){case _0x29f6('0xed'):_0x21bc96=_0x399aed['UserId']?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed[_0x29f6('0x3f')]):_0x29f6('0xe9');break;case _0x29f6('0xee'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed[_0x29f6('0xef')][_0x29f6('0xf0')]||_0x399aed[_0x29f6('0xef')][_0x29f6('0x33')]:_0x29f6('0xe9');break;case _0x29f6('0xf1'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed['User']['fullname']:_0x29f6('0xe9');break;default:_0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):'System';}var _0x593d86=util[_0x29f6('0xe1')](_0x29f6('0xf2'),moment(_0x399aed[_0x29f6('0x7d')])[_0x29f6('0xe1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x399aed[_0x29f6('0xf3')]==='in'?_0x46a5da:_0x21bc96,_0x399aed[_0x29f6('0x2e')]);if(!_0x399aed[_0x29f6('0xf4')]){fs[_0x29f6('0xf5')](_0x168724,_0x593d86);}}return db[_0x29f6('0xf6')][_0x29f6('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0x29f6('0xf7')],'as':_0x29f6('0xf8'),'raw':!![],'include':[{'model':db[_0x29f6('0xf9')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x29f6('0x14')](function(_0x294136){if(!_0x294136||!_0x294136[_0x29f6('0xf8')]||!_0x2216ef[_0x29f6('0x2e')])return _0x2ef994;var _0x59fb2a=_0x294136['getSmtpOptions']();return respondWithRpcPromise(_0x29f6('0xfa'),_0x29f6('0xfb'),{'account':_0x59fb2a,'message':{'from':util[_0x29f6('0xe1')](_0x29f6('0xfc'),_0x294136[_0x29f6('0x2a')],_0x294136['email']||_0x294136[_0x29f6('0xf8')][_0x29f6('0x9e')]),'to':_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')],'subject':_0x29f6('0xfd'),'text':util[_0x29f6('0xe1')](_0x29f6('0xfe'),_0x2216ef['body'][_0x29f6('0xe0')]),'attachments':[{'path':_0x168724}]}})[_0x29f6('0x14')](function(){return _0x2ef994;})[_0x29f6('0x39')](function(_0x3d027f){logger['error'](_0x3d027f);});})[_0x29f6('0x14')](respondWithStatusCode(_0x4577ee,0xc8))[_0x29f6('0x39')](handleError(_0x4577ee,null));};exports[_0x29f6('0xff')]=function(_0x2df557,_0x589222){return db[_0x29f6('0xcb')][_0x29f6('0xb8')]({'where':{'id':_0x2df557[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x589222,null))[_0x29f6('0x14')](function(_0x318fd1){if(_0x318fd1){return _0x318fd1[_0x29f6('0xff')](_0x2df557[_0x29f6('0x2e')]['ids'],_[_0x29f6('0x100')](_0x2df557[_0x29f6('0x2e')],['ids','id'])||{});}})['then'](respondWithResult(_0x589222,null))['catch'](handleError(_0x589222,null));};exports[_0x29f6('0x101')]=function(_0x29017d,_0x5863a2){var _0x2f7729={'raw':![],'where':{}};var _0x171342={};var _0x1dafb9={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x29017d['params']['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x5863a2,null))[_0x29f6('0x14')](function(_0x1207f7){if(_0x1207f7){_0x171342[_0x29f6('0x47')]=_[_0x29f6('0x49')](db[_0x29f6('0xcb')][_0x29f6('0x44')]);_0x171342[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x29017d[_0x29f6('0x48')]);_0x171342['filters']=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],_0x171342['query']);_0x2f7729[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x29017d[_0x29f6('0x48')]['fields']));_0x2f7729[_0x29f6('0x4c')]=_0x2f7729[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2f7729['attributes']:_0x171342['model'];if(!_0x29017d[_0x29f6('0x48')][_0x29f6('0x4f')](_0x29f6('0x102'))){_0x2f7729[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x29017d[_0x29f6('0x48')]['limit']);_0x2f7729['offset']=qs[_0x29f6('0x21')](_0x29017d[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x2f7729[_0x29f6('0x50')]=qs[_0x29f6('0x103')](_0x29017d[_0x29f6('0x48')]['sort']);_0x2f7729['where']=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x29017d[_0x29f6('0x48')],_0x171342['filters']));_0x2f7729['where']['ChatInteractionId']=_0x1207f7['id'];if(_0x29017d[_0x29f6('0x48')]['filter']){_0x2f7729[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x2f7729[_0x29f6('0x4c')],function(_0x25532f){var _0x31ebb3={};_0x31ebb3[_0x25532f]={'$like':'%'+_0x29017d[_0x29f6('0x48')][_0x29f6('0x88')]+'%'};return _0x31ebb3;})});}if(_0x29017d['query'][_0x29f6('0x104')]){var _0x173977=_0x29017d['query'][_0x29f6('0x104')][_0x29f6('0x36')](',');var _0x43acdc={};_0x43acdc[_0x173977[0x0]]={'$gte':moment(_0x173977[0x1])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2f7729['where']=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],_0x43acdc);}_0x2f7729=_[_0x29f6('0x2d')]({},_0x2f7729,_0x29017d[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x2f7729['where']})[_0x29f6('0x14')](function(_0x216ad8){_0x1dafb9['count']=_0x216ad8;if(_0x29017d['query']['includeAll']){_0x2f7729[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')][_0x29f6('0x106')](_0x2f7729);})[_0x29f6('0x14')](function(_0x2b1808){_0x1dafb9['rows']=_0x2b1808;return _0x1dafb9;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x5863a2,_0x2f7729))[_0x29f6('0x39')](handleError(_0x5863a2,null));};exports[_0x29f6('0x107')]=function(_0x3d68f3,_0x1cb0c0){var _0x47e4e5={'where':{}},_0x3a19d2={},_0x3450c3={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d68f3[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1cb0c0,null))[_0x29f6('0x14')](function(_0x6a318b){if(_0x6a318b){_0x3a19d2['model']=_[_0x29f6('0x49')](db[_0x29f6('0xcb')]['rawAttributes']);_0x3a19d2[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x3d68f3[_0x29f6('0x48')]);_0x3a19d2['filters']=_['intersection'](_0x3a19d2['model'],_0x3a19d2['query']);_0x47e4e5[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x3a19d2[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x47e4e5[_0x29f6('0x4c')]=_0x47e4e5[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x47e4e5[_0x29f6('0x4c')]:_0x3a19d2['model'];if(!_0x3d68f3[_0x29f6('0x48')]['hasOwnProperty'](_0x29f6('0x102'))){_0x47e4e5[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x23')]);_0x47e4e5[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x47e4e5['order']=qs['sort'](_0x3d68f3[_0x29f6('0x48')]['sort']);_0x47e4e5[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x3d68f3[_0x29f6('0x48')],_0x3a19d2[_0x29f6('0x4a')]));_0x47e4e5['where'][_0x29f6('0xb2')]=_0x6a318b['id'];if(_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x88')]){_0x47e4e5[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x47e4e5[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x47e4e5[_0x29f6('0x4c')],function(_0x346ece){var _0xc22605={};_0xc22605[_0x346ece]={'$like':'%'+_0x3d68f3[_0x29f6('0x48')]['filter']+'%'};return _0xc22605;})});}_0x47e4e5[_0x29f6('0x51')]['secret']=![];if(_0x3d68f3[_0x29f6('0x48')]['id']){_0x47e4e5[_0x29f6('0x51')]['id']={'$gt':_0x3d68f3['query']['id']};}_0x47e4e5=_['merge']({},_0x47e4e5,_0x3d68f3[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x47e4e5[_0x29f6('0x51')]})[_0x29f6('0x14')](function(_0x15db8c){_0x3450c3[_0x29f6('0x24')]=_0x15db8c;_0x47e4e5[_0x29f6('0xb7')]=[];if(_0x3d68f3['query']['includeAgent']){_0x47e4e5[_0x29f6('0xb7')]['push']({'model':db[_0x29f6('0xef')],'as':_0x29f6('0xef'),'attributes':['id','fullname',_0x29f6('0xf0')]});}if(_0x3d68f3[_0x29f6('0x48')]['includeAll']){_0x47e4e5[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')]['findAll'](_0x47e4e5);})['then'](function(_0x37c860){_0x3450c3[_0x29f6('0xb3')]=_0x37c860;return _0x3450c3;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x1cb0c0,_0x47e4e5))[_0x29f6('0x39')](handleError(_0x1cb0c0,null));};exports[_0x29f6('0x108')]=function(_0x371548,_0x7a0ebf){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x371548[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x7a0ebf,null))[_0x29f6('0x14')](function(_0x1e05e2){if(_0x1e05e2){return _0x1e05e2[_0x29f6('0x109')](_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')],_[_0x29f6('0x100')](_0x371548[_0x29f6('0x2e')],[_0x29f6('0x10a'),'id'])||{})[_0x29f6('0x10b')](function(){return db[_0x29f6('0x76')]['findAll']({'attributes':['id',_0x29f6('0x2a'),_0x29f6('0x10c')],'where':{'id':_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')]}});})['then'](function(_0x5248ba){socket[_0x29f6('0x10d')](_0x29f6('0x10e'),{'id':Number(_0x371548[_0x29f6('0xb5')]['id']),'tags':_0x5248ba||[]});return{'id':Number(_0x371548['params']['id']),'tags':_0x5248ba||[]};});}})[_0x29f6('0x14')](respondWithResult(_0x7a0ebf,null))[_0x29f6('0x39')](handleError(_0x7a0ebf,null));};exports[_0x29f6('0x10f')]=function(_0x47028e,_0x410ab5){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x47028e[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x410ab5,null))[_0x29f6('0x14')](function(_0x281c49){if(_0x281c49){return _0x281c49[_0x29f6('0x10f')](_0x47028e[_0x29f6('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x410ab5,null))[_0x29f6('0x39')](handleError(_0x410ab5,null));};exports['download']=function(_0x5250bc,_0x31ba94){var _0x31dcfe=moment()[_0x29f6('0x110')]()[_0x29f6('0xa0')]();var _0x5cf3d4=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],_0x29f6('0x111'),'files',_0x29f6('0x112'));var _0x5dcaf2=path['join'](config['root'],'server',_0x29f6('0x113'),_0x29f6('0x114'));var _0xcf75fe=path[_0x29f6('0xdd')](_0x5cf3d4,_0x31dcfe);var _0x48ecb0=util['format']('transcript-%d-%s.zip',_0x5250bc[_0x29f6('0xb5')]['id'],_0x31dcfe);var _0x5de30e=path[_0x29f6('0xdd')](_0x5cf3d4,_0x48ecb0);var _0x10989a=[];_0x10989a[_0x29f6('0x38')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x10989a[_0x29f6('0x38')]({'model':db[_0x29f6('0xe6')],'as':_0x29f6('0x6d'),'attributes':['id',_0x29f6('0x115'),_0x29f6('0x116')],'raw':!![]});if(_0x5250bc['query'][_0x29f6('0x114')]){_0x10989a[_0x29f6('0x38')]({'model':db['Attachment'],'as':_0x29f6('0xd7'),'raw':!![]});}var _0x15c951=[{'model':db[_0x29f6('0xcb')],'as':'Messages','attributes':['id','body',_0x29f6('0x7d'),'direction',_0x29f6('0xf4'),_0x29f6('0x117')],'include':_0x10989a}];_0x15c951['push']({'model':db['ChatWebsite'],'as':_0x29f6('0x118'),'attributes':['id',_0x29f6('0x2a')]});_0x15c951[_0x29f6('0x38')]({'model':db['User'],'as':_0x29f6('0x119'),'attributes':['id',_0x29f6('0x33')]});return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x5250bc[_0x29f6('0xb5')]['id']},'include':_0x15c951})['then'](handleEntityNotFound(_0x31ba94,null))[_0x29f6('0x14')](function(_0x4ad41d){if(_0x4ad41d){var _0x598bcd=_0x4ad41d['get']({'plain':!![]});fs['mkdirSync'](_0xcf75fe);var _0x53751c={'channel':_0x29f6('0x11a'),'account':_0x598bcd['Account'][_0x29f6('0x2a')],'agent':_0x598bcd[_0x29f6('0x119')]?_0x598bcd[_0x29f6('0x119')][_0x29f6('0x33')]:_0x29f6('0x11b'),'createdAt':moment(_0x598bcd['createdAt'])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'closedAt':_0x598bcd['closed']?moment(_0x598bcd[_0x29f6('0x11d')])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x29f6('0xa0')]():'','disposition':_0x598bcd['disposition'],'chatInfo':{'browser':_0x598bcd[_0x29f6('0x11e')],'os':_0x598bcd[_0x29f6('0x11f')],'referer':_0x598bcd[_0x29f6('0x120')],'customerIp':_0x598bcd[_0x29f6('0x121')],'customerPort':_0x598bcd[_0x29f6('0x122')]?_0x598bcd[_0x29f6('0x122')]:_0x29f6('0x11b')},'messages':_(_0x598bcd[_0x29f6('0xe5')])[_0x29f6('0x123')]()[_0x29f6('0x88')]({'secret':![]})[_0x29f6('0x32')](function(_0x2fd414){if(_0x2fd414['Attachment']){var _0x49c5f6=path[_0x29f6('0xdd')](_0x5dcaf2,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]);if(fs[_0x29f6('0x124')](_0x49c5f6)){fs[_0x29f6('0x125')](_0x49c5f6)[_0x29f6('0x126')](fs[_0x29f6('0x127')](path[_0x29f6('0xdd')](_0xcf75fe,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')])));}}return{'date':moment(_0x2fd414[_0x29f6('0x7d')])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'sender':_0x2fd414[_0x29f6('0xf3')]===_0x29f6('0x128')?_0x2fd414[_0x29f6('0xef')]?_0x2fd414[_0x29f6('0xef')]['fullname']:_0x29f6('0xe9'):_0x2fd414[_0x29f6('0x6d')]['firstName']+(_0x2fd414['Contact'][_0x29f6('0x116')]?'\x20'+_0x2fd414[_0x29f6('0x6d')][_0x29f6('0x116')]:''),'body':_0x2fd414[_0x29f6('0xd7')]?_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]:_0x2fd414[_0x29f6('0x2e')],'direction':_0x2fd414['direction']==='out'?'A':'C','secret':_0x2fd414['secret'],'read':_0x2fd414[_0x29f6('0x117')],'attachment':_0x2fd414[_0x29f6('0xd7')]};})[_0x29f6('0x69')]()};return ejs[_0x29f6('0x129')](path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server','views',_0x29f6('0x12a')),{'interaction':_0x53751c})[_0x29f6('0x14')](function(_0x3307a1){var _0x595aff=path[_0x29f6('0xdd')](_0xcf75fe,'transcript-'+_0x598bcd['id']+'-'+_0x31dcfe+_0x29f6('0x12b'));var _0x3101aa={'path':_0x595aff,'channel':'Chat','interactionId':_0x598bcd['id']};return pdf['createPdfFromHTML'](_0x3307a1,_0x3101aa);})[_0x29f6('0x14')](function(){return new Promise(function(_0x4c7b46,_0x41d45f){zipdir(_0xcf75fe,{'saveTo':_0x5de30e},function(_0x1f1679,_0x2dfc83){if(_0x1f1679)return _0x41d45f(_0x1f1679);return _0x4c7b46(_0x2dfc83);});})[_0x29f6('0x14')](function(){return new BPromise(function(_0x53cde9,_0x26eef7){rimraf(_0xcf75fe,function(_0x17b595){if(_0x17b595)_0x26eef7(_0x17b595);return _0x53cde9();});});})['then'](function(){return _0x31ba94[_0x29f6('0xde')](_0x5de30e,_0x48ecb0,function(_0x22fcde){if(_0x22fcde){logger[_0x29f6('0x1b')](_0x29f6('0x12c'),_0x22fcde);}else{fs['unlinkSync'](_0x5de30e);}});});});}else{return _0x31ba94[_0x29f6('0x1e')](0xc8);}})[_0x29f6('0x39')](handleError(_0x31ba94,null));};
\ No newline at end of file
+var _0x153f=['sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','setTags','spread','emit','chatInteractionTags:save','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','secret','read','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','lastName','renderFile','views','transcript-','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','stack','name','send','render','merge','contact','agent','interaction','account','Users','map','TagIds','split','Tags','push','catch','waiting','talking','answered','unmanaged','closed','UserId','disposition','abandoned','total','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','value','`\x20=\x200','having','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','body','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','unreadMessages','order','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','rows','show','params','fields','includeAll','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','isNull','vidaooMetadata','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','pathTranscript','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0x153f,0x15b));var _0xf153=function(_0x4c0130,_0x4bc4b4){_0x4c0130=_0x4c0130-0x0;var _0x35c61c=_0x153f[_0x4c0130];return _0x35c61c;};'use strict';var rimraf=require(_0xf153('0x0'));var zipdir=require(_0xf153('0x1'));var rp=require(_0xf153('0x2'));var moment=require(_0xf153('0x3'));var BPromise=require(_0xf153('0x4'));var Mustache=require(_0xf153('0x5'));var util=require(_0xf153('0x6'));var path=require('path');var ejs=require(_0xf153('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf153('0x8'));var Redis=require(_0xf153('0x9'));var qs=require(_0xf153('0xa'));var as=require(_0xf153('0xb'));var pdf=require(_0xf153('0xc'));var logger=require('../../config/logger')(_0xf153('0xd'));var config=require(_0xf153('0xe'));var db=require(_0xf153('0xf'))['db'];config[_0xf153('0x10')]=_[_0xf153('0x11')](config[_0xf153('0x10')],{'host':_0xf153('0x12'),'port':0x18eb});var socket=require(_0xf153('0x13'))(new Redis(config[_0xf153('0x10')]));require(_0xf153('0x14'))['register'](socket);var jayson=require(_0xf153('0x15'));var client=jayson[_0xf153('0x16')][_0xf153('0x17')]({'port':0x232b});var client9004=jayson['client'][_0xf153('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x292f89,_0x65756d,_0x1cc666,_0x256b7d){return new BPromise(function(_0x107d31,_0x3f915c){var _0x1d54c4=_0x256b7d||client;return _0x1d54c4[_0xf153('0x18')](_0x292f89,_0x1cc666)['then'](function(_0x18be7e){logger[_0xf153('0x19')](_0xf153('0x1a'),_0x65756d,_0xf153('0x1b'));logger[_0xf153('0x1c')](_0xf153('0x1d'),_0x65756d,_0xf153('0x1b'),JSON[_0xf153('0x1e')](_0x18be7e));if(_0x18be7e['error']){if(_0x18be7e[_0xf153('0x1f')]['code']===0x1f4){logger[_0xf153('0x1f')](_0xf153('0x1a'),_0x65756d,_0x18be7e[_0xf153('0x1f')][_0xf153('0x20')]);return _0x3f915c(_0x18be7e['error'][_0xf153('0x20')]);}logger[_0xf153('0x1f')](_0xf153('0x1a'),_0x65756d,_0x18be7e[_0xf153('0x1f')][_0xf153('0x20')]);return _0x107d31(_0x18be7e[_0xf153('0x1f')][_0xf153('0x20')]);}else{logger[_0xf153('0x19')](_0xf153('0x1a'),_0x65756d,_0xf153('0x1b'));_0x107d31(_0x18be7e[_0xf153('0x21')][_0xf153('0x20')]);}})['catch'](function(_0xcd5762){logger[_0xf153('0x1f')](_0xf153('0x1a'),_0x65756d,_0xcd5762);_0x3f915c(_0xcd5762);});});}function respondWithStatusCode(_0x32e759,_0x5c9f44){_0x5c9f44=_0x5c9f44||0xcc;return function(_0x3e94b5){if(_0x3e94b5){return _0x32e759[_0xf153('0x22')](_0x5c9f44);}return _0x32e759[_0xf153('0x23')](_0x5c9f44)[_0xf153('0x24')]();};}function respondWithResult(_0x38190c,_0x1570fc){_0x1570fc=_0x1570fc||0xc8;return function(_0x39f3ed){if(_0x39f3ed){return _0x38190c[_0xf153('0x23')](_0x1570fc)[_0xf153('0x25')](_0x39f3ed);}};}function respondWithFilteredResult(_0xe490f8,_0x35f9da){return function(_0x141ef4){if(_0x141ef4){var _0x703adb=typeof _0x35f9da[_0xf153('0x26')]===_0xf153('0x27')&&typeof _0x35f9da['limit']===_0xf153('0x27');var _0x3f1c6f=_0x141ef4['count'];var _0x16cdcd=_0x703adb?0x0:_0x35f9da[_0xf153('0x26')];var _0x4e45f9=_0x703adb?_0x141ef4[_0xf153('0x28')]:_0x35f9da[_0xf153('0x26')]+_0x35f9da[_0xf153('0x29')];var _0x2b9a9c;if(_0x4e45f9>=_0x3f1c6f){_0x4e45f9=_0x3f1c6f;_0x2b9a9c=0xc8;}else{_0x2b9a9c=0xce;}_0xe490f8[_0xf153('0x23')](_0x2b9a9c);return _0xe490f8[_0xf153('0x2a')](_0xf153('0x2b'),_0x16cdcd+'-'+_0x4e45f9+'/'+_0x3f1c6f)[_0xf153('0x25')](_0x141ef4);}return null;};}function saveUpdates(_0x19a568){return function(_0x8e31bf){if(_0x8e31bf){return _0x8e31bf[_0xf153('0x2c')](_0x19a568)[_0xf153('0x2d')](function(_0x5b5237){return _0x5b5237;});}return null;};}function removeEntity(_0x258fb0){return function(_0xbb3619){if(_0xbb3619){return _0xbb3619[_0xf153('0x2e')]()[_0xf153('0x2d')](function(){_0x258fb0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28433d){return function(_0x4c6ea0){if(!_0x4c6ea0){_0x28433d['sendStatus'](0x194);}return _0x4c6ea0;};}function handleError(_0x2473d0,_0x4ab958){_0x4ab958=_0x4ab958||0x1f4;return function(_0x2b9623){logger['error'](_0x2b9623[_0xf153('0x2f')]);if(_0x2b9623[_0xf153('0x30')]){delete _0x2b9623['name'];}_0x2473d0[_0xf153('0x23')](_0x4ab958)[_0xf153('0x31')](_0x2b9623);};}function getMustacheRender(_0x538069,_0x40be52){return Mustache[_0xf153('0x32')](_0x538069,_[_0xf153('0x33')](_0x40be52['body'],{'contact':_0x40be52[_0xf153('0x34')],'message':_0x40be52['message'],'agent':_0x40be52[_0xf153('0x35')],'interaction':_0x40be52[_0xf153('0x36')],'account':_0x40be52[_0xf153('0x37')]}))||'';}function getInteractionUsers(_0x1820c3,_0x274bcc){return new BPromise(function(_0x284fe8,_0x4becf3){try{if(_0x274bcc[_0x1820c3['id']]){_0x1820c3[_0xf153('0x38')]=_[_0xf153('0x39')](_0x274bcc[_0x1820c3['id']],function(_0x332809){return{'id':_0x332809['id'],'fullname':_0x332809['fullname']};});}}catch(_0x244172){_0x4becf3(_0x244172);}_0x284fe8(_0x1820c3);});}function getInteractionTags(_0x17d60c,_0xd2a763){return new BPromise(function(_0x254692,_0x36c5cd){try{if(_0x17d60c[_0xf153('0x3a')]){_0x17d60c['Tags']=[];_0x17d60c[_0xf153('0x3a')][_0xf153('0x3b')](',')['forEach'](function(_0x14b2e3){_0x17d60c[_0xf153('0x3c')][_0xf153('0x3d')](_0xd2a763[_0x14b2e3]);});}delete _0x17d60c[_0xf153('0x3a')];}catch(_0x103b91){_0x36c5cd(_0x103b91);}_0x254692(_0x17d60c);});}function updateChatInteraction(_0x42360a,_0xef1510,_0x4d90c1){return new BPromise(function(_0x355131,_0x2f63d6){return getInteractionUsers(_0x42360a,_0x4d90c1)[_0xf153('0x2d')](function(_0x352e7c){return getInteractionTags(_0x352e7c,_0xef1510);})[_0xf153('0x2d')](function(_0x1ee606){return getStateInteraction(_0x1ee606);})['then'](function(_0x4b108e){_0x355131(_0x4b108e);})[_0xf153('0x3e')](function(_0x5051f3){_0x2f63d6(_0x5051f3);});});}function getStateInteraction(_0x46dd09){return new BPromise(function(_0x36c456){_0x46dd09[_0xf153('0x3f')]=0x0;_0x46dd09[_0xf153('0x40')]=0x0;_0x46dd09[_0xf153('0x41')]=0x0;_0x46dd09[_0xf153('0x42')]=0x0;_0x46dd09['abandoned']=0x0;_0x46dd09['total']=0x0;if(!_0x46dd09[_0xf153('0x43')]&&!_0x46dd09[_0xf153('0x44')]){_0x46dd09['waiting']+=0x1;}if(!_0x46dd09[_0xf153('0x43')]&&_0x46dd09[_0xf153('0x44')]){_0x46dd09[_0xf153('0x40')]+=0x1;if(_0x46dd09[_0xf153('0x3f')]){_0x46dd09[_0xf153('0x3f')]-=0x1;}}if(_0x46dd09[_0xf153('0x43')]&&_0x46dd09[_0xf153('0x45')]===_0xf153('0x46')){_0x46dd09[_0xf153('0x46')]+=0x1;if(_0x46dd09[_0xf153('0x3f')]){_0x46dd09[_0xf153('0x3f')]-=0x1;}}else if(_0x46dd09[_0xf153('0x43')]&&!_0x46dd09['UserId']&&_0x46dd09[_0xf153('0x45')]){_0x46dd09[_0xf153('0x42')]+=0x1;if(_0x46dd09[_0xf153('0x3f')]){_0x46dd09['waiting']-=0x1;}}else if(_0x46dd09[_0xf153('0x43')]&&_0x46dd09[_0xf153('0x44')]){_0x46dd09['answered']+=0x1;if(_0x46dd09[_0xf153('0x40')]){_0x46dd09['talking']-=0x1;}}_0x46dd09[_0xf153('0x47')]+=0x1;_0x36c456(_0x46dd09);});}exports[_0xf153('0x48')]=function(_0x17fb10,_0x550d45){var _0x1f540b={},_0x209048={},_0x1426eb={'count':0x0,'rows':[]};var _0x1bece2=_[_0xf153('0x39')](db['ChatInteraction'][_0xf153('0x49')],function(_0x3bc265){return{'name':_0x3bc265['fieldName'],'type':_0x3bc265[_0xf153('0x4a')][_0xf153('0x4b')]};});_0x209048[_0xf153('0x4c')]=_['map'](_0x1bece2,_0xf153('0x30'));_0x209048[_0xf153('0x4d')]=_[_0xf153('0x4e')](_0x17fb10[_0xf153('0x4d')]);_0x209048[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x209048[_0xf153('0x4c')],_0x209048[_0xf153('0x4d')]);_0x1f540b[_0xf153('0x51')]=_['intersection'](_0x209048[_0xf153('0x4c')],qs['fields'](_0x17fb10['query']['fields']));_0x1f540b[_0xf153('0x51')]=_0x1f540b[_0xf153('0x51')]['length']?_0x1f540b[_0xf153('0x51')]:_0x209048[_0xf153('0x4c')];if(!_0x17fb10['query'][_0xf153('0x52')](_0xf153('0x53'))){_0x1f540b[_0xf153('0x29')]=qs[_0xf153('0x29')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x29')]);_0x1f540b['offset']=qs[_0xf153('0x26')](_0x17fb10[_0xf153('0x4d')]['offset']);}_0x1f540b['order']=qs[_0xf153('0x54')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x54')]);_0x1f540b[_0xf153('0x55')]=qs[_0xf153('0x4f')](_[_0xf153('0x56')](_0x17fb10['query'],_0x209048[_0xf153('0x4f')]),_0x1bece2);var _0x51d813=[];var _0x340aba=squel[_0xf153('0x57')]()[_0xf153('0x58')]('id')['field'](_0xf153('0x30'))[_0xf153('0x58')](_0xf153('0x59'))[_0xf153('0x5a')](_0xf153('0x5b'));var _0x18d0ce=squel[_0xf153('0x57')]()['field'](_0xf153('0x5c'))[_0xf153('0x58')](_0xf153('0x5d'))['field'](_0xf153('0x5e'))[_0xf153('0x5a')](_0xf153('0x5f'),'ui')[_0xf153('0x60')](_0xf153('0x61'),'u',_0xf153('0x62'));var _0x245124=squel[_0xf153('0x57')]()['from'](_0xf153('0x63'),'i')[_0xf153('0x60')]('cm_contacts','c',_0xf153('0x64'))[_0xf153('0x60')](_0xf153('0x61'),'o',_0xf153('0x65'))[_0xf153('0x60')](_0xf153('0x66'),'a',_0xf153('0x67'))[_0xf153('0x60')](_0xf153('0x68'),'me',_0xf153('0x69'))[_0xf153('0x60')]('chat_interaction_has_tags','it',_0xf153('0x6a'))[_0xf153('0x60')]('tools_tags','t',_0xf153('0x6b'));var _0x25e66e=squel[_0xf153('0x6c')]();var _0x147d3a=[];var _0x603892=squel[_0xf153('0x6c')]();var _0x2736e3;if(_0x17fb10['query'][_0xf153('0x6d')]){_0x2736e3=as[_0xf153('0x6e')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x6d')]);var _0x17f58d=_0x2736e3[_0xf153('0x6f')];for(var _0x19ec0b=0x0;_0x19ec0b<_0x2736e3[_0xf153('0x70')][_0xf153('0x71')];_0x19ec0b++){var _0x4c9157=_0x2736e3[_0xf153('0x70')][_0x19ec0b];var _0x433566='i';var _0x4afdc4=_[_0xf153('0x72')](_0x1bece2,['name',_0x4c9157[_0xf153('0x58')]]);if(!_0x4afdc4){switch(_0x4c9157[_0xf153('0x58')]){case'unreadMessages':if(_0x4c9157[_0xf153('0x73')]==0x1){_0x245124['having']('`'+_0x4c9157[_0xf153('0x58')]+_0xf153('0x74'));}else{_0x245124[_0xf153('0x75')]('`'+_0x4c9157[_0xf153('0x58')]+'`\x20>\x200');}break;case _0xf153('0x76'):if(_0x4c9157[_0xf153('0x77')]==='$substring'){if(_0x4c9157[_0xf153('0x73')][_0xf153('0x3b')]('\x20')[_0xf153('0x71')]>0x1){_0x25e66e[_0x17f58d](_0xf153('0x78'),qs[_0xf153('0x79')](_0x4c9157['value']),null);}else{var _0xf4a542='%'+_0x4c9157['value']+'%';_0x25e66e[_0x17f58d](_0xf153('0x7a'),_0xf4a542,_0xf4a542,_0xf4a542);}}else{_0x4afdc4=_[_0xf153('0x72')](_0x1bece2,['name','ContactId']);_0x4c9157[_0xf153('0x58')]=_0xf153('0x7b');_0x44da13=as['buildExpression'](_0x433566,_0x4afdc4[_0xf153('0x4a')],_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13[_0xf153('0x7c')],_0x44da13[_0xf153('0x73')]['start'],_0x44da13[_0xf153('0x73')][_0xf153('0x24')]);}break;case _0xf153('0x7d'):var _0x1e5e95=_0x4c9157[_0xf153('0x73')][_0xf153('0x3b')](',')[_0xf153('0x39')](function(_0x364957){return Number(_0x364957);});_0x1e5e95[_0xf153('0x7e')](function(_0x858289){_0x603892['or'](_0xf153('0x7f'),'%,'+_0x858289+',%');});_0x147d3a=_[_0xf153('0x80')](_0x147d3a,_0x1e5e95);break;case _0xf153('0x81'):if(_0x4c9157[_0xf153('0x77')]===_0xf153('0x82')){_0x25e66e[_0x17f58d](_0xf153('0x83'),'%'+_0x4c9157['value']+'%',null);}else{_0x4afdc4=_[_0xf153('0x72')](_0x1bece2,['name','UserId']);_0x4c9157[_0xf153('0x58')]='UserId';_0x44da13=as[_0xf153('0x84')](_0x433566,_0x4afdc4[_0xf153('0x4a')],_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13[_0xf153('0x7c')],_0x44da13[_0xf153('0x73')][_0xf153('0x85')],_0x44da13[_0xf153('0x73')]['end']);}break;case _0xf153('0x86'):_0x44da13=as[_0xf153('0x84')]('me',null,_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13[_0xf153('0x7c')],_0x44da13['value']['start'],_0x44da13[_0xf153('0x73')][_0xf153('0x24')]);break;}}else{var _0x44da13=as['buildExpression'](_0x433566,_0x4afdc4[_0xf153('0x4a')],_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13['text'],_0x44da13['value'][_0xf153('0x85')],_0x44da13[_0xf153('0x73')][_0xf153('0x24')]);}}}else{var _0x583dbf=_(_0x17fb10[_0xf153('0x4d')])[_0xf153('0x4e')]()['map'](function(_0x193c8c){return _[_0xf153('0x87')](_0x1bece2,[_0xf153('0x30'),_0x193c8c])?_0x193c8c:undefined;})[_0xf153('0x88')]()[_0xf153('0x73')]();if(!_['isEmpty'](_0x583dbf)){_0x583dbf[_0xf153('0x7e')](function(_0xf791a1){if(_0xf791a1===_0xf153('0x89')){_0x245124[_0xf153('0x55')](_0xf153('0x8a'),[][_0xf153('0x8b')](_0x17fb10[_0xf153('0x4d')][_0xf791a1]));}else if(_0xf791a1==='createdAt'){var _0x756f52=JSON[_0xf153('0x8c')](_0x17fb10[_0xf153('0x4d')][_0xf791a1])[_0xf153('0x8d')];var _0x269102=JSON[_0xf153('0x8c')](_0x17fb10['query'][_0xf791a1])[_0xf153('0x8e')];_0x245124[_0xf153('0x55')](_0xf153('0x8f'),_0x756f52,_0x269102);}else{if(_0x17fb10[_0xf153('0x4d')][_0xf791a1]===_0xf153('0x90')){_0x245124[_0xf153('0x55')]('i.'+_0xf791a1+_0xf153('0x91'));}else{_0x245124[_0xf153('0x55')]('i.'+_0xf791a1+_0xf153('0x92'),_0x17fb10[_0xf153('0x4d')][_0xf791a1]);}}});}if(_0x17fb10['query']['read']){if(_0x17fb10['query']['read']==0x1){_0x245124[_0xf153('0x75')](_0xf153('0x93'));}else{_0x245124[_0xf153('0x75')](_0xf153('0x94'));}}if(_0x17fb10[_0xf153('0x4d')]['tag']){_0x147d3a=_[_0xf153('0x95')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x96')])?_0x17fb10[_0xf153('0x4d')]['tag']:new Array(_0x17fb10[_0xf153('0x4d')][_0xf153('0x96')]);_0x147d3a[_0xf153('0x7e')](function(_0x4a5f54){_0x603892['or'](_0xf153('0x7f'),'%,'+_0x4a5f54+',%');});}if(_0x17fb10['query'][_0xf153('0x97')]){var _0x25ab76=_0x17fb10[_0xf153('0x4d')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf153('0x98')](_0x25ab76)){_0x25e66e['or'](_0xf153('0x99'),_0x25ab76+'%');}else{_0x25e66e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x25ab76))['or'](_0xf153('0x9a'),_0x25ab76+'%');}}}_0x245124['where'](_0x25e66e);_0x245124[_0xf153('0x9b')]('i.id');var _0xb3632c={'type':db[_0xf153('0x9c')][_0xf153('0x9d')][_0xf153('0x9e')],'raw':!![]};var _0x303dcf=_0x245124[_0xf153('0x9f')]();_0x303dcf['field'](_0xf153('0xa0'));_0x303dcf[_0xf153('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf153('0xa1'));if(_0x1f540b[_0xf153('0xa2')]){_0x1f540b[_0xf153('0xa2')][_0xf153('0x7e')](function(_0x5c6ac2){var _0x3e36fc=_0x5c6ac2[0x0]===_0xf153('0xa3')?_0x5c6ac2[0x0]:'i.'+_0x5c6ac2[0x0];_0x245124['order'](_0x3e36fc,_0x5c6ac2[0x1]===_0xf153('0xa4')?![]:!![]);});}if(!_[_0xf153('0xa5')](_0x147d3a)){_0x245124[_0xf153('0x75')](_0x603892);_0x303dcf[_0xf153('0x55')]('t.id\x20IN\x20?',_0x147d3a);}BPromise[_0xf153('0xa6')]()[_0xf153('0x2d')](function(){if(!_0x2736e3){if(_0x17fb10[_0xf153('0x4d')][_0xf153('0x89')])return;_0x303dcf[_0xf153('0x55')](_0xf153('0xa7'));_0x245124[_0xf153('0x55')](_0xf153('0xa7'));return;}if(_0x17fb10[_0xf153('0xa8')]['role']!==_0xf153('0x35'))return;return _0x17fb10[_0xf153('0xa8')][_0xf153('0xa9')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d24b5){if(_[_0xf153('0xa5')](_0x4d24b5)){_0x303dcf['where'](_0xf153('0xaa'));_0x245124[_0xf153('0x55')](_0xf153('0xaa'));}else{_0x303dcf['where']('i.ChatWebsiteId\x20IN\x20?',_[_0xf153('0x39')](_0x4d24b5,'id'));_0x245124[_0xf153('0x55')](_0xf153('0x8a'),_['map'](_0x4d24b5,'id'));}});})[_0xf153('0x2d')](function(){if(_0x17fb10[_0xf153('0xa8')][_0xf153('0xab')]===_0xf153('0x35')&&!_0x2736e3&&!_0x17fb10[_0xf153('0x4d')][_0xf153('0x89')])return[];return db[_0xf153('0xac')][_0xf153('0x4d')](_0x303dcf[_0xf153('0xad')](),_0xb3632c);})[_0xf153('0x2d')](function(_0x347859){_0x1426eb[_0xf153('0x28')]=_0x347859[_0xf153('0x71')];if(_0x1426eb['count']===0x0)return[];return db[_0xf153('0xac')][_0xf153('0x4d')](_0x340aba[_0xf153('0xad')](),_0xb3632c)['then'](function(_0x573032){_0x51d813=_[_0xf153('0xae')](_0x573032,'id');_0xb3632c=_['merge'](_0xb3632c,{'model':db[_0xf153('0xaf')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17fb10[_0xf153('0x4d')]['fields']){_0x1f540b[_0xf153('0x51')][_0xf153('0x7e')](function(_0x3b0b94){_0x245124[_0xf153('0x58')]('i.'+_0x3b0b94);});}else{_0x245124[_0xf153('0x58')](_0xf153('0xb0'),_0xf153('0xa1'));_0x245124[_0xf153('0x58')]('a.key',_0xf153('0xb1'));_0x245124[_0xf153('0x58')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x245124[_0xf153('0x58')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x245124[_0xf153('0x58')](_0xf153('0xb2'));_0x245124['field'](_0xf153('0xb3'),_0xf153('0xb4'));_0x245124[_0xf153('0x58')](_0xf153('0xb5'),_0xf153('0xb6'));_0x245124[_0xf153('0x58')](_0xf153('0xb7'),_0xf153('0xb8'));_0x245124[_0xf153('0x58')]('c.phone',_0xf153('0xb9'));_0x245124['field'](_0xf153('0xba'),'Contact.mobile');_0x245124[_0xf153('0x58')]('c.fax','Contact.fax');_0x245124[_0xf153('0x58')]('o.fullname',_0xf153('0xbb'));_0x245124[_0xf153('0x58')]('o.internal','Owner.internal');_0x245124[_0xf153('0x58')](_0xf153('0xbc'),_0xf153('0x3a'));}if(_0x1f540b['limit'])_0x245124[_0xf153('0x29')](_0x1f540b[_0xf153('0x29')]);if(_0x1f540b[_0xf153('0x26')])_0x245124[_0xf153('0x26')](_0x1f540b['offset']);return db[_0xf153('0xac')][_0xf153('0x4d')](_0x245124[_0xf153('0xad')](),_0xb3632c);})[_0xf153('0x2d')](function(_0x1022c5){if(_0x1022c5[_0xf153('0x71')]>0x0)_0x18d0ce[_0xf153('0x55')](_0xf153('0xbd'),_[_0xf153('0x39')](_0x1022c5,'id'));return db[_0xf153('0xac')][_0xf153('0x4d')](_0x18d0ce[_0xf153('0xad')](),_0xb3632c)['then'](function(_0x1aebab){var _0x192708=_['groupBy'](_0x1aebab,_0xf153('0xbe'));var _0x4525e1=[];_0x1022c5[_0xf153('0x7e')](function(_0x449f8d){_0x4525e1[_0xf153('0x3d')](updateChatInteraction(_0x449f8d,_0x51d813,_0x192708));});return BPromise['all'](_0x4525e1);});});})[_0xf153('0x2d')](function(_0xa13662){_0x1426eb[_0xf153('0xbf')]=_0xa13662;return _0x1426eb;})[_0xf153('0x2d')](respondWithFilteredResult(_0x550d45,_0x1f540b))[_0xf153('0x3e')](handleError(_0x550d45,null));};exports[_0xf153('0xc0')]=function(_0x2e55f4,_0x1098b7){var _0x29d492={'raw':![],'where':{'id':_0x2e55f4[_0xf153('0xc1')]['id']}},_0x3f7938={};_0x3f7938[_0xf153('0x4c')]=_[_0xf153('0x4e')](db[_0xf153('0xaf')][_0xf153('0x49')]);_0x3f7938['query']=_[_0xf153('0x4e')](_0x2e55f4[_0xf153('0x4d')]);_0x3f7938[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x3f7938[_0xf153('0x4c')],_0x3f7938[_0xf153('0x4d')]);_0x29d492[_0xf153('0x51')]=_[_0xf153('0x50')](_0x3f7938['model'],qs[_0xf153('0xc2')](_0x2e55f4[_0xf153('0x4d')][_0xf153('0xc2')]));_0x29d492[_0xf153('0x51')]=_0x29d492[_0xf153('0x51')]['length']?_0x29d492[_0xf153('0x51')]:_0x3f7938[_0xf153('0x4c')];if(_0x2e55f4[_0xf153('0x4d')][_0xf153('0xc3')]){_0x29d492['include']=[{'all':!![]}];}_0x29d492=_['merge']({},_0x29d492,_0x2e55f4[_0xf153('0xc4')]);return db[_0xf153('0xaf')]['find'](_0x29d492)['then'](handleEntityNotFound(_0x1098b7,null))[_0xf153('0x2d')](respondWithResult(_0x1098b7,null))[_0xf153('0x3e')](handleError(_0x1098b7,null));};exports[_0xf153('0xc5')]=function(_0x339e9e,_0x31a019){return db[_0xf153('0xaf')][_0xf153('0xc5')](_0x339e9e[_0xf153('0x86')],{})[_0xf153('0x2d')](respondWithResult(_0x31a019,0xc9))['catch'](handleError(_0x31a019,null));};exports[_0xf153('0x2c')]=function(_0x110f72,_0x527cce){if(_0x110f72[_0xf153('0x86')]['id']){delete _0x110f72[_0xf153('0x86')]['id'];}return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x110f72['params']['id']}})['then'](handleEntityNotFound(_0x527cce,null))[_0xf153('0x2d')](saveUpdates(_0x110f72[_0xf153('0x86')],null))[_0xf153('0x2d')](respondWithResult(_0x527cce,null))['catch'](handleError(_0x527cce,null));};exports[_0xf153('0x2e')]=function(_0x45c835,_0x3ca774){return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x45c835[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x3ca774,null))['then'](removeEntity(_0x3ca774,null))[_0xf153('0x3e')](handleError(_0x3ca774,null));};exports[_0xf153('0xc6')]=function(_0x3451e9,_0x3af786){return db[_0xf153('0xaf')][_0xf153('0xc6')]()[_0xf153('0x2d')](respondWithResult(_0x3af786,null))[_0xf153('0x3e')](handleError(_0x3af786,null));};exports[_0xf153('0xc7')]=function(_0x53eee4,_0x2dd1d8){var _0x2c3f76=_0x53eee4[_0xf153('0xc1')]['id'];var _0x374ba4;var _0x1b4f50;var _0x40c1d1;return db['ChatInteraction'][_0xf153('0xc8')]({'where':{'id':_0x2c3f76}})[_0xf153('0x2d')](function(_0x8711eb){_0x374ba4=_0x8711eb;return db[_0xf153('0xc9')]['findOne']({'where':{'id':_0x8711eb[_0xf153('0x89')]},'attributes':['id',_0xf153('0xca'),_0xf153('0xcb'),_0xf153('0xcc'),_0xf153('0xcd'),'vidaooMetadata'],'raw':!![]});})[_0xf153('0x2d')](function(_0x2e908a){if(_0x2e908a&&_0x2e908a['vidaooApiKey']&&_0x2e908a[_0xf153('0xcb')]){_0x1b4f50=_0x2e908a;var _0x57d320={'interaction':{'id':_0x2c3f76},'agent':{'id':_0x53eee4[_0xf153('0xa8')]['id'],'name':_0x53eee4[_0xf153('0xa8')][_0xf153('0x30')],'fullname':_0x53eee4[_0xf153('0xa8')]['fullname'],'email':_0x53eee4[_0xf153('0xa8')][_0xf153('0xce')]},'contact':_0x53eee4['body'][_0xf153('0x34')],'account':_0x53eee4['body'][_0xf153('0x37')]};var _0x30ae3c={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2e908a['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x53eee4[_0xf153('0xa8')][_0xf153('0xce')]],'buttons':null,'topic':_0x1b4f50['vidaooTopic'],'note':_[_0xf153('0xcf')](_0x1b4f50[_0xf153('0xcd')])?null:getMustacheRender(_0x1b4f50['vidaooNote'],_0x57d320),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xf153('0xcf')](_0x1b4f50[_0xf153('0xd0')])){var _0x32971d=getMustacheRender(_0x1b4f50[_0xf153('0xd0')],_0x57d320);var _0x1a4825=JSON[_0xf153('0x8c')](_0x32971d);_0x30ae3c[_0xf153('0x86')][_0xf153('0xd1')]=_0x1a4825;}}catch(_0xb03f70){throw new db[(_0xf153('0x9c'))]['ValidationError'](_0xf153('0xd2'));}return rp(_0x30ae3c);}else{throw new db['Sequelize']['ValidationError'](_0xf153('0xd3'));}})[_0xf153('0x2d')](function(_0x264968){_0x40c1d1=_0x264968;if(_0x40c1d1['id']){var _0xe61167={'body':_0x40c1d1['join_url'],'ChatWebsiteId':_0x1b4f50['id'],'ChatInteractionId':_0x374ba4['id'],'direction':_0xf153('0xd4'),'UserId':_0x53eee4['user']['id']};return db[_0xf153('0xd5')][_0xf153('0xc5')](_0xe61167,{});}else{throw new db[(_0xf153('0x9c'))]['ValidationError'](_0xf153('0xd6'));}})[_0xf153('0x2d')](function(){return _0x374ba4['updateAttributes']({'vidaooSessionId':_0x40c1d1['id']});})[_0xf153('0x2d')](respondWithResult(_0x2dd1d8,null))['catch'](handleError(_0x2dd1d8,null));};exports[_0xf153('0xd7')]=function(_0x1ba174,_0xab67b7){if(_0x1ba174['body']['id']){delete _0x1ba174['body']['id'];}return db[_0xf153('0xaf')]['find']({'where':{'id':_0x1ba174[_0xf153('0xc1')]['id']},'include':[{'model':db[_0xf153('0xd8')],'as':_0xf153('0x76')}]})[_0xf153('0x2d')](handleEntityNotFound(_0xab67b7,null))[_0xf153('0x2d')](saveUpdates(_0x1ba174[_0xf153('0x86')],null))[_0xf153('0x2d')](respondWithResult(_0xab67b7,null))[_0xf153('0x3e')](handleError(_0xab67b7,null));};exports[_0xf153('0xd9')]=function(_0x40ade6,_0x1a9bfb){if(_0x40ade6[_0xf153('0x86')]['id']){delete _0x40ade6[_0xf153('0x86')]['id'];}return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x40ade6[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](function(_0x50dd96){if(!_0x50dd96){logger[_0xf153('0x1f')](_0xf153('0xda'),_0xf153('0xd9'),0x194,'entity\x20not\x20found');_0x1a9bfb[_0xf153('0x22')](0x194);}else{if(_0x50dd96[_0xf153('0x44')]){throw new db[(_0xf153('0x9c'))]['ValidationError'](_0xf153('0xdb'));}}return _0x50dd96;})[_0xf153('0x2d')](function(_0xeebd4f){if(_0xeebd4f){return _0xeebd4f[_0xf153('0x2c')]({'closed':_0x40ade6[_0xf153('0x86')]['closed'],'disposition':_0x40ade6[_0xf153('0x86')]['disposition']})[_0xf153('0x2d')](function(_0x4fe273){return _0x4fe273;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0xf153('0xd9'),_0x40ade6['body'],client9004);})[_0xf153('0x2d')](respondWithResult(_0x1a9bfb,null))['catch'](handleError(_0x1a9bfb,null));};exports[_0xf153('0xdc')]=function(_0x25543b,_0x3c1ae6){_0x25543b[_0xf153('0x86')]['name']=_0x25543b[_0xf153('0xdd')][_0xf153('0xde')];_0x25543b['body'][_0xf153('0xdf')]=_0x25543b[_0xf153('0xdd')][_0xf153('0xe0')];_0x25543b[_0xf153('0x86')][_0xf153('0x4a')]=_0x25543b[_0xf153('0xdd')][_0xf153('0xe1')];return db['Attachment'][_0xf153('0xc5')](_0x25543b[_0xf153('0x86')])[_0xf153('0x2d')](respondWithResult(_0x3c1ae6,0xc9))[_0xf153('0x3e')](handleError(_0x3c1ae6,null));};exports[_0xf153('0xe2')]=function(_0x2c8401,_0x41ef70){return db['ChatInteraction'][_0xf153('0xc8')]({'where':{'id':_0x2c8401[_0xf153('0xc1')]['id']},'raw':!![]})[_0xf153('0x2d')](handleEntityNotFound(_0x41ef70,null))[_0xf153('0x2d')](function(_0x283f9e){if(_0x283f9e){if(_0x283f9e['closed']){return _0x41ef70['status'](0x193)[_0xf153('0x25')]({'status':0x193,'message':_0xf153('0xe3')});}return db['Attachment'][_0xf153('0xc8')]({'where':{'id':_0x2c8401[_0xf153('0x4d')][_0xf153('0xe4')]},'raw':!![]})['then'](handleEntityNotFound(_0x41ef70,null));}})['then'](function(_0x13b7e2){if(_0x13b7e2){var _0x25222f=_0x13b7e2[_0xf153('0xe5')]!==null;var _0x4b2cdd=path[_0xf153('0xe6')](config[_0xf153('0xe7')],_0xf153('0xe8'));if(_0x25222f){_0x4b2cdd=path[_0xf153('0xe6')](_0x4b2cdd,_0xf153('0xe9'));}var _0x1ac5ff=path[_0xf153('0xe6')](_0x4b2cdd,_0x13b7e2[_0xf153('0xdf')]);return _0x41ef70[_0xf153('0xea')](_0x1ac5ff);}})[_0xf153('0x3e')](handleError(_0x41ef70,null));};exports[_0xf153('0xeb')]=function(_0x126535,_0x392c8e){var _0x203143=null;var _0x173f12=null;var _0x1f8794=null;if(_0x126535[_0xf153('0x86')]['id']){delete _0x126535[_0xf153('0x86')]['id'];}if(_0x126535['body'][_0xf153('0xec')]){_0x1f8794=path['join'](config[_0xf153('0xe7')],_0xf153('0xed'),util['format']('transcript-%s.txt',Date['now']()));_0x126535[_0xf153('0x86')][_0xf153('0xee')]=_0x1f8794;}return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x126535['params']['id']},'include':[{'model':db[_0xf153('0xd5')],'as':_0xf153('0xef'),'include':[{'model':db[_0xf153('0x81')],'as':_0xf153('0x81')}]}]})[_0xf153('0x2d')](handleEntityNotFound(_0x392c8e,null))[_0xf153('0x2d')](saveUpdates(_0x126535[_0xf153('0x86')],null))[_0xf153('0x2d')](function(_0x4c2b50){if(_0x4c2b50){_0x203143=_0x4c2b50;return db[_0xf153('0xc9')][_0xf153('0x72')]({'where':{'id':_0x203143['ChatWebsiteId']}});}})['then'](function(_0x3021e6){if(_0x3021e6){_0x173f12=_0x3021e6;return db[_0xf153('0xd8')]['find']({'where':{'id':_0x203143[_0xf153('0x7b')]}});}})['then'](function(_0x3057f1){if(_0x3057f1){if(_0x1f8794){var _0x207255=null;for(var _0xd8cd84=0x1;_0xd8cd84<_0x203143[_0xf153('0xef')][_0xf153('0x71')];++_0xd8cd84){_0x207255=_0x203143['Messages'][_0xd8cd84];var _0xb4dbdd=_0x207255['UserId']?util['format'](_0xf153('0xf0'),_0x173f12[_0xf153('0xf1')],_0x207255[_0xf153('0x44')]):_0xf153('0xf2');var _0x5b1a91=_0x126535[_0xf153('0x86')][_0xf153('0xf3')]||util[_0xf153('0xf4')](_0xf153('0xf0'),_0xf153('0xf5'),_0x207255[_0xf153('0x7b')]);switch(_0x173f12[_0xf153('0xf6')]){case _0xf153('0xf7'):_0xb4dbdd=_0x207255['UserId']?util[_0xf153('0xf4')](_0xf153('0xf0'),_0x173f12[_0xf153('0xf1')],_0x207255[_0xf153('0x44')]):_0xf153('0xf2');break;case _0xf153('0xf8'):_0xb4dbdd=_0x207255[_0xf153('0x44')]?_0x207255[_0xf153('0x81')][_0xf153('0xf9')]||_0x207255[_0xf153('0x81')][_0xf153('0xfa')]:_0xf153('0xf2');break;case'agent_fullname':_0xb4dbdd=_0x207255[_0xf153('0x44')]?_0x207255[_0xf153('0x81')]['fullname']:_0xf153('0xf2');break;default:_0xb4dbdd=_0x207255[_0xf153('0x44')]?util[_0xf153('0xf4')](_0xf153('0xf0'),_0x173f12[_0xf153('0xf1')],_0x207255[_0xf153('0x44')]):_0xf153('0xf2');}var _0x4b8d5c=util[_0xf153('0xf4')](_0xf153('0xfb'),moment(_0x207255[_0xf153('0xfc')])[_0xf153('0xf4')]('MM/DD/YYYY\x20HH:mm:ss'),_0x207255[_0xf153('0xfd')]==='in'?_0x5b1a91:_0xb4dbdd,_0x207255[_0xf153('0x86')]);if(!_0x207255['secret']){fs[_0xf153('0xfe')](_0x1f8794,_0x4b8d5c);}}return db['MailAccount'][_0xf153('0xc8')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf153('0xff'),'raw':!![],'include':[{'model':db[_0xf153('0x100')],'as':_0xf153('0x100'),'raw':!![]}]}]});}}})[_0xf153('0x2d')](function(_0x5a8d13){if(!_0x5a8d13||!_0x5a8d13[_0xf153('0xff')]||!_0x126535['body'])return _0x203143;var _0x21285e=_0x5a8d13[_0xf153('0x101')]();return respondWithRpcPromise(_0xf153('0x102'),_0xf153('0x103'),{'account':_0x21285e,'message':{'from':util[_0xf153('0xf4')](_0xf153('0x104'),_0x5a8d13['name'],_0x5a8d13[_0xf153('0xce')]||_0x5a8d13['Smtp'][_0xf153('0xa8')]),'to':_0x126535['body'][_0xf153('0xec')],'subject':_0xf153('0x105'),'text':util[_0xf153('0xf4')](_0xf153('0x106'),_0x126535['body'][_0xf153('0xec')]),'attachments':[{'path':_0x1f8794}]}})['then'](function(){return _0x203143;})[_0xf153('0x3e')](function(_0x5c32d1){logger[_0xf153('0x1f')](_0x5c32d1);});})[_0xf153('0x2d')](respondWithStatusCode(_0x392c8e,0xc8))[_0xf153('0x3e')](handleError(_0x392c8e,null));};exports[_0xf153('0x107')]=function(_0x273b03,_0x3165e5){return db[_0xf153('0xd5')][_0xf153('0x72')]({'where':{'id':_0x273b03['params']['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x3165e5,null))[_0xf153('0x2d')](function(_0x48c9e4){if(_0x48c9e4){return _0x48c9e4[_0xf153('0x107')](_0x273b03[_0xf153('0x86')][_0xf153('0x108')],_[_0xf153('0x109')](_0x273b03[_0xf153('0x86')],[_0xf153('0x108'),'id'])||{});}})[_0xf153('0x2d')](respondWithResult(_0x3165e5,null))['catch'](handleError(_0x3165e5,null));};exports['getMessages']=function(_0x550c10,_0x3e8153){var _0x1fb83a={'raw':![],'where':{}};var _0x10f948={};var _0x5cc922={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf153('0xc8')]({'where':{'id':_0x550c10['params']['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x3e8153,null))[_0xf153('0x2d')](function(_0x21a1c9){if(_0x21a1c9){_0x10f948[_0xf153('0x4c')]=_[_0xf153('0x4e')](db['ChatMessage'][_0xf153('0x49')]);_0x10f948[_0xf153('0x4d')]=_[_0xf153('0x4e')](_0x550c10['query']);_0x10f948[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x10f948[_0xf153('0x4c')],_0x10f948[_0xf153('0x4d')]);_0x1fb83a[_0xf153('0x51')]=_[_0xf153('0x50')](_0x10f948[_0xf153('0x4c')],qs[_0xf153('0xc2')](_0x550c10[_0xf153('0x4d')][_0xf153('0xc2')]));_0x1fb83a[_0xf153('0x51')]=_0x1fb83a[_0xf153('0x51')][_0xf153('0x71')]?_0x1fb83a[_0xf153('0x51')]:_0x10f948[_0xf153('0x4c')];if(!_0x550c10[_0xf153('0x4d')][_0xf153('0x52')]('nolimit')){_0x1fb83a[_0xf153('0x29')]=qs[_0xf153('0x29')](_0x550c10[_0xf153('0x4d')][_0xf153('0x29')]);_0x1fb83a['offset']=qs[_0xf153('0x26')](_0x550c10[_0xf153('0x4d')][_0xf153('0x26')]);}_0x1fb83a[_0xf153('0xa2')]=qs[_0xf153('0x54')](_0x550c10[_0xf153('0x4d')]['sort']);_0x1fb83a[_0xf153('0x55')]=qs[_0xf153('0x4f')](_['pick'](_0x550c10[_0xf153('0x4d')],_0x10f948[_0xf153('0x4f')]));_0x1fb83a[_0xf153('0x55')][_0xf153('0xbe')]=_0x21a1c9['id'];if(_0x550c10[_0xf153('0x4d')][_0xf153('0x97')]){_0x1fb83a[_0xf153('0x55')]=_[_0xf153('0x33')](_0x1fb83a[_0xf153('0x55')],{'$or':_[_0xf153('0x39')](_0x1fb83a[_0xf153('0x51')],function(_0x4538be){var _0x63ad32={};_0x63ad32[_0x4538be]={'$like':'%'+_0x550c10['query'][_0xf153('0x97')]+'%'};return _0x63ad32;})});}if(_0x550c10[_0xf153('0x4d')][_0xf153('0x8d')]){var _0x9503e=_0x550c10[_0xf153('0x4d')][_0xf153('0x8d')]['split'](',');var _0x49ea9a={};_0x49ea9a[_0x9503e[0x0]]={'$gte':moment(_0x9503e[0x1])[_0xf153('0xf4')](_0xf153('0x10a'))};_0x1fb83a[_0xf153('0x55')]=_['merge'](_0x1fb83a[_0xf153('0x55')],_0x49ea9a);}_0x1fb83a=_[_0xf153('0x33')]({},_0x1fb83a,_0x550c10[_0xf153('0xc4')]);return db[_0xf153('0xd5')][_0xf153('0x28')]({'where':_0x1fb83a[_0xf153('0x55')]})[_0xf153('0x2d')](function(_0x921b52){_0x5cc922['count']=_0x921b52;if(_0x550c10['query'][_0xf153('0xc3')]){_0x1fb83a[_0xf153('0x10b')]=[{'all':!![]}];}return db[_0xf153('0xd5')][_0xf153('0x10c')](_0x1fb83a);})[_0xf153('0x2d')](function(_0x577fc7){_0x5cc922[_0xf153('0xbf')]=_0x577fc7;return _0x5cc922;});}})[_0xf153('0x2d')](respondWithFilteredResult(_0x3e8153,_0x1fb83a))[_0xf153('0x3e')](handleError(_0x3e8153,null));};exports[_0xf153('0x10d')]=function(_0x283af8,_0x58be79){var _0x1d0d1a={'where':{}},_0x5397a8={},_0x466386={'count':0x0,'rows':[]};return db[_0xf153('0xaf')][_0xf153('0xc8')]({'where':{'id':_0x283af8[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x58be79,null))['then'](function(_0x5efd23){if(_0x5efd23){_0x5397a8[_0xf153('0x4c')]=_[_0xf153('0x4e')](db[_0xf153('0xd5')][_0xf153('0x49')]);_0x5397a8[_0xf153('0x4d')]=_[_0xf153('0x4e')](_0x283af8[_0xf153('0x4d')]);_0x5397a8[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x5397a8[_0xf153('0x4c')],_0x5397a8[_0xf153('0x4d')]);_0x1d0d1a[_0xf153('0x51')]=_[_0xf153('0x50')](_0x5397a8[_0xf153('0x4c')],qs[_0xf153('0xc2')](_0x283af8[_0xf153('0x4d')][_0xf153('0xc2')]));_0x1d0d1a[_0xf153('0x51')]=_0x1d0d1a[_0xf153('0x51')][_0xf153('0x71')]?_0x1d0d1a[_0xf153('0x51')]:_0x5397a8[_0xf153('0x4c')];if(!_0x283af8['query']['hasOwnProperty'](_0xf153('0x53'))){_0x1d0d1a[_0xf153('0x29')]=qs[_0xf153('0x29')](_0x283af8['query'][_0xf153('0x29')]);_0x1d0d1a[_0xf153('0x26')]=qs[_0xf153('0x26')](_0x283af8['query'][_0xf153('0x26')]);}_0x1d0d1a[_0xf153('0xa2')]=qs[_0xf153('0x54')](_0x283af8[_0xf153('0x4d')]['sort']);_0x1d0d1a[_0xf153('0x55')]=qs['filters'](_[_0xf153('0x56')](_0x283af8[_0xf153('0x4d')],_0x5397a8[_0xf153('0x4f')]));_0x1d0d1a[_0xf153('0x55')]['ChatInteractionId']=_0x5efd23['id'];if(_0x283af8[_0xf153('0x4d')]['filter']){_0x1d0d1a[_0xf153('0x55')]=_[_0xf153('0x33')](_0x1d0d1a[_0xf153('0x55')],{'$or':_[_0xf153('0x39')](_0x1d0d1a[_0xf153('0x51')],function(_0x397ee2){var _0x17e62e={};_0x17e62e[_0x397ee2]={'$like':'%'+_0x283af8[_0xf153('0x4d')][_0xf153('0x97')]+'%'};return _0x17e62e;})});}_0x1d0d1a['where']['secret']=![];if(_0x283af8[_0xf153('0x4d')]['id']){_0x1d0d1a[_0xf153('0x55')]['id']={'$gt':_0x283af8[_0xf153('0x4d')]['id']};}_0x1d0d1a=_['merge']({},_0x1d0d1a,_0x283af8[_0xf153('0xc4')]);return db[_0xf153('0xd5')][_0xf153('0x28')]({'where':_0x1d0d1a['where']})[_0xf153('0x2d')](function(_0x100f48){_0x466386[_0xf153('0x28')]=_0x100f48;_0x1d0d1a[_0xf153('0x10b')]=[];if(_0x283af8['query']['includeAgent']){_0x1d0d1a[_0xf153('0x10b')][_0xf153('0x3d')]({'model':db[_0xf153('0x81')],'as':_0xf153('0x81'),'attributes':['id','fullname',_0xf153('0xf9')]});}if(_0x283af8[_0xf153('0x4d')][_0xf153('0xc3')]){_0x1d0d1a[_0xf153('0x10b')]=[{'all':!![]}];}return db[_0xf153('0xd5')][_0xf153('0x10c')](_0x1d0d1a);})[_0xf153('0x2d')](function(_0x3a94c5){_0x466386[_0xf153('0xbf')]=_0x3a94c5;return _0x466386;});}})[_0xf153('0x2d')](respondWithFilteredResult(_0x58be79,_0x1d0d1a))['catch'](handleError(_0x58be79,null));};exports['addTags']=function(_0x11997d,_0x74943){return db[_0xf153('0xaf')]['find']({'where':{'id':_0x11997d[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x74943,null))['then'](function(_0x3f7eb6){if(_0x3f7eb6){return _0x3f7eb6[_0xf153('0x10e')](_0x11997d['body']['ids'],_[_0xf153('0x109')](_0x11997d['body'],[_0xf153('0x108'),'id'])||{})[_0xf153('0x10f')](function(){return db[_0xf153('0x7d')]['findAll']({'attributes':['id',_0xf153('0x30'),_0xf153('0x59')],'where':{'id':_0x11997d['body'][_0xf153('0x108')]}});})['then'](function(_0x5742a6){socket[_0xf153('0x110')](_0xf153('0x111'),{'id':Number(_0x11997d[_0xf153('0xc1')]['id']),'tags':_0x5742a6||[]});return{'id':Number(_0x11997d[_0xf153('0xc1')]['id']),'tags':_0x5742a6||[]};});}})[_0xf153('0x2d')](respondWithResult(_0x74943,null))[_0xf153('0x3e')](handleError(_0x74943,null));};exports['removeTags']=function(_0x9d9d65,_0x301675){return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x9d9d65[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x301675,null))[_0xf153('0x2d')](function(_0x4a5c86){if(_0x4a5c86){return _0x4a5c86['removeTags'](_0x9d9d65[_0xf153('0x4d')][_0xf153('0x108')]);}})['then'](respondWithStatusCode(_0x301675,null))[_0xf153('0x3e')](handleError(_0x301675,null));};exports[_0xf153('0xea')]=function(_0x252e74,_0x48f9ff){var _0x2180ec=moment()[_0xf153('0x112')]()[_0xf153('0xad')]();var _0x265407=path[_0xf153('0xe6')](config[_0xf153('0xe7')],_0xf153('0x113'),_0xf153('0x114'),_0xf153('0x115'));var _0x2a39ae=path[_0xf153('0xe6')](config['root'],_0xf153('0x113'),_0xf153('0x114'),_0xf153('0x116'));var _0x154c3c=path[_0xf153('0xe6')](_0x265407,_0x2180ec);var _0x5b9c=util[_0xf153('0xf4')](_0xf153('0x117'),_0x252e74[_0xf153('0xc1')]['id'],_0x2180ec);var _0x304d66=path['join'](_0x265407,_0x5b9c);var _0x444f68=[];_0x444f68[_0xf153('0x3d')]({'model':db[_0xf153('0x81')],'as':_0xf153('0x81'),'attributes':['id',_0xf153('0xfa')],'raw':!![]});_0x444f68[_0xf153('0x3d')]({'model':db[_0xf153('0xd8')],'as':_0xf153('0x76'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x252e74[_0xf153('0x4d')]['attachments']){_0x444f68[_0xf153('0x3d')]({'model':db[_0xf153('0x118')],'as':_0xf153('0x118'),'raw':!![]});}var _0x3d553d=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xf153('0x86'),_0xf153('0xfc'),_0xf153('0xfd'),_0xf153('0x119'),_0xf153('0x11a')],'include':_0x444f68}];_0x3d553d[_0xf153('0x3d')]({'model':db[_0xf153('0xc9')],'as':_0xf153('0x11b'),'attributes':['id',_0xf153('0x30')]});_0x3d553d[_0xf153('0x3d')]({'model':db[_0xf153('0x81')],'as':_0xf153('0x11c'),'attributes':['id',_0xf153('0xfa')]});return db[_0xf153('0xaf')]['find']({'where':{'id':_0x252e74[_0xf153('0xc1')]['id']},'include':_0x3d553d})[_0xf153('0x2d')](handleEntityNotFound(_0x48f9ff,null))[_0xf153('0x2d')](function(_0xf53fc6){if(_0xf53fc6){var _0x45112b=_0xf53fc6[_0xf153('0x11d')]({'plain':!![]});fs[_0xf153('0x11e')](_0x154c3c);var _0x1435bd={'channel':_0xf153('0x11f'),'account':_0x45112b[_0xf153('0x11b')]['name'],'agent':_0x45112b[_0xf153('0x11c')]?_0x45112b[_0xf153('0x11c')][_0xf153('0xfa')]:_0xf153('0x120'),'createdAt':moment(_0x45112b['createdAt'])[_0xf153('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x45112b['closed']?moment(_0x45112b['closedAt'])[_0xf153('0xf4')](_0xf153('0x10a'))[_0xf153('0xad')]():'','disposition':_0x45112b[_0xf153('0x45')],'chatInfo':{'browser':_0x45112b[_0xf153('0x121')],'os':_0x45112b['osName'],'referer':_0x45112b[_0xf153('0x122')],'customerIp':_0x45112b[_0xf153('0x123')],'customerPort':_0x45112b['customerPort']?_0x45112b[_0xf153('0x124')]:_0xf153('0x120')},'messages':_(_0x45112b['Messages'])[_0xf153('0x125')]()['filter']({'secret':![]})[_0xf153('0x39')](function(_0x5aa0bf){if(_0x5aa0bf[_0xf153('0x118')]){var _0x5ec77c=path[_0xf153('0xe6')](_0x2a39ae,_0x5aa0bf[_0xf153('0x118')][_0xf153('0xdf')]);if(fs[_0xf153('0x126')](_0x5ec77c)){fs[_0xf153('0x127')](_0x5ec77c)['pipe'](fs[_0xf153('0x128')](path[_0xf153('0xe6')](_0x154c3c,_0x5aa0bf[_0xf153('0x118')][_0xf153('0xdf')])));}}return{'date':moment(_0x5aa0bf['createdAt'])[_0xf153('0xf4')](_0xf153('0x10a'))[_0xf153('0xad')](),'sender':_0x5aa0bf[_0xf153('0xfd')]===_0xf153('0xd4')?_0x5aa0bf['User']?_0x5aa0bf[_0xf153('0x81')][_0xf153('0xfa')]:_0xf153('0xf2'):_0x5aa0bf[_0xf153('0x76')]['firstName']+(_0x5aa0bf[_0xf153('0x76')][_0xf153('0x129')]?'\x20'+_0x5aa0bf[_0xf153('0x76')][_0xf153('0x129')]:''),'body':_0x5aa0bf[_0xf153('0x118')]?_0x5aa0bf['Attachment'][_0xf153('0xdf')]:_0x5aa0bf[_0xf153('0x86')],'direction':_0x5aa0bf[_0xf153('0xfd')]===_0xf153('0xd4')?'A':'C','secret':_0x5aa0bf[_0xf153('0x119')],'read':_0x5aa0bf[_0xf153('0x11a')],'attachment':_0x5aa0bf['Attachment']};})['value']()};return ejs[_0xf153('0x12a')](path[_0xf153('0xe6')](config[_0xf153('0xe7')],_0xf153('0x113'),_0xf153('0x12b'),'downloadInteraction.ejs'),{'interaction':_0x1435bd})[_0xf153('0x2d')](function(_0x415d13){var _0xb2f8e0=path[_0xf153('0xe6')](_0x154c3c,_0xf153('0x12c')+_0x45112b['id']+'-'+_0x2180ec+'.pdf');var _0x3b6a0e={'path':_0xb2f8e0,'channel':_0xf153('0x11f'),'interactionId':_0x45112b['id']};return pdf['createPdfFromHTML'](_0x415d13,_0x3b6a0e);})[_0xf153('0x2d')](function(){return new Promise(function(_0x19de76,_0x5912d8){zipdir(_0x154c3c,{'saveTo':_0x304d66},function(_0x426db4,_0x52677c){if(_0x426db4)return _0x5912d8(_0x426db4);return _0x19de76(_0x52677c);});})[_0xf153('0x2d')](function(){return new BPromise(function(_0x200d37,_0x393d95){rimraf(_0x154c3c,function(_0x30a638){if(_0x30a638)_0x393d95(_0x30a638);return _0x200d37();});});})[_0xf153('0x2d')](function(){return _0x48f9ff['download'](_0x304d66,_0x5b9c,function(_0x416a91){if(_0x416a91){logger['error'](_0xf153('0x12d'),_0x416a91);}else{fs[_0xf153('0x12e')](_0x304d66);}});});});}else{return _0x48f9ff[_0xf153('0x22')](0xc8);}})[_0xf153('0x3e')](handleError(_0x48f9ff,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 865aaf8..bbe9164 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 _0x69a7=['setDataValue','Users','findAll','length','emit','catch','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','then'];(function(_0x11278a,_0x97706c){var _0x11d9af=function(_0x16c7d1){while(--_0x16c7d1){_0x11278a['push'](_0x11278a['shift']());}};_0x11d9af(++_0x97706c);}(_0x69a7,0x9d));var _0x769a=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0x69a7[_0x4164f2];return _0x2575c7;};'use strict';var EventEmitter=require(_0x769a('0x0'));var ChatInteraction=require(_0x769a('0x1'))['db'][_0x769a('0x2')];var ChatMessage=require(_0x769a('0x1'))['db'][_0x769a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x769a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x769a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3e9192){return function(_0x1ec084,_0x398d61,_0x3d8878){_0x1ec084[_0x769a('0x6')]({'attributes':['id'],'raw':!![]})[_0x769a('0x7')](function(_0x46424f){_0x1ec084[_0x769a('0x8')](_0x769a('0x9'),_0x46424f['map'](function(_0x12f472){return{'id':_0x12f472['id']};}));return ChatMessage[_0x769a('0xa')]({'where':{'ChatInteractionId':_0x1ec084['id'],'direction':'in','read':![]},'raw':!![]});})[_0x769a('0x7')](function(_0xb70fc8){_0x1ec084['setDataValue']('unreadMessages',_0xb70fc8[_0x769a('0xb')]);ChatInteractionEvents[_0x769a('0xc')](_0x3e9192+':'+_0x1ec084['id'],_0x1ec084);ChatInteractionEvents[_0x769a('0xc')](_0x3e9192,_0x1ec084);_0x3d8878(null);})[_0x769a('0xd')](_0x3d8878(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x769a('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x11bb=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','update','remove','then','Users','map','unreadMessages','length','emit','catch'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x11bb,0x1f3));var _0xb11b=function(_0x5592ac,_0x53136c){_0x5592ac=_0x5592ac-0x0;var _0x456dd2=_0x11bb[_0x5592ac];return _0x456dd2;};'use strict';var EventEmitter=require(_0xb11b('0x0'));var ChatInteraction=require(_0xb11b('0x1'))['db'][_0xb11b('0x2')];var ChatMessage=require(_0xb11b('0x1'))['db'][_0xb11b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb11b('0x4'),'afterDestroy':_0xb11b('0x5')};function emitEvent(_0x403dc0){return function(_0x2183e2,_0x6ebb10,_0xbc3bf2){_0x2183e2['getUsers']({'attributes':['id'],'raw':!![]})[_0xb11b('0x6')](function(_0x52e884){_0x2183e2['setDataValue'](_0xb11b('0x7'),_0x52e884[_0xb11b('0x8')](function(_0x593c90){return{'id':_0x593c90['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2183e2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4637dd){_0x2183e2['setDataValue'](_0xb11b('0x9'),_0x4637dd[_0xb11b('0xa')]);ChatInteractionEvents[_0xb11b('0xb')](_0x403dc0+':'+_0x2183e2['id'],_0x2183e2);ChatInteractionEvents[_0xb11b('0xb')](_0x403dc0,_0x2183e2);_0xbc3bf2(null);})[_0xb11b('0xc')](_0xbc3bf2(null));};}for(var e in events){if(events[_0xb11b('0xd')](e)){var event=events[e];ChatInteraction[_0xb11b('0xe')](e,emitEvent(event));}}module[_0xb11b('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 3e6b7bb..e321d40 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 _0x8b09=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatInteraction','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0x8b09,0x130));var _0x98b0=function(_0x177420,_0x18c369){_0x177420=_0x177420-0x0;var _0x437a50=_0x8b09[_0x177420];return _0x437a50;};'use strict';var _=require(_0x98b0('0x0'));var util=require(_0x98b0('0x1'));var logger=require(_0x98b0('0x2'))('api');var moment=require(_0x98b0('0x3'));var BPromise=require(_0x98b0('0x4'));var rp=require(_0x98b0('0x5'));var fs=require('fs');var path=require(_0x98b0('0x6'));var rimraf=require('rimraf');var config=require(_0x98b0('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x98b0('0x8')]=function(_0x3bc053,_0x10f2c6){return _0x3bc053[_0x98b0('0x9')](_0x98b0('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b8e9b,_0x3c1c03,_0x397773){if(_0x2b8e9b['changed'](_0x98b0('0xb'))){_0x2b8e9b[_0x98b0('0xc')]=moment()[_0x98b0('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x397773(null,_0x2b8e9b);}},'charset':_0x98b0('0xe'),'collate':_0x98b0('0xf')});};
\ No newline at end of file
+var _0x8a11=['request-promise','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0xdb320,_0x116a79){var _0x1a552d=function(_0x3b41b2){while(--_0x3b41b2){_0xdb320['push'](_0xdb320['shift']());}};_0x1a552d(++_0x116a79);}(_0x8a11,0xcc));var _0x18a1=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x8a11[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x18a1('0x0'));var util=require(_0x18a1('0x1'));var logger=require(_0x18a1('0x2'))('api');var moment=require(_0x18a1('0x3'));var BPromise=require(_0x18a1('0x4'));var rp=require(_0x18a1('0x5'));var fs=require('fs');var path=require(_0x18a1('0x6'));var rimraf=require(_0x18a1('0x7'));var config=require(_0x18a1('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x18a1('0x9')]=function(_0x2875ba,_0x3d09a3){return _0x2875ba[_0x18a1('0xa')](_0x18a1('0xb'),attributes,{'tableName':_0x18a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15daf2,_0x14d16c,_0x45f55){if(_0x15daf2[_0x18a1('0xd')](_0x18a1('0xe'))){_0x15daf2[_0x18a1('0xf')]=moment()[_0x18a1('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x45f55(null,_0x15daf2);}},'charset':_0x18a1('0x11'),'collate':_0x18a1('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 3fa12ff..0541651 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 _0x4f5a=['redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','body','options','raw','attributes','limit','catch','AddTagsToChatInteraction','find','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x530db1,_0x2b9531){var _0x31c1f2=function(_0x1c77b3){while(--_0x1c77b3){_0x530db1['push'](_0x530db1['shift']());}};_0x31c1f2(++_0x2b9531);}(_0x4f5a,0xeb));var _0xa4f5=function(_0x37dee8,_0x3faaaf){_0x37dee8=_0x37dee8-0x0;var _0x18ae38=_0x4f5a[_0x37dee8];return _0x18ae38;};'use strict';var _=require('lodash');var util=require(_0xa4f5('0x0'));var moment=require(_0xa4f5('0x1'));var BPromise=require(_0xa4f5('0x2'));var rs=require(_0xa4f5('0x3'));var fs=require('fs');var Redis=require(_0xa4f5('0x4'));var db=require(_0xa4f5('0x5'))['db'];var utils=require(_0xa4f5('0x6'));var logger=require(_0xa4f5('0x7'))('rpc');var config=require(_0xa4f5('0x8'));var jayson=require(_0xa4f5('0x9'));var client=jayson['client'][_0xa4f5('0xa')]({'port':0x232a});config[_0xa4f5('0xb')]=_[_0xa4f5('0xc')](config[_0xa4f5('0xb')],{'host':_0xa4f5('0xd'),'port':0x18eb});var socket=require(_0xa4f5('0xe'))(new Redis(config[_0xa4f5('0xb')]));require(_0xa4f5('0xf'))[_0xa4f5('0x10')](socket);function respondWithRpcPromise(_0x40a291,_0x2a3d14,_0x58422a){return new BPromise(function(_0x32363e,_0x11bf80){return client['request'](_0x40a291,_0x58422a)[_0xa4f5('0x11')](function(_0x1fa31e){logger[_0xa4f5('0x12')](_0xa4f5('0x13'),_0x2a3d14,_0xa4f5('0x14'));logger[_0xa4f5('0x15')](_0xa4f5('0x16'),_0x2a3d14,'request\x20sent',JSON[_0xa4f5('0x17')](_0x1fa31e));if(_0x1fa31e[_0xa4f5('0x18')]){if(_0x1fa31e[_0xa4f5('0x18')][_0xa4f5('0x19')]===0x1f4){logger[_0xa4f5('0x18')](_0xa4f5('0x13'),_0x2a3d14,_0x1fa31e[_0xa4f5('0x18')][_0xa4f5('0x1a')]);return _0x11bf80(_0x1fa31e['error'][_0xa4f5('0x1a')]);}logger['error'](_0xa4f5('0x13'),_0x2a3d14,_0x1fa31e[_0xa4f5('0x18')][_0xa4f5('0x1a')]);return _0x32363e(_0x1fa31e[_0xa4f5('0x18')]['message']);}else{logger[_0xa4f5('0x12')](_0xa4f5('0x13'),_0x2a3d14,_0xa4f5('0x14'));_0x32363e(_0x1fa31e[_0xa4f5('0x1b')]['message']);}})['catch'](function(_0x59e8f5){logger[_0xa4f5('0x18')](_0xa4f5('0x13'),_0x2a3d14,_0x59e8f5);_0x11bf80(_0x59e8f5);});});}exports[_0xa4f5('0x1c')]=function(_0xb583a){var _0x952b5a=this;return new Promise(function(_0x3ba9f0,_0x52be72){return db[_0xa4f5('0x1d')]['update'](_0xb583a[_0xa4f5('0x1e')],{'raw':_0xb583a[_0xa4f5('0x1f')]?_0xb583a[_0xa4f5('0x1f')][_0xa4f5('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb583a[_0xa4f5('0x1f')]?_0xb583a[_0xa4f5('0x1f')]['where']||null:null,'attributes':_0xb583a[_0xa4f5('0x1f')]?_0xb583a[_0xa4f5('0x1f')][_0xa4f5('0x21')]||null:null,'limit':_0xb583a[_0xa4f5('0x1f')]?_0xb583a[_0xa4f5('0x1f')][_0xa4f5('0x22')]||null:null})[_0xa4f5('0x11')](function(_0x638ad){logger[_0xa4f5('0x12')](_0xa4f5('0x1c'),_0xb583a);logger[_0xa4f5('0x15')](_0xa4f5('0x1c'),_0xb583a,JSON[_0xa4f5('0x17')](_0x638ad));_0x3ba9f0(_0x638ad);})[_0xa4f5('0x23')](function(_0x1ad64f){logger['error'](_0xa4f5('0x1c'),_0x1ad64f[_0xa4f5('0x1a')],_0xb583a);_0x52be72(_0x952b5a[_0xa4f5('0x18')](0x1f4,_0x1ad64f[_0xa4f5('0x1a')]));});});};exports[_0xa4f5('0x24')]=function(_0x5dcaaf){return new Promise(function(_0x5b8599,_0x4ab9b4){return db[_0xa4f5('0x1d')][_0xa4f5('0x25')]({'where':_0x5dcaaf['options']?_0x5dcaaf[_0xa4f5('0x1f')]['where']||null:null})[_0xa4f5('0x11')](function(_0x510b5c){if(_0x510b5c){return _0x510b5c['addTags'](_0x5dcaaf[_0xa4f5('0x1e')][_0xa4f5('0x26')],_['omit'](_0x5dcaaf[_0xa4f5('0x1e')],['ids','id'])||{});}})[_0xa4f5('0x27')](function(_0x10ced8){logger['info'](_0xa4f5('0x28'),_0x5dcaaf);logger[_0xa4f5('0x15')](_0xa4f5('0x28'),_0x5dcaaf,JSON[_0xa4f5('0x17')](_0x10ced8));_0x5b8599(_0x10ced8);})[_0xa4f5('0x23')](function(_0x25ba51){logger[_0xa4f5('0x18')]('AddTags',_0x25ba51[_0xa4f5('0x1a')],_0x5dcaaf);_0x4ab9b4(_this['error'](0x1f4,_0x25ba51[_0xa4f5('0x1a')]));});});};
\ No newline at end of file
+var _0xc91b=['options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','omit','body','spread','debug','AddTags','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update'];(function(_0x47e97d,_0x23c172){var _0x2a248a=function(_0x2c7c80){while(--_0x2c7c80){_0x47e97d['push'](_0x47e97d['shift']());}};_0x2a248a(++_0x23c172);}(_0xc91b,0x157));var _0xbc91=function(_0x39ccd4,_0x412903){_0x39ccd4=_0x39ccd4-0x0;var _0x587605=_0xc91b[_0x39ccd4];return _0x587605;};'use strict';var _=require('lodash');var util=require(_0xbc91('0x0'));var moment=require(_0xbc91('0x1'));var BPromise=require('bluebird');var rs=require(_0xbc91('0x2'));var fs=require('fs');var Redis=require(_0xbc91('0x3'));var db=require(_0xbc91('0x4'))['db'];var utils=require(_0xbc91('0x5'));var logger=require(_0xbc91('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbc91('0x7'));var client=jayson['client'][_0xbc91('0x8')]({'port':0x232a});config[_0xbc91('0x9')]=_[_0xbc91('0xa')](config[_0xbc91('0x9')],{'host':_0xbc91('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbc91('0xc'))[_0xbc91('0xd')](socket);function respondWithRpcPromise(_0x1ee372,_0x528eef,_0x136eac){return new BPromise(function(_0x30763d,_0x2a1c27){return client['request'](_0x1ee372,_0x136eac)[_0xbc91('0xe')](function(_0x49bf40){logger[_0xbc91('0xf')](_0xbc91('0x10'),_0x528eef,'request\x20sent');logger['debug'](_0xbc91('0x11'),_0x528eef,_0xbc91('0x12'),JSON['stringify'](_0x49bf40));if(_0x49bf40[_0xbc91('0x13')]){if(_0x49bf40[_0xbc91('0x13')]['code']===0x1f4){logger[_0xbc91('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x528eef,_0x49bf40[_0xbc91('0x13')][_0xbc91('0x14')]);return _0x2a1c27(_0x49bf40['error']['message']);}logger[_0xbc91('0x13')](_0xbc91('0x10'),_0x528eef,_0x49bf40[_0xbc91('0x13')][_0xbc91('0x14')]);return _0x30763d(_0x49bf40['error']['message']);}else{logger[_0xbc91('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x528eef,_0xbc91('0x12'));_0x30763d(_0x49bf40[_0xbc91('0x15')]['message']);}})[_0xbc91('0x16')](function(_0x57c825){logger['error'](_0xbc91('0x10'),_0x528eef,_0x57c825);_0x2a1c27(_0x57c825);});});}exports[_0xbc91('0x17')]=function(_0x395e3c){var _0x127b1d=this;return new Promise(function(_0x34e5a8,_0x58d01d){return db[_0xbc91('0x18')][_0xbc91('0x19')](_0x395e3c['body'],{'raw':_0x395e3c[_0xbc91('0x1a')]?_0x395e3c[_0xbc91('0x1a')][_0xbc91('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x395e3c['options']?_0x395e3c[_0xbc91('0x1a')][_0xbc91('0x1c')]||null:null,'attributes':_0x395e3c[_0xbc91('0x1a')]?_0x395e3c['options'][_0xbc91('0x1d')]||null:null,'limit':_0x395e3c[_0xbc91('0x1a')]?_0x395e3c['options'][_0xbc91('0x1e')]||null:null})['then'](function(_0x142b85){logger[_0xbc91('0xf')]('UpdateChatInteraction',_0x395e3c);logger['debug'](_0xbc91('0x17'),_0x395e3c,JSON['stringify'](_0x142b85));_0x34e5a8(_0x142b85);})[_0xbc91('0x16')](function(_0x535098){logger['error']('UpdateChatInteraction',_0x535098['message'],_0x395e3c);_0x58d01d(_0x127b1d[_0xbc91('0x13')](0x1f4,_0x535098[_0xbc91('0x14')]));});});};exports[_0xbc91('0x1f')]=function(_0x5a79ec){return new Promise(function(_0xbd044,_0x1b4089){return db[_0xbc91('0x18')][_0xbc91('0x20')]({'where':_0x5a79ec['options']?_0x5a79ec[_0xbc91('0x1a')][_0xbc91('0x1c')]||null:null})[_0xbc91('0xe')](function(_0x447bec){if(_0x447bec){return _0x447bec[_0xbc91('0x21')](_0x5a79ec['body'][_0xbc91('0x22')],_[_0xbc91('0x23')](_0x5a79ec[_0xbc91('0x24')],['ids','id'])||{});}})[_0xbc91('0x25')](function(_0x271285){logger[_0xbc91('0xf')]('AddTags',_0x5a79ec);logger[_0xbc91('0x26')](_0xbc91('0x27'),_0x5a79ec,JSON[_0xbc91('0x28')](_0x271285));_0xbd044(_0x271285);})[_0xbc91('0x16')](function(_0x44a66d){logger[_0xbc91('0x13')](_0xbc91('0x27'),_0x44a66d[_0xbc91('0x14')],_0x5a79ec);_0x1b4089(_this[_0xbc91('0x13')](0x1f4,_0x44a66d[_0xbc91('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index be16729..9c1ec84 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 _0x155d=['update','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x5ed052,_0x2c5baa){var _0x2f2d6d=function(_0x42b3e4){while(--_0x42b3e4){_0x5ed052['push'](_0x5ed052['shift']());}};_0x2f2d6d(++_0x2c5baa);}(_0x155d,0x89));var _0xd155=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x155d[_0x13b02f];return _0x12e9a6;};'use strict';var ChatInteractionEvents=require(_0xd155('0x0'));var events=[_0xd155('0x1'),_0xd155('0x2'),_0xd155('0x3')];function createListener(_0x50eeee,_0x2526f7){return function(_0x3ec1be){_0x2526f7['emit'](_0x50eeee,_0x3ec1be);};}function removeListener(_0x4cf996,_0x4f127d){return function(){ChatInteractionEvents['removeListener'](_0x4cf996,_0x4f127d);};}exports[_0xd155('0x4')]=function(_0x433e8e){for(var _0x2ec7a9=0x0,_0x16c6d0=events[_0xd155('0x5')];_0x2ec7a9<_0x16c6d0;_0x2ec7a9++){var _0x102bb6=events[_0x2ec7a9];var _0x463e8e=createListener(_0xd155('0x6')+_0x102bb6,_0x433e8e);ChatInteractionEvents['on'](_0x102bb6,_0x463e8e);}};
\ No newline at end of file
+var _0xfcda=['./chatInteraction.events','save','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x3941c5,_0x3b5b2f){var _0x9b93a3=function(_0x1f0264){while(--_0x1f0264){_0x3941c5['push'](_0x3941c5['shift']());}};_0x9b93a3(++_0x3b5b2f);}(_0xfcda,0x198));var _0xafcd=function(_0x74f73,_0x2acc98){_0x74f73=_0x74f73-0x0;var _0x3827c2=_0xfcda[_0x74f73];return _0x3827c2;};'use strict';var ChatInteractionEvents=require(_0xafcd('0x0'));var events=[_0xafcd('0x1'),'remove',_0xafcd('0x2')];function createListener(_0x55dc26,_0x57b33a){return function(_0x4c5beb){_0x57b33a[_0xafcd('0x3')](_0x55dc26,_0x4c5beb);};}function removeListener(_0x187185,_0x18d3fd){return function(){ChatInteractionEvents[_0xafcd('0x4')](_0x187185,_0x18d3fd);};}exports[_0xafcd('0x5')]=function(_0x412e67){for(var _0x2623cb=0x0,_0x53fb69=events[_0xafcd('0x6')];_0x2623cb<_0x53fb69;_0x2623cb++){var _0x4c1e30=events[_0x2623cb];var _0x3f625f=createListener(_0xafcd('0x7')+_0x4c1e30,_0x412e67);ChatInteractionEvents['on'](_0x4c1e30,_0x3f625f);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index ddc314c..7ead9d9 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 _0xdff0=['get','isAuthenticated','index','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','replace','single','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','delete','chatinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller'];(function(_0x21f403,_0x209e8d){var _0x470dec=function(_0x1336eb){while(--_0x1336eb){_0x21f403['push'](_0x21f403['shift']());}};_0x470dec(++_0x209e8d);}(_0xdff0,0xe5));var _0x0dff=function(_0x5393c5,_0x4a05ac){_0x5393c5=_0x5393c5-0x0;var _0x3c0372=_0xdff0[_0x5393c5];return _0x3c0372;};'use strict';var multer=require('multer');var util=require(_0x0dff('0x0'));var path=require('path');var timeout=require(_0x0dff('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0dff('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x0dff('0x3'));var config=require(_0x0dff('0x4'));var controller=require(_0x0dff('0x5'));router[_0x0dff('0x6')]('/',auth[_0x0dff('0x7')](),controller[_0x0dff('0x8')]);router[_0x0dff('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0dff('0x6')](_0x0dff('0x9'),auth[_0x0dff('0xa')](),controller[_0x0dff('0xb')]);router['get'](_0x0dff('0xc'),auth[_0x0dff('0xa')](),controller[_0x0dff('0xd')]);router[_0x0dff('0x6')](_0x0dff('0xe'),auth['isAuthenticated'](),controller[_0x0dff('0xf')]);router[_0x0dff('0x6')](_0x0dff('0x10'),auth[_0x0dff('0xa')](),controller[_0x0dff('0x11')]);router[_0x0dff('0x6')]('/:id/download',auth[_0x0dff('0x7')](),controller[_0x0dff('0x12')]);router[_0x0dff('0x13')]('/',auth['isAuthenticated'](),controller[_0x0dff('0x14')]);router['post'](_0x0dff('0x15'),auth[_0x0dff('0x7')](),controller[_0x0dff('0x16')]);var upload=multer({'storage':multer[_0x0dff('0x17')]({'destination':function(_0x3efc6c,_0x519569,_0x3595fb){_0x3595fb(null,path[_0x0dff('0x18')](config[_0x0dff('0x19')],_0x0dff('0x1a')));},'filename':function(_0x2dcfe7,_0xf9d734,_0xf34d2){_0xf34d2(null,util['format'](_0x0dff('0x1b'),Date[_0x0dff('0x1c')](),_0xf9d734['originalname'][_0x0dff('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x0dff('0x1e')]('file'),controller[_0x0dff('0x1f')]);router[_0x0dff('0x13')](_0x0dff('0xe'),auth[_0x0dff('0xa')](),controller['addMessage']);router[_0x0dff('0x13')](_0x0dff('0x20'),auth[_0x0dff('0x7')](),interaction[_0x0dff('0x21')](_0x0dff('0x22'),_0x0dff('0x23')),controller[_0x0dff('0x24')]);router[_0x0dff('0x25')](_0x0dff('0x9'),auth[_0x0dff('0x7')](),interaction[_0x0dff('0x21')]('chat',_0x0dff('0x26')),controller['update']);router['put'](_0x0dff('0x27'),controller[_0x0dff('0x28')]);router[_0x0dff('0x25')](_0x0dff('0x29'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x0dff('0x25')]('/:id/close',controller['close']);router[_0x0dff('0x2a')]('/:id',auth[_0x0dff('0x7')](),interaction[_0x0dff('0x21')]('chat',_0x0dff('0x2b')),controller[_0x0dff('0x2c')]);router[_0x0dff('0x2a')](_0x0dff('0x20'),auth[_0x0dff('0x7')](),controller[_0x0dff('0x2d')]);module[_0x0dff('0x2e')]=router;
\ No newline at end of file
+var _0x83a4=['update','put','/:id/custom_update','/:id/abandon','delete','tracked','destroy','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/my_messages','getMyMessages','/:id/download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','/:id','chatinteraction:update'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0x83a4,0x1d4));var _0x483a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x83a4[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x483a('0x0'));var util=require(_0x483a('0x1'));var path=require('path');var timeout=require(_0x483a('0x2'));var express=require('express');var router=express[_0x483a('0x3')]();var fs_extra=require(_0x483a('0x4'));var auth=require(_0x483a('0x5'));var interaction=require(_0x483a('0x6'));var config=require(_0x483a('0x7'));var controller=require(_0x483a('0x8'));router[_0x483a('0x9')]('/',auth[_0x483a('0xa')](),controller['index']);router[_0x483a('0x9')](_0x483a('0xb'),auth[_0x483a('0xa')](),controller[_0x483a('0xc')]);router[_0x483a('0x9')]('/:id',auth[_0x483a('0xd')](),controller['show']);router[_0x483a('0x9')](_0x483a('0xe'),auth[_0x483a('0xd')](),controller[_0x483a('0xf')]);router[_0x483a('0x9')]('/:id/messages',auth[_0x483a('0xa')](),controller['getMessages']);router['get'](_0x483a('0x10'),auth[_0x483a('0xd')](),controller[_0x483a('0x11')]);router['get'](_0x483a('0x12'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x483a('0xa')](),controller[_0x483a('0x13')]);router[_0x483a('0x14')](_0x483a('0x15'),auth['isAuthenticated'](),controller[_0x483a('0x16')]);var upload=multer({'storage':multer[_0x483a('0x17')]({'destination':function(_0x2428e6,_0x304aa6,_0x53d28d){_0x53d28d(null,path[_0x483a('0x18')](config['root'],_0x483a('0x19')));},'filename':function(_0x31f5d7,_0x4a95b6,_0x2ac469){_0x2ac469(null,util[_0x483a('0x1a')](_0x483a('0x1b'),Date[_0x483a('0x1c')](),_0x4a95b6[_0x483a('0x1d')][_0x483a('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x483a('0x14')](_0x483a('0x1f'),upload[_0x483a('0x20')]('file'),controller[_0x483a('0x21')]);router[_0x483a('0x14')](_0x483a('0x22'),auth[_0x483a('0xd')](),controller[_0x483a('0x23')]);router[_0x483a('0x14')](_0x483a('0x24'),auth[_0x483a('0xa')](),interaction['tracked'](_0x483a('0x25'),_0x483a('0x26')),controller[_0x483a('0x27')]);router['put'](_0x483a('0x28'),auth[_0x483a('0xa')](),interaction['tracked']('chat',_0x483a('0x29')),controller[_0x483a('0x2a')]);router[_0x483a('0x2b')](_0x483a('0x2c'),controller['customUpdate']);router[_0x483a('0x2b')](_0x483a('0x2d'),auth[_0x483a('0xd')](),controller['abandon']);router[_0x483a('0x2b')]('/:id/close',controller['close']);router[_0x483a('0x2e')](_0x483a('0x28'),auth[_0x483a('0xa')](),interaction[_0x483a('0x2f')](_0x483a('0x25'),'chatinteraction:destroy'),controller[_0x483a('0x30')]);router[_0x483a('0x2e')]('/:id/tags',auth[_0x483a('0xa')](),controller[_0x483a('0x31')]);module[_0x483a('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 969da77..ef8365b 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 _0xa863=['exports','TEXT','medium','INTEGER','sequelize'];(function(_0x14c51b,_0x5d71ba){var _0x3fdfe3=function(_0x2b5c25){while(--_0x2b5c25){_0x14c51b['push'](_0x14c51b['shift']());}};_0x3fdfe3(++_0x5d71ba);}(_0xa863,0x16c));var _0x3a86=function(_0x1389d4,_0x13f53b){_0x1389d4=_0x1389d4-0x0;var _0x11f32a=_0xa863[_0x1389d4];return _0x11f32a;};'use strict';var Sequelize=require(_0x3a86('0x0'));module[_0x3a86('0x1')]={'body':{'type':Sequelize[_0x3a86('0x2')](_0x3a86('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3a86('0x4')]}};
\ No newline at end of file
+var _0xe0e8=['TEXT','medium','INTEGER','sequelize','exports'];(function(_0xfb7680,_0x2018ae){var _0x3eb2ac=function(_0x56d55f){while(--_0x56d55f){_0xfb7680['push'](_0xfb7680['shift']());}};_0x3eb2ac(++_0x2018ae);}(_0xe0e8,0x189));var _0x8e0e=function(_0x3ac027,_0x122bd2){_0x3ac027=_0x3ac027-0x0;var _0x3e98e9=_0xe0e8[_0x3ac027];return _0x3e98e9;};'use strict';var Sequelize=require(_0x8e0e('0x0'));module[_0x8e0e('0x1')]={'body':{'type':Sequelize[_0x8e0e('0x2')](_0x8e0e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8e0e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index f41e724..1ee574b 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 _0xacba=['options','ChatInternalMessage','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe','messages','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','fullname','role','userpic','online','showWebBar','-online','VoiceQueue','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','push','filter','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','type','VIRTUAL','merge'];(function(_0x563eab,_0x5edc88){var _0x5994ff=function(_0xe408ec){while(--_0xe408ec){_0x563eab['push'](_0x563eab['shift']());}};_0x5994ff(++_0x5edc88);}(_0xacba,0x9b));var _0xaacb=function(_0x54dbd5,_0x3e7ef6){_0x54dbd5=_0x54dbd5-0x0;var _0x2b8e09=_0xacba[_0x54dbd5];return _0x2b8e09;};'use strict';var emlformat=require(_0xaacb('0x0'));var rimraf=require(_0xaacb('0x1'));var zipdir=require(_0xaacb('0x2'));var jsonpatch=require(_0xaacb('0x3'));var rp=require(_0xaacb('0x4'));var moment=require(_0xaacb('0x5'));var BPromise=require(_0xaacb('0x6'));var Mustache=require(_0xaacb('0x7'));var util=require('util');var path=require(_0xaacb('0x8'));var sox=require(_0xaacb('0x9'));var csv=require(_0xaacb('0xa'));var ejs=require(_0xaacb('0xb'));var fs=require('fs');var fs_extra=require(_0xaacb('0xc'));var _=require(_0xaacb('0xd'));var squel=require(_0xaacb('0xe'));var crypto=require(_0xaacb('0xf'));var jsforce=require(_0xaacb('0x10'));var deskjs=require(_0xaacb('0x11'));var toCsv=require(_0xaacb('0xa'));var querystring=require(_0xaacb('0x12'));var Papa=require(_0xaacb('0x13'));var Redis=require(_0xaacb('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xaacb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaacb('0x16'));var logger=require(_0xaacb('0x17'))(_0xaacb('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaacb('0x19'));var db=require(_0xaacb('0x1a'))['db'];config[_0xaacb('0x1b')]=_[_0xaacb('0x1c')](config[_0xaacb('0x1b')],{'host':_0xaacb('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaacb('0x1b')]));require('./chatInternalMessage.socket')[_0xaacb('0x1e')](socket);function respondWithStatusCode(_0x322232,_0x3f0a4a){_0x3f0a4a=_0x3f0a4a||0xcc;return function(_0x3e0858){if(_0x3e0858){return _0x322232[_0xaacb('0x1f')](_0x3f0a4a);}return _0x322232[_0xaacb('0x20')](_0x3f0a4a)[_0xaacb('0x21')]();};}function respondWithResult(_0x1cbeee,_0x3134f2){_0x3134f2=_0x3134f2||0xc8;return function(_0x2a5259){if(_0x2a5259){return _0x1cbeee['status'](_0x3134f2)[_0xaacb('0x22')](_0x2a5259);}};}function respondWithFilteredResult(_0x2bf584,_0x24c0fe){return function(_0x16ec32){if(_0x16ec32){var _0x155b96=typeof _0x24c0fe[_0xaacb('0x23')]==='undefined'&&typeof _0x24c0fe['limit']===_0xaacb('0x24');var _0x157c2b=_0x16ec32[_0xaacb('0x25')];var _0xd9e37e=_0x155b96?0x0:_0x24c0fe[_0xaacb('0x23')];var _0x528e43=_0x155b96?_0x16ec32['count']:_0x24c0fe[_0xaacb('0x23')]+_0x24c0fe[_0xaacb('0x26')];var _0x365248;if(_0x528e43>=_0x157c2b){_0x528e43=_0x157c2b;_0x365248=0xc8;}else{_0x365248=0xce;}_0x2bf584[_0xaacb('0x20')](_0x365248);return _0x2bf584[_0xaacb('0x27')](_0xaacb('0x28'),_0xd9e37e+'-'+_0x528e43+'/'+_0x157c2b)['json'](_0x16ec32);}return null;};}function patchUpdates(_0x2f6f35){return function(_0x1f430a){try{jsonpatch['apply'](_0x1f430a,_0x2f6f35,!![]);}catch(_0x89d2f6){return BPromise[_0xaacb('0x29')](_0x89d2f6);}return _0x1f430a[_0xaacb('0x2a')]();};}function saveUpdates(_0x109422,_0x150ba6){return function(_0x142d10){if(_0x142d10){return _0x142d10[_0xaacb('0x2b')](_0x109422)[_0xaacb('0x2c')](function(_0x91b2dc){return _0x91b2dc;});}return null;};}function removeEntity(_0x38ebe2,_0x3a3542){return function(_0x4f2ca1){if(_0x4f2ca1){return _0x4f2ca1[_0xaacb('0x2d')]()[_0xaacb('0x2c')](function(){_0x38ebe2[_0xaacb('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x564b97,_0x1f751a){return function(_0x20b691){if(!_0x20b691){_0x564b97[_0xaacb('0x1f')](0x194);}return _0x20b691;};}function handleError(_0x56ae4a,_0x3106f3){_0x3106f3=_0x3106f3||0x1f4;return function(_0x523c9d){logger[_0xaacb('0x2e')](_0x523c9d[_0xaacb('0x2f')]);if(_0x523c9d['name']){delete _0x523c9d[_0xaacb('0x30')];}_0x56ae4a[_0xaacb('0x20')](_0x3106f3)[_0xaacb('0x31')](_0x523c9d);};}exports['index']=function(_0x44dd12,_0x40fc39){var _0x4848c2={},_0x1b6d81={},_0x51e608={'count':0x0,'rows':[]};var _0x5143da=_['map'](db['ChatInternalMessage'][_0xaacb('0x32')],function(_0x48147b){return{'name':_0x48147b[_0xaacb('0x33')],'type':_0x48147b['type'][_0xaacb('0x34')]};});_0x1b6d81[_0xaacb('0x35')]=_['map'](_0x5143da,_0xaacb('0x30'));_0x1b6d81[_0xaacb('0x36')]=_['keys'](_0x44dd12[_0xaacb('0x36')]);_0x1b6d81[_0xaacb('0x37')]=_[_0xaacb('0x38')](_0x1b6d81[_0xaacb('0x35')],_0x1b6d81['query']);_0x4848c2[_0xaacb('0x39')]=_['intersection'](_0x1b6d81['model'],qs[_0xaacb('0x3a')](_0x44dd12['query'][_0xaacb('0x3a')]));_0x4848c2['attributes']=_0x4848c2[_0xaacb('0x39')][_0xaacb('0x3b')]?_0x4848c2[_0xaacb('0x39')]:_0x1b6d81['model'];if(!_0x44dd12[_0xaacb('0x36')][_0xaacb('0x3c')](_0xaacb('0x3d'))){_0x4848c2[_0xaacb('0x26')]=qs['limit'](_0x44dd12[_0xaacb('0x36')][_0xaacb('0x26')]);_0x4848c2[_0xaacb('0x23')]=qs[_0xaacb('0x23')](_0x44dd12[_0xaacb('0x36')][_0xaacb('0x23')]);}_0x4848c2[_0xaacb('0x3e')]=qs[_0xaacb('0x3f')](_0x44dd12['query'][_0xaacb('0x3f')]);_0x4848c2[_0xaacb('0x40')]=qs[_0xaacb('0x37')](_['pick'](_0x44dd12['query'],_0x1b6d81[_0xaacb('0x37')]),_0x5143da);if(_0x44dd12[_0xaacb('0x36')]['filter']){_0x4848c2[_0xaacb('0x40')]=_['merge'](_0x4848c2[_0xaacb('0x40')],{'$or':_[_0xaacb('0x41')](_0x5143da,function(_0x57122){if(_0x57122[_0xaacb('0x42')]!==_0xaacb('0x43')){var _0xd5042d={};_0xd5042d[_0x57122[_0xaacb('0x30')]]={'$like':'%'+_0x44dd12[_0xaacb('0x36')]['filter']+'%'};return _0xd5042d;}})});}_0x4848c2=_[_0xaacb('0x44')]({},_0x4848c2,_0x44dd12[_0xaacb('0x45')]);var _0xe965af={'where':_0x4848c2[_0xaacb('0x40')]};return db[_0xaacb('0x46')][_0xaacb('0x25')](_0xe965af)[_0xaacb('0x2c')](function(_0x38e345){_0x51e608[_0xaacb('0x25')]=_0x38e345;if(_0x44dd12[_0xaacb('0x36')][_0xaacb('0x47')]){_0x4848c2[_0xaacb('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xaacb('0x49')](_0x4848c2);})[_0xaacb('0x2c')](function(_0x38104e){_0x51e608[_0xaacb('0x4a')]=_0x38104e;return _0x51e608;})[_0xaacb('0x2c')](respondWithFilteredResult(_0x40fc39,_0x4848c2))[_0xaacb('0x4b')](handleError(_0x40fc39,null));};exports['show']=function(_0x29a93b,_0x473aaf){var _0x4317d8={'raw':!![],'where':{'id':_0x29a93b['params']['id']}},_0xc4d706={};_0xc4d706[_0xaacb('0x35')]=_[_0xaacb('0x4c')](db['ChatInternalMessage'][_0xaacb('0x32')]);_0xc4d706['query']=_['keys'](_0x29a93b[_0xaacb('0x36')]);_0xc4d706[_0xaacb('0x37')]=_[_0xaacb('0x38')](_0xc4d706[_0xaacb('0x35')],_0xc4d706['query']);_0x4317d8[_0xaacb('0x39')]=_['intersection'](_0xc4d706[_0xaacb('0x35')],qs[_0xaacb('0x3a')](_0x29a93b['query'][_0xaacb('0x3a')]));_0x4317d8[_0xaacb('0x39')]=_0x4317d8['attributes'][_0xaacb('0x3b')]?_0x4317d8[_0xaacb('0x39')]:_0xc4d706['model'];if(_0x29a93b[_0xaacb('0x36')][_0xaacb('0x47')]){_0x4317d8['include']=[{'all':!![]}];}_0x4317d8=_['merge']({},_0x4317d8,_0x29a93b[_0xaacb('0x45')]);return db['ChatInternalMessage'][_0xaacb('0x4d')](_0x4317d8)['then'](handleEntityNotFound(_0x473aaf,null))[_0xaacb('0x2c')](respondWithResult(_0x473aaf,null))[_0xaacb('0x4b')](handleError(_0x473aaf,null));};exports[_0xaacb('0x4e')]=function(_0x567a05,_0x13e9f0){return db['ChatInternalMessage'][_0xaacb('0x4e')](_0x567a05[_0xaacb('0x4f')],{})[_0xaacb('0x2c')](respondWithResult(_0x13e9f0,0xc9))[_0xaacb('0x4b')](handleError(_0x13e9f0,null));};exports[_0xaacb('0x2b')]=function(_0x408bce,_0x5e6647){if(_0x408bce[_0xaacb('0x4f')]['id']){delete _0x408bce[_0xaacb('0x4f')]['id'];}return db[_0xaacb('0x46')][_0xaacb('0x4d')]({'where':{'id':_0x408bce['params']['id']}})[_0xaacb('0x2c')](handleEntityNotFound(_0x5e6647,null))[_0xaacb('0x2c')](saveUpdates(_0x408bce[_0xaacb('0x4f')],null))[_0xaacb('0x2c')](respondWithResult(_0x5e6647,null))[_0xaacb('0x4b')](handleError(_0x5e6647,null));};exports['destroy']=function(_0x54290e,_0x19c2b2){return db[_0xaacb('0x46')][_0xaacb('0x4d')]({'where':{'id':_0x54290e[_0xaacb('0x50')]['id']}})[_0xaacb('0x2c')](handleEntityNotFound(_0x19c2b2,null))['then'](removeEntity(_0x19c2b2,null))[_0xaacb('0x4b')](handleError(_0x19c2b2,null));};exports[_0xaacb('0x51')]=function(_0x1b4c91,_0x374f60){return db[_0xaacb('0x46')][_0xaacb('0x51')]()['then'](respondWithResult(_0x374f60,null))[_0xaacb('0x4b')](handleError(_0x374f60,null));};function wrapUser(_0x18f16e){return function(_0x561c1b){var _0x368dfe=_0x18f16e['get']({'plain':!![]});_0x368dfe[_0xaacb('0x52')]=[];if(_0x561c1b){_0x368dfe['lastMessageAt']=_0x561c1b[_0xaacb('0x53')];_0x368dfe['lastMessage']=_0x561c1b;}else{_0x368dfe[_0xaacb('0x54')]=moment(0x0)[_0xaacb('0x55')](_0xaacb('0x56'));_0x368dfe[_0xaacb('0x57')]={};}return _0x368dfe;};}exports[_0xaacb('0x58')]=function(_0x15a289,_0x5df241,_0x364a6c){var _0x5e1700=[];return db['User']['findAll']({'where':{'role':[_0xaacb('0x59'),_0xaacb('0x5a'),'user']},'attributes':['id',_0xaacb('0x5b'),_0xaacb('0x30'),_0xaacb('0x5c'),_0xaacb('0x5d'),'internal',_0xaacb('0x5e'),'lastLoginAt','allowmessenger',_0xaacb('0x5f')],'order':qs['sort'](_0xaacb('0x60')),'include':[{'model':db[_0xaacb('0x61')],'as':'VoiceQueues','attributes':['id','name',_0xaacb('0x42')],'through':{'attributes':[]}}]})[_0xaacb('0x2c')](function(_0x21a820){if(_0x21a820){var _0x562ddf=_0x15a289[_0xaacb('0x62')][_0xaacb('0x63')]({'plain':!![]});if(!_0x562ddf)throw new Error(_0xaacb('0x64'));if(_0x562ddf[_0xaacb('0x5c')]===_0xaacb('0x62')){return db[_0xaacb('0x65')]['find']({'where':{'name':_0xaacb('0x66'),'userProfileId':_0x562ddf['userProfileId']},'raw':!![]})[_0xaacb('0x2c')](function(_0x35104e){if(_0x35104e){if(_0x35104e[_0xaacb('0x67')]===0x0){return db[_0xaacb('0x68')][_0xaacb('0x49')]({'where':{'sectionId':_0x35104e['id']},'raw':!![]})[_0xaacb('0x2c')](function(_0x146df8){var _0x3274e2=[];if(_[_0xaacb('0x69')](_0x146df8)){_0x3274e2=_['filter'](_0x21a820,function(_0x211e4e){if(_0x211e4e['role']!==_0xaacb('0x59')){return _0x211e4e;}});return _0x3274e2;}else{for(var _0xec6aec=0x0;_0xec6aec<_0x21a820[_0xaacb('0x3b')];_0xec6aec++){var _0x184cff=_0x21a820[_0xec6aec];if(_0x184cff[_0xaacb('0x5c')]==='agent'){var _0x2f4c57=_[_0xaacb('0x4d')](_0x146df8,function(_0x48d42c){return _0x48d42c['resourceId']===_0x184cff['id'];});if(_0x2f4c57)_0x3274e2[_0xaacb('0x6a')](_0x184cff);}else{_0x3274e2[_0xaacb('0x6a')](_0x184cff);}}return _0x3274e2;}});}else{return _0x21a820;}}else{var _0x6c63f9=_[_0xaacb('0x6b')](_0x21a820,function(_0x2f7d1c){if(_0x2f7d1c['role']!==_0xaacb('0x59')){return _0x2f7d1c;}});return _0x6c63f9;}});}else{return _0x21a820;}}})[_0xaacb('0x2c')](function(_0x1b85c7){var _0x4b6177=[];if(_0x1b85c7){_0x5e1700=_0x1b85c7;for(var _0x184f80=0x0;_0x184f80<_0x1b85c7[_0xaacb('0x3b')];_0x184f80+=0x1){_0x5e1700[_0x184f80][_0xaacb('0x52')]=[];_0x4b6177[_0xaacb('0x6a')](db[_0xaacb('0x46')][_0xaacb('0x4d')]({'where':{'FromId':[_0x15a289[_0xaacb('0x62')]['id'],_0x1b85c7[_0x184f80]['id']],'ToId':[_0x15a289['user']['id'],_0x1b85c7[_0x184f80]['id']],'ChatGroupId':null},'attributes':['id',_0xaacb('0x53'),_0xaacb('0x6c'),_0xaacb('0x6d'),'read',_0xaacb('0x4f')],'order':qs[_0xaacb('0x3f')](_0xaacb('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1b85c7[_0x184f80])));}return BPromise[_0xaacb('0x6f')](_0x4b6177);}return[];})[_0xaacb('0x2c')](function(_0x2933f9){return{'rows':_0x2933f9,'count':_0x2933f9[_0xaacb('0x3b')]};})['then'](respondWithResult(_0x5df241,null))[_0xaacb('0x4b')](handleError(_0x5df241,null));};
\ No newline at end of file
+var _0xe564=['Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','findAll','rows','show','params','length','includeAll','include','catch','create','body','find','describe','get','messages','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','agent','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x322f4d,_0x2211c6){var _0x548443=function(_0x5f42a4){while(--_0x5f42a4){_0x322f4d['push'](_0x322f4d['shift']());}};_0x548443(++_0x2211c6);}(_0xe564,0x1b7));var _0x4e56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe564[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e56('0x0'));var zipdir=require(_0x4e56('0x1'));var jsonpatch=require(_0x4e56('0x2'));var rp=require(_0x4e56('0x3'));var moment=require(_0x4e56('0x4'));var BPromise=require(_0x4e56('0x5'));var Mustache=require(_0x4e56('0x6'));var util=require(_0x4e56('0x7'));var path=require(_0x4e56('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e56('0x9'));var fs=require('fs');var fs_extra=require(_0x4e56('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4e56('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4e56('0xc'));var Papa=require('papaparse');var Redis=require(_0x4e56('0xd'));var authService=require(_0x4e56('0xe'));var qs=require(_0x4e56('0xf'));var as=require(_0x4e56('0x10'));var hardwareService=require(_0x4e56('0x11'));var logger=require(_0x4e56('0x12'))(_0x4e56('0x13'));var utils=require(_0x4e56('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4e56('0x15'))['db'];config[_0x4e56('0x16')]=_['defaults'](config[_0x4e56('0x16')],{'host':_0x4e56('0x17'),'port':0x18eb});var socket=require(_0x4e56('0x18'))(new Redis(config[_0x4e56('0x16')]));require('./chatInternalMessage.socket')[_0x4e56('0x19')](socket);function respondWithStatusCode(_0x23aa99,_0x1cfc27){_0x1cfc27=_0x1cfc27||0xcc;return function(_0x4408ac){if(_0x4408ac){return _0x23aa99[_0x4e56('0x1a')](_0x1cfc27);}return _0x23aa99['status'](_0x1cfc27)[_0x4e56('0x1b')]();};}function respondWithResult(_0xca930c,_0x287c98){_0x287c98=_0x287c98||0xc8;return function(_0x326cf6){if(_0x326cf6){return _0xca930c[_0x4e56('0x1c')](_0x287c98)[_0x4e56('0x1d')](_0x326cf6);}};}function respondWithFilteredResult(_0xa1b0a7,_0x39b64e){return function(_0x20c4ec){if(_0x20c4ec){var _0x3db547=typeof _0x39b64e[_0x4e56('0x1e')]===_0x4e56('0x1f')&&typeof _0x39b64e[_0x4e56('0x20')]===_0x4e56('0x1f');var _0x267696=_0x20c4ec[_0x4e56('0x21')];var _0x25c348=_0x3db547?0x0:_0x39b64e[_0x4e56('0x1e')];var _0x1870e6=_0x3db547?_0x20c4ec[_0x4e56('0x21')]:_0x39b64e[_0x4e56('0x1e')]+_0x39b64e[_0x4e56('0x20')];var _0x899123;if(_0x1870e6>=_0x267696){_0x1870e6=_0x267696;_0x899123=0xc8;}else{_0x899123=0xce;}_0xa1b0a7[_0x4e56('0x1c')](_0x899123);return _0xa1b0a7[_0x4e56('0x22')](_0x4e56('0x23'),_0x25c348+'-'+_0x1870e6+'/'+_0x267696)[_0x4e56('0x1d')](_0x20c4ec);}return null;};}function patchUpdates(_0x546a9c){return function(_0x34670d){try{jsonpatch[_0x4e56('0x24')](_0x34670d,_0x546a9c,!![]);}catch(_0x35e27a){return BPromise['reject'](_0x35e27a);}return _0x34670d[_0x4e56('0x25')]();};}function saveUpdates(_0x2b8568,_0x512078){return function(_0x84678c){if(_0x84678c){return _0x84678c[_0x4e56('0x26')](_0x2b8568)[_0x4e56('0x27')](function(_0x58d524){return _0x58d524;});}return null;};}function removeEntity(_0x2195f9,_0x150484){return function(_0x4f6b4f){if(_0x4f6b4f){return _0x4f6b4f[_0x4e56('0x28')]()[_0x4e56('0x27')](function(){_0x2195f9[_0x4e56('0x1c')](0xcc)[_0x4e56('0x1b')]();});}};}function handleEntityNotFound(_0x1a70f8,_0xe011e8){return function(_0x1d78e9){if(!_0x1d78e9){_0x1a70f8[_0x4e56('0x1a')](0x194);}return _0x1d78e9;};}function handleError(_0xc4dd1a,_0x39be3e){_0x39be3e=_0x39be3e||0x1f4;return function(_0x49f0a4){logger['error'](_0x49f0a4[_0x4e56('0x29')]);if(_0x49f0a4[_0x4e56('0x2a')]){delete _0x49f0a4[_0x4e56('0x2a')];}_0xc4dd1a['status'](_0x39be3e)[_0x4e56('0x2b')](_0x49f0a4);};}exports[_0x4e56('0x2c')]=function(_0x13776f,_0x46f6a2){var _0x577ea7={},_0x4aa0a8={},_0x5cf851={'count':0x0,'rows':[]};var _0x2e8443=_[_0x4e56('0x2d')](db[_0x4e56('0x2e')][_0x4e56('0x2f')],function(_0x3064db){return{'name':_0x3064db[_0x4e56('0x30')],'type':_0x3064db[_0x4e56('0x31')][_0x4e56('0x32')]};});_0x4aa0a8[_0x4e56('0x33')]=_[_0x4e56('0x2d')](_0x2e8443,_0x4e56('0x2a'));_0x4aa0a8[_0x4e56('0x34')]=_[_0x4e56('0x35')](_0x13776f['query']);_0x4aa0a8['filters']=_[_0x4e56('0x36')](_0x4aa0a8[_0x4e56('0x33')],_0x4aa0a8[_0x4e56('0x34')]);_0x577ea7[_0x4e56('0x37')]=_[_0x4e56('0x36')](_0x4aa0a8[_0x4e56('0x33')],qs[_0x4e56('0x38')](_0x13776f[_0x4e56('0x34')]['fields']));_0x577ea7[_0x4e56('0x37')]=_0x577ea7[_0x4e56('0x37')]['length']?_0x577ea7[_0x4e56('0x37')]:_0x4aa0a8[_0x4e56('0x33')];if(!_0x13776f[_0x4e56('0x34')][_0x4e56('0x39')]('nolimit')){_0x577ea7[_0x4e56('0x20')]=qs[_0x4e56('0x20')](_0x13776f[_0x4e56('0x34')][_0x4e56('0x20')]);_0x577ea7['offset']=qs['offset'](_0x13776f[_0x4e56('0x34')]['offset']);}_0x577ea7[_0x4e56('0x3a')]=qs['sort'](_0x13776f['query'][_0x4e56('0x3b')]);_0x577ea7['where']=qs[_0x4e56('0x3c')](_[_0x4e56('0x3d')](_0x13776f[_0x4e56('0x34')],_0x4aa0a8[_0x4e56('0x3c')]),_0x2e8443);if(_0x13776f['query'][_0x4e56('0x3e')]){_0x577ea7['where']=_[_0x4e56('0x3f')](_0x577ea7['where'],{'$or':_['map'](_0x2e8443,function(_0x21cc55){if(_0x21cc55[_0x4e56('0x31')]!==_0x4e56('0x40')){var _0x1db635={};_0x1db635[_0x21cc55['name']]={'$like':'%'+_0x13776f[_0x4e56('0x34')][_0x4e56('0x3e')]+'%'};return _0x1db635;}})});}_0x577ea7=_[_0x4e56('0x3f')]({},_0x577ea7,_0x13776f[_0x4e56('0x41')]);var _0x44ceb3={'where':_0x577ea7[_0x4e56('0x42')]};return db[_0x4e56('0x2e')]['count'](_0x44ceb3)[_0x4e56('0x27')](function(_0x364f53){_0x5cf851[_0x4e56('0x21')]=_0x364f53;if(_0x13776f['query']['includeAll']){_0x577ea7['include']=[{'all':!![]}];}return db[_0x4e56('0x2e')][_0x4e56('0x43')](_0x577ea7);})[_0x4e56('0x27')](function(_0x35a17b){_0x5cf851[_0x4e56('0x44')]=_0x35a17b;return _0x5cf851;})[_0x4e56('0x27')](respondWithFilteredResult(_0x46f6a2,_0x577ea7))['catch'](handleError(_0x46f6a2,null));};exports[_0x4e56('0x45')]=function(_0x1ce7dd,_0x36c7b7){var _0x2fc059={'raw':!![],'where':{'id':_0x1ce7dd[_0x4e56('0x46')]['id']}},_0x3fc222={};_0x3fc222[_0x4e56('0x33')]=_['keys'](db['ChatInternalMessage'][_0x4e56('0x2f')]);_0x3fc222[_0x4e56('0x34')]=_[_0x4e56('0x35')](_0x1ce7dd['query']);_0x3fc222[_0x4e56('0x3c')]=_[_0x4e56('0x36')](_0x3fc222['model'],_0x3fc222['query']);_0x2fc059['attributes']=_[_0x4e56('0x36')](_0x3fc222[_0x4e56('0x33')],qs[_0x4e56('0x38')](_0x1ce7dd[_0x4e56('0x34')]['fields']));_0x2fc059[_0x4e56('0x37')]=_0x2fc059['attributes'][_0x4e56('0x47')]?_0x2fc059[_0x4e56('0x37')]:_0x3fc222['model'];if(_0x1ce7dd[_0x4e56('0x34')][_0x4e56('0x48')]){_0x2fc059[_0x4e56('0x49')]=[{'all':!![]}];}_0x2fc059=_[_0x4e56('0x3f')]({},_0x2fc059,_0x1ce7dd[_0x4e56('0x41')]);return db[_0x4e56('0x2e')]['find'](_0x2fc059)[_0x4e56('0x27')](handleEntityNotFound(_0x36c7b7,null))[_0x4e56('0x27')](respondWithResult(_0x36c7b7,null))[_0x4e56('0x4a')](handleError(_0x36c7b7,null));};exports[_0x4e56('0x4b')]=function(_0x2fcfec,_0x364c26){return db[_0x4e56('0x2e')][_0x4e56('0x4b')](_0x2fcfec['body'],{})[_0x4e56('0x27')](respondWithResult(_0x364c26,0xc9))['catch'](handleError(_0x364c26,null));};exports['update']=function(_0x5e8dee,_0x329cd8){if(_0x5e8dee[_0x4e56('0x4c')]['id']){delete _0x5e8dee['body']['id'];}return db['ChatInternalMessage'][_0x4e56('0x4d')]({'where':{'id':_0x5e8dee['params']['id']}})[_0x4e56('0x27')](handleEntityNotFound(_0x329cd8,null))['then'](saveUpdates(_0x5e8dee[_0x4e56('0x4c')],null))[_0x4e56('0x27')](respondWithResult(_0x329cd8,null))['catch'](handleError(_0x329cd8,null));};exports['destroy']=function(_0x3aaa3a,_0x666ae7){return db[_0x4e56('0x2e')]['find']({'where':{'id':_0x3aaa3a[_0x4e56('0x46')]['id']}})[_0x4e56('0x27')](handleEntityNotFound(_0x666ae7,null))['then'](removeEntity(_0x666ae7,null))[_0x4e56('0x4a')](handleError(_0x666ae7,null));};exports[_0x4e56('0x4e')]=function(_0x209841,_0x5d555f){return db[_0x4e56('0x2e')][_0x4e56('0x4e')]()[_0x4e56('0x27')](respondWithResult(_0x5d555f,null))[_0x4e56('0x4a')](handleError(_0x5d555f,null));};function wrapUser(_0x5aeee0){return function(_0x333699){var _0x123c03=_0x5aeee0[_0x4e56('0x4f')]({'plain':!![]});_0x123c03[_0x4e56('0x50')]=[];if(_0x333699){_0x123c03['lastMessageAt']=_0x333699[_0x4e56('0x51')];_0x123c03[_0x4e56('0x52')]=_0x333699;}else{_0x123c03['lastMessageAt']=moment(0x0)['format'](_0x4e56('0x53'));_0x123c03[_0x4e56('0x52')]={};}return _0x123c03;};}exports['getUsers']=function(_0x19d943,_0x145de6,_0x15bee6){var _0xb8f312=[];return db[_0x4e56('0x54')][_0x4e56('0x43')]({'where':{'role':[_0x4e56('0x55'),'admin',_0x4e56('0x56')]},'attributes':['id',_0x4e56('0x57'),_0x4e56('0x2a'),_0x4e56('0x58'),_0x4e56('0x59'),_0x4e56('0x5a'),'online',_0x4e56('0x5b'),_0x4e56('0x5c'),'showWebBar'],'order':qs[_0x4e56('0x3b')]('-online'),'include':[{'model':db[_0x4e56('0x5d')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x4e56('0x27')](function(_0x1f5e14){if(_0x1f5e14){var _0x239702=_0x19d943['user'][_0x4e56('0x4f')]({'plain':!![]});if(!_0x239702)throw new Error(_0x4e56('0x5e'));if(_0x239702[_0x4e56('0x58')]===_0x4e56('0x56')){return db[_0x4e56('0x5f')]['find']({'where':{'name':_0x4e56('0x60'),'userProfileId':_0x239702[_0x4e56('0x61')]},'raw':!![]})['then'](function(_0xefcbdf){if(_0xefcbdf){if(_0xefcbdf['autoAssociation']===0x0){return db[_0x4e56('0x62')]['findAll']({'where':{'sectionId':_0xefcbdf['id']},'raw':!![]})[_0x4e56('0x27')](function(_0x580030){var _0x4c1cbe=[];if(_[_0x4e56('0x63')](_0x580030)){_0x4c1cbe=_[_0x4e56('0x3e')](_0x1f5e14,function(_0x3b6963){if(_0x3b6963[_0x4e56('0x58')]!=='agent'){return _0x3b6963;}});return _0x4c1cbe;}else{for(var _0x4cc4a8=0x0;_0x4cc4a8<_0x1f5e14[_0x4e56('0x47')];_0x4cc4a8++){var _0x3d8450=_0x1f5e14[_0x4cc4a8];if(_0x3d8450[_0x4e56('0x58')]===_0x4e56('0x55')){var _0xbdbc82=_[_0x4e56('0x4d')](_0x580030,function(_0x306377){return _0x306377[_0x4e56('0x64')]===_0x3d8450['id'];});if(_0xbdbc82)_0x4c1cbe[_0x4e56('0x65')](_0x3d8450);}else{_0x4c1cbe[_0x4e56('0x65')](_0x3d8450);}}return _0x4c1cbe;}});}else{return _0x1f5e14;}}else{var _0x2ba0c1=_[_0x4e56('0x3e')](_0x1f5e14,function(_0x2d8daa){if(_0x2d8daa['role']!=='agent'){return _0x2d8daa;}});return _0x2ba0c1;}});}else{return _0x1f5e14;}}})[_0x4e56('0x27')](function(_0x519659){var _0x3b3235=[];if(_0x519659){_0xb8f312=_0x519659;for(var _0x343485=0x0;_0x343485<_0x519659['length'];_0x343485+=0x1){_0xb8f312[_0x343485][_0x4e56('0x50')]=[];_0x3b3235[_0x4e56('0x65')](db[_0x4e56('0x2e')]['find']({'where':{'FromId':[_0x19d943[_0x4e56('0x56')]['id'],_0x519659[_0x343485]['id']],'ToId':[_0x19d943[_0x4e56('0x56')]['id'],_0x519659[_0x343485]['id']],'ChatGroupId':null},'attributes':['id',_0x4e56('0x51'),_0x4e56('0x66'),_0x4e56('0x67'),_0x4e56('0x68'),_0x4e56('0x4c')],'order':qs[_0x4e56('0x3b')](_0x4e56('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x519659[_0x343485])));}return BPromise[_0x4e56('0x6a')](_0x3b3235);}return[];})['then'](function(_0x364183){return{'rows':_0x364183,'count':_0x364183['length']};})[_0x4e56('0x27')](respondWithResult(_0x145de6,null))[_0x4e56('0x4a')](handleError(_0x145de6,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 8ed9446..ae75874 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 _0x8ee9=['../../mysqldb','ChatInternalMessage','save','remove','emit','hasOwnProperty','exports'];(function(_0x438fe1,_0x3308d5){var _0x3c8e1b=function(_0x2f8d41){while(--_0x2f8d41){_0x438fe1['push'](_0x438fe1['shift']());}};_0x3c8e1b(++_0x3308d5);}(_0x8ee9,0x1f1));var _0x98ee=function(_0x4d2a57,_0x267329){_0x4d2a57=_0x4d2a57-0x0;var _0x3a9514=_0x8ee9[_0x4d2a57];return _0x3a9514;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x98ee('0x0'))['db'][_0x98ee('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x98ee('0x2'),'afterUpdate':'update','afterDestroy':_0x98ee('0x3')};function emitEvent(_0x3ce827){return function(_0x16cc99,_0x19f208,_0x50a5fb){ChatInternalMessageEvents[_0x98ee('0x4')](_0x3ce827+':'+_0x16cc99['id'],_0x16cc99);ChatInternalMessageEvents[_0x98ee('0x4')](_0x3ce827,_0x16cc99);_0x50a5fb(null);};}for(var e in events){if(events[_0x98ee('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x98ee('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xdb2d=['save','remove','emit','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0xdb2d,0x19c));var _0xddb2=function(_0x2f6af5,_0x776b09){_0x2f6af5=_0x2f6af5-0x0;var _0x4b9875=_0xdb2d[_0x2f6af5];return _0x4b9875;};'use strict';var EventEmitter=require(_0xddb2('0x0'));var ChatInternalMessage=require(_0xddb2('0x1'))['db'][_0xddb2('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xddb2('0x3')](0x0);var events={'afterCreate':_0xddb2('0x4'),'afterUpdate':'update','afterDestroy':_0xddb2('0x5')};function emitEvent(_0x4ba9e5){return function(_0x435fc3,_0xa22392,_0x3c519f){ChatInternalMessageEvents[_0xddb2('0x6')](_0x4ba9e5+':'+_0x435fc3['id'],_0x435fc3);ChatInternalMessageEvents[_0xddb2('0x6')](_0x4ba9e5,_0x435fc3);_0x3c519f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xddb2('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index b7de648..13fa7d7 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 _0x10ae=['moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x872f6f,_0x5efe7b){var _0x59a5f4=function(_0x147463){while(--_0x147463){_0x872f6f['push'](_0x872f6f['shift']());}};_0x59a5f4(++_0x5efe7b);}(_0x10ae,0x6d));var _0xe10a=function(_0x1090be,_0x4bdd56){_0x1090be=_0x1090be-0x0;var _0x3afb33=_0x10ae[_0x1090be];return _0x3afb33;};'use strict';var _=require('lodash');var util=require(_0xe10a('0x0'));var logger=require(_0xe10a('0x1'))(_0xe10a('0x2'));var moment=require(_0xe10a('0x3'));var BPromise=require(_0xe10a('0x4'));var rp=require(_0xe10a('0x5'));var fs=require('fs');var path=require(_0xe10a('0x6'));var rimraf=require('rimraf');var config=require(_0xe10a('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xe10a('0x8')]=function(_0x30475c,_0x17ffd3){return _0x30475c[_0xe10a('0x9')](_0xe10a('0xa'),attributes,{'tableName':_0xe10a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe10a('0xc'),'collate':_0xe10a('0xd')});};
\ No newline at end of file
+var _0xf799=['request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5ea2f9,_0x320917){var _0x36e586=function(_0x2e79a2){while(--_0x2e79a2){_0x5ea2f9['push'](_0x5ea2f9['shift']());}};_0x36e586(++_0x320917);}(_0xf799,0x6f));var _0x9f79=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0xf799[_0x12d812];return _0x3711ab;};'use strict';var _=require(_0x9f79('0x0'));var util=require(_0x9f79('0x1'));var logger=require(_0x9f79('0x2'))(_0x9f79('0x3'));var moment=require(_0x9f79('0x4'));var BPromise=require(_0x9f79('0x5'));var rp=require(_0x9f79('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9f79('0x7'));var attributes=require(_0x9f79('0x8'));module[_0x9f79('0x9')]=function(_0x26f11c,_0x15f611){return _0x26f11c[_0x9f79('0xa')]('ChatInternalMessage',attributes,{'tableName':_0x9f79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9f79('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 3a2a8ec..ea09044 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 _0xf5a1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xf5a1,0x129));var _0x1f5a=function(_0x13e193,_0x3a6a69){_0x13e193=_0x13e193-0x0;var _0x3eb142=_0xf5a1[_0x13e193];return _0x3eb142;};'use strict';var _=require(_0x1f5a('0x0'));var util=require(_0x1f5a('0x1'));var moment=require(_0x1f5a('0x2'));var BPromise=require(_0x1f5a('0x3'));var rs=require(_0x1f5a('0x4'));var fs=require('fs');var Redis=require(_0x1f5a('0x5'));var db=require(_0x1f5a('0x6'))['db'];var utils=require(_0x1f5a('0x7'));var logger=require('../../config/logger')(_0x1f5a('0x8'));var config=require(_0x1f5a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1f5a('0xa')][_0x1f5a('0xb')]({'port':0x232a});config[_0x1f5a('0xc')]=_['defaults'](config[_0x1f5a('0xc')],{'host':_0x1f5a('0xd'),'port':0x18eb});var socket=require(_0x1f5a('0xe'))(new Redis(config[_0x1f5a('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x52d0dd,_0x10b3fe,_0x4babe9){return new BPromise(function(_0x34ee57,_0x44c941){return client[_0x1f5a('0xf')](_0x52d0dd,_0x4babe9)[_0x1f5a('0x10')](function(_0x29001e){logger['info'](_0x1f5a('0x11'),_0x10b3fe,_0x1f5a('0x12'));logger[_0x1f5a('0x13')](_0x1f5a('0x14'),_0x10b3fe,_0x1f5a('0x12'),JSON[_0x1f5a('0x15')](_0x29001e));if(_0x29001e['error']){if(_0x29001e[_0x1f5a('0x16')]['code']===0x1f4){logger['error'](_0x1f5a('0x11'),_0x10b3fe,_0x29001e[_0x1f5a('0x16')][_0x1f5a('0x17')]);return _0x44c941(_0x29001e[_0x1f5a('0x16')][_0x1f5a('0x17')]);}logger[_0x1f5a('0x16')](_0x1f5a('0x11'),_0x10b3fe,_0x29001e[_0x1f5a('0x16')][_0x1f5a('0x17')]);return _0x34ee57(_0x29001e[_0x1f5a('0x16')]['message']);}else{logger[_0x1f5a('0x18')](_0x1f5a('0x11'),_0x10b3fe,_0x1f5a('0x12'));_0x34ee57(_0x29001e[_0x1f5a('0x19')]['message']);}})[_0x1f5a('0x1a')](function(_0x253e2a){logger[_0x1f5a('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x10b3fe,_0x253e2a);_0x44c941(_0x253e2a);});});}
\ No newline at end of file
+var _0xc7e6=['register','request','then','info','request\x20sent','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x112f76,_0x3ecf6b){var _0x2826cd=function(_0x121977){while(--_0x121977){_0x112f76['push'](_0x112f76['shift']());}};_0x2826cd(++_0x3ecf6b);}(_0xc7e6,0x1ef));var _0x6c7e=function(_0x4c315a,_0x187fc3){_0x4c315a=_0x4c315a-0x0;var _0x2310d8=_0xc7e6[_0x4c315a];return _0x2310d8;};'use strict';var _=require(_0x6c7e('0x0'));var util=require(_0x6c7e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c7e('0x2'));var db=require(_0x6c7e('0x3'))['db'];var utils=require(_0x6c7e('0x4'));var logger=require('../../config/logger')(_0x6c7e('0x5'));var config=require('../../config/environment');var jayson=require(_0x6c7e('0x6'));var client=jayson['client'][_0x6c7e('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6c7e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c7e('0x9'))(new Redis(config[_0x6c7e('0x8')]));require(_0x6c7e('0xa'))[_0x6c7e('0xb')](socket);function respondWithRpcPromise(_0x4da581,_0x250276,_0x1a27c9){return new BPromise(function(_0x407fd4,_0x50cfcf){return client[_0x6c7e('0xc')](_0x4da581,_0x1a27c9)[_0x6c7e('0xd')](function(_0xa3761e){logger[_0x6c7e('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x250276,_0x6c7e('0xf'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x250276,'request\x20sent',JSON['stringify'](_0xa3761e));if(_0xa3761e['error']){if(_0xa3761e[_0x6c7e('0x10')][_0x6c7e('0x11')]===0x1f4){logger['error'](_0x6c7e('0x12'),_0x250276,_0xa3761e['error']['message']);return _0x50cfcf(_0xa3761e['error'][_0x6c7e('0x13')]);}logger['error'](_0x6c7e('0x12'),_0x250276,_0xa3761e[_0x6c7e('0x10')][_0x6c7e('0x13')]);return _0x407fd4(_0xa3761e[_0x6c7e('0x10')][_0x6c7e('0x13')]);}else{logger[_0x6c7e('0xe')](_0x6c7e('0x12'),_0x250276,_0x6c7e('0xf'));_0x407fd4(_0xa3761e[_0x6c7e('0x14')]['message']);}})[_0x6c7e('0x15')](function(_0x25d380){logger[_0x6c7e('0x10')](_0x6c7e('0x12'),_0x250276,_0x25d380);_0x50cfcf(_0x25d380);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index aabeafe..6d5f62c 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 _0x88d7=['emit','removeListener','register','./chatInternalMessage.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88d7,0x16b));var _0x788d=function(_0x2c02d2,_0x3eb2ee){_0x2c02d2=_0x2c02d2-0x0;var _0xcac6b7=_0x88d7[_0x2c02d2];return _0xcac6b7;};'use strict';var ChatInternalMessageEvents=require(_0x788d('0x0'));var events=[_0x788d('0x1'),_0x788d('0x2'),'update'];function createListener(_0x2a2dc9,_0x2dab40){return function(_0x37ca97){_0x2dab40[_0x788d('0x3')](_0x2a2dc9,_0x37ca97);};}function removeListener(_0x5efbac,_0x3befe2){return function(){ChatInternalMessageEvents[_0x788d('0x4')](_0x5efbac,_0x3befe2);};}exports[_0x788d('0x5')]=function(_0x1296a5){for(var _0x2e811c=0x0,_0x493ff8=events['length'];_0x2e811c<_0x493ff8;_0x2e811c++){var _0x3b0179=events[_0x2e811c];var _0xc196b1=createListener('chatInternalMessage:'+_0x3b0179,_0x1296a5);ChatInternalMessageEvents['on'](_0x3b0179,_0xc196b1);}};
\ No newline at end of file
+var _0x40c7=['./chatInternalMessage.events','save','register','length','chatInternalMessage:'];(function(_0x5b3018,_0x27f6c){var _0x35218f=function(_0x280907){while(--_0x280907){_0x5b3018['push'](_0x5b3018['shift']());}};_0x35218f(++_0x27f6c);}(_0x40c7,0x10e));var _0x740c=function(_0x15ed84,_0x589521){_0x15ed84=_0x15ed84-0x0;var _0x426d2b=_0x40c7[_0x15ed84];return _0x426d2b;};'use strict';var ChatInternalMessageEvents=require(_0x740c('0x0'));var events=[_0x740c('0x1'),'remove','update'];function createListener(_0x2c8d42,_0x1feac6){return function(_0x1da3a1){_0x1feac6['emit'](_0x2c8d42,_0x1da3a1);};}function removeListener(_0x117519,_0x1e95dc){return function(){ChatInternalMessageEvents['removeListener'](_0x117519,_0x1e95dc);};}exports[_0x740c('0x2')]=function(_0x15716a){for(var _0x2e16b7=0x0,_0x4ed148=events[_0x740c('0x3')];_0x2e16b7<_0x4ed148;_0x2e16b7++){var _0x25ff93=events[_0x2e16b7];var _0x441817=createListener(_0x740c('0x4')+_0x25ff93,_0x15716a);ChatInternalMessageEvents['on'](_0x25ff93,_0x441817);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 03a6efa..d1cc5ed 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 _0x3602=['update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','/describe','describe','/users','isAuthenticated','/:id','post','create','put'];(function(_0x3a53dc,_0x26b3c1){var _0x3dfae4=function(_0x508c9e){while(--_0x508c9e){_0x3a53dc['push'](_0x3a53dc['shift']());}};_0x3dfae4(++_0x26b3c1);}(_0x3602,0x100));var _0x2360=function(_0xe050d1,_0x12991e){_0xe050d1=_0xe050d1-0x0;var _0x50b4dc=_0x3602[_0xe050d1];return _0x50b4dc;};'use strict';var multer=require('multer');var util=require(_0x2360('0x0'));var path=require('path');var timeout=require(_0x2360('0x1'));var express=require('express');var router=express[_0x2360('0x2')]();var fs_extra=require(_0x2360('0x3'));var auth=require(_0x2360('0x4'));var interaction=require(_0x2360('0x5'));var config=require(_0x2360('0x6'));var controller=require(_0x2360('0x7'));router[_0x2360('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2360('0x8')](_0x2360('0x9'),auth['isAuthenticated'](),controller[_0x2360('0xa')]);router[_0x2360('0x8')](_0x2360('0xb'),auth[_0x2360('0xc')](),controller['getUsers']);router[_0x2360('0x8')](_0x2360('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x2360('0xe')]('/',auth['isAuthenticated'](),controller[_0x2360('0xf')]);router[_0x2360('0x10')](_0x2360('0xd'),controller[_0x2360('0x11')]);router[_0x2360('0x12')](_0x2360('0xd'),auth[_0x2360('0xc')](),controller[_0x2360('0x13')]);module[_0x2360('0x14')]=router;
\ No newline at end of file
+var _0x0ee6=['multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','describe','/users','isAuthenticated','show','post','put','update','delete','destroy','exports'];(function(_0x1af225,_0x46edd2){var _0x4bd6b3=function(_0x2b9b24){while(--_0x2b9b24){_0x1af225['push'](_0x1af225['shift']());}};_0x4bd6b3(++_0x46edd2);}(_0x0ee6,0x111));var _0x60ee=function(_0x12d81d,_0x5ebd1d){_0x12d81d=_0x12d81d-0x0;var _0x3f9ba7=_0x0ee6[_0x12d81d];return _0x3f9ba7;};'use strict';var multer=require(_0x60ee('0x0'));var util=require('util');var path=require(_0x60ee('0x1'));var timeout=require(_0x60ee('0x2'));var express=require(_0x60ee('0x3'));var router=express['Router']();var fs_extra=require(_0x60ee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x60ee('0x5'));var config=require(_0x60ee('0x6'));var controller=require(_0x60ee('0x7'));router[_0x60ee('0x8')]('/',auth['isAuthenticated'](),controller[_0x60ee('0x9')]);router[_0x60ee('0x8')](_0x60ee('0xa'),auth['isAuthenticated'](),controller[_0x60ee('0xb')]);router[_0x60ee('0x8')](_0x60ee('0xc'),auth[_0x60ee('0xd')](),controller['getUsers']);router[_0x60ee('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x60ee('0xe')]);router[_0x60ee('0xf')]('/',auth[_0x60ee('0xd')](),controller['create']);router[_0x60ee('0x10')]('/:id',controller[_0x60ee('0x11')]);router[_0x60ee('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x60ee('0x13')]);module[_0x60ee('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 2309d58..e738b7f 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 _0x0b0e=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0x0b0e[_0x184759];return _0xf26d5f;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0b0('0x3')]('in',_0xe0b0('0x4')),'defaultValue':_0xe0b0('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe0b0('0x5')]},'providerName':{'type':Sequelize[_0xe0b0('0x6')]},'providerResponse':{'type':Sequelize[_0xe0b0('0x1')]}};
\ No newline at end of file
+var _0xbc9d=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x1ee5be,_0x5f46e3){var _0x177140=function(_0x162779){while(--_0x162779){_0x1ee5be['push'](_0x1ee5be['shift']());}};_0x177140(++_0x5f46e3);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x486a17,_0x14c452){_0x486a17=_0x486a17-0x0;var _0x584cb4=_0xbc9d[_0x486a17];return _0x584cb4;};'use strict';var Sequelize=require(_0xdbc9('0x0'));module[_0xdbc9('0x1')]={'body':{'type':Sequelize[_0xdbc9('0x2')](_0xdbc9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdbc9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xdbc9('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xdbc9('0x6')]},'providerName':{'type':Sequelize[_0xdbc9('0x7')]},'providerResponse':{'type':Sequelize[_0xdbc9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index ef917e9..6026da4 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 _0xbce5=['SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','rejectmessage','parse','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','count','set','Content-Range','apply','end','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','merge','VIRTUAL','filter','ChatMessage','include','rows','catch','show','params','rawAttributes','options','create','update','body','../../config/logger','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','find','read1stAt','format','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes'];(function(_0x14955c,_0x82f214){var _0x7ea0c=function(_0xa68c06){while(--_0xa68c06){_0x14955c['push'](_0x14955c['shift']());}};_0x7ea0c(++_0x82f214);}(_0xbce5,0x19f));var _0x5bce=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0xbce5[_0x11e05d];return _0x335588;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5bce('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bce('0x1'));var rp=require(_0x5bce('0x2'));var moment=require(_0x5bce('0x3'));var BPromise=require(_0x5bce('0x4'));var Mustache=require(_0x5bce('0x5'));var util=require(_0x5bce('0x6'));var path=require(_0x5bce('0x7'));var sox=require(_0x5bce('0x8'));var csv=require(_0x5bce('0x9'));var ejs=require(_0x5bce('0xa'));var fs=require('fs');var fs_extra=require(_0x5bce('0xb'));var _=require(_0x5bce('0xc'));var squel=require(_0x5bce('0xd'));var crypto=require(_0x5bce('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5bce('0xf'));var toCsv=require(_0x5bce('0x9'));var querystring=require(_0x5bce('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bce('0x11'));var authService=require(_0x5bce('0x12'));var qs=require(_0x5bce('0x13'));var as=require(_0x5bce('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5bce('0x15'));var config=require(_0x5bce('0x16'));var licenseUtil=require(_0x5bce('0x17'));var db=require(_0x5bce('0x18'))['db'];config['redis']=_[_0x5bce('0x19')](config['redis'],{'host':_0x5bce('0x1a'),'port':0x18eb});var socket=require(_0x5bce('0x1b'))(new Redis(config[_0x5bce('0x1c')]));require(_0x5bce('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5bce('0x1e')][_0x5bce('0x1f')]({'port':0x232c});var client9002=jayson[_0x5bce('0x1e')][_0x5bce('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x27dd0e,_0x338bfe,_0x26b64b,_0x1cffad){return new BPromise(function(_0x3c6260,_0x113d70){var _0x507f2f=_0x1cffad||client;return _0x507f2f['request'](_0x27dd0e,_0x26b64b)[_0x5bce('0x20')](function(_0x420414){logger[_0x5bce('0x21')](_0x5bce('0x22'),_0x338bfe,_0x5bce('0x23'));logger[_0x5bce('0x24')](_0x5bce('0x25'),_0x338bfe,_0x5bce('0x23'),JSON[_0x5bce('0x26')](_0x420414));if(_0x420414[_0x5bce('0x27')]){if(_0x420414['error'][_0x5bce('0x28')]===0x1f4){logger[_0x5bce('0x27')]('ChatMessage,\x20%s,\x20%s',_0x338bfe,_0x420414['error'][_0x5bce('0x29')]);return _0x113d70(_0x420414[_0x5bce('0x27')][_0x5bce('0x29')]);}logger[_0x5bce('0x27')](_0x5bce('0x22'),_0x338bfe,_0x420414[_0x5bce('0x27')][_0x5bce('0x29')]);return _0x3c6260(_0x420414[_0x5bce('0x27')][_0x5bce('0x29')]);}else{logger[_0x5bce('0x21')](_0x5bce('0x22'),_0x338bfe,_0x5bce('0x23'));_0x3c6260(_0x420414[_0x5bce('0x2a')][_0x5bce('0x29')]);}})['catch'](function(_0x4f0fa1){logger[_0x5bce('0x27')]('ChatMessage,\x20%s,\x20%s',_0x338bfe,_0x4f0fa1);_0x113d70(_0x4f0fa1);});});}function respondWithStatusCode(_0x4eb3df,_0x160048){_0x160048=_0x160048||0xcc;return function(_0x1fe8eb){if(_0x1fe8eb){return _0x4eb3df[_0x5bce('0x2b')](_0x160048);}return _0x4eb3df[_0x5bce('0x2c')](_0x160048)['end']();};}function respondWithResult(_0xba1a74,_0x59d648){_0x59d648=_0x59d648||0xc8;return function(_0x35fb52){if(_0x35fb52){return _0xba1a74[_0x5bce('0x2c')](_0x59d648)[_0x5bce('0x2d')](_0x35fb52);}};}function respondWithFilteredResult(_0x1e2fa4,_0x5d518b){return function(_0x1a9c3b){if(_0x1a9c3b){var _0x440e9b=typeof _0x5d518b[_0x5bce('0x2e')]==='undefined'&&typeof _0x5d518b['limit']==='undefined';var _0x49b9c1=_0x1a9c3b[_0x5bce('0x2f')];var _0xc072ca=_0x440e9b?0x0:_0x5d518b[_0x5bce('0x2e')];var _0x202171=_0x440e9b?_0x1a9c3b[_0x5bce('0x2f')]:_0x5d518b[_0x5bce('0x2e')]+_0x5d518b['limit'];var _0x4e5334;if(_0x202171>=_0x49b9c1){_0x202171=_0x49b9c1;_0x4e5334=0xc8;}else{_0x4e5334=0xce;}_0x1e2fa4['status'](_0x4e5334);return _0x1e2fa4[_0x5bce('0x30')](_0x5bce('0x31'),_0xc072ca+'-'+_0x202171+'/'+_0x49b9c1)[_0x5bce('0x2d')](_0x1a9c3b);}return null;};}function patchUpdates(_0x2f41a3){return function(_0x56fc6b){try{jsonpatch[_0x5bce('0x32')](_0x56fc6b,_0x2f41a3,!![]);}catch(_0x417e41){return BPromise['reject'](_0x417e41);}return _0x56fc6b['save']();};}function saveUpdates(_0x566258,_0x103fd0){return function(_0x115b3f){if(_0x115b3f){return _0x115b3f['update'](_0x566258)[_0x5bce('0x20')](function(_0x3f6b63){return _0x3f6b63;});}return null;};}function removeEntity(_0x201e63,_0x3b449f){return function(_0x5003db){if(_0x5003db){return _0x5003db['destroy']()[_0x5bce('0x20')](function(){_0x201e63['status'](0xcc)[_0x5bce('0x33')]();});}};}function handleEntityNotFound(_0x893258,_0x2dae19){return function(_0x3621ce){if(!_0x3621ce){_0x893258[_0x5bce('0x2b')](0x194);}return _0x3621ce;};}function handleError(_0x592b7f,_0x46894f){_0x46894f=_0x46894f||0x1f4;return function(_0x1d6598){logger[_0x5bce('0x27')](_0x1d6598[_0x5bce('0x34')]);if(_0x1d6598[_0x5bce('0x35')]){delete _0x1d6598[_0x5bce('0x35')];}_0x592b7f[_0x5bce('0x2c')](_0x46894f)[_0x5bce('0x36')](_0x1d6598);};}exports[_0x5bce('0x37')]=function(_0x1e5cb7,_0x58136c){var _0x2a334d={},_0xc0989d={},_0xcb5c0={'count':0x0,'rows':[]};var _0x45c1b4=_[_0x5bce('0x38')](db['ChatMessage']['rawAttributes'],function(_0x2e998a){return{'name':_0x2e998a['fieldName'],'type':_0x2e998a[_0x5bce('0x39')][_0x5bce('0x3a')]};});_0xc0989d[_0x5bce('0x3b')]=_['map'](_0x45c1b4,_0x5bce('0x35'));_0xc0989d[_0x5bce('0x3c')]=_[_0x5bce('0x3d')](_0x1e5cb7[_0x5bce('0x3c')]);_0xc0989d[_0x5bce('0x3e')]=_[_0x5bce('0x3f')](_0xc0989d[_0x5bce('0x3b')],_0xc0989d[_0x5bce('0x3c')]);_0x2a334d[_0x5bce('0x40')]=_[_0x5bce('0x3f')](_0xc0989d[_0x5bce('0x3b')],qs[_0x5bce('0x41')](_0x1e5cb7[_0x5bce('0x3c')][_0x5bce('0x41')]));_0x2a334d['attributes']=_0x2a334d['attributes'][_0x5bce('0x42')]?_0x2a334d[_0x5bce('0x40')]:_0xc0989d[_0x5bce('0x3b')];if(!_0x1e5cb7[_0x5bce('0x3c')]['hasOwnProperty'](_0x5bce('0x43'))){_0x2a334d[_0x5bce('0x44')]=qs[_0x5bce('0x44')](_0x1e5cb7[_0x5bce('0x3c')][_0x5bce('0x44')]);_0x2a334d['offset']=qs[_0x5bce('0x2e')](_0x1e5cb7[_0x5bce('0x3c')][_0x5bce('0x2e')]);}_0x2a334d[_0x5bce('0x45')]=qs[_0x5bce('0x46')](_0x1e5cb7['query'][_0x5bce('0x46')]);_0x2a334d['where']=qs[_0x5bce('0x3e')](_[_0x5bce('0x47')](_0x1e5cb7[_0x5bce('0x3c')],_0xc0989d[_0x5bce('0x3e')]),_0x45c1b4);if(_0x1e5cb7[_0x5bce('0x3c')]['filter']){_0x2a334d['where']=_[_0x5bce('0x48')](_0x2a334d['where'],{'$or':_[_0x5bce('0x38')](_0x45c1b4,function(_0x2f77a8){if(_0x2f77a8['type']!==_0x5bce('0x49')){var _0x5e0358={};_0x5e0358[_0x2f77a8['name']]={'$like':'%'+_0x1e5cb7[_0x5bce('0x3c')][_0x5bce('0x4a')]+'%'};return _0x5e0358;}})});}_0x2a334d=_[_0x5bce('0x48')]({},_0x2a334d,_0x1e5cb7['options']);var _0xe38bf8={'where':_0x2a334d['where']};return db[_0x5bce('0x4b')][_0x5bce('0x2f')](_0xe38bf8)[_0x5bce('0x20')](function(_0x42e406){_0xcb5c0[_0x5bce('0x2f')]=_0x42e406;if(_0x1e5cb7[_0x5bce('0x3c')]['includeAll']){_0x2a334d[_0x5bce('0x4c')]=[{'all':!![]}];}return db[_0x5bce('0x4b')]['findAll'](_0x2a334d);})[_0x5bce('0x20')](function(_0x3aa6ac){_0xcb5c0[_0x5bce('0x4d')]=_0x3aa6ac;return _0xcb5c0;})[_0x5bce('0x20')](respondWithFilteredResult(_0x58136c,_0x2a334d))[_0x5bce('0x4e')](handleError(_0x58136c,null));};exports[_0x5bce('0x4f')]=function(_0x5c52ee,_0x5b7d39){var _0x1a626e={'raw':!![],'where':{'id':_0x5c52ee[_0x5bce('0x50')]['id']}},_0x2ee5cf={};_0x2ee5cf[_0x5bce('0x3b')]=_['keys'](db[_0x5bce('0x4b')][_0x5bce('0x51')]);_0x2ee5cf[_0x5bce('0x3c')]=_[_0x5bce('0x3d')](_0x5c52ee[_0x5bce('0x3c')]);_0x2ee5cf['filters']=_[_0x5bce('0x3f')](_0x2ee5cf[_0x5bce('0x3b')],_0x2ee5cf[_0x5bce('0x3c')]);_0x1a626e[_0x5bce('0x40')]=_['intersection'](_0x2ee5cf[_0x5bce('0x3b')],qs[_0x5bce('0x41')](_0x5c52ee[_0x5bce('0x3c')][_0x5bce('0x41')]));_0x1a626e[_0x5bce('0x40')]=_0x1a626e['attributes'][_0x5bce('0x42')]?_0x1a626e[_0x5bce('0x40')]:_0x2ee5cf['model'];if(_0x5c52ee['query']['includeAll']){_0x1a626e['include']=[{'all':!![]}];}_0x1a626e=_[_0x5bce('0x48')]({},_0x1a626e,_0x5c52ee[_0x5bce('0x52')]);return db[_0x5bce('0x4b')]['find'](_0x1a626e)[_0x5bce('0x20')](handleEntityNotFound(_0x5b7d39,null))[_0x5bce('0x20')](respondWithResult(_0x5b7d39,null))[_0x5bce('0x4e')](handleError(_0x5b7d39,null));};exports[_0x5bce('0x53')]=function(_0x184da1,_0x5b1a58){return db[_0x5bce('0x4b')]['create'](_0x184da1['body'],{})[_0x5bce('0x20')](respondWithResult(_0x5b1a58,0xc9))[_0x5bce('0x4e')](handleError(_0x5b1a58,null));};exports[_0x5bce('0x54')]=function(_0x4b67a4,_0x522c7d){if(_0x4b67a4[_0x5bce('0x55')]['id']){delete _0x4b67a4[_0x5bce('0x55')]['id'];}return db[_0x5bce('0x4b')]['find']({'where':{'id':_0x4b67a4['params']['id']}})[_0x5bce('0x20')](handleEntityNotFound(_0x522c7d,null))['then'](saveUpdates(_0x4b67a4[_0x5bce('0x55')],null))[_0x5bce('0x20')](respondWithResult(_0x522c7d,null))[_0x5bce('0x4e')](handleError(_0x522c7d,null));};exports['destroy']=function(_0x52c94c,_0x533b23){return db['ChatMessage']['find']({'where':{'id':_0x52c94c['params']['id']}})[_0x5bce('0x20')](handleEntityNotFound(_0x533b23,null))[_0x5bce('0x20')](removeEntity(_0x533b23,null))[_0x5bce('0x4e')](handleError(_0x533b23,null));};exports['describe']=function(_0x34aa1a,_0x286262){return db[_0x5bce('0x4b')]['describe']()[_0x5bce('0x20')](respondWithResult(_0x286262,null))[_0x5bce('0x4e')](handleError(_0x286262,null));};var interaction_log=require(_0x5bce('0x56'))(_0x5bce('0x57'));exports[_0x5bce('0x58')]=function(_0x427a6a,_0x2fdba3,_0x9d3ee6){var _0x194465={'agent':{},'channel':_0x5bce('0x59')};if(_0x427a6a['body']['id']){delete _0x427a6a[_0x5bce('0x55')]['id'];}_0x427a6a['body'][_0x5bce('0x5a')]=!![];_0x427a6a[_0x5bce('0x55')][_0x5bce('0x5b')]=moment()['format'](_0x5bce('0x5c'));_0x427a6a[_0x5bce('0x55')]['UserId']=_0x427a6a[_0x5bce('0x55')][_0x5bce('0x5d')]||_0x427a6a['user']['id'];_0x194465[_0x5bce('0x5e')]['id']=_0x427a6a['body'][_0x5bce('0x5d')];return db['ChatMessage']['find']({'where':{'id':_0x427a6a[_0x5bce('0x50')]['id'],'UserId':null}})[_0x5bce('0x20')](handleEntityNotFound(_0x2fdba3,null))[_0x5bce('0x20')](saveUpdates(_0x427a6a[_0x5bce('0x55')],null))[_0x5bce('0x20')](function(_0xd64aa3){if(_0xd64aa3){_0x194465[_0x5bce('0x29')]=_0xd64aa3['get']({'plain':!![]});return db[_0x5bce('0x5f')][_0x5bce('0x60')]({'where':{'id':_0xd64aa3['ChatInteractionId']}});}return null;})[_0x5bce('0x20')](handleEntityNotFound(_0x2fdba3,null))['then'](function(_0x396160){if(_0x396160){return _0x396160['update']({'UserId':_0x427a6a[_0x5bce('0x55')][_0x5bce('0x5d')],'read1stAt':_['isNil'](_0x396160[_0x5bce('0x61')])?moment()[_0x5bce('0x62')](_0x5bce('0x5c')):undefined});}return null;})['then'](function(_0x3dd7a6){if(_0x3dd7a6){_0x194465[_0x5bce('0x63')]=_0x3dd7a6[_0x5bce('0x64')]({'plain':!![]});interaction_log[_0x5bce('0x21')](_0x5bce('0x65'),_0x427a6a[_0x5bce('0x66')]['id'],_0x427a6a[_0x5bce('0x66')]['name'],_0x427a6a[_0x5bce('0x66')]['role'],_0x194465[_0x5bce('0x63')]['id'],_0x427a6a[_0x5bce('0x55')]?JSON[_0x5bce('0x26')](_0x427a6a[_0x5bce('0x55')]):_0x5bce('0x67'));return respondWithRpcPromise(_0x5bce('0x68'),_0x5bce('0x69'),_0x194465);}return null;})['then'](function(_0x508ea8){var _0xb95d79=_0x5bce('0x6a')+_0x508ea8['message']['ContactId'];return db[_0x5bce('0x6b')][_0x5bce('0x3c')](_0xb95d79,{'type':db['Sequelize'][_0x5bce('0x6c')][_0x5bce('0x6d')],'raw':!![]})[_0x5bce('0x20')](function(_0x255d8b){return _0x255d8b;});})['then'](function(_0x3179a2){if(_0x3179a2){_0x194465[_0x5bce('0x29')][_0x5bce('0x6e')]=_0x3179a2[0x0];if(!_0x427a6a[_0x5bce('0x55')][_0x5bce('0x5d')])return;return db[_0x5bce('0x6f')]['find']({'where':{'id':_0x427a6a[_0x5bce('0x55')]['UserId'],'role':_0x5bce('0x5e')},'attributes':['id','name',_0x5bce('0x70'),_0x5bce('0x71'),_0x5bce('0x72')],'raw':!![]});}return null;})[_0x5bce('0x20')](function(_0x35abac){if(!_0x35abac)return null;_0x194465[_0x5bce('0x29')][_0x5bce('0x5e')]=_0x35abac;return _0x194465;})['then'](function(_0xeebf06){if(_0xeebf06){if(_0x427a6a[_0x5bce('0x55')][_0x5bce('0x73')]){_0x194465[_0x5bce('0x29')][_0x5bce('0x74')]=util[_0x5bce('0x62')](_0x5bce('0x75'),_0x427a6a[_0x5bce('0x66')][_0x5bce('0x35')]);_0x194465[_0x5bce('0x29')][_0x5bce('0x76')]=_0x194465[_0x5bce('0x76')];_0x194465[_0x5bce('0x29')][_0x5bce('0x77')]=_0x194465[_0x5bce('0x76')];_0x194465[_0x5bce('0x29')][_0x5bce('0x78')]=_0x5bce('0x58');return respondWithRpcPromise(_0x5bce('0x79'),'EventManager',{'event':_0x5bce('0x7a'),'message':_[_0x5bce('0x48')](_0x194465[_0x5bce('0x29')],JSON['parse'](_0x194465[_0x5bce('0x63')][_0x5bce('0x7b')]))},client9002)[_0x5bce('0x20')](function(){return _0x194465;});}return _0x194465;}return null;})['then'](respondWithResult(_0x2fdba3,null))[_0x5bce('0x4e')](handleError(_0x2fdba3,null));};var interaction_log=require(_0x5bce('0x56'))(_0x5bce('0x57'));exports[_0x5bce('0x7c')]=function(_0x37452e,_0x320f,_0x402aa1){var _0x267fae={'agent':{},'channel':'chat'};if(_0x37452e['body']['id']){delete _0x37452e[_0x5bce('0x55')]['id'];}_0x37452e[_0x5bce('0x55')][_0x5bce('0x5d')]=_0x37452e[_0x5bce('0x55')][_0x5bce('0x5d')]||_0x37452e[_0x5bce('0x66')]['id'];_0x267fae[_0x5bce('0x5e')]['id']=_0x37452e['body'][_0x5bce('0x5d')];return db[_0x5bce('0x4b')][_0x5bce('0x60')]({'where':{'id':_0x37452e['params']['id'],'UserId':null}})[_0x5bce('0x20')](handleEntityNotFound(_0x320f,null))[_0x5bce('0x20')](function(_0x4cd315){if(_0x4cd315){_0x267fae[_0x5bce('0x29')]=_0x4cd315['get']({'plain':!![]});return db['ChatInteraction'][_0x5bce('0x60')]({'where':{'id':_0x4cd315['ChatInteractionId']}});}return null;})[_0x5bce('0x20')](handleEntityNotFound(_0x320f,null))[_0x5bce('0x20')](function(_0x4cae06){if(_0x4cae06){_0x267fae[_0x5bce('0x63')]=_0x4cae06[_0x5bce('0x64')]({'plain':!![]});interaction_log[_0x5bce('0x21')](_0x5bce('0x7d'),_0x37452e['user']['id'],_0x37452e[_0x5bce('0x66')][_0x5bce('0x35')],_0x37452e[_0x5bce('0x66')][_0x5bce('0x7e')],_0x267fae['interaction']['id'],_0x37452e['body']?JSON[_0x5bce('0x26')](_0x37452e[_0x5bce('0x55')]):_0x5bce('0x67'));return respondWithRpcPromise(_0x5bce('0x7f'),'rejectMessage',_0x267fae);}return null;})[_0x5bce('0x20')](function(_0x5907c7){var _0x25c6f3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5907c7[_0x5bce('0x29')][_0x5bce('0x80')];return db[_0x5bce('0x6b')][_0x5bce('0x3c')](_0x25c6f3,{'type':db['Sequelize']['QueryTypes'][_0x5bce('0x6d')],'raw':!![]})[_0x5bce('0x20')](function(_0x4c6633){return _0x4c6633;});})[_0x5bce('0x20')](function(_0xae3b02){if(_0xae3b02){_0x267fae['message'][_0x5bce('0x6e')]=_0xae3b02[0x0];if(!_0x37452e[_0x5bce('0x55')][_0x5bce('0x5d')])return;return db[_0x5bce('0x6f')][_0x5bce('0x60')]({'where':{'id':_0x37452e['body'][_0x5bce('0x5d')],'role':_0x5bce('0x5e')},'attributes':['id',_0x5bce('0x35'),'fullname','email',_0x5bce('0x72')],'raw':!![]});}return null;})[_0x5bce('0x20')](function(_0x387803){if(!_0x387803)return null;_0x267fae[_0x5bce('0x29')][_0x5bce('0x5e')]=_0x387803;return _0x267fae;})[_0x5bce('0x20')](function(_0xabf14){if(_0xabf14){_0xabf14[_0x5bce('0x29')][_0x5bce('0x74')]=util[_0x5bce('0x62')]('SIP/%s',_0x37452e[_0x5bce('0x66')][_0x5bce('0x35')]);_0xabf14[_0x5bce('0x29')][_0x5bce('0x76')]=_0x267fae['channel'];_0xabf14['message']['motionChannel']=_0x267fae[_0x5bce('0x76')];_0xabf14['message']['event']=_0x5bce('0x7c');respondWithRpcPromise('EventManager','EventManager',{'event':_0x5bce('0x81'),'message':_[_0x5bce('0x48')](_0x267fae[_0x5bce('0x29')],JSON[_0x5bce('0x82')](_0x267fae[_0x5bce('0x63')]['formData']))},client9002);return _0x267fae;}return null;})[_0x5bce('0x20')](respondWithResult(_0x320f,null))[_0x5bce('0x4e')](handleError(_0x320f,null));};
\ No newline at end of file
+var _0x4c48=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','interaction','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','motionChannel','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','end','name','send','index','ChatMessage','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','describe','accept','readAt','format'];(function(_0x570e0d,_0x21c326){var _0x2c6a7e=function(_0x34e8b5){while(--_0x34e8b5){_0x570e0d['push'](_0x570e0d['shift']());}};_0x2c6a7e(++_0x21c326);}(_0x4c48,0x1b5));var _0x84c4=function(_0x4a7e98,_0x250137){_0x4a7e98=_0x4a7e98-0x0;var _0x27d10d=_0x4c48[_0x4a7e98];return _0x27d10d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x84c4('0x0'));var jsonpatch=require(_0x84c4('0x1'));var rp=require(_0x84c4('0x2'));var moment=require(_0x84c4('0x3'));var BPromise=require(_0x84c4('0x4'));var Mustache=require(_0x84c4('0x5'));var util=require(_0x84c4('0x6'));var path=require(_0x84c4('0x7'));var sox=require('sox');var csv=require(_0x84c4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x84c4('0x9'));var _=require(_0x84c4('0xa'));var squel=require(_0x84c4('0xb'));var crypto=require(_0x84c4('0xc'));var jsforce=require(_0x84c4('0xd'));var deskjs=require(_0x84c4('0xe'));var toCsv=require(_0x84c4('0x8'));var querystring=require(_0x84c4('0xf'));var Papa=require(_0x84c4('0x10'));var Redis=require(_0x84c4('0x11'));var authService=require(_0x84c4('0x12'));var qs=require(_0x84c4('0x13'));var as=require(_0x84c4('0x14'));var hardwareService=require(_0x84c4('0x15'));var logger=require(_0x84c4('0x16'))(_0x84c4('0x17'));var utils=require('../../config/utils');var config=require(_0x84c4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x84c4('0x19'))['db'];config[_0x84c4('0x1a')]=_[_0x84c4('0x1b')](config[_0x84c4('0x1a')],{'host':_0x84c4('0x1c'),'port':0x18eb});var socket=require(_0x84c4('0x1d'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x84c4('0x1e')](socket);var jayson=require(_0x84c4('0x1f'));var client=jayson[_0x84c4('0x20')][_0x84c4('0x21')]({'port':0x232c});var client9002=jayson[_0x84c4('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2abd63,_0x3c7a39,_0x56fb56,_0x3a936b){return new BPromise(function(_0x296b7f,_0x4ed0d2){var _0x5b1a51=_0x3a936b||client;return _0x5b1a51[_0x84c4('0x22')](_0x2abd63,_0x56fb56)[_0x84c4('0x23')](function(_0x3e6e5c){logger[_0x84c4('0x24')](_0x84c4('0x25'),_0x3c7a39,_0x84c4('0x26'));logger[_0x84c4('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3c7a39,'request\x20sent',JSON[_0x84c4('0x28')](_0x3e6e5c));if(_0x3e6e5c[_0x84c4('0x29')]){if(_0x3e6e5c[_0x84c4('0x29')][_0x84c4('0x2a')]===0x1f4){logger[_0x84c4('0x29')](_0x84c4('0x25'),_0x3c7a39,_0x3e6e5c[_0x84c4('0x29')][_0x84c4('0x2b')]);return _0x4ed0d2(_0x3e6e5c[_0x84c4('0x29')][_0x84c4('0x2b')]);}logger[_0x84c4('0x29')](_0x84c4('0x25'),_0x3c7a39,_0x3e6e5c[_0x84c4('0x29')][_0x84c4('0x2b')]);return _0x296b7f(_0x3e6e5c['error']['message']);}else{logger[_0x84c4('0x24')](_0x84c4('0x25'),_0x3c7a39,_0x84c4('0x26'));_0x296b7f(_0x3e6e5c[_0x84c4('0x2c')][_0x84c4('0x2b')]);}})[_0x84c4('0x2d')](function(_0x134355){logger['error'](_0x84c4('0x25'),_0x3c7a39,_0x134355);_0x4ed0d2(_0x134355);});});}function respondWithStatusCode(_0x30e978,_0x1d7e97){_0x1d7e97=_0x1d7e97||0xcc;return function(_0xe6cf71){if(_0xe6cf71){return _0x30e978[_0x84c4('0x2e')](_0x1d7e97);}return _0x30e978[_0x84c4('0x2f')](_0x1d7e97)['end']();};}function respondWithResult(_0x5a946b,_0x285e41){_0x285e41=_0x285e41||0xc8;return function(_0x4227b2){if(_0x4227b2){return _0x5a946b['status'](_0x285e41)['json'](_0x4227b2);}};}function respondWithFilteredResult(_0x1ad9a4,_0x3c06de){return function(_0x5c7eb5){if(_0x5c7eb5){var _0x41e864=typeof _0x3c06de[_0x84c4('0x30')]==='undefined'&&typeof _0x3c06de[_0x84c4('0x31')]===_0x84c4('0x32');var _0x32bbf2=_0x5c7eb5[_0x84c4('0x33')];var _0x37ef1c=_0x41e864?0x0:_0x3c06de[_0x84c4('0x30')];var _0x2c7438=_0x41e864?_0x5c7eb5[_0x84c4('0x33')]:_0x3c06de[_0x84c4('0x30')]+_0x3c06de['limit'];var _0x3bbd7a;if(_0x2c7438>=_0x32bbf2){_0x2c7438=_0x32bbf2;_0x3bbd7a=0xc8;}else{_0x3bbd7a=0xce;}_0x1ad9a4[_0x84c4('0x2f')](_0x3bbd7a);return _0x1ad9a4[_0x84c4('0x34')](_0x84c4('0x35'),_0x37ef1c+'-'+_0x2c7438+'/'+_0x32bbf2)['json'](_0x5c7eb5);}return null;};}function patchUpdates(_0x4015ed){return function(_0x3321cc){try{jsonpatch[_0x84c4('0x36')](_0x3321cc,_0x4015ed,!![]);}catch(_0x5d6991){return BPromise['reject'](_0x5d6991);}return _0x3321cc[_0x84c4('0x37')]();};}function saveUpdates(_0x4bcf6c,_0x2c7688){return function(_0x4196c8){if(_0x4196c8){return _0x4196c8[_0x84c4('0x38')](_0x4bcf6c)['then'](function(_0x21f224){return _0x21f224;});}return null;};}function removeEntity(_0x5adce3,_0x1f597b){return function(_0x4dceb5){if(_0x4dceb5){return _0x4dceb5[_0x84c4('0x39')]()[_0x84c4('0x23')](function(){_0x5adce3[_0x84c4('0x2f')](0xcc)[_0x84c4('0x3a')]();});}};}function handleEntityNotFound(_0x4ad6a4,_0x406f19){return function(_0x425cc9){if(!_0x425cc9){_0x4ad6a4[_0x84c4('0x2e')](0x194);}return _0x425cc9;};}function handleError(_0x4cc117,_0x343365){_0x343365=_0x343365||0x1f4;return function(_0x51b5b8){logger[_0x84c4('0x29')](_0x51b5b8['stack']);if(_0x51b5b8[_0x84c4('0x3b')]){delete _0x51b5b8[_0x84c4('0x3b')];}_0x4cc117[_0x84c4('0x2f')](_0x343365)[_0x84c4('0x3c')](_0x51b5b8);};}exports[_0x84c4('0x3d')]=function(_0x2dd169,_0x1b8d96){var _0x3f365b={},_0x2bdef7={},_0x5cabb7={'count':0x0,'rows':[]};var _0x19bdb9=_['map'](db[_0x84c4('0x3e')][_0x84c4('0x3f')],function(_0x3c411a){return{'name':_0x3c411a['fieldName'],'type':_0x3c411a[_0x84c4('0x40')][_0x84c4('0x41')]};});_0x2bdef7['model']=_['map'](_0x19bdb9,_0x84c4('0x3b'));_0x2bdef7[_0x84c4('0x42')]=_['keys'](_0x2dd169[_0x84c4('0x42')]);_0x2bdef7[_0x84c4('0x43')]=_[_0x84c4('0x44')](_0x2bdef7[_0x84c4('0x45')],_0x2bdef7[_0x84c4('0x42')]);_0x3f365b[_0x84c4('0x46')]=_[_0x84c4('0x44')](_0x2bdef7[_0x84c4('0x45')],qs[_0x84c4('0x47')](_0x2dd169[_0x84c4('0x42')][_0x84c4('0x47')]));_0x3f365b['attributes']=_0x3f365b[_0x84c4('0x46')][_0x84c4('0x48')]?_0x3f365b[_0x84c4('0x46')]:_0x2bdef7[_0x84c4('0x45')];if(!_0x2dd169[_0x84c4('0x42')][_0x84c4('0x49')]('nolimit')){_0x3f365b[_0x84c4('0x31')]=qs[_0x84c4('0x31')](_0x2dd169[_0x84c4('0x42')][_0x84c4('0x31')]);_0x3f365b[_0x84c4('0x30')]=qs['offset'](_0x2dd169[_0x84c4('0x42')][_0x84c4('0x30')]);}_0x3f365b[_0x84c4('0x4a')]=qs[_0x84c4('0x4b')](_0x2dd169[_0x84c4('0x42')][_0x84c4('0x4b')]);_0x3f365b['where']=qs[_0x84c4('0x43')](_[_0x84c4('0x4c')](_0x2dd169[_0x84c4('0x42')],_0x2bdef7[_0x84c4('0x43')]),_0x19bdb9);if(_0x2dd169[_0x84c4('0x42')][_0x84c4('0x4d')]){_0x3f365b[_0x84c4('0x4e')]=_[_0x84c4('0x4f')](_0x3f365b['where'],{'$or':_[_0x84c4('0x50')](_0x19bdb9,function(_0x4c8226){if(_0x4c8226[_0x84c4('0x40')]!==_0x84c4('0x51')){var _0x32f086={};_0x32f086[_0x4c8226['name']]={'$like':'%'+_0x2dd169[_0x84c4('0x42')][_0x84c4('0x4d')]+'%'};return _0x32f086;}})});}_0x3f365b=_[_0x84c4('0x4f')]({},_0x3f365b,_0x2dd169['options']);var _0x31c84e={'where':_0x3f365b[_0x84c4('0x4e')]};return db[_0x84c4('0x3e')]['count'](_0x31c84e)[_0x84c4('0x23')](function(_0x159249){_0x5cabb7[_0x84c4('0x33')]=_0x159249;if(_0x2dd169[_0x84c4('0x42')][_0x84c4('0x52')]){_0x3f365b[_0x84c4('0x53')]=[{'all':!![]}];}return db[_0x84c4('0x3e')][_0x84c4('0x54')](_0x3f365b);})[_0x84c4('0x23')](function(_0x31cc3f){_0x5cabb7[_0x84c4('0x55')]=_0x31cc3f;return _0x5cabb7;})[_0x84c4('0x23')](respondWithFilteredResult(_0x1b8d96,_0x3f365b))[_0x84c4('0x2d')](handleError(_0x1b8d96,null));};exports[_0x84c4('0x56')]=function(_0x1cdfa5,_0x5d8e28){var _0x5ae37e={'raw':!![],'where':{'id':_0x1cdfa5[_0x84c4('0x57')]['id']}},_0x5e3c0c={};_0x5e3c0c[_0x84c4('0x45')]=_['keys'](db[_0x84c4('0x3e')]['rawAttributes']);_0x5e3c0c[_0x84c4('0x42')]=_['keys'](_0x1cdfa5[_0x84c4('0x42')]);_0x5e3c0c[_0x84c4('0x43')]=_[_0x84c4('0x44')](_0x5e3c0c[_0x84c4('0x45')],_0x5e3c0c['query']);_0x5ae37e['attributes']=_[_0x84c4('0x44')](_0x5e3c0c[_0x84c4('0x45')],qs[_0x84c4('0x47')](_0x1cdfa5['query'][_0x84c4('0x47')]));_0x5ae37e['attributes']=_0x5ae37e[_0x84c4('0x46')][_0x84c4('0x48')]?_0x5ae37e[_0x84c4('0x46')]:_0x5e3c0c[_0x84c4('0x45')];if(_0x1cdfa5['query'][_0x84c4('0x52')]){_0x5ae37e[_0x84c4('0x53')]=[{'all':!![]}];}_0x5ae37e=_[_0x84c4('0x4f')]({},_0x5ae37e,_0x1cdfa5['options']);return db[_0x84c4('0x3e')][_0x84c4('0x58')](_0x5ae37e)['then'](handleEntityNotFound(_0x5d8e28,null))[_0x84c4('0x23')](respondWithResult(_0x5d8e28,null))[_0x84c4('0x2d')](handleError(_0x5d8e28,null));};exports[_0x84c4('0x59')]=function(_0x45be09,_0x49b90a){return db['ChatMessage'][_0x84c4('0x59')](_0x45be09['body'],{})['then'](respondWithResult(_0x49b90a,0xc9))[_0x84c4('0x2d')](handleError(_0x49b90a,null));};exports['update']=function(_0x1234b3,_0x290da3){if(_0x1234b3[_0x84c4('0x5a')]['id']){delete _0x1234b3['body']['id'];}return db[_0x84c4('0x3e')]['find']({'where':{'id':_0x1234b3[_0x84c4('0x57')]['id']}})['then'](handleEntityNotFound(_0x290da3,null))[_0x84c4('0x23')](saveUpdates(_0x1234b3['body'],null))['then'](respondWithResult(_0x290da3,null))[_0x84c4('0x2d')](handleError(_0x290da3,null));};exports[_0x84c4('0x39')]=function(_0x515fb7,_0x4a650e){return db[_0x84c4('0x3e')][_0x84c4('0x58')]({'where':{'id':_0x515fb7['params']['id']}})[_0x84c4('0x23')](handleEntityNotFound(_0x4a650e,null))['then'](removeEntity(_0x4a650e,null))[_0x84c4('0x2d')](handleError(_0x4a650e,null));};exports['describe']=function(_0x519de3,_0x25afb5){return db[_0x84c4('0x3e')][_0x84c4('0x5b')]()[_0x84c4('0x23')](respondWithResult(_0x25afb5,null))[_0x84c4('0x2d')](handleError(_0x25afb5,null));};var interaction_log=require(_0x84c4('0x16'))('chat-interactions');exports[_0x84c4('0x5c')]=function(_0x3fa5ef,_0x2cdb4c,_0x2ad96d){var _0x3697ef={'agent':{},'channel':'chat'};if(_0x3fa5ef['body']['id']){delete _0x3fa5ef[_0x84c4('0x5a')]['id'];}_0x3fa5ef[_0x84c4('0x5a')]['read']=!![];_0x3fa5ef[_0x84c4('0x5a')][_0x84c4('0x5d')]=moment()[_0x84c4('0x5e')](_0x84c4('0x5f'));_0x3fa5ef['body'][_0x84c4('0x60')]=_0x3fa5ef[_0x84c4('0x5a')][_0x84c4('0x60')]||_0x3fa5ef[_0x84c4('0x61')]['id'];_0x3697ef[_0x84c4('0x62')]['id']=_0x3fa5ef['body'][_0x84c4('0x60')];return db['ChatMessage'][_0x84c4('0x58')]({'where':{'id':_0x3fa5ef[_0x84c4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2cdb4c,null))[_0x84c4('0x23')](saveUpdates(_0x3fa5ef[_0x84c4('0x5a')],null))[_0x84c4('0x23')](function(_0x19e405){if(_0x19e405){_0x3697ef[_0x84c4('0x2b')]=_0x19e405[_0x84c4('0x63')]({'plain':!![]});return db[_0x84c4('0x64')]['find']({'where':{'id':_0x19e405[_0x84c4('0x65')]}});}return null;})[_0x84c4('0x23')](handleEntityNotFound(_0x2cdb4c,null))[_0x84c4('0x23')](function(_0x39cdf4){if(_0x39cdf4){return _0x39cdf4[_0x84c4('0x38')]({'UserId':_0x3fa5ef[_0x84c4('0x5a')][_0x84c4('0x60')],'read1stAt':_[_0x84c4('0x66')](_0x39cdf4[_0x84c4('0x67')])?moment()[_0x84c4('0x5e')](_0x84c4('0x5f')):undefined});}return null;})[_0x84c4('0x23')](function(_0x3c6d15){if(_0x3c6d15){_0x3697ef['interaction']=_0x3c6d15['get']({'plain':!![]});interaction_log[_0x84c4('0x24')](_0x84c4('0x68'),_0x3fa5ef['user']['id'],_0x3fa5ef[_0x84c4('0x61')][_0x84c4('0x3b')],_0x3fa5ef[_0x84c4('0x61')]['role'],_0x3697ef['interaction']['id'],_0x3fa5ef[_0x84c4('0x5a')]?JSON['stringify'](_0x3fa5ef[_0x84c4('0x5a')]):_0x84c4('0x69'));return respondWithRpcPromise(_0x84c4('0x6a'),_0x84c4('0x6b'),_0x3697ef);}return null;})[_0x84c4('0x23')](function(_0x21be94){var _0xd80483='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x21be94[_0x84c4('0x2b')][_0x84c4('0x6c')];return db[_0x84c4('0x6d')][_0x84c4('0x42')](_0xd80483,{'type':db[_0x84c4('0x6e')][_0x84c4('0x6f')][_0x84c4('0x70')],'raw':!![]})[_0x84c4('0x23')](function(_0x280715){return _0x280715;});})[_0x84c4('0x23')](function(_0x54e0a6){if(_0x54e0a6){_0x3697ef[_0x84c4('0x2b')][_0x84c4('0x71')]=_0x54e0a6[0x0];if(!_0x3fa5ef[_0x84c4('0x5a')][_0x84c4('0x60')])return;return db[_0x84c4('0x72')]['find']({'where':{'id':_0x3fa5ef[_0x84c4('0x5a')][_0x84c4('0x60')],'role':_0x84c4('0x62')},'attributes':['id','name',_0x84c4('0x73'),_0x84c4('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x479486){if(!_0x479486)return null;_0x3697ef['message'][_0x84c4('0x62')]=_0x479486;return _0x3697ef;})[_0x84c4('0x23')](function(_0x1fea35){if(_0x1fea35){if(_0x3fa5ef['body']['manual']){_0x3697ef[_0x84c4('0x2b')][_0x84c4('0x75')]=util[_0x84c4('0x5e')](_0x84c4('0x76'),_0x3fa5ef[_0x84c4('0x61')][_0x84c4('0x3b')]);_0x3697ef[_0x84c4('0x2b')][_0x84c4('0x77')]=_0x3697ef[_0x84c4('0x77')];_0x3697ef['message']['motionChannel']=_0x3697ef[_0x84c4('0x77')];_0x3697ef[_0x84c4('0x2b')][_0x84c4('0x78')]=_0x84c4('0x5c');return respondWithRpcPromise(_0x84c4('0x79'),'EventManager',{'event':_0x84c4('0x7a'),'message':_['merge'](_0x3697ef[_0x84c4('0x2b')],JSON[_0x84c4('0x7b')](_0x3697ef[_0x84c4('0x7c')]['formData']))},client9002)[_0x84c4('0x23')](function(){return _0x3697ef;});}return _0x3697ef;}return null;})[_0x84c4('0x23')](respondWithResult(_0x2cdb4c,null))[_0x84c4('0x2d')](handleError(_0x2cdb4c,null));};var interaction_log=require(_0x84c4('0x16'))('chat-interactions');exports['reject']=function(_0x5bd179,_0x442dd4,_0x212e5c){var _0x2f8c74={'agent':{},'channel':_0x84c4('0x7d')};if(_0x5bd179['body']['id']){delete _0x5bd179[_0x84c4('0x5a')]['id'];}_0x5bd179[_0x84c4('0x5a')]['UserId']=_0x5bd179[_0x84c4('0x5a')][_0x84c4('0x60')]||_0x5bd179[_0x84c4('0x61')]['id'];_0x2f8c74[_0x84c4('0x62')]['id']=_0x5bd179['body'][_0x84c4('0x60')];return db[_0x84c4('0x3e')][_0x84c4('0x58')]({'where':{'id':_0x5bd179[_0x84c4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x442dd4,null))[_0x84c4('0x23')](function(_0x48a2b0){if(_0x48a2b0){_0x2f8c74[_0x84c4('0x2b')]=_0x48a2b0[_0x84c4('0x63')]({'plain':!![]});return db[_0x84c4('0x64')][_0x84c4('0x58')]({'where':{'id':_0x48a2b0[_0x84c4('0x65')]}});}return null;})[_0x84c4('0x23')](handleEntityNotFound(_0x442dd4,null))[_0x84c4('0x23')](function(_0x2ad022){if(_0x2ad022){_0x2f8c74[_0x84c4('0x7c')]=_0x2ad022[_0x84c4('0x63')]({'plain':!![]});interaction_log[_0x84c4('0x24')](_0x84c4('0x7e'),_0x5bd179[_0x84c4('0x61')]['id'],_0x5bd179['user'][_0x84c4('0x3b')],_0x5bd179[_0x84c4('0x61')][_0x84c4('0x7f')],_0x2f8c74['interaction']['id'],_0x5bd179['body']?JSON[_0x84c4('0x28')](_0x5bd179[_0x84c4('0x5a')]):'null');return respondWithRpcPromise('RejectMessage',_0x84c4('0x80'),_0x2f8c74);}return null;})[_0x84c4('0x23')](function(_0x464128){var _0xf1440d=_0x84c4('0x81')+_0x464128[_0x84c4('0x2b')][_0x84c4('0x6c')];return db[_0x84c4('0x6d')][_0x84c4('0x42')](_0xf1440d,{'type':db[_0x84c4('0x6e')][_0x84c4('0x6f')]['SELECT'],'raw':!![]})[_0x84c4('0x23')](function(_0x547b3e){return _0x547b3e;});})[_0x84c4('0x23')](function(_0x58aec5){if(_0x58aec5){_0x2f8c74[_0x84c4('0x2b')][_0x84c4('0x71')]=_0x58aec5[0x0];if(!_0x5bd179[_0x84c4('0x5a')][_0x84c4('0x60')])return;return db[_0x84c4('0x72')][_0x84c4('0x58')]({'where':{'id':_0x5bd179[_0x84c4('0x5a')][_0x84c4('0x60')],'role':_0x84c4('0x62')},'attributes':['id',_0x84c4('0x3b'),'fullname','email',_0x84c4('0x82')],'raw':!![]});}return null;})[_0x84c4('0x23')](function(_0x3814ed){if(!_0x3814ed)return null;_0x2f8c74[_0x84c4('0x2b')][_0x84c4('0x62')]=_0x3814ed;return _0x2f8c74;})[_0x84c4('0x23')](function(_0x38ab90){if(_0x38ab90){_0x38ab90[_0x84c4('0x2b')]['interface']=util[_0x84c4('0x5e')]('SIP/%s',_0x5bd179[_0x84c4('0x61')]['name']);_0x38ab90['message'][_0x84c4('0x77')]=_0x2f8c74['channel'];_0x38ab90[_0x84c4('0x2b')][_0x84c4('0x83')]=_0x2f8c74[_0x84c4('0x77')];_0x38ab90['message']['event']='reject';respondWithRpcPromise(_0x84c4('0x79'),_0x84c4('0x79'),{'event':_0x84c4('0x84'),'message':_[_0x84c4('0x4f')](_0x2f8c74[_0x84c4('0x2b')],JSON[_0x84c4('0x7b')](_0x2f8c74['interaction']['formData']))},client9002);return _0x2f8c74;}return null;})[_0x84c4('0x23')](respondWithResult(_0x442dd4,null))['catch'](handleError(_0x442dd4,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 0f6979e..e107347 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 _0x7efa=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x1c20f0,_0x1f1600){var _0x3380b7=function(_0x56e3d6){while(--_0x56e3d6){_0x1c20f0['push'](_0x1c20f0['shift']());}};_0x3380b7(++_0x1f1600);}(_0x7efa,0x1a7));var _0xa7ef=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7efa[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xa7ef('0x0'));var ChatMessage=require(_0xa7ef('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa7ef('0x2')](0x0);var events={'afterCreate':_0xa7ef('0x3'),'afterUpdate':_0xa7ef('0x4'),'afterDestroy':_0xa7ef('0x5')};function emitEvent(_0x441b7c){return function(_0x423f6b,_0x5c4954,_0x5d4267){ChatMessageEvents[_0xa7ef('0x6')](_0x441b7c+':'+_0x423f6b['id'],_0x423f6b);ChatMessageEvents[_0xa7ef('0x6')](_0x441b7c,_0x423f6b);_0x5d4267(null);};}for(var e in events){if(events[_0xa7ef('0x7')](e)){var event=events[e];ChatMessage[_0xa7ef('0x8')](e,emitEvent(event));}}module[_0xa7ef('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x31a0=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x553d36,_0x8d66de){var _0x1cc51d=function(_0x51ce77){while(--_0x51ce77){_0x553d36['push'](_0x553d36['shift']());}};_0x1cc51d(++_0x8d66de);}(_0x31a0,0x1b4));var _0x031a=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x31a0[_0x4dc7b9];return _0x3ab114;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x031a('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x031a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x031a('0x2'),'afterDestroy':_0x031a('0x3')};function emitEvent(_0x4ce8c9){return function(_0x1a8877,_0x3bb2a1,_0x2ca1af){ChatMessageEvents[_0x031a('0x4')](_0x4ce8c9+':'+_0x1a8877['id'],_0x1a8877);ChatMessageEvents[_0x031a('0x4')](_0x4ce8c9,_0x1a8877);_0x2ca1af(null);};}for(var e in events){if(events[_0x031a('0x5')](e)){var event=events[e];ChatMessage[_0x031a('0x6')](e,emitEvent(event));}}module[_0x031a('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index f1702fb..dc3e94d 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 _0x27bf=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','direction','out','secret','isNil','UserId','findOne','ChatInteractionId','then','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x458fc8,_0x185f79){var _0x4c66bd=function(_0x5a3d5d){while(--_0x5a3d5d){_0x458fc8['push'](_0x458fc8['shift']());}};_0x4c66bd(++_0x185f79);}(_0x27bf,0x117));var _0xf27b=function(_0x3b2976,_0x5bd2d3){_0x3b2976=_0x3b2976-0x0;var _0x17b743=_0x27bf[_0x3b2976];return _0x17b743;};'use strict';var _=require(_0xf27b('0x0'));var util=require(_0xf27b('0x1'));var logger=require(_0xf27b('0x2'))(_0xf27b('0x3'));var moment=require(_0xf27b('0x4'));var BPromise=require(_0xf27b('0x5'));var rp=require(_0xf27b('0x6'));var fs=require('fs');var path=require(_0xf27b('0x7'));var rimraf=require(_0xf27b('0x8'));var config=require(_0xf27b('0x9'));var attributes=require(_0xf27b('0xa'));module['exports']=function(_0x1a18b4,_0x39bf1b){return _0x1a18b4[_0xf27b('0xb')](_0xf27b('0xc'),attributes,{'tableName':_0xf27b('0xd'),'paranoid':![],'indexes':[{'name':_0xf27b('0xe'),'fields':['body'],'type':_0xf27b('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9ca64e,_0x969a6f,_0x122944){var _0x3ff5e4=_0x1a18b4[_0xf27b('0x10')];var _0x28fc32=_0x9ca64e['get']({'plain':!![]});if(_0x28fc32['direction']['toLowerCase']()==='in'||_0x28fc32[_0xf27b('0x11')]['toLowerCase']()===_0xf27b('0x12')&&!_0x28fc32[_0xf27b('0x13')]&&!_[_0xf27b('0x14')](_0x28fc32[_0xf27b('0x15')])){_0x3ff5e4['ChatInteraction'][_0xf27b('0x16')]({'where':{'id':_0x28fc32[_0xf27b('0x17')]}})[_0xf27b('0x18')](function(_0x32e55f){if(_0x32e55f){_0x32e55f['update']({'lastMsgAt':_0x28fc32[_0xf27b('0x19')],'lastMsgDirection':_0x28fc32[_0xf27b('0x11')]['toLowerCase']()});}})['catch'](function(_0x1400ce){console['error'](_0x1400ce);});}_0x122944();}},'charset':_0xf27b('0x1a'),'collate':_0xf27b('0x1b')});};
\ No newline at end of file
+var _0x58fa=['bluebird','request-promise','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','error','lodash','../../config/logger','api','moment'];(function(_0x4cfc78,_0x45ece1){var _0x4acc35=function(_0x2f910c){while(--_0x2f910c){_0x4cfc78['push'](_0x4cfc78['shift']());}};_0x4acc35(++_0x45ece1);}(_0x58fa,0x134));var _0xa58f=function(_0x3dca99,_0x4d4d95){_0x3dca99=_0x3dca99-0x0;var _0x440108=_0x58fa[_0x3dca99];return _0x440108;};'use strict';var _=require(_0xa58f('0x0'));var util=require('util');var logger=require(_0xa58f('0x1'))(_0xa58f('0x2'));var moment=require(_0xa58f('0x3'));var BPromise=require(_0xa58f('0x4'));var rp=require(_0xa58f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa58f('0x6'));module[_0xa58f('0x7')]=function(_0x4d9ca6,_0xfaf56){return _0x4d9ca6[_0xa58f('0x8')](_0xa58f('0x9'),attributes,{'tableName':_0xa58f('0xa'),'paranoid':![],'indexes':[{'name':_0xa58f('0xb'),'fields':[_0xa58f('0xc')],'type':_0xa58f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x55e91a,_0x113f7a,_0x2051c7){var _0x221935=_0x4d9ca6[_0xa58f('0xe')];var _0x41d60e=_0x55e91a[_0xa58f('0xf')]({'plain':!![]});if(_0x41d60e[_0xa58f('0x10')][_0xa58f('0x11')]()==='in'||_0x41d60e[_0xa58f('0x10')][_0xa58f('0x11')]()==='out'&&!_0x41d60e[_0xa58f('0x12')]&&!_[_0xa58f('0x13')](_0x41d60e[_0xa58f('0x14')])){_0x221935[_0xa58f('0x15')][_0xa58f('0x16')]({'where':{'id':_0x41d60e[_0xa58f('0x17')]}})[_0xa58f('0x18')](function(_0x5a9743){if(_0x5a9743){_0x5a9743['update']({'lastMsgAt':_0x41d60e['createdAt'],'lastMsgDirection':_0x41d60e['direction'][_0xa58f('0x11')]()});}})['catch'](function(_0x5576df){console[_0xa58f('0x19')](_0x5576df);});}_0x2051c7();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index ab94db6..a467f35 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 _0xd068=['message','info','catch','CreateChatMessage','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x471448,_0x1c0e9e){var _0x38190b=function(_0x41dd2f){while(--_0x41dd2f){_0x471448['push'](_0x471448['shift']());}};_0x38190b(++_0x1c0e9e);}(_0xd068,0xce));var _0x8d06=function(_0x46c5e1,_0x32d719){_0x46c5e1=_0x46c5e1-0x0;var _0x14af5a=_0xd068[_0x46c5e1];return _0x14af5a;};'use strict';var _=require(_0x8d06('0x0'));var util=require(_0x8d06('0x1'));var moment=require(_0x8d06('0x2'));var BPromise=require(_0x8d06('0x3'));var rs=require(_0x8d06('0x4'));var fs=require('fs');var Redis=require(_0x8d06('0x5'));var db=require(_0x8d06('0x6'))['db'];var utils=require(_0x8d06('0x7'));var logger=require(_0x8d06('0x8'))(_0x8d06('0x9'));var config=require(_0x8d06('0xa'));var jayson=require(_0x8d06('0xb'));var client=jayson[_0x8d06('0xc')][_0x8d06('0xd')]({'port':0x232a});config[_0x8d06('0xe')]=_[_0x8d06('0xf')](config[_0x8d06('0xe')],{'host':_0x8d06('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d06('0xe')]));require('./chatMessage.socket')[_0x8d06('0x11')](socket);function respondWithRpcPromise(_0x1a6e88,_0x4e9acc,_0x2d3935){return new BPromise(function(_0x5afdc9,_0x44b6f5){return client[_0x8d06('0x12')](_0x1a6e88,_0x2d3935)['then'](function(_0x4e819a){logger['info'](_0x8d06('0x13'),_0x4e9acc,_0x8d06('0x14'));logger[_0x8d06('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4e9acc,_0x8d06('0x14'),JSON[_0x8d06('0x16')](_0x4e819a));if(_0x4e819a[_0x8d06('0x17')]){if(_0x4e819a[_0x8d06('0x17')][_0x8d06('0x18')]===0x1f4){logger[_0x8d06('0x17')](_0x8d06('0x13'),_0x4e9acc,_0x4e819a['error']['message']);return _0x44b6f5(_0x4e819a[_0x8d06('0x17')][_0x8d06('0x19')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4e9acc,_0x4e819a[_0x8d06('0x17')][_0x8d06('0x19')]);return _0x5afdc9(_0x4e819a['error'][_0x8d06('0x19')]);}else{logger[_0x8d06('0x1a')](_0x8d06('0x13'),_0x4e9acc,_0x8d06('0x14'));_0x5afdc9(_0x4e819a['result'][_0x8d06('0x19')]);}})[_0x8d06('0x1b')](function(_0x8b9b52){logger[_0x8d06('0x17')](_0x8d06('0x13'),_0x4e9acc,_0x8b9b52);_0x44b6f5(_0x8b9b52);});});}exports[_0x8d06('0x1c')]=function(_0x26d1bf){var _0xd09a54=this;return new Promise(function(_0x2bd6d5,_0x578016){return db['ChatMessage']['create'](_0x26d1bf[_0x8d06('0x1d')],{'raw':_0x26d1bf[_0x8d06('0x1e')]?_0x26d1bf['options'][_0x8d06('0x1f')]===undefined?!![]:![]:!![]})[_0x8d06('0x20')](function(_0x53bc85){logger[_0x8d06('0x1a')]('CreateChatMessage',_0x26d1bf);logger[_0x8d06('0x15')]('CreateChatMessage',_0x26d1bf,JSON[_0x8d06('0x16')](_0x53bc85));_0x2bd6d5(_0x53bc85);})[_0x8d06('0x1b')](function(_0x3986c4){logger['error'](_0x8d06('0x1c'),_0x3986c4['message'],_0x26d1bf);_0x578016(_0xd09a54['error'](0x1f4,_0x3986c4[_0x8d06('0x19')]));});});};
\ No newline at end of file
+var _0x2e0c=['ChatMessage','create','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatMessage'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0x2e0c,0x1bf));var _0xc2e0=function(_0x5e4241,_0x4b437f){_0x5e4241=_0x5e4241-0x0;var _0x583197=_0x2e0c[_0x5e4241];return _0x583197;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc2e0('0x0'));var BPromise=require(_0xc2e0('0x1'));var rs=require(_0xc2e0('0x2'));var fs=require('fs');var Redis=require(_0xc2e0('0x3'));var db=require(_0xc2e0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc2e0('0x5'));var config=require(_0xc2e0('0x6'));var jayson=require(_0xc2e0('0x7'));var client=jayson[_0xc2e0('0x8')][_0xc2e0('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc2e0('0xa')],{'host':_0xc2e0('0xb'),'port':0x18eb});var socket=require(_0xc2e0('0xc'))(new Redis(config[_0xc2e0('0xa')]));require(_0xc2e0('0xd'))[_0xc2e0('0xe')](socket);function respondWithRpcPromise(_0x599ee3,_0x2e3115,_0x21b2ba){return new BPromise(function(_0x1f16b4,_0x1e2496){return client[_0xc2e0('0xf')](_0x599ee3,_0x21b2ba)[_0xc2e0('0x10')](function(_0x595f3e){logger[_0xc2e0('0x11')](_0xc2e0('0x12'),_0x2e3115,'request\x20sent');logger[_0xc2e0('0x13')](_0xc2e0('0x14'),_0x2e3115,_0xc2e0('0x15'),JSON[_0xc2e0('0x16')](_0x595f3e));if(_0x595f3e[_0xc2e0('0x17')]){if(_0x595f3e[_0xc2e0('0x17')][_0xc2e0('0x18')]===0x1f4){logger['error'](_0xc2e0('0x12'),_0x2e3115,_0x595f3e[_0xc2e0('0x17')][_0xc2e0('0x19')]);return _0x1e2496(_0x595f3e[_0xc2e0('0x17')][_0xc2e0('0x19')]);}logger[_0xc2e0('0x17')](_0xc2e0('0x12'),_0x2e3115,_0x595f3e['error'][_0xc2e0('0x19')]);return _0x1f16b4(_0x595f3e[_0xc2e0('0x17')][_0xc2e0('0x19')]);}else{logger[_0xc2e0('0x11')](_0xc2e0('0x12'),_0x2e3115,'request\x20sent');_0x1f16b4(_0x595f3e[_0xc2e0('0x1a')][_0xc2e0('0x19')]);}})[_0xc2e0('0x1b')](function(_0x49d740){logger[_0xc2e0('0x17')](_0xc2e0('0x12'),_0x2e3115,_0x49d740);_0x1e2496(_0x49d740);});});}exports[_0xc2e0('0x1c')]=function(_0x59c1bc){var _0x349e96=this;return new Promise(function(_0x15ef93,_0x27bf70){return db[_0xc2e0('0x1d')][_0xc2e0('0x1e')](_0x59c1bc[_0xc2e0('0x1f')],{'raw':_0x59c1bc[_0xc2e0('0x20')]?_0x59c1bc[_0xc2e0('0x20')][_0xc2e0('0x21')]===undefined?!![]:![]:!![]})[_0xc2e0('0x10')](function(_0x1f21de){logger[_0xc2e0('0x11')](_0xc2e0('0x1c'),_0x59c1bc);logger[_0xc2e0('0x13')](_0xc2e0('0x1c'),_0x59c1bc,JSON['stringify'](_0x1f21de));_0x15ef93(_0x1f21de);})['catch'](function(_0x54433d){logger[_0xc2e0('0x17')](_0xc2e0('0x1c'),_0x54433d['message'],_0x59c1bc);_0x27bf70(_0x349e96['error'](0x1f4,_0x54433d[_0xc2e0('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 3f90a62..6573799 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 _0x818f=['update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x99d550,_0x3b7e84){var _0x557cc4=function(_0x45ff31){while(--_0x45ff31){_0x99d550['push'](_0x99d550['shift']());}};_0x557cc4(++_0x3b7e84);}(_0x818f,0x1da));var _0xf818=function(_0x560901,_0x5cf280){_0x560901=_0x560901-0x0;var _0x19b9a1=_0x818f[_0x560901];return _0x19b9a1;};'use strict';var ChatMessageEvents=require(_0xf818('0x0'));var events=[_0xf818('0x1'),_0xf818('0x2'),_0xf818('0x3')];function createListener(_0x121db7,_0x39b430){return function(_0x58f142){_0x39b430[_0xf818('0x4')](_0x121db7,_0x58f142);};}function removeListener(_0xd6c86,_0x2c1bb0){return function(){ChatMessageEvents[_0xf818('0x5')](_0xd6c86,_0x2c1bb0);};}exports[_0xf818('0x6')]=function(_0x41310f){for(var _0x27119b=0x0,_0x42a23e=events[_0xf818('0x7')];_0x27119b<_0x42a23e;_0x27119b++){var _0x55540d=events[_0x27119b];var _0x1dbfc8=createListener(_0xf818('0x8')+_0x55540d,_0x41310f);ChatMessageEvents['on'](_0x55540d,_0x1dbfc8);}};
\ No newline at end of file
+var _0x85d0=['emit','register','length','chatMessage:'];(function(_0x16d058,_0x4e3030){var _0x159c45=function(_0x51cc8d){while(--_0x51cc8d){_0x16d058['push'](_0x16d058['shift']());}};_0x159c45(++_0x4e3030);}(_0x85d0,0x164));var _0x085d=function(_0x19ba8a,_0x29b432){_0x19ba8a=_0x19ba8a-0x0;var _0x2f5ff8=_0x85d0[_0x19ba8a];return _0x2f5ff8;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove','update'];function createListener(_0x297001,_0x1716e5){return function(_0xfd8773){_0x1716e5[_0x085d('0x0')](_0x297001,_0xfd8773);};}function removeListener(_0x231765,_0x19ae4c){return function(){ChatMessageEvents['removeListener'](_0x231765,_0x19ae4c);};}exports[_0x085d('0x1')]=function(_0x5c917f){for(var _0x364f09=0x0,_0x9acc97=events[_0x085d('0x2')];_0x364f09<_0x9acc97;_0x364f09++){var _0x4a12b7=events[_0x364f09];var _0xf65d01=createListener(_0x085d('0x3')+_0x4a12b7,_0x5c917f);ChatMessageEvents['on'](_0x4a12b7,_0xf65d01);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index fc9a446..ea2262e 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 _0x290f=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','tracked','chat','chatmessage:create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util'];(function(_0x1c2ab8,_0x575359){var _0x2f683f=function(_0x1842b9){while(--_0x1842b9){_0x1c2ab8['push'](_0x1c2ab8['shift']());}};_0x2f683f(++_0x575359);}(_0x290f,0x1ae));var _0xf290=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x290f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf290('0x0'));var util=require(_0xf290('0x1'));var path=require(_0xf290('0x2'));var timeout=require(_0xf290('0x3'));var express=require(_0xf290('0x4'));var router=express['Router']();var fs_extra=require(_0xf290('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf290('0x6'));var controller=require('./chatMessage.controller');router[_0xf290('0x7')]('/',auth[_0xf290('0x8')](),controller['index']);router['get'](_0xf290('0x9'),auth[_0xf290('0x8')](),controller['describe']);router[_0xf290('0x7')](_0xf290('0xa'),auth[_0xf290('0x8')](),controller[_0xf290('0xb')]);router[_0xf290('0xc')]('/',auth[_0xf290('0x8')](),interaction[_0xf290('0xd')](_0xf290('0xe'),_0xf290('0xf')),controller['create']);router[_0xf290('0x10')](_0xf290('0xa'),controller['update']);router['put'](_0xf290('0x11'),auth['isAuthenticated'](),controller[_0xf290('0x12')]);router['put'](_0xf290('0x13'),auth['isAuthenticated'](),controller[_0xf290('0x14')]);router[_0xf290('0x15')](_0xf290('0xa'),auth[_0xf290('0x8')](),controller[_0xf290('0x16')]);module[_0xf290('0x17')]=router;
\ No newline at end of file
+var _0x392a=['/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','tracked','chat','chatmessage:create','create','update','accept','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x392a,0x1b4));var _0xa392=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x392a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xa392('0x0'));var util=require('util');var path=require(_0xa392('0x1'));var timeout=require(_0xa392('0x2'));var express=require(_0xa392('0x3'));var router=express[_0xa392('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa392('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa392('0x6'));router[_0xa392('0x7')]('/',auth[_0xa392('0x8')](),controller[_0xa392('0x9')]);router[_0xa392('0x7')](_0xa392('0xa'),auth[_0xa392('0x8')](),controller[_0xa392('0xb')]);router['get'](_0xa392('0xc'),auth[_0xa392('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0xa392('0xd')](_0xa392('0xe'),_0xa392('0xf')),controller[_0xa392('0x10')]);router['put']('/:id',controller[_0xa392('0x11')]);router['put']('/:id/accept',auth[_0xa392('0x8')](),controller[_0xa392('0x12')]);router[_0xa392('0x13')](_0xa392('0x14'),auth[_0xa392('0x8')](),controller[_0xa392('0x15')]);router[_0xa392('0x16')](_0xa392('0xc'),auth[_0xa392('0x8')](),controller['destroy']);module[_0xa392('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index d8b166d..5cf15cc 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0xc624,_0x2ff6f5){var _0x12831e=function(_0x2e59a3){while(--_0x2e59a3){_0xc624['push'](_0xc624['shift']());}};_0x12831e(++_0x2ff6f5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x32ff69,_0x319391){var _0x223947=function(_0x44f855){while(--_0x44f855){_0x32ff69['push'](_0x32ff69['shift']());}};_0x223947(++_0x319391);}(_0xb10b,0x12a));var _0xbb10=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xb10b[_0x836465];return _0x2150ea;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index fbadbc3..dbfec0a 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(_0x7db371,_0x474c27){var _0x1ea571=function(_0x497f88){while(--_0x497f88){_0x7db371['push'](_0x7db371['shift']());}};_0x1ea571(++_0x474c27);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x54a3d9,_0x351d15){_0x54a3d9=_0x54a3d9-0x0;var _0x7564e8=_0x7a54[_0x54a3d9];return _0x7564e8;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 5bd986d..53a4d31 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 _0x779f=['../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x39f097,_0x17116b){var _0x544f6a=function(_0x457caf){while(--_0x457caf){_0x39f097['push'](_0x39f097['shift']());}};_0x544f6a(++_0x17116b);}(_0x779f,0x9a));var _0xf779=function(_0x42c8b2,_0x28285){_0x42c8b2=_0x42c8b2-0x0;var _0x215db7=_0x779f[_0x42c8b2];return _0x215db7;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xf779('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf779('0x1'),'afterUpdate':_0xf779('0x2'),'afterDestroy':_0xf779('0x3')};function emitEvent(_0x24f9a2){return function(_0x5b3456,_0x54cb9f,_0x28a9ba){ChatOfflineMessageEvents['emit'](_0x24f9a2+':'+_0x5b3456['id'],_0x5b3456);ChatOfflineMessageEvents[_0xf779('0x4')](_0x24f9a2,_0x5b3456);_0x28a9ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xf779('0x5')](e,emitEvent(event));}}module[_0xf779('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x83b9=['../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x23533c,_0x3cb682){var _0x583254=function(_0x2d7dc9){while(--_0x2d7dc9){_0x23533c['push'](_0x23533c['shift']());}};_0x583254(++_0x3cb682);}(_0x83b9,0x155));var _0x983b=function(_0xc5d9de,_0x151b03){_0xc5d9de=_0xc5d9de-0x0;var _0x49b41d=_0x83b9[_0xc5d9de];return _0x49b41d;};'use strict';var EventEmitter=require(_0x983b('0x0'));var ChatOfflineMessage=require(_0x983b('0x1'))['db'][_0x983b('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x983b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x983b('0x4'),'afterDestroy':_0x983b('0x5')};function emitEvent(_0x5dbe97){return function(_0x576883,_0x431c1c,_0x2d164e){ChatOfflineMessageEvents[_0x983b('0x6')](_0x5dbe97+':'+_0x576883['id'],_0x576883);ChatOfflineMessageEvents[_0x983b('0x6')](_0x5dbe97,_0x576883);_0x2d164e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x983b('0x7')](e,emitEvent(event));}}module[_0x983b('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 e6dc294..d5fa9a5 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 _0x962c=['utf8mb4_unicode_ci','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x3fba72,_0x32f320){var _0x46b50f=function(_0x12e71b){while(--_0x12e71b){_0x3fba72['push'](_0x3fba72['shift']());}};_0x46b50f(++_0x32f320);}(_0x962c,0xa3));var _0xc962=function(_0x42db57,_0x36b686){_0x42db57=_0x42db57-0x0;var _0x48cf4f=_0x962c[_0x42db57];return _0x48cf4f;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xc962('0x0')]=function(_0x58ba60){return _0x58ba60[_0xc962('0x1')](_0xc962('0x2'),attributes,{'tableName':_0xc962('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc962('0x4'),'collate':_0xc962('0x5')});};
\ No newline at end of file
+var _0x24ce=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','define'];(function(_0x1f88f0,_0x2dc0ac){var _0x3684f5=function(_0x2f5efd){while(--_0x2f5efd){_0x1f88f0['push'](_0x1f88f0['shift']());}};_0x3684f5(++_0x2dc0ac);}(_0x24ce,0x8b));var _0xe24c=function(_0x36e939,_0x299038){_0x36e939=_0x36e939-0x0;var _0xe60148=_0x24ce[_0x36e939];return _0xe60148;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x21eaaa){return _0x21eaaa[_0xe24c('0x0')]('ChatOfflineMessage',attributes,{'tableName':_0xe24c('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe24c('0x2'),'collate':_0xe24c('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 5acead1..5c60b43 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 _0x73a9=['then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x18920a,_0x5c7896){var _0x5b48a2=function(_0x6e0bf5){while(--_0x6e0bf5){_0x18920a['push'](_0x18920a['shift']());}};_0x5b48a2(++_0x5c7896);}(_0x73a9,0xda));var _0x973a=function(_0x2207f4,_0x465326){_0x2207f4=_0x2207f4-0x0;var _0x19969f=_0x73a9[_0x2207f4];return _0x19969f;};'use strict';var _=require('lodash');var util=require(_0x973a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x973a('0x1'));var fs=require('fs');var Redis=require(_0x973a('0x2'));var db=require(_0x973a('0x3'))['db'];var utils=require(_0x973a('0x4'));var logger=require(_0x973a('0x5'))(_0x973a('0x6'));var config=require(_0x973a('0x7'));var jayson=require(_0x973a('0x8'));var client=jayson[_0x973a('0x9')][_0x973a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afbf8,_0x13b27c,_0x579ea6){return new BPromise(function(_0x28a1d0,_0x21cf5a){return client[_0x973a('0xb')](_0x5afbf8,_0x579ea6)[_0x973a('0xc')](function(_0xb37905){logger['info'](_0x973a('0xd'),_0x13b27c,_0x973a('0xe'));logger[_0x973a('0xf')](_0x973a('0x10'),_0x13b27c,'request\x20sent',JSON[_0x973a('0x11')](_0xb37905));if(_0xb37905[_0x973a('0x12')]){if(_0xb37905[_0x973a('0x12')]['code']===0x1f4){logger['error'](_0x973a('0xd'),_0x13b27c,_0xb37905[_0x973a('0x12')][_0x973a('0x13')]);return _0x21cf5a(_0xb37905['error'][_0x973a('0x13')]);}logger[_0x973a('0x12')](_0x973a('0xd'),_0x13b27c,_0xb37905[_0x973a('0x12')][_0x973a('0x13')]);return _0x28a1d0(_0xb37905[_0x973a('0x12')]['message']);}else{logger[_0x973a('0x14')](_0x973a('0xd'),_0x13b27c,_0x973a('0xe'));_0x28a1d0(_0xb37905[_0x973a('0x15')][_0x973a('0x13')]);}})[_0x973a('0x16')](function(_0x5c9046){logger[_0x973a('0x12')](_0x973a('0xd'),_0x13b27c,_0x5c9046);_0x21cf5a(_0x5c9046);});});}
\ No newline at end of file
+var _0x7ca8=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x5b30ae,_0x2eecd9){var _0x27fe=function(_0x3c6d21){while(--_0x3c6d21){_0x5b30ae['push'](_0x5b30ae['shift']());}};_0x27fe(++_0x2eecd9);}(_0x7ca8,0xf5));var _0x87ca=function(_0x474018,_0x3e1fda){_0x474018=_0x474018-0x0;var _0x4a03d5=_0x7ca8[_0x474018];return _0x4a03d5;};'use strict';var _=require('lodash');var util=require(_0x87ca('0x0'));var moment=require(_0x87ca('0x1'));var BPromise=require(_0x87ca('0x2'));var rs=require(_0x87ca('0x3'));var fs=require('fs');var Redis=require(_0x87ca('0x4'));var db=require(_0x87ca('0x5'))['db'];var utils=require(_0x87ca('0x6'));var logger=require(_0x87ca('0x7'))(_0x87ca('0x8'));var config=require(_0x87ca('0x9'));var jayson=require(_0x87ca('0xa'));var client=jayson[_0x87ca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ce850,_0x1c5ca3,_0x12b73f){return new BPromise(function(_0x10323f,_0x444f47){return client[_0x87ca('0xc')](_0x4ce850,_0x12b73f)[_0x87ca('0xd')](function(_0x4953ff){logger[_0x87ca('0xe')](_0x87ca('0xf'),_0x1c5ca3,'request\x20sent');logger[_0x87ca('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1c5ca3,_0x87ca('0x11'),JSON['stringify'](_0x4953ff));if(_0x4953ff[_0x87ca('0x12')]){if(_0x4953ff[_0x87ca('0x12')][_0x87ca('0x13')]===0x1f4){logger[_0x87ca('0x12')](_0x87ca('0xf'),_0x1c5ca3,_0x4953ff[_0x87ca('0x12')][_0x87ca('0x14')]);return _0x444f47(_0x4953ff[_0x87ca('0x12')][_0x87ca('0x14')]);}logger['error'](_0x87ca('0xf'),_0x1c5ca3,_0x4953ff['error'][_0x87ca('0x14')]);return _0x10323f(_0x4953ff[_0x87ca('0x12')][_0x87ca('0x14')]);}else{logger[_0x87ca('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1c5ca3,_0x87ca('0x11'));_0x10323f(_0x4953ff['result'][_0x87ca('0x14')]);}})[_0x87ca('0x15')](function(_0xd8d74b){logger[_0x87ca('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1c5ca3,_0xd8d74b);_0x444f47(_0xd8d74b);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e5abcb2..d5f1383 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 _0x423e=['express','Router','fs-extra','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','multer','util','path','connect-timeout'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x423e,0x188));var _0xe423=function(_0x8299df,_0x2887e1){_0x8299df=_0x8299df-0x0;var _0x4a707f=_0x423e[_0x8299df];return _0x4a707f;};'use strict';var multer=require(_0xe423('0x0'));var util=require(_0xe423('0x1'));var path=require(_0xe423('0x2'));var timeout=require(_0xe423('0x3'));var express=require(_0xe423('0x4'));var router=express[_0xe423('0x5')]();var fs_extra=require(_0xe423('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe423('0x7'));router['get']('/',auth[_0xe423('0x8')](),controller['index']);router[_0xe423('0x9')](_0xe423('0xa'),auth['isAuthenticated'](),controller[_0xe423('0xb')]);router[_0xe423('0x9')](_0xe423('0xc'),auth[_0xe423('0x8')](),controller[_0xe423('0xd')]);router['post']('/',auth[_0xe423('0x8')](),controller[_0xe423('0xe')]);router[_0xe423('0xf')](_0xe423('0xc'),auth[_0xe423('0x8')](),controller[_0xe423('0x10')]);router[_0xe423('0x11')]('/:id',auth[_0xe423('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf380=['/describe','describe','/:id','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated'];(function(_0x28fe98,_0x36592a){var _0x3b482d=function(_0x30405c){while(--_0x30405c){_0x28fe98['push'](_0x28fe98['shift']());}};_0x3b482d(++_0x36592a);}(_0xf380,0x1ac));var _0x0f38=function(_0x367b02,_0x163098){_0x367b02=_0x367b02-0x0;var _0x9bb382=_0xf380[_0x367b02];return _0x9bb382;};'use strict';var multer=require(_0x0f38('0x0'));var util=require(_0x0f38('0x1'));var path=require('path');var timeout=require(_0x0f38('0x2'));var express=require(_0x0f38('0x3'));var router=express[_0x0f38('0x4')]();var fs_extra=require(_0x0f38('0x5'));var auth=require(_0x0f38('0x6'));var interaction=require(_0x0f38('0x7'));var config=require(_0x0f38('0x8'));var controller=require(_0x0f38('0x9'));router[_0x0f38('0xa')]('/',auth[_0x0f38('0xb')](),controller['index']);router[_0x0f38('0xa')](_0x0f38('0xc'),auth[_0x0f38('0xb')](),controller[_0x0f38('0xd')]);router[_0x0f38('0xa')](_0x0f38('0xe'),auth[_0x0f38('0xb')](),controller['show']);router['post']('/',auth[_0x0f38('0xb')](),controller[_0x0f38('0xf')]);router['put'](_0x0f38('0xe'),auth[_0x0f38('0xb')](),controller[_0x0f38('0x10')]);router[_0x0f38('0x11')](_0x0f38('0xe'),auth['isAuthenticated'](),controller[_0x0f38('0x12')]);module[_0x0f38('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 57f2434..f3e0947 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 _0x8135=['ENUM','mouseOver','INTEGER','sequelize','exports','STRING'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8135,0x8d));var _0x5813=function(_0x5a00fa,_0x426a92){_0x5a00fa=_0x5a00fa-0x0;var _0x1f6acb=_0x8135[_0x5a00fa];return _0x1f6acb;};'use strict';var Sequelize=require(_0x5813('0x0'));module[_0x5813('0x1')]={'name':{'type':Sequelize[_0x5813('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5813('0x3')]('mouseOver','timeout'),'defaultValue':_0x5813('0x4')},'selector':{'type':Sequelize[_0x5813('0x2')]},'timeout':{'type':Sequelize[_0x5813('0x5')]}};
\ No newline at end of file
+var _0x9870=['ENUM','mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x54d826,_0x48a629){var _0x4305b9=function(_0x2da18a){while(--_0x2da18a){_0x54d826['push'](_0x54d826['shift']());}};_0x4305b9(++_0x48a629);}(_0x9870,0x17f));var _0x0987=function(_0x5e5443,_0x2dad79){_0x5e5443=_0x5e5443-0x0;var _0x32bd1d=_0x9870[_0x5e5443];return _0x32bd1d;};'use strict';var Sequelize=require(_0x0987('0x0'));module[_0x0987('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0987('0x2')](_0x0987('0x3'),_0x0987('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x0987('0x5')]},'timeout':{'type':Sequelize[_0x0987('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 29cc4fd..b4f4770 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 _0xf3cc=['model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','params'];(function(_0x1e3e02,_0x4f78db){var _0x57291a=function(_0x4bf784){while(--_0x4bf784){_0x1e3e02['push'](_0x1e3e02['shift']());}};_0x57291a(++_0x4f78db);}(_0xf3cc,0x10d));var _0xcf3c=function(_0xf0f7ba,_0x48be70){_0xf0f7ba=_0xf0f7ba-0x0;var _0x44382c=_0xf3cc[_0xf0f7ba];return _0x44382c;};'use strict';var emlformat=require(_0xcf3c('0x0'));var rimraf=require(_0xcf3c('0x1'));var zipdir=require(_0xcf3c('0x2'));var jsonpatch=require(_0xcf3c('0x3'));var rp=require('request-promise');var moment=require(_0xcf3c('0x4'));var BPromise=require(_0xcf3c('0x5'));var Mustache=require(_0xcf3c('0x6'));var util=require('util');var path=require(_0xcf3c('0x7'));var sox=require(_0xcf3c('0x8'));var csv=require('to-csv');var ejs=require(_0xcf3c('0x9'));var fs=require('fs');var fs_extra=require(_0xcf3c('0xa'));var _=require(_0xcf3c('0xb'));var squel=require(_0xcf3c('0xc'));var crypto=require(_0xcf3c('0xd'));var jsforce=require(_0xcf3c('0xe'));var deskjs=require(_0xcf3c('0xf'));var toCsv=require(_0xcf3c('0x10'));var querystring=require(_0xcf3c('0x11'));var Papa=require(_0xcf3c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf3c('0x13'));var as=require(_0xcf3c('0x14'));var hardwareService=require(_0xcf3c('0x15'));var logger=require(_0xcf3c('0x16'))(_0xcf3c('0x17'));var utils=require(_0xcf3c('0x18'));var config=require(_0xcf3c('0x19'));var licenseUtil=require(_0xcf3c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245b88,_0x389b0f){_0x389b0f=_0x389b0f||0xcc;return function(_0x59a8dc){if(_0x59a8dc){return _0x245b88[_0xcf3c('0x1b')](_0x389b0f);}return _0x245b88['status'](_0x389b0f)['end']();};}function respondWithResult(_0x56261f,_0x3fd714){_0x3fd714=_0x3fd714||0xc8;return function(_0x598576){if(_0x598576){return _0x56261f[_0xcf3c('0x1c')](_0x3fd714)[_0xcf3c('0x1d')](_0x598576);}};}function respondWithFilteredResult(_0x4e35fc,_0x3e759f){return function(_0x540046){if(_0x540046){var _0x30d023=typeof _0x3e759f[_0xcf3c('0x1e')]===_0xcf3c('0x1f')&&typeof _0x3e759f['limit']===_0xcf3c('0x1f');var _0x190c8c=_0x540046[_0xcf3c('0x20')];var _0x3f6cef=_0x30d023?0x0:_0x3e759f['offset'];var _0x3789b6=_0x30d023?_0x540046[_0xcf3c('0x20')]:_0x3e759f[_0xcf3c('0x1e')]+_0x3e759f[_0xcf3c('0x21')];var _0x3d0e0a;if(_0x3789b6>=_0x190c8c){_0x3789b6=_0x190c8c;_0x3d0e0a=0xc8;}else{_0x3d0e0a=0xce;}_0x4e35fc[_0xcf3c('0x1c')](_0x3d0e0a);return _0x4e35fc[_0xcf3c('0x22')](_0xcf3c('0x23'),_0x3f6cef+'-'+_0x3789b6+'/'+_0x190c8c)[_0xcf3c('0x1d')](_0x540046);}return null;};}function patchUpdates(_0x8e7738){return function(_0x26a26e){try{jsonpatch[_0xcf3c('0x24')](_0x26a26e,_0x8e7738,!![]);}catch(_0x4e80d4){return BPromise[_0xcf3c('0x25')](_0x4e80d4);}return _0x26a26e['save']();};}function saveUpdates(_0x3c9153,_0x1228c1){return function(_0x5dddc1){if(_0x5dddc1){return _0x5dddc1[_0xcf3c('0x26')](_0x3c9153)[_0xcf3c('0x27')](function(_0x328336){return _0x328336;});}return null;};}function removeEntity(_0x1d7e79,_0x32bbd5){return function(_0x3f1771){if(_0x3f1771){return _0x3f1771[_0xcf3c('0x28')]()[_0xcf3c('0x27')](function(){_0x1d7e79['status'](0xcc)[_0xcf3c('0x29')]();});}};}function handleEntityNotFound(_0x4ce43c,_0x2281b6){return function(_0x15b55c){if(!_0x15b55c){_0x4ce43c[_0xcf3c('0x1b')](0x194);}return _0x15b55c;};}function handleError(_0x35e546,_0x181c90){_0x181c90=_0x181c90||0x1f4;return function(_0x43c912){logger['error'](_0x43c912[_0xcf3c('0x2a')]);if(_0x43c912['name']){delete _0x43c912[_0xcf3c('0x2b')];}_0x35e546[_0xcf3c('0x1c')](_0x181c90)[_0xcf3c('0x2c')](_0x43c912);};}exports['show']=function(_0x397996,_0x54174a){var _0x1d8223={'raw':!![],'where':{'id':_0x397996[_0xcf3c('0x2d')]['id']}},_0xe22e99={};_0xe22e99[_0xcf3c('0x2e')]=_['keys'](db[_0xcf3c('0x2f')][_0xcf3c('0x30')]);_0xe22e99[_0xcf3c('0x31')]=_[_0xcf3c('0x32')](_0x397996['query']);_0xe22e99[_0xcf3c('0x33')]=_[_0xcf3c('0x34')](_0xe22e99[_0xcf3c('0x2e')],_0xe22e99['query']);_0x1d8223[_0xcf3c('0x35')]=_[_0xcf3c('0x34')](_0xe22e99[_0xcf3c('0x2e')],qs['fields'](_0x397996[_0xcf3c('0x31')][_0xcf3c('0x36')]));_0x1d8223[_0xcf3c('0x35')]=_0x1d8223[_0xcf3c('0x35')][_0xcf3c('0x37')]?_0x1d8223['attributes']:_0xe22e99[_0xcf3c('0x2e')];if(_0x397996['query'][_0xcf3c('0x38')]){_0x1d8223['include']=[{'all':!![]}];}_0x1d8223=_[_0xcf3c('0x39')]({},_0x1d8223,_0x397996[_0xcf3c('0x3a')]);return db[_0xcf3c('0x2f')][_0xcf3c('0x3b')](_0x1d8223)[_0xcf3c('0x27')](handleEntityNotFound(_0x54174a,null))[_0xcf3c('0x27')](respondWithResult(_0x54174a,null))[_0xcf3c('0x3c')](handleError(_0x54174a,null));};exports[_0xcf3c('0x3d')]=function(_0x4844f2,_0xbc118e){return db[_0xcf3c('0x2f')][_0xcf3c('0x3d')](_0x4844f2[_0xcf3c('0x3e')],{})[_0xcf3c('0x27')](respondWithResult(_0xbc118e,0xc9))[_0xcf3c('0x3c')](handleError(_0xbc118e,null));};exports[_0xcf3c('0x26')]=function(_0xff382e,_0x16f81d){if(_0xff382e[_0xcf3c('0x3e')]['id']){delete _0xff382e['body']['id'];}return db[_0xcf3c('0x2f')]['find']({'where':{'id':_0xff382e['params']['id']}})['then'](handleEntityNotFound(_0x16f81d,null))[_0xcf3c('0x27')](saveUpdates(_0xff382e[_0xcf3c('0x3e')],null))[_0xcf3c('0x27')](respondWithResult(_0x16f81d,null))[_0xcf3c('0x3c')](handleError(_0x16f81d,null));};exports['destroy']=function(_0x54ca05,_0x27e186){return db[_0xcf3c('0x2f')][_0xcf3c('0x3b')]({'where':{'id':_0x54ca05[_0xcf3c('0x2d')]['id']}})[_0xcf3c('0x27')](handleEntityNotFound(_0x27e186,null))[_0xcf3c('0x27')](removeEntity(_0x27e186,null))['catch'](handleError(_0x27e186,null));};
\ No newline at end of file
+var _0x1224=['query','keys','filters','intersection','attributes','fields','length','merge','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','show','params','model','ChatProactiveAction'];(function(_0xdac5f,_0x1c39c7){var _0x5ea6c3=function(_0x4e3ebb){while(--_0x4e3ebb){_0xdac5f['push'](_0xdac5f['shift']());}};_0x5ea6c3(++_0x1c39c7);}(_0x1224,0x10d));var _0x4122=function(_0x10865b,_0x252f1b){_0x10865b=_0x10865b-0x0;var _0x157426=_0x1224[_0x10865b];return _0x157426;};'use strict';var emlformat=require(_0x4122('0x0'));var rimraf=require(_0x4122('0x1'));var zipdir=require(_0x4122('0x2'));var jsonpatch=require(_0x4122('0x3'));var rp=require(_0x4122('0x4'));var moment=require(_0x4122('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4122('0x6'));var util=require(_0x4122('0x7'));var path=require(_0x4122('0x8'));var sox=require('sox');var csv=require(_0x4122('0x9'));var ejs=require(_0x4122('0xa'));var fs=require('fs');var fs_extra=require(_0x4122('0xb'));var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0x9'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var Redis=require(_0x4122('0x13'));var authService=require(_0x4122('0x14'));var qs=require(_0x4122('0x15'));var as=require(_0x4122('0x16'));var hardwareService=require(_0x4122('0x17'));var logger=require(_0x4122('0x18'))(_0x4122('0x19'));var utils=require(_0x4122('0x1a'));var config=require(_0x4122('0x1b'));var licenseUtil=require(_0x4122('0x1c'));var db=require(_0x4122('0x1d'))['db'];function respondWithStatusCode(_0x440ff0,_0x8d4876){_0x8d4876=_0x8d4876||0xcc;return function(_0xe213d){if(_0xe213d){return _0x440ff0[_0x4122('0x1e')](_0x8d4876);}return _0x440ff0[_0x4122('0x1f')](_0x8d4876)[_0x4122('0x20')]();};}function respondWithResult(_0x421ee3,_0x1a701e){_0x1a701e=_0x1a701e||0xc8;return function(_0x3a88fe){if(_0x3a88fe){return _0x421ee3['status'](_0x1a701e)[_0x4122('0x21')](_0x3a88fe);}};}function respondWithFilteredResult(_0x3c674e,_0x192e77){return function(_0x359909){if(_0x359909){var _0x520300=typeof _0x192e77[_0x4122('0x22')]===_0x4122('0x23')&&typeof _0x192e77['limit']===_0x4122('0x23');var _0x3ec4d3=_0x359909[_0x4122('0x24')];var _0x4636ae=_0x520300?0x0:_0x192e77[_0x4122('0x22')];var _0x42374d=_0x520300?_0x359909[_0x4122('0x24')]:_0x192e77['offset']+_0x192e77['limit'];var _0x586105;if(_0x42374d>=_0x3ec4d3){_0x42374d=_0x3ec4d3;_0x586105=0xc8;}else{_0x586105=0xce;}_0x3c674e[_0x4122('0x1f')](_0x586105);return _0x3c674e[_0x4122('0x25')](_0x4122('0x26'),_0x4636ae+'-'+_0x42374d+'/'+_0x3ec4d3)[_0x4122('0x21')](_0x359909);}return null;};}function patchUpdates(_0xef6995){return function(_0xb0a7d){try{jsonpatch[_0x4122('0x27')](_0xb0a7d,_0xef6995,!![]);}catch(_0x46b24e){return BPromise['reject'](_0x46b24e);}return _0xb0a7d[_0x4122('0x28')]();};}function saveUpdates(_0x50e243,_0x4f949a){return function(_0x508cd7){if(_0x508cd7){return _0x508cd7[_0x4122('0x29')](_0x50e243)[_0x4122('0x2a')](function(_0x317418){return _0x317418;});}return null;};}function removeEntity(_0x4eb35b,_0x128fde){return function(_0x386cdc){if(_0x386cdc){return _0x386cdc['destroy']()['then'](function(){_0x4eb35b[_0x4122('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db23e,_0x59895d){return function(_0x1b449b){if(!_0x1b449b){_0x4db23e[_0x4122('0x1e')](0x194);}return _0x1b449b;};}function handleError(_0xbb76e1,_0x1bb51b){_0x1bb51b=_0x1bb51b||0x1f4;return function(_0x31568f){logger[_0x4122('0x2b')](_0x31568f[_0x4122('0x2c')]);if(_0x31568f[_0x4122('0x2d')]){delete _0x31568f[_0x4122('0x2d')];}_0xbb76e1[_0x4122('0x1f')](_0x1bb51b)[_0x4122('0x2e')](_0x31568f);};}exports[_0x4122('0x2f')]=function(_0xfefaf6,_0x5f32c5){var _0x2e5bc2={'raw':!![],'where':{'id':_0xfefaf6[_0x4122('0x30')]['id']}},_0x43c51c={};_0x43c51c[_0x4122('0x31')]=_['keys'](db[_0x4122('0x32')]['rawAttributes']);_0x43c51c[_0x4122('0x33')]=_[_0x4122('0x34')](_0xfefaf6[_0x4122('0x33')]);_0x43c51c[_0x4122('0x35')]=_[_0x4122('0x36')](_0x43c51c[_0x4122('0x31')],_0x43c51c[_0x4122('0x33')]);_0x2e5bc2[_0x4122('0x37')]=_['intersection'](_0x43c51c[_0x4122('0x31')],qs[_0x4122('0x38')](_0xfefaf6['query'][_0x4122('0x38')]));_0x2e5bc2[_0x4122('0x37')]=_0x2e5bc2[_0x4122('0x37')][_0x4122('0x39')]?_0x2e5bc2['attributes']:_0x43c51c[_0x4122('0x31')];if(_0xfefaf6[_0x4122('0x33')]['includeAll']){_0x2e5bc2['include']=[{'all':!![]}];}_0x2e5bc2=_[_0x4122('0x3a')]({},_0x2e5bc2,_0xfefaf6['options']);return db[_0x4122('0x32')][_0x4122('0x3b')](_0x2e5bc2)['then'](handleEntityNotFound(_0x5f32c5,null))[_0x4122('0x2a')](respondWithResult(_0x5f32c5,null))[_0x4122('0x3c')](handleError(_0x5f32c5,null));};exports[_0x4122('0x3d')]=function(_0x5bb6d6,_0x35971b){return db['ChatProactiveAction'][_0x4122('0x3d')](_0x5bb6d6[_0x4122('0x3e')],{})[_0x4122('0x2a')](respondWithResult(_0x35971b,0xc9))['catch'](handleError(_0x35971b,null));};exports[_0x4122('0x29')]=function(_0x5427ca,_0x2da1bd){if(_0x5427ca[_0x4122('0x3e')]['id']){delete _0x5427ca['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x5427ca[_0x4122('0x30')]['id']}})['then'](handleEntityNotFound(_0x2da1bd,null))[_0x4122('0x2a')](saveUpdates(_0x5427ca[_0x4122('0x3e')],null))[_0x4122('0x2a')](respondWithResult(_0x2da1bd,null))[_0x4122('0x3c')](handleError(_0x2da1bd,null));};exports[_0x4122('0x3f')]=function(_0x517a59,_0x5c20ec){return db[_0x4122('0x32')]['find']({'where':{'id':_0x517a59[_0x4122('0x30')]['id']}})['then'](handleEntityNotFound(_0x5c20ec,null))[_0x4122('0x2a')](removeEntity(_0x5c20ec,null))[_0x4122('0x3c')](handleError(_0x5c20ec,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 37473b6..807b442 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 _0xc61c=['define','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x3544b1,_0x2f12aa){var _0x77c2a0=function(_0x5a231d){while(--_0x5a231d){_0x3544b1['push'](_0x3544b1['shift']());}};_0x77c2a0(++_0x2f12aa);}(_0xc61c,0x12d));var _0xcc61=function(_0x2929cd,_0x1d3a2a){_0x2929cd=_0x2929cd-0x0;var _0x16c157=_0xc61c[_0x2929cd];return _0x16c157;};'use strict';var _=require(_0xcc61('0x0'));var util=require('util');var logger=require(_0xcc61('0x1'))(_0xcc61('0x2'));var moment=require(_0xcc61('0x3'));var BPromise=require(_0xcc61('0x4'));var rp=require(_0xcc61('0x5'));var fs=require('fs');var path=require(_0xcc61('0x6'));var rimraf=require(_0xcc61('0x7'));var config=require(_0xcc61('0x8'));var attributes=require(_0xcc61('0x9'));module[_0xcc61('0xa')]=function(_0x151677,_0x539f54){return _0x151677[_0xcc61('0xb')]('ChatProactiveAction',attributes,{'tableName':_0xcc61('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4efe=['path','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x4efe,0x1c7));var _0xe4ef=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x4efe[_0x1b6186];return _0x186121;};'use strict';var _=require(_0xe4ef('0x0'));var util=require(_0xe4ef('0x1'));var logger=require(_0xe4ef('0x2'))(_0xe4ef('0x3'));var moment=require('moment');var BPromise=require(_0xe4ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4ef('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe4ef('0x6'));module[_0xe4ef('0x7')]=function(_0x59ca1c,_0x66a8f3){return _0x59ca1c['define'](_0xe4ef('0x8'),attributes,{'tableName':_0xe4ef('0x9'),'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 e44bf6a..292c505 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 _0xe692=['http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x271ace,_0x2b1999){var _0x48e6af=function(_0x166e5c){while(--_0x166e5c){_0x271ace['push'](_0x271ace['shift']());}};_0x48e6af(++_0x2b1999);}(_0xe692,0x1b0));var _0x2e69=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xe692[_0x176329];return _0x31997c;};'use strict';var _=require(_0x2e69('0x0'));var util=require(_0x2e69('0x1'));var moment=require(_0x2e69('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e69('0x3'));var fs=require('fs');var Redis=require(_0x2e69('0x4'));var db=require(_0x2e69('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2e69('0x6'));var jayson=require(_0x2e69('0x7'));var client=jayson[_0x2e69('0x8')][_0x2e69('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f424c,_0x4f9ec9,_0x588f35){return new BPromise(function(_0x33ded8,_0x1f8fcf){return client[_0x2e69('0xa')](_0x4f424c,_0x588f35)[_0x2e69('0xb')](function(_0x4b1b6d){logger[_0x2e69('0xc')](_0x2e69('0xd'),_0x4f9ec9,'request\x20sent');logger[_0x2e69('0xe')](_0x2e69('0xf'),_0x4f9ec9,_0x2e69('0x10'),JSON[_0x2e69('0x11')](_0x4b1b6d));if(_0x4b1b6d[_0x2e69('0x12')]){if(_0x4b1b6d['error']['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4f9ec9,_0x4b1b6d[_0x2e69('0x12')][_0x2e69('0x13')]);return _0x1f8fcf(_0x4b1b6d[_0x2e69('0x12')]['message']);}logger[_0x2e69('0x12')](_0x2e69('0xd'),_0x4f9ec9,_0x4b1b6d['error']['message']);return _0x33ded8(_0x4b1b6d[_0x2e69('0x12')][_0x2e69('0x13')]);}else{logger[_0x2e69('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f9ec9,'request\x20sent');_0x33ded8(_0x4b1b6d[_0x2e69('0x14')][_0x2e69('0x13')]);}})['catch'](function(_0x5e882b){logger['error'](_0x2e69('0xd'),_0x4f9ec9,_0x5e882b);_0x1f8fcf(_0x5e882b);});});}
\ No newline at end of file
+var _0x6157=['stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6157,0xeb));var _0x7615=function(_0xf6ac4d,_0x18979a){_0xf6ac4d=_0xf6ac4d-0x0;var _0x3cfeb3=_0x6157[_0xf6ac4d];return _0x3cfeb3;};'use strict';var _=require(_0x7615('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7615('0x1'));var rs=require(_0x7615('0x2'));var fs=require('fs');var Redis=require(_0x7615('0x3'));var db=require(_0x7615('0x4'))['db'];var utils=require(_0x7615('0x5'));var logger=require(_0x7615('0x6'))(_0x7615('0x7'));var config=require(_0x7615('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7615('0x9')][_0x7615('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d7490,_0xeb56d3,_0x3554dc){return new BPromise(function(_0x2320f7,_0x5512a1){return client[_0x7615('0xb')](_0x4d7490,_0x3554dc)[_0x7615('0xc')](function(_0x24b0db){logger[_0x7615('0xd')](_0x7615('0xe'),_0xeb56d3,_0x7615('0xf'));logger[_0x7615('0x10')](_0x7615('0x11'),_0xeb56d3,'request\x20sent',JSON[_0x7615('0x12')](_0x24b0db));if(_0x24b0db[_0x7615('0x13')]){if(_0x24b0db['error'][_0x7615('0x14')]===0x1f4){logger['error'](_0x7615('0xe'),_0xeb56d3,_0x24b0db[_0x7615('0x13')][_0x7615('0x15')]);return _0x5512a1(_0x24b0db[_0x7615('0x13')]['message']);}logger[_0x7615('0x13')](_0x7615('0xe'),_0xeb56d3,_0x24b0db[_0x7615('0x13')][_0x7615('0x15')]);return _0x2320f7(_0x24b0db[_0x7615('0x13')]['message']);}else{logger[_0x7615('0xd')](_0x7615('0xe'),_0xeb56d3,_0x7615('0xf'));_0x2320f7(_0x24b0db[_0x7615('0x16')]['message']);}})['catch'](function(_0x2ef30e){logger[_0x7615('0x13')](_0x7615('0xe'),_0xeb56d3,_0x2ef30e);_0x5512a1(_0x2ef30e);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 9e9d4fe..b652bdd 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 _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x260e4b,_0x54668d){var _0x18dfba=function(_0x37b530){while(--_0x37b530){_0x260e4b['push'](_0x260e4b['shift']());}};_0x18dfba(++_0x54668d);}(_0x7c09,0x102));var _0x97c0=function(_0x375c2f,_0x2c1bec){_0x375c2f=_0x375c2f-0x0;var _0x7cc2c1=_0x7c09[_0x375c2f];return _0x7cc2c1;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router;
\ No newline at end of file
+var _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x117369,_0x4466a2){var _0x541d94=function(_0x1b556b){while(--_0x1b556b){_0x117369['push'](_0x117369['shift']());}};_0x541d94(++_0x4466a2);}(_0xeda8,0x104));var _0x8eda=function(_0x51d630,_0x17f9d5){_0x51d630=_0x51d630-0x0;var _0x35059a=_0xeda8[_0x51d630];return _0x35059a;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 4b17586..d975ff2 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 _0x86ed=['name','INTEGER','rrmemory','roundrobin','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x86ed,0xa9));var _0xd86e=function(_0x4194cb,_0x1b2fa6){_0x4194cb=_0x4194cb-0x0;var _0x504484=_0x86ed[_0x4194cb];return _0x504484;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd86e('0x0')],'unique':_0xd86e('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd86e('0x0')]},'timeout':{'type':Sequelize[_0xd86e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd86e('0x3'),'beepall',_0xd86e('0x4'))}};
\ No newline at end of file
+var _0xa0a9=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x27b99a,_0x22bedf){var _0x432ed2=function(_0x1844ad){while(--_0x1844ad){_0x27b99a['push'](_0x27b99a['shift']());}};_0x432ed2(++_0x22bedf);}(_0xa0a9,0x143));var _0x9a0a=function(_0x217098,_0x3b775e){_0x217098=_0x217098-0x0;var _0x2c2ddd=_0xa0a9[_0x217098];return _0x2c2ddd;};'use strict';var Sequelize=require(_0x9a0a('0x0'));module['exports']={'name':{'type':Sequelize[_0x9a0a('0x1')],'unique':_0x9a0a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a0a('0x1')]},'timeout':{'type':Sequelize[_0x9a0a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9a0a('0x4')](_0x9a0a('0x5'),_0x9a0a('0x6'),_0x9a0a('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 51eea15..c38ad4e 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 _0xa274=['SIP','createdAt','findOne','Team','pick','getTeams','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','get','UserProfileResource','stack','name','send','index','map','ChatQueue','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','UserChatQueue','length','hasOwnProperty','nolimit','findAndCountAll','UserId','chatPause','updatedAt','format'];(function(_0x10ac69,_0xfce771){var _0x5a9e0d=function(_0x464a4a){while(--_0x464a4a){_0x10ac69['push'](_0x10ac69['shift']());}};_0x5a9e0d(++_0xfce771);}(_0xa274,0xc3));var _0x4a27=function(_0x42d1f8,_0x22e529){_0x42d1f8=_0x42d1f8-0x0;var _0x40d234=_0xa274[_0x42d1f8];return _0x40d234;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a27('0x0'));var zipdir=require(_0x4a27('0x1'));var jsonpatch=require(_0x4a27('0x2'));var rp=require(_0x4a27('0x3'));var moment=require(_0x4a27('0x4'));var BPromise=require(_0x4a27('0x5'));var Mustache=require(_0x4a27('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4a27('0x7'));var csv=require('to-csv');var ejs=require(_0x4a27('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a27('0x9'));var squel=require('squel');var crypto=require(_0x4a27('0xa'));var jsforce=require(_0x4a27('0xb'));var deskjs=require(_0x4a27('0xc'));var toCsv=require(_0x4a27('0xd'));var querystring=require(_0x4a27('0xe'));var Papa=require('papaparse');var Redis=require(_0x4a27('0xf'));var authService=require(_0x4a27('0x10'));var qs=require(_0x4a27('0x11'));var as=require(_0x4a27('0x12'));var hardwareService=require(_0x4a27('0x13'));var logger=require(_0x4a27('0x14'))(_0x4a27('0x15'));var utils=require(_0x4a27('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4a27('0x17'));var db=require(_0x4a27('0x18'))['db'];config[_0x4a27('0x19')]=_['defaults'](config[_0x4a27('0x19')],{'host':_0x4a27('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a27('0x19')]));require(_0x4a27('0x1b'))[_0x4a27('0x1c')](socket);var jayson=require(_0x4a27('0x1d'));var client=jayson[_0x4a27('0x1e')][_0x4a27('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x306fb0,_0x5b2b9a,_0x5add90,_0x3dc384){return new BPromise(function(_0x29b902,_0x2ff275){var _0x31d18d=_0x3dc384||client;return _0x31d18d[_0x4a27('0x20')](_0x306fb0,_0x5add90)[_0x4a27('0x21')](function(_0xf7118){logger['info'](_0x4a27('0x22'),_0x5b2b9a,_0x4a27('0x23'));logger[_0x4a27('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5b2b9a,_0x4a27('0x23'),JSON[_0x4a27('0x25')](_0xf7118));if(_0xf7118[_0x4a27('0x26')]){if(_0xf7118[_0x4a27('0x26')]['code']===0x1f4){logger[_0x4a27('0x26')](_0x4a27('0x22'),_0x5b2b9a,_0xf7118[_0x4a27('0x26')][_0x4a27('0x27')]);return _0x2ff275(_0xf7118[_0x4a27('0x26')]['message']);}logger[_0x4a27('0x26')]('ChatQueue,\x20%s,\x20%s',_0x5b2b9a,_0xf7118[_0x4a27('0x26')][_0x4a27('0x27')]);return _0x29b902(_0xf7118[_0x4a27('0x26')][_0x4a27('0x27')]);}else{logger[_0x4a27('0x28')]('ChatQueue,\x20%s,\x20%s',_0x5b2b9a,_0x4a27('0x23'));_0x29b902(_0xf7118[_0x4a27('0x29')][_0x4a27('0x27')]);}})['catch'](function(_0x552f24){logger[_0x4a27('0x26')]('ChatQueue,\x20%s,\x20%s',_0x5b2b9a,_0x552f24);_0x2ff275(_0x552f24);});});}function respondWithStatusCode(_0x23cda0,_0x3754ae){_0x3754ae=_0x3754ae||0xcc;return function(_0x261ad9){if(_0x261ad9){return _0x23cda0[_0x4a27('0x2a')](_0x3754ae);}return _0x23cda0[_0x4a27('0x2b')](_0x3754ae)[_0x4a27('0x2c')]();};}function respondWithResult(_0x532358,_0x53f991){_0x53f991=_0x53f991||0xc8;return function(_0xed36fa){if(_0xed36fa){return _0x532358['status'](_0x53f991)[_0x4a27('0x2d')](_0xed36fa);}};}function respondWithFilteredResult(_0x33b075,_0x5dfb44){return function(_0x3f3a78){if(_0x3f3a78){var _0x327582=typeof _0x5dfb44[_0x4a27('0x2e')]===_0x4a27('0x2f')&&typeof _0x5dfb44[_0x4a27('0x30')]===_0x4a27('0x2f');var _0x44f62f=_0x3f3a78[_0x4a27('0x31')];var _0xccea82=_0x327582?0x0:_0x5dfb44[_0x4a27('0x2e')];var _0x53aa67=_0x327582?_0x3f3a78['count']:_0x5dfb44[_0x4a27('0x2e')]+_0x5dfb44['limit'];var _0x33f3d9;if(_0x53aa67>=_0x44f62f){_0x53aa67=_0x44f62f;_0x33f3d9=0xc8;}else{_0x33f3d9=0xce;}_0x33b075[_0x4a27('0x2b')](_0x33f3d9);return _0x33b075[_0x4a27('0x32')](_0x4a27('0x33'),_0xccea82+'-'+_0x53aa67+'/'+_0x44f62f)[_0x4a27('0x2d')](_0x3f3a78);}return null;};}function patchUpdates(_0x262ee8){return function(_0x3ee5b8){try{jsonpatch[_0x4a27('0x34')](_0x3ee5b8,_0x262ee8,!![]);}catch(_0x406a2a){return BPromise['reject'](_0x406a2a);}return _0x3ee5b8['save']();};}function saveUpdates(_0x5e2d5e,_0xd11476){return function(_0x19037b){if(_0x19037b){return _0x19037b['update'](_0x5e2d5e)[_0x4a27('0x21')](function(_0x19f976){return _0x19f976;});}return null;};}function removeEntity(_0x3ba0cb,_0x3a1603){return function(_0x536d65){if(_0x536d65){return _0x536d65[_0x4a27('0x35')]()[_0x4a27('0x21')](function(){var _0x380c31=_0x536d65[_0x4a27('0x36')]({'plain':!![]});var _0x531b0a='ChatQueues';return db[_0x4a27('0x37')][_0x4a27('0x35')]({'where':{'type':_0x531b0a,'resourceId':_0x380c31['id']}})[_0x4a27('0x21')](function(){return _0x536d65;});})[_0x4a27('0x21')](function(){_0x3ba0cb[_0x4a27('0x2b')](0xcc)[_0x4a27('0x2c')]();});}};}function handleEntityNotFound(_0x1e831b,_0x316323){return function(_0x216238){if(!_0x216238){_0x1e831b[_0x4a27('0x2a')](0x194);}return _0x216238;};}function handleError(_0x543d63,_0x594d79){_0x594d79=_0x594d79||0x1f4;return function(_0xa148ae){logger[_0x4a27('0x26')](_0xa148ae[_0x4a27('0x38')]);if(_0xa148ae[_0x4a27('0x39')]){delete _0xa148ae['name'];}_0x543d63[_0x4a27('0x2b')](_0x594d79)[_0x4a27('0x3a')](_0xa148ae);};}exports[_0x4a27('0x3b')]=function(_0x2b5c04,_0x1d0762){var _0x4ffa23={},_0x20a9d6={},_0x311c31={'count':0x0,'rows':[]};var _0xd4d4c0=_[_0x4a27('0x3c')](db[_0x4a27('0x3d')]['rawAttributes'],function(_0x1166f0){return{'name':_0x1166f0['fieldName'],'type':_0x1166f0[_0x4a27('0x3e')][_0x4a27('0x3f')]};});_0x20a9d6[_0x4a27('0x40')]=_[_0x4a27('0x3c')](_0xd4d4c0,_0x4a27('0x39'));_0x20a9d6[_0x4a27('0x41')]=_[_0x4a27('0x42')](_0x2b5c04[_0x4a27('0x41')]);_0x20a9d6[_0x4a27('0x43')]=_[_0x4a27('0x44')](_0x20a9d6['model'],_0x20a9d6[_0x4a27('0x41')]);_0x4ffa23['attributes']=_[_0x4a27('0x44')](_0x20a9d6[_0x4a27('0x40')],qs[_0x4a27('0x45')](_0x2b5c04['query'][_0x4a27('0x45')]));_0x4ffa23[_0x4a27('0x46')]=_0x4ffa23[_0x4a27('0x46')]['length']?_0x4ffa23[_0x4a27('0x46')]:_0x20a9d6[_0x4a27('0x40')];if(!_0x2b5c04[_0x4a27('0x41')]['hasOwnProperty']('nolimit')){_0x4ffa23['limit']=qs[_0x4a27('0x30')](_0x2b5c04['query'][_0x4a27('0x30')]);_0x4ffa23[_0x4a27('0x2e')]=qs[_0x4a27('0x2e')](_0x2b5c04[_0x4a27('0x41')][_0x4a27('0x2e')]);}_0x4ffa23[_0x4a27('0x47')]=qs[_0x4a27('0x48')](_0x2b5c04['query'][_0x4a27('0x48')]);_0x4ffa23[_0x4a27('0x49')]=qs[_0x4a27('0x43')](_['pick'](_0x2b5c04[_0x4a27('0x41')],_0x20a9d6[_0x4a27('0x43')]),_0xd4d4c0);if(_0x2b5c04[_0x4a27('0x41')][_0x4a27('0x4a')]){_0x4ffa23[_0x4a27('0x49')]=_['merge'](_0x4ffa23[_0x4a27('0x49')],{'$or':_[_0x4a27('0x3c')](_0xd4d4c0,function(_0x98518a){if(_0x98518a['type']!==_0x4a27('0x4b')){var _0x5ca804={};_0x5ca804[_0x98518a['name']]={'$like':'%'+_0x2b5c04[_0x4a27('0x41')][_0x4a27('0x4a')]+'%'};return _0x5ca804;}})});}_0x4ffa23=_[_0x4a27('0x4c')]({},_0x4ffa23,_0x2b5c04[_0x4a27('0x4d')]);var _0x426c56={'where':_0x4ffa23[_0x4a27('0x49')]};return db[_0x4a27('0x3d')]['count'](_0x426c56)[_0x4a27('0x21')](function(_0x56d2bd){_0x311c31[_0x4a27('0x31')]=_0x56d2bd;if(_0x2b5c04['query'][_0x4a27('0x4e')]){_0x4ffa23[_0x4a27('0x4f')]=[{'all':!![]}];}return db[_0x4a27('0x3d')][_0x4a27('0x50')](_0x4ffa23);})[_0x4a27('0x21')](function(_0x59c8ef){_0x311c31[_0x4a27('0x51')]=_0x59c8ef;return _0x311c31;})[_0x4a27('0x21')](respondWithFilteredResult(_0x1d0762,_0x4ffa23))[_0x4a27('0x52')](handleError(_0x1d0762,null));};exports[_0x4a27('0x53')]=function(_0x3ca272,_0x456872){var _0x519c45={'raw':!![],'where':{'id':_0x3ca272[_0x4a27('0x54')]['id']}},_0x151704={};_0x151704[_0x4a27('0x40')]=_[_0x4a27('0x42')](db[_0x4a27('0x3d')][_0x4a27('0x55')]);_0x151704[_0x4a27('0x41')]=_[_0x4a27('0x42')](_0x3ca272[_0x4a27('0x41')]);_0x151704[_0x4a27('0x43')]=_[_0x4a27('0x44')](_0x151704[_0x4a27('0x40')],_0x151704[_0x4a27('0x41')]);_0x519c45[_0x4a27('0x46')]=_['intersection'](_0x151704[_0x4a27('0x40')],qs[_0x4a27('0x45')](_0x3ca272[_0x4a27('0x41')][_0x4a27('0x45')]));_0x519c45['attributes']=_0x519c45[_0x4a27('0x46')]['length']?_0x519c45[_0x4a27('0x46')]:_0x151704[_0x4a27('0x40')];if(_0x3ca272[_0x4a27('0x41')]['includeAll']){_0x519c45[_0x4a27('0x4f')]=[{'all':!![]}];}_0x519c45=_[_0x4a27('0x4c')]({},_0x519c45,_0x3ca272['options']);return db[_0x4a27('0x3d')]['find'](_0x519c45)[_0x4a27('0x21')](handleEntityNotFound(_0x456872,null))['then'](respondWithResult(_0x456872,null))[_0x4a27('0x52')](handleError(_0x456872,null));};exports[_0x4a27('0x56')]=function(_0x362a9c,_0x566dd1){return db[_0x4a27('0x3d')][_0x4a27('0x56')](_0x362a9c[_0x4a27('0x57')],{})[_0x4a27('0x21')](function(_0x425e1d){var _0x161465=_0x362a9c[_0x4a27('0x58')][_0x4a27('0x36')]({'plain':!![]});if(!_0x161465)throw new Error(_0x4a27('0x59'));if(_0x161465[_0x4a27('0x5a')]==='user'){var _0x54c30c=_0x425e1d[_0x4a27('0x36')]({'plain':!![]});var _0x5504ba=_0x4a27('0x5b');return db['UserProfileSection'][_0x4a27('0x5c')]({'where':{'name':_0x5504ba,'userProfileId':_0x161465[_0x4a27('0x5d')]},'raw':!![]})[_0x4a27('0x21')](function(_0x1ed1e9){if(_0x1ed1e9&&_0x1ed1e9[_0x4a27('0x5e')]===0x0){return db[_0x4a27('0x37')]['create']({'name':_0x54c30c['name'],'resourceId':_0x54c30c['id'],'type':_0x1ed1e9[_0x4a27('0x39')],'sectionId':_0x1ed1e9['id']},{})[_0x4a27('0x21')](function(){return _0x425e1d;});}else{return _0x425e1d;}})['catch'](function(_0x583516){logger[_0x4a27('0x26')](_0x4a27('0x5f'),_0x583516);throw _0x583516;});}return _0x425e1d;})[_0x4a27('0x21')](respondWithResult(_0x566dd1,0xc9))['catch'](handleError(_0x566dd1,null));};exports[_0x4a27('0x60')]=function(_0x3eb120,_0x5e6f3d){if(_0x3eb120[_0x4a27('0x57')]['id']){delete _0x3eb120[_0x4a27('0x57')]['id'];}return db[_0x4a27('0x3d')][_0x4a27('0x5c')]({'where':{'id':_0x3eb120['params']['id']}})[_0x4a27('0x21')](handleEntityNotFound(_0x5e6f3d,null))[_0x4a27('0x21')](saveUpdates(_0x3eb120[_0x4a27('0x57')],null))[_0x4a27('0x21')](respondWithResult(_0x5e6f3d,null))[_0x4a27('0x52')](handleError(_0x5e6f3d,null));};exports[_0x4a27('0x35')]=function(_0x37d145,_0x3efaa0){return db[_0x4a27('0x3d')][_0x4a27('0x5c')]({'where':{'id':_0x37d145[_0x4a27('0x54')]['id']}})['then'](handleEntityNotFound(_0x3efaa0,null))[_0x4a27('0x21')](removeEntity(_0x3efaa0,null))['catch'](handleError(_0x3efaa0,null));};exports[_0x4a27('0x61')]=function(_0x11a2a3,_0x169927){return db['ChatQueue'][_0x4a27('0x61')]()[_0x4a27('0x21')](respondWithResult(_0x169927,null))[_0x4a27('0x52')](handleError(_0x169927,null));};exports['getMembers']=function(_0x516003,_0x3573b1,_0x423da3){var _0x4650b1={'raw':!![],'where':{}},_0x319323={},_0x5abc96;return db[_0x4a27('0x3d')]['findOne']({'where':{'id':_0x516003[_0x4a27('0x54')]['id']}})[_0x4a27('0x21')](handleEntityNotFound(_0x3573b1,null))[_0x4a27('0x21')](function(_0x4cc310){if(_0x4cc310){_0x5abc96=_0x4cc310['get']({'plain':!![]});_0x319323[_0x4a27('0x40')]=_[_0x4a27('0x42')](db[_0x4a27('0x62')][_0x4a27('0x55')]);_0x319323[_0x4a27('0x41')]=_['keys'](_0x516003[_0x4a27('0x41')]);_0x319323[_0x4a27('0x43')]=_[_0x4a27('0x44')](_0x319323[_0x4a27('0x40')],_0x319323[_0x4a27('0x41')]);_0x4650b1['attributes']=_[_0x4a27('0x44')](_0x319323[_0x4a27('0x40')],qs[_0x4a27('0x45')](_0x516003[_0x4a27('0x41')][_0x4a27('0x45')]));_0x4650b1['attributes']=_0x4650b1[_0x4a27('0x46')][_0x4a27('0x63')]?_0x4650b1[_0x4a27('0x46')]:_0x319323['model'];if(!_0x516003[_0x4a27('0x41')][_0x4a27('0x64')](_0x4a27('0x65'))){_0x4650b1[_0x4a27('0x30')]=qs[_0x4a27('0x30')](_0x516003['query'][_0x4a27('0x30')]);_0x4650b1[_0x4a27('0x2e')]=qs[_0x4a27('0x2e')](_0x516003['query']['offset']);}_0x4650b1['order']=qs[_0x4a27('0x48')](_0x516003[_0x4a27('0x41')][_0x4a27('0x48')]);_0x4650b1[_0x4a27('0x49')]=qs[_0x4a27('0x43')](_['pick'](_0x516003[_0x4a27('0x41')],_0x319323['filters']));_0x4650b1['where']['ChatQueueId']=_0x4cc310['id'];if(_0x516003[_0x4a27('0x41')][_0x4a27('0x4a')]){_0x4650b1[_0x4a27('0x49')]=_[_0x4a27('0x4c')](_0x4650b1[_0x4a27('0x49')],{'$or':_['map'](_0x4650b1[_0x4a27('0x46')],function(_0x12c14f){var _0x63590d={};_0x63590d[_0x12c14f]={'$like':'%'+_0x516003[_0x4a27('0x41')][_0x4a27('0x4a')]+'%'};return _0x63590d;})});}_0x4650b1=_[_0x4a27('0x4c')]({},_0x4650b1,_0x516003['options']);return db[_0x4a27('0x62')][_0x4a27('0x50')](_0x4650b1);}})[_0x4a27('0x21')](function(_0x2e0e4b){if(_0x2e0e4b){return db['User'][_0x4a27('0x66')]({'where':{'id':_['map'](_0x2e0e4b,_0x4a27('0x67')),'role':'agent'},'attributes':['id',_0x4a27('0x39'),_0x4a27('0x68'),_0x4a27('0x69'),'createdAt']});}})[_0x4a27('0x21')](function(_0x18f6ea){if(_0x18f6ea){return{'count':_0x18f6ea[_0x4a27('0x31')],'rows':_[_0x4a27('0x3c')](_0x18f6ea[_0x4a27('0x51')],function(_0x2c8daa){return{'membername':_0x2c8daa[_0x4a27('0x39')],'UserId':_0x2c8daa['id'],'queue_name':_0x5abc96['name'],'ChatQueueId':_0x5abc96['id'],'interface':util[_0x4a27('0x6a')]('%s/%s',_0x4a27('0x6b'),_0x2c8daa[_0x4a27('0x39')]),'penalty':0x0,'paused':_0x2c8daa[_0x4a27('0x68')],'createdAt':_0x2c8daa[_0x4a27('0x6c')],'updatedAt':_0x2c8daa['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4a27('0x21')](respondWithFilteredResult(_0x3573b1,_0x4650b1))['catch'](handleError(_0x3573b1,null));};exports['getTeams']=function(_0x4bc59b,_0x593fcf,_0x1d8ad){var _0x31b06c={};var _0x16a3f0={};var _0x302950;var _0xf3cf0b;return db['ChatQueue'][_0x4a27('0x6d')]({'where':{'id':_0x4bc59b[_0x4a27('0x54')]['id']}})['then'](handleEntityNotFound(_0x593fcf,null))[_0x4a27('0x21')](function(_0x3fd916){if(_0x3fd916){_0x302950=_0x3fd916;_0x16a3f0[_0x4a27('0x40')]=_[_0x4a27('0x42')](db[_0x4a27('0x6e')]['rawAttributes']);_0x16a3f0[_0x4a27('0x41')]=_[_0x4a27('0x42')](_0x4bc59b['query']);_0x16a3f0[_0x4a27('0x43')]=_[_0x4a27('0x44')](_0x16a3f0[_0x4a27('0x40')],_0x16a3f0[_0x4a27('0x41')]);_0x31b06c[_0x4a27('0x46')]=_[_0x4a27('0x44')](_0x16a3f0[_0x4a27('0x40')],qs['fields'](_0x4bc59b[_0x4a27('0x41')]['fields']));_0x31b06c[_0x4a27('0x46')]=_0x31b06c['attributes'][_0x4a27('0x63')]?_0x31b06c['attributes']:_0x16a3f0[_0x4a27('0x40')];_0x31b06c[_0x4a27('0x47')]=qs['sort'](_0x4bc59b[_0x4a27('0x41')][_0x4a27('0x48')]);_0x31b06c[_0x4a27('0x49')]=qs[_0x4a27('0x43')](_[_0x4a27('0x6f')](_0x4bc59b[_0x4a27('0x41')],_0x16a3f0['filters']));if(_0x4bc59b['query'][_0x4a27('0x4a')]){_0x31b06c[_0x4a27('0x49')]=_[_0x4a27('0x4c')](_0x31b06c[_0x4a27('0x49')],{'$or':_[_0x4a27('0x3c')](_0x31b06c[_0x4a27('0x46')],function(_0x2d86d9){var _0x3305be={};_0x3305be[_0x2d86d9]={'$like':'%'+_0x4bc59b[_0x4a27('0x41')][_0x4a27('0x4a')]+'%'};return _0x3305be;})});}_0x31b06c=_['merge']({},_0x31b06c,_0x4bc59b[_0x4a27('0x4d')]);return _0x302950[_0x4a27('0x70')](_0x31b06c);}})[_0x4a27('0x21')](function(_0x20c81b){if(_0x20c81b){_0xf3cf0b=_0x20c81b[_0x4a27('0x63')];if(!_0x4bc59b[_0x4a27('0x41')][_0x4a27('0x64')](_0x4a27('0x65'))){_0x31b06c['limit']=qs['limit'](_0x4bc59b[_0x4a27('0x41')][_0x4a27('0x30')]);_0x31b06c[_0x4a27('0x2e')]=qs[_0x4a27('0x2e')](_0x4bc59b[_0x4a27('0x41')][_0x4a27('0x2e')]);}return _0x302950[_0x4a27('0x70')](_0x31b06c);}})[_0x4a27('0x21')](function(_0x1cae37){if(_0x1cae37){return _0x1cae37?{'count':_0xf3cf0b,'rows':_0x1cae37}:null;}})[_0x4a27('0x21')](respondWithResult(_0x593fcf,null))['catch'](handleError(_0x593fcf,null));};exports[_0x4a27('0x71')]=function(_0x40000a,_0x53f51e,_0x39c0a7){var _0x5989d8=_0x40000a[_0x4a27('0x57')][_0x4a27('0x72')];return db['Team'][_0x4a27('0x50')]({'where':{'id':_0x5989d8},'attributes':['id'],'include':[{'model':db[_0x4a27('0x73')],'as':_0x4a27('0x74'),'attributes':['id','name','online',_0x4a27('0x75'),_0x4a27('0x76')],'raw':!![]}]})[_0x4a27('0x21')](function(_0x257d36){if(_0x257d36){var _0x14330b=_[_0x4a27('0x77')](_0x257d36,function(_0x34a149){var _0x51f000=_0x34a149[_0x4a27('0x36')]({'plain':!![]});return _0x51f000[_0x4a27('0x74')];});return db[_0x4a27('0x3d')]['find']({'where':{'id':_0x40000a[_0x4a27('0x54')]['id']}})[_0x4a27('0x21')](function(_0x22ad20){return db[_0x4a27('0x78')][_0x4a27('0x79')](function(_0x450862){return _0x22ad20[_0x4a27('0x71')](_0x5989d8,{'transaction':_0x450862})[_0x4a27('0x21')](function(){return BPromise[_0x4a27('0x7a')](_0x14330b,function(_0x15157b){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x15157b['id'],'ChatQueueId':_0x40000a[_0x4a27('0x54')]['id']},'transaction':_0x450862});});})[_0x4a27('0x21')](function(){_0x14330b['forEach'](function(_0x36fb6a){socket[_0x4a27('0x7b')](_0x4a27('0x7c'),{'UserId':_0x36fb6a['id'],'ChatQueueId':_0x22ad20['id']});});});});});}})[_0x4a27('0x21')](respondWithStatusCode(_0x53f51e,null))['catch'](handleError(_0x53f51e,null));};exports[_0x4a27('0x7d')]=function(_0x3214d6,_0x4eabd7,_0x303882){return db[_0x4a27('0x6e')][_0x4a27('0x50')]({'where':{'id':_0x3214d6[_0x4a27('0x41')][_0x4a27('0x72')]},'attributes':['id'],'include':[{'model':db[_0x4a27('0x73')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4a27('0x21')](handleEntityNotFound(_0x4eabd7,null))[_0x4a27('0x21')](function(_0x37fadb){var _0x56d7ac=_['map'](_0x37fadb,'id');var _0x4da1aa=[];var _0x359ccf=[];var _0x4aa944=squel[_0x4a27('0x7e')]();_0x4aa944[_0x4a27('0x7f')]('tq.TeamId')[_0x4a27('0x80')](_0x4a27('0x81'),'tq')[_0x4a27('0x82')](_0x4a27('0x83'),'ut',_0x4a27('0x84'))[_0x4a27('0x49')]('ChatQueueId\x20=\x20?',_0x3214d6[_0x4a27('0x54')]['id']);for(var _0x43b3d0=0x0;_0x43b3d0<_0x37fadb['length'];_0x43b3d0+=0x1){let _0x28b49b=_0x37fadb[_0x43b3d0];for(var _0x427d58=0x0;_0x427d58<_0x28b49b['Agents'][_0x4a27('0x63')];_0x427d58+=0x1){let _0x1de678=_0x28b49b['Agents'][_0x427d58];var _0x20a61e=_0x4aa944[_0x4a27('0x85')]();_0x20a61e[_0x4a27('0x49')](_0x4a27('0x86'),_0x1de678['id']);_0x359ccf[_0x4a27('0x87')](db['sequelize'][_0x4a27('0x41')](_0x20a61e[_0x4a27('0x88')](),{'type':db[_0x4a27('0x78')]['QueryTypes'][_0x4a27('0x89')]})['then'](function(_0x2eea04){if(_0x2eea04['length']===0x1){return _0x1de678['id'];}else{var _0x329d15=_['every'](_[_0x4a27('0x3c')](_0x2eea04,_0x4a27('0x8a')),function(_0x5cc9e3){return _['includes'](_0x56d7ac,_0x5cc9e3);});if(_0x329d15){return _0x1de678['id'];}}}));}}return BPromise[_0x4a27('0x8b')](_0x359ccf)[_0x4a27('0x21')](function(_0x585fbc){_0x4da1aa=_(_0x4da1aa)[_0x4a27('0x8c')](_0x585fbc)[_0x4a27('0x8d')]()[_0x4a27('0x8e')]();return db[_0x4a27('0x3d')][_0x4a27('0x5c')]({'where':{'id':_0x3214d6['params']['id']}})[_0x4a27('0x21')](function(_0x13ba10){return db[_0x4a27('0x78')][_0x4a27('0x79')](function(_0x662875){return _0x13ba10[_0x4a27('0x7d')](_0x3214d6['query']['ids'],{'transaction':_0x662875})[_0x4a27('0x21')](function(){if(!_[_0x4a27('0x8f')](_0x4da1aa)){return _0x13ba10[_0x4a27('0x90')](_0x4da1aa,{'transaction':_0x662875});}})[_0x4a27('0x21')](function(){_0x4da1aa[_0x4a27('0x91')](function(_0x97dbdb){socket[_0x4a27('0x7b')](_0x4a27('0x92'),{'UserId':_0x97dbdb,'ChatQueueId':_0x13ba10['id']});});});});});});})[_0x4a27('0x21')](respondWithStatusCode(_0x4eabd7,null))[_0x4a27('0x52')](handleError(_0x4eabd7,null));};exports[_0x4a27('0x93')]=function(_0x12924b,_0x11b218,_0x13fef0){return db['ChatQueue'][_0x4a27('0x5c')]({'where':{'id':_0x12924b['params']['id']}})['then'](handleEntityNotFound(_0x11b218,null))[_0x4a27('0x21')](function(_0x34cdf6){if(_0x34cdf6){return _0x34cdf6[_0x4a27('0x93')](_0x12924b['body'][_0x4a27('0x72')],_['omit'](_0x12924b[_0x4a27('0x57')],['ids','id'])||{})[_0x4a27('0x94')](function(_0x494565){for(var _0x63b55d=0x0;_0x63b55d<_0x12924b[_0x4a27('0x57')][_0x4a27('0x72')][_0x4a27('0x63')];_0x63b55d+=0x1){socket[_0x4a27('0x7b')]('userChatQueue:save',{'UserId':Number(_0x12924b[_0x4a27('0x57')][_0x4a27('0x72')][_0x63b55d]),'ChatQueueId':Number(_0x12924b[_0x4a27('0x54')]['id'])});}return _0x494565;});}})[_0x4a27('0x21')](respondWithResult(_0x11b218,null))[_0x4a27('0x52')](handleError(_0x11b218,null));};exports[_0x4a27('0x90')]=function(_0x1d2ca5,_0x4178e0,_0x17b3db){return db[_0x4a27('0x3d')][_0x4a27('0x5c')]({'where':{'id':_0x1d2ca5[_0x4a27('0x54')]['id']}})[_0x4a27('0x21')](handleEntityNotFound(_0x4178e0,null))[_0x4a27('0x21')](function(_0x2d04bf){if(_0x2d04bf){return _0x2d04bf[_0x4a27('0x90')](_0x1d2ca5[_0x4a27('0x41')][_0x4a27('0x72')])[_0x4a27('0x21')](function(){if(_[_0x4a27('0x95')](_0x1d2ca5[_0x4a27('0x41')][_0x4a27('0x72')])){for(var _0x55806f=0x0;_0x55806f<_0x1d2ca5[_0x4a27('0x41')][_0x4a27('0x72')][_0x4a27('0x63')];_0x55806f+=0x1){socket[_0x4a27('0x7b')](_0x4a27('0x92'),{'UserId':Number(_0x1d2ca5['query'][_0x4a27('0x72')][_0x55806f]),'ChatQueueId':Number(_0x1d2ca5[_0x4a27('0x54')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x1d2ca5['query'][_0x4a27('0x72')]),'ChatQueueId':Number(_0x1d2ca5[_0x4a27('0x54')]['id'])});}});}})[_0x4a27('0x21')](respondWithStatusCode(_0x4178e0,null))[_0x4a27('0x52')](handleError(_0x4178e0,null));};exports[_0x4a27('0x96')]=function(_0x1388cc,_0x8a0ff2,_0x3eb9d2){var _0x238fc2={};var _0x49de68={};var _0x440ca5;var _0x38a2e1;return db['ChatQueue'][_0x4a27('0x6d')]({'where':{'id':_0x1388cc[_0x4a27('0x54')]['id']}})[_0x4a27('0x21')](handleEntityNotFound(_0x8a0ff2,null))[_0x4a27('0x21')](function(_0x150d6a){if(_0x150d6a){_0x440ca5=_0x150d6a;_0x49de68[_0x4a27('0x40')]=_[_0x4a27('0x42')](db['User'][_0x4a27('0x55')]);_0x49de68[_0x4a27('0x41')]=_['keys'](_0x1388cc[_0x4a27('0x41')]);_0x49de68['filters']=_[_0x4a27('0x44')](_0x49de68[_0x4a27('0x40')],_0x49de68[_0x4a27('0x41')]);_0x238fc2['attributes']=_[_0x4a27('0x44')](_0x49de68['model'],qs['fields'](_0x1388cc[_0x4a27('0x41')][_0x4a27('0x45')]));_0x238fc2[_0x4a27('0x46')]=_0x238fc2[_0x4a27('0x46')]['length']?_0x238fc2[_0x4a27('0x46')]:_0x49de68[_0x4a27('0x40')];_0x238fc2[_0x4a27('0x47')]=qs[_0x4a27('0x48')](_0x1388cc[_0x4a27('0x41')][_0x4a27('0x48')]);_0x238fc2[_0x4a27('0x49')]=qs[_0x4a27('0x43')](_['pick'](_0x1388cc[_0x4a27('0x41')],_0x49de68[_0x4a27('0x43')]));if(_0x1388cc['query'][_0x4a27('0x4a')]){_0x238fc2[_0x4a27('0x49')]=_[_0x4a27('0x4c')](_0x238fc2[_0x4a27('0x49')],{'$or':_[_0x4a27('0x3c')](_0x238fc2[_0x4a27('0x46')],function(_0x6bd208){var _0x3922f1={};_0x3922f1[_0x6bd208]={'$like':'%'+_0x1388cc[_0x4a27('0x41')][_0x4a27('0x4a')]+'%'};return _0x3922f1;})});}_0x238fc2=_[_0x4a27('0x4c')]({},_0x238fc2,_0x1388cc[_0x4a27('0x4d')]);return _0x440ca5[_0x4a27('0x96')](_0x238fc2);}})['then'](function(_0x40f8bf){if(_0x40f8bf){_0x38a2e1=_0x40f8bf['length'];if(!_0x1388cc[_0x4a27('0x41')][_0x4a27('0x64')]('nolimit')){_0x238fc2[_0x4a27('0x30')]=qs[_0x4a27('0x30')](_0x1388cc[_0x4a27('0x41')]['limit']);_0x238fc2[_0x4a27('0x2e')]=qs['offset'](_0x1388cc['query'][_0x4a27('0x2e')]);}return _0x440ca5[_0x4a27('0x96')](_0x238fc2);}})['then'](function(_0x24c69a){if(_0x24c69a){return _0x24c69a?{'count':_0x38a2e1,'rows':_0x24c69a}:null;}})[_0x4a27('0x21')](respondWithResult(_0x8a0ff2,null))[_0x4a27('0x52')](handleError(_0x8a0ff2,null));};
\ No newline at end of file
+var _0xb7a5=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','get','ChatQueues','UserProfileResource','destroy','stack','name','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','params','Team','addTeams','ids','Agents','interface','flatMap','transaction','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeAgents','userChatQueue:remove','addAgents','omit','isArray','emit','getAgents','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xb7a5,0x1bf));var _0x5b7a=function(_0x2d8dfb,_0x1768b5){_0x2d8dfb=_0x2d8dfb-0x0;var _0x59b6a6=_0xb7a5[_0x2d8dfb];return _0x59b6a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b7a('0x0'));var zipdir=require(_0x5b7a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b7a('0x2'));var moment=require(_0x5b7a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5b7a('0x4'));var util=require('util');var path=require(_0x5b7a('0x5'));var sox=require(_0x5b7a('0x6'));var csv=require(_0x5b7a('0x7'));var ejs=require(_0x5b7a('0x8'));var fs=require('fs');var fs_extra=require(_0x5b7a('0x9'));var _=require(_0x5b7a('0xa'));var squel=require(_0x5b7a('0xb'));var crypto=require(_0x5b7a('0xc'));var jsforce=require(_0x5b7a('0xd'));var deskjs=require(_0x5b7a('0xe'));var toCsv=require(_0x5b7a('0x7'));var querystring=require('querystring');var Papa=require(_0x5b7a('0xf'));var Redis=require(_0x5b7a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5b7a('0x11'));var as=require(_0x5b7a('0x12'));var hardwareService=require(_0x5b7a('0x13'));var logger=require(_0x5b7a('0x14'))(_0x5b7a('0x15'));var utils=require(_0x5b7a('0x16'));var config=require(_0x5b7a('0x17'));var licenseUtil=require(_0x5b7a('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5b7a('0x19')](config[_0x5b7a('0x1a')],{'host':_0x5b7a('0x1b'),'port':0x18eb});var socket=require(_0x5b7a('0x1c'))(new Redis(config['redis']));require(_0x5b7a('0x1d'))[_0x5b7a('0x1e')](socket);var jayson=require(_0x5b7a('0x1f'));var client=jayson['client'][_0x5b7a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x37dd33,_0x5288a9,_0x5f4aff,_0x501502){return new BPromise(function(_0x20007c,_0x3a062e){var _0x1e8b08=_0x501502||client;return _0x1e8b08[_0x5b7a('0x21')](_0x37dd33,_0x5f4aff)[_0x5b7a('0x22')](function(_0x390a33){logger['info'](_0x5b7a('0x23'),_0x5288a9,_0x5b7a('0x24'));logger[_0x5b7a('0x25')](_0x5b7a('0x26'),_0x5288a9,_0x5b7a('0x24'),JSON[_0x5b7a('0x27')](_0x390a33));if(_0x390a33['error']){if(_0x390a33[_0x5b7a('0x28')][_0x5b7a('0x29')]===0x1f4){logger[_0x5b7a('0x28')]('ChatQueue,\x20%s,\x20%s',_0x5288a9,_0x390a33[_0x5b7a('0x28')][_0x5b7a('0x2a')]);return _0x3a062e(_0x390a33['error']['message']);}logger['error'](_0x5b7a('0x23'),_0x5288a9,_0x390a33['error'][_0x5b7a('0x2a')]);return _0x20007c(_0x390a33[_0x5b7a('0x28')][_0x5b7a('0x2a')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5288a9,_0x5b7a('0x24'));_0x20007c(_0x390a33[_0x5b7a('0x2b')][_0x5b7a('0x2a')]);}})[_0x5b7a('0x2c')](function(_0x65e050){logger[_0x5b7a('0x28')](_0x5b7a('0x23'),_0x5288a9,_0x65e050);_0x3a062e(_0x65e050);});});}function respondWithStatusCode(_0x3f2d8c,_0x42c91d){_0x42c91d=_0x42c91d||0xcc;return function(_0x586467){if(_0x586467){return _0x3f2d8c[_0x5b7a('0x2d')](_0x42c91d);}return _0x3f2d8c['status'](_0x42c91d)[_0x5b7a('0x2e')]();};}function respondWithResult(_0x22d9c8,_0x1227d1){_0x1227d1=_0x1227d1||0xc8;return function(_0x252c97){if(_0x252c97){return _0x22d9c8[_0x5b7a('0x2f')](_0x1227d1)['json'](_0x252c97);}};}function respondWithFilteredResult(_0x190f89,_0x570106){return function(_0x48856e){if(_0x48856e){var _0x4010d4=typeof _0x570106[_0x5b7a('0x30')]==='undefined'&&typeof _0x570106[_0x5b7a('0x31')]===_0x5b7a('0x32');var _0x52e00e=_0x48856e[_0x5b7a('0x33')];var _0x28d60a=_0x4010d4?0x0:_0x570106['offset'];var _0xc4bf9f=_0x4010d4?_0x48856e[_0x5b7a('0x33')]:_0x570106['offset']+_0x570106['limit'];var _0x1aabdb;if(_0xc4bf9f>=_0x52e00e){_0xc4bf9f=_0x52e00e;_0x1aabdb=0xc8;}else{_0x1aabdb=0xce;}_0x190f89[_0x5b7a('0x2f')](_0x1aabdb);return _0x190f89[_0x5b7a('0x34')](_0x5b7a('0x35'),_0x28d60a+'-'+_0xc4bf9f+'/'+_0x52e00e)[_0x5b7a('0x36')](_0x48856e);}return null;};}function patchUpdates(_0xd7800d){return function(_0x5aecd9){try{jsonpatch['apply'](_0x5aecd9,_0xd7800d,!![]);}catch(_0x5e18c6){return BPromise[_0x5b7a('0x37')](_0x5e18c6);}return _0x5aecd9[_0x5b7a('0x38')]();};}function saveUpdates(_0x163860,_0x5bf348){return function(_0x4a6828){if(_0x4a6828){return _0x4a6828[_0x5b7a('0x39')](_0x163860)[_0x5b7a('0x22')](function(_0x48d007){return _0x48d007;});}return null;};}function removeEntity(_0xb49571,_0x5a88fa){return function(_0x158c41){if(_0x158c41){return _0x158c41['destroy']()['then'](function(){var _0x5d2e29=_0x158c41[_0x5b7a('0x3a')]({'plain':!![]});var _0x5f3a1d=_0x5b7a('0x3b');return db[_0x5b7a('0x3c')][_0x5b7a('0x3d')]({'where':{'type':_0x5f3a1d,'resourceId':_0x5d2e29['id']}})[_0x5b7a('0x22')](function(){return _0x158c41;});})[_0x5b7a('0x22')](function(){_0xb49571[_0x5b7a('0x2f')](0xcc)[_0x5b7a('0x2e')]();});}};}function handleEntityNotFound(_0x11693f,_0x7f4e35){return function(_0x4a4582){if(!_0x4a4582){_0x11693f[_0x5b7a('0x2d')](0x194);}return _0x4a4582;};}function handleError(_0x5d6b91,_0x157365){_0x157365=_0x157365||0x1f4;return function(_0x2b82b0){logger[_0x5b7a('0x28')](_0x2b82b0[_0x5b7a('0x3e')]);if(_0x2b82b0[_0x5b7a('0x3f')]){delete _0x2b82b0[_0x5b7a('0x3f')];}_0x5d6b91[_0x5b7a('0x2f')](_0x157365)['send'](_0x2b82b0);};}exports['index']=function(_0x3ead99,_0x418582){var _0x274cbb={},_0xc88028={},_0x430b8c={'count':0x0,'rows':[]};var _0x1233d4=_[_0x5b7a('0x40')](db[_0x5b7a('0x41')][_0x5b7a('0x42')],function(_0x3eb94b){return{'name':_0x3eb94b[_0x5b7a('0x43')],'type':_0x3eb94b[_0x5b7a('0x44')][_0x5b7a('0x45')]};});_0xc88028[_0x5b7a('0x46')]=_[_0x5b7a('0x40')](_0x1233d4,'name');_0xc88028['query']=_['keys'](_0x3ead99[_0x5b7a('0x47')]);_0xc88028['filters']=_[_0x5b7a('0x48')](_0xc88028[_0x5b7a('0x46')],_0xc88028[_0x5b7a('0x47')]);_0x274cbb[_0x5b7a('0x49')]=_[_0x5b7a('0x48')](_0xc88028[_0x5b7a('0x46')],qs[_0x5b7a('0x4a')](_0x3ead99[_0x5b7a('0x47')]['fields']));_0x274cbb[_0x5b7a('0x49')]=_0x274cbb[_0x5b7a('0x49')]['length']?_0x274cbb[_0x5b7a('0x49')]:_0xc88028[_0x5b7a('0x46')];if(!_0x3ead99[_0x5b7a('0x47')][_0x5b7a('0x4b')](_0x5b7a('0x4c'))){_0x274cbb[_0x5b7a('0x31')]=qs[_0x5b7a('0x31')](_0x3ead99['query']['limit']);_0x274cbb[_0x5b7a('0x30')]=qs[_0x5b7a('0x30')](_0x3ead99[_0x5b7a('0x47')][_0x5b7a('0x30')]);}_0x274cbb[_0x5b7a('0x4d')]=qs[_0x5b7a('0x4e')](_0x3ead99[_0x5b7a('0x47')][_0x5b7a('0x4e')]);_0x274cbb[_0x5b7a('0x4f')]=qs[_0x5b7a('0x50')](_[_0x5b7a('0x51')](_0x3ead99[_0x5b7a('0x47')],_0xc88028[_0x5b7a('0x50')]),_0x1233d4);if(_0x3ead99[_0x5b7a('0x47')][_0x5b7a('0x52')]){_0x274cbb['where']=_[_0x5b7a('0x53')](_0x274cbb['where'],{'$or':_[_0x5b7a('0x40')](_0x1233d4,function(_0x34e57f){if(_0x34e57f['type']!==_0x5b7a('0x54')){var _0x5d6f30={};_0x5d6f30[_0x34e57f[_0x5b7a('0x3f')]]={'$like':'%'+_0x3ead99['query'][_0x5b7a('0x52')]+'%'};return _0x5d6f30;}})});}_0x274cbb=_[_0x5b7a('0x53')]({},_0x274cbb,_0x3ead99[_0x5b7a('0x55')]);var _0x43c200={'where':_0x274cbb['where']};return db[_0x5b7a('0x41')][_0x5b7a('0x33')](_0x43c200)[_0x5b7a('0x22')](function(_0xe2d3e4){_0x430b8c[_0x5b7a('0x33')]=_0xe2d3e4;if(_0x3ead99[_0x5b7a('0x47')][_0x5b7a('0x56')]){_0x274cbb[_0x5b7a('0x57')]=[{'all':!![]}];}return db[_0x5b7a('0x41')][_0x5b7a('0x58')](_0x274cbb);})['then'](function(_0x3b3085){_0x430b8c[_0x5b7a('0x59')]=_0x3b3085;return _0x430b8c;})[_0x5b7a('0x22')](respondWithFilteredResult(_0x418582,_0x274cbb))[_0x5b7a('0x2c')](handleError(_0x418582,null));};exports['show']=function(_0x12cbb7,_0x404049){var _0x2e631a={'raw':!![],'where':{'id':_0x12cbb7['params']['id']}},_0x10d27e={};_0x10d27e['model']=_[_0x5b7a('0x5a')](db[_0x5b7a('0x41')]['rawAttributes']);_0x10d27e['query']=_[_0x5b7a('0x5a')](_0x12cbb7['query']);_0x10d27e[_0x5b7a('0x50')]=_[_0x5b7a('0x48')](_0x10d27e[_0x5b7a('0x46')],_0x10d27e['query']);_0x2e631a[_0x5b7a('0x49')]=_['intersection'](_0x10d27e[_0x5b7a('0x46')],qs[_0x5b7a('0x4a')](_0x12cbb7[_0x5b7a('0x47')][_0x5b7a('0x4a')]));_0x2e631a[_0x5b7a('0x49')]=_0x2e631a[_0x5b7a('0x49')][_0x5b7a('0x5b')]?_0x2e631a[_0x5b7a('0x49')]:_0x10d27e[_0x5b7a('0x46')];if(_0x12cbb7['query'][_0x5b7a('0x56')]){_0x2e631a[_0x5b7a('0x57')]=[{'all':!![]}];}_0x2e631a=_[_0x5b7a('0x53')]({},_0x2e631a,_0x12cbb7['options']);return db[_0x5b7a('0x41')][_0x5b7a('0x5c')](_0x2e631a)['then'](handleEntityNotFound(_0x404049,null))[_0x5b7a('0x22')](respondWithResult(_0x404049,null))[_0x5b7a('0x2c')](handleError(_0x404049,null));};exports[_0x5b7a('0x5d')]=function(_0x451223,_0x129b93){return db['ChatQueue'][_0x5b7a('0x5d')](_0x451223[_0x5b7a('0x5e')],{})[_0x5b7a('0x22')](function(_0x5a96d6){var _0x7a7a76=_0x451223[_0x5b7a('0x5f')][_0x5b7a('0x3a')]({'plain':!![]});if(!_0x7a7a76)throw new Error(_0x5b7a('0x60'));if(_0x7a7a76[_0x5b7a('0x61')]===_0x5b7a('0x5f')){var _0x14a25f=_0x5a96d6[_0x5b7a('0x3a')]({'plain':!![]});var _0x2da68f='ChatQueues';return db[_0x5b7a('0x62')][_0x5b7a('0x5c')]({'where':{'name':_0x2da68f,'userProfileId':_0x7a7a76[_0x5b7a('0x63')]},'raw':!![]})[_0x5b7a('0x22')](function(_0x3c60a5){if(_0x3c60a5&&_0x3c60a5[_0x5b7a('0x64')]===0x0){return db[_0x5b7a('0x3c')][_0x5b7a('0x5d')]({'name':_0x14a25f[_0x5b7a('0x3f')],'resourceId':_0x14a25f['id'],'type':_0x3c60a5['name'],'sectionId':_0x3c60a5['id']},{})['then'](function(){return _0x5a96d6;});}else{return _0x5a96d6;}})['catch'](function(_0x54fa37){logger[_0x5b7a('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54fa37);throw _0x54fa37;});}return _0x5a96d6;})[_0x5b7a('0x22')](respondWithResult(_0x129b93,0xc9))[_0x5b7a('0x2c')](handleError(_0x129b93,null));};exports[_0x5b7a('0x39')]=function(_0x33ad36,_0x484dd1){if(_0x33ad36[_0x5b7a('0x5e')]['id']){delete _0x33ad36[_0x5b7a('0x5e')]['id'];}return db['ChatQueue'][_0x5b7a('0x5c')]({'where':{'id':_0x33ad36['params']['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x484dd1,null))[_0x5b7a('0x22')](saveUpdates(_0x33ad36[_0x5b7a('0x5e')],null))['then'](respondWithResult(_0x484dd1,null))[_0x5b7a('0x2c')](handleError(_0x484dd1,null));};exports[_0x5b7a('0x3d')]=function(_0xa057d,_0x49c3d8){return db[_0x5b7a('0x41')][_0x5b7a('0x5c')]({'where':{'id':_0xa057d['params']['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x49c3d8,null))[_0x5b7a('0x22')](removeEntity(_0x49c3d8,null))[_0x5b7a('0x2c')](handleError(_0x49c3d8,null));};exports[_0x5b7a('0x65')]=function(_0x243855,_0x226897){return db['ChatQueue'][_0x5b7a('0x65')]()[_0x5b7a('0x22')](respondWithResult(_0x226897,null))[_0x5b7a('0x2c')](handleError(_0x226897,null));};exports[_0x5b7a('0x66')]=function(_0x17de3d,_0x30a66b,_0xc8e8a3){var _0x2d8dcd={'raw':!![],'where':{}},_0x5e3b6d={},_0x489c93;return db['ChatQueue'][_0x5b7a('0x67')]({'where':{'id':_0x17de3d['params']['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x30a66b,null))['then'](function(_0x2a2d89){if(_0x2a2d89){_0x489c93=_0x2a2d89['get']({'plain':!![]});_0x5e3b6d[_0x5b7a('0x46')]=_[_0x5b7a('0x5a')](db[_0x5b7a('0x68')]['rawAttributes']);_0x5e3b6d['query']=_['keys'](_0x17de3d[_0x5b7a('0x47')]);_0x5e3b6d[_0x5b7a('0x50')]=_[_0x5b7a('0x48')](_0x5e3b6d[_0x5b7a('0x46')],_0x5e3b6d[_0x5b7a('0x47')]);_0x2d8dcd[_0x5b7a('0x49')]=_['intersection'](_0x5e3b6d[_0x5b7a('0x46')],qs[_0x5b7a('0x4a')](_0x17de3d[_0x5b7a('0x47')][_0x5b7a('0x4a')]));_0x2d8dcd[_0x5b7a('0x49')]=_0x2d8dcd[_0x5b7a('0x49')][_0x5b7a('0x5b')]?_0x2d8dcd[_0x5b7a('0x49')]:_0x5e3b6d[_0x5b7a('0x46')];if(!_0x17de3d[_0x5b7a('0x47')][_0x5b7a('0x4b')](_0x5b7a('0x4c'))){_0x2d8dcd[_0x5b7a('0x31')]=qs[_0x5b7a('0x31')](_0x17de3d['query'][_0x5b7a('0x31')]);_0x2d8dcd[_0x5b7a('0x30')]=qs[_0x5b7a('0x30')](_0x17de3d[_0x5b7a('0x47')][_0x5b7a('0x30')]);}_0x2d8dcd[_0x5b7a('0x4d')]=qs[_0x5b7a('0x4e')](_0x17de3d[_0x5b7a('0x47')]['sort']);_0x2d8dcd['where']=qs[_0x5b7a('0x50')](_['pick'](_0x17de3d['query'],_0x5e3b6d[_0x5b7a('0x50')]));_0x2d8dcd[_0x5b7a('0x4f')][_0x5b7a('0x69')]=_0x2a2d89['id'];if(_0x17de3d[_0x5b7a('0x47')][_0x5b7a('0x52')]){_0x2d8dcd['where']=_[_0x5b7a('0x53')](_0x2d8dcd[_0x5b7a('0x4f')],{'$or':_['map'](_0x2d8dcd[_0x5b7a('0x49')],function(_0x494ad4){var _0x2bb4a6={};_0x2bb4a6[_0x494ad4]={'$like':'%'+_0x17de3d[_0x5b7a('0x47')][_0x5b7a('0x52')]+'%'};return _0x2bb4a6;})});}_0x2d8dcd=_[_0x5b7a('0x53')]({},_0x2d8dcd,_0x17de3d[_0x5b7a('0x55')]);return db[_0x5b7a('0x68')][_0x5b7a('0x58')](_0x2d8dcd);}})['then'](function(_0x4dc286){if(_0x4dc286){return db[_0x5b7a('0x6a')][_0x5b7a('0x6b')]({'where':{'id':_[_0x5b7a('0x40')](_0x4dc286,_0x5b7a('0x6c')),'role':_0x5b7a('0x6d')},'attributes':['id','name',_0x5b7a('0x6e'),_0x5b7a('0x6f'),_0x5b7a('0x70')]});}})[_0x5b7a('0x22')](function(_0x1e8e88){if(_0x1e8e88){return{'count':_0x1e8e88[_0x5b7a('0x33')],'rows':_[_0x5b7a('0x40')](_0x1e8e88['rows'],function(_0xa05e1){return{'membername':_0xa05e1['name'],'UserId':_0xa05e1['id'],'queue_name':_0x489c93[_0x5b7a('0x3f')],'ChatQueueId':_0x489c93['id'],'interface':util[_0x5b7a('0x71')](_0x5b7a('0x72'),_0x5b7a('0x73'),_0xa05e1[_0x5b7a('0x3f')]),'penalty':0x0,'paused':_0xa05e1[_0x5b7a('0x6e')],'createdAt':_0xa05e1[_0x5b7a('0x70')],'updatedAt':_0xa05e1[_0x5b7a('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5b7a('0x22')](respondWithFilteredResult(_0x30a66b,_0x2d8dcd))[_0x5b7a('0x2c')](handleError(_0x30a66b,null));};exports[_0x5b7a('0x74')]=function(_0x28e7fa,_0x372feb,_0x12b8df){var _0x3109c5={};var _0x328186={};var _0x47bce;var _0x2582cb;return db[_0x5b7a('0x41')][_0x5b7a('0x67')]({'where':{'id':_0x28e7fa[_0x5b7a('0x75')]['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x372feb,null))[_0x5b7a('0x22')](function(_0x46c6ed){if(_0x46c6ed){_0x47bce=_0x46c6ed;_0x328186['model']=_[_0x5b7a('0x5a')](db[_0x5b7a('0x76')]['rawAttributes']);_0x328186['query']=_[_0x5b7a('0x5a')](_0x28e7fa[_0x5b7a('0x47')]);_0x328186['filters']=_[_0x5b7a('0x48')](_0x328186[_0x5b7a('0x46')],_0x328186[_0x5b7a('0x47')]);_0x3109c5[_0x5b7a('0x49')]=_['intersection'](_0x328186[_0x5b7a('0x46')],qs[_0x5b7a('0x4a')](_0x28e7fa['query'][_0x5b7a('0x4a')]));_0x3109c5[_0x5b7a('0x49')]=_0x3109c5[_0x5b7a('0x49')][_0x5b7a('0x5b')]?_0x3109c5[_0x5b7a('0x49')]:_0x328186[_0x5b7a('0x46')];_0x3109c5['order']=qs[_0x5b7a('0x4e')](_0x28e7fa['query'][_0x5b7a('0x4e')]);_0x3109c5[_0x5b7a('0x4f')]=qs[_0x5b7a('0x50')](_[_0x5b7a('0x51')](_0x28e7fa[_0x5b7a('0x47')],_0x328186[_0x5b7a('0x50')]));if(_0x28e7fa[_0x5b7a('0x47')][_0x5b7a('0x52')]){_0x3109c5[_0x5b7a('0x4f')]=_['merge'](_0x3109c5[_0x5b7a('0x4f')],{'$or':_[_0x5b7a('0x40')](_0x3109c5['attributes'],function(_0x19c68b){var _0x1465dc={};_0x1465dc[_0x19c68b]={'$like':'%'+_0x28e7fa['query'][_0x5b7a('0x52')]+'%'};return _0x1465dc;})});}_0x3109c5=_[_0x5b7a('0x53')]({},_0x3109c5,_0x28e7fa[_0x5b7a('0x55')]);return _0x47bce[_0x5b7a('0x74')](_0x3109c5);}})[_0x5b7a('0x22')](function(_0x45d5d8){if(_0x45d5d8){_0x2582cb=_0x45d5d8[_0x5b7a('0x5b')];if(!_0x28e7fa['query']['hasOwnProperty'](_0x5b7a('0x4c'))){_0x3109c5[_0x5b7a('0x31')]=qs[_0x5b7a('0x31')](_0x28e7fa[_0x5b7a('0x47')]['limit']);_0x3109c5[_0x5b7a('0x30')]=qs['offset'](_0x28e7fa[_0x5b7a('0x47')]['offset']);}return _0x47bce['getTeams'](_0x3109c5);}})[_0x5b7a('0x22')](function(_0x361e96){if(_0x361e96){return _0x361e96?{'count':_0x2582cb,'rows':_0x361e96}:null;}})[_0x5b7a('0x22')](respondWithResult(_0x372feb,null))[_0x5b7a('0x2c')](handleError(_0x372feb,null));};exports[_0x5b7a('0x77')]=function(_0x2ebb3d,_0x27928d,_0x127890){var _0x597337=_0x2ebb3d[_0x5b7a('0x5e')][_0x5b7a('0x78')];return db[_0x5b7a('0x76')][_0x5b7a('0x58')]({'where':{'id':_0x597337},'attributes':['id'],'include':[{'model':db[_0x5b7a('0x6a')],'as':_0x5b7a('0x79'),'attributes':['id','name','online','voicePause',_0x5b7a('0x7a')],'raw':!![]}]})['then'](function(_0x423d14){if(_0x423d14){var _0x330809=_[_0x5b7a('0x7b')](_0x423d14,function(_0x46f27e){var _0x4b894a=_0x46f27e[_0x5b7a('0x3a')]({'plain':!![]});return _0x4b894a[_0x5b7a('0x79')];});return db[_0x5b7a('0x41')][_0x5b7a('0x5c')]({'where':{'id':_0x2ebb3d[_0x5b7a('0x75')]['id']}})[_0x5b7a('0x22')](function(_0x9ad87c){return db['sequelize'][_0x5b7a('0x7c')](function(_0xcd5d37){return _0x9ad87c[_0x5b7a('0x77')](_0x597337,{'transaction':_0xcd5d37})[_0x5b7a('0x22')](function(){return BPromise['each'](_0x330809,function(_0x3d28dc){return db[_0x5b7a('0x68')]['findOrCreate']({'where':{'UserId':_0x3d28dc['id'],'ChatQueueId':_0x2ebb3d['params']['id']},'transaction':_0xcd5d37});});})['then'](function(){_0x330809[_0x5b7a('0x7d')](function(_0x44756d){socket['emit'](_0x5b7a('0x7e'),{'UserId':_0x44756d['id'],'ChatQueueId':_0x9ad87c['id']});});});});});}})[_0x5b7a('0x22')](respondWithStatusCode(_0x27928d,null))[_0x5b7a('0x2c')](handleError(_0x27928d,null));};exports[_0x5b7a('0x7f')]=function(_0x136616,_0x4e2753,_0x26fb1a){return db[_0x5b7a('0x76')]['findAll']({'where':{'id':_0x136616['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5b7a('0x79'),'attributes':['id'],'raw':!![]}]})[_0x5b7a('0x22')](handleEntityNotFound(_0x4e2753,null))[_0x5b7a('0x22')](function(_0x202ad0){var _0x4eb133=_[_0x5b7a('0x40')](_0x202ad0,'id');var _0x353fea=[];var _0x22037e=[];var _0x32a273=squel[_0x5b7a('0x80')]();_0x32a273[_0x5b7a('0x81')](_0x5b7a('0x82'))[_0x5b7a('0x83')]('team_has_chat_queues','tq')[_0x5b7a('0x84')](_0x5b7a('0x85'),'ut',_0x5b7a('0x86'))[_0x5b7a('0x4f')](_0x5b7a('0x87'),_0x136616[_0x5b7a('0x75')]['id']);for(var _0x439c45=0x0;_0x439c45<_0x202ad0['length'];_0x439c45+=0x1){let _0x5a63b4=_0x202ad0[_0x439c45];for(var _0x1bf28b=0x0;_0x1bf28b<_0x5a63b4[_0x5b7a('0x79')][_0x5b7a('0x5b')];_0x1bf28b+=0x1){let _0x574f8a=_0x5a63b4[_0x5b7a('0x79')][_0x1bf28b];var _0x547c9d=_0x32a273['clone']();_0x547c9d[_0x5b7a('0x4f')](_0x5b7a('0x88'),_0x574f8a['id']);_0x22037e[_0x5b7a('0x89')](db[_0x5b7a('0x8a')]['query'](_0x547c9d[_0x5b7a('0x8b')](),{'type':db[_0x5b7a('0x8a')][_0x5b7a('0x8c')][_0x5b7a('0x8d')]})[_0x5b7a('0x22')](function(_0x561e7a){if(_0x561e7a[_0x5b7a('0x5b')]===0x1){return _0x574f8a['id'];}else{var _0x3d7e3b=_[_0x5b7a('0x8e')](_[_0x5b7a('0x40')](_0x561e7a,_0x5b7a('0x8f')),function(_0x487164){return _[_0x5b7a('0x90')](_0x4eb133,_0x487164);});if(_0x3d7e3b){return _0x574f8a['id'];}}}));}}return BPromise[_0x5b7a('0x91')](_0x22037e)[_0x5b7a('0x22')](function(_0x1059c0){_0x353fea=_(_0x353fea)[_0x5b7a('0x92')](_0x1059c0)[_0x5b7a('0x93')]()['value']();return db['ChatQueue'][_0x5b7a('0x5c')]({'where':{'id':_0x136616[_0x5b7a('0x75')]['id']}})[_0x5b7a('0x22')](function(_0x307523){return db[_0x5b7a('0x8a')][_0x5b7a('0x7c')](function(_0x54b1fb){return _0x307523[_0x5b7a('0x7f')](_0x136616[_0x5b7a('0x47')]['ids'],{'transaction':_0x54b1fb})[_0x5b7a('0x22')](function(){if(!_['isEmpty'](_0x353fea)){return _0x307523[_0x5b7a('0x94')](_0x353fea,{'transaction':_0x54b1fb});}})[_0x5b7a('0x22')](function(){_0x353fea[_0x5b7a('0x7d')](function(_0x33ab00){socket['emit'](_0x5b7a('0x95'),{'UserId':_0x33ab00,'ChatQueueId':_0x307523['id']});});});});});});})['then'](respondWithStatusCode(_0x4e2753,null))['catch'](handleError(_0x4e2753,null));};exports[_0x5b7a('0x96')]=function(_0x391a92,_0x1dd8da,_0x41af76){return db[_0x5b7a('0x41')][_0x5b7a('0x5c')]({'where':{'id':_0x391a92[_0x5b7a('0x75')]['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x1dd8da,null))['then'](function(_0xaec571){if(_0xaec571){return _0xaec571[_0x5b7a('0x96')](_0x391a92[_0x5b7a('0x5e')][_0x5b7a('0x78')],_[_0x5b7a('0x97')](_0x391a92[_0x5b7a('0x5e')],[_0x5b7a('0x78'),'id'])||{})['spread'](function(_0x560f4c){for(var _0x5874fe=0x0;_0x5874fe<_0x391a92['body']['ids'][_0x5b7a('0x5b')];_0x5874fe+=0x1){socket['emit'](_0x5b7a('0x7e'),{'UserId':Number(_0x391a92[_0x5b7a('0x5e')][_0x5b7a('0x78')][_0x5874fe]),'ChatQueueId':Number(_0x391a92[_0x5b7a('0x75')]['id'])});}return _0x560f4c;});}})[_0x5b7a('0x22')](respondWithResult(_0x1dd8da,null))['catch'](handleError(_0x1dd8da,null));};exports[_0x5b7a('0x94')]=function(_0x4ecc07,_0x3fbff4,_0x345748){return db[_0x5b7a('0x41')]['find']({'where':{'id':_0x4ecc07[_0x5b7a('0x75')]['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x3fbff4,null))[_0x5b7a('0x22')](function(_0x210bf7){if(_0x210bf7){return _0x210bf7[_0x5b7a('0x94')](_0x4ecc07['query']['ids'])['then'](function(){if(_[_0x5b7a('0x98')](_0x4ecc07['query'][_0x5b7a('0x78')])){for(var _0x2cbe08=0x0;_0x2cbe08<_0x4ecc07[_0x5b7a('0x47')][_0x5b7a('0x78')]['length'];_0x2cbe08+=0x1){socket[_0x5b7a('0x99')](_0x5b7a('0x95'),{'UserId':Number(_0x4ecc07[_0x5b7a('0x47')][_0x5b7a('0x78')][_0x2cbe08]),'ChatQueueId':Number(_0x4ecc07[_0x5b7a('0x75')]['id'])});}}else{socket['emit'](_0x5b7a('0x95'),{'UserId':Number(_0x4ecc07[_0x5b7a('0x47')][_0x5b7a('0x78')]),'ChatQueueId':Number(_0x4ecc07[_0x5b7a('0x75')]['id'])});}});}})['then'](respondWithStatusCode(_0x3fbff4,null))[_0x5b7a('0x2c')](handleError(_0x3fbff4,null));};exports[_0x5b7a('0x9a')]=function(_0x3008f9,_0x2efca4,_0x322021){var _0x256251={};var _0x4664d3={};var _0x3c9021;var _0x4b1aad;return db[_0x5b7a('0x41')]['findOne']({'where':{'id':_0x3008f9['params']['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x2efca4,null))[_0x5b7a('0x22')](function(_0x43e0d0){if(_0x43e0d0){_0x3c9021=_0x43e0d0;_0x4664d3[_0x5b7a('0x46')]=_[_0x5b7a('0x5a')](db[_0x5b7a('0x6a')]['rawAttributes']);_0x4664d3[_0x5b7a('0x47')]=_[_0x5b7a('0x5a')](_0x3008f9['query']);_0x4664d3[_0x5b7a('0x50')]=_[_0x5b7a('0x48')](_0x4664d3[_0x5b7a('0x46')],_0x4664d3[_0x5b7a('0x47')]);_0x256251['attributes']=_[_0x5b7a('0x48')](_0x4664d3['model'],qs[_0x5b7a('0x4a')](_0x3008f9[_0x5b7a('0x47')]['fields']));_0x256251[_0x5b7a('0x49')]=_0x256251[_0x5b7a('0x49')][_0x5b7a('0x5b')]?_0x256251[_0x5b7a('0x49')]:_0x4664d3[_0x5b7a('0x46')];_0x256251[_0x5b7a('0x4d')]=qs[_0x5b7a('0x4e')](_0x3008f9[_0x5b7a('0x47')]['sort']);_0x256251['where']=qs[_0x5b7a('0x50')](_['pick'](_0x3008f9['query'],_0x4664d3[_0x5b7a('0x50')]));if(_0x3008f9[_0x5b7a('0x47')][_0x5b7a('0x52')]){_0x256251[_0x5b7a('0x4f')]=_[_0x5b7a('0x53')](_0x256251[_0x5b7a('0x4f')],{'$or':_[_0x5b7a('0x40')](_0x256251[_0x5b7a('0x49')],function(_0x110217){var _0xae8662={};_0xae8662[_0x110217]={'$like':'%'+_0x3008f9['query'][_0x5b7a('0x52')]+'%'};return _0xae8662;})});}_0x256251=_[_0x5b7a('0x53')]({},_0x256251,_0x3008f9['options']);return _0x3c9021[_0x5b7a('0x9a')](_0x256251);}})['then'](function(_0x37046a){if(_0x37046a){_0x4b1aad=_0x37046a[_0x5b7a('0x5b')];if(!_0x3008f9[_0x5b7a('0x47')][_0x5b7a('0x4b')](_0x5b7a('0x4c'))){_0x256251[_0x5b7a('0x31')]=qs[_0x5b7a('0x31')](_0x3008f9[_0x5b7a('0x47')][_0x5b7a('0x31')]);_0x256251['offset']=qs[_0x5b7a('0x30')](_0x3008f9[_0x5b7a('0x47')][_0x5b7a('0x30')]);}return _0x3c9021[_0x5b7a('0x9a')](_0x256251);}})[_0x5b7a('0x22')](function(_0x3506b9){if(_0x3506b9){return _0x3506b9?{'count':_0x4b1aad,'rows':_0x3506b9}:null;}})[_0x5b7a('0x22')](respondWithResult(_0x2efca4,null))[_0x5b7a('0x2c')](handleError(_0x2efca4,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index aa548d2..5703406 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 _0xe458=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x385879,_0x3135be){var _0x5652ef=function(_0x560be5){while(--_0x560be5){_0x385879['push'](_0x385879['shift']());}};_0x5652ef(++_0x3135be);}(_0xe458,0x6c));var _0x8e45=function(_0xe46b62,_0x4c0026){_0xe46b62=_0xe46b62-0x0;var _0x502552=_0xe458[_0xe46b62];return _0x502552;};'use strict';var EventEmitter=require(_0x8e45('0x0'));var ChatQueue=require(_0x8e45('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8e45('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e45('0x3'),'afterDestroy':_0x8e45('0x4')};function emitEvent(_0x942c83){return function(_0x236d56,_0x517d7e,_0x499820){ChatQueueEvents['emit'](_0x942c83+':'+_0x236d56['id'],_0x236d56);ChatQueueEvents[_0x8e45('0x5')](_0x942c83,_0x236d56);_0x499820(null);};}for(var e in events){if(events[_0x8e45('0x6')](e)){var event=events[e];ChatQueue[_0x8e45('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xa93a=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','save','update'];(function(_0x4a0156,_0x26e36e){var _0x13f19e=function(_0x2e8d16){while(--_0x2e8d16){_0x4a0156['push'](_0x4a0156['shift']());}};_0x13f19e(++_0x26e36e);}(_0xa93a,0x16c));var _0xaa93=function(_0x31a198,_0x53a914){_0x31a198=_0x31a198-0x0;var _0x112841=_0xa93a[_0x31a198];return _0x112841;};'use strict';var EventEmitter=require(_0xaa93('0x0'));var ChatQueue=require(_0xaa93('0x1'))['db'][_0xaa93('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaa93('0x3'),'afterUpdate':_0xaa93('0x4'),'afterDestroy':_0xaa93('0x5')};function emitEvent(_0x534d94){return function(_0x1a142e,_0x1baeff,_0x1810ca){ChatQueueEvents['emit'](_0x534d94+':'+_0x1a142e['id'],_0x1a142e);ChatQueueEvents[_0xaa93('0x6')](_0x534d94,_0x1a142e);_0x1810ca(null);};}for(var e in events){if(events[_0xaa93('0x7')](e)){var event=events[e];ChatQueue[_0xaa93('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 29ed419..f7be447 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 _0x30f0=['request-promise','path','rimraf','define','ChatQueue','lodash','../../config/logger','api','moment','bluebird'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x30f0,0x18b));var _0x030f=function(_0x33d8c7,_0x300227){_0x33d8c7=_0x33d8c7-0x0;var _0x2fe482=_0x30f0[_0x33d8c7];return _0x2fe482;};'use strict';var _=require(_0x030f('0x0'));var util=require('util');var logger=require(_0x030f('0x1'))(_0x030f('0x2'));var moment=require(_0x030f('0x3'));var BPromise=require(_0x030f('0x4'));var rp=require(_0x030f('0x5'));var fs=require('fs');var path=require(_0x030f('0x6'));var rimraf=require(_0x030f('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module['exports']=function(_0xc9abc1,_0xe30dc1){return _0xc9abc1[_0x030f('0x8')](_0x030f('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0710=['../../config/environment','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x378f34,_0x43ed5a){var _0x2f19e6=function(_0x1bd0b5){while(--_0x1bd0b5){_0x378f34['push'](_0x378f34['shift']());}};_0x2f19e6(++_0x43ed5a);}(_0x0710,0x67));var _0x0071=function(_0x3a3aa2,_0x16fada){_0x3a3aa2=_0x3a3aa2-0x0;var _0x2beb2a=_0x0710[_0x3a3aa2];return _0x2beb2a;};'use strict';var _=require(_0x0071('0x0'));var util=require(_0x0071('0x1'));var logger=require(_0x0071('0x2'))(_0x0071('0x3'));var moment=require(_0x0071('0x4'));var BPromise=require(_0x0071('0x5'));var rp=require(_0x0071('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0071('0x7'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x24fcd7,_0x2b1aa9){return _0x24fcd7['define'](_0x0071('0x8'),attributes,{'tableName':_0x0071('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 7d0e2d4..6ca8182 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 _0x5a3c=['include','map','model','ChatQueue','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x5a3c,0x176));var _0xc5a3=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5a3c[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xc5a3('0x0'));var util=require(_0xc5a3('0x1'));var moment=require(_0xc5a3('0x2'));var BPromise=require('bluebird');var rs=require(_0xc5a3('0x3'));var fs=require('fs');var Redis=require(_0xc5a3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5a3('0x5'));var logger=require(_0xc5a3('0x6'))(_0xc5a3('0x7'));var config=require(_0xc5a3('0x8'));var jayson=require(_0xc5a3('0x9'));var client=jayson[_0xc5a3('0xa')][_0xc5a3('0xb')]({'port':0x232a});config[_0xc5a3('0xc')]=_[_0xc5a3('0xd')](config[_0xc5a3('0xc')],{'host':_0xc5a3('0xe'),'port':0x18eb});var socket=require(_0xc5a3('0xf'))(new Redis(config[_0xc5a3('0xc')]));require(_0xc5a3('0x10'))['register'](socket);function respondWithRpcPromise(_0x3fc7ce,_0x354369,_0x12411a){return new BPromise(function(_0x4406c1,_0x264554){return client[_0xc5a3('0x11')](_0x3fc7ce,_0x12411a)[_0xc5a3('0x12')](function(_0xcece45){logger[_0xc5a3('0x13')]('ChatQueue,\x20%s,\x20%s',_0x354369,_0xc5a3('0x14'));logger[_0xc5a3('0x15')](_0xc5a3('0x16'),_0x354369,_0xc5a3('0x14'),JSON[_0xc5a3('0x17')](_0xcece45));if(_0xcece45[_0xc5a3('0x18')]){if(_0xcece45[_0xc5a3('0x18')][_0xc5a3('0x19')]===0x1f4){logger[_0xc5a3('0x18')](_0xc5a3('0x1a'),_0x354369,_0xcece45[_0xc5a3('0x18')][_0xc5a3('0x1b')]);return _0x264554(_0xcece45[_0xc5a3('0x18')][_0xc5a3('0x1b')]);}logger[_0xc5a3('0x18')](_0xc5a3('0x1a'),_0x354369,_0xcece45[_0xc5a3('0x18')]['message']);return _0x4406c1(_0xcece45[_0xc5a3('0x18')][_0xc5a3('0x1b')]);}else{logger['info'](_0xc5a3('0x1a'),_0x354369,_0xc5a3('0x14'));_0x4406c1(_0xcece45[_0xc5a3('0x1c')][_0xc5a3('0x1b')]);}})[_0xc5a3('0x1d')](function(_0x3d9834){logger[_0xc5a3('0x18')](_0xc5a3('0x1a'),_0x354369,_0x3d9834);_0x264554(_0x3d9834);});});}exports[_0xc5a3('0x1e')]=function(_0x401f98){var _0x22dd74=this;return new Promise(function(_0x4d1b8f,_0x429885){return db['ChatQueue'][_0xc5a3('0x1f')]({'raw':_0x401f98[_0xc5a3('0x20')]?_0x401f98[_0xc5a3('0x20')][_0xc5a3('0x21')]===undefined?!![]:![]:!![],'where':_0x401f98[_0xc5a3('0x20')]?_0x401f98['options'][_0xc5a3('0x22')]||null:null,'attributes':_0x401f98['options']?_0x401f98['options'][_0xc5a3('0x23')]||null:null,'limit':_0x401f98[_0xc5a3('0x20')]?_0x401f98[_0xc5a3('0x20')]['limit']||null:null,'include':_0x401f98['options']?_0x401f98['options'][_0xc5a3('0x24')]?_[_0xc5a3('0x25')](_0x401f98[_0xc5a3('0x20')]['include'],function(_0x52650f){return{'model':db[_0x52650f[_0xc5a3('0x26')]],'as':_0x52650f['as'],'attributes':_0x52650f['attributes'],'include':_0x52650f[_0xc5a3('0x24')]?_[_0xc5a3('0x25')](_0x52650f[_0xc5a3('0x24')],function(_0x198022){return{'model':db[_0x198022[_0xc5a3('0x26')]],'as':_0x198022['as'],'attributes':_0x198022['attributes'],'include':_0x198022[_0xc5a3('0x24')]?_['map'](_0x198022['include'],function(_0x40e15a){return{'model':db[_0x40e15a[_0xc5a3('0x26')]],'as':_0x40e15a['as'],'attributes':_0x40e15a[_0xc5a3('0x23')]};}):[]};}):[]};}):[]:[]})[_0xc5a3('0x12')](function(_0x393f2c){logger[_0xc5a3('0x13')](_0xc5a3('0x1e'),_0x401f98);logger[_0xc5a3('0x15')]('GetChatQueue',_0x401f98,JSON['stringify'](_0x393f2c));_0x4d1b8f(_0x393f2c);})['catch'](function(_0x4a180f){logger['error'](_0xc5a3('0x1e'),_0x4a180f[_0xc5a3('0x1b')],_0x401f98);_0x429885(_0x22dd74[_0xc5a3('0x18')](0x1f4,_0x4a180f[_0xc5a3('0x1b')]));});});};exports['ShowChatQueue']=function(_0x38d403){var _0x521090=this;return new Promise(function(_0x1cec54,_0x4bbc4d){return db[_0xc5a3('0x27')]['find']({'raw':_0x38d403[_0xc5a3('0x20')]?_0x38d403[_0xc5a3('0x20')][_0xc5a3('0x21')]===undefined?!![]:![]:!![],'where':_0x38d403[_0xc5a3('0x20')]?_0x38d403[_0xc5a3('0x20')]['where']||null:null,'attributes':_0x38d403[_0xc5a3('0x20')]?_0x38d403[_0xc5a3('0x20')][_0xc5a3('0x23')]||null:null,'include':_0x38d403[_0xc5a3('0x20')]?_0x38d403[_0xc5a3('0x20')]['include']?_[_0xc5a3('0x25')](_0x38d403[_0xc5a3('0x20')][_0xc5a3('0x24')],function(_0x4d0992){return{'model':db[_0x4d0992[_0xc5a3('0x26')]],'as':_0x4d0992['as'],'attributes':_0x4d0992[_0xc5a3('0x23')],'include':_0x4d0992['include']?_['map'](_0x4d0992['include'],function(_0x98d666){return{'model':db[_0x98d666[_0xc5a3('0x26')]],'as':_0x98d666['as'],'attributes':_0x98d666[_0xc5a3('0x23')],'include':_0x98d666['include']?_[_0xc5a3('0x25')](_0x98d666['include'],function(_0x4564bc){return{'model':db[_0x4564bc[_0xc5a3('0x26')]],'as':_0x4564bc['as'],'attributes':_0x4564bc[_0xc5a3('0x23')]};}):[]};}):[]};}):[]:[]})[_0xc5a3('0x12')](function(_0x26ed96){logger['info'](_0xc5a3('0x28'),_0x38d403);logger[_0xc5a3('0x15')]('ShowChatQueue',_0x38d403,JSON[_0xc5a3('0x17')](_0x26ed96));_0x1cec54(_0x26ed96);})['catch'](function(_0x3de593){logger[_0xc5a3('0x18')](_0xc5a3('0x28'),_0x3de593[_0xc5a3('0x1b')],_0x38d403);_0x4bbc4d(_0x521090[_0xc5a3('0x18')](0x1f4,_0x3de593[_0xc5a3('0x1b')]));});});};
\ No newline at end of file
+var _0x082a=['findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','find','ShowChatQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatQueue'];(function(_0x6f76f5,_0xaa19d4){var _0x11d801=function(_0x57acee){while(--_0x57acee){_0x6f76f5['push'](_0x6f76f5['shift']());}};_0x11d801(++_0xaa19d4);}(_0x082a,0x154));var _0xa082=function(_0x291bc2,_0xb2d760){_0x291bc2=_0x291bc2-0x0;var _0x269d3c=_0x082a[_0x291bc2];return _0x269d3c;};'use strict';var _=require('lodash');var util=require(_0xa082('0x0'));var moment=require(_0xa082('0x1'));var BPromise=require(_0xa082('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa082('0x3'));var db=require(_0xa082('0x4'))['db'];var utils=require(_0xa082('0x5'));var logger=require(_0xa082('0x6'))(_0xa082('0x7'));var config=require('../../config/environment');var jayson=require(_0xa082('0x8'));var client=jayson['client'][_0xa082('0x9')]({'port':0x232a});config[_0xa082('0xa')]=_['defaults'](config[_0xa082('0xa')],{'host':_0xa082('0xb'),'port':0x18eb});var socket=require(_0xa082('0xc'))(new Redis(config['redis']));require(_0xa082('0xd'))[_0xa082('0xe')](socket);function respondWithRpcPromise(_0xd359ef,_0x46b66d,_0x7c826c){return new BPromise(function(_0x494ef6,_0x1fcf69){return client[_0xa082('0xf')](_0xd359ef,_0x7c826c)[_0xa082('0x10')](function(_0x5798dc){logger['info'](_0xa082('0x11'),_0x46b66d,_0xa082('0x12'));logger[_0xa082('0x13')](_0xa082('0x14'),_0x46b66d,'request\x20sent',JSON[_0xa082('0x15')](_0x5798dc));if(_0x5798dc[_0xa082('0x16')]){if(_0x5798dc[_0xa082('0x16')][_0xa082('0x17')]===0x1f4){logger[_0xa082('0x16')](_0xa082('0x11'),_0x46b66d,_0x5798dc['error'][_0xa082('0x18')]);return _0x1fcf69(_0x5798dc[_0xa082('0x16')]['message']);}logger[_0xa082('0x16')](_0xa082('0x11'),_0x46b66d,_0x5798dc[_0xa082('0x16')][_0xa082('0x18')]);return _0x494ef6(_0x5798dc['error']['message']);}else{logger[_0xa082('0x19')](_0xa082('0x11'),_0x46b66d,'request\x20sent');_0x494ef6(_0x5798dc[_0xa082('0x1a')]['message']);}})[_0xa082('0x1b')](function(_0x284376){logger[_0xa082('0x16')](_0xa082('0x11'),_0x46b66d,_0x284376);_0x1fcf69(_0x284376);});});}exports['GetChatQueue']=function(_0x318663){var _0x18f765=this;return new Promise(function(_0x48f656,_0x24befc){return db[_0xa082('0x1c')][_0xa082('0x1d')]({'raw':_0x318663[_0xa082('0x1e')]?_0x318663['options'][_0xa082('0x1f')]===undefined?!![]:![]:!![],'where':_0x318663['options']?_0x318663[_0xa082('0x1e')][_0xa082('0x20')]||null:null,'attributes':_0x318663['options']?_0x318663[_0xa082('0x1e')][_0xa082('0x21')]||null:null,'limit':_0x318663['options']?_0x318663['options'][_0xa082('0x22')]||null:null,'include':_0x318663[_0xa082('0x1e')]?_0x318663[_0xa082('0x1e')][_0xa082('0x23')]?_[_0xa082('0x24')](_0x318663[_0xa082('0x1e')][_0xa082('0x23')],function(_0x457ca9){return{'model':db[_0x457ca9[_0xa082('0x25')]],'as':_0x457ca9['as'],'attributes':_0x457ca9[_0xa082('0x21')],'include':_0x457ca9[_0xa082('0x23')]?_[_0xa082('0x24')](_0x457ca9[_0xa082('0x23')],function(_0x2d6170){return{'model':db[_0x2d6170[_0xa082('0x25')]],'as':_0x2d6170['as'],'attributes':_0x2d6170[_0xa082('0x21')],'include':_0x2d6170[_0xa082('0x23')]?_[_0xa082('0x24')](_0x2d6170[_0xa082('0x23')],function(_0x22ace6){return{'model':db[_0x22ace6[_0xa082('0x25')]],'as':_0x22ace6['as'],'attributes':_0x22ace6[_0xa082('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa082('0x10')](function(_0x16e9bf){logger[_0xa082('0x19')](_0xa082('0x26'),_0x318663);logger['debug'](_0xa082('0x26'),_0x318663,JSON[_0xa082('0x15')](_0x16e9bf));_0x48f656(_0x16e9bf);})[_0xa082('0x1b')](function(_0x329bb2){logger[_0xa082('0x16')]('GetChatQueue',_0x329bb2[_0xa082('0x18')],_0x318663);_0x24befc(_0x18f765[_0xa082('0x16')](0x1f4,_0x329bb2['message']));});});};exports['ShowChatQueue']=function(_0x491652){var _0x17cc4b=this;return new Promise(function(_0x4247df,_0x31c10b){return db[_0xa082('0x1c')][_0xa082('0x27')]({'raw':_0x491652[_0xa082('0x1e')]?_0x491652[_0xa082('0x1e')][_0xa082('0x1f')]===undefined?!![]:![]:!![],'where':_0x491652[_0xa082('0x1e')]?_0x491652[_0xa082('0x1e')][_0xa082('0x20')]||null:null,'attributes':_0x491652[_0xa082('0x1e')]?_0x491652[_0xa082('0x1e')]['attributes']||null:null,'include':_0x491652['options']?_0x491652['options'][_0xa082('0x23')]?_[_0xa082('0x24')](_0x491652[_0xa082('0x1e')]['include'],function(_0x4c3291){return{'model':db[_0x4c3291[_0xa082('0x25')]],'as':_0x4c3291['as'],'attributes':_0x4c3291[_0xa082('0x21')],'include':_0x4c3291[_0xa082('0x23')]?_['map'](_0x4c3291[_0xa082('0x23')],function(_0x50d1b1){return{'model':db[_0x50d1b1[_0xa082('0x25')]],'as':_0x50d1b1['as'],'attributes':_0x50d1b1[_0xa082('0x21')],'include':_0x50d1b1['include']?_[_0xa082('0x24')](_0x50d1b1[_0xa082('0x23')],function(_0x5a30d1){return{'model':db[_0x5a30d1[_0xa082('0x25')]],'as':_0x5a30d1['as'],'attributes':_0x5a30d1['attributes']};}):[]};}):[]};}):[]:[]})[_0xa082('0x10')](function(_0x32079c){logger[_0xa082('0x19')](_0xa082('0x28'),_0x491652);logger[_0xa082('0x13')](_0xa082('0x28'),_0x491652,JSON[_0xa082('0x15')](_0x32079c));_0x4247df(_0x32079c);})['catch'](function(_0xa942c9){logger[_0xa082('0x16')](_0xa082('0x28'),_0xa942c9[_0xa082('0x18')],_0x491652);_0x31c10b(_0x17cc4b[_0xa082('0x16')](0x1f4,_0xa942c9[_0xa082('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index b874f90..e1f7020 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x72b1,0x16e));var _0x172b=function(_0x192611,_0x4e75ce){_0x192611=_0x192611-0x0;var _0x124c55=_0x72b1[_0x192611];return _0x124c55;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}};
\ No newline at end of file
+var _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x36768a,_0x32fa68){var _0x18706e=function(_0x4adfc3){while(--_0x4adfc3){_0x36768a['push'](_0x36768a['shift']());}};_0x18706e(++_0x32fa68);}(_0xe107,0xb3));var _0x7e10=function(_0x43c03f,_0x5f21af){_0x43c03f=_0x43c03f-0x0;var _0x4fec76=_0xe107[_0x43c03f];return _0x4fec76;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index a6d858c..328fdf5 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3e74,0x175));var _0x43e7=function(_0xf74839,_0x4381f8){_0xf74839=_0xf74839-0x0;var _0x1153a4=_0x3e74[_0xf74839];return _0x1153a4;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x92958f,_0x44430b){var _0x1e406d=function(_0x42699d){while(--_0x42699d){_0x92958f['push'](_0x92958f['shift']());}};_0x1e406d(++_0x44430b);}(_0x55ca,0x126));var _0xa55c=function(_0x170941,_0x38d105){_0x170941=_0x170941-0x0;var _0x50e48d=_0x55ca[_0x170941];return _0x50e48d;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 8996636..b90856f 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 _0x9bb9=['moment','sequelize','STRING','DATE'];(function(_0x3b362c,_0x3fca6b){var _0x5a9c36=function(_0x2c1fcd){while(--_0x2c1fcd){_0x3b362c['push'](_0x3b362c['shift']());}};_0x5a9c36(++_0x3fca6b);}(_0x9bb9,0x84));var _0x99bb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9bb9[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x99bb('0x0'));var Sequelize=require(_0x99bb('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x99bb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x99bb('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x99bb('0x3')]},'exitAt':{'type':Sequelize[_0x99bb('0x3')]},'reason':{'type':Sequelize[_0x99bb('0x2')]}};
\ No newline at end of file
+var _0xe1ff=['moment','sequelize','exports','STRING','DATE'];(function(_0x4e3e62,_0x1059a8){var _0x4a34df=function(_0x4fcfc1){while(--_0x4fcfc1){_0x4e3e62['push'](_0x4e3e62['shift']());}};_0x4a34df(++_0x1059a8);}(_0xe1ff,0x1e0));var _0xfe1f=function(_0x210e49,_0x4acbc2){_0x210e49=_0x210e49-0x0;var _0x20559b=_0xe1ff[_0x210e49];return _0x20559b;};'use strict';var moment=require(_0xfe1f('0x0'));var Sequelize=require(_0xfe1f('0x1'));module[_0xfe1f('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfe1f('0x3')]},'joinAt':{'type':Sequelize[_0xfe1f('0x4')]},'leaveAt':{'type':Sequelize[_0xfe1f('0x4')]},'acceptAt':{'type':Sequelize[_0xfe1f('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfe1f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 70b151f..d0e3501 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 _0x5430=['update','then','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save'];(function(_0x41f3ee,_0x1e03f6){var _0x38406a=function(_0x376ec1){while(--_0x376ec1){_0x41f3ee['push'](_0x41f3ee['shift']());}};_0x38406a(++_0x1e03f6);}(_0x5430,0x10c));var _0x0543=function(_0x166fe1,_0xb302bb){_0x166fe1=_0x166fe1-0x0;var _0x1f059c=_0x5430[_0x166fe1];return _0x1f059c;};'use strict';var emlformat=require(_0x0543('0x0'));var rimraf=require(_0x0543('0x1'));var zipdir=require(_0x0543('0x2'));var jsonpatch=require(_0x0543('0x3'));var rp=require(_0x0543('0x4'));var moment=require(_0x0543('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0543('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0543('0x7'));var ejs=require(_0x0543('0x8'));var fs=require('fs');var fs_extra=require(_0x0543('0x9'));var _=require(_0x0543('0xa'));var squel=require(_0x0543('0xb'));var crypto=require('crypto');var jsforce=require(_0x0543('0xc'));var deskjs=require(_0x0543('0xd'));var toCsv=require(_0x0543('0x7'));var querystring=require(_0x0543('0xe'));var Papa=require(_0x0543('0xf'));var Redis=require(_0x0543('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0543('0x11'));var as=require(_0x0543('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0543('0x13'))(_0x0543('0x14'));var utils=require(_0x0543('0x15'));var config=require(_0x0543('0x16'));var licenseUtil=require(_0x0543('0x17'));var db=require(_0x0543('0x18'))['db'];function respondWithStatusCode(_0x30c54e,_0x27290d){_0x27290d=_0x27290d||0xcc;return function(_0x46d176){if(_0x46d176){return _0x30c54e[_0x0543('0x19')](_0x27290d);}return _0x30c54e[_0x0543('0x1a')](_0x27290d)[_0x0543('0x1b')]();};}function respondWithResult(_0x552980,_0x4f1f2a){_0x4f1f2a=_0x4f1f2a||0xc8;return function(_0x21e9ac){if(_0x21e9ac){return _0x552980['status'](_0x4f1f2a)['json'](_0x21e9ac);}};}function respondWithFilteredResult(_0xcb09df,_0x40fb03){return function(_0x1dff7d){if(_0x1dff7d){var _0x1cfadf=typeof _0x40fb03[_0x0543('0x1c')]==='undefined'&&typeof _0x40fb03[_0x0543('0x1d')]===_0x0543('0x1e');var _0x2dd5cb=_0x1dff7d[_0x0543('0x1f')];var _0x20b396=_0x1cfadf?0x0:_0x40fb03[_0x0543('0x1c')];var _0x577cf0=_0x1cfadf?_0x1dff7d['count']:_0x40fb03[_0x0543('0x1c')]+_0x40fb03['limit'];var _0x50ea84;if(_0x577cf0>=_0x2dd5cb){_0x577cf0=_0x2dd5cb;_0x50ea84=0xc8;}else{_0x50ea84=0xce;}_0xcb09df[_0x0543('0x1a')](_0x50ea84);return _0xcb09df[_0x0543('0x20')](_0x0543('0x21'),_0x20b396+'-'+_0x577cf0+'/'+_0x2dd5cb)['json'](_0x1dff7d);}return null;};}function patchUpdates(_0x3f0452){return function(_0x51c271){try{jsonpatch[_0x0543('0x22')](_0x51c271,_0x3f0452,!![]);}catch(_0x411ec2){return BPromise['reject'](_0x411ec2);}return _0x51c271[_0x0543('0x23')]();};}function saveUpdates(_0x333c72,_0x427919){return function(_0x110060){if(_0x110060){return _0x110060[_0x0543('0x24')](_0x333c72)[_0x0543('0x25')](function(_0x4adba7){return _0x4adba7;});}return null;};}function removeEntity(_0x5979d2,_0x59f1b2){return function(_0xbfe5dc){if(_0xbfe5dc){return _0xbfe5dc[_0x0543('0x26')]()[_0x0543('0x25')](function(){_0x5979d2[_0x0543('0x1a')](0xcc)[_0x0543('0x1b')]();});}};}function handleEntityNotFound(_0x26e500,_0x36d824){return function(_0x17a3de){if(!_0x17a3de){_0x26e500[_0x0543('0x19')](0x194);}return _0x17a3de;};}function handleError(_0xf1eccf,_0x40a261){_0x40a261=_0x40a261||0x1f4;return function(_0x21fc63){logger['error'](_0x21fc63[_0x0543('0x27')]);if(_0x21fc63[_0x0543('0x28')]){delete _0x21fc63[_0x0543('0x28')];}_0xf1eccf['status'](_0x40a261)[_0x0543('0x29')](_0x21fc63);};}exports[_0x0543('0x2a')]=function(_0x41c4a7,_0x10b881){var _0x5dd789={},_0x1732be={},_0x10b9f3={'count':0x0,'rows':[]};var _0x492f60=_['map'](db[_0x0543('0x2b')][_0x0543('0x2c')],function(_0x51d49d){return{'name':_0x51d49d[_0x0543('0x2d')],'type':_0x51d49d[_0x0543('0x2e')][_0x0543('0x2f')]};});_0x1732be[_0x0543('0x30')]=_[_0x0543('0x31')](_0x492f60,_0x0543('0x28'));_0x1732be[_0x0543('0x32')]=_['keys'](_0x41c4a7[_0x0543('0x32')]);_0x1732be['filters']=_[_0x0543('0x33')](_0x1732be[_0x0543('0x30')],_0x1732be[_0x0543('0x32')]);_0x5dd789[_0x0543('0x34')]=_[_0x0543('0x33')](_0x1732be['model'],qs[_0x0543('0x35')](_0x41c4a7['query'][_0x0543('0x35')]));_0x5dd789[_0x0543('0x34')]=_0x5dd789[_0x0543('0x34')][_0x0543('0x36')]?_0x5dd789['attributes']:_0x1732be[_0x0543('0x30')];if(!_0x41c4a7['query'][_0x0543('0x37')](_0x0543('0x38'))){_0x5dd789[_0x0543('0x1d')]=qs[_0x0543('0x1d')](_0x41c4a7[_0x0543('0x32')][_0x0543('0x1d')]);_0x5dd789[_0x0543('0x1c')]=qs[_0x0543('0x1c')](_0x41c4a7[_0x0543('0x32')][_0x0543('0x1c')]);}_0x5dd789['order']=qs[_0x0543('0x39')](_0x41c4a7[_0x0543('0x32')]['sort']);_0x5dd789[_0x0543('0x3a')]=qs['filters'](_[_0x0543('0x3b')](_0x41c4a7[_0x0543('0x32')],_0x1732be['filters']),_0x492f60);if(_0x41c4a7['query'][_0x0543('0x3c')]){_0x5dd789[_0x0543('0x3a')]=_['merge'](_0x5dd789[_0x0543('0x3a')],{'$or':_[_0x0543('0x31')](_0x492f60,function(_0x54543f){if(_0x54543f[_0x0543('0x2e')]!==_0x0543('0x3d')){var _0x3ecd70={};_0x3ecd70[_0x54543f[_0x0543('0x28')]]={'$like':'%'+_0x41c4a7[_0x0543('0x32')]['filter']+'%'};return _0x3ecd70;}})});}_0x5dd789=_['merge']({},_0x5dd789,_0x41c4a7['options']);var _0x486d9c={'where':_0x5dd789[_0x0543('0x3a')]};return db[_0x0543('0x2b')][_0x0543('0x1f')](_0x486d9c)['then'](function(_0xc66396){_0x10b9f3[_0x0543('0x1f')]=_0xc66396;if(_0x41c4a7[_0x0543('0x32')][_0x0543('0x3e')]){_0x5dd789[_0x0543('0x3f')]=[{'all':!![]}];}return db[_0x0543('0x2b')][_0x0543('0x40')](_0x5dd789);})['then'](function(_0x24a891){_0x10b9f3[_0x0543('0x41')]=_0x24a891;return _0x10b9f3;})[_0x0543('0x25')](respondWithFilteredResult(_0x10b881,_0x5dd789))[_0x0543('0x42')](handleError(_0x10b881,null));};exports[_0x0543('0x43')]=function(_0x43b7e8,_0x5bf53d){var _0x53dfb8={'raw':!![],'where':{'id':_0x43b7e8[_0x0543('0x44')]['id']}},_0x44116a={};_0x44116a[_0x0543('0x30')]=_[_0x0543('0x45')](db[_0x0543('0x2b')][_0x0543('0x2c')]);_0x44116a[_0x0543('0x32')]=_[_0x0543('0x45')](_0x43b7e8[_0x0543('0x32')]);_0x44116a['filters']=_['intersection'](_0x44116a[_0x0543('0x30')],_0x44116a[_0x0543('0x32')]);_0x53dfb8['attributes']=_['intersection'](_0x44116a[_0x0543('0x30')],qs[_0x0543('0x35')](_0x43b7e8['query'][_0x0543('0x35')]));_0x53dfb8['attributes']=_0x53dfb8[_0x0543('0x34')][_0x0543('0x36')]?_0x53dfb8['attributes']:_0x44116a['model'];if(_0x43b7e8[_0x0543('0x32')]['includeAll']){_0x53dfb8[_0x0543('0x3f')]=[{'all':!![]}];}_0x53dfb8=_[_0x0543('0x46')]({},_0x53dfb8,_0x43b7e8[_0x0543('0x47')]);return db[_0x0543('0x2b')][_0x0543('0x48')](_0x53dfb8)[_0x0543('0x25')](handleEntityNotFound(_0x5bf53d,null))['then'](respondWithResult(_0x5bf53d,null))[_0x0543('0x42')](handleError(_0x5bf53d,null));};exports[_0x0543('0x49')]=function(_0xb8076c,_0xf0a28f){return db[_0x0543('0x2b')]['create'](_0xb8076c[_0x0543('0x4a')],{})['then'](respondWithResult(_0xf0a28f,0xc9))[_0x0543('0x42')](handleError(_0xf0a28f,null));};exports[_0x0543('0x24')]=function(_0x3f4c40,_0x46d398){if(_0x3f4c40[_0x0543('0x4a')]['id']){delete _0x3f4c40[_0x0543('0x4a')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x3f4c40['params']['id']}})[_0x0543('0x25')](handleEntityNotFound(_0x46d398,null))[_0x0543('0x25')](saveUpdates(_0x3f4c40['body'],null))[_0x0543('0x25')](respondWithResult(_0x46d398,null))[_0x0543('0x42')](handleError(_0x46d398,null));};exports[_0x0543('0x26')]=function(_0x3d3bfc,_0x90dd22){return db[_0x0543('0x2b')]['find']({'where':{'id':_0x3d3bfc[_0x0543('0x44')]['id']}})[_0x0543('0x25')](handleEntityNotFound(_0x90dd22,null))[_0x0543('0x25')](removeEntity(_0x90dd22,null))[_0x0543('0x42')](handleError(_0x90dd22,null));};exports[_0x0543('0x4b')]=function(_0x449150,_0x265bc1){return db[_0x0543('0x2b')][_0x0543('0x4b')]()[_0x0543('0x25')](respondWithResult(_0x265bc1,null))[_0x0543('0x42')](handleError(_0x265bc1,null));};
\ No newline at end of file
+var _0x0650=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ChatQueueReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','rawAttributes','fieldName','key','model'];(function(_0x94b65,_0x2bbe54){var _0x21fd68=function(_0xfe60e8){while(--_0xfe60e8){_0x94b65['push'](_0x94b65['shift']());}};_0x21fd68(++_0x2bbe54);}(_0x0650,0xed));var _0x0065=function(_0x2db29c,_0xdfad2c){_0x2db29c=_0x2db29c-0x0;var _0x54a99c=_0x0650[_0x2db29c];return _0x54a99c;};'use strict';var emlformat=require(_0x0065('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0065('0x1'));var jsonpatch=require(_0x0065('0x2'));var rp=require('request-promise');var moment=require(_0x0065('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0065('0x4'));var util=require(_0x0065('0x5'));var path=require(_0x0065('0x6'));var sox=require('sox');var csv=require(_0x0065('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0065('0x8'));var crypto=require(_0x0065('0x9'));var jsforce=require(_0x0065('0xa'));var deskjs=require(_0x0065('0xb'));var toCsv=require(_0x0065('0x7'));var querystring=require(_0x0065('0xc'));var Papa=require(_0x0065('0xd'));var Redis=require(_0x0065('0xe'));var authService=require(_0x0065('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0065('0x10'));var hardwareService=require(_0x0065('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0065('0x12'));var licenseUtil=require(_0x0065('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45c7d1,_0x4255f6){_0x4255f6=_0x4255f6||0xcc;return function(_0x4c6296){if(_0x4c6296){return _0x45c7d1[_0x0065('0x14')](_0x4255f6);}return _0x45c7d1[_0x0065('0x15')](_0x4255f6)['end']();};}function respondWithResult(_0x5ae653,_0x1b9b1e){_0x1b9b1e=_0x1b9b1e||0xc8;return function(_0x5c0b74){if(_0x5c0b74){return _0x5ae653['status'](_0x1b9b1e)[_0x0065('0x16')](_0x5c0b74);}};}function respondWithFilteredResult(_0x5773d6,_0x38a870){return function(_0x48d817){if(_0x48d817){var _0x391fc1=typeof _0x38a870[_0x0065('0x17')]===_0x0065('0x18')&&typeof _0x38a870[_0x0065('0x19')]===_0x0065('0x18');var _0x34b0e2=_0x48d817[_0x0065('0x1a')];var _0x393d6e=_0x391fc1?0x0:_0x38a870['offset'];var _0x18bfa1=_0x391fc1?_0x48d817[_0x0065('0x1a')]:_0x38a870['offset']+_0x38a870[_0x0065('0x19')];var _0x3a0517;if(_0x18bfa1>=_0x34b0e2){_0x18bfa1=_0x34b0e2;_0x3a0517=0xc8;}else{_0x3a0517=0xce;}_0x5773d6[_0x0065('0x15')](_0x3a0517);return _0x5773d6[_0x0065('0x1b')](_0x0065('0x1c'),_0x393d6e+'-'+_0x18bfa1+'/'+_0x34b0e2)[_0x0065('0x16')](_0x48d817);}return null;};}function patchUpdates(_0x319e7a){return function(_0x529e30){try{jsonpatch['apply'](_0x529e30,_0x319e7a,!![]);}catch(_0x4b1213){return BPromise[_0x0065('0x1d')](_0x4b1213);}return _0x529e30[_0x0065('0x1e')]();};}function saveUpdates(_0x5b60c3,_0x2de3ae){return function(_0x5f1733){if(_0x5f1733){return _0x5f1733[_0x0065('0x1f')](_0x5b60c3)[_0x0065('0x20')](function(_0x3ec265){return _0x3ec265;});}return null;};}function removeEntity(_0x376452,_0x161b4c){return function(_0x1efa70){if(_0x1efa70){return _0x1efa70[_0x0065('0x21')]()['then'](function(){_0x376452[_0x0065('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4a4e,_0x3c715a){return function(_0x5924b3){if(!_0x5924b3){_0x4b4a4e[_0x0065('0x14')](0x194);}return _0x5924b3;};}function handleError(_0x6bf13b,_0x5db92c){_0x5db92c=_0x5db92c||0x1f4;return function(_0x123604){logger['error'](_0x123604['stack']);if(_0x123604[_0x0065('0x22')]){delete _0x123604[_0x0065('0x22')];}_0x6bf13b['status'](_0x5db92c)['send'](_0x123604);};}exports['index']=function(_0x51e091,_0x2e554f){var _0x1a977a={},_0x1f8813={},_0x369d08={'count':0x0,'rows':[]};var _0x4f15f5=_['map'](db['ChatQueueReport'][_0x0065('0x23')],function(_0x3a5286){return{'name':_0x3a5286[_0x0065('0x24')],'type':_0x3a5286['type'][_0x0065('0x25')]};});_0x1f8813[_0x0065('0x26')]=_['map'](_0x4f15f5,_0x0065('0x22'));_0x1f8813[_0x0065('0x27')]=_[_0x0065('0x28')](_0x51e091[_0x0065('0x27')]);_0x1f8813[_0x0065('0x29')]=_[_0x0065('0x2a')](_0x1f8813[_0x0065('0x26')],_0x1f8813[_0x0065('0x27')]);_0x1a977a['attributes']=_['intersection'](_0x1f8813['model'],qs[_0x0065('0x2b')](_0x51e091[_0x0065('0x27')][_0x0065('0x2b')]));_0x1a977a[_0x0065('0x2c')]=_0x1a977a[_0x0065('0x2c')][_0x0065('0x2d')]?_0x1a977a[_0x0065('0x2c')]:_0x1f8813['model'];if(!_0x51e091[_0x0065('0x27')][_0x0065('0x2e')](_0x0065('0x2f'))){_0x1a977a[_0x0065('0x19')]=qs[_0x0065('0x19')](_0x51e091['query'][_0x0065('0x19')]);_0x1a977a[_0x0065('0x17')]=qs[_0x0065('0x17')](_0x51e091[_0x0065('0x27')][_0x0065('0x17')]);}_0x1a977a[_0x0065('0x30')]=qs[_0x0065('0x31')](_0x51e091[_0x0065('0x27')][_0x0065('0x31')]);_0x1a977a[_0x0065('0x32')]=qs['filters'](_[_0x0065('0x33')](_0x51e091[_0x0065('0x27')],_0x1f8813[_0x0065('0x29')]),_0x4f15f5);if(_0x51e091['query'][_0x0065('0x34')]){_0x1a977a[_0x0065('0x32')]=_[_0x0065('0x35')](_0x1a977a[_0x0065('0x32')],{'$or':_[_0x0065('0x36')](_0x4f15f5,function(_0x231986){if(_0x231986['type']!==_0x0065('0x37')){var _0x2d1ba9={};_0x2d1ba9[_0x231986[_0x0065('0x22')]]={'$like':'%'+_0x51e091['query'][_0x0065('0x34')]+'%'};return _0x2d1ba9;}})});}_0x1a977a=_['merge']({},_0x1a977a,_0x51e091[_0x0065('0x38')]);var _0x37a434={'where':_0x1a977a['where']};return db[_0x0065('0x39')][_0x0065('0x1a')](_0x37a434)[_0x0065('0x20')](function(_0x3c1d6b){_0x369d08[_0x0065('0x1a')]=_0x3c1d6b;if(_0x51e091[_0x0065('0x27')]['includeAll']){_0x1a977a[_0x0065('0x3a')]=[{'all':!![]}];}return db[_0x0065('0x39')][_0x0065('0x3b')](_0x1a977a);})[_0x0065('0x20')](function(_0x1d251d){_0x369d08[_0x0065('0x3c')]=_0x1d251d;return _0x369d08;})[_0x0065('0x20')](respondWithFilteredResult(_0x2e554f,_0x1a977a))[_0x0065('0x3d')](handleError(_0x2e554f,null));};exports[_0x0065('0x3e')]=function(_0x41d6f7,_0x26cef9){var _0x32ab66={'raw':!![],'where':{'id':_0x41d6f7[_0x0065('0x3f')]['id']}},_0x35722d={};_0x35722d[_0x0065('0x26')]=_[_0x0065('0x28')](db[_0x0065('0x39')][_0x0065('0x23')]);_0x35722d[_0x0065('0x27')]=_[_0x0065('0x28')](_0x41d6f7[_0x0065('0x27')]);_0x35722d[_0x0065('0x29')]=_[_0x0065('0x2a')](_0x35722d['model'],_0x35722d[_0x0065('0x27')]);_0x32ab66['attributes']=_[_0x0065('0x2a')](_0x35722d['model'],qs[_0x0065('0x2b')](_0x41d6f7['query'][_0x0065('0x2b')]));_0x32ab66[_0x0065('0x2c')]=_0x32ab66[_0x0065('0x2c')]['length']?_0x32ab66['attributes']:_0x35722d[_0x0065('0x26')];if(_0x41d6f7[_0x0065('0x27')][_0x0065('0x40')]){_0x32ab66[_0x0065('0x3a')]=[{'all':!![]}];}_0x32ab66=_['merge']({},_0x32ab66,_0x41d6f7[_0x0065('0x38')]);return db[_0x0065('0x39')][_0x0065('0x41')](_0x32ab66)[_0x0065('0x20')](handleEntityNotFound(_0x26cef9,null))[_0x0065('0x20')](respondWithResult(_0x26cef9,null))['catch'](handleError(_0x26cef9,null));};exports[_0x0065('0x42')]=function(_0x5ef382,_0x339730){return db[_0x0065('0x39')][_0x0065('0x42')](_0x5ef382[_0x0065('0x43')],{})['then'](respondWithResult(_0x339730,0xc9))[_0x0065('0x3d')](handleError(_0x339730,null));};exports['update']=function(_0x86fa3d,_0x20b727){if(_0x86fa3d[_0x0065('0x43')]['id']){delete _0x86fa3d[_0x0065('0x43')]['id'];}return db[_0x0065('0x39')][_0x0065('0x41')]({'where':{'id':_0x86fa3d[_0x0065('0x3f')]['id']}})[_0x0065('0x20')](handleEntityNotFound(_0x20b727,null))[_0x0065('0x20')](saveUpdates(_0x86fa3d[_0x0065('0x43')],null))[_0x0065('0x20')](respondWithResult(_0x20b727,null))['catch'](handleError(_0x20b727,null));};exports[_0x0065('0x21')]=function(_0xcd7d13,_0x277b74){return db[_0x0065('0x39')][_0x0065('0x41')]({'where':{'id':_0xcd7d13[_0x0065('0x3f')]['id']}})[_0x0065('0x20')](handleEntityNotFound(_0x277b74,null))['then'](removeEntity(_0x277b74,null))['catch'](handleError(_0x277b74,null));};exports[_0x0065('0x44')]=function(_0x2da487,_0xf7e228){return db[_0x0065('0x39')][_0x0065('0x44')]()[_0x0065('0x20')](respondWithResult(_0xf7e228,null))[_0x0065('0x3d')](handleError(_0xf7e228,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index b3d3c89..8963017 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x27e2d9,_0x12a971){var _0x257582=function(_0xe49e76){while(--_0xe49e76){_0x27e2d9['push'](_0x27e2d9['shift']());}};_0x257582(++_0x12a971);}(_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
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0xbf171b,_0x21c916){var _0x21ab7e=function(_0x46a03d){while(--_0x46a03d){_0xbf171b['push'](_0xbf171b['shift']());}};_0x21ab7e(++_0x21c916);}(_0xe706,0xa3));var _0x6e70=function(_0x41cb4b,_0x200468){_0x41cb4b=_0x41cb4b-0x0;var _0x1719c1=_0xe706[_0x41cb4b];return _0x1719c1;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 1371e31..46da8fe 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 _0xde44=['CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xde44,0x160));var _0x4de4=function(_0x5bf388,_0x418bec){_0x5bf388=_0x5bf388-0x0;var _0x2d0577=_0xde44[_0x5bf388];return _0x2d0577;};'use strict';var _=require(_0x4de4('0x0'));var util=require(_0x4de4('0x1'));var moment=require(_0x4de4('0x2'));var BPromise=require(_0x4de4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4de4('0x4'));var db=require(_0x4de4('0x5'))['db'];var utils=require(_0x4de4('0x6'));var logger=require(_0x4de4('0x7'))(_0x4de4('0x8'));var config=require('../../config/environment');var jayson=require(_0x4de4('0x9'));var client=jayson['client'][_0x4de4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x406f08,_0x4f0c11,_0x4f13e7){return new BPromise(function(_0x18b3f6,_0x2d43e5){return client[_0x4de4('0xb')](_0x406f08,_0x4f13e7)['then'](function(_0xcd37c7){logger['info'](_0x4de4('0xc'),_0x4f0c11,'request\x20sent');logger[_0x4de4('0xd')](_0x4de4('0xe'),_0x4f0c11,'request\x20sent',JSON[_0x4de4('0xf')](_0xcd37c7));if(_0xcd37c7[_0x4de4('0x10')]){if(_0xcd37c7['error']['code']===0x1f4){logger[_0x4de4('0x10')](_0x4de4('0xc'),_0x4f0c11,_0xcd37c7[_0x4de4('0x10')]['message']);return _0x2d43e5(_0xcd37c7[_0x4de4('0x10')][_0x4de4('0x11')]);}logger[_0x4de4('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x4f0c11,_0xcd37c7[_0x4de4('0x10')]['message']);return _0x18b3f6(_0xcd37c7[_0x4de4('0x10')][_0x4de4('0x11')]);}else{logger[_0x4de4('0x12')](_0x4de4('0xc'),_0x4f0c11,_0x4de4('0x13'));_0x18b3f6(_0xcd37c7[_0x4de4('0x14')][_0x4de4('0x11')]);}})[_0x4de4('0x15')](function(_0x5c2ef2){logger[_0x4de4('0x10')](_0x4de4('0xc'),_0x4f0c11,_0x5c2ef2);_0x2d43e5(_0x5c2ef2);});});}exports[_0x4de4('0x16')]=function(_0x524d02){var _0x2ba13b=this;return new Promise(function(_0x3a0f4a,_0x33b818){return db[_0x4de4('0x17')][_0x4de4('0x18')](_0x524d02[_0x4de4('0x19')],{'raw':_0x524d02[_0x4de4('0x1a')]?_0x524d02[_0x4de4('0x1a')][_0x4de4('0x1b')]===undefined?!![]:![]:!![]})[_0x4de4('0x1c')](function(_0x1dfb0c){logger[_0x4de4('0x12')](_0x4de4('0x16'),_0x524d02);logger['debug'](_0x4de4('0x16'),_0x524d02,JSON['stringify'](_0x1dfb0c));_0x3a0f4a(_0x1dfb0c);})[_0x4de4('0x15')](function(_0x1e4098){logger[_0x4de4('0x10')](_0x4de4('0x16'),_0x1e4098[_0x4de4('0x11')],_0x524d02);_0x33b818(_0x2ba13b[_0x4de4('0x10')](0x1f4,_0x1e4098[_0x4de4('0x11')]));});});};exports[_0x4de4('0x1d')]=function(_0x52a43c){var _0x3c9572=this;return new Promise(function(_0xea570e,_0x3e4a88){return db['ChatQueueReport'][_0x4de4('0x1e')](_0x52a43c[_0x4de4('0x19')],{'raw':_0x52a43c[_0x4de4('0x1a')]?_0x52a43c[_0x4de4('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52a43c['options']?_0x52a43c[_0x4de4('0x1a')][_0x4de4('0x1f')]||null:null,'attributes':_0x52a43c['options']?_0x52a43c['options'][_0x4de4('0x20')]||null:null,'limit':_0x52a43c['options']?_0x52a43c['options'][_0x4de4('0x21')]||null:null})[_0x4de4('0x1c')](function(_0x1e3158){logger[_0x4de4('0x12')](_0x4de4('0x1d'),_0x52a43c);logger['debug'](_0x4de4('0x1d'),_0x52a43c,JSON['stringify'](_0x1e3158));_0xea570e(_0x1e3158);})[_0x4de4('0x15')](function(_0x3c78af){logger[_0x4de4('0x10')](_0x4de4('0x1d'),_0x3c78af['message'],_0x52a43c);_0x3e4a88(_0x3c9572[_0x4de4('0x10')](0x1f4,_0x3c78af[_0x4de4('0x11')]));});});};
\ No newline at end of file
+var _0xe6fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','attributes','limit','lodash'];(function(_0x5b551e,_0x1d32c3){var _0x56fd43=function(_0x426201){while(--_0x426201){_0x5b551e['push'](_0x5b551e['shift']());}};_0x56fd43(++_0x1d32c3);}(_0xe6fa,0x154));var _0xae6f=function(_0x4b92e9,_0x2f6330){_0x4b92e9=_0x4b92e9-0x0;var _0x3de0be=_0xe6fa[_0x4b92e9];return _0x3de0be;};'use strict';var _=require(_0xae6f('0x0'));var util=require(_0xae6f('0x1'));var moment=require('moment');var BPromise=require(_0xae6f('0x2'));var rs=require(_0xae6f('0x3'));var fs=require('fs');var Redis=require(_0xae6f('0x4'));var db=require(_0xae6f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xae6f('0x6'))(_0xae6f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae6f('0x8')][_0xae6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16d124,_0x555526,_0x23c5cb){return new BPromise(function(_0x324df9,_0x1ec178){return client[_0xae6f('0xa')](_0x16d124,_0x23c5cb)[_0xae6f('0xb')](function(_0xd163b9){logger[_0xae6f('0xc')](_0xae6f('0xd'),_0x555526,_0xae6f('0xe'));logger['debug'](_0xae6f('0xf'),_0x555526,_0xae6f('0xe'),JSON[_0xae6f('0x10')](_0xd163b9));if(_0xd163b9[_0xae6f('0x11')]){if(_0xd163b9[_0xae6f('0x11')][_0xae6f('0x12')]===0x1f4){logger[_0xae6f('0x11')](_0xae6f('0xd'),_0x555526,_0xd163b9[_0xae6f('0x11')][_0xae6f('0x13')]);return _0x1ec178(_0xd163b9[_0xae6f('0x11')][_0xae6f('0x13')]);}logger[_0xae6f('0x11')](_0xae6f('0xd'),_0x555526,_0xd163b9[_0xae6f('0x11')][_0xae6f('0x13')]);return _0x324df9(_0xd163b9['error'][_0xae6f('0x13')]);}else{logger['info'](_0xae6f('0xd'),_0x555526,'request\x20sent');_0x324df9(_0xd163b9['result'][_0xae6f('0x13')]);}})['catch'](function(_0x262cdd){logger[_0xae6f('0x11')](_0xae6f('0xd'),_0x555526,_0x262cdd);_0x1ec178(_0x262cdd);});});}exports[_0xae6f('0x14')]=function(_0x1af955){var _0x3aa2b1=this;return new Promise(function(_0xa9990e,_0x3de8ba){return db[_0xae6f('0x15')][_0xae6f('0x16')](_0x1af955[_0xae6f('0x17')],{'raw':_0x1af955[_0xae6f('0x18')]?_0x1af955['options'][_0xae6f('0x19')]===undefined?!![]:![]:!![]})[_0xae6f('0xb')](function(_0x3c0ba8){logger['info']('CreateChatQueueReport',_0x1af955);logger['debug'](_0xae6f('0x14'),_0x1af955,JSON[_0xae6f('0x10')](_0x3c0ba8));_0xa9990e(_0x3c0ba8);})[_0xae6f('0x1a')](function(_0x497a6b){logger[_0xae6f('0x11')](_0xae6f('0x14'),_0x497a6b[_0xae6f('0x13')],_0x1af955);_0x3de8ba(_0x3aa2b1[_0xae6f('0x11')](0x1f4,_0x497a6b[_0xae6f('0x13')]));});});};exports[_0xae6f('0x1b')]=function(_0x429298){var _0x4fef40=this;return new Promise(function(_0x39400a,_0x486491){return db[_0xae6f('0x15')][_0xae6f('0x1c')](_0x429298[_0xae6f('0x17')],{'raw':_0x429298[_0xae6f('0x18')]?_0x429298[_0xae6f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x429298[_0xae6f('0x18')]?_0x429298[_0xae6f('0x18')]['where']||null:null,'attributes':_0x429298[_0xae6f('0x18')]?_0x429298[_0xae6f('0x18')][_0xae6f('0x1d')]||null:null,'limit':_0x429298[_0xae6f('0x18')]?_0x429298['options'][_0xae6f('0x1e')]||null:null})['then'](function(_0x358cdd){logger[_0xae6f('0xc')](_0xae6f('0x1b'),_0x429298);logger['debug'](_0xae6f('0x1b'),_0x429298,JSON[_0xae6f('0x10')](_0x358cdd));_0x39400a(_0x358cdd);})['catch'](function(_0x517bb2){logger[_0xae6f('0x11')](_0xae6f('0x1b'),_0x517bb2[_0xae6f('0x13')],_0x429298);_0x486491(_0x4fef40['error'](0x1f4,_0x517bb2[_0xae6f('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 808eea6..56a918a 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 _0xf1bd=['delete','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1bd,0x158));var _0xdf1b=function(_0x39a0b3,_0x5c3c59){_0x39a0b3=_0x39a0b3-0x0;var _0x43ab98=_0xf1bd[_0x39a0b3];return _0x43ab98;};'use strict';var multer=require(_0xdf1b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdf1b('0x1'));var express=require(_0xdf1b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdf1b('0x3'));var interaction=require(_0xdf1b('0x4'));var config=require(_0xdf1b('0x5'));var controller=require(_0xdf1b('0x6'));router[_0xdf1b('0x7')]('/',auth[_0xdf1b('0x8')](),controller[_0xdf1b('0x9')]);router['get'](_0xdf1b('0xa'),auth['isAuthenticated'](),controller[_0xdf1b('0xb')]);router[_0xdf1b('0x7')](_0xdf1b('0xc'),auth['isAuthenticated'](),controller[_0xdf1b('0xd')]);router['post']('/',auth[_0xdf1b('0x8')](),controller[_0xdf1b('0xe')]);router[_0xdf1b('0xf')](_0xdf1b('0xc'),auth[_0xdf1b('0x8')](),controller[_0xdf1b('0x10')]);router[_0xdf1b('0x11')](_0xdf1b('0xc'),auth[_0xdf1b('0x8')](),controller['destroy']);module[_0xdf1b('0x12')]=router;
\ No newline at end of file
+var _0xd691=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','multer'];(function(_0x4c43de,_0x38b1d5){var _0x3de90a=function(_0x803cff){while(--_0x803cff){_0x4c43de['push'](_0x4c43de['shift']());}};_0x3de90a(++_0x38b1d5);}(_0xd691,0x18f));var _0x1d69=function(_0xa5bd84,_0x287943){_0xa5bd84=_0xa5bd84-0x0;var _0x22bcca=_0xd691[_0xa5bd84];return _0x22bcca;};'use strict';var multer=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var path=require('path');var timeout=require(_0x1d69('0x2'));var express=require(_0x1d69('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1d69('0x4'));var interaction=require(_0x1d69('0x5'));var config=require(_0x1d69('0x6'));var controller=require(_0x1d69('0x7'));router[_0x1d69('0x8')]('/',auth[_0x1d69('0x9')](),controller[_0x1d69('0xa')]);router['get'](_0x1d69('0xb'),auth[_0x1d69('0x9')](),controller[_0x1d69('0xc')]);router[_0x1d69('0x8')](_0x1d69('0xd'),auth[_0x1d69('0x9')](),controller[_0x1d69('0xe')]);router[_0x1d69('0xf')]('/',auth[_0x1d69('0x9')](),controller[_0x1d69('0x10')]);router['put']('/:id',auth[_0x1d69('0x9')](),controller[_0x1d69('0x11')]);router[_0x1d69('0x12')]('/:id',auth[_0x1d69('0x9')](),controller[_0x1d69('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0aded07..6ef042f 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0xb43b,0x1b2));var _0xbb43=function(_0x53bbc8,_0x379567){_0x53bbc8=_0x53bbc8-0x0;var _0x12d602=_0xb43b[_0x53bbc8];return _0x12d602;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x42c5b1,_0x57613c){_0x42c5b1=_0x42c5b1-0x0;var _0x5633cd=_0xb43b[_0x42c5b1];return _0x5633cd;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 29b1194..cfcd5fd 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 _0x1833=['jsforce','desk.js','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','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','ChatTransferReport','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x261a74,_0x244ae3){var _0x231cf3=function(_0x49314e){while(--_0x49314e){_0x261a74['push'](_0x261a74['shift']());}};_0x231cf3(++_0x244ae3);}(_0x1833,0x93));var _0x3183=function(_0x2e78b4,_0x4e9b05){_0x2e78b4=_0x2e78b4-0x0;var _0x129f4d=_0x1833[_0x2e78b4];return _0x129f4d;};'use strict';var emlformat=require(_0x3183('0x0'));var rimraf=require(_0x3183('0x1'));var zipdir=require(_0x3183('0x2'));var jsonpatch=require(_0x3183('0x3'));var rp=require(_0x3183('0x4'));var moment=require(_0x3183('0x5'));var BPromise=require(_0x3183('0x6'));var Mustache=require(_0x3183('0x7'));var util=require('util');var path=require(_0x3183('0x8'));var sox=require(_0x3183('0x9'));var csv=require(_0x3183('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3183('0xb'));var _=require(_0x3183('0xc'));var squel=require(_0x3183('0xd'));var crypto=require(_0x3183('0xe'));var jsforce=require(_0x3183('0xf'));var deskjs=require(_0x3183('0x10'));var toCsv=require(_0x3183('0xa'));var querystring=require(_0x3183('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3183('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3183('0x13'));var hardwareService=require(_0x3183('0x14'));var logger=require(_0x3183('0x15'))(_0x3183('0x16'));var utils=require(_0x3183('0x17'));var config=require(_0x3183('0x18'));var licenseUtil=require(_0x3183('0x19'));var db=require(_0x3183('0x1a'))['db'];function respondWithStatusCode(_0xb906d3,_0x385f90){_0x385f90=_0x385f90||0xcc;return function(_0x33bf23){if(_0x33bf23){return _0xb906d3[_0x3183('0x1b')](_0x385f90);}return _0xb906d3[_0x3183('0x1c')](_0x385f90)[_0x3183('0x1d')]();};}function respondWithResult(_0x566c6c,_0x13467d){_0x13467d=_0x13467d||0xc8;return function(_0x208e6e){if(_0x208e6e){return _0x566c6c[_0x3183('0x1c')](_0x13467d)[_0x3183('0x1e')](_0x208e6e);}};}function respondWithFilteredResult(_0x382051,_0x7d601f){return function(_0x3e0a61){if(_0x3e0a61){var _0x3ea34e=typeof _0x7d601f['offset']==='undefined'&&typeof _0x7d601f['limit']===_0x3183('0x1f');var _0x136ed1=_0x3e0a61[_0x3183('0x20')];var _0x547c70=_0x3ea34e?0x0:_0x7d601f[_0x3183('0x21')];var _0x177314=_0x3ea34e?_0x3e0a61[_0x3183('0x20')]:_0x7d601f[_0x3183('0x21')]+_0x7d601f[_0x3183('0x22')];var _0x14a8c4;if(_0x177314>=_0x136ed1){_0x177314=_0x136ed1;_0x14a8c4=0xc8;}else{_0x14a8c4=0xce;}_0x382051[_0x3183('0x1c')](_0x14a8c4);return _0x382051[_0x3183('0x23')](_0x3183('0x24'),_0x547c70+'-'+_0x177314+'/'+_0x136ed1)[_0x3183('0x1e')](_0x3e0a61);}return null;};}function patchUpdates(_0x1d42d2){return function(_0x219a7f){try{jsonpatch[_0x3183('0x25')](_0x219a7f,_0x1d42d2,!![]);}catch(_0x6ab817){return BPromise[_0x3183('0x26')](_0x6ab817);}return _0x219a7f[_0x3183('0x27')]();};}function saveUpdates(_0x3ffa1e,_0x257f2e){return function(_0x1ddd0a){if(_0x1ddd0a){return _0x1ddd0a[_0x3183('0x28')](_0x3ffa1e)['then'](function(_0x3d9ba7){return _0x3d9ba7;});}return null;};}function removeEntity(_0xe8a748,_0x5c206d){return function(_0x246379){if(_0x246379){return _0x246379[_0x3183('0x29')]()[_0x3183('0x2a')](function(){_0xe8a748[_0x3183('0x1c')](0xcc)[_0x3183('0x1d')]();});}};}function handleEntityNotFound(_0x10c7a9,_0x1f6bd6){return function(_0x423937){if(!_0x423937){_0x10c7a9[_0x3183('0x1b')](0x194);}return _0x423937;};}function handleError(_0x4ff959,_0x48684a){_0x48684a=_0x48684a||0x1f4;return function(_0x9826a6){logger[_0x3183('0x2b')](_0x9826a6[_0x3183('0x2c')]);if(_0x9826a6['name']){delete _0x9826a6[_0x3183('0x2d')];}_0x4ff959['status'](_0x48684a)['send'](_0x9826a6);};}exports[_0x3183('0x2e')]=function(_0x5a1e42,_0x256b59){var _0x5d1bb9={},_0x239a3a={},_0x1edf98={'count':0x0,'rows':[]};var _0x3eb0ed=_['map'](db[_0x3183('0x2f')]['rawAttributes'],function(_0x4b64af){return{'name':_0x4b64af[_0x3183('0x30')],'type':_0x4b64af[_0x3183('0x31')][_0x3183('0x32')]};});_0x239a3a[_0x3183('0x33')]=_[_0x3183('0x34')](_0x3eb0ed,_0x3183('0x2d'));_0x239a3a[_0x3183('0x35')]=_[_0x3183('0x36')](_0x5a1e42[_0x3183('0x35')]);_0x239a3a['filters']=_[_0x3183('0x37')](_0x239a3a[_0x3183('0x33')],_0x239a3a['query']);_0x5d1bb9[_0x3183('0x38')]=_[_0x3183('0x37')](_0x239a3a[_0x3183('0x33')],qs['fields'](_0x5a1e42['query'][_0x3183('0x39')]));_0x5d1bb9[_0x3183('0x38')]=_0x5d1bb9[_0x3183('0x38')]['length']?_0x5d1bb9[_0x3183('0x38')]:_0x239a3a[_0x3183('0x33')];if(!_0x5a1e42[_0x3183('0x35')]['hasOwnProperty'](_0x3183('0x3a'))){_0x5d1bb9[_0x3183('0x22')]=qs[_0x3183('0x22')](_0x5a1e42['query'][_0x3183('0x22')]);_0x5d1bb9[_0x3183('0x21')]=qs['offset'](_0x5a1e42[_0x3183('0x35')][_0x3183('0x21')]);}_0x5d1bb9[_0x3183('0x3b')]=qs[_0x3183('0x3c')](_0x5a1e42[_0x3183('0x35')][_0x3183('0x3c')]);_0x5d1bb9['where']=qs[_0x3183('0x3d')](_[_0x3183('0x3e')](_0x5a1e42[_0x3183('0x35')],_0x239a3a[_0x3183('0x3d')]),_0x3eb0ed);if(_0x5a1e42[_0x3183('0x35')]['filter']){_0x5d1bb9['where']=_[_0x3183('0x3f')](_0x5d1bb9[_0x3183('0x40')],{'$or':_[_0x3183('0x34')](_0x3eb0ed,function(_0x541c4f){if(_0x541c4f[_0x3183('0x31')]!==_0x3183('0x41')){var _0x1a4284={};_0x1a4284[_0x541c4f[_0x3183('0x2d')]]={'$like':'%'+_0x5a1e42[_0x3183('0x35')][_0x3183('0x42')]+'%'};return _0x1a4284;}})});}_0x5d1bb9=_['merge']({},_0x5d1bb9,_0x5a1e42[_0x3183('0x43')]);var _0x16b7cf={'where':_0x5d1bb9[_0x3183('0x40')]};return db[_0x3183('0x2f')][_0x3183('0x20')](_0x16b7cf)[_0x3183('0x2a')](function(_0x3db657){_0x1edf98[_0x3183('0x20')]=_0x3db657;if(_0x5a1e42[_0x3183('0x35')][_0x3183('0x44')]){_0x5d1bb9[_0x3183('0x45')]=[{'all':!![]}];}return db[_0x3183('0x2f')][_0x3183('0x46')](_0x5d1bb9);})[_0x3183('0x2a')](function(_0x302e3f){_0x1edf98[_0x3183('0x47')]=_0x302e3f;return _0x1edf98;})['then'](respondWithFilteredResult(_0x256b59,_0x5d1bb9))[_0x3183('0x48')](handleError(_0x256b59,null));};exports[_0x3183('0x49')]=function(_0xb48c2,_0x3f442b){var _0x5d1b48={'raw':!![],'where':{'id':_0xb48c2[_0x3183('0x4a')]['id']}},_0x2cd33d={};_0x2cd33d[_0x3183('0x33')]=_['keys'](db['ChatTransferReport'][_0x3183('0x4b')]);_0x2cd33d[_0x3183('0x35')]=_[_0x3183('0x36')](_0xb48c2[_0x3183('0x35')]);_0x2cd33d[_0x3183('0x3d')]=_[_0x3183('0x37')](_0x2cd33d[_0x3183('0x33')],_0x2cd33d[_0x3183('0x35')]);_0x5d1b48[_0x3183('0x38')]=_['intersection'](_0x2cd33d[_0x3183('0x33')],qs[_0x3183('0x39')](_0xb48c2['query'][_0x3183('0x39')]));_0x5d1b48[_0x3183('0x38')]=_0x5d1b48[_0x3183('0x38')][_0x3183('0x4c')]?_0x5d1b48[_0x3183('0x38')]:_0x2cd33d[_0x3183('0x33')];if(_0xb48c2['query']['includeAll']){_0x5d1b48['include']=[{'all':!![]}];}_0x5d1b48=_[_0x3183('0x3f')]({},_0x5d1b48,_0xb48c2['options']);return db[_0x3183('0x2f')][_0x3183('0x4d')](_0x5d1b48)['then'](handleEntityNotFound(_0x3f442b,null))[_0x3183('0x2a')](respondWithResult(_0x3f442b,null))['catch'](handleError(_0x3f442b,null));};exports[_0x3183('0x4e')]=function(_0x293c84,_0x547b5d){return db[_0x3183('0x2f')][_0x3183('0x4e')](_0x293c84[_0x3183('0x4f')],{})['then'](respondWithResult(_0x547b5d,0xc9))[_0x3183('0x48')](handleError(_0x547b5d,null));};exports[_0x3183('0x28')]=function(_0x158e33,_0x56829d){if(_0x158e33['body']['id']){delete _0x158e33[_0x3183('0x4f')]['id'];}return db[_0x3183('0x2f')][_0x3183('0x4d')]({'where':{'id':_0x158e33[_0x3183('0x4a')]['id']}})[_0x3183('0x2a')](handleEntityNotFound(_0x56829d,null))[_0x3183('0x2a')](saveUpdates(_0x158e33[_0x3183('0x4f')],null))[_0x3183('0x2a')](respondWithResult(_0x56829d,null))[_0x3183('0x48')](handleError(_0x56829d,null));};exports[_0x3183('0x29')]=function(_0x2bd7b8,_0x1f454b){return db[_0x3183('0x2f')]['find']({'where':{'id':_0x2bd7b8[_0x3183('0x4a')]['id']}})[_0x3183('0x2a')](handleEntityNotFound(_0x1f454b,null))[_0x3183('0x2a')](removeEntity(_0x1f454b,null))['catch'](handleError(_0x1f454b,null));};exports[_0x3183('0x50')]=function(_0x221277,_0x3fc2f2){return db[_0x3183('0x2f')][_0x3183('0x50')]()[_0x3183('0x2a')](respondWithResult(_0x3fc2f2,null))['catch'](handleError(_0x3fc2f2,null));};
\ No newline at end of file
+var _0xa184=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x425353,_0x442351){var _0x566c59=function(_0x3d22d8){while(--_0x3d22d8){_0x425353['push'](_0x425353['shift']());}};_0x566c59(++_0x442351);}(_0xa184,0x110));var _0x4a18=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0xa184[_0x1f1511];return _0x1d9ab8;};'use strict';var emlformat=require(_0x4a18('0x0'));var rimraf=require(_0x4a18('0x1'));var zipdir=require(_0x4a18('0x2'));var jsonpatch=require(_0x4a18('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a18('0x4'));var Mustache=require(_0x4a18('0x5'));var util=require('util');var path=require(_0x4a18('0x6'));var sox=require(_0x4a18('0x7'));var csv=require('to-csv');var ejs=require(_0x4a18('0x8'));var fs=require('fs');var fs_extra=require(_0x4a18('0x9'));var _=require(_0x4a18('0xa'));var squel=require('squel');var crypto=require(_0x4a18('0xb'));var jsforce=require(_0x4a18('0xc'));var deskjs=require(_0x4a18('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4a18('0xe'));var Papa=require(_0x4a18('0xf'));var Redis=require(_0x4a18('0x10'));var authService=require(_0x4a18('0x11'));var qs=require(_0x4a18('0x12'));var as=require(_0x4a18('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a18('0x14'))(_0x4a18('0x15'));var utils=require(_0x4a18('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4a18('0x17'));var db=require(_0x4a18('0x18'))['db'];function respondWithStatusCode(_0x1616af,_0xc124c3){_0xc124c3=_0xc124c3||0xcc;return function(_0x45f64d){if(_0x45f64d){return _0x1616af[_0x4a18('0x19')](_0xc124c3);}return _0x1616af[_0x4a18('0x1a')](_0xc124c3)[_0x4a18('0x1b')]();};}function respondWithResult(_0x316f90,_0x47a3da){_0x47a3da=_0x47a3da||0xc8;return function(_0x18084f){if(_0x18084f){return _0x316f90[_0x4a18('0x1a')](_0x47a3da)[_0x4a18('0x1c')](_0x18084f);}};}function respondWithFilteredResult(_0x44206e,_0x17b687){return function(_0x57e44d){if(_0x57e44d){var _0x34c423=typeof _0x17b687[_0x4a18('0x1d')]==='undefined'&&typeof _0x17b687[_0x4a18('0x1e')]==='undefined';var _0x3a50e0=_0x57e44d[_0x4a18('0x1f')];var _0x3baf6d=_0x34c423?0x0:_0x17b687[_0x4a18('0x1d')];var _0xb44456=_0x34c423?_0x57e44d[_0x4a18('0x1f')]:_0x17b687[_0x4a18('0x1d')]+_0x17b687['limit'];var _0x27cffa;if(_0xb44456>=_0x3a50e0){_0xb44456=_0x3a50e0;_0x27cffa=0xc8;}else{_0x27cffa=0xce;}_0x44206e[_0x4a18('0x1a')](_0x27cffa);return _0x44206e['set'](_0x4a18('0x20'),_0x3baf6d+'-'+_0xb44456+'/'+_0x3a50e0)[_0x4a18('0x1c')](_0x57e44d);}return null;};}function patchUpdates(_0x38cae5){return function(_0x74e28b){try{jsonpatch[_0x4a18('0x21')](_0x74e28b,_0x38cae5,!![]);}catch(_0x3963d9){return BPromise[_0x4a18('0x22')](_0x3963d9);}return _0x74e28b[_0x4a18('0x23')]();};}function saveUpdates(_0x2f5e0e,_0x8f7633){return function(_0x4e2621){if(_0x4e2621){return _0x4e2621['update'](_0x2f5e0e)[_0x4a18('0x24')](function(_0xf30b89){return _0xf30b89;});}return null;};}function removeEntity(_0x474459,_0x5e5531){return function(_0x440a6b){if(_0x440a6b){return _0x440a6b[_0x4a18('0x25')]()['then'](function(){_0x474459[_0x4a18('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb99fed,_0x5b1c79){return function(_0x28bbee){if(!_0x28bbee){_0xb99fed[_0x4a18('0x19')](0x194);}return _0x28bbee;};}function handleError(_0x192c75,_0x20c9cc){_0x20c9cc=_0x20c9cc||0x1f4;return function(_0xa360c3){logger['error'](_0xa360c3[_0x4a18('0x26')]);if(_0xa360c3[_0x4a18('0x27')]){delete _0xa360c3[_0x4a18('0x27')];}_0x192c75[_0x4a18('0x1a')](_0x20c9cc)[_0x4a18('0x28')](_0xa360c3);};}exports[_0x4a18('0x29')]=function(_0x59fd98,_0x4df062){var _0x26e057={},_0x5cd8a1={},_0x3eea2b={'count':0x0,'rows':[]};var _0x4a3e7b=_[_0x4a18('0x2a')](db[_0x4a18('0x2b')]['rawAttributes'],function(_0x308b71){return{'name':_0x308b71[_0x4a18('0x2c')],'type':_0x308b71[_0x4a18('0x2d')][_0x4a18('0x2e')]};});_0x5cd8a1['model']=_['map'](_0x4a3e7b,_0x4a18('0x27'));_0x5cd8a1[_0x4a18('0x2f')]=_['keys'](_0x59fd98['query']);_0x5cd8a1[_0x4a18('0x30')]=_[_0x4a18('0x31')](_0x5cd8a1['model'],_0x5cd8a1[_0x4a18('0x2f')]);_0x26e057[_0x4a18('0x32')]=_[_0x4a18('0x31')](_0x5cd8a1['model'],qs['fields'](_0x59fd98['query'][_0x4a18('0x33')]));_0x26e057[_0x4a18('0x32')]=_0x26e057[_0x4a18('0x32')][_0x4a18('0x34')]?_0x26e057[_0x4a18('0x32')]:_0x5cd8a1[_0x4a18('0x35')];if(!_0x59fd98[_0x4a18('0x2f')]['hasOwnProperty']('nolimit')){_0x26e057[_0x4a18('0x1e')]=qs[_0x4a18('0x1e')](_0x59fd98['query'][_0x4a18('0x1e')]);_0x26e057[_0x4a18('0x1d')]=qs[_0x4a18('0x1d')](_0x59fd98[_0x4a18('0x2f')][_0x4a18('0x1d')]);}_0x26e057[_0x4a18('0x36')]=qs['sort'](_0x59fd98['query'][_0x4a18('0x37')]);_0x26e057[_0x4a18('0x38')]=qs['filters'](_[_0x4a18('0x39')](_0x59fd98['query'],_0x5cd8a1['filters']),_0x4a3e7b);if(_0x59fd98[_0x4a18('0x2f')][_0x4a18('0x3a')]){_0x26e057[_0x4a18('0x38')]=_[_0x4a18('0x3b')](_0x26e057[_0x4a18('0x38')],{'$or':_[_0x4a18('0x2a')](_0x4a3e7b,function(_0x591e9c){if(_0x591e9c['type']!=='VIRTUAL'){var _0x4907e0={};_0x4907e0[_0x591e9c['name']]={'$like':'%'+_0x59fd98[_0x4a18('0x2f')][_0x4a18('0x3a')]+'%'};return _0x4907e0;}})});}_0x26e057=_[_0x4a18('0x3b')]({},_0x26e057,_0x59fd98[_0x4a18('0x3c')]);var _0xd71dc7={'where':_0x26e057[_0x4a18('0x38')]};return db['ChatTransferReport'][_0x4a18('0x1f')](_0xd71dc7)[_0x4a18('0x24')](function(_0x201ca0){_0x3eea2b[_0x4a18('0x1f')]=_0x201ca0;if(_0x59fd98[_0x4a18('0x2f')][_0x4a18('0x3d')]){_0x26e057[_0x4a18('0x3e')]=[{'all':!![]}];}return db[_0x4a18('0x2b')][_0x4a18('0x3f')](_0x26e057);})['then'](function(_0xe3fdc3){_0x3eea2b['rows']=_0xe3fdc3;return _0x3eea2b;})[_0x4a18('0x24')](respondWithFilteredResult(_0x4df062,_0x26e057))[_0x4a18('0x40')](handleError(_0x4df062,null));};exports[_0x4a18('0x41')]=function(_0x1af579,_0x42f4f8){var _0x2a2d41={'raw':!![],'where':{'id':_0x1af579[_0x4a18('0x42')]['id']}},_0x5341b6={};_0x5341b6[_0x4a18('0x35')]=_[_0x4a18('0x43')](db[_0x4a18('0x2b')][_0x4a18('0x44')]);_0x5341b6[_0x4a18('0x2f')]=_['keys'](_0x1af579[_0x4a18('0x2f')]);_0x5341b6[_0x4a18('0x30')]=_[_0x4a18('0x31')](_0x5341b6[_0x4a18('0x35')],_0x5341b6[_0x4a18('0x2f')]);_0x2a2d41[_0x4a18('0x32')]=_[_0x4a18('0x31')](_0x5341b6['model'],qs[_0x4a18('0x33')](_0x1af579[_0x4a18('0x2f')][_0x4a18('0x33')]));_0x2a2d41['attributes']=_0x2a2d41['attributes'][_0x4a18('0x34')]?_0x2a2d41[_0x4a18('0x32')]:_0x5341b6[_0x4a18('0x35')];if(_0x1af579[_0x4a18('0x2f')][_0x4a18('0x3d')]){_0x2a2d41[_0x4a18('0x3e')]=[{'all':!![]}];}_0x2a2d41=_[_0x4a18('0x3b')]({},_0x2a2d41,_0x1af579[_0x4a18('0x3c')]);return db['ChatTransferReport'][_0x4a18('0x45')](_0x2a2d41)[_0x4a18('0x24')](handleEntityNotFound(_0x42f4f8,null))['then'](respondWithResult(_0x42f4f8,null))['catch'](handleError(_0x42f4f8,null));};exports['create']=function(_0x4e9f68,_0xc6e7a7){return db[_0x4a18('0x2b')][_0x4a18('0x46')](_0x4e9f68[_0x4a18('0x47')],{})[_0x4a18('0x24')](respondWithResult(_0xc6e7a7,0xc9))[_0x4a18('0x40')](handleError(_0xc6e7a7,null));};exports['update']=function(_0x18d50a,_0x12f1a7){if(_0x18d50a[_0x4a18('0x47')]['id']){delete _0x18d50a['body']['id'];}return db[_0x4a18('0x2b')][_0x4a18('0x45')]({'where':{'id':_0x18d50a[_0x4a18('0x42')]['id']}})[_0x4a18('0x24')](handleEntityNotFound(_0x12f1a7,null))[_0x4a18('0x24')](saveUpdates(_0x18d50a[_0x4a18('0x47')],null))[_0x4a18('0x24')](respondWithResult(_0x12f1a7,null))[_0x4a18('0x40')](handleError(_0x12f1a7,null));};exports[_0x4a18('0x25')]=function(_0x5eba95,_0x4ee0c4){return db['ChatTransferReport']['find']({'where':{'id':_0x5eba95[_0x4a18('0x42')]['id']}})[_0x4a18('0x24')](handleEntityNotFound(_0x4ee0c4,null))[_0x4a18('0x24')](removeEntity(_0x4ee0c4,null))[_0x4a18('0x40')](handleError(_0x4ee0c4,null));};exports[_0x4a18('0x48')]=function(_0x3738d5,_0x4ba180){return db[_0x4a18('0x2b')][_0x4a18('0x48')]()['then'](respondWithResult(_0x4ba180,null))[_0x4a18('0x40')](handleError(_0x4ba180,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 19a5c98..10a4154 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 _0xa009=['api','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x29cf2c,_0x2bc713){var _0x25d21b=function(_0x497622){while(--_0x497622){_0x29cf2c['push'](_0x29cf2c['shift']());}};_0x25d21b(++_0x2bc713);}(_0xa009,0x194));var _0x9a00=function(_0x48043a,_0x2b99c1){_0x48043a=_0x48043a-0x0;var _0x7d92d2=_0xa009[_0x48043a];return _0x7d92d2;};'use strict';var _=require(_0x9a00('0x0'));var util=require(_0x9a00('0x1'));var logger=require(_0x9a00('0x2'))(_0x9a00('0x3'));var moment=require('moment');var BPromise=require(_0x9a00('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a00('0x5'));var rimraf=require(_0x9a00('0x6'));var config=require(_0x9a00('0x7'));var attributes=require(_0x9a00('0x8'));module['exports']=function(_0x3bec2e,_0x441300){return _0x3bec2e['define'](_0x9a00('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x9a00('0xa'),'fields':[_0x9a00('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9dde=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0x9dde,0xc6));var _0xe9dd=function(_0x30c727,_0x678006){_0x30c727=_0x30c727-0x0;var _0x56cb22=_0x9dde[_0x30c727];return _0x56cb22;};'use strict';var _=require('lodash');var util=require(_0xe9dd('0x0'));var logger=require(_0xe9dd('0x1'))(_0xe9dd('0x2'));var moment=require(_0xe9dd('0x3'));var BPromise=require('bluebird');var rp=require(_0xe9dd('0x4'));var fs=require('fs');var path=require(_0xe9dd('0x5'));var rimraf=require('rimraf');var config=require(_0xe9dd('0x6'));var attributes=require(_0xe9dd('0x7'));module['exports']=function(_0x443d8a,_0x28be7c){return _0x443d8a[_0xe9dd('0x8')](_0xe9dd('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe9dd('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 3f6ed28..eeef700 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 _0x9096=['then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2813fa,_0x3211d4){var _0x8a2acb=function(_0x4a9602){while(--_0x4a9602){_0x2813fa['push'](_0x2813fa['shift']());}};_0x8a2acb(++_0x3211d4);}(_0x9096,0x169));var _0x6909=function(_0x3e7285,_0x25b75b){_0x3e7285=_0x3e7285-0x0;var _0x3c3455=_0x9096[_0x3e7285];return _0x3c3455;};'use strict';var _=require(_0x6909('0x0'));var util=require(_0x6909('0x1'));var moment=require('moment');var BPromise=require(_0x6909('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6909('0x3'));var db=require(_0x6909('0x4'))['db'];var utils=require(_0x6909('0x5'));var logger=require(_0x6909('0x6'))(_0x6909('0x7'));var config=require(_0x6909('0x8'));var jayson=require(_0x6909('0x9'));var client=jayson[_0x6909('0xa')][_0x6909('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25dfd4,_0x422835,_0x3fd8fa){return new BPromise(function(_0x810876,_0x3fa604){return client[_0x6909('0xc')](_0x25dfd4,_0x3fd8fa)[_0x6909('0xd')](function(_0x5f236c){logger[_0x6909('0xe')](_0x6909('0xf'),_0x422835,'request\x20sent');logger[_0x6909('0x10')](_0x6909('0x11'),_0x422835,'request\x20sent',JSON[_0x6909('0x12')](_0x5f236c));if(_0x5f236c[_0x6909('0x13')]){if(_0x5f236c[_0x6909('0x13')]['code']===0x1f4){logger[_0x6909('0x13')](_0x6909('0xf'),_0x422835,_0x5f236c['error'][_0x6909('0x14')]);return _0x3fa604(_0x5f236c[_0x6909('0x13')][_0x6909('0x14')]);}logger[_0x6909('0x13')](_0x6909('0xf'),_0x422835,_0x5f236c[_0x6909('0x13')][_0x6909('0x14')]);return _0x810876(_0x5f236c[_0x6909('0x13')]['message']);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x422835,'request\x20sent');_0x810876(_0x5f236c['result'][_0x6909('0x14')]);}})[_0x6909('0x15')](function(_0x367a6f){logger[_0x6909('0x13')](_0x6909('0xf'),_0x422835,_0x367a6f);_0x3fa604(_0x367a6f);});});}
\ No newline at end of file
+var _0x0b05=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3c908c,_0x8e3474){var _0xb94259=function(_0x53998d){while(--_0x53998d){_0x3c908c['push'](_0x3c908c['shift']());}};_0xb94259(++_0x8e3474);}(_0x0b05,0x1bd));var _0x50b0=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x0b05[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x50b0('0x0'));var util=require(_0x50b0('0x1'));var moment=require(_0x50b0('0x2'));var BPromise=require(_0x50b0('0x3'));var rs=require(_0x50b0('0x4'));var fs=require('fs');var Redis=require(_0x50b0('0x5'));var db=require(_0x50b0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x50b0('0x7'))(_0x50b0('0x8'));var config=require(_0x50b0('0x9'));var jayson=require(_0x50b0('0xa'));var client=jayson[_0x50b0('0xb')][_0x50b0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35c709,_0xa79c37,_0x45a507){return new BPromise(function(_0x35d672,_0x44f3ef){return client[_0x50b0('0xd')](_0x35c709,_0x45a507)[_0x50b0('0xe')](function(_0x537b70){logger[_0x50b0('0xf')](_0x50b0('0x10'),_0xa79c37,_0x50b0('0x11'));logger[_0x50b0('0x12')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xa79c37,_0x50b0('0x11'),JSON['stringify'](_0x537b70));if(_0x537b70[_0x50b0('0x13')]){if(_0x537b70[_0x50b0('0x13')][_0x50b0('0x14')]===0x1f4){logger['error'](_0x50b0('0x10'),_0xa79c37,_0x537b70[_0x50b0('0x13')][_0x50b0('0x15')]);return _0x44f3ef(_0x537b70[_0x50b0('0x13')][_0x50b0('0x15')]);}logger[_0x50b0('0x13')](_0x50b0('0x10'),_0xa79c37,_0x537b70[_0x50b0('0x13')][_0x50b0('0x15')]);return _0x35d672(_0x537b70[_0x50b0('0x13')][_0x50b0('0x15')]);}else{logger[_0x50b0('0xf')](_0x50b0('0x10'),_0xa79c37,_0x50b0('0x11'));_0x35d672(_0x537b70['result']['message']);}})[_0x50b0('0x16')](function(_0x3cbf7b){logger[_0x50b0('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0xa79c37,_0x3cbf7b);_0x44f3ef(_0x3cbf7b);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 634c29b..c00771e 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 _0xf744=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0x11cb91,_0x5ef17c){var _0x2bc42f=function(_0x481ea2){while(--_0x481ea2){_0x11cb91['push'](_0x11cb91['shift']());}};_0x2bc42f(++_0x5ef17c);}(_0xf744,0x1ab));var _0x4f74=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xf744[_0x38ced4];return _0x547c07;};'use strict';var multer=require(_0x4f74('0x0'));var util=require('util');var path=require(_0x4f74('0x1'));var timeout=require(_0x4f74('0x2'));var express=require(_0x4f74('0x3'));var router=express[_0x4f74('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4f74('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4f74('0x6'));var controller=require(_0x4f74('0x7'));router[_0x4f74('0x8')]('/',auth[_0x4f74('0x9')](),controller[_0x4f74('0xa')]);router[_0x4f74('0x8')]('/describe',auth[_0x4f74('0x9')](),controller['describe']);router[_0x4f74('0x8')](_0x4f74('0xb'),auth[_0x4f74('0x9')](),controller[_0x4f74('0xc')]);router['post']('/',auth[_0x4f74('0x9')](),controller[_0x4f74('0xd')]);router[_0x4f74('0xe')](_0x4f74('0xb'),auth[_0x4f74('0x9')](),controller[_0x4f74('0xf')]);router[_0x4f74('0x10')](_0x4f74('0xb'),auth['isAuthenticated'](),controller[_0x4f74('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x91aa=['show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x179920,_0xa14b27){var _0x57acb1=function(_0x8b0ad5){while(--_0x8b0ad5){_0x179920['push'](_0x179920['shift']());}};_0x57acb1(++_0xa14b27);}(_0x91aa,0xb0));var _0xa91a=function(_0x9f897b,_0x2bc0f7){_0x9f897b=_0x9f897b-0x0;var _0x595177=_0x91aa[_0x9f897b];return _0x595177;};'use strict';var multer=require('multer');var util=require(_0xa91a('0x0'));var path=require(_0xa91a('0x1'));var timeout=require('connect-timeout');var express=require(_0xa91a('0x2'));var router=express[_0xa91a('0x3')]();var fs_extra=require(_0xa91a('0x4'));var auth=require(_0xa91a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa91a('0x6'));var controller=require('./chatTransferReport.controller');router[_0xa91a('0x7')]('/',auth[_0xa91a('0x8')](),controller[_0xa91a('0x9')]);router['get'](_0xa91a('0xa'),auth[_0xa91a('0x8')](),controller[_0xa91a('0xb')]);router[_0xa91a('0x7')](_0xa91a('0xc'),auth[_0xa91a('0x8')](),controller[_0xa91a('0xd')]);router[_0xa91a('0xe')]('/',auth[_0xa91a('0x8')](),controller[_0xa91a('0xf')]);router[_0xa91a('0x10')](_0xa91a('0xc'),auth[_0xa91a('0x8')](),controller[_0xa91a('0x11')]);router[_0xa91a('0x12')]('/:id',auth[_0xa91a('0x8')](),controller[_0xa91a('0x13')]);module[_0xa91a('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 68f8ba1..853a84b 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 _0xfed0=['We\x20are\x20here!','Send','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','ENUM','squared','rounded'];(function(_0x1d6807,_0x2f31bb){var _0x4025ac=function(_0x4e6de5){while(--_0x4e6de5){_0x1d6807['push'](_0x1d6807['shift']());}};_0x4025ac(++_0x2f31bb);}(_0xfed0,0x17c));var _0x0fed=function(_0x3bb200,_0x56df05){_0x3bb200=_0x3bb200-0x0;var _0x2e24a6=_0xfed0[_0x3bb200];return _0x2e24a6;};'use strict';var Sequelize=require(_0x0fed('0x0'));var rs=require(_0x0fed('0x1'));module[_0x0fed('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x0fed('0x3')],'allowNull':![],'unique':_0x0fed('0x4')},'description':{'type':Sequelize[_0x0fed('0x3')]},'mapKey':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x6')},'customerAlias':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0fed('0x3')],'allowNull':![],'defaultValue':_0x0fed('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0fed('0x3')],'allowNull':![],'defaultValue':_0x0fed('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0fed('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0fed('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0fed('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0fed('0x9')]('rounded',_0x0fed('0xa')),'defaultValue':_0x0fed('0xb')},'header_online':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0xc')},'start_chat_button':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0fed('0xd')},'header_offline':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0fed('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0fed('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x0fed('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0fed('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0fed('0x14')},'closingMessageButton':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0xd')},'skipMessageButton':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0fed('0x15')},'ratingType':{'type':Sequelize[_0x0fed('0x9')](_0x0fed('0x16'),_0x0fed('0x17')),'defaultValue':_0x0fed('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0fed('0x10')],'defaultValue':function(){return JSON[_0x0fed('0x18')]({'items':[{'type':_0x0fed('0x19'),'variable':null,'config':{'placeholder':_0x0fed('0x1a'),'type':_0x0fed('0x1b'),'required':!![]},'props':{'title':_0x0fed('0x1a'),'helpText':''}},{'type':_0x0fed('0x19'),'props':{'title':_0x0fed('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0fed('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0fed('0x1c')](_0x0fed('0x1d'))?JSON[_0x0fed('0x1e')](this[_0x0fed('0x1c')](_0x0fed('0x1d'))):{};},'set':function(_0x2d57cf){return this[_0x0fed('0x1f')](_0x0fed('0x1d'),JSON[_0x0fed('0x18')](_0x2d57cf));}},'offlineForm':{'type':Sequelize[_0x0fed('0x10')],'defaultValue':function(){return JSON[_0x0fed('0x18')]({'items':[{'type':_0x0fed('0x19'),'props':{'title':_0x0fed('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x0fed('0x5'),'type':_0x0fed('0x5')},'variable':null},{'type':_0x0fed('0x20'),'config':{'placeholder':_0x0fed('0x21')},'props':{'title':_0x0fed('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x0fed('0x1c')]('offlineForm')?JSON[_0x0fed('0x1e')](this[_0x0fed('0x1c')](_0x0fed('0x22'))):{};},'set':function(_0x36b06a){return this['setDataValue'](_0x0fed('0x22'),JSON[_0x0fed('0x18')](_0x36b06a));}},'token':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':function(){return rs[_0x0fed('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0fed('0x3')]},'forwardOffline':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0fed('0x3')]},'waitingTitle':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x24')},'waitingMessage':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0fed('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0fed('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0fed('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0fed('0x10')],'defaultValue':function(){return _0x0fed('0x29');}},'notificationSound':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0fed('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x0fed('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x2b')},'messagesAlignment':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':_0x0fed('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x0fed('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0fed('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0fed('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0fed('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x0fed('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0fed('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![],'comment':_0x0fed('0x2d'),'set':function(_0x4e085b){if(!_0x4e085b)this[_0x0fed('0x1f')]('mandatoryDispositionPauseId',null);this[_0x0fed('0x1f')](_0x0fed('0x2e'),_0x4e085b);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0fed('0x3')]},'vidaooTopic':{'type':Sequelize[_0x0fed('0x3')],'allowNull':![],'defaultValue':_0x0fed('0x2f')},'vidaooNote':{'type':Sequelize[_0x0fed('0x3')],'defaultValue':function(){return _0x0fed('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x0fed('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0fed('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x3b66=['generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','offlineForm'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3b66,0x7b));var _0x63b6=function(_0x226731,_0x9e13a6){_0x226731=_0x226731-0x0;var _0x4f1992=_0x3b66[_0x226731];return _0x4f1992;};'use strict';var Sequelize=require(_0x63b6('0x0'));var rs=require(_0x63b6('0x1'));module[_0x63b6('0x2')]={'name':{'type':Sequelize[_0x63b6('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x63b6('0x3')],'allowNull':![],'unique':_0x63b6('0x4')},'description':{'type':Sequelize[_0x63b6('0x3')]},'mapKey':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x5')},'mapKeyOffline':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x63b6('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x63b6('0x3')],'allowNull':![],'defaultValue':_0x63b6('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x63b6('0x3')],'allowNull':![],'defaultValue':_0x63b6('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x63b6('0x3')]},'animation':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x63b6('0xa')]('rounded',_0x63b6('0xb')),'defaultValue':_0x63b6('0xc')},'header_online':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0xd')},'start_chat_button':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x63b6('0xf')},'header_offline':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x10')},'download_transcript':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x63b6('0x11')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x63b6('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x63b6('0x13')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x63b6('0x14')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x63b6('0x15')},'placeholderMessage':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x16')},'closingMessage':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x17')},'closingMessageButton':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0xf')},'skipMessageButton':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x18')},'ratingType':{'type':Sequelize[_0x63b6('0xa')](_0x63b6('0x19'),'thumb'),'defaultValue':_0x63b6('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x63b6('0x11')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x63b6('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x63b6('0x1a'),'variable':null,'config':{'placeholder':_0x63b6('0x1b'),'type':_0x63b6('0x1c'),'required':!![]},'props':{'title':_0x63b6('0x1b'),'helpText':''}},{'type':_0x63b6('0x1a'),'props':{'title':_0x63b6('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x63b6('0x5'),'type':_0x63b6('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x63b6('0x1d')](_0x63b6('0x1e'))?JSON[_0x63b6('0x1f')](this[_0x63b6('0x1d')](_0x63b6('0x1e'))):{};},'set':function(_0x1fb1cb){return this[_0x63b6('0x20')](_0x63b6('0x1e'),JSON['stringify'](_0x1fb1cb));}},'offlineForm':{'type':Sequelize[_0x63b6('0x13')],'defaultValue':function(){return JSON[_0x63b6('0x21')]({'items':[{'type':'input','props':{'title':_0x63b6('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x63b6('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x63b6('0x22')},'props':{'title':_0x63b6('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x63b6('0x23'))?JSON[_0x63b6('0x1f')](this[_0x63b6('0x1d')](_0x63b6('0x23'))):{};},'set':function(_0x4ee541){return this['setDataValue'](_0x63b6('0x23'),JSON[_0x63b6('0x21')](_0x4ee541));}},'token':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':function(){return rs[_0x63b6('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x63b6('0x3')]},'forwardOffline':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x63b6('0x3')]},'waitingTitle':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x25')},'waitingMessage':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x27')},'offlineMessageBody':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x29')},'skipUnmanaged':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x63b6('0x13')]},'showAgentAvatar':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x63b6('0x13')],'defaultValue':function(){return _0x63b6('0x2b');}},'notificationSound':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x63b6('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x63b6('0x11')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x2d')},'messagesAlignment':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x63b6('0x3')],'allowNull':![],'defaultValue':_0x63b6('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x63b6('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x63b6('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':_0x63b6('0x2f')},'systemAvatar':{'type':Sequelize[_0x63b6('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x63b6('0x11')],'comment':_0x63b6('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![],'comment':_0x63b6('0x31'),'set':function(_0x3f6219){if(!_0x3f6219)this[_0x63b6('0x20')]('mandatoryDispositionPauseId',null);this[_0x63b6('0x20')](_0x63b6('0x32'),_0x3f6219);}},'vidaooEscalation':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x63b6('0x3')]},'vidaooTopic':{'type':Sequelize[_0x63b6('0x3')],'allowNull':![],'defaultValue':_0x63b6('0x33')},'vidaooNote':{'type':Sequelize[_0x63b6('0x3')],'defaultValue':function(){return _0x63b6('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x63b6('0x13')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x63b6('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 44236c4..b98e5bf 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 _0x43fd=['addLogo','addAvatar','file','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','unknown','device','vendor','type','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','lastName','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','Contact','User','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','push','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','ChatOfflineMessage','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./chatWebsite.socket','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','ChatWebsite,\x20%s,\x20%s','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','filters','model','intersection','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','keys','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','hasOwnProperty','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers'];(function(_0x31464b,_0x292eb3){var _0x48ba7c=function(_0x16dc3c){while(--_0x16dc3c){_0x31464b['push'](_0x31464b['shift']());}};_0x48ba7c(++_0x292eb3);}(_0x43fd,0x1ec));var _0xd43f=function(_0xe09cf,_0x237a4a){_0xe09cf=_0xe09cf-0x0;var _0x3bd449=_0x43fd[_0xe09cf];return _0x3bd449;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xd43f('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xd43f('0x1'));var fs=require('fs');var fs_extra=require(_0xd43f('0x2'));var _=require('lodash');var querystring=require(_0xd43f('0x3'));var Redis=require('ioredis');var qs=require(_0xd43f('0x4'));var logger=require(_0xd43f('0x5'))(_0xd43f('0x6'));var config=require(_0xd43f('0x7'));var db=require('../../mysqldb')['db'];config[_0xd43f('0x8')]=_[_0xd43f('0x9')](config[_0xd43f('0x8')],{'host':_0xd43f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd43f('0x8')]));require(_0xd43f('0xb'))['register'](socket);var htmlToText=require(_0xd43f('0xc'));var jayson=require(_0xd43f('0xd'));var client=jayson[_0xd43f('0xe')][_0xd43f('0xf')]({'port':0x232c});var client9002=jayson[_0xd43f('0xe')]['http']({'port':0x232a});var client9003=jayson[_0xd43f('0xe')][_0xd43f('0xf')]({'port':0x232b});var client9001=jayson[_0xd43f('0xe')][_0xd43f('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x430977,_0x396916,_0x22f057,_0x1a72f1){return new BPromise(function(_0x2b4549,_0x1bed70){var _0x1eba90=_0x1a72f1||client;return _0x1eba90['request'](_0x430977,_0x22f057)[_0xd43f('0x10')](function(_0x922f49){logger[_0xd43f('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x396916,'request\x20sent');logger['debug'](_0xd43f('0x12'),_0x396916,_0xd43f('0x13'),JSON['stringify'](_0x922f49));if(_0x922f49[_0xd43f('0x14')]){if(_0x922f49[_0xd43f('0x14')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x396916,_0x922f49['error'][_0xd43f('0x15')]);return _0x1bed70(_0x922f49[_0xd43f('0x14')]['message']);}logger[_0xd43f('0x14')](_0xd43f('0x16'),_0x396916,_0x922f49[_0xd43f('0x14')][_0xd43f('0x15')]);return _0x2b4549(_0x922f49['error'][_0xd43f('0x15')]);}else{logger[_0xd43f('0x11')](_0xd43f('0x16'),_0x396916,'request\x20sent');_0x2b4549(_0x922f49['result']['message']);}})[_0xd43f('0x17')](function(_0x25007c){logger[_0xd43f('0x14')](_0xd43f('0x16'),_0x396916,_0x25007c);_0x1bed70(_0x25007c);});});}function respondWithStatusCode(_0x3b1094,_0x3b974c){_0x3b974c=_0x3b974c||0xcc;return function(_0x296a77){if(_0x296a77){return _0x3b1094['sendStatus'](_0x3b974c);}return _0x3b1094[_0xd43f('0x18')](_0x3b974c)['end']();};}function respondWithResult(_0x352102,_0x47f960){_0x47f960=_0x47f960||0xc8;return function(_0x5ab88f){if(_0x5ab88f){return _0x352102[_0xd43f('0x18')](_0x47f960)[_0xd43f('0x19')](_0x5ab88f);}};}function respondWithFilteredResult(_0x2a9ce4,_0x2a38f6){return function(_0x35acd0){if(_0x35acd0){var _0xcaf5ae=typeof _0x2a38f6[_0xd43f('0x1a')]===_0xd43f('0x1b')&&typeof _0x2a38f6[_0xd43f('0x1c')]==='undefined';var _0x26a6c9=_0x35acd0[_0xd43f('0x1d')];var _0x366cf7=_0xcaf5ae?0x0:_0x2a38f6[_0xd43f('0x1a')];var _0x209ccd=_0xcaf5ae?_0x35acd0['count']:_0x2a38f6[_0xd43f('0x1a')]+_0x2a38f6[_0xd43f('0x1c')];var _0x285b86;if(_0x209ccd>=_0x26a6c9){_0x209ccd=_0x26a6c9;_0x285b86=0xc8;}else{_0x285b86=0xce;}_0x2a9ce4[_0xd43f('0x18')](_0x285b86);return _0x2a9ce4[_0xd43f('0x1e')](_0xd43f('0x1f'),_0x366cf7+'-'+_0x209ccd+'/'+_0x26a6c9)['json'](_0x35acd0);}return null;};}function saveUpdates(_0x1e54d0){return function(_0x1f476d){if(_0x1f476d){return _0x1f476d['update'](_0x1e54d0)[_0xd43f('0x10')](function(_0x5b1219){return _0x5b1219;});}return null;};}function removeEntity(_0x53aae7){return function(_0x45e84a){if(_0x45e84a){return _0x45e84a[_0xd43f('0x20')]()[_0xd43f('0x10')](function(){var _0x4d032e=_0x45e84a[_0xd43f('0x21')]({'plain':!![]});var _0x23c4f7='ChatWebsites';return db['UserProfileResource'][_0xd43f('0x20')]({'where':{'type':_0x23c4f7,'resourceId':_0x4d032e['id']}})[_0xd43f('0x10')](function(){return _0x45e84a;});})[_0xd43f('0x10')](function(){_0x53aae7[_0xd43f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfdea){return function(_0x24015b){if(!_0x24015b){_0x2bfdea[_0xd43f('0x22')](0x194);}return _0x24015b;};}function handleError(_0x3920eb,_0x5a5717){_0x5a5717=_0x5a5717||0x1f4;return function(_0x2461bc){logger[_0xd43f('0x14')](_0x2461bc['stack']);if(_0x2461bc[_0xd43f('0x23')]){delete _0x2461bc['name'];}_0x3920eb[_0xd43f('0x18')](_0x5a5717)[_0xd43f('0x24')](_0x2461bc);};}exports[_0xd43f('0x25')]=function(_0x51b765,_0x7fc3e){var _0x2ccd50={'include':[{'model':db[_0xd43f('0x26')],'as':_0xd43f('0x27')}]},_0x523718={},_0x3b785f={'count':0x0,'rows':[]};var _0x4ed4eb=_[_0xd43f('0x28')](db[_0xd43f('0x29')][_0xd43f('0x2a')],function(_0x20682d){return{'name':_0x20682d[_0xd43f('0x2b')],'type':_0x20682d['type'][_0xd43f('0x2c')]};});_0x523718['model']=_[_0xd43f('0x28')](_0x4ed4eb,_0xd43f('0x23'));_0x523718[_0xd43f('0x2d')]=_['keys'](_0x51b765[_0xd43f('0x2d')]);_0x523718[_0xd43f('0x2e')]=_['intersection'](_0x523718[_0xd43f('0x2f')],_0x523718['query']);_0x2ccd50['attributes']=_[_0xd43f('0x30')](_0x523718['model'],qs['fields'](_0x51b765[_0xd43f('0x2d')]['fields']));_0x2ccd50['attributes']=_0x2ccd50[_0xd43f('0x31')][_0xd43f('0x32')]?_0x2ccd50[_0xd43f('0x31')]:_0x523718[_0xd43f('0x2f')];if(!_0x51b765[_0xd43f('0x2d')]['hasOwnProperty'](_0xd43f('0x33'))){_0x2ccd50[_0xd43f('0x1c')]=qs[_0xd43f('0x1c')](_0x51b765[_0xd43f('0x2d')][_0xd43f('0x1c')]);_0x2ccd50[_0xd43f('0x1a')]=qs[_0xd43f('0x1a')](_0x51b765[_0xd43f('0x2d')][_0xd43f('0x1a')]);}_0x2ccd50[_0xd43f('0x34')]=qs[_0xd43f('0x35')](_0x51b765['query'][_0xd43f('0x35')]);_0x2ccd50[_0xd43f('0x36')]=qs['filters'](_['pick'](_0x51b765[_0xd43f('0x2d')],_0x523718[_0xd43f('0x2e')]),_0x4ed4eb);if(_0x51b765[_0xd43f('0x2d')]['filter']){_0x2ccd50[_0xd43f('0x36')]=_[_0xd43f('0x37')](_0x2ccd50[_0xd43f('0x36')],{'$or':_[_0xd43f('0x28')](_0x4ed4eb,function(_0x546f1e){if(_0x546f1e['type']!==_0xd43f('0x38')){var _0x39e9d1={};_0x39e9d1[_0x546f1e[_0xd43f('0x23')]]={'$like':'%'+_0x51b765['query'][_0xd43f('0x39')]+'%'};return _0x39e9d1;}})});}_0x2ccd50=_[_0xd43f('0x37')]({},_0x2ccd50,_0x51b765[_0xd43f('0x3a')]);var _0x425628={'where':_0x2ccd50[_0xd43f('0x36')]};return db[_0xd43f('0x29')][_0xd43f('0x1d')](_0x425628)[_0xd43f('0x10')](function(_0x4f5587){_0x3b785f[_0xd43f('0x1d')]=_0x4f5587;if(_0x51b765[_0xd43f('0x2d')][_0xd43f('0x3b')]){_0x2ccd50[_0xd43f('0x3c')]=[{'all':!![]}];}return db[_0xd43f('0x29')][_0xd43f('0x3d')](_0x2ccd50);})[_0xd43f('0x10')](function(_0x30fcd9){_0x3b785f[_0xd43f('0x3e')]=_0x30fcd9;return _0x3b785f;})[_0xd43f('0x10')](respondWithFilteredResult(_0x7fc3e,_0x2ccd50))[_0xd43f('0x17')](handleError(_0x7fc3e,null));};exports['show']=function(_0x440627,_0x15d79c){var _0x3b6d79={'raw':![],'where':{'id':_0x440627[_0xd43f('0x3f')]['id']},'include':[{'model':db[_0xd43f('0x26')],'as':'mandatoryDispositionPause'}]},_0x237bc1={};_0x237bc1[_0xd43f('0x2f')]=_['keys'](db[_0xd43f('0x29')]['rawAttributes']);_0x237bc1[_0xd43f('0x2d')]=_[_0xd43f('0x40')](_0x440627[_0xd43f('0x2d')]);_0x237bc1[_0xd43f('0x2e')]=_[_0xd43f('0x30')](_0x237bc1[_0xd43f('0x2f')],_0x237bc1[_0xd43f('0x2d')]);_0x3b6d79[_0xd43f('0x31')]=_[_0xd43f('0x30')](_0x237bc1['model'],qs[_0xd43f('0x41')](_0x440627[_0xd43f('0x2d')][_0xd43f('0x41')]));_0x3b6d79[_0xd43f('0x31')]=_0x3b6d79[_0xd43f('0x31')][_0xd43f('0x32')]?_0x3b6d79[_0xd43f('0x31')]:_0x237bc1[_0xd43f('0x2f')];if(_0x440627[_0xd43f('0x2d')][_0xd43f('0x3b')]){_0x3b6d79[_0xd43f('0x3c')]=[{'all':!![]}];}_0x3b6d79=_['merge']({},_0x3b6d79,_0x440627['options']);return db[_0xd43f('0x29')][_0xd43f('0x42')](_0x3b6d79)[_0xd43f('0x10')](handleEntityNotFound(_0x15d79c,null))['then'](respondWithResult(_0x15d79c,null))['catch'](handleError(_0x15d79c,null));};exports[_0xd43f('0x43')]=function(_0x28bffb,_0x18fff9){return db[_0xd43f('0x29')][_0xd43f('0x43')](_0x28bffb['body'],{})[_0xd43f('0x10')](function(_0x9093b1){var _0x176332=_0x28bffb[_0xd43f('0x44')][_0xd43f('0x21')]({'plain':!![]});if(!_0x176332)throw new Error(_0xd43f('0x45'));if(_0x176332['role']===_0xd43f('0x44')){var _0x381276=_0x9093b1[_0xd43f('0x21')]({'plain':!![]});var _0x376d02=_0xd43f('0x46');return db[_0xd43f('0x47')][_0xd43f('0x42')]({'where':{'name':_0x376d02,'userProfileId':_0x176332[_0xd43f('0x48')]},'raw':!![]})['then'](function(_0x2a5fd1){if(_0x2a5fd1&&_0x2a5fd1[_0xd43f('0x49')]===0x0){return db[_0xd43f('0x4a')]['create']({'name':_0x381276[_0xd43f('0x23')],'resourceId':_0x381276['id'],'type':_0x2a5fd1[_0xd43f('0x23')],'sectionId':_0x2a5fd1['id']},{})[_0xd43f('0x10')](function(){return _0x9093b1;});}else{return _0x9093b1;}})[_0xd43f('0x17')](function(_0x41588b){logger[_0xd43f('0x14')](_0xd43f('0x4b'),_0x41588b);throw _0x41588b;});}return _0x9093b1;})[_0xd43f('0x10')](respondWithResult(_0x18fff9,0xc9))[_0xd43f('0x17')](handleError(_0x18fff9,null));};exports[_0xd43f('0x4c')]=function(_0x4ca871,_0x1398ef){if(_0x4ca871[_0xd43f('0x4d')]['id']){delete _0x4ca871['body']['id'];}return db[_0xd43f('0x29')][_0xd43f('0x42')]({'where':{'id':_0x4ca871[_0xd43f('0x3f')]['id']},'include':[{'model':db['Pause'],'as':_0xd43f('0x27')}]})['then'](handleEntityNotFound(_0x1398ef,null))[_0xd43f('0x10')](saveUpdates(_0x4ca871['body'],null))[_0xd43f('0x10')](respondWithResult(_0x1398ef,null))['catch'](handleError(_0x1398ef,null));};exports[_0xd43f('0x20')]=function(_0x1378db,_0xee4cdd){return db['ChatWebsite']['find']({'where':{'id':_0x1378db[_0xd43f('0x3f')]['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0xee4cdd,null))['then'](removeEntity(_0xee4cdd,null))[_0xd43f('0x17')](handleError(_0xee4cdd,null));};exports[_0xd43f('0x4e')]=function(_0x4cd762,_0xc8f239){return db[_0xd43f('0x29')][_0xd43f('0x4e')]()[_0xd43f('0x10')](respondWithResult(_0xc8f239,null))[_0xd43f('0x17')](handleError(_0xc8f239,null));};exports[_0xd43f('0x4f')]=function(_0x2851dc,_0x5a2129){if(_0x2851dc[_0xd43f('0x4d')]['id']){delete _0x2851dc[_0xd43f('0x4d')]['id'];}return db[_0xd43f('0x29')][_0xd43f('0x42')]({'where':{'id':_0x2851dc[_0xd43f('0x3f')]['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x5a2129,null))[_0xd43f('0x10')](function(_0x539a9b){if(_0x539a9b){_0x2851dc[_0xd43f('0x4d')][_0xd43f('0x50')]=_0x539a9b['id'];return db['Disposition'][_0xd43f('0x43')](_0x2851dc[_0xd43f('0x4d')]);}})[_0xd43f('0x10')](respondWithResult(_0x5a2129,null))[_0xd43f('0x17')](handleError(_0x5a2129,null));};exports[_0xd43f('0x51')]=function(_0xd40a7b,_0x459c43){var _0x553b4a={'raw':![],'where':{}};var _0xb1bd44={};var _0x15210f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd43f('0x52')]({'where':{'id':_0xd40a7b['params']['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x459c43,null))[_0xd43f('0x10')](function(_0xe5efb0){if(_0xe5efb0){_0xb1bd44[_0xd43f('0x2f')]=_[_0xd43f('0x40')](db[_0xd43f('0x53')][_0xd43f('0x2a')]);_0xb1bd44[_0xd43f('0x2d')]=_[_0xd43f('0x40')](_0xd40a7b[_0xd43f('0x2d')]);_0xb1bd44[_0xd43f('0x2e')]=_[_0xd43f('0x30')](_0xb1bd44[_0xd43f('0x2f')],_0xb1bd44[_0xd43f('0x2d')]);_0x553b4a['attributes']=_[_0xd43f('0x30')](_0xb1bd44[_0xd43f('0x2f')],qs[_0xd43f('0x41')](_0xd40a7b['query'][_0xd43f('0x41')]));_0x553b4a['attributes']=_0x553b4a[_0xd43f('0x31')][_0xd43f('0x32')]?_0x553b4a[_0xd43f('0x31')]:_0xb1bd44[_0xd43f('0x2f')];if(!_0xd40a7b['query'][_0xd43f('0x54')](_0xd43f('0x33'))){_0x553b4a[_0xd43f('0x1c')]=qs['limit'](_0xd40a7b[_0xd43f('0x2d')]['limit']);_0x553b4a[_0xd43f('0x1a')]=qs[_0xd43f('0x1a')](_0xd40a7b[_0xd43f('0x2d')][_0xd43f('0x1a')]);}_0x553b4a['order']=qs[_0xd43f('0x35')](_0xd40a7b['query'][_0xd43f('0x35')]);_0x553b4a['where']=qs[_0xd43f('0x2e')](_[_0xd43f('0x55')](_0xd40a7b['query'],_0xb1bd44[_0xd43f('0x2e')]));_0x553b4a[_0xd43f('0x36')][_0xd43f('0x50')]=_0xe5efb0['id'];if(_0xd40a7b[_0xd43f('0x2d')]['filter']){_0x553b4a[_0xd43f('0x36')]=_[_0xd43f('0x37')](_0x553b4a[_0xd43f('0x36')],{'$or':_[_0xd43f('0x28')](_0x553b4a['attributes'],function(_0x3723de){var _0x182bfd={};_0x182bfd[_0x3723de]={'$like':'%'+_0xd40a7b['query']['filter']+'%'};return _0x182bfd;})});}_0x553b4a=_[_0xd43f('0x37')]({},_0x553b4a,_0xd40a7b[_0xd43f('0x3a')]);return db[_0xd43f('0x53')]['count']({'where':_0x553b4a[_0xd43f('0x36')]})['then'](function(_0x2d8760){_0x15210f[_0xd43f('0x1d')]=_0x2d8760;if(_0xd40a7b['query'][_0xd43f('0x3b')]){_0x553b4a[_0xd43f('0x3c')]=[{'all':!![]}];}return db[_0xd43f('0x53')][_0xd43f('0x3d')](_0x553b4a);})[_0xd43f('0x10')](function(_0x2f6499){_0x15210f[_0xd43f('0x3e')]=_0x2f6499;return _0x15210f;});}})[_0xd43f('0x10')](respondWithFilteredResult(_0x459c43,_0x553b4a))[_0xd43f('0x17')](handleError(_0x459c43,null));};exports[_0xd43f('0x56')]=function(_0x3703b5,_0x595ba5){return db[_0xd43f('0x29')]['find']({'where':{'id':_0x3703b5[_0xd43f('0x3f')]['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x595ba5,null))[_0xd43f('0x10')](function(_0x321f9){if(_0x321f9){return _0x321f9['removeDispositions'](_0x3703b5['query'][_0xd43f('0x57')]);}})[_0xd43f('0x10')](respondWithStatusCode(_0x595ba5,null))['catch'](handleError(_0x595ba5,null));};exports[_0xd43f('0x58')]=function(_0x370954,_0x3a5420){if(_0x370954[_0xd43f('0x4d')]['id']){delete _0x370954[_0xd43f('0x4d')]['id'];}return db[_0xd43f('0x29')][_0xd43f('0x42')]({'where':{'id':_0x370954[_0xd43f('0x3f')]['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x3a5420,null))[_0xd43f('0x10')](function(_0x1c97c3){if(_0x1c97c3){_0x370954[_0xd43f('0x4d')][_0xd43f('0x50')]=_0x1c97c3['id'];return db[_0xd43f('0x59')][_0xd43f('0x43')](_0x370954[_0xd43f('0x4d')]);}})['then'](respondWithResult(_0x3a5420,null))['catch'](handleError(_0x3a5420,null));};exports[_0xd43f('0x5a')]=function(_0xc8fc9,_0x596bde){var _0xa29ccc={'raw':![],'where':{}};var _0x4a3dc={};var _0x4dab68={'count':0x0,'rows':[]};return db[_0xd43f('0x29')][_0xd43f('0x52')]({'where':{'id':_0xc8fc9[_0xd43f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x596bde,null))['then'](function(_0x17830b){if(_0x17830b){_0x4a3dc[_0xd43f('0x2f')]=_[_0xd43f('0x40')](db[_0xd43f('0x59')][_0xd43f('0x2a')]);_0x4a3dc[_0xd43f('0x2d')]=_[_0xd43f('0x40')](_0xc8fc9[_0xd43f('0x2d')]);_0x4a3dc[_0xd43f('0x2e')]=_[_0xd43f('0x30')](_0x4a3dc[_0xd43f('0x2f')],_0x4a3dc[_0xd43f('0x2d')]);_0xa29ccc['attributes']=_[_0xd43f('0x30')](_0x4a3dc[_0xd43f('0x2f')],qs[_0xd43f('0x41')](_0xc8fc9[_0xd43f('0x2d')][_0xd43f('0x41')]));_0xa29ccc[_0xd43f('0x31')]=_0xa29ccc[_0xd43f('0x31')]['length']?_0xa29ccc[_0xd43f('0x31')]:_0x4a3dc[_0xd43f('0x2f')];if(!_0xc8fc9[_0xd43f('0x2d')][_0xd43f('0x54')]('nolimit')){_0xa29ccc[_0xd43f('0x1c')]=qs[_0xd43f('0x1c')](_0xc8fc9[_0xd43f('0x2d')][_0xd43f('0x1c')]);_0xa29ccc[_0xd43f('0x1a')]=qs[_0xd43f('0x1a')](_0xc8fc9[_0xd43f('0x2d')][_0xd43f('0x1a')]);}_0xa29ccc[_0xd43f('0x34')]=qs['sort'](_0xc8fc9[_0xd43f('0x2d')]['sort']);_0xa29ccc[_0xd43f('0x36')]=qs[_0xd43f('0x2e')](_[_0xd43f('0x55')](_0xc8fc9[_0xd43f('0x2d')],_0x4a3dc['filters']));_0xa29ccc[_0xd43f('0x36')][_0xd43f('0x50')]=_0x17830b['id'];if(_0xc8fc9['query'][_0xd43f('0x39')]){_0xa29ccc[_0xd43f('0x36')]=_[_0xd43f('0x37')](_0xa29ccc[_0xd43f('0x36')],{'$or':_[_0xd43f('0x28')](_0xa29ccc[_0xd43f('0x31')],function(_0x4f3d39){var _0x5c6897={};_0x5c6897[_0x4f3d39]={'$like':'%'+_0xc8fc9['query'][_0xd43f('0x39')]+'%'};return _0x5c6897;})});}_0xa29ccc=_['merge']({},_0xa29ccc,_0xc8fc9[_0xd43f('0x3a')]);return db['CannedAnswer'][_0xd43f('0x1d')]({'where':_0xa29ccc[_0xd43f('0x36')]})[_0xd43f('0x10')](function(_0xcd8b45){_0x4dab68[_0xd43f('0x1d')]=_0xcd8b45;if(_0xc8fc9[_0xd43f('0x2d')][_0xd43f('0x3b')]){_0xa29ccc[_0xd43f('0x3c')]=[{'all':!![]}];}return db[_0xd43f('0x59')][_0xd43f('0x3d')](_0xa29ccc);})[_0xd43f('0x10')](function(_0x32a272){_0x4dab68[_0xd43f('0x3e')]=_0x32a272;return _0x4dab68;});}})['then'](respondWithFilteredResult(_0x596bde,_0xa29ccc))[_0xd43f('0x17')](handleError(_0x596bde,null));};exports[_0xd43f('0x5b')]=function(_0x80efa4,_0x43f29e){return db[_0xd43f('0x29')]['find']({'where':{'id':_0x80efa4[_0xd43f('0x3f')]['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x43f29e,null))[_0xd43f('0x10')](function(_0xd6f157){if(_0xd6f157){return _0xd6f157[_0xd43f('0x5b')](_0x80efa4[_0xd43f('0x2d')][_0xd43f('0x57')]);}})['then'](respondWithStatusCode(_0x43f29e,null))['catch'](handleError(_0x43f29e,null));};exports[_0xd43f('0x5c')]=function(_0x23fd84,_0x3781a9){_0x23fd84[_0xd43f('0x4d')]['sitepic']=_0x23fd84['file']['filename'];return db['ChatWebsite'][_0xd43f('0x42')]({'where':{'id':_0x23fd84[_0xd43f('0x3f')]['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x3781a9,null))[_0xd43f('0x10')](saveUpdates(_0x23fd84[_0xd43f('0x4d')],null))[_0xd43f('0x10')](respondWithResult(_0x3781a9,null))['catch'](handleError(_0x3781a9,null));};exports[_0xd43f('0x5d')]=function(_0xfa6af3,_0x59da9b){_0xfa6af3['body']['agentAvatar']=_0xfa6af3[_0xd43f('0x5e')][_0xd43f('0x5f')];return db['ChatWebsite'][_0xd43f('0x42')]({'where':{'id':_0xfa6af3['params']['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x59da9b,null))['then'](saveUpdates(_0xfa6af3[_0xd43f('0x4d')],null))[_0xd43f('0x10')](respondWithResult(_0x59da9b,null))['catch'](handleError(_0x59da9b,null));};exports[_0xd43f('0x60')]=function(_0x245b22,_0x12f230){_0x245b22['body']['customerAvatar']=_0x245b22[_0xd43f('0x5e')]['filename'];return db[_0xd43f('0x29')][_0xd43f('0x42')]({'where':{'id':_0x245b22[_0xd43f('0x3f')]['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x12f230,null))[_0xd43f('0x10')](saveUpdates(_0x245b22['body'],null))[_0xd43f('0x10')](respondWithResult(_0x12f230,null))['catch'](handleError(_0x12f230,null));};exports[_0xd43f('0x61')]=function(_0x3bd29e,_0x547185){_0x3bd29e[_0xd43f('0x4d')][_0xd43f('0x62')]=_0x3bd29e['file'][_0xd43f('0x5f')];return db['ChatWebsite'][_0xd43f('0x42')]({'where':{'id':_0x3bd29e[_0xd43f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x547185,null))[_0xd43f('0x10')](saveUpdates(_0x3bd29e[_0xd43f('0x4d')],null))[_0xd43f('0x10')](respondWithResult(_0x547185,null))[_0xd43f('0x17')](handleError(_0x547185,null));};exports[_0xd43f('0x63')]=function(_0x37e350,_0x8359f6){var _0xb503d9=path[_0xd43f('0x64')](config['root'],_0xd43f('0x65'));var _0x1caf5d={'where':{'id':_0x37e350[_0xd43f('0x3f')]['id']},'attributes':['id',_0xd43f('0x66')],'raw':!![]};var _0x493268=![];return require(_0xd43f('0x67'))[_0xd43f('0x68')]()['then'](function(_0x2a8c7b){if(_0x2a8c7b){_0x493268=_0x2a8c7b[_0xd43f('0x69')];}})[_0xd43f('0x10')](function(){return db[_0xd43f('0x29')][_0xd43f('0x42')](_0x1caf5d);})[_0xd43f('0x10')](handleEntityNotFound(_0x8359f6,null))['then'](function(_0x3757e1){if(_0x3757e1){if(!_['isNil'](_0x3757e1['sitepic'])){if(fs[_0xd43f('0x6a')](path[_0xd43f('0x64')](config[_0xd43f('0x6b')],_0xd43f('0x6c'),_0x3757e1['sitepic']))&&_0x493268){_0xb503d9=path[_0xd43f('0x64')](config[_0xd43f('0x6b')],_0xd43f('0x6c'),_0x3757e1[_0xd43f('0x66')]);}}return _0x8359f6['download'](_0xb503d9);}})[_0xd43f('0x17')](handleError(_0x8359f6,null));};exports[_0xd43f('0x6d')]=function(_0x5b2330,_0x56710d){var _0x3905c4=path[_0xd43f('0x64')](config[_0xd43f('0x6b')],_0xd43f('0x6e'));var _0x2b8199={'where':{'id':_0x5b2330[_0xd43f('0x3f')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xd43f('0x29')][_0xd43f('0x42')](_0x2b8199)[_0xd43f('0x10')](handleEntityNotFound(_0x56710d,null))[_0xd43f('0x10')](function(_0x526a55){if(_0x526a55){if(!_[_0xd43f('0x6f')](_0x526a55[_0xd43f('0x70')])){if(fs[_0xd43f('0x6a')](path[_0xd43f('0x64')](config['root'],'server/files/images/avatars/',_0x526a55[_0xd43f('0x70')]))){_0x3905c4=path[_0xd43f('0x64')](config['root'],_0xd43f('0x71'),_0x526a55[_0xd43f('0x70')]);}}return _0x56710d[_0xd43f('0x72')](_0x3905c4);}})[_0xd43f('0x17')](handleError(_0x56710d,null));};exports['getCustomerAvatar']=function(_0x3c7b21,_0x37fded){var _0x39b6ce=path['join'](config[_0xd43f('0x6b')],_0xd43f('0x73'));var _0x378e67={'where':{'id':_0x3c7b21[_0xd43f('0x3f')]['id']},'attributes':['id',_0xd43f('0x74'),_0xd43f('0x75')],'raw':!![]};return db[_0xd43f('0x29')]['find'](_0x378e67)['then'](handleEntityNotFound(_0x37fded,null))[_0xd43f('0x10')](function(_0x2b4210){if(_0x2b4210){if(!_[_0xd43f('0x6f')](_0x2b4210['customerAvatar'])){if(fs[_0xd43f('0x6a')](path[_0xd43f('0x64')](config[_0xd43f('0x6b')],_0xd43f('0x71'),_0x2b4210[_0xd43f('0x74')]))&&_0x2b4210[_0xd43f('0x75')]){_0x39b6ce=path[_0xd43f('0x64')](config['root'],_0xd43f('0x71'),_0x2b4210[_0xd43f('0x74')]);}}return _0x37fded[_0xd43f('0x72')](_0x39b6ce);}})[_0xd43f('0x17')](handleError(_0x37fded,null));};exports[_0xd43f('0x76')]=function(_0x52db62,_0x211b48){var _0x4fe18a=path['join'](config[_0xd43f('0x6b')],_0xd43f('0x77'));var _0x1911e5={'where':{'id':_0x52db62[_0xd43f('0x3f')]['id']},'attributes':['id',_0xd43f('0x62')],'raw':!![]};return db[_0xd43f('0x29')][_0xd43f('0x42')](_0x1911e5)[_0xd43f('0x10')](handleEntityNotFound(_0x211b48,null))[_0xd43f('0x10')](function(_0x3958e3){if(_0x3958e3){if(!_['isNil'](_0x3958e3[_0xd43f('0x62')])){if(fs[_0xd43f('0x6a')](path[_0xd43f('0x64')](config[_0xd43f('0x6b')],_0xd43f('0x71'),_0x3958e3['systemAvatar']))){_0x4fe18a=path[_0xd43f('0x64')](config[_0xd43f('0x6b')],_0xd43f('0x71'),_0x3958e3[_0xd43f('0x62')]);}}return _0x211b48[_0xd43f('0x72')](_0x4fe18a);}})[_0xd43f('0x17')](handleError(_0x211b48,null));};exports[_0xd43f('0x78')]=function(_0x30be89,_0x2eba10){var _0x549041=require('user-agent-parser');var _0x3b8c12=new _0x549041();var _0x5e631f=_0x3b8c12[_0xd43f('0x79')](_0x30be89[_0xd43f('0x7a')][_0xd43f('0x7b')])[_0xd43f('0x7c')]();var _0x48499c={'body':_0x30be89[_0xd43f('0x4d')],'channel':_0xd43f('0x7d')};var _0xde7606=[];var _0x50f233=[];var _0x126eae={};var _0x17443f=![];return db[_0xd43f('0x7e')][_0xd43f('0x4e')]()['then'](function(_0x427e05){if(!_0x427e05){throw new db[(_0xd43f('0x7f'))][(_0xd43f('0x80'))]('no\x20available\x20attributes');}_0xde7606=_[_0xd43f('0x81')](_['keys'](_0x427e05),[_0xd43f('0x82'),_0xd43f('0x83')]);_0x50f233=_[_0xd43f('0x81')](_[_0xd43f('0x40')](_0x427e05),[_0xd43f('0x82'),_0xd43f('0x83'),_0xd43f('0x84'),_0xd43f('0x85')]);if(_0x30be89[_0xd43f('0x4d')]['id']){delete _0x30be89[_0xd43f('0x4d')]['id'];}if(_['isNil'](_0x30be89[_0xd43f('0x4d')]['from'])){throw new db[(_0xd43f('0x7f'))][(_0xd43f('0x80'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x30be89[_0xd43f('0x4d')][_0xd43f('0x4d')])||_0x30be89[_0xd43f('0x4d')][_0xd43f('0x4d')]===''){throw new db['Sequelize'][(_0xd43f('0x80'))](_0xd43f('0x86'));}if(_['isNil'](_0x30be89[_0xd43f('0x4d')][_0xd43f('0x87')])){throw new db[(_0xd43f('0x7f'))][(_0xd43f('0x80'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x50f233);}if(!_[_0xd43f('0x88')](_0x50f233,_0x30be89[_0xd43f('0x4d')][_0xd43f('0x87')])){throw new db[(_0xd43f('0x7f'))]['ValidationError'](_0xd43f('0x89')+_0x50f233);}_0x126eae[_0x30be89['body'][_0xd43f('0x87')]]=_0x30be89[_0xd43f('0x4d')][_0xd43f('0x8a')];})[_0xd43f('0x10')](function(){return db[_0xd43f('0x29')][_0xd43f('0x42')]({'where':{'id':_0x30be89[_0xd43f('0x3f')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xd43f('0x7e')],'as':_0xd43f('0x8b'),'where':_0x126eae,'limit':0x1,'order':[[_0xd43f('0x83'),_0xd43f('0x8c')]]}]},{'model':db[_0xd43f('0x8d')],'as':_0xd43f('0x8e')}]});})[_0xd43f('0x10')](handleEntityNotFound(_0x2eba10,null))[_0xd43f('0x10')](function(_0x445bb2){if(_0x445bb2&&_0x445bb2[_0xd43f('0x8f')]){_0x48499c[_0xd43f('0x90')]=_0x445bb2;_0x48499c[_0xd43f('0x91')]=_0x445bb2[_0xd43f('0x8e')];_0x48499c[_0xd43f('0x92')]=_0x445bb2[_0xd43f('0x8f')];_0x48499c['applications']=_[_0xd43f('0x93')](_0x48499c[_0xd43f('0x91')],[_0xd43f('0x94')],[_0xd43f('0x95')]);if(_0x48499c['account'][_0xd43f('0x8e')]){delete _0x48499c[_0xd43f('0x90')][_0xd43f('0x8e')];}if(_0x48499c[_0xd43f('0x90')][_0xd43f('0x8f')]&&_0x48499c[_0xd43f('0x90')][_0xd43f('0x8f')][_0xd43f('0x8b')][_0xd43f('0x32')]){return _0x48499c[_0xd43f('0x90')][_0xd43f('0x8f')][_0xd43f('0x8b')][0x0];}var _0x41c0ea=_[_0xd43f('0x9')](_0x30be89['body'],{'firstName':_0x30be89['body']['from'],'ListId':_0x445bb2[_0xd43f('0x85')]});_0x41c0ea[_0x30be89['body']['mapKey']]=_0x30be89[_0xd43f('0x4d')][_0xd43f('0x8a')];return db[_0xd43f('0x7e')][_0xd43f('0x43')](_0x41c0ea,{'fields':_0xde7606,'raw':!![]});}})[_0xd43f('0x10')](handleEntityNotFound(_0x2eba10,null))['then'](function(_0x808f94){_0x48499c[_0xd43f('0x96')]=_0x808f94;var _0x4cbb61=_0x30be89[_0xd43f('0x4d')]['customerIp'];if(_0x30be89[_0xd43f('0x7a')][_0xd43f('0x97')]){_0x4cbb61=_0x30be89[_0xd43f('0x7a')][_0xd43f('0x97')];}else if(_0x30be89['headers'][_0xd43f('0x98')]){_0x4cbb61=_[_0xd43f('0x99')](_0x30be89['headers'][_0xd43f('0x98')][_0xd43f('0x9a')](','));}if(_0x808f94){var _0x651f61={'ContactId':_0x808f94['id'],'ChatWebsiteId':_0x30be89['params']['id'],'from':(_0x808f94[_0xd43f('0x9b')]||'')+'\x20'+(_0x808f94['lastName']||''),'customerIp':_0x4cbb61,'customerPort':_0x30be89['headers'][_0xd43f('0x9c')]?_0x30be89[_0xd43f('0x7a')][_0xd43f('0x9c')]:null,'referer':_0x30be89[_0xd43f('0x4d')][_0xd43f('0x9d')],'browserName':_0x5e631f[_0xd43f('0x9e')][_0xd43f('0x23')]&&_0x5e631f[_0xd43f('0x9e')][_0xd43f('0x9f')]?util[_0xd43f('0xa0')]('%s\x20%s',_0x5e631f[_0xd43f('0x9e')]['name'],_0x5e631f[_0xd43f('0x9e')][_0xd43f('0x9f')]):'unknown','browserVersion':_0x5e631f['browser'][_0xd43f('0x9f')]||_0xd43f('0xa1'),'osName':util[_0xd43f('0xa0')]('%s\x20%s',_0x5e631f['os']['name'],_0x5e631f['os'][_0xd43f('0x9f')]),'osVersion':_0x5e631f['os'][_0xd43f('0x9f')],'deviceModel':_0x5e631f[_0xd43f('0xa2')]['model']&&_0x5e631f[_0xd43f('0xa2')][_0xd43f('0xa3')]?util[_0xd43f('0xa0')]('%s\x20%s\x20%s',_0x5e631f['device']['model'],_0x5e631f[_0xd43f('0xa2')][_0xd43f('0xa3')],_0x5e631f[_0xd43f('0xa2')][_0xd43f('0xa4')]):null,'deviceVendor':_0x5e631f[_0xd43f('0xa2')][_0xd43f('0xa3')],'deviceType':_0x5e631f[_0xd43f('0xa2')][_0xd43f('0xa4')],'formData':JSON[_0xd43f('0xa5')](_0x30be89[_0xd43f('0x4d')])};var _0xed7746={'ChatWebsiteId':_0x30be89[_0xd43f('0x3f')]['id'],'closed':![]};if(_0x30be89['body'][_0xd43f('0xa6')]){_0xed7746[_0xd43f('0xa6')]=_0x30be89[_0xd43f('0x4d')][_0xd43f('0xa6')];return db['ChatInteraction'][_0xd43f('0x42')]({'where':_0xed7746})['then'](function(_0x47c1a9){if(_0x47c1a9){return[_0x47c1a9,![]];}_0x651f61[_0xd43f('0xa6')]=_0x30be89[_0xd43f('0x4d')][_0xd43f('0xa6')];_0x651f61[_0xd43f('0xa7')]=_0x30be89['body'][_0xd43f('0xa7')];return db[_0xd43f('0xa8')][_0xd43f('0x43')](_0x651f61)[_0xd43f('0x10')](function(_0x1b46d8){return[_0x1b46d8,!![]];});});}_0xed7746[_0xd43f('0xa9')]=_0x808f94['id'];if(_0x30be89['body'][_0xd43f('0xaa')]&&_0x30be89['body']['interaction']['id']){_0xed7746['id']=_0x30be89['body'][_0xd43f('0xaa')]['id'];return db[_0xd43f('0xa8')][_0xd43f('0x42')]({'where':_0xed7746})['then'](function(_0x3e1382){if(_0x3e1382){return[_0x3e1382,![]];}return db[_0xd43f('0xa8')][_0xd43f('0x43')](_0x651f61)[_0xd43f('0x10')](function(_0x3c9d94){return[_0x3c9d94,!![]];});});}return db[_0xd43f('0xa8')][_0xd43f('0x43')](_0x651f61)[_0xd43f('0x10')](function(_0x651406){return[_0x651406,!![]];});}})[_0xd43f('0xab')](function(_0x32a0e5,_0x260151){if(_0x32a0e5){_0x17443f=_0x260151;if(!_0x260151){var _0x2f02b0={'from':(_0x48499c['contact'][_0xd43f('0x9b')]||'')+'\x20'+(_0x48499c[_0xd43f('0x96')][_0xd43f('0xac')]||'')};if(_0x30be89[_0xd43f('0x4d')][_0xd43f('0xa6')]&&_0x30be89[_0xd43f('0x4d')][_0xd43f('0xad')]&&_0x30be89['body'][_0xd43f('0xa6')]!=_0x30be89['body'][_0xd43f('0xad')]){_0x2f02b0[_0xd43f('0xa6')]=_0x30be89[_0xd43f('0x4d')][_0xd43f('0xad')];}return _0x32a0e5['update'](_0x2f02b0);}else{return _0x32a0e5;}}})[_0xd43f('0x10')](function(_0x175eb7){_0x48499c[_0xd43f('0xaa')]=_0x175eb7[_0xd43f('0x21')]({'plain':!![]});_0x48499c[_0xd43f('0xaa')][_0xd43f('0xae')]=_0x17443f;if(_0x48499c[_0xd43f('0xaa')][_0xd43f('0xae')]){if(_0x48499c[_0xd43f('0x90')]['autoclose']){_0x48499c['applications']['push']({'id':0x0,'priority':_0x48499c[_0xd43f('0x91')][_0xd43f('0x32')]+0x1,'app':_0xd43f('0xaf'),'appdata':_0xd43f('0xb0'),'interval':_0xd43f('0xb1')});}}return db[_0xd43f('0xb2')]['create']({'body':_0x30be89[_0xd43f('0x4d')][_0xd43f('0x4d')],'ChatWebsiteId':_0x30be89[_0xd43f('0x3f')]['id'],'ChatInteractionId':_0x175eb7['id'],'direction':'in','ContactId':_0x48499c['contact']['id'],'AttachmentId':_0x30be89[_0xd43f('0x4d')]['AttachmentId']});})[_0xd43f('0x10')](function(_0x2d4eb6){_0x48499c[_0xd43f('0x15')]=_0x2d4eb6;if(_0x48499c[_0xd43f('0xaa')]['UserId']){return db['User']['find']({'attributes':['id',_0xd43f('0x23')],'where':{'id':_0x48499c[_0xd43f('0xaa')][_0xd43f('0xb3')]}})[_0xd43f('0x10')](function(_0x1f27ae){if(_0x1f27ae){_0x48499c[_0xd43f('0x91')][_0xd43f('0xb4')]({'id':0x0,'priority':0x0,'app':_0xd43f('0xb5'),'appdata':_0x1f27ae[_0xd43f('0x23')]+','+(_0x48499c[_0xd43f('0x90')][_0xd43f('0xb6')]||0xa),'interval':_0xd43f('0xb1')});_0x48499c[_0xd43f('0xb7')]=!![];}return respondWithRpcPromise(_0xd43f('0xb8'),'startRouting',_0x48499c);});}return respondWithRpcPromise(_0xd43f('0xb8'),_0xd43f('0xb9'),_0x48499c);})[_0xd43f('0x10')](function(_0x161bbd){respondWithRpcPromise(_0xd43f('0xba'),'EventManager',{'event':_0xd43f('0x78'),'message':_0x161bbd},client9002);return _0x161bbd;})['then'](respondWithResult(_0x2eba10,null))['catch'](handleError(_0x2eba10,null));};exports[_0xd43f('0xbb')]=function(_0x3aa9e9,_0x2ed713){var _0x5c3ac1,_0x6e28c,_0x26f89a;var _0xf8f697=[];var _0x10ad5f={};var _0x45e33b=_0x3aa9e9[_0xd43f('0xbc')]||[];var _0x5aafaf=[];var _0x1995b2;return db[_0xd43f('0x7e')][_0xd43f('0x4e')]()[_0xd43f('0x10')](function(_0x1036e4){if(!_0x1036e4){throw new db['Sequelize'][(_0xd43f('0x80'))](_0xd43f('0xbd'));}_0xf8f697=_[_0xd43f('0x81')](_[_0xd43f('0x40')](_0x1036e4),[_0xd43f('0x82'),_0xd43f('0x83'),'CompanyId',_0xd43f('0x85')]);if(_0x3aa9e9['body']['id']){delete _0x3aa9e9[_0xd43f('0x4d')]['id'];}if(_[_0xd43f('0x6f')](_0x3aa9e9[_0xd43f('0x4d')][_0xd43f('0x8a')])){throw _0x2ed713['status'](0x1f4)[_0xd43f('0x24')](new db[(_0xd43f('0x7f'))][(_0xd43f('0x80'))](_0xd43f('0xbe')));}if(_[_0xd43f('0x6f')](_0x3aa9e9['body'][_0xd43f('0x4d')])||_0x3aa9e9[_0xd43f('0x4d')][_0xd43f('0x4d')]===''){throw _0x2ed713['status'](0x1f4)['send'](new db['Sequelize'][(_0xd43f('0x80'))](_0xd43f('0x86')));}if(_['isNil'](_0x3aa9e9['body'][_0xd43f('0xbf')])){throw _0x2ed713[_0xd43f('0x18')](0x1f4)[_0xd43f('0x24')](new db[(_0xd43f('0x7f'))][(_0xd43f('0x80'))](_0xd43f('0xc0')+_0xf8f697));}if(!_[_0xd43f('0x88')](_0xf8f697,_0x3aa9e9[_0xd43f('0x4d')]['mapKeyOffline'])){throw _0x2ed713[_0xd43f('0x18')](0x1f4)[_0xd43f('0x24')](new db[(_0xd43f('0x7f'))][(_0xd43f('0x80'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf8f697));}_0x10ad5f[_0x3aa9e9[_0xd43f('0x4d')][_0xd43f('0xbf')]]=_0x3aa9e9[_0xd43f('0x4d')][_0xd43f('0x8a')];})['then'](function(){return db['ChatWebsite'][_0xd43f('0x42')]({'where':{'id':_0x3aa9e9[_0xd43f('0x3f')]['id']},'include':[{'model':db[_0xd43f('0xc1')],'as':_0xd43f('0x8f')},{'model':db['MailAccount'],'as':_0xd43f('0xc2')}]});})[_0xd43f('0x10')](handleEntityNotFound(_0x2ed713,null))['then'](function(_0x21bad8){if(_0x21bad8&&_0x21bad8[_0xd43f('0x8f')]){_0x6e28c=_0x21bad8;var _0x50c513=_[_0xd43f('0x9')](_0x3aa9e9[_0xd43f('0x4d')],{'firstName':_0x3aa9e9[_0xd43f('0x4d')][_0xd43f('0x8a')],'phone':_0x3aa9e9[_0xd43f('0x4d')]['from'],'ListId':_0x21bad8[_0xd43f('0x85')]});_0x50c513[_0x3aa9e9[_0xd43f('0x4d')][_0xd43f('0xbf')]]=_0x3aa9e9[_0xd43f('0x4d')]['from'];return db[_0xd43f('0x7e')][_0xd43f('0xc3')]({'where':_0x10ad5f,'defaults':_0x50c513});}})[_0xd43f('0xab')](function(_0x55600f){if(_0x55600f){_0x26f89a=_0x55600f;var _0x3a2f6f=fs[_0xd43f('0xc4')](path[_0xd43f('0x64')](config[_0xd43f('0x6b')],_0xd43f('0xc5')),'utf8');var _0x3562f5=ejs['render'](_0x3a2f6f,{'body':_['toPairs'](_0x3aa9e9[_0xd43f('0x4d')]['body']),'bodyTitle':_0x6e28c[_0xd43f('0xc6')]});return db['ChatOfflineMessage'][_0xd43f('0x43')]({'body':_0x3562f5,'plainBody':htmlToText[_0xd43f('0xc7')](_0x3562f5),'ContactId':_0x55600f['id'],'ChatWebsiteId':_0x6e28c['id']});}})[_0xd43f('0x10')](function(_0x13dcce){_0x1995b2=_0x13dcce;if(_0x45e33b[_0xd43f('0x32')]){var _0x2e30d3=_0x45e33b[_0xd43f('0x28')](function(_0x1a59d8){return{'name':_0x1a59d8[_0xd43f('0xc8')],'basename':_0x1a59d8[_0xd43f('0x5f')],'type':_0x1a59d8[_0xd43f('0xc9')],'ChatOfflineMessageId':_0x13dcce['id']};});_0x5aafaf=_0x2e30d3[_0xd43f('0x28')](_0x48410f=>{var _0x56e7eb={'filename':_0x48410f[_0xd43f('0x23')],'path':path['join'](config[_0xd43f('0x6b')],_0xd43f('0xca'),_0xd43f('0xbc'),_0xd43f('0xcb'),_0xd43f('0xcc'),_0x48410f[_0xd43f('0xcd')])};return _0x56e7eb;});if(!_0x6e28c[_0xd43f('0xce')]){return db[_0xd43f('0xcf')][_0xd43f('0xd0')](function(_0xfdbe57){return db[_0xd43f('0xd1')]['bulkCreate'](_0x2e30d3,{'transaction':_0xfdbe57});});}}})[_0xd43f('0x10')](function(){if(_0x1995b2){_0x5c3ac1=_0x1995b2;return db[_0xd43f('0xc2')][_0xd43f('0x52')]({'where':{'service':!![]},'include':[{'model':db[_0xd43f('0xd2')],'as':_0xd43f('0xd3'),'raw':!![],'include':[{'model':db[_0xd43f('0xd4')],'as':_0xd43f('0xd4'),'raw':!![]}]}]});}})[_0xd43f('0x10')](function(_0x50571e){if(_0x50571e&&_0x50571e[_0xd43f('0xd3')]&&_0x6e28c[_0xd43f('0xd5')]&&_0x6e28c[_0xd43f('0xd6')]){var _0x1e40c0=_0x50571e['getSmtpOptions']();return respondWithRpcPromise(_0xd43f('0xd7'),_0xd43f('0xd8'),{'account':_0x1e40c0,'message':{'from':util[_0xd43f('0xa0')](_0xd43f('0xd9'),_0x50571e[_0xd43f('0x23')],_0x50571e[_0xd43f('0xda')]||_0x50571e['Smtp']['user']),'to':_0x6e28c['forwardOfflineAddress'],'subject':_0x6e28c[_0xd43f('0xdb')],'html':_0x5c3ac1[_0xd43f('0x4d')],'attachments':_0x5aafaf}},client9003)[_0xd43f('0x10')](function(){return _0x5c3ac1;})['catch'](function(_0x372b2d){logger[_0xd43f('0x14')](_0x372b2d);});}})[_0xd43f('0x10')](function(){if(_0x6e28c&&_0x6e28c[_0xd43f('0xce')]&&_0x6e28c[_0xd43f('0xdc')]){var _0x1e9d7e=[];if(_0x45e33b[_0xd43f('0x32')]){_0x1e9d7e=_0x45e33b['map'](function(_0x8ac678){return{'name':_0x8ac678[_0xd43f('0xc8')],'basename':_0x8ac678['filename'],'type':_0x8ac678['mimetype'],'ChatOfflineMessageId':_0x1995b2['id']};});}var _0x30c306;if(!_[_0xd43f('0x6f')](_0x6e28c[_0xd43f('0xdd')])){var _0x32c6ce=_['map'](_0x3aa9e9[_0xd43f('0x4d')],function(_0x19b090){return _0x19b090;});var _0xcad05c=_[_0xd43f('0xde')](_0x32c6ce)[0x0];var _0x122339=_[_0xd43f('0xdf')](_0xcad05c,function(_0x299bc7){return _0x299bc7;});_0x30c306=_0x122339[0x1][_0x6e28c['subjectOffline']];}var _0x4f762f={'from':_0x26f89a[_0xd43f('0xda')],'firstName':_0x26f89a[_0xd43f('0x9b')],'lastName':_0x26f89a[_0xd43f('0xac')],'mapKey':_0xd43f('0xda'),'message':{'from':_0x26f89a[_0xd43f('0xda')],'to':_0x6e28c[_0xd43f('0xc2')][_0xd43f('0xda')],'cc':'','subject':_[_0xd43f('0x6f')](_0x30c306)?_0x6e28c[_0xd43f('0xdb')]:_0x30c306,'messageId':'','sentAt':new Date(),'attach':_0x1e9d7e['length'],'attachments':_0x1e9d7e,'originChannel':_0xd43f('0xe0'),'ChatWebsiteId':_0x6e28c['id'],'ChatOfflineMessageId':_0x5c3ac1['id'],'originTo':_0x6e28c[_0xd43f('0xc2')][_0xd43f('0xda')]},'body':_0x5c3ac1[_0xd43f('0x4d')]};var _0x2143ad={'account':{'id':_0x6e28c['MailAccountId']},'body':_0x4f762f,'log':_0xd43f('0xe1')};return respondWithRpcPromise(_0xd43f('0xe1'),_0xd43f('0xe2'),_0x2143ad,client9001)['then'](function(){return _0x5c3ac1;})[_0xd43f('0x17')](function(_0x36839a){logger[_0xd43f('0x14')](_0x36839a);});}return;})[_0xd43f('0x10')](function(){if(_0x5c3ac1){return _0x5c3ac1;}})[_0xd43f('0x10')](respondWithResult(_0x2ed713,null))[_0xd43f('0x17')](function(_0x33517d){logger[_0xd43f('0x14')](_0xd43f('0x17'),_0x33517d);for(var _0x1379fe of _0x45e33b){var _0x328736=path['join'](config['root'],_0xd43f('0xca'),'files',_0xd43f('0xcb'),'offline-chat',_0x1379fe[_0xd43f('0x5f')]);fs_extra[_0xd43f('0xe3')](_0x328736)[_0xd43f('0x17')](function(_0x497c60){logger[_0xd43f('0x14')]('Could\x20not\x20remove\x20attachment\x20file',_0x328736,_0x497c60);});}});};exports[_0xd43f('0xe4')]=function(_0x2bd853,_0x29f0fc){return db[_0xd43f('0xa8')][_0xd43f('0x42')]({'where':{'id':_0x2bd853[_0xd43f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x29f0fc,null))[_0xd43f('0x10')](function(_0x25890a){if(_0x25890a){return _0x25890a['addInteraction'](_0x2bd853[_0xd43f('0x4d')]['ids'],_[_0xd43f('0xe5')](_0x2bd853[_0xd43f('0x4d')],[_0xd43f('0x57'),'id'])||{});}})[_0xd43f('0x10')](respondWithResult(_0x29f0fc,null))[_0xd43f('0x17')](handleError(_0x29f0fc,null));};exports['getInteractions']=function(_0x2f10ee,_0x41fae1){var _0x41f10e={'raw':![],'where':{}};var _0x240bf3={};var _0xbc1c44={'count':0x0,'rows':[]};return db[_0xd43f('0x29')]['findOne']({'where':{'id':_0x2f10ee[_0xd43f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x41fae1,null))[_0xd43f('0x10')](function(_0x1a4385){if(_0x1a4385){_0x240bf3[_0xd43f('0x2f')]=_[_0xd43f('0x40')](db['ChatInteraction'][_0xd43f('0x2a')]);_0x240bf3[_0xd43f('0x2d')]=_[_0xd43f('0x40')](_0x2f10ee[_0xd43f('0x2d')]);_0x240bf3[_0xd43f('0x2e')]=_[_0xd43f('0x30')](_0x240bf3[_0xd43f('0x2f')],_0x240bf3['query']);_0x41f10e[_0xd43f('0x31')]=_[_0xd43f('0x30')](_0x240bf3['model'],qs[_0xd43f('0x41')](_0x2f10ee[_0xd43f('0x2d')][_0xd43f('0x41')]));_0x41f10e[_0xd43f('0x31')]=_0x41f10e[_0xd43f('0x31')]['length']?_0x41f10e[_0xd43f('0x31')]:_0x240bf3['model'];if(!_0x2f10ee[_0xd43f('0x2d')][_0xd43f('0x54')](_0xd43f('0x33'))){_0x41f10e[_0xd43f('0x1c')]=qs[_0xd43f('0x1c')](_0x2f10ee[_0xd43f('0x2d')][_0xd43f('0x1c')]);_0x41f10e[_0xd43f('0x1a')]=qs[_0xd43f('0x1a')](_0x2f10ee[_0xd43f('0x2d')]['offset']);}_0x41f10e[_0xd43f('0x34')]=qs[_0xd43f('0x35')](_0x2f10ee[_0xd43f('0x2d')]['sort']);_0x41f10e[_0xd43f('0x36')]=qs[_0xd43f('0x2e')](_[_0xd43f('0x55')](_0x2f10ee['query'],_0x240bf3[_0xd43f('0x2e')]));_0x41f10e[_0xd43f('0x36')][_0xd43f('0x50')]=_0x1a4385['id'];if(_0x2f10ee[_0xd43f('0x2d')]['filter']){_0x41f10e[_0xd43f('0x36')]=_[_0xd43f('0x37')](_0x41f10e[_0xd43f('0x36')],{'$or':_['map'](_0x41f10e['attributes'],function(_0x5264b4){var _0x58badb={};_0x58badb[_0x5264b4]={'$like':'%'+_0x2f10ee[_0xd43f('0x2d')][_0xd43f('0x39')]+'%'};return _0x58badb;})});}_0x41f10e=_[_0xd43f('0x37')]({},_0x41f10e,_0x2f10ee[_0xd43f('0x3a')]);return db[_0xd43f('0xa8')]['count']({'where':_0x41f10e[_0xd43f('0x36')]})['then'](function(_0x16294d){_0xbc1c44[_0xd43f('0x1d')]=_0x16294d;if(_0x2f10ee[_0xd43f('0x2d')]['includeAll']){_0x41f10e[_0xd43f('0x3c')]=[{'model':db[_0xd43f('0x7e')],'as':_0xd43f('0xe6'),'required':![]},{'model':db[_0xd43f('0xe7')],'as':'Owner','attributes':[_0xd43f('0x23'),'fullname',_0xd43f('0xe8')],'required':![]},{'model':db['Tag'],'as':_0xd43f('0xe9'),'attributes':['id',_0xd43f('0x23'),_0xd43f('0xea')],'where':_0x2f10ee[_0xd43f('0x2d')][_0xd43f('0xeb')]?{'id':_0x2f10ee[_0xd43f('0x2d')][_0xd43f('0xeb')]}:undefined,'required':_0x2f10ee[_0xd43f('0x2d')][_0xd43f('0xeb')]?!![]:![]}];}return db['ChatInteraction'][_0xd43f('0x3d')](_0x41f10e);})[_0xd43f('0x10')](function(_0x5d7e12){_0xbc1c44[_0xd43f('0x3e')]=_0x5d7e12;return _0xbc1c44;});}})[_0xd43f('0x10')](respondWithFilteredResult(_0x41fae1,_0x41f10e))['catch'](handleError(_0x41fae1,null));};function iftimePromise(_0x10df6a,_0x5cf524){return respondWithRpcPromise(_0xd43f('0xec'),_0xd43f('0xed'),{'command':_0x5cf524[_0xd43f('0xee')]?util[_0xd43f('0xa0')](_0xd43f('0xef'),_0x10df6a['interval'],_0x5cf524[_0xd43f('0xee')]):util['format'](_0xd43f('0xf0'),_0x10df6a['interval'])},client9002)['then'](function(_0x207755){var _0x5a1369=_0x207755&&_0x207755[_0xd43f('0xf1')]('true')>=0x0?!![]:![];logger[_0xd43f('0x11')](_0xd43f('0xf2'),_0x5cf524['id'],_0x10df6a['id'],_0x10df6a[_0xd43f('0xf3')],_0x5a1369?_0xd43f('0xf4'):_0xd43f('0xf5'),_0x5cf524[_0xd43f('0xee')]?_0x5cf524['timezone']:'No\x20timezone');return _0x5a1369;})[_0xd43f('0x17')](function(_0xd7f1be){logger[_0xd43f('0x14')](_0xd43f('0xf2'),_0x5cf524['id'],_0x10df6a['id'],_0x10df6a[_0xd43f('0xf3')],util['inspect'](_0xd7f1be,{'showHidden':![],'depth':null}),_0x5cf524[_0xd43f('0xee')]?_0x5cf524[_0xd43f('0xee')]:'No\x20timezone');return![];});}exports[_0xd43f('0xed')]=function(_0x270e46,_0x2dffa3){var _0x579ae4=0x0;var _0xd5380c=0x0;var _0x2b2567=![];var _0x287845;var _0x543b0a;return db[_0xd43f('0x29')][_0xd43f('0x42')]({'where':{'id':_0x270e46[_0xd43f('0x3f')]['id']},'include':[{'model':db[_0xd43f('0xf6')],'as':_0xd43f('0xf6'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xd43f('0xf3')],'raw':!![]}]}]})[_0xd43f('0x10')](handleEntityNotFound(_0x2dffa3,null))[_0xd43f('0x10')](function(_0x159166){if(_0x159166){_0x287845=_0x159166;return _0x159166[_0xd43f('0xf7')]({'raw':!![]});}})['then'](function(_0x452dc0){if(_0x287845){if(_0x452dc0){_0x543b0a=_0x452dc0;}}return require(_0xd43f('0x67'))['getLicense']();})[_0xd43f('0x10')](function(_0x23142d){if(_0x23142d){_0xd5380c=_0x23142d[_0xd43f('0xf8')];_0x2b2567=_0x23142d[_0xd43f('0x69')];}})['then'](function(){return db[_0xd43f('0xa8')]['count']({'where':{'closed':![]}});})['then'](function(_0x2f6cf1){_0x579ae4=_0x2f6cf1;if(_0xd5380c&&_0x2f6cf1>_0xd5380c){return db[_0xd43f('0xf9')][_0xd43f('0x52')]({'where':{'id':0x1}})[_0xd43f('0x10')](function(_0x1110ff){if(_0x1110ff){_0x1110ff[_0xd43f('0xfa')](_0xd43f('0xfb'));}});}})[_0xd43f('0x10')](function(){if(_0x287845['Interval']&&_0x287845[_0xd43f('0xf6')][_0xd43f('0xfc')]){var _0x4acc9f=[];for(var _0x34f49e=0x0;_0x34f49e<_0x287845[_0xd43f('0xf6')][_0xd43f('0xfc')][_0xd43f('0x32')];_0x34f49e++){var _0x22b12d=_0x287845['Interval']['Intervals'][_0x34f49e][_0xd43f('0x21')]({'plain':!![]});_0x4acc9f[_0xd43f('0xfd')](iftimePromise(_0x22b12d,_0x287845));}return BPromise[_0xd43f('0xfe')](_0x4acc9f)[_0xd43f('0x10')](function(_0x5edccb){return _['some'](_0x5edccb);});}else{return!![];}})[_0xd43f('0x10')](function(_0x51345d){var _0x412f1a=fs[_0xd43f('0xc4')](path[_0xd43f('0x64')](config['root'],_0xd43f('0xff')),'utf8');var _0x4874fd={'remote':_0x287845[_0xd43f('0x100')],'query':querystring[_0xd43f('0xa5')](_[_0xd43f('0x37')](_0x287845['get']({'plain':!![]}),{'customerIp':_0x270e46['headers'][_0xd43f('0x98')]||_0x270e46[_0xd43f('0x7a')][_0xd43f('0x101')]||_0x270e46[_0xd43f('0x102')][_0xd43f('0x103')]||_0x270e46['ip'],'referer':_0x270e46[_0xd43f('0x7a')][_0xd43f('0x9d')],'openedInteractions':_0x579ae4,'maxInteractions':_0xd5380c,'virtual':_0x2b2567[_0xd43f('0xf8')],'online':_0x51345d,'custom':_0x2b2567}))['replace'](/'/g,'\x5c\x27')};_0x2dffa3[_0xd43f('0x24')](ejs[_0xd43f('0x104')](Mustache[_0xd43f('0x104')](_0x412f1a,_0x4874fd),{'proactiveActions':_0x543b0a,'alignment':_0x287845[_0xd43f('0x105')],'verticalAlignment':_0x287845[_0xd43f('0x106')],'div_color':_0x287845['color'],'labelText':_0x287845[_0xd43f('0x107')],'text_color':_0x287845[_0xd43f('0x108')],'button_color':_0x287845[_0xd43f('0x109')],'background_color':_0x287845[_0xd43f('0x10a')],'hideWhenOffline':_0x287845['hideWhenOffline'],'interval':_0x287845[_0xd43f('0x10b')]}));})[_0xd43f('0x17')](handleError(_0x2dffa3,null));};exports[_0xd43f('0x10c')]=function(_0x1623f3,_0xdee04d){var _0x530ded=_0x1623f3['params']['id'];var _0x10db9a=_0x1623f3['body'];var _0x5a0613=0xc8;var _0x427aa0=null;return db['sequelize'][_0xd43f('0xd0')]({'isolationLevel':db[_0xd43f('0xcf')][_0xd43f('0x10d')][_0xd43f('0x10e')][_0xd43f('0x10f')]},function(_0x6892ae){return db[_0xd43f('0x29')][_0xd43f('0x52')]({'where':{'id':_0x530ded},'transaction':_0x6892ae})[_0xd43f('0x10')](function(_0x5eab26){if(_0x5eab26){return db[_0xd43f('0x8d')]['destroy']({'where':{'ChatWebsiteId':_0x530ded},'transaction':_0x6892ae})[_0xd43f('0x10')](function(){var _0xe30976=_[_0xd43f('0x28')](_0x10db9a,function(_0x3b902e){_0x3b902e['ChatWebsiteId']=_0x530ded;return _0x3b902e;});return db['ChatApplication'][_0xd43f('0x110')](_0xe30976,{'transaction':_0x6892ae});});}else{_0x5a0613=0x194;_0x427aa0=[];}});})[_0xd43f('0x10')](function(){if(_0x5a0613!==0x194){return db[_0xd43f('0x8d')][_0xd43f('0x111')]({'where':{'ChatWebsiteId':_0x530ded},'order':_0xd43f('0x94')})[_0xd43f('0x10')](function(_0x57c3fb){_0x427aa0=_0x57c3fb;});}})[_0xd43f('0x17')](function(_0xbb6192){_0x5a0613=0x1f4;logger['error'](_0xbb6192['stack']);if(_0xbb6192[_0xd43f('0x23')]){delete _0xbb6192[_0xd43f('0x23')];}_0x427aa0=_0xbb6192;})[_0xd43f('0x112')](function(){if(_0x427aa0===null){_0xdee04d['sendStatus'](_0x5a0613);}else{if(_0x5a0613===0x1f4){_0xdee04d[_0xd43f('0x18')](_0x5a0613)[_0xd43f('0x24')](_0x427aa0);}else{_0xdee04d[_0xd43f('0x18')](_0x5a0613)[_0xd43f('0x19')](_0x427aa0);}}});};exports[_0xd43f('0x113')]=function(_0x592a62,_0x441e18){var _0x5ef779={};var _0xdb7bde={};var _0x5c69d9;var _0x390bc7;return db[_0xd43f('0x29')][_0xd43f('0x52')]({'where':{'id':_0x592a62[_0xd43f('0x3f')]['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x441e18,null))[_0xd43f('0x10')](function(_0x39238d){if(_0x39238d){_0x5c69d9=_0x39238d;_0xdb7bde[_0xd43f('0x2f')]=_['keys'](db[_0xd43f('0x8d')][_0xd43f('0x2a')]);_0xdb7bde[_0xd43f('0x2d')]=_[_0xd43f('0x40')](_0x592a62['query']);_0xdb7bde['filters']=_[_0xd43f('0x30')](_0xdb7bde[_0xd43f('0x2f')],_0xdb7bde[_0xd43f('0x2d')]);_0x5ef779[_0xd43f('0x31')]=_[_0xd43f('0x30')](_0xdb7bde['model'],qs[_0xd43f('0x41')](_0x592a62[_0xd43f('0x2d')][_0xd43f('0x41')]));_0x5ef779[_0xd43f('0x31')]=_0x5ef779[_0xd43f('0x31')][_0xd43f('0x32')]?_0x5ef779[_0xd43f('0x31')]:_0xdb7bde[_0xd43f('0x2f')];_0x5ef779[_0xd43f('0x34')]=qs[_0xd43f('0x35')](_0x592a62[_0xd43f('0x2d')][_0xd43f('0x35')]);_0x5ef779[_0xd43f('0x36')]=qs[_0xd43f('0x2e')](_[_0xd43f('0x55')](_0x592a62['query'],_0xdb7bde[_0xd43f('0x2e')]));if(_0x592a62[_0xd43f('0x2d')][_0xd43f('0x39')]){_0x5ef779['where']=_['merge'](_0x5ef779['where'],{'$or':_['map'](_0x5ef779[_0xd43f('0x31')],function(_0x18b433){var _0x1df508={};_0x1df508[_0x18b433]={'$like':'%'+_0x592a62['query'][_0xd43f('0x39')]+'%'};return _0x1df508;})});}_0x5ef779=_[_0xd43f('0x37')]({},_0x5ef779,_0x592a62[_0xd43f('0x3a')]);return _0x5c69d9['getApplications'](_0x5ef779);}})[_0xd43f('0x10')](function(_0x2e413d){if(_0x2e413d){_0x390bc7=_0x2e413d[_0xd43f('0x32')];if(!_0x592a62[_0xd43f('0x2d')][_0xd43f('0x54')](_0xd43f('0x33'))){_0x5ef779[_0xd43f('0x1c')]=qs[_0xd43f('0x1c')](_0x592a62[_0xd43f('0x2d')][_0xd43f('0x1c')]);_0x5ef779[_0xd43f('0x1a')]=qs[_0xd43f('0x1a')](_0x592a62[_0xd43f('0x2d')]['offset']);}return _0x5c69d9[_0xd43f('0x113')](_0x5ef779);}})[_0xd43f('0x10')](function(_0x22f638){if(_0x22f638){return _0x22f638?{'count':_0x390bc7,'rows':_0x22f638}:null;}})['then'](respondWithResult(_0x441e18,null))[_0xd43f('0x17')](handleError(_0x441e18,null));};exports['addProactiveActions']=function(_0x2d2884,_0x2b56e7){return db[_0xd43f('0x114')][_0xd43f('0x42')]({'where':{'id':_0x2d2884['params']['id']}})['then'](handleEntityNotFound(_0x2b56e7,null))[_0xd43f('0x10')](function(_0x2e424c){if(_0x2e424c){return _0x2e424c[_0xd43f('0x115')](_0x2d2884[_0xd43f('0x4d')][_0xd43f('0x57')],_[_0xd43f('0xe5')](_0x2d2884[_0xd43f('0x4d')],['ids','id'])||{});}})[_0xd43f('0x10')](respondWithResult(_0x2b56e7,null))[_0xd43f('0x17')](handleError(_0x2b56e7,null));};exports['getProactiveActions']=function(_0x3a5439,_0x1fe152){var _0x3aaea4={};var _0x743b23={};var _0x5819c1;var _0x1abff4;return db[_0xd43f('0x29')][_0xd43f('0x52')]({'where':{'id':_0x3a5439[_0xd43f('0x3f')]['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x1fe152,null))[_0xd43f('0x10')](function(_0x4d719d){if(_0x4d719d){_0x5819c1=_0x4d719d;_0x743b23[_0xd43f('0x2f')]=_[_0xd43f('0x40')](db[_0xd43f('0x116')][_0xd43f('0x2a')]);_0x743b23['query']=_['keys'](_0x3a5439[_0xd43f('0x2d')]);_0x743b23[_0xd43f('0x2e')]=_['intersection'](_0x743b23[_0xd43f('0x2f')],_0x743b23[_0xd43f('0x2d')]);_0x3aaea4[_0xd43f('0x31')]=_[_0xd43f('0x30')](_0x743b23['model'],qs[_0xd43f('0x41')](_0x3a5439[_0xd43f('0x2d')][_0xd43f('0x41')]));_0x3aaea4['attributes']=_0x3aaea4['attributes'][_0xd43f('0x32')]?_0x3aaea4[_0xd43f('0x31')]:_0x743b23[_0xd43f('0x2f')];_0x3aaea4[_0xd43f('0x34')]=qs['sort'](_0x3a5439[_0xd43f('0x2d')][_0xd43f('0x35')]);_0x3aaea4['where']=qs[_0xd43f('0x2e')](_[_0xd43f('0x55')](_0x3a5439[_0xd43f('0x2d')],_0x743b23[_0xd43f('0x2e')]));if(_0x3a5439[_0xd43f('0x2d')]['filter']){_0x3aaea4[_0xd43f('0x36')]=_[_0xd43f('0x37')](_0x3aaea4[_0xd43f('0x36')],{'$or':_[_0xd43f('0x28')](_0x3aaea4[_0xd43f('0x31')],function(_0x4d411b){var _0x2fb265={};_0x2fb265[_0x4d411b]={'$like':'%'+_0x3a5439[_0xd43f('0x2d')][_0xd43f('0x39')]+'%'};return _0x2fb265;})});}_0x3aaea4=_['merge']({},_0x3aaea4,_0x3a5439[_0xd43f('0x3a')]);return _0x5819c1[_0xd43f('0xf7')](_0x3aaea4);}})[_0xd43f('0x10')](function(_0x43fd94){if(_0x43fd94){_0x1abff4=_0x43fd94[_0xd43f('0x32')];if(!_0x3a5439['query'][_0xd43f('0x54')]('nolimit')){_0x3aaea4[_0xd43f('0x1c')]=qs[_0xd43f('0x1c')](_0x3a5439[_0xd43f('0x2d')]['limit']);_0x3aaea4[_0xd43f('0x1a')]=qs[_0xd43f('0x1a')](_0x3a5439[_0xd43f('0x2d')]['offset']);}return _0x5819c1[_0xd43f('0xf7')](_0x3aaea4);}})[_0xd43f('0x10')](function(_0x9d6218){if(_0x9d6218){return _0x9d6218?{'count':_0x1abff4,'rows':_0x9d6218}:null;}})['then'](respondWithResult(_0x1fe152,null))['catch'](handleError(_0x1fe152,null));};exports[_0xd43f('0x117')]=function(_0x105926,_0x4b6d30){var _0x472901=_0x105926[_0xd43f('0x2d')][_0xd43f('0x118')]===_0xd43f('0x119')?_0xd43f('0x11a'):_0xd43f('0x11b');return db[_0xd43f('0x29')]['find']({'attributes':['id',_0x472901],'where':{'id':_0x105926[_0xd43f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4b6d30,null))[_0xd43f('0x10')](function(_0x3e4069){if(_0x3e4069){var _0x2aa5df=_0x3e4069[_0x472901];var _0x3464ec=_0x2aa5df&&_0x2aa5df['items']?_0x2aa5df[_0xd43f('0x11c')]:[];_0x4b6d30[_0xd43f('0x24')]({'fromKey':_[_0xd43f('0x6f')](_0x2aa5df['fromKey'])?undefined:_0x2aa5df['fromKey'],'count':_0x3464ec['length'],'rows':_0x3464ec});}})[_0xd43f('0x17')](handleError(_0x4b6d30,null));};exports['getOfflineMessages']=function(_0x129171,_0x195294){var _0x32aced={'raw':![],'where':{}};var _0x2ae795={};var _0x2315e5={'count':0x0,'rows':[]};return db[_0xd43f('0x29')]['findOne']({'where':{'id':_0x129171[_0xd43f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x195294,null))[_0xd43f('0x10')](function(_0x469bc1){if(_0x469bc1){_0x2ae795[_0xd43f('0x2f')]=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x2ae795[_0xd43f('0x2d')]=_['keys'](_0x129171[_0xd43f('0x2d')]);_0x2ae795[_0xd43f('0x2e')]=_['intersection'](_0x2ae795[_0xd43f('0x2f')],_0x2ae795[_0xd43f('0x2d')]);_0x32aced['attributes']=_[_0xd43f('0x30')](_0x2ae795[_0xd43f('0x2f')],qs[_0xd43f('0x41')](_0x129171[_0xd43f('0x2d')]['fields']));_0x32aced[_0xd43f('0x31')]=_0x32aced[_0xd43f('0x31')][_0xd43f('0x32')]?_0x32aced[_0xd43f('0x31')]:_0x2ae795['model'];if(!_0x129171[_0xd43f('0x2d')][_0xd43f('0x54')](_0xd43f('0x33'))){_0x32aced[_0xd43f('0x1c')]=qs[_0xd43f('0x1c')](_0x129171[_0xd43f('0x2d')][_0xd43f('0x1c')]);_0x32aced['offset']=qs[_0xd43f('0x1a')](_0x129171[_0xd43f('0x2d')][_0xd43f('0x1a')]);}_0x32aced[_0xd43f('0x34')]=qs[_0xd43f('0x35')](_0x129171['query'][_0xd43f('0x35')]);_0x32aced[_0xd43f('0x36')]=qs[_0xd43f('0x2e')](_[_0xd43f('0x55')](_0x129171[_0xd43f('0x2d')],_0x2ae795[_0xd43f('0x2e')]));_0x32aced[_0xd43f('0x36')][_0xd43f('0x50')]=_0x469bc1['id'];if(_0x129171[_0xd43f('0x2d')][_0xd43f('0x39')]){_0x32aced['where']=_[_0xd43f('0x37')](_0x32aced[_0xd43f('0x36')],{'$or':_[_0xd43f('0x28')](_0x32aced[_0xd43f('0x31')],function(_0x5ac693){var _0x296d90={};_0x296d90[_0x5ac693]={'$like':'%'+_0x129171[_0xd43f('0x2d')][_0xd43f('0x39')]+'%'};return _0x296d90;})});}_0x32aced=_[_0xd43f('0x37')]({},_0x32aced,_0x129171[_0xd43f('0x3a')]);return db[_0xd43f('0x11d')][_0xd43f('0x1d')]({'where':_0x32aced['where']})[_0xd43f('0x10')](function(_0x236c67){_0x2315e5[_0xd43f('0x1d')]=_0x236c67;if(_0x129171[_0xd43f('0x2d')][_0xd43f('0x3b')]){_0x32aced[_0xd43f('0x3c')]=[{'all':!![]}];}else{_0x32aced['include']=[{'model':db[_0xd43f('0x7e')],'as':_0xd43f('0xe6'),'required':![]},{'model':db[_0xd43f('0xd1')],'as':_0xd43f('0x11e'),'required':![]}];}return db[_0xd43f('0x11d')][_0xd43f('0x3d')](_0x32aced);})[_0xd43f('0x10')](function(_0xe7a088){_0x2315e5['rows']=_0xe7a088;return _0x2315e5;});}})[_0xd43f('0x10')](respondWithFilteredResult(_0x195294,_0x32aced))['catch'](handleError(_0x195294,null));};exports[_0xd43f('0x11f')]=function(_0x9a08a8,_0x1f4c51){return db['ChatWebsite'][_0xd43f('0x42')]({'where':{'id':_0x9a08a8['params']['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x1f4c51,null))[_0xd43f('0x10')](function(_0x1477f0){if(_0x1477f0){return _0x1477f0[_0xd43f('0x11f')](_0x9a08a8[_0xd43f('0x4d')][_0xd43f('0x57')],_[_0xd43f('0xe5')](_0x9a08a8['body'],['ids','id'])||{})[_0xd43f('0xab')](function(_0x5d941e){for(var _0x5825a9=0x0;_0x5825a9<_0x9a08a8['body'][_0xd43f('0x57')][_0xd43f('0x32')];_0x5825a9+=0x1){socket[_0xd43f('0x120')]('userChatWebsite:save',{'UserId':Number(_0x9a08a8[_0xd43f('0x4d')][_0xd43f('0x57')][_0x5825a9]),'ChatWebsiteId':Number(_0x9a08a8[_0xd43f('0x3f')]['id'])});}return _0x5d941e;});}})[_0xd43f('0x10')](respondWithResult(_0x1f4c51,null))[_0xd43f('0x17')](handleError(_0x1f4c51,null));};exports[_0xd43f('0x121')]=function(_0x4ecf57,_0x1f32ea){return db['ChatWebsite'][_0xd43f('0x42')]({'where':{'id':_0x4ecf57['params']['id']}})[_0xd43f('0x10')](handleEntityNotFound(_0x1f32ea,null))[_0xd43f('0x10')](function(_0x39476e){if(_0x39476e){return _0x39476e[_0xd43f('0x121')](_0x4ecf57[_0xd43f('0x2d')]['ids'])[_0xd43f('0x10')](function(){if(_['isArray'](_0x4ecf57[_0xd43f('0x2d')][_0xd43f('0x57')])){for(var _0x232146=0x0;_0x232146<_0x4ecf57[_0xd43f('0x2d')][_0xd43f('0x57')][_0xd43f('0x32')];_0x232146+=0x1){socket['emit'](_0xd43f('0x122'),{'UserId':Number(_0x4ecf57['query'][_0xd43f('0x57')][_0x232146]),'ChatWebsiteId':Number(_0x4ecf57[_0xd43f('0x3f')]['id'])});}}else{socket[_0xd43f('0x120')]('userChatWebsite:remove',{'UserId':Number(_0x4ecf57[_0xd43f('0x2d')][_0xd43f('0x57')]),'ChatWebsiteId':Number(_0x4ecf57[_0xd43f('0x3f')]['id'])});}});}})[_0xd43f('0x10')](respondWithStatusCode(_0x1f32ea,null))[_0xd43f('0x17')](handleError(_0x1f32ea,null));};exports[_0xd43f('0x123')]=function(_0x4bf1b5,_0x29d9c6){var _0x23bb54={};var _0x378673={};var _0x37cc97;var _0x2d4e34;return db['ChatWebsite'][_0xd43f('0x52')]({'where':{'id':_0x4bf1b5[_0xd43f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x29d9c6,null))[_0xd43f('0x10')](function(_0xc54744){if(_0xc54744){_0x37cc97=_0xc54744;_0x378673['model']=_[_0xd43f('0x40')](db[_0xd43f('0xe7')]['rawAttributes']);_0x378673['query']=_[_0xd43f('0x40')](_0x4bf1b5['query']);_0x378673[_0xd43f('0x2e')]=_[_0xd43f('0x30')](_0x378673['model'],_0x378673[_0xd43f('0x2d')]);_0x23bb54[_0xd43f('0x31')]=_['intersection'](_0x378673['model'],qs['fields'](_0x4bf1b5[_0xd43f('0x2d')][_0xd43f('0x41')]));_0x23bb54[_0xd43f('0x31')]=_0x23bb54['attributes'][_0xd43f('0x32')]?_0x23bb54[_0xd43f('0x31')]:_0x378673[_0xd43f('0x2f')];_0x23bb54[_0xd43f('0x34')]=qs['sort'](_0x4bf1b5[_0xd43f('0x2d')]['sort']);_0x23bb54[_0xd43f('0x36')]=qs[_0xd43f('0x2e')](_['pick'](_0x4bf1b5[_0xd43f('0x2d')],_0x378673[_0xd43f('0x2e')]));if(_0x4bf1b5[_0xd43f('0x2d')]['filter']){_0x23bb54[_0xd43f('0x36')]=_[_0xd43f('0x37')](_0x23bb54['where'],{'$or':_[_0xd43f('0x28')](_0x23bb54[_0xd43f('0x31')],function(_0x21bada){var _0x118add={};_0x118add[_0x21bada]={'$like':'%'+_0x4bf1b5[_0xd43f('0x2d')][_0xd43f('0x39')]+'%'};return _0x118add;})});}_0x23bb54=_[_0xd43f('0x37')]({},_0x23bb54,_0x4bf1b5['options']);return _0x37cc97['getAgents'](_0x23bb54);}})['then'](function(_0x5adfc7){if(_0x5adfc7){_0x2d4e34=_0x5adfc7[_0xd43f('0x32')];if(!_0x4bf1b5['query'][_0xd43f('0x54')]('nolimit')){_0x23bb54[_0xd43f('0x1c')]=qs[_0xd43f('0x1c')](_0x4bf1b5[_0xd43f('0x2d')][_0xd43f('0x1c')]);_0x23bb54['offset']=qs[_0xd43f('0x1a')](_0x4bf1b5[_0xd43f('0x2d')][_0xd43f('0x1a')]);}return _0x37cc97['getAgents'](_0x23bb54);}})[_0xd43f('0x10')](function(_0x3e6cab){if(_0x3e6cab){return _0x3e6cab?{'count':_0x2d4e34,'rows':_0x3e6cab}:null;}})[_0xd43f('0x10')](respondWithResult(_0x29d9c6,null))['catch'](handleError(_0x29d9c6,null));};
\ No newline at end of file
+var _0xf3cc=['ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','count','findAll','rows','show','params','keys','rawAttributes','options','find','create','body','user','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','length','sort','includeAll','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','CmContact','Contacts','ChatApplication','account','applications','orderBy','asc','Applications','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s','interval','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info'];(function(_0x2f3f01,_0x4a7f1a){var _0x20a7ad=function(_0x1c041f){while(--_0x1c041f){_0x2f3f01['push'](_0x2f3f01['shift']());}};_0x20a7ad(++_0x4a7f1a);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x5a125c,_0x155fa2){_0x5a125c=_0x5a125c-0x0;var _0x4c70af=_0xf3cc[_0x5a125c];return _0x4c70af;};'use strict';var BPromise=require(_0xcf3c('0x0'));var Mustache=require(_0xcf3c('0x1'));var util=require(_0xcf3c('0x2'));var path=require(_0xcf3c('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf3c('0x4'));var _=require(_0xcf3c('0x5'));var querystring=require(_0xcf3c('0x6'));var Redis=require('ioredis');var qs=require(_0xcf3c('0x7'));var logger=require(_0xcf3c('0x8'))('api');var config=require(_0xcf3c('0x9'));var db=require(_0xcf3c('0xa'))['db'];config[_0xcf3c('0xb')]=_[_0xcf3c('0xc')](config[_0xcf3c('0xb')],{'host':_0xcf3c('0xd'),'port':0x18eb});var socket=require(_0xcf3c('0xe'))(new Redis(config[_0xcf3c('0xb')]));require(_0xcf3c('0xf'))[_0xcf3c('0x10')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0xcf3c('0x11')][_0xcf3c('0x12')]({'port':0x232c});var client9002=jayson[_0xcf3c('0x11')][_0xcf3c('0x12')]({'port':0x232a});var client9003=jayson[_0xcf3c('0x11')][_0xcf3c('0x12')]({'port':0x232b});var client9001=jayson[_0xcf3c('0x11')][_0xcf3c('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x5b1526,_0x245b88,_0x389b0f,_0x59a8dc){return new BPromise(function(_0x60e424,_0x4e6c38){var _0x55ef34=_0x59a8dc||client;return _0x55ef34['request'](_0x5b1526,_0x389b0f)[_0xcf3c('0x13')](function(_0x598576){logger[_0xcf3c('0x14')](_0xcf3c('0x15'),_0x245b88,'request\x20sent');logger[_0xcf3c('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x245b88,_0xcf3c('0x17'),JSON[_0xcf3c('0x18')](_0x598576));if(_0x598576[_0xcf3c('0x19')]){if(_0x598576['error'][_0xcf3c('0x1a')]===0x1f4){logger[_0xcf3c('0x19')](_0xcf3c('0x15'),_0x245b88,_0x598576[_0xcf3c('0x19')]['message']);return _0x4e6c38(_0x598576[_0xcf3c('0x19')][_0xcf3c('0x1b')]);}logger[_0xcf3c('0x19')](_0xcf3c('0x15'),_0x245b88,_0x598576[_0xcf3c('0x19')][_0xcf3c('0x1b')]);return _0x60e424(_0x598576[_0xcf3c('0x19')][_0xcf3c('0x1b')]);}else{logger[_0xcf3c('0x14')](_0xcf3c('0x15'),_0x245b88,_0xcf3c('0x17'));_0x60e424(_0x598576[_0xcf3c('0x1c')]['message']);}})[_0xcf3c('0x1d')](function(_0x54cd87){logger[_0xcf3c('0x19')](_0xcf3c('0x15'),_0x245b88,_0x54cd87);_0x4e6c38(_0x54cd87);});});}function respondWithStatusCode(_0x5dddc1,_0x1bd0f2){_0x1bd0f2=_0x1bd0f2||0xcc;return function(_0x12ff47){if(_0x12ff47){return _0x5dddc1[_0xcf3c('0x1e')](_0x1bd0f2);}return _0x5dddc1[_0xcf3c('0x1f')](_0x1bd0f2)[_0xcf3c('0x20')]();};}function respondWithResult(_0x3f1771,_0x22d98e){_0x22d98e=_0x22d98e||0xc8;return function(_0x43609a){if(_0x43609a){return _0x3f1771['status'](_0x22d98e)[_0xcf3c('0x21')](_0x43609a);}};}function respondWithFilteredResult(_0x4ce43c,_0x2281b6){return function(_0x15b55c){if(_0x15b55c){var _0x42ce14=typeof _0x2281b6[_0xcf3c('0x22')]===_0xcf3c('0x23')&&typeof _0x2281b6[_0xcf3c('0x24')]==='undefined';var _0x22c54c=_0x15b55c['count'];var _0x47d619=_0x42ce14?0x0:_0x2281b6[_0xcf3c('0x22')];var _0x3b253d=_0x42ce14?_0x15b55c['count']:_0x2281b6[_0xcf3c('0x22')]+_0x2281b6['limit'];var _0x1d8223;if(_0x3b253d>=_0x22c54c){_0x3b253d=_0x22c54c;_0x1d8223=0xc8;}else{_0x1d8223=0xce;}_0x4ce43c[_0xcf3c('0x1f')](_0x1d8223);return _0x4ce43c[_0xcf3c('0x25')](_0xcf3c('0x26'),_0x47d619+'-'+_0x3b253d+'/'+_0x22c54c)['json'](_0x15b55c);}return null;};}function saveUpdates(_0xc751e8){return function(_0x41834f){if(_0x41834f){return _0x41834f[_0xcf3c('0x27')](_0xc751e8)[_0xcf3c('0x13')](function(_0x502bca){return _0x502bca;});}return null;};}function removeEntity(_0x1fae74){return function(_0x2cf47e){if(_0x2cf47e){return _0x2cf47e[_0xcf3c('0x28')]()['then'](function(){var _0x3a5880=_0x2cf47e[_0xcf3c('0x29')]({'plain':!![]});var _0x196b02='ChatWebsites';return db[_0xcf3c('0x2a')][_0xcf3c('0x28')]({'where':{'type':_0x196b02,'resourceId':_0x3a5880['id']}})[_0xcf3c('0x13')](function(){return _0x2cf47e;});})[_0xcf3c('0x13')](function(){_0x1fae74[_0xcf3c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aced6){return function(_0x549fb4){if(!_0x549fb4){_0x2aced6[_0xcf3c('0x1e')](0x194);}return _0x549fb4;};}function handleError(_0x57d644,_0x2a78f2){_0x2a78f2=_0x2a78f2||0x1f4;return function(_0x1daba1){logger[_0xcf3c('0x19')](_0x1daba1[_0xcf3c('0x2b')]);if(_0x1daba1[_0xcf3c('0x2c')]){delete _0x1daba1[_0xcf3c('0x2c')];}_0x57d644[_0xcf3c('0x1f')](_0x2a78f2)[_0xcf3c('0x2d')](_0x1daba1);};}exports['index']=function(_0xbc118e,_0x1106a6){var _0x592ecc={'include':[{'model':db[_0xcf3c('0x2e')],'as':_0xcf3c('0x2f')}]},_0x7c323d={},_0x34ea9f={'count':0x0,'rows':[]};var _0xff382e=_[_0xcf3c('0x30')](db[_0xcf3c('0x31')]['rawAttributes'],function(_0xcf5a75){return{'name':_0xcf5a75['fieldName'],'type':_0xcf5a75['type']['key']};});_0x7c323d[_0xcf3c('0x32')]=_[_0xcf3c('0x30')](_0xff382e,_0xcf3c('0x2c'));_0x7c323d[_0xcf3c('0x33')]=_['keys'](_0xbc118e['query']);_0x7c323d[_0xcf3c('0x34')]=_[_0xcf3c('0x35')](_0x7c323d[_0xcf3c('0x32')],_0x7c323d[_0xcf3c('0x33')]);_0x592ecc[_0xcf3c('0x36')]=_[_0xcf3c('0x35')](_0x7c323d['model'],qs[_0xcf3c('0x37')](_0xbc118e[_0xcf3c('0x33')][_0xcf3c('0x37')]));_0x592ecc['attributes']=_0x592ecc[_0xcf3c('0x36')]['length']?_0x592ecc['attributes']:_0x7c323d[_0xcf3c('0x32')];if(!_0xbc118e[_0xcf3c('0x33')][_0xcf3c('0x38')](_0xcf3c('0x39'))){_0x592ecc[_0xcf3c('0x24')]=qs[_0xcf3c('0x24')](_0xbc118e[_0xcf3c('0x33')][_0xcf3c('0x24')]);_0x592ecc[_0xcf3c('0x22')]=qs['offset'](_0xbc118e['query'][_0xcf3c('0x22')]);}_0x592ecc[_0xcf3c('0x3a')]=qs['sort'](_0xbc118e[_0xcf3c('0x33')]['sort']);_0x592ecc[_0xcf3c('0x3b')]=qs[_0xcf3c('0x34')](_[_0xcf3c('0x3c')](_0xbc118e[_0xcf3c('0x33')],_0x7c323d[_0xcf3c('0x34')]),_0xff382e);if(_0xbc118e[_0xcf3c('0x33')][_0xcf3c('0x3d')]){_0x592ecc[_0xcf3c('0x3b')]=_[_0xcf3c('0x3e')](_0x592ecc[_0xcf3c('0x3b')],{'$or':_[_0xcf3c('0x30')](_0xff382e,function(_0x2a5399){if(_0x2a5399[_0xcf3c('0x3f')]!==_0xcf3c('0x40')){var _0x256e00={};_0x256e00[_0x2a5399[_0xcf3c('0x2c')]]={'$like':'%'+_0xbc118e[_0xcf3c('0x33')][_0xcf3c('0x3d')]+'%'};return _0x256e00;}})});}_0x592ecc=_['merge']({},_0x592ecc,_0xbc118e['options']);var _0x36846f={'where':_0x592ecc['where']};return db[_0xcf3c('0x31')][_0xcf3c('0x41')](_0x36846f)[_0xcf3c('0x13')](function(_0x33c576){_0x34ea9f[_0xcf3c('0x41')]=_0x33c576;if(_0xbc118e['query']['includeAll']){_0x592ecc['include']=[{'all':!![]}];}return db[_0xcf3c('0x31')][_0xcf3c('0x42')](_0x592ecc);})['then'](function(_0x43e6f8){_0x34ea9f[_0xcf3c('0x43')]=_0x43e6f8;return _0x34ea9f;})[_0xcf3c('0x13')](respondWithFilteredResult(_0x1106a6,_0x592ecc))[_0xcf3c('0x1d')](handleError(_0x1106a6,null));};exports[_0xcf3c('0x44')]=function(_0x37da53,_0x592da0){var _0x1a7271={'raw':![],'where':{'id':_0x37da53[_0xcf3c('0x45')]['id']},'include':[{'model':db[_0xcf3c('0x2e')],'as':_0xcf3c('0x2f')}]},_0x31124d={};_0x31124d['model']=_[_0xcf3c('0x46')](db[_0xcf3c('0x31')][_0xcf3c('0x47')]);_0x31124d[_0xcf3c('0x33')]=_['keys'](_0x37da53[_0xcf3c('0x33')]);_0x31124d['filters']=_[_0xcf3c('0x35')](_0x31124d['model'],_0x31124d['query']);_0x1a7271['attributes']=_['intersection'](_0x31124d[_0xcf3c('0x32')],qs[_0xcf3c('0x37')](_0x37da53['query'][_0xcf3c('0x37')]));_0x1a7271[_0xcf3c('0x36')]=_0x1a7271[_0xcf3c('0x36')]['length']?_0x1a7271['attributes']:_0x31124d[_0xcf3c('0x32')];if(_0x37da53[_0xcf3c('0x33')]['includeAll']){_0x1a7271['include']=[{'all':!![]}];}_0x1a7271=_['merge']({},_0x1a7271,_0x37da53[_0xcf3c('0x48')]);return db['ChatWebsite'][_0xcf3c('0x49')](_0x1a7271)['then'](handleEntityNotFound(_0x592da0,null))[_0xcf3c('0x13')](respondWithResult(_0x592da0,null))[_0xcf3c('0x1d')](handleError(_0x592da0,null));};exports[_0xcf3c('0x4a')]=function(_0x44c700,_0x2d0710){return db['ChatWebsite'][_0xcf3c('0x4a')](_0x44c700[_0xcf3c('0x4b')],{})[_0xcf3c('0x13')](function(_0xab4bb8){var _0x410b19=_0x44c700[_0xcf3c('0x4c')][_0xcf3c('0x29')]({'plain':!![]});if(!_0x410b19)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410b19['role']==='user'){var _0x1697f3=_0xab4bb8['get']({'plain':!![]});var _0x5a7c0f=_0xcf3c('0x4d');return db[_0xcf3c('0x4e')][_0xcf3c('0x49')]({'where':{'name':_0x5a7c0f,'userProfileId':_0x410b19['userProfileId']},'raw':!![]})[_0xcf3c('0x13')](function(_0x543ed2){if(_0x543ed2&&_0x543ed2[_0xcf3c('0x4f')]===0x0){return db[_0xcf3c('0x2a')][_0xcf3c('0x4a')]({'name':_0x1697f3[_0xcf3c('0x2c')],'resourceId':_0x1697f3['id'],'type':_0x543ed2[_0xcf3c('0x2c')],'sectionId':_0x543ed2['id']},{})[_0xcf3c('0x13')](function(){return _0xab4bb8;});}else{return _0xab4bb8;}})[_0xcf3c('0x1d')](function(_0x13588c){logger[_0xcf3c('0x19')](_0xcf3c('0x50'),_0x13588c);throw _0x13588c;});}return _0xab4bb8;})[_0xcf3c('0x13')](respondWithResult(_0x2d0710,0xc9))['catch'](handleError(_0x2d0710,null));};exports[_0xcf3c('0x27')]=function(_0x191cfb,_0x27dbf1){if(_0x191cfb[_0xcf3c('0x4b')]['id']){delete _0x191cfb[_0xcf3c('0x4b')]['id'];}return db[_0xcf3c('0x31')]['find']({'where':{'id':_0x191cfb[_0xcf3c('0x45')]['id']},'include':[{'model':db['Pause'],'as':_0xcf3c('0x2f')}]})['then'](handleEntityNotFound(_0x27dbf1,null))['then'](saveUpdates(_0x191cfb['body'],null))[_0xcf3c('0x13')](respondWithResult(_0x27dbf1,null))[_0xcf3c('0x1d')](handleError(_0x27dbf1,null));};exports['destroy']=function(_0x3dbb60,_0x138a4a){return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'where':{'id':_0x3dbb60[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x138a4a,null))['then'](removeEntity(_0x138a4a,null))[_0xcf3c('0x1d')](handleError(_0x138a4a,null));};exports[_0xcf3c('0x51')]=function(_0x2e01ab,_0x1b8212){return db[_0xcf3c('0x31')][_0xcf3c('0x51')]()[_0xcf3c('0x13')](respondWithResult(_0x1b8212,null))[_0xcf3c('0x1d')](handleError(_0x1b8212,null));};exports[_0xcf3c('0x52')]=function(_0x25df85,_0x1adca9){if(_0x25df85[_0xcf3c('0x4b')]['id']){delete _0x25df85[_0xcf3c('0x4b')]['id'];}return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'where':{'id':_0x25df85[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x1adca9,null))[_0xcf3c('0x13')](function(_0x50b802){if(_0x50b802){_0x25df85[_0xcf3c('0x4b')][_0xcf3c('0x53')]=_0x50b802['id'];return db[_0xcf3c('0x54')][_0xcf3c('0x4a')](_0x25df85[_0xcf3c('0x4b')]);}})[_0xcf3c('0x13')](respondWithResult(_0x1adca9,null))[_0xcf3c('0x1d')](handleError(_0x1adca9,null));};exports[_0xcf3c('0x55')]=function(_0x2ddec1,_0x5b786e){var _0x40cc30={'raw':![],'where':{}};var _0x48f93b={};var _0x1789a7={'count':0x0,'rows':[]};return db[_0xcf3c('0x31')][_0xcf3c('0x56')]({'where':{'id':_0x2ddec1[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x5b786e,null))['then'](function(_0x53c850){if(_0x53c850){_0x48f93b[_0xcf3c('0x32')]=_['keys'](db['Disposition']['rawAttributes']);_0x48f93b[_0xcf3c('0x33')]=_[_0xcf3c('0x46')](_0x2ddec1[_0xcf3c('0x33')]);_0x48f93b[_0xcf3c('0x34')]=_['intersection'](_0x48f93b[_0xcf3c('0x32')],_0x48f93b['query']);_0x40cc30[_0xcf3c('0x36')]=_[_0xcf3c('0x35')](_0x48f93b[_0xcf3c('0x32')],qs['fields'](_0x2ddec1[_0xcf3c('0x33')][_0xcf3c('0x37')]));_0x40cc30[_0xcf3c('0x36')]=_0x40cc30[_0xcf3c('0x36')][_0xcf3c('0x57')]?_0x40cc30[_0xcf3c('0x36')]:_0x48f93b[_0xcf3c('0x32')];if(!_0x2ddec1[_0xcf3c('0x33')][_0xcf3c('0x38')](_0xcf3c('0x39'))){_0x40cc30[_0xcf3c('0x24')]=qs[_0xcf3c('0x24')](_0x2ddec1[_0xcf3c('0x33')][_0xcf3c('0x24')]);_0x40cc30[_0xcf3c('0x22')]=qs[_0xcf3c('0x22')](_0x2ddec1['query'][_0xcf3c('0x22')]);}_0x40cc30[_0xcf3c('0x3a')]=qs[_0xcf3c('0x58')](_0x2ddec1['query'][_0xcf3c('0x58')]);_0x40cc30[_0xcf3c('0x3b')]=qs[_0xcf3c('0x34')](_[_0xcf3c('0x3c')](_0x2ddec1[_0xcf3c('0x33')],_0x48f93b[_0xcf3c('0x34')]));_0x40cc30[_0xcf3c('0x3b')][_0xcf3c('0x53')]=_0x53c850['id'];if(_0x2ddec1['query'][_0xcf3c('0x3d')]){_0x40cc30[_0xcf3c('0x3b')]=_['merge'](_0x40cc30[_0xcf3c('0x3b')],{'$or':_['map'](_0x40cc30[_0xcf3c('0x36')],function(_0x1f3e6e){var _0x17d3b6={};_0x17d3b6[_0x1f3e6e]={'$like':'%'+_0x2ddec1[_0xcf3c('0x33')]['filter']+'%'};return _0x17d3b6;})});}_0x40cc30=_[_0xcf3c('0x3e')]({},_0x40cc30,_0x2ddec1[_0xcf3c('0x48')]);return db['Disposition'][_0xcf3c('0x41')]({'where':_0x40cc30[_0xcf3c('0x3b')]})[_0xcf3c('0x13')](function(_0x1ded75){_0x1789a7[_0xcf3c('0x41')]=_0x1ded75;if(_0x2ddec1['query'][_0xcf3c('0x59')]){_0x40cc30[_0xcf3c('0x5a')]=[{'all':!![]}];}return db[_0xcf3c('0x54')][_0xcf3c('0x42')](_0x40cc30);})[_0xcf3c('0x13')](function(_0x2634eb){_0x1789a7[_0xcf3c('0x43')]=_0x2634eb;return _0x1789a7;});}})[_0xcf3c('0x13')](respondWithFilteredResult(_0x5b786e,_0x40cc30))['catch'](handleError(_0x5b786e,null));};exports[_0xcf3c('0x5b')]=function(_0x1627d7,_0x1102df){return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'where':{'id':_0x1627d7['params']['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x1102df,null))[_0xcf3c('0x13')](function(_0x4db968){if(_0x4db968){return _0x4db968['removeDispositions'](_0x1627d7[_0xcf3c('0x33')][_0xcf3c('0x5c')]);}})[_0xcf3c('0x13')](respondWithStatusCode(_0x1102df,null))[_0xcf3c('0x1d')](handleError(_0x1102df,null));};exports[_0xcf3c('0x5d')]=function(_0x16a973,_0x4c7ebd){if(_0x16a973[_0xcf3c('0x4b')]['id']){delete _0x16a973['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x16a973['params']['id']}})['then'](handleEntityNotFound(_0x4c7ebd,null))['then'](function(_0x574e56){if(_0x574e56){_0x16a973[_0xcf3c('0x4b')][_0xcf3c('0x53')]=_0x574e56['id'];return db[_0xcf3c('0x5e')][_0xcf3c('0x4a')](_0x16a973[_0xcf3c('0x4b')]);}})[_0xcf3c('0x13')](respondWithResult(_0x4c7ebd,null))[_0xcf3c('0x1d')](handleError(_0x4c7ebd,null));};exports[_0xcf3c('0x5f')]=function(_0x2bde9b,_0x3b05ea){var _0x4994d9={'raw':![],'where':{}};var _0x79c19={};var _0x1b2ee1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcf3c('0x56')]({'where':{'id':_0x2bde9b['params']['id']}})['then'](handleEntityNotFound(_0x3b05ea,null))[_0xcf3c('0x13')](function(_0x2283e9){if(_0x2283e9){_0x79c19[_0xcf3c('0x32')]=_[_0xcf3c('0x46')](db[_0xcf3c('0x5e')][_0xcf3c('0x47')]);_0x79c19[_0xcf3c('0x33')]=_[_0xcf3c('0x46')](_0x2bde9b[_0xcf3c('0x33')]);_0x79c19[_0xcf3c('0x34')]=_[_0xcf3c('0x35')](_0x79c19[_0xcf3c('0x32')],_0x79c19[_0xcf3c('0x33')]);_0x4994d9['attributes']=_[_0xcf3c('0x35')](_0x79c19['model'],qs['fields'](_0x2bde9b[_0xcf3c('0x33')][_0xcf3c('0x37')]));_0x4994d9[_0xcf3c('0x36')]=_0x4994d9[_0xcf3c('0x36')]['length']?_0x4994d9[_0xcf3c('0x36')]:_0x79c19[_0xcf3c('0x32')];if(!_0x2bde9b[_0xcf3c('0x33')][_0xcf3c('0x38')](_0xcf3c('0x39'))){_0x4994d9[_0xcf3c('0x24')]=qs[_0xcf3c('0x24')](_0x2bde9b[_0xcf3c('0x33')][_0xcf3c('0x24')]);_0x4994d9[_0xcf3c('0x22')]=qs[_0xcf3c('0x22')](_0x2bde9b[_0xcf3c('0x33')][_0xcf3c('0x22')]);}_0x4994d9[_0xcf3c('0x3a')]=qs[_0xcf3c('0x58')](_0x2bde9b[_0xcf3c('0x33')][_0xcf3c('0x58')]);_0x4994d9['where']=qs[_0xcf3c('0x34')](_[_0xcf3c('0x3c')](_0x2bde9b['query'],_0x79c19[_0xcf3c('0x34')]));_0x4994d9['where'][_0xcf3c('0x53')]=_0x2283e9['id'];if(_0x2bde9b['query'][_0xcf3c('0x3d')]){_0x4994d9[_0xcf3c('0x3b')]=_[_0xcf3c('0x3e')](_0x4994d9[_0xcf3c('0x3b')],{'$or':_['map'](_0x4994d9[_0xcf3c('0x36')],function(_0x3c190b){var _0x3a3a47={};_0x3a3a47[_0x3c190b]={'$like':'%'+_0x2bde9b[_0xcf3c('0x33')][_0xcf3c('0x3d')]+'%'};return _0x3a3a47;})});}_0x4994d9=_[_0xcf3c('0x3e')]({},_0x4994d9,_0x2bde9b['options']);return db['CannedAnswer'][_0xcf3c('0x41')]({'where':_0x4994d9[_0xcf3c('0x3b')]})[_0xcf3c('0x13')](function(_0x2b1153){_0x1b2ee1[_0xcf3c('0x41')]=_0x2b1153;if(_0x2bde9b[_0xcf3c('0x33')][_0xcf3c('0x59')]){_0x4994d9['include']=[{'all':!![]}];}return db[_0xcf3c('0x5e')][_0xcf3c('0x42')](_0x4994d9);})[_0xcf3c('0x13')](function(_0x212589){_0x1b2ee1[_0xcf3c('0x43')]=_0x212589;return _0x1b2ee1;});}})[_0xcf3c('0x13')](respondWithFilteredResult(_0x3b05ea,_0x4994d9))['catch'](handleError(_0x3b05ea,null));};exports['removeAnswers']=function(_0x10e9f9,_0x56140a){return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'where':{'id':_0x10e9f9['params']['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x56140a,null))[_0xcf3c('0x13')](function(_0x53cdca){if(_0x53cdca){return _0x53cdca[_0xcf3c('0x60')](_0x10e9f9[_0xcf3c('0x33')][_0xcf3c('0x5c')]);}})[_0xcf3c('0x13')](respondWithStatusCode(_0x56140a,null))['catch'](handleError(_0x56140a,null));};exports[_0xcf3c('0x61')]=function(_0x123ba2,_0x520c31){_0x123ba2[_0xcf3c('0x4b')]['sitepic']=_0x123ba2[_0xcf3c('0x62')][_0xcf3c('0x63')];return db['ChatWebsite'][_0xcf3c('0x49')]({'where':{'id':_0x123ba2[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x520c31,null))[_0xcf3c('0x13')](saveUpdates(_0x123ba2[_0xcf3c('0x4b')],null))[_0xcf3c('0x13')](respondWithResult(_0x520c31,null))['catch'](handleError(_0x520c31,null));};exports['addAvatar']=function(_0x290696,_0x36ab71){_0x290696[_0xcf3c('0x4b')][_0xcf3c('0x64')]=_0x290696['file'][_0xcf3c('0x63')];return db['ChatWebsite'][_0xcf3c('0x49')]({'where':{'id':_0x290696[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x36ab71,null))[_0xcf3c('0x13')](saveUpdates(_0x290696['body'],null))[_0xcf3c('0x13')](respondWithResult(_0x36ab71,null))[_0xcf3c('0x1d')](handleError(_0x36ab71,null));};exports[_0xcf3c('0x65')]=function(_0x2a1d6d,_0x34cbf8){_0x2a1d6d['body'][_0xcf3c('0x66')]=_0x2a1d6d['file'][_0xcf3c('0x63')];return db['ChatWebsite'][_0xcf3c('0x49')]({'where':{'id':_0x2a1d6d['params']['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x34cbf8,null))[_0xcf3c('0x13')](saveUpdates(_0x2a1d6d[_0xcf3c('0x4b')],null))[_0xcf3c('0x13')](respondWithResult(_0x34cbf8,null))[_0xcf3c('0x1d')](handleError(_0x34cbf8,null));};exports[_0xcf3c('0x67')]=function(_0x12a9bf,_0x5236b9){_0x12a9bf[_0xcf3c('0x4b')][_0xcf3c('0x68')]=_0x12a9bf['file'][_0xcf3c('0x63')];return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'where':{'id':_0x12a9bf[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x5236b9,null))[_0xcf3c('0x13')](saveUpdates(_0x12a9bf[_0xcf3c('0x4b')],null))[_0xcf3c('0x13')](respondWithResult(_0x5236b9,null))[_0xcf3c('0x1d')](handleError(_0x5236b9,null));};exports[_0xcf3c('0x69')]=function(_0x288215,_0x249842){var _0x152bf9=path[_0xcf3c('0x6a')](config[_0xcf3c('0x6b')],_0xcf3c('0x6c'));var _0x88d24c={'where':{'id':_0x288215['params']['id']},'attributes':['id',_0xcf3c('0x6d')],'raw':!![]};var _0x55b6b2=![];return require(_0xcf3c('0x6e'))[_0xcf3c('0x6f')]()[_0xcf3c('0x13')](function(_0x9cbdb8){if(_0x9cbdb8){_0x55b6b2=_0x9cbdb8[_0xcf3c('0x70')];}})[_0xcf3c('0x13')](function(){return db['ChatWebsite'][_0xcf3c('0x49')](_0x88d24c);})['then'](handleEntityNotFound(_0x249842,null))[_0xcf3c('0x13')](function(_0x29ef87){if(_0x29ef87){if(!_[_0xcf3c('0x71')](_0x29ef87[_0xcf3c('0x6d')])){if(fs[_0xcf3c('0x72')](path[_0xcf3c('0x6a')](config[_0xcf3c('0x6b')],'server/files/images/logos/',_0x29ef87[_0xcf3c('0x6d')]))&&_0x55b6b2){_0x152bf9=path[_0xcf3c('0x6a')](config['root'],'server/files/images/logos/',_0x29ef87[_0xcf3c('0x6d')]);}}return _0x249842[_0xcf3c('0x73')](_0x152bf9);}})[_0xcf3c('0x1d')](handleError(_0x249842,null));};exports['getAvatar']=function(_0x107708,_0x28d172){var _0x4614c3=path[_0xcf3c('0x6a')](config[_0xcf3c('0x6b')],_0xcf3c('0x74'));var _0x510d5b={'where':{'id':_0x107708[_0xcf3c('0x45')]['id']},'attributes':['id',_0xcf3c('0x64')],'raw':!![]};return db[_0xcf3c('0x31')][_0xcf3c('0x49')](_0x510d5b)[_0xcf3c('0x13')](handleEntityNotFound(_0x28d172,null))[_0xcf3c('0x13')](function(_0x25f772){if(_0x25f772){if(!_[_0xcf3c('0x71')](_0x25f772[_0xcf3c('0x64')])){if(fs[_0xcf3c('0x72')](path['join'](config['root'],_0xcf3c('0x75'),_0x25f772['agentAvatar']))){_0x4614c3=path[_0xcf3c('0x6a')](config['root'],'server/files/images/avatars/',_0x25f772[_0xcf3c('0x64')]);}}return _0x28d172[_0xcf3c('0x73')](_0x4614c3);}})[_0xcf3c('0x1d')](handleError(_0x28d172,null));};exports['getCustomerAvatar']=function(_0x502e82,_0x59e3c8){var _0xecf2da=path[_0xcf3c('0x6a')](config[_0xcf3c('0x6b')],'server/files/images/avatars/customer_avatar.png');var _0x189fe8={'where':{'id':_0x502e82[_0xcf3c('0x45')]['id']},'attributes':['id',_0xcf3c('0x66'),_0xcf3c('0x76')],'raw':!![]};return db['ChatWebsite'][_0xcf3c('0x49')](_0x189fe8)[_0xcf3c('0x13')](handleEntityNotFound(_0x59e3c8,null))['then'](function(_0x3bb705){if(_0x3bb705){if(!_['isNil'](_0x3bb705[_0xcf3c('0x66')])){if(fs['existsSync'](path[_0xcf3c('0x6a')](config['root'],_0xcf3c('0x75'),_0x3bb705[_0xcf3c('0x66')]))&&_0x3bb705[_0xcf3c('0x76')]){_0xecf2da=path[_0xcf3c('0x6a')](config[_0xcf3c('0x6b')],'server/files/images/avatars/',_0x3bb705[_0xcf3c('0x66')]);}}return _0x59e3c8[_0xcf3c('0x73')](_0xecf2da);}})[_0xcf3c('0x1d')](handleError(_0x59e3c8,null));};exports['getSystemAvatar']=function(_0x5d6132,_0x280ae9){var _0x18a7f8=path['join'](config[_0xcf3c('0x6b')],_0xcf3c('0x77'));var _0x329fe7={'where':{'id':_0x5d6132[_0xcf3c('0x45')]['id']},'attributes':['id',_0xcf3c('0x68')],'raw':!![]};return db[_0xcf3c('0x31')][_0xcf3c('0x49')](_0x329fe7)['then'](handleEntityNotFound(_0x280ae9,null))[_0xcf3c('0x13')](function(_0x31d09e){if(_0x31d09e){if(!_['isNil'](_0x31d09e['systemAvatar'])){if(fs['existsSync'](path[_0xcf3c('0x6a')](config[_0xcf3c('0x6b')],_0xcf3c('0x75'),_0x31d09e[_0xcf3c('0x68')]))){_0x18a7f8=path['join'](config[_0xcf3c('0x6b')],_0xcf3c('0x75'),_0x31d09e[_0xcf3c('0x68')]);}}return _0x280ae9[_0xcf3c('0x73')](_0x18a7f8);}})[_0xcf3c('0x1d')](handleError(_0x280ae9,null));};exports[_0xcf3c('0x78')]=function(_0x26b1b3,_0xc304f3){var _0x1d80cd=require(_0xcf3c('0x79'));var _0x354c87=new _0x1d80cd();var _0xc4e572=_0x354c87[_0xcf3c('0x7a')](_0x26b1b3[_0xcf3c('0x7b')][_0xcf3c('0x7c')])['getResult']();var _0x5e3d35={'body':_0x26b1b3['body'],'channel':'chat'};var _0x27281e=[];var _0x18b67e=[];var _0x19c741={};var _0x453442=![];return db['CmContact'][_0xcf3c('0x51')]()[_0xcf3c('0x13')](function(_0x42a6ae){if(!_0x42a6ae){throw new db['Sequelize'][(_0xcf3c('0x7d'))](_0xcf3c('0x7e'));}_0x27281e=_[_0xcf3c('0x7f')](_[_0xcf3c('0x46')](_0x42a6ae),['createdAt',_0xcf3c('0x80')]);_0x18b67e=_[_0xcf3c('0x7f')](_[_0xcf3c('0x46')](_0x42a6ae),[_0xcf3c('0x81'),_0xcf3c('0x80'),_0xcf3c('0x82'),_0xcf3c('0x83')]);if(_0x26b1b3[_0xcf3c('0x4b')]['id']){delete _0x26b1b3[_0xcf3c('0x4b')]['id'];}if(_['isNil'](_0x26b1b3['body'][_0xcf3c('0x84')])){throw new db[(_0xcf3c('0x85'))][(_0xcf3c('0x7d'))]('from\x20is\x20mandatory');}if(_[_0xcf3c('0x71')](_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0x4b')])||_0x26b1b3['body'][_0xcf3c('0x4b')]===''){throw new db[(_0xcf3c('0x85'))][(_0xcf3c('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcf3c('0x71')](_0x26b1b3[_0xcf3c('0x4b')]['mapKey'])){throw new db[(_0xcf3c('0x85'))][(_0xcf3c('0x7d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18b67e);}if(!_['includes'](_0x18b67e,_0x26b1b3[_0xcf3c('0x4b')]['mapKey'])){throw new db['Sequelize'][(_0xcf3c('0x7d'))](_0xcf3c('0x86')+_0x18b67e);}_0x19c741[_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0x87')]]=_0x26b1b3['body'][_0xcf3c('0x84')];})[_0xcf3c('0x13')](function(){return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'where':{'id':_0x26b1b3[_0xcf3c('0x45')]['id']},'include':[{'model':db[_0xcf3c('0x88')],'as':_0xcf3c('0x89'),'include':[{'model':db[_0xcf3c('0x8a')],'as':_0xcf3c('0x8b'),'where':_0x19c741,'limit':0x1,'order':[[_0xcf3c('0x80'),'DESC']]}]},{'model':db[_0xcf3c('0x8c')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0xc304f3,null))['then'](function(_0x5cf4c8){if(_0x5cf4c8&&_0x5cf4c8[_0xcf3c('0x89')]){_0x5e3d35[_0xcf3c('0x8d')]=_0x5cf4c8;_0x5e3d35[_0xcf3c('0x8e')]=_0x5cf4c8['Applications'];_0x5e3d35['list']=_0x5cf4c8[_0xcf3c('0x89')];_0x5e3d35['applications']=_[_0xcf3c('0x8f')](_0x5e3d35['applications'],['priority'],[_0xcf3c('0x90')]);if(_0x5e3d35[_0xcf3c('0x8d')][_0xcf3c('0x91')]){delete _0x5e3d35['account'][_0xcf3c('0x91')];}if(_0x5e3d35[_0xcf3c('0x8d')][_0xcf3c('0x89')]&&_0x5e3d35[_0xcf3c('0x8d')][_0xcf3c('0x89')][_0xcf3c('0x8b')]['length']){return _0x5e3d35['account'][_0xcf3c('0x89')][_0xcf3c('0x8b')][0x0];}var _0x433c71=_[_0xcf3c('0xc')](_0x26b1b3[_0xcf3c('0x4b')],{'firstName':_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0x84')],'ListId':_0x5cf4c8['ListId']});_0x433c71[_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0x87')]]=_0x26b1b3['body'][_0xcf3c('0x84')];return db['CmContact'][_0xcf3c('0x4a')](_0x433c71,{'fields':_0x27281e,'raw':!![]});}})[_0xcf3c('0x13')](handleEntityNotFound(_0xc304f3,null))[_0xcf3c('0x13')](function(_0x33917a){_0x5e3d35[_0xcf3c('0x92')]=_0x33917a;var _0x2f8e19=_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0x93')];if(_0x26b1b3[_0xcf3c('0x7b')]['cf-connecting-ip']){_0x2f8e19=_0x26b1b3[_0xcf3c('0x7b')][_0xcf3c('0x94')];}else if(_0x26b1b3[_0xcf3c('0x7b')]['x-forwarded-for']){_0x2f8e19=_[_0xcf3c('0x95')](_0x26b1b3[_0xcf3c('0x7b')][_0xcf3c('0x96')][_0xcf3c('0x97')](','));}if(_0x33917a){var _0x45f249={'ContactId':_0x33917a['id'],'ChatWebsiteId':_0x26b1b3[_0xcf3c('0x45')]['id'],'from':(_0x33917a[_0xcf3c('0x98')]||'')+'\x20'+(_0x33917a[_0xcf3c('0x99')]||''),'customerIp':_0x2f8e19,'customerPort':_0x26b1b3['headers'][_0xcf3c('0x9a')]?_0x26b1b3['headers'][_0xcf3c('0x9a')]:null,'referer':_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0x9b')],'browserName':_0xc4e572[_0xcf3c('0x9c')][_0xcf3c('0x2c')]&&_0xc4e572[_0xcf3c('0x9c')][_0xcf3c('0x9d')]?util[_0xcf3c('0x9e')](_0xcf3c('0x9f'),_0xc4e572[_0xcf3c('0x9c')][_0xcf3c('0x2c')],_0xc4e572[_0xcf3c('0x9c')][_0xcf3c('0x9d')]):'unknown','browserVersion':_0xc4e572[_0xcf3c('0x9c')]['version']||_0xcf3c('0xa0'),'osName':util[_0xcf3c('0x9e')](_0xcf3c('0x9f'),_0xc4e572['os'][_0xcf3c('0x2c')],_0xc4e572['os'][_0xcf3c('0x9d')]),'osVersion':_0xc4e572['os']['version'],'deviceModel':_0xc4e572['device'][_0xcf3c('0x32')]&&_0xc4e572[_0xcf3c('0xa1')]['vendor']?util[_0xcf3c('0x9e')]('%s\x20%s\x20%s',_0xc4e572['device']['model'],_0xc4e572['device']['vendor'],_0xc4e572[_0xcf3c('0xa1')][_0xcf3c('0x3f')]):null,'deviceVendor':_0xc4e572[_0xcf3c('0xa1')][_0xcf3c('0xa2')],'deviceType':_0xc4e572[_0xcf3c('0xa1')][_0xcf3c('0x3f')],'formData':JSON[_0xcf3c('0x18')](_0x26b1b3[_0xcf3c('0x4b')])};var _0x253144={'ChatWebsiteId':_0x26b1b3['params']['id'],'closed':![]};if(_0x26b1b3[_0xcf3c('0x4b')]['threadId']){_0x253144[_0xcf3c('0xa3')]=_0x26b1b3[_0xcf3c('0x4b')]['threadId'];return db['ChatInteraction']['find']({'where':_0x253144})[_0xcf3c('0x13')](function(_0x42dfd3){if(_0x42dfd3){return[_0x42dfd3,![]];}_0x45f249['threadId']=_0x26b1b3[_0xcf3c('0x4b')]['threadId'];_0x45f249[_0xcf3c('0xa4')]=_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0xa4')];return db[_0xcf3c('0xa5')][_0xcf3c('0x4a')](_0x45f249)[_0xcf3c('0x13')](function(_0x58b653){return[_0x58b653,!![]];});});}_0x253144[_0xcf3c('0xa6')]=_0x33917a['id'];if(_0x26b1b3['body'][_0xcf3c('0xa7')]&&_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0xa7')]['id']){_0x253144['id']=_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0xa7')]['id'];return db[_0xcf3c('0xa5')]['find']({'where':_0x253144})[_0xcf3c('0x13')](function(_0x3c928d){if(_0x3c928d){return[_0x3c928d,![]];}return db[_0xcf3c('0xa5')][_0xcf3c('0x4a')](_0x45f249)[_0xcf3c('0x13')](function(_0x4504d4){return[_0x4504d4,!![]];});});}return db[_0xcf3c('0xa5')][_0xcf3c('0x4a')](_0x45f249)[_0xcf3c('0x13')](function(_0x28265f){return[_0x28265f,!![]];});}})[_0xcf3c('0xa8')](function(_0x21f75b,_0x51d835){if(_0x21f75b){_0x453442=_0x51d835;if(!_0x51d835){var _0x2a59b6={'from':(_0x5e3d35['contact'][_0xcf3c('0x98')]||'')+'\x20'+(_0x5e3d35[_0xcf3c('0x92')][_0xcf3c('0x99')]||'')};if(_0x26b1b3[_0xcf3c('0x4b')]['threadId']&&_0x26b1b3[_0xcf3c('0x4b')]['messageId']&&_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0xa3')]!=_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0xa9')]){_0x2a59b6[_0xcf3c('0xa3')]=_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0xa9')];}return _0x21f75b[_0xcf3c('0x27')](_0x2a59b6);}else{return _0x21f75b;}}})[_0xcf3c('0x13')](function(_0x4c0bcc){_0x5e3d35[_0xcf3c('0xa7')]=_0x4c0bcc[_0xcf3c('0x29')]({'plain':!![]});_0x5e3d35[_0xcf3c('0xa7')][_0xcf3c('0xaa')]=_0x453442;if(_0x5e3d35[_0xcf3c('0xa7')][_0xcf3c('0xaa')]){if(_0x5e3d35['account'][_0xcf3c('0xab')]){_0x5e3d35[_0xcf3c('0x8e')][_0xcf3c('0xac')]({'id':0x0,'priority':_0x5e3d35[_0xcf3c('0x8e')][_0xcf3c('0x57')]+0x1,'app':_0xcf3c('0xad'),'appdata':_0xcf3c('0xae'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0x4b')],'ChatWebsiteId':_0x26b1b3[_0xcf3c('0x45')]['id'],'ChatInteractionId':_0x4c0bcc['id'],'direction':'in','ContactId':_0x5e3d35[_0xcf3c('0x92')]['id'],'AttachmentId':_0x26b1b3[_0xcf3c('0x4b')][_0xcf3c('0xaf')]});})[_0xcf3c('0x13')](function(_0x559b85){_0x5e3d35['message']=_0x559b85;if(_0x5e3d35[_0xcf3c('0xa7')][_0xcf3c('0xb0')]){return db[_0xcf3c('0xb1')][_0xcf3c('0x49')]({'attributes':['id',_0xcf3c('0x2c')],'where':{'id':_0x5e3d35[_0xcf3c('0xa7')][_0xcf3c('0xb0')]}})['then'](function(_0x31f715){if(_0x31f715){_0x5e3d35[_0xcf3c('0x8e')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcf3c('0xb2'),'appdata':_0x31f715[_0xcf3c('0x2c')]+','+(_0x5e3d35[_0xcf3c('0x8d')][_0xcf3c('0xb3')]||0xa),'interval':_0xcf3c('0xb4')});_0x5e3d35[_0xcf3c('0xb5')]=!![];}return respondWithRpcPromise('Start',_0xcf3c('0xb6'),_0x5e3d35);});}return respondWithRpcPromise('Start','startRouting',_0x5e3d35);})[_0xcf3c('0x13')](function(_0x2ace99){respondWithRpcPromise(_0xcf3c('0xb7'),'EventManager',{'event':'notify','message':_0x2ace99},client9002);return _0x2ace99;})[_0xcf3c('0x13')](respondWithResult(_0xc304f3,null))[_0xcf3c('0x1d')](handleError(_0xc304f3,null));};exports[_0xcf3c('0xb8')]=function(_0x2f1648,_0x4e5ed7){var _0x588a52,_0x176e9e,_0x428770;var _0x4be0c6=[];var _0x4fa441={};var _0x3b01c0=_0x2f1648[_0xcf3c('0xb9')]||[];var _0x3d6fe2=[];var _0x574443;return db['CmContact'][_0xcf3c('0x51')]()[_0xcf3c('0x13')](function(_0x20afdf){if(!_0x20afdf){throw new db[(_0xcf3c('0x85'))][(_0xcf3c('0x7d'))](_0xcf3c('0x7e'));}_0x4be0c6=_['difference'](_[_0xcf3c('0x46')](_0x20afdf),[_0xcf3c('0x81'),'updatedAt',_0xcf3c('0x82'),_0xcf3c('0x83')]);if(_0x2f1648[_0xcf3c('0x4b')]['id']){delete _0x2f1648[_0xcf3c('0x4b')]['id'];}if(_[_0xcf3c('0x71')](_0x2f1648[_0xcf3c('0x4b')][_0xcf3c('0x84')])){throw _0x4e5ed7[_0xcf3c('0x1f')](0x1f4)[_0xcf3c('0x2d')](new db[(_0xcf3c('0x85'))][(_0xcf3c('0x7d'))](_0xcf3c('0xba')));}if(_['isNil'](_0x2f1648[_0xcf3c('0x4b')][_0xcf3c('0x4b')])||_0x2f1648['body'][_0xcf3c('0x4b')]===''){throw _0x4e5ed7[_0xcf3c('0x1f')](0x1f4)[_0xcf3c('0x2d')](new db[(_0xcf3c('0x85'))][(_0xcf3c('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xcf3c('0x71')](_0x2f1648[_0xcf3c('0x4b')][_0xcf3c('0xbb')])){throw _0x4e5ed7[_0xcf3c('0x1f')](0x1f4)[_0xcf3c('0x2d')](new db[(_0xcf3c('0x85'))]['ValidationError'](_0xcf3c('0xbc')+_0x4be0c6));}if(!_[_0xcf3c('0xbd')](_0x4be0c6,_0x2f1648[_0xcf3c('0x4b')]['mapKeyOffline'])){throw _0x4e5ed7[_0xcf3c('0x1f')](0x1f4)[_0xcf3c('0x2d')](new db['Sequelize']['ValidationError'](_0xcf3c('0xbe')+_0x4be0c6));}_0x4fa441[_0x2f1648[_0xcf3c('0x4b')][_0xcf3c('0xbb')]]=_0x2f1648['body'][_0xcf3c('0x84')];})['then'](function(){return db['ChatWebsite'][_0xcf3c('0x49')]({'where':{'id':_0x2f1648['params']['id']},'include':[{'model':db[_0xcf3c('0x88')],'as':_0xcf3c('0x89')},{'model':db[_0xcf3c('0xbf')],'as':_0xcf3c('0xbf')}]});})[_0xcf3c('0x13')](handleEntityNotFound(_0x4e5ed7,null))[_0xcf3c('0x13')](function(_0x3ec69c){if(_0x3ec69c&&_0x3ec69c['List']){_0x176e9e=_0x3ec69c;var _0x1e84be=_[_0xcf3c('0xc')](_0x2f1648[_0xcf3c('0x4b')],{'firstName':_0x2f1648[_0xcf3c('0x4b')]['from'],'phone':_0x2f1648['body'][_0xcf3c('0x84')],'ListId':_0x3ec69c[_0xcf3c('0x83')]});_0x1e84be[_0x2f1648[_0xcf3c('0x4b')][_0xcf3c('0xbb')]]=_0x2f1648[_0xcf3c('0x4b')][_0xcf3c('0x84')];return db[_0xcf3c('0x8a')]['findOrCreate']({'where':_0x4fa441,'defaults':_0x1e84be});}})['spread'](function(_0x39e88e){if(_0x39e88e){_0x428770=_0x39e88e;var _0x796d3e=fs['readFileSync'](path[_0xcf3c('0x6a')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xcf3c('0xc0'));var _0x2000c8=ejs[_0xcf3c('0xc1')](_0x796d3e,{'body':_[_0xcf3c('0xc2')](_0x2f1648['body']['body']),'bodyTitle':_0x176e9e[_0xcf3c('0xc3')]});return db[_0xcf3c('0xc4')][_0xcf3c('0x4a')]({'body':_0x2000c8,'plainBody':htmlToText[_0xcf3c('0xc5')](_0x2000c8),'ContactId':_0x39e88e['id'],'ChatWebsiteId':_0x176e9e['id']});}})[_0xcf3c('0x13')](function(_0x1e4962){_0x574443=_0x1e4962;if(_0x3b01c0[_0xcf3c('0x57')]){var _0x5ab305=_0x3b01c0[_0xcf3c('0x30')](function(_0x1743e5){return{'name':_0x1743e5['originalname'],'basename':_0x1743e5['filename'],'type':_0x1743e5[_0xcf3c('0xc6')],'ChatOfflineMessageId':_0x1e4962['id']};});_0x3d6fe2=_0x5ab305[_0xcf3c('0x30')](_0x2c3179=>{var _0x40ecc8={'filename':_0x2c3179[_0xcf3c('0x2c')],'path':path[_0xcf3c('0x6a')](config[_0xcf3c('0x6b')],_0xcf3c('0xc7'),_0xcf3c('0xb9'),_0xcf3c('0xc8'),_0xcf3c('0xc9'),_0x2c3179['basename'])};return _0x40ecc8;});if(!_0x176e9e[_0xcf3c('0xca')]){return db[_0xcf3c('0xcb')][_0xcf3c('0xcc')](function(_0x4e2396){return db[_0xcf3c('0xcd')][_0xcf3c('0xce')](_0x5ab305,{'transaction':_0x4e2396});});}}})['then'](function(){if(_0x574443){_0x588a52=_0x574443;return db[_0xcf3c('0xbf')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xcf3c('0xcf')],'as':_0xcf3c('0xd0'),'raw':!![],'include':[{'model':db[_0xcf3c('0xd1')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xcf3c('0x13')](function(_0xc288cb){if(_0xc288cb&&_0xc288cb[_0xcf3c('0xd0')]&&_0x176e9e[_0xcf3c('0xd2')]&&_0x176e9e[_0xcf3c('0xd3')]){var _0x3ada57=_0xc288cb[_0xcf3c('0xd4')]();return respondWithRpcPromise(_0xcf3c('0xd5'),_0xcf3c('0xd6'),{'account':_0x3ada57,'message':{'from':util[_0xcf3c('0x9e')](_0xcf3c('0xd7'),_0xc288cb[_0xcf3c('0x2c')],_0xc288cb[_0xcf3c('0xd8')]||_0xc288cb[_0xcf3c('0xd0')][_0xcf3c('0x4c')]),'to':_0x176e9e['forwardOfflineAddress'],'subject':_0x176e9e[_0xcf3c('0xd9')],'html':_0x588a52[_0xcf3c('0x4b')],'attachments':_0x3d6fe2}},client9003)[_0xcf3c('0x13')](function(){return _0x588a52;})[_0xcf3c('0x1d')](function(_0x5e4122){logger[_0xcf3c('0x19')](_0x5e4122);});}})['then'](function(){if(_0x176e9e&&_0x176e9e[_0xcf3c('0xca')]&&_0x176e9e[_0xcf3c('0xda')]){var _0x7034f7=[];if(_0x3b01c0[_0xcf3c('0x57')]){_0x7034f7=_0x3b01c0['map'](function(_0x350b92){return{'name':_0x350b92['originalname'],'basename':_0x350b92[_0xcf3c('0x63')],'type':_0x350b92[_0xcf3c('0xc6')],'ChatOfflineMessageId':_0x574443['id']};});}var _0x973db8;if(!_[_0xcf3c('0x71')](_0x176e9e[_0xcf3c('0xdb')])){var _0x99578f=_[_0xcf3c('0x30')](_0x2f1648[_0xcf3c('0x4b')],function(_0x1ed3f8){return _0x1ed3f8;});var _0x32eec9=_[_0xcf3c('0xdc')](_0x99578f)[0x0];var _0x3ca58c=_[_0xcf3c('0xdd')](_0x32eec9,function(_0x2f8e11){return _0x2f8e11;});_0x973db8=_0x3ca58c[0x1][_0x176e9e[_0xcf3c('0xdb')]];}var _0x5a1940={'from':_0x428770[_0xcf3c('0xd8')],'firstName':_0x428770[_0xcf3c('0x98')],'lastName':_0x428770[_0xcf3c('0x99')],'mapKey':_0xcf3c('0xd8'),'message':{'from':_0x428770['email'],'to':_0x176e9e['MailAccount'][_0xcf3c('0xd8')],'cc':'','subject':_[_0xcf3c('0x71')](_0x973db8)?_0x176e9e[_0xcf3c('0xd9')]:_0x973db8,'messageId':'','sentAt':new Date(),'attach':_0x7034f7[_0xcf3c('0x57')],'attachments':_0x7034f7,'originChannel':'Chat','ChatWebsiteId':_0x176e9e['id'],'ChatOfflineMessageId':_0x588a52['id'],'originTo':_0x176e9e[_0xcf3c('0xbf')][_0xcf3c('0xd8')]},'body':_0x588a52[_0xcf3c('0x4b')]};var _0x565cad={'account':{'id':_0x176e9e[_0xcf3c('0xda')]},'body':_0x5a1940,'log':_0xcf3c('0xde')};return respondWithRpcPromise(_0xcf3c('0xde'),_0xcf3c('0xdf'),_0x565cad,client9001)[_0xcf3c('0x13')](function(){return _0x588a52;})['catch'](function(_0x5b146a){logger[_0xcf3c('0x19')](_0x5b146a);});}return;})[_0xcf3c('0x13')](function(){if(_0x588a52){return _0x588a52;}})[_0xcf3c('0x13')](respondWithResult(_0x4e5ed7,null))[_0xcf3c('0x1d')](function(_0x4daf27){logger[_0xcf3c('0x19')]('catch',_0x4daf27);for(var _0x36f279 of _0x3b01c0){var _0x33c32b=path['join'](config[_0xcf3c('0x6b')],_0xcf3c('0xc7'),'files',_0xcf3c('0xc8'),'offline-chat',_0x36f279[_0xcf3c('0x63')]);fs_extra['remove'](_0x33c32b)['catch'](function(_0x369d57){logger[_0xcf3c('0x19')](_0xcf3c('0xe0'),_0x33c32b,_0x369d57);});}});};exports[_0xcf3c('0xe1')]=function(_0x5af868,_0x5ee1e8){return db[_0xcf3c('0xa5')]['find']({'where':{'id':_0x5af868[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x5ee1e8,null))[_0xcf3c('0x13')](function(_0x235303){if(_0x235303){return _0x235303[_0xcf3c('0xe1')](_0x5af868[_0xcf3c('0x4b')][_0xcf3c('0x5c')],_[_0xcf3c('0xe2')](_0x5af868[_0xcf3c('0x4b')],['ids','id'])||{});}})[_0xcf3c('0x13')](respondWithResult(_0x5ee1e8,null))['catch'](handleError(_0x5ee1e8,null));};exports[_0xcf3c('0xe3')]=function(_0x263d3f,_0x25d8af){var _0xba9782={'raw':![],'where':{}};var _0x215a9a={};var _0x20c67a={'count':0x0,'rows':[]};return db[_0xcf3c('0x31')][_0xcf3c('0x56')]({'where':{'id':_0x263d3f[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x25d8af,null))[_0xcf3c('0x13')](function(_0x26b306){if(_0x26b306){_0x215a9a[_0xcf3c('0x32')]=_[_0xcf3c('0x46')](db['ChatInteraction'][_0xcf3c('0x47')]);_0x215a9a[_0xcf3c('0x33')]=_['keys'](_0x263d3f[_0xcf3c('0x33')]);_0x215a9a[_0xcf3c('0x34')]=_[_0xcf3c('0x35')](_0x215a9a[_0xcf3c('0x32')],_0x215a9a['query']);_0xba9782['attributes']=_['intersection'](_0x215a9a[_0xcf3c('0x32')],qs['fields'](_0x263d3f[_0xcf3c('0x33')][_0xcf3c('0x37')]));_0xba9782[_0xcf3c('0x36')]=_0xba9782[_0xcf3c('0x36')]['length']?_0xba9782[_0xcf3c('0x36')]:_0x215a9a['model'];if(!_0x263d3f[_0xcf3c('0x33')][_0xcf3c('0x38')](_0xcf3c('0x39'))){_0xba9782['limit']=qs['limit'](_0x263d3f[_0xcf3c('0x33')][_0xcf3c('0x24')]);_0xba9782[_0xcf3c('0x22')]=qs['offset'](_0x263d3f[_0xcf3c('0x33')]['offset']);}_0xba9782['order']=qs[_0xcf3c('0x58')](_0x263d3f['query']['sort']);_0xba9782[_0xcf3c('0x3b')]=qs[_0xcf3c('0x34')](_[_0xcf3c('0x3c')](_0x263d3f['query'],_0x215a9a[_0xcf3c('0x34')]));_0xba9782[_0xcf3c('0x3b')]['ChatWebsiteId']=_0x26b306['id'];if(_0x263d3f[_0xcf3c('0x33')]['filter']){_0xba9782[_0xcf3c('0x3b')]=_[_0xcf3c('0x3e')](_0xba9782[_0xcf3c('0x3b')],{'$or':_['map'](_0xba9782[_0xcf3c('0x36')],function(_0x676cc4){var _0x501954={};_0x501954[_0x676cc4]={'$like':'%'+_0x263d3f['query']['filter']+'%'};return _0x501954;})});}_0xba9782=_[_0xcf3c('0x3e')]({},_0xba9782,_0x263d3f[_0xcf3c('0x48')]);return db[_0xcf3c('0xa5')][_0xcf3c('0x41')]({'where':_0xba9782['where']})[_0xcf3c('0x13')](function(_0xb9b1d4){_0x20c67a[_0xcf3c('0x41')]=_0xb9b1d4;if(_0x263d3f[_0xcf3c('0x33')]['includeAll']){_0xba9782[_0xcf3c('0x5a')]=[{'model':db['CmContact'],'as':_0xcf3c('0xe4'),'required':![]},{'model':db['User'],'as':_0xcf3c('0xe5'),'attributes':[_0xcf3c('0x2c'),_0xcf3c('0xe6'),_0xcf3c('0xe7')],'required':![]},{'model':db[_0xcf3c('0xe8')],'as':_0xcf3c('0xe9'),'attributes':['id',_0xcf3c('0x2c'),_0xcf3c('0xea')],'where':_0x263d3f[_0xcf3c('0x33')][_0xcf3c('0xeb')]?{'id':_0x263d3f[_0xcf3c('0x33')][_0xcf3c('0xeb')]}:undefined,'required':_0x263d3f[_0xcf3c('0x33')][_0xcf3c('0xeb')]?!![]:![]}];}return db[_0xcf3c('0xa5')][_0xcf3c('0x42')](_0xba9782);})[_0xcf3c('0x13')](function(_0x29f61d){_0x20c67a[_0xcf3c('0x43')]=_0x29f61d;return _0x20c67a;});}})[_0xcf3c('0x13')](respondWithFilteredResult(_0x25d8af,_0xba9782))[_0xcf3c('0x1d')](handleError(_0x25d8af,null));};function iftimePromise(_0x6a9417,_0x255467){return respondWithRpcPromise(_0xcf3c('0xec'),'getSnippet',{'command':_0x255467[_0xcf3c('0xed')]?util[_0xcf3c('0x9e')]('iftime\x20%s,%s',_0x6a9417['interval'],_0x255467[_0xcf3c('0xed')]):util[_0xcf3c('0x9e')](_0xcf3c('0xee'),_0x6a9417[_0xcf3c('0xef')])},client9002)[_0xcf3c('0x13')](function(_0x16c628){var _0x22509a=_0x16c628&&_0x16c628['indexOf'](_0xcf3c('0xf0'))>=0x0?!![]:![];logger[_0xcf3c('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x255467['id'],_0x6a9417['id'],_0x6a9417[_0xcf3c('0xef')],_0x22509a?_0xcf3c('0xf1'):'OFFLINE',_0x255467[_0xcf3c('0xed')]?_0x255467['timezone']:_0xcf3c('0xf2'));return _0x22509a;})[_0xcf3c('0x1d')](function(_0x5ca255){logger[_0xcf3c('0x19')](_0xcf3c('0xf3'),_0x255467['id'],_0x6a9417['id'],_0x6a9417[_0xcf3c('0xef')],util[_0xcf3c('0xf4')](_0x5ca255,{'showHidden':![],'depth':null}),_0x255467[_0xcf3c('0xed')]?_0x255467['timezone']:'No\x20timezone');return![];});}exports[_0xcf3c('0xf5')]=function(_0x382ad3,_0xd0dd0){var _0x239be2=0x0;var _0x42174a=0x0;var _0x4092c9=![];var _0x1e21c7;var _0xeca3af;return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'where':{'id':_0x382ad3[_0xcf3c('0x45')]['id']},'include':[{'model':db[_0xcf3c('0xf6')],'as':_0xcf3c('0xf6'),'include':[{'model':db[_0xcf3c('0xf6')],'as':'Intervals','attributes':['id',_0xcf3c('0xef')],'raw':!![]}]}]})[_0xcf3c('0x13')](handleEntityNotFound(_0xd0dd0,null))['then'](function(_0xe07d71){if(_0xe07d71){_0x1e21c7=_0xe07d71;return _0xe07d71[_0xcf3c('0xf7')]({'raw':!![]});}})[_0xcf3c('0x13')](function(_0x5b2af2){if(_0x1e21c7){if(_0x5b2af2){_0xeca3af=_0x5b2af2;}}return require(_0xcf3c('0x6e'))['getLicense']();})['then'](function(_0x258392){if(_0x258392){_0x42174a=_0x258392[_0xcf3c('0xf8')];_0x4092c9=_0x258392[_0xcf3c('0x70')];}})[_0xcf3c('0x13')](function(){return db[_0xcf3c('0xa5')][_0xcf3c('0x41')]({'where':{'closed':![]}});})[_0xcf3c('0x13')](function(_0x195a13){_0x239be2=_0x195a13;if(_0x42174a&&_0x195a13>_0x42174a){return db[_0xcf3c('0xf9')][_0xcf3c('0x56')]({'where':{'id':0x1}})[_0xcf3c('0x13')](function(_0x8c9770){if(_0x8c9770){_0x8c9770[_0xcf3c('0xfa')](_0xcf3c('0xfb'));}});}})[_0xcf3c('0x13')](function(){if(_0x1e21c7[_0xcf3c('0xf6')]&&_0x1e21c7[_0xcf3c('0xf6')][_0xcf3c('0xfc')]){var _0x896677=[];for(var _0x2652a4=0x0;_0x2652a4<_0x1e21c7[_0xcf3c('0xf6')]['Intervals'][_0xcf3c('0x57')];_0x2652a4++){var _0xaf298e=_0x1e21c7['Interval']['Intervals'][_0x2652a4]['get']({'plain':!![]});_0x896677[_0xcf3c('0xac')](iftimePromise(_0xaf298e,_0x1e21c7));}return BPromise[_0xcf3c('0xfd')](_0x896677)[_0xcf3c('0x13')](function(_0x51d625){return _['some'](_0x51d625);});}else{return!![];}})['then'](function(_0x5221f6){var _0x503c81=fs[_0xcf3c('0xfe')](path[_0xcf3c('0x6a')](config[_0xcf3c('0x6b')],_0xcf3c('0xff')),_0xcf3c('0xc0'));var _0x591299={'remote':_0x1e21c7[_0xcf3c('0x100')],'query':querystring['stringify'](_['merge'](_0x1e21c7[_0xcf3c('0x29')]({'plain':!![]}),{'customerIp':_0x382ad3[_0xcf3c('0x7b')][_0xcf3c('0x96')]||_0x382ad3[_0xcf3c('0x7b')][_0xcf3c('0x101')]||_0x382ad3[_0xcf3c('0x102')][_0xcf3c('0x103')]||_0x382ad3['ip'],'referer':_0x382ad3[_0xcf3c('0x7b')][_0xcf3c('0x9b')],'openedInteractions':_0x239be2,'maxInteractions':_0x42174a,'virtual':_0x4092c9['virtual'],'online':_0x5221f6,'custom':_0x4092c9}))[_0xcf3c('0x104')](/'/g,'\x5c\x27')};_0xd0dd0[_0xcf3c('0x2d')](ejs[_0xcf3c('0xc1')](Mustache[_0xcf3c('0xc1')](_0x503c81,_0x591299),{'proactiveActions':_0xeca3af,'alignment':_0x1e21c7[_0xcf3c('0x105')],'verticalAlignment':_0x1e21c7[_0xcf3c('0x106')],'div_color':_0x1e21c7['color'],'labelText':_0x1e21c7[_0xcf3c('0x107')],'text_color':_0x1e21c7[_0xcf3c('0x108')],'button_color':_0x1e21c7[_0xcf3c('0x109')],'background_color':_0x1e21c7[_0xcf3c('0x10a')],'hideWhenOffline':_0x1e21c7[_0xcf3c('0x10b')],'interval':_0x1e21c7[_0xcf3c('0x10c')]}));})[_0xcf3c('0x1d')](handleError(_0xd0dd0,null));};exports['addApplications']=function(_0xda368,_0x93c5cb){var _0xb91b19=_0xda368[_0xcf3c('0x45')]['id'];var _0x9768e1=_0xda368['body'];var _0x49d276=0xc8;var _0x5f4dd7=null;return db['sequelize'][_0xcf3c('0xcc')]({'isolationLevel':db[_0xcf3c('0xcb')][_0xcf3c('0x10d')][_0xcf3c('0x10e')]['READ_COMMITTED']},function(_0x314e53){return db[_0xcf3c('0x31')]['findOne']({'where':{'id':_0xb91b19},'transaction':_0x314e53})[_0xcf3c('0x13')](function(_0x271f7c){if(_0x271f7c){return db[_0xcf3c('0x8c')][_0xcf3c('0x28')]({'where':{'ChatWebsiteId':_0xb91b19},'transaction':_0x314e53})[_0xcf3c('0x13')](function(){var _0x234fc8=_[_0xcf3c('0x30')](_0x9768e1,function(_0x359fe3){_0x359fe3['ChatWebsiteId']=_0xb91b19;return _0x359fe3;});return db[_0xcf3c('0x8c')][_0xcf3c('0xce')](_0x234fc8,{'transaction':_0x314e53});});}else{_0x49d276=0x194;_0x5f4dd7=[];}});})[_0xcf3c('0x13')](function(){if(_0x49d276!==0x194){return db[_0xcf3c('0x8c')][_0xcf3c('0x10f')]({'where':{'ChatWebsiteId':_0xb91b19},'order':'priority'})[_0xcf3c('0x13')](function(_0x57347c){_0x5f4dd7=_0x57347c;});}})['catch'](function(_0x564c39){_0x49d276=0x1f4;logger[_0xcf3c('0x19')](_0x564c39[_0xcf3c('0x2b')]);if(_0x564c39[_0xcf3c('0x2c')]){delete _0x564c39[_0xcf3c('0x2c')];}_0x5f4dd7=_0x564c39;})[_0xcf3c('0x110')](function(){if(_0x5f4dd7===null){_0x93c5cb[_0xcf3c('0x1e')](_0x49d276);}else{if(_0x49d276===0x1f4){_0x93c5cb[_0xcf3c('0x1f')](_0x49d276)[_0xcf3c('0x2d')](_0x5f4dd7);}else{_0x93c5cb[_0xcf3c('0x1f')](_0x49d276)[_0xcf3c('0x21')](_0x5f4dd7);}}});};exports[_0xcf3c('0x111')]=function(_0x49aa0c,_0x6d132b){var _0x25636f={};var _0x59c3d4={};var _0x5d0178;var _0x23ea98;return db[_0xcf3c('0x31')]['findOne']({'where':{'id':_0x49aa0c[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x6d132b,null))[_0xcf3c('0x13')](function(_0x375525){if(_0x375525){_0x5d0178=_0x375525;_0x59c3d4[_0xcf3c('0x32')]=_[_0xcf3c('0x46')](db[_0xcf3c('0x8c')]['rawAttributes']);_0x59c3d4[_0xcf3c('0x33')]=_['keys'](_0x49aa0c[_0xcf3c('0x33')]);_0x59c3d4['filters']=_[_0xcf3c('0x35')](_0x59c3d4[_0xcf3c('0x32')],_0x59c3d4[_0xcf3c('0x33')]);_0x25636f['attributes']=_[_0xcf3c('0x35')](_0x59c3d4[_0xcf3c('0x32')],qs[_0xcf3c('0x37')](_0x49aa0c[_0xcf3c('0x33')][_0xcf3c('0x37')]));_0x25636f[_0xcf3c('0x36')]=_0x25636f[_0xcf3c('0x36')][_0xcf3c('0x57')]?_0x25636f['attributes']:_0x59c3d4['model'];_0x25636f[_0xcf3c('0x3a')]=qs['sort'](_0x49aa0c[_0xcf3c('0x33')][_0xcf3c('0x58')]);_0x25636f[_0xcf3c('0x3b')]=qs[_0xcf3c('0x34')](_[_0xcf3c('0x3c')](_0x49aa0c[_0xcf3c('0x33')],_0x59c3d4['filters']));if(_0x49aa0c[_0xcf3c('0x33')][_0xcf3c('0x3d')]){_0x25636f[_0xcf3c('0x3b')]=_[_0xcf3c('0x3e')](_0x25636f[_0xcf3c('0x3b')],{'$or':_[_0xcf3c('0x30')](_0x25636f['attributes'],function(_0x361c7d){var _0x2f1349={};_0x2f1349[_0x361c7d]={'$like':'%'+_0x49aa0c['query']['filter']+'%'};return _0x2f1349;})});}_0x25636f=_[_0xcf3c('0x3e')]({},_0x25636f,_0x49aa0c[_0xcf3c('0x48')]);return _0x5d0178[_0xcf3c('0x111')](_0x25636f);}})[_0xcf3c('0x13')](function(_0xefc36d){if(_0xefc36d){_0x23ea98=_0xefc36d[_0xcf3c('0x57')];if(!_0x49aa0c[_0xcf3c('0x33')][_0xcf3c('0x38')]('nolimit')){_0x25636f[_0xcf3c('0x24')]=qs[_0xcf3c('0x24')](_0x49aa0c[_0xcf3c('0x33')][_0xcf3c('0x24')]);_0x25636f['offset']=qs[_0xcf3c('0x22')](_0x49aa0c['query']['offset']);}return _0x5d0178[_0xcf3c('0x111')](_0x25636f);}})[_0xcf3c('0x13')](function(_0x3e7d3f){if(_0x3e7d3f){return _0x3e7d3f?{'count':_0x23ea98,'rows':_0x3e7d3f}:null;}})['then'](respondWithResult(_0x6d132b,null))[_0xcf3c('0x1d')](handleError(_0x6d132b,null));};exports[_0xcf3c('0x112')]=function(_0x444f70,_0x8ba6da){return db[_0xcf3c('0x113')]['find']({'where':{'id':_0x444f70[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x8ba6da,null))[_0xcf3c('0x13')](function(_0x1979f2){if(_0x1979f2){return _0x1979f2[_0xcf3c('0x112')](_0x444f70['body'][_0xcf3c('0x5c')],_[_0xcf3c('0xe2')](_0x444f70['body'],['ids','id'])||{});}})[_0xcf3c('0x13')](respondWithResult(_0x8ba6da,null))['catch'](handleError(_0x8ba6da,null));};exports[_0xcf3c('0xf7')]=function(_0x50bba0,_0x1aa998){var _0xfad289={};var _0x5abf32={};var _0x3bee38;var _0x7dd644;return db['ChatWebsite'][_0xcf3c('0x56')]({'where':{'id':_0x50bba0[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x1aa998,null))[_0xcf3c('0x13')](function(_0x2c93e9){if(_0x2c93e9){_0x3bee38=_0x2c93e9;_0x5abf32[_0xcf3c('0x32')]=_[_0xcf3c('0x46')](db[_0xcf3c('0x114')][_0xcf3c('0x47')]);_0x5abf32[_0xcf3c('0x33')]=_[_0xcf3c('0x46')](_0x50bba0[_0xcf3c('0x33')]);_0x5abf32[_0xcf3c('0x34')]=_['intersection'](_0x5abf32[_0xcf3c('0x32')],_0x5abf32['query']);_0xfad289['attributes']=_[_0xcf3c('0x35')](_0x5abf32[_0xcf3c('0x32')],qs[_0xcf3c('0x37')](_0x50bba0[_0xcf3c('0x33')][_0xcf3c('0x37')]));_0xfad289['attributes']=_0xfad289[_0xcf3c('0x36')][_0xcf3c('0x57')]?_0xfad289['attributes']:_0x5abf32['model'];_0xfad289[_0xcf3c('0x3a')]=qs[_0xcf3c('0x58')](_0x50bba0[_0xcf3c('0x33')][_0xcf3c('0x58')]);_0xfad289['where']=qs[_0xcf3c('0x34')](_[_0xcf3c('0x3c')](_0x50bba0['query'],_0x5abf32[_0xcf3c('0x34')]));if(_0x50bba0['query']['filter']){_0xfad289['where']=_['merge'](_0xfad289[_0xcf3c('0x3b')],{'$or':_[_0xcf3c('0x30')](_0xfad289[_0xcf3c('0x36')],function(_0x5c73b5){var _0x120147={};_0x120147[_0x5c73b5]={'$like':'%'+_0x50bba0[_0xcf3c('0x33')][_0xcf3c('0x3d')]+'%'};return _0x120147;})});}_0xfad289=_[_0xcf3c('0x3e')]({},_0xfad289,_0x50bba0[_0xcf3c('0x48')]);return _0x3bee38[_0xcf3c('0xf7')](_0xfad289);}})[_0xcf3c('0x13')](function(_0x2a5d2f){if(_0x2a5d2f){_0x7dd644=_0x2a5d2f[_0xcf3c('0x57')];if(!_0x50bba0[_0xcf3c('0x33')]['hasOwnProperty'](_0xcf3c('0x39'))){_0xfad289['limit']=qs[_0xcf3c('0x24')](_0x50bba0[_0xcf3c('0x33')][_0xcf3c('0x24')]);_0xfad289[_0xcf3c('0x22')]=qs[_0xcf3c('0x22')](_0x50bba0[_0xcf3c('0x33')][_0xcf3c('0x22')]);}return _0x3bee38[_0xcf3c('0xf7')](_0xfad289);}})['then'](function(_0xd07e8e){if(_0xd07e8e){return _0xd07e8e?{'count':_0x7dd644,'rows':_0xd07e8e}:null;}})['then'](respondWithResult(_0x1aa998,null))[_0xcf3c('0x1d')](handleError(_0x1aa998,null));};exports['getFields']=function(_0x33f26a,_0x5d2ca0){var _0x56608c=_0x33f26a[_0xcf3c('0x33')][_0xcf3c('0x115')]===_0xcf3c('0x116')?_0xcf3c('0x117'):_0xcf3c('0x118');return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'attributes':['id',_0x56608c],'where':{'id':_0x33f26a['params']['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x5d2ca0,null))[_0xcf3c('0x13')](function(_0x2beaba){if(_0x2beaba){var _0x2b258d=_0x2beaba[_0x56608c];var _0x583b5f=_0x2b258d&&_0x2b258d[_0xcf3c('0x119')]?_0x2b258d[_0xcf3c('0x119')]:[];_0x5d2ca0[_0xcf3c('0x2d')]({'fromKey':_[_0xcf3c('0x71')](_0x2b258d[_0xcf3c('0x11a')])?undefined:_0x2b258d['fromKey'],'count':_0x583b5f[_0xcf3c('0x57')],'rows':_0x583b5f});}})[_0xcf3c('0x1d')](handleError(_0x5d2ca0,null));};exports[_0xcf3c('0x11b')]=function(_0x2bc399,_0x201cc0){var _0x44f060={'raw':![],'where':{}};var _0x785fe9={};var _0x3c89ec={'count':0x0,'rows':[]};return db[_0xcf3c('0x31')][_0xcf3c('0x56')]({'where':{'id':_0x2bc399[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x201cc0,null))['then'](function(_0x5cd4ae){if(_0x5cd4ae){_0x785fe9[_0xcf3c('0x32')]=_['keys'](db[_0xcf3c('0xc4')][_0xcf3c('0x47')]);_0x785fe9[_0xcf3c('0x33')]=_['keys'](_0x2bc399['query']);_0x785fe9['filters']=_[_0xcf3c('0x35')](_0x785fe9[_0xcf3c('0x32')],_0x785fe9[_0xcf3c('0x33')]);_0x44f060['attributes']=_[_0xcf3c('0x35')](_0x785fe9[_0xcf3c('0x32')],qs[_0xcf3c('0x37')](_0x2bc399[_0xcf3c('0x33')][_0xcf3c('0x37')]));_0x44f060['attributes']=_0x44f060[_0xcf3c('0x36')][_0xcf3c('0x57')]?_0x44f060[_0xcf3c('0x36')]:_0x785fe9[_0xcf3c('0x32')];if(!_0x2bc399['query'][_0xcf3c('0x38')](_0xcf3c('0x39'))){_0x44f060[_0xcf3c('0x24')]=qs[_0xcf3c('0x24')](_0x2bc399[_0xcf3c('0x33')]['limit']);_0x44f060[_0xcf3c('0x22')]=qs[_0xcf3c('0x22')](_0x2bc399[_0xcf3c('0x33')][_0xcf3c('0x22')]);}_0x44f060['order']=qs[_0xcf3c('0x58')](_0x2bc399[_0xcf3c('0x33')]['sort']);_0x44f060[_0xcf3c('0x3b')]=qs[_0xcf3c('0x34')](_['pick'](_0x2bc399['query'],_0x785fe9[_0xcf3c('0x34')]));_0x44f060['where']['ChatWebsiteId']=_0x5cd4ae['id'];if(_0x2bc399[_0xcf3c('0x33')][_0xcf3c('0x3d')]){_0x44f060[_0xcf3c('0x3b')]=_[_0xcf3c('0x3e')](_0x44f060[_0xcf3c('0x3b')],{'$or':_[_0xcf3c('0x30')](_0x44f060[_0xcf3c('0x36')],function(_0x36f0b8){var _0x46e8cf={};_0x46e8cf[_0x36f0b8]={'$like':'%'+_0x2bc399[_0xcf3c('0x33')][_0xcf3c('0x3d')]+'%'};return _0x46e8cf;})});}_0x44f060=_[_0xcf3c('0x3e')]({},_0x44f060,_0x2bc399[_0xcf3c('0x48')]);return db[_0xcf3c('0xc4')]['count']({'where':_0x44f060[_0xcf3c('0x3b')]})[_0xcf3c('0x13')](function(_0x43bdf2){_0x3c89ec[_0xcf3c('0x41')]=_0x43bdf2;if(_0x2bc399[_0xcf3c('0x33')]['includeAll']){_0x44f060['include']=[{'all':!![]}];}else{_0x44f060['include']=[{'model':db[_0xcf3c('0x8a')],'as':_0xcf3c('0xe4'),'required':![]},{'model':db[_0xcf3c('0xcd')],'as':'Attachments','required':![]}];}return db[_0xcf3c('0xc4')][_0xcf3c('0x42')](_0x44f060);})[_0xcf3c('0x13')](function(_0x4ab67f){_0x3c89ec[_0xcf3c('0x43')]=_0x4ab67f;return _0x3c89ec;});}})['then'](respondWithFilteredResult(_0x201cc0,_0x44f060))[_0xcf3c('0x1d')](handleError(_0x201cc0,null));};exports[_0xcf3c('0x11c')]=function(_0x376de3,_0x141da2){return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'where':{'id':_0x376de3[_0xcf3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x141da2,null))[_0xcf3c('0x13')](function(_0x21fabd){if(_0x21fabd){return _0x21fabd[_0xcf3c('0x11c')](_0x376de3[_0xcf3c('0x4b')][_0xcf3c('0x5c')],_['omit'](_0x376de3[_0xcf3c('0x4b')],[_0xcf3c('0x5c'),'id'])||{})[_0xcf3c('0xa8')](function(_0x332254){for(var _0x2db1fd=0x0;_0x2db1fd<_0x376de3[_0xcf3c('0x4b')][_0xcf3c('0x5c')]['length'];_0x2db1fd+=0x1){socket[_0xcf3c('0x11d')]('userChatWebsite:save',{'UserId':Number(_0x376de3[_0xcf3c('0x4b')][_0xcf3c('0x5c')][_0x2db1fd]),'ChatWebsiteId':Number(_0x376de3[_0xcf3c('0x45')]['id'])});}return _0x332254;});}})[_0xcf3c('0x13')](respondWithResult(_0x141da2,null))[_0xcf3c('0x1d')](handleError(_0x141da2,null));};exports[_0xcf3c('0x11e')]=function(_0x157578,_0x156196){return db[_0xcf3c('0x31')][_0xcf3c('0x49')]({'where':{'id':_0x157578[_0xcf3c('0x45')]['id']}})[_0xcf3c('0x13')](handleEntityNotFound(_0x156196,null))[_0xcf3c('0x13')](function(_0x12e9a7){if(_0x12e9a7){return _0x12e9a7[_0xcf3c('0x11e')](_0x157578[_0xcf3c('0x33')]['ids'])['then'](function(){if(_[_0xcf3c('0x11f')](_0x157578[_0xcf3c('0x33')][_0xcf3c('0x5c')])){for(var _0x5bf191=0x0;_0x5bf191<_0x157578[_0xcf3c('0x33')][_0xcf3c('0x5c')][_0xcf3c('0x57')];_0x5bf191+=0x1){socket[_0xcf3c('0x11d')](_0xcf3c('0x120'),{'UserId':Number(_0x157578['query'][_0xcf3c('0x5c')][_0x5bf191]),'ChatWebsiteId':Number(_0x157578[_0xcf3c('0x45')]['id'])});}}else{socket[_0xcf3c('0x11d')](_0xcf3c('0x120'),{'UserId':Number(_0x157578[_0xcf3c('0x33')][_0xcf3c('0x5c')]),'ChatWebsiteId':Number(_0x157578[_0xcf3c('0x45')]['id'])});}});}})[_0xcf3c('0x13')](respondWithStatusCode(_0x156196,null))[_0xcf3c('0x1d')](handleError(_0x156196,null));};exports[_0xcf3c('0x121')]=function(_0x4a8c6b,_0x1a4884){var _0x4409c0={};var _0x3a4b55={};var _0x179dc9;var _0x5f540d;return db[_0xcf3c('0x31')][_0xcf3c('0x56')]({'where':{'id':_0x4a8c6b[_0xcf3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a4884,null))['then'](function(_0x49e041){if(_0x49e041){_0x179dc9=_0x49e041;_0x3a4b55[_0xcf3c('0x32')]=_[_0xcf3c('0x46')](db[_0xcf3c('0xb1')][_0xcf3c('0x47')]);_0x3a4b55[_0xcf3c('0x33')]=_['keys'](_0x4a8c6b[_0xcf3c('0x33')]);_0x3a4b55['filters']=_[_0xcf3c('0x35')](_0x3a4b55['model'],_0x3a4b55['query']);_0x4409c0[_0xcf3c('0x36')]=_['intersection'](_0x3a4b55['model'],qs[_0xcf3c('0x37')](_0x4a8c6b[_0xcf3c('0x33')][_0xcf3c('0x37')]));_0x4409c0['attributes']=_0x4409c0[_0xcf3c('0x36')][_0xcf3c('0x57')]?_0x4409c0[_0xcf3c('0x36')]:_0x3a4b55[_0xcf3c('0x32')];_0x4409c0[_0xcf3c('0x3a')]=qs[_0xcf3c('0x58')](_0x4a8c6b[_0xcf3c('0x33')][_0xcf3c('0x58')]);_0x4409c0[_0xcf3c('0x3b')]=qs['filters'](_['pick'](_0x4a8c6b['query'],_0x3a4b55['filters']));if(_0x4a8c6b[_0xcf3c('0x33')]['filter']){_0x4409c0['where']=_['merge'](_0x4409c0['where'],{'$or':_[_0xcf3c('0x30')](_0x4409c0[_0xcf3c('0x36')],function(_0x10f9e0){var _0x4fd1b8={};_0x4fd1b8[_0x10f9e0]={'$like':'%'+_0x4a8c6b['query'][_0xcf3c('0x3d')]+'%'};return _0x4fd1b8;})});}_0x4409c0=_[_0xcf3c('0x3e')]({},_0x4409c0,_0x4a8c6b[_0xcf3c('0x48')]);return _0x179dc9[_0xcf3c('0x121')](_0x4409c0);}})[_0xcf3c('0x13')](function(_0x4f569f){if(_0x4f569f){_0x5f540d=_0x4f569f[_0xcf3c('0x57')];if(!_0x4a8c6b[_0xcf3c('0x33')][_0xcf3c('0x38')](_0xcf3c('0x39'))){_0x4409c0[_0xcf3c('0x24')]=qs[_0xcf3c('0x24')](_0x4a8c6b['query'][_0xcf3c('0x24')]);_0x4409c0[_0xcf3c('0x22')]=qs[_0xcf3c('0x22')](_0x4a8c6b['query'][_0xcf3c('0x22')]);}return _0x179dc9[_0xcf3c('0x121')](_0x4409c0);}})[_0xcf3c('0x13')](function(_0x2154b6){if(_0x2154b6){return _0x2154b6?{'count':_0x5f540d,'rows':_0x2154b6}:null;}})['then'](respondWithResult(_0x1a4884,null))[_0xcf3c('0x1d')](handleError(_0x1a4884,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index d99b273..4c30628 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 _0x81bd=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update'];(function(_0x52f15e,_0x23b9d0){var _0x5caabe=function(_0x341545){while(--_0x341545){_0x52f15e['push'](_0x52f15e['shift']());}};_0x5caabe(++_0x23b9d0);}(_0x81bd,0x7c));var _0xd81b=function(_0x4fa0e8,_0x26b636){_0x4fa0e8=_0x4fa0e8-0x0;var _0x19cadd=_0x81bd[_0x4fa0e8];return _0x19cadd;};'use strict';var EventEmitter=require(_0xd81b('0x0'));var ChatWebsite=require(_0xd81b('0x1'))['db'][_0xd81b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd81b('0x3')](0x0);var events={'afterCreate':_0xd81b('0x4'),'afterUpdate':_0xd81b('0x5'),'afterDestroy':_0xd81b('0x6')};function emitEvent(_0x54e096){return function(_0x16e8de,_0x2c3d9e,_0x1b6cfe){ChatWebsiteEvents['emit'](_0x54e096+':'+_0x16e8de['id'],_0x16e8de);ChatWebsiteEvents[_0xd81b('0x7')](_0x54e096,_0x16e8de);_0x1b6cfe(null);};}for(var e in events){if(events[_0xd81b('0x8')](e)){var event=events[e];ChatWebsite[_0xd81b('0x9')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x302c=['save','emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x200271,_0xc66c2a){var _0x2addbb=function(_0x3880c0){while(--_0x3880c0){_0x200271['push'](_0x200271['shift']());}};_0x2addbb(++_0xc66c2a);}(_0x302c,0x15c));var _0xc302=function(_0x3544ae,_0x3064a5){_0x3544ae=_0x3544ae-0x0;var _0x203f9c=_0x302c[_0x3544ae];return _0x203f9c;};'use strict';var EventEmitter=require(_0xc302('0x0'));var ChatWebsite=require(_0xc302('0x1'))['db'][_0xc302('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc302('0x3')](0x0);var events={'afterCreate':_0xc302('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x256168){return function(_0xdc61f1,_0x3ed277,_0x589559){ChatWebsiteEvents['emit'](_0x256168+':'+_0xdc61f1['id'],_0xdc61f1);ChatWebsiteEvents[_0xc302('0x5')](_0x256168,_0xdc61f1);_0x589559(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xc302('0x6')](e,emitEvent(event));}}module[_0xc302('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index ac267a7..e33b70c 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 _0x9f98=['lodash','api','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x516fb0,_0x250ebe){var _0x26758e=function(_0x222139){while(--_0x222139){_0x516fb0['push'](_0x516fb0['shift']());}};_0x26758e(++_0x250ebe);}(_0x9f98,0x132));var _0x89f9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9f98[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x89f9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x89f9('0x1'));var moment=require('moment');var BPromise=require(_0x89f9('0x2'));var rp=require(_0x89f9('0x3'));var fs=require('fs');var path=require(_0x89f9('0x4'));var rimraf=require('rimraf');var config=require(_0x89f9('0x5'));var attributes=require(_0x89f9('0x6'));module[_0x89f9('0x7')]=function(_0x56719d,_0x42627a){return _0x56719d['define'](_0x89f9('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3115=['chat_websites','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x3115,0x85));var _0x5311=function(_0xc376e1,_0x1a2b83){_0xc376e1=_0xc376e1-0x0;var _0x63e01c=_0x3115[_0xc376e1];return _0x63e01c;};'use strict';var _=require(_0x5311('0x0'));var util=require(_0x5311('0x1'));var logger=require(_0x5311('0x2'))('api');var moment=require(_0x5311('0x3'));var BPromise=require(_0x5311('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5311('0x5'));var rimraf=require(_0x5311('0x6'));var config=require(_0x5311('0x7'));var attributes=require(_0x5311('0x8'));module[_0x5311('0x9')]=function(_0x481c22,_0x4fc5bb){return _0x481c22['define']('ChatWebsite',attributes,{'tableName':_0x5311('0xa'),'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 31c73f3..b216e46 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 _0x3d6f=['ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','register','then','info'];(function(_0x1c4803,_0x59694c){var _0x3110bc=function(_0x162f3b){while(--_0x162f3b){_0x1c4803['push'](_0x1c4803['shift']());}};_0x3110bc(++_0x59694c);}(_0x3d6f,0xa2));var _0xf3d6=function(_0x589eb4,_0xaa2019){_0x589eb4=_0x589eb4-0x0;var _0xf50816=_0x3d6f[_0x589eb4];return _0xf50816;};'use strict';var _=require('lodash');var util=require(_0xf3d6('0x0'));var moment=require(_0xf3d6('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3d6('0x2'));var db=require(_0xf3d6('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf3d6('0x4'));var config=require(_0xf3d6('0x5'));var jayson=require(_0xf3d6('0x6'));var client=jayson[_0xf3d6('0x7')]['http']({'port':0x232a});config['redis']=_[_0xf3d6('0x8')](config['redis'],{'host':_0xf3d6('0x9'),'port':0x18eb});var socket=require(_0xf3d6('0xa'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xf3d6('0xb')](socket);function respondWithRpcPromise(_0x574fc5,_0x28047b,_0x1d981a){return new BPromise(function(_0x10c787,_0x3add9a){return client['request'](_0x574fc5,_0x1d981a)[_0xf3d6('0xc')](function(_0x2f72f4){logger[_0xf3d6('0xd')](_0xf3d6('0xe'),_0x28047b,'request\x20sent');logger[_0xf3d6('0xf')](_0xf3d6('0x10'),_0x28047b,'request\x20sent',JSON[_0xf3d6('0x11')](_0x2f72f4));if(_0x2f72f4[_0xf3d6('0x12')]){if(_0x2f72f4[_0xf3d6('0x12')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x28047b,_0x2f72f4[_0xf3d6('0x12')][_0xf3d6('0x13')]);return _0x3add9a(_0x2f72f4[_0xf3d6('0x12')][_0xf3d6('0x13')]);}logger[_0xf3d6('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x28047b,_0x2f72f4[_0xf3d6('0x12')][_0xf3d6('0x13')]);return _0x10c787(_0x2f72f4['error'][_0xf3d6('0x13')]);}else{logger[_0xf3d6('0xd')](_0xf3d6('0xe'),_0x28047b,_0xf3d6('0x14'));_0x10c787(_0x2f72f4[_0xf3d6('0x15')][_0xf3d6('0x13')]);}})['catch'](function(_0x17bdf2){logger[_0xf3d6('0x12')](_0xf3d6('0xe'),_0x28047b,_0x17bdf2);_0x3add9a(_0x17bdf2);});});}
\ No newline at end of file
+var _0x9c26=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0x9c26,0xdf));var _0x69c2=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x9c26[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0x69c2('0x0'));var util=require(_0x69c2('0x1'));var moment=require(_0x69c2('0x2'));var BPromise=require(_0x69c2('0x3'));var rs=require(_0x69c2('0x4'));var fs=require('fs');var Redis=require(_0x69c2('0x5'));var db=require(_0x69c2('0x6'))['db'];var utils=require(_0x69c2('0x7'));var logger=require(_0x69c2('0x8'))(_0x69c2('0x9'));var config=require(_0x69c2('0xa'));var jayson=require(_0x69c2('0xb'));var client=jayson[_0x69c2('0xc')]['http']({'port':0x232a});config[_0x69c2('0xd')]=_[_0x69c2('0xe')](config[_0x69c2('0xd')],{'host':_0x69c2('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x69c2('0x10'))[_0x69c2('0x11')](socket);function respondWithRpcPromise(_0x563372,_0x8da6b3,_0x1b5bf9){return new BPromise(function(_0x210172,_0x31410f){return client[_0x69c2('0x12')](_0x563372,_0x1b5bf9)[_0x69c2('0x13')](function(_0x402ac3){logger['info'](_0x69c2('0x14'),_0x8da6b3,_0x69c2('0x15'));logger[_0x69c2('0x16')](_0x69c2('0x17'),_0x8da6b3,_0x69c2('0x15'),JSON[_0x69c2('0x18')](_0x402ac3));if(_0x402ac3[_0x69c2('0x19')]){if(_0x402ac3[_0x69c2('0x19')]['code']===0x1f4){logger[_0x69c2('0x19')](_0x69c2('0x14'),_0x8da6b3,_0x402ac3[_0x69c2('0x19')][_0x69c2('0x1a')]);return _0x31410f(_0x402ac3['error']['message']);}logger[_0x69c2('0x19')](_0x69c2('0x14'),_0x8da6b3,_0x402ac3[_0x69c2('0x19')][_0x69c2('0x1a')]);return _0x210172(_0x402ac3[_0x69c2('0x19')]['message']);}else{logger['info'](_0x69c2('0x14'),_0x8da6b3,'request\x20sent');_0x210172(_0x402ac3['result'][_0x69c2('0x1a')]);}})[_0x69c2('0x1b')](function(_0x2af05b){logger[_0x69c2('0x19')](_0x69c2('0x14'),_0x8da6b3,_0x2af05b);_0x31410f(_0x2af05b);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e41993e..3c112d3 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 _0x2de4=['remove','update','register','length','chatWebsite:','save'];(function(_0x9e778d,_0x227065){var _0x2d6bf8=function(_0x303994){while(--_0x303994){_0x9e778d['push'](_0x9e778d['shift']());}};_0x2d6bf8(++_0x227065);}(_0x2de4,0xef));var _0x42de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2de4[_0x3dd15e];return _0x231fd0;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x42de('0x0'),_0x42de('0x1'),_0x42de('0x2')];function createListener(_0x121453,_0x123fec){return function(_0x1efe5a){_0x123fec['emit'](_0x121453,_0x1efe5a);};}function removeListener(_0x3d21b0,_0x27f66b){return function(){ChatWebsiteEvents['removeListener'](_0x3d21b0,_0x27f66b);};}exports[_0x42de('0x3')]=function(_0x387008){for(var _0x21497d=0x0,_0x34320e=events[_0x42de('0x4')];_0x21497d<_0x34320e;_0x21497d++){var _0xe15b6=events[_0x21497d];var _0x56f68c=createListener(_0x42de('0x5')+_0xe15b6,_0x387008);ChatWebsiteEvents['on'](_0xe15b6,_0x56f68c);}};
\ No newline at end of file
+var _0x4654=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','save','update'];(function(_0x18fdea,_0x397091){var _0x5c0af1=function(_0x4c4edf){while(--_0x4c4edf){_0x18fdea['push'](_0x18fdea['shift']());}};_0x5c0af1(++_0x397091);}(_0x4654,0x6d));var _0x4465=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4654[_0x2dafbe];return _0x58a45a;};'use strict';var ChatWebsiteEvents=require(_0x4465('0x0'));var events=[_0x4465('0x1'),'remove',_0x4465('0x2')];function createListener(_0x1c7010,_0x5d6ae0){return function(_0x36b052){_0x5d6ae0[_0x4465('0x3')](_0x1c7010,_0x36b052);};}function removeListener(_0x2f9f5b,_0x2bf7b7){return function(){ChatWebsiteEvents[_0x4465('0x4')](_0x2f9f5b,_0x2bf7b7);};}exports[_0x4465('0x5')]=function(_0x53f1b1){for(var _0x189b63=0x0,_0x34f258=events['length'];_0x189b63<_0x34f258;_0x189b63++){var _0x269b94=events[_0x189b63];var _0x3170d3=createListener(_0x4465('0x6')+_0x269b94,_0x53f1b1);ChatWebsiteEvents['on'](_0x269b94,_0x3170d3);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 1d130a7..6df2878 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 _0x7b8a=['/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','addLogo','file','addAvatar','/:id/customer_avatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','any','offline','addInteraction','addProactiveActions','/:id/users','addAgents','put','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x7b8a,0x1ab));var _0xa7b8=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x7b8a[_0x2891d1];return _0x486948;};'use strict';var multer=require('multer');var util=require(_0xa7b8('0x0'));var path=require(_0xa7b8('0x1'));var timeout=require(_0xa7b8('0x2'));var express=require(_0xa7b8('0x3'));var router=express[_0xa7b8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa7b8('0x5'));var interaction=require(_0xa7b8('0x6'));var config=require(_0xa7b8('0x7'));var controller=require(_0xa7b8('0x8'));router[_0xa7b8('0x9')]('/',auth[_0xa7b8('0xa')](),controller[_0xa7b8('0xb')]);router['get'](_0xa7b8('0xc'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0xd')]);router['get'](_0xa7b8('0xe'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0xf')]);router[_0xa7b8('0x9')](_0xa7b8('0x10'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x11')]);router[_0xa7b8('0x9')](_0xa7b8('0x12'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x13')]);router[_0xa7b8('0x9')]('/:id/logo',controller[_0xa7b8('0x14')]);router['get'](_0xa7b8('0x15'),controller[_0xa7b8('0x16')]);router[_0xa7b8('0x9')]('/:id/customer_avatar',controller[_0xa7b8('0x17')]);router['get'](_0xa7b8('0x18'),controller[_0xa7b8('0x19')]);router[_0xa7b8('0x9')](_0xa7b8('0x1a'),auth['isAuthenticated'](),controller[_0xa7b8('0x1b')]);router[_0xa7b8('0x9')](_0xa7b8('0x1c'),controller[_0xa7b8('0x1d')]);router['get'](_0xa7b8('0x1e'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x1f')]);router[_0xa7b8('0x9')](_0xa7b8('0x20'),auth[_0xa7b8('0xa')](),controller['getProactiveActions']);router[_0xa7b8('0x9')](_0xa7b8('0x21'),controller[_0xa7b8('0x22')]);router[_0xa7b8('0x9')](_0xa7b8('0x23'),auth['isAuthenticated'](),controller[_0xa7b8('0x24')]);router[_0xa7b8('0x9')]('/:id/users',auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x25')]);router[_0xa7b8('0x26')]('/',auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x27')]);router[_0xa7b8('0x26')](_0xa7b8('0x10'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x28')]);router[_0xa7b8('0x26')](_0xa7b8('0x12'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x29')]);var upload=multer({'storage':multer[_0xa7b8('0x2a')]({'destination':function(_0x207b13,_0xfccd37,_0x23b4a8){_0x23b4a8(null,path[_0xa7b8('0x2b')](config[_0xa7b8('0x2c')],_0xa7b8('0x2d')));},'filename':function(_0x5b111b,_0x4f1eb2,_0x25563a){_0x25563a(null,util[_0xa7b8('0x2e')](_0xa7b8('0x2f'),Date[_0xa7b8('0x30')](),_0x4f1eb2[_0xa7b8('0x31')]));}})});router[_0xa7b8('0x26')](_0xa7b8('0x32'),upload[_0xa7b8('0x33')]('file'),controller[_0xa7b8('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28f764,_0x23e6ad,_0x2d71bd){_0x2d71bd(null,path[_0xa7b8('0x2b')](config[_0xa7b8('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x15fd6b,_0x54bf01,_0x22a610){_0x22a610(null,util[_0xa7b8('0x2e')]('%s-%s',Date[_0xa7b8('0x30')](),_0x54bf01[_0xa7b8('0x31')]));}})});router[_0xa7b8('0x26')](_0xa7b8('0x15'),upload[_0xa7b8('0x33')](_0xa7b8('0x35')),controller[_0xa7b8('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34c759,_0x46659d,_0x4216c2){_0x4216c2(null,path[_0xa7b8('0x2b')](config[_0xa7b8('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x2d0947,_0xfdaebe,_0x452e48){_0x452e48(null,util[_0xa7b8('0x2e')](_0xa7b8('0x2f'),Date[_0xa7b8('0x30')](),_0xfdaebe[_0xa7b8('0x31')]));}})});router[_0xa7b8('0x26')](_0xa7b8('0x37'),upload['single'](_0xa7b8('0x35')),controller[_0xa7b8('0x38')]);var upload=multer({'storage':multer[_0xa7b8('0x2a')]({'destination':function(_0x510752,_0x125389,_0x3a27d0){_0x3a27d0(null,path[_0xa7b8('0x2b')](config[_0xa7b8('0x2c')],_0xa7b8('0x39')));},'filename':function(_0x2e80ea,_0x36cff0,_0x2a1e2a){_0x2a1e2a(null,util[_0xa7b8('0x2e')](_0xa7b8('0x2f'),Date['now'](),_0x36cff0[_0xa7b8('0x31')]));}})});router['post'](_0xa7b8('0x18'),upload['single'](_0xa7b8('0x35')),controller[_0xa7b8('0x3a')]);router[_0xa7b8('0x26')](_0xa7b8('0x3b'),controller[_0xa7b8('0x3c')]);const offlineUploadMulter=multer({'storage':multer[_0xa7b8('0x2a')]({'destination':function(_0x38be22,_0x208b39,_0xba94e1){const _0x5620c5=path[_0xa7b8('0x2b')](config[_0xa7b8('0x2c')],_0xa7b8('0x3d'),_0xa7b8('0x3e'),_0xa7b8('0x3f'));fs_extra[_0xa7b8('0x40')](_0x5620c5,function(){_0xba94e1(null,_0x5620c5);});},'filename':function(_0x411bac,_0x3b0bf1,_0x4d7559){const _0x321219=_0x3b0bf1[_0xa7b8('0x31')][_0xa7b8('0x41')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x28efd8=path['extname'](_0x321219);const _0x34b865=Date[_0xa7b8('0x30')]()+'-'+_0x321219[_0xa7b8('0x41')](_0x28efd8,'')+_0x28efd8;_0x4d7559(null,_0x34b865);}})});router[_0xa7b8('0x26')]('/:id/offline',offlineUploadMulter[_0xa7b8('0x42')](),controller[_0xa7b8('0x43')]);router['post']('/:id/interactions',auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x44')]);router[_0xa7b8('0x26')](_0xa7b8('0x1e'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa7b8('0x26')](_0xa7b8('0x20'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x45')]);router['post'](_0xa7b8('0x46'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x47')]);router[_0xa7b8('0x48')](_0xa7b8('0xe'),auth[_0xa7b8('0xa')](),controller['update']);router['delete']('/:id',auth[_0xa7b8('0xa')](),controller['destroy']);router[_0xa7b8('0x49')](_0xa7b8('0x10'),auth[_0xa7b8('0xa')](),controller['removeDispositions']);router[_0xa7b8('0x49')](_0xa7b8('0x12'),auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x4a')]);router[_0xa7b8('0x49')]('/:id/users',auth[_0xa7b8('0xa')](),controller[_0xa7b8('0x4b')]);module[_0xa7b8('0x4c')]=router;
\ No newline at end of file
+var _0x92d2=['isAuthenticated','/describe','/:id','show','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','join','root','format','now','originalname','file','addLogo','%s-%s','single','diskStorage','addCustomerAvatar','server/files/images/avatars/','/:id/system_avatar','notify','offline-chat','ensureDir','replace','/:id/offline','offline','addInteraction','addApplications','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get'];(function(_0x3e6d2f,_0x38d422){var _0xa43717=function(_0x3108ae){while(--_0x3108ae){_0x3e6d2f['push'](_0x3e6d2f['shift']());}};_0xa43717(++_0x38d422);}(_0x92d2,0x77));var _0x292d=function(_0x467b60,_0x4c33e4){_0x467b60=_0x467b60-0x0;var _0x2a7429=_0x92d2[_0x467b60];return _0x2a7429;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x292d('0x0'));var timeout=require(_0x292d('0x1'));var express=require(_0x292d('0x2'));var router=express[_0x292d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x292d('0x4'));var interaction=require(_0x292d('0x5'));var config=require(_0x292d('0x6'));var controller=require(_0x292d('0x7'));router[_0x292d('0x8')]('/',auth[_0x292d('0x9')](),controller['index']);router[_0x292d('0x8')](_0x292d('0xa'),auth[_0x292d('0x9')](),controller['describe']);router[_0x292d('0x8')](_0x292d('0xb'),auth['isAuthenticated'](),controller[_0x292d('0xc')]);router[_0x292d('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x292d('0xd'),auth['isAuthenticated'](),controller[_0x292d('0xe')]);router[_0x292d('0x8')](_0x292d('0xf'),controller[_0x292d('0x10')]);router['get'](_0x292d('0x11'),controller[_0x292d('0x12')]);router[_0x292d('0x8')](_0x292d('0x13'),controller[_0x292d('0x14')]);router[_0x292d('0x8')]('/:id/system_avatar',controller[_0x292d('0x15')]);router[_0x292d('0x8')](_0x292d('0x16'),auth['isAuthenticated'](),controller[_0x292d('0x17')]);router['get']('/:id/snippet',controller[_0x292d('0x18')]);router[_0x292d('0x8')](_0x292d('0x19'),auth[_0x292d('0x9')](),controller['getApplications']);router[_0x292d('0x8')](_0x292d('0x1a'),auth[_0x292d('0x9')](),controller[_0x292d('0x1b')]);router[_0x292d('0x8')](_0x292d('0x1c'),controller['getFields']);router[_0x292d('0x8')]('/:id/offline_messages',auth[_0x292d('0x9')](),controller[_0x292d('0x1d')]);router[_0x292d('0x8')](_0x292d('0x1e'),auth[_0x292d('0x9')](),controller['getAgents']);router[_0x292d('0x1f')]('/',auth['isAuthenticated'](),controller[_0x292d('0x20')]);router['post']('/:id/dispositions',auth[_0x292d('0x9')](),controller[_0x292d('0x21')]);router['post'](_0x292d('0xd'),auth[_0x292d('0x9')](),controller[_0x292d('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc2979c,_0x20be48,_0x14969c){_0x14969c(null,path[_0x292d('0x23')](config[_0x292d('0x24')],'server/files/images/logos/'));},'filename':function(_0x1e2d6b,_0xf8be08,_0xf3f4d3){_0xf3f4d3(null,util[_0x292d('0x25')]('%s-%s',Date[_0x292d('0x26')](),_0xf8be08[_0x292d('0x27')]));}})});router[_0x292d('0x1f')](_0x292d('0xf'),upload['single'](_0x292d('0x28')),controller[_0x292d('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4950c8,_0x39f230,_0xac2ed1){_0xac2ed1(null,path[_0x292d('0x23')](config[_0x292d('0x24')],'server/files/images/avatars/'));},'filename':function(_0x30194d,_0x53c8d4,_0x34d670){_0x34d670(null,util[_0x292d('0x25')](_0x292d('0x2a'),Date['now'](),_0x53c8d4[_0x292d('0x27')]));}})});router[_0x292d('0x1f')](_0x292d('0x11'),upload[_0x292d('0x2b')](_0x292d('0x28')),controller['addAvatar']);var upload=multer({'storage':multer[_0x292d('0x2c')]({'destination':function(_0x161697,_0x1b4f48,_0x234407){_0x234407(null,path[_0x292d('0x23')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xf289b0,_0x1fdfa0,_0xdc6932){_0xdc6932(null,util['format']('%s-%s',Date[_0x292d('0x26')](),_0x1fdfa0[_0x292d('0x27')]));}})});router[_0x292d('0x1f')](_0x292d('0x13'),upload[_0x292d('0x2b')](_0x292d('0x28')),controller[_0x292d('0x2d')]);var upload=multer({'storage':multer[_0x292d('0x2c')]({'destination':function(_0x25fc5d,_0x16ace9,_0x3e01b2){_0x3e01b2(null,path[_0x292d('0x23')](config[_0x292d('0x24')],_0x292d('0x2e')));},'filename':function(_0x95abb6,_0x14c2a4,_0x4a0491){_0x4a0491(null,util[_0x292d('0x25')](_0x292d('0x2a'),Date['now'](),_0x14c2a4[_0x292d('0x27')]));}})});router[_0x292d('0x1f')](_0x292d('0x2f'),upload[_0x292d('0x2b')](_0x292d('0x28')),controller['addSystemAvatar']);router['post']('/:id/notify',controller[_0x292d('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x292d('0x2c')]({'destination':function(_0x479045,_0xb1432a,_0x93e3){const _0x2c69b8=path[_0x292d('0x23')](config['root'],'server/files','attachments',_0x292d('0x31'));fs_extra[_0x292d('0x32')](_0x2c69b8,function(){_0x93e3(null,_0x2c69b8);});},'filename':function(_0x39e99d,_0x5de9ca,_0x41e0fa){const _0x2984ba=_0x5de9ca[_0x292d('0x27')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1497e=path['extname'](_0x2984ba);const _0x5331a4=Date['now']()+'-'+_0x2984ba[_0x292d('0x33')](_0x1497e,'')+_0x1497e;_0x41e0fa(null,_0x5331a4);}})});router[_0x292d('0x1f')](_0x292d('0x34'),offlineUploadMulter['any'](),controller[_0x292d('0x35')]);router[_0x292d('0x1f')](_0x292d('0x16'),auth[_0x292d('0x9')](),controller[_0x292d('0x36')]);router[_0x292d('0x1f')]('/:id/applications',auth[_0x292d('0x9')](),controller[_0x292d('0x37')]);router['post'](_0x292d('0x1a'),auth[_0x292d('0x9')](),controller['addProactiveActions']);router[_0x292d('0x1f')](_0x292d('0x1e'),auth['isAuthenticated'](),controller['addAgents']);router[_0x292d('0x38')](_0x292d('0xb'),auth[_0x292d('0x9')](),controller[_0x292d('0x39')]);router[_0x292d('0x3a')](_0x292d('0xb'),auth['isAuthenticated'](),controller[_0x292d('0x3b')]);router['delete']('/:id/dispositions',auth[_0x292d('0x9')](),controller[_0x292d('0x3c')]);router[_0x292d('0x3a')](_0x292d('0xd'),auth[_0x292d('0x9')](),controller[_0x292d('0x3d')]);router[_0x292d('0x3a')](_0x292d('0x1e'),auth['isAuthenticated'](),controller[_0x292d('0x3e')]);module[_0x292d('0x3f')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 09f85d8..264a481 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 _0xb044=['expressEndpoint','/client-logs','use','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','get','Client-Side\x20logger\x20not\x20found!'];(function(_0x301f7f,_0x58a5d4){var _0x56dc26=function(_0x215563){while(--_0x215563){_0x301f7f['push'](_0x301f7f['shift']());}};_0x56dc26(++_0x58a5d4);}(_0xb044,0xd4));var _0x4b04=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xb044[_0x16b9ed];return _0x66b1f8;};var beaverLogger=require(_0x4b04('0x0'));var express=require(_0x4b04('0x1'));var auth=require(_0x4b04('0x2'));var config=require(_0x4b04('0x3'));var router=express['Router']();var isProduction=config[_0x4b04('0x4')]===_0x4b04('0x5')||![];function clientSideLogs(_0x40f2f5,_0x3a5a58,_0x20f449){var _0x49492a=_0x40f2f5[_0x4b04('0x6')][_0x4b04('0x7')]('client-side-logger');if(!_0x49492a){throw new Error(_0x4b04('0x8'));}return beaverLogger[_0x4b04('0x9')]({'uri':_0x4b04('0xa'),'logger':_0x49492a,'enableCors':!isProduction})(_0x40f2f5,_0x3a5a58,_0x20f449);}router[_0x4b04('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x4b04('0xc')]=router;
\ No newline at end of file
+var _0x1098=['../components/auth/service','production','Client-Side\x20logger\x20not\x20found!','isAuthenticated','exports','express'];(function(_0x2142fa,_0x1e9945){var _0x350983=function(_0x125657){while(--_0x125657){_0x2142fa['push'](_0x2142fa['shift']());}};_0x350983(++_0x1e9945);}(_0x1098,0x131));var _0x8109=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1098[_0x3dd15e];return _0x231fd0;};var beaverLogger=require('beaver-logger/server');var express=require(_0x8109('0x0'));var auth=require(_0x8109('0x1'));var config=require('../config/environment');var router=express['Router']();var isProduction=config['env']===_0x8109('0x2')||![];function clientSideLogs(_0x3386cd,_0x8746eb,_0x2c0b7f){var _0x5a89ee=_0x3386cd['app']['get']('client-side-logger');if(!_0x5a89ee){throw new Error(_0x8109('0x3'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x5a89ee,'enableCors':!isProduction})(_0x3386cd,_0x8746eb,_0x2c0b7f);}router['use'](auth[_0x8109('0x4')](),clientSideLogs);module[_0x8109('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index f3fdc56..2e6298a 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 _0x08c5=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x1364cb,_0x324656){var _0x5b2672=function(_0x447aba){while(--_0x447aba){_0x1364cb['push'](_0x1364cb['shift']());}};_0x5b2672(++_0x324656);}(_0x08c5,0x80));var _0x508c=function(_0x4b6159,_0x13da06){_0x4b6159=_0x4b6159-0x0;var _0x5e3b01=_0x08c5[_0x4b6159];return _0x5e3b01;};'use strict';var Sequelize=require(_0x508c('0x0'));module[_0x508c('0x1')]={'name':{'type':Sequelize[_0x508c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x508c('0x3')](_0x508c('0x4'),_0x508c('0x5'),_0x508c('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x508c('0x3')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x508c('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x508c('0x2')],'comment':_0x508c('0x7')},'data3':{'type':Sequelize[_0x508c('0x2')],'comment':_0x508c('0x8')},'data4':{'type':Sequelize[_0x508c('0x2')],'comment':_0x508c('0x9')},'data5':{'type':Sequelize[_0x508c('0xa')],'comment':_0x508c('0xb')},'data6':{'type':Sequelize[_0x508c('0xa')],'comment':_0x508c('0xc')},'data7':{'type':Sequelize[_0x508c('0xa')],'comment':_0x508c('0xd')}};
\ No newline at end of file
+var _0x8396=['sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x3fb3ba,_0x2dd84d){var _0xfa43ea=function(_0x16e74b){while(--_0x16e74b){_0x3fb3ba['push'](_0x3fb3ba['shift']());}};_0xfa43ea(++_0x2dd84d);}(_0x8396,0xa8));var _0x6839=function(_0x5db600,_0x47f723){_0x5db600=_0x5db600-0x0;var _0x18190c=_0x8396[_0x5db600];return _0x18190c;};'use strict';var Sequelize=require(_0x6839('0x0'));module['exports']={'name':{'type':Sequelize[_0x6839('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6839('0x2')](_0x6839('0x3'),_0x6839('0x4'),_0x6839('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x6839('0x6'),_0x6839('0x7'))},'data1':{'type':Sequelize[_0x6839('0x1')],'comment':_0x6839('0x8')},'data2':{'type':Sequelize[_0x6839('0x1')],'comment':_0x6839('0x9')},'data3':{'type':Sequelize[_0x6839('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x6839('0x1')],'comment':_0x6839('0xa')},'data5':{'type':Sequelize[_0x6839('0xb')],'comment':_0x6839('0xc')},'data6':{'type':Sequelize[_0x6839('0xb')],'comment':_0x6839('0xd')},'data7':{'type':Sequelize[_0x6839('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 8f9bba8..dec4be7 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 _0x8379=['query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','service','decryptString','data3','catch','show','params','keys','find','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','includes','MicrosoftAzure','encryptString','oauth2MicrosoftAuthorize','findOne','user','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','oauth2Claims','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','error','stack','name','CloudProvider','rawAttributes','type','key','model','map'];(function(_0x101ba9,_0x377658){var _0x5dcebc=function(_0x270060){while(--_0x270060){_0x101ba9['push'](_0x101ba9['shift']());}};_0x5dcebc(++_0x377658);}(_0x8379,0x1d4));var _0x9837=function(_0x9391df,_0x2bebda){_0x9391df=_0x9391df-0x0;var _0x59255b=_0x8379[_0x9391df];return _0x59255b;};'use strict';var _=require(_0x9837('0x0'));var Redis=require('ioredis');var qs=require(_0x9837('0x1'));var encryptor=require(_0x9837('0x2'));var config=require(_0x9837('0x3'));var logger=require(_0x9837('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x9837('0x5'));config[_0x9837('0x6')]=_['defaults'](config['redis'],{'host':_0x9837('0x7'),'port':0x18eb});var socket=require(_0x9837('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x9837('0x6')]);function respondWithStatusCode(_0x825c80,_0x4d1b43){_0x4d1b43=_0x4d1b43||0xcc;return function(_0x19573c){if(_0x19573c){return _0x825c80[_0x9837('0x9')](_0x4d1b43);}return _0x825c80[_0x9837('0xa')](_0x4d1b43)[_0x9837('0xb')]();};}function respondWithResult(_0x537e55,_0x344b0f){_0x344b0f=_0x344b0f||0xc8;return function(_0x4e57f8){if(_0x4e57f8){return _0x537e55[_0x9837('0xa')](_0x344b0f)[_0x9837('0xc')](_0x4e57f8);}};}function respondWithFilteredResult(_0x4c1122,_0x45a315){return function(_0x5866ce){if(_0x5866ce){var _0xbd65ce=typeof _0x45a315[_0x9837('0xd')]===_0x9837('0xe')&&typeof _0x45a315['limit']===_0x9837('0xe');var _0x2d104f=_0x5866ce[_0x9837('0xf')];var _0x512592=_0xbd65ce?0x0:_0x45a315[_0x9837('0xd')];var _0x1c04ac=_0xbd65ce?_0x5866ce['count']:_0x45a315[_0x9837('0xd')]+_0x45a315[_0x9837('0x10')];var _0x535e9e;if(_0x1c04ac>=_0x2d104f){_0x1c04ac=_0x2d104f;_0x535e9e=0xc8;}else{_0x535e9e=0xce;}_0x4c1122['status'](_0x535e9e);return _0x4c1122['set'](_0x9837('0x11'),_0x512592+'-'+_0x1c04ac+'/'+_0x2d104f)['json'](_0x5866ce);}return null;};}function saveUpdates(_0x4403fe){return function(_0xdb34d8){if(_0xdb34d8){return _0xdb34d8[_0x9837('0x12')](_0x4403fe)[_0x9837('0x13')](function(_0x587b02){return _0x587b02;});}return null;};}function removeEntity(_0x2ec8bc){return function(_0x2d2368){if(_0x2d2368){return _0x2d2368[_0x9837('0x14')]()['then'](function(){_0x2ec8bc[_0x9837('0xa')](0xcc)[_0x9837('0xb')]();});}};}function handleEntityNotFound(_0x211b41){return function(_0x56c951){if(!_0x56c951){_0x211b41[_0x9837('0x9')](0x194);}return _0x56c951;};}function handleError(_0x38e81a,_0x462ec6){_0x462ec6=_0x462ec6||0x1f4;return function(_0x59eaed){logger[_0x9837('0x15')](_0x59eaed[_0x9837('0x16')]);if(_0x59eaed[_0x9837('0x17')]){delete _0x59eaed['name'];}_0x38e81a[_0x9837('0xa')](_0x462ec6)['send'](_0x59eaed);};}function maskClientSecret(_0xd8ca53){return _['padEnd'](_0xd8ca53['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x5a504a,_0x371798){var _0x3fe80a={},_0x5207b0={},_0x164e25={'count':0x0,'rows':[]};var _0x4e0dff=_['map'](db[_0x9837('0x18')][_0x9837('0x19')],function(_0x18a3a0){return{'name':_0x18a3a0['fieldName'],'type':_0x18a3a0[_0x9837('0x1a')][_0x9837('0x1b')]};});_0x5207b0[_0x9837('0x1c')]=_[_0x9837('0x1d')](_0x4e0dff,_0x9837('0x17'));_0x5207b0[_0x9837('0x1e')]=_['keys'](_0x5a504a[_0x9837('0x1e')]);_0x5207b0[_0x9837('0x1f')]=_[_0x9837('0x20')](_0x5207b0[_0x9837('0x1c')],_0x5207b0[_0x9837('0x1e')]);_0x3fe80a[_0x9837('0x21')]=_['intersection'](_0x5207b0[_0x9837('0x1c')],qs['fields'](_0x5a504a[_0x9837('0x1e')][_0x9837('0x22')]));_0x3fe80a[_0x9837('0x21')]=_0x3fe80a[_0x9837('0x21')][_0x9837('0x23')]?_0x3fe80a['attributes']:_0x5207b0['model'];if(!_0x5a504a[_0x9837('0x1e')][_0x9837('0x24')]('nolimit')){_0x3fe80a[_0x9837('0x10')]=qs[_0x9837('0x10')](_0x5a504a[_0x9837('0x1e')][_0x9837('0x10')]);_0x3fe80a['offset']=qs[_0x9837('0xd')](_0x5a504a[_0x9837('0x1e')][_0x9837('0xd')]);}_0x3fe80a['order']=qs['sort'](_0x5a504a[_0x9837('0x1e')][_0x9837('0x25')]);_0x3fe80a[_0x9837('0x26')]=qs['filters'](_[_0x9837('0x27')](_0x5a504a['query'],_0x5207b0[_0x9837('0x1f')]),_0x4e0dff);if(_0x5a504a['query'][_0x9837('0x28')]){_0x3fe80a[_0x9837('0x26')]=_[_0x9837('0x29')](_0x3fe80a[_0x9837('0x26')],{'$or':_[_0x9837('0x1d')](_0x4e0dff,function(_0x50a1db){if(_0x50a1db[_0x9837('0x1a')]!==_0x9837('0x2a')){var _0x299076={};_0x299076[_0x50a1db[_0x9837('0x17')]]={'$like':'%'+_0x5a504a[_0x9837('0x1e')][_0x9837('0x28')]+'%'};return _0x299076;}})});}_0x3fe80a=_[_0x9837('0x29')]({},_0x3fe80a,_0x5a504a['options']);var _0x303fc2={'where':_0x3fe80a['where']};return db[_0x9837('0x18')][_0x9837('0xf')](_0x303fc2)[_0x9837('0x13')](function(_0x29012a){_0x164e25[_0x9837('0xf')]=_0x29012a;if(_0x5a504a['query'][_0x9837('0x2b')]){_0x3fe80a[_0x9837('0x2c')]=[{'all':!![]}];}return db[_0x9837('0x18')][_0x9837('0x2d')](_0x3fe80a);})['then'](function(_0x5111e3){_0x164e25['rows']=_[_0x9837('0x1d')](_0x5111e3,function(_0x243800){if(_0x243800[_0x9837('0x2e')]==='MicrosoftAzure'){var _0x2ebebd=encryptor[_0x9837('0x2f')](_0x243800['data3']);_0x243800[_0x9837('0x30')]=maskClientSecret(_0x2ebebd);}return _0x243800;});return _0x164e25;})['then'](respondWithFilteredResult(_0x371798,_0x3fe80a))[_0x9837('0x31')](handleError(_0x371798,null));};exports[_0x9837('0x32')]=function(_0x1fecca,_0x3cb4b8){var _0x29ae6c={'raw':!![],'where':{'id':_0x1fecca[_0x9837('0x33')]['id']}},_0x4cf03b={};_0x4cf03b['model']=_[_0x9837('0x34')](db['CloudProvider'][_0x9837('0x19')]);_0x4cf03b[_0x9837('0x1e')]=_[_0x9837('0x34')](_0x1fecca['query']);_0x4cf03b[_0x9837('0x1f')]=_[_0x9837('0x20')](_0x4cf03b[_0x9837('0x1c')],_0x4cf03b[_0x9837('0x1e')]);_0x29ae6c[_0x9837('0x21')]=_[_0x9837('0x20')](_0x4cf03b[_0x9837('0x1c')],qs[_0x9837('0x22')](_0x1fecca['query']['fields']));_0x29ae6c['attributes']=_0x29ae6c[_0x9837('0x21')]['length']?_0x29ae6c['attributes']:_0x4cf03b['model'];if(_0x1fecca[_0x9837('0x1e')][_0x9837('0x2b')]){_0x29ae6c[_0x9837('0x2c')]=[{'all':!![]}];}_0x29ae6c=_[_0x9837('0x29')]({},_0x29ae6c,_0x1fecca['options']);return db['CloudProvider'][_0x9837('0x35')](_0x29ae6c)[_0x9837('0x13')](handleEntityNotFound(_0x3cb4b8,null))[_0x9837('0x13')](function(_0x34231b){if(_0x34231b[_0x9837('0x2e')]==='MicrosoftAzure'){var _0x62032c=encryptor[_0x9837('0x2f')](_0x34231b[_0x9837('0x30')]);_0x34231b[_0x9837('0x30')]=maskClientSecret(_0x62032c);}return _0x34231b;})['then'](respondWithResult(_0x3cb4b8,null))['catch'](handleError(_0x3cb4b8,null));};exports['create']=function(_0x46c3b9,_0x5017c3){if(!_0x46c3b9['body'][_0x9837('0x17')])throw new Error(_0x9837('0x36'));if(!_0x46c3b9[_0x9837('0x37')][_0x9837('0x2e')])throw new Error(_0x9837('0x38'));var _0x4ff3f8=db[_0x9837('0x18')][_0x9837('0x19')][_0x9837('0x2e')]['values'];if(!_0x4ff3f8[_0x9837('0x39')](_0x46c3b9[_0x9837('0x37')][_0x9837('0x2e')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x4ff3f8['join'](',\x20'));if(_0x46c3b9[_0x9837('0x37')][_0x9837('0x2e')]===_0x9837('0x3a')&&_0x46c3b9[_0x9837('0x37')][_0x9837('0x30')]){_0x46c3b9[_0x9837('0x37')][_0x9837('0x30')]=encryptor[_0x9837('0x3b')](_0x46c3b9[_0x9837('0x37')]['data3']);}return db[_0x9837('0x18')]['create'](_0x46c3b9[_0x9837('0x37')],{})[_0x9837('0x13')](respondWithResult(_0x5017c3,0xc9))[_0x9837('0x31')](handleError(_0x5017c3,null));};exports[_0x9837('0x12')]=function(_0x401410,_0x836226){if(_0x401410[_0x9837('0x37')]['id']){delete _0x401410[_0x9837('0x37')]['id'];}return db[_0x9837('0x18')][_0x9837('0x35')]({'where':{'id':_0x401410[_0x9837('0x33')]['id']}})[_0x9837('0x13')](handleEntityNotFound(_0x836226,null))['then'](function(_0x137a81){if(_0x137a81[_0x9837('0x2e')]===_0x9837('0x3a')&&_0x401410[_0x9837('0x37')][_0x9837('0x30')]){_0x401410[_0x9837('0x37')][_0x9837('0x30')]=encryptor[_0x9837('0x3b')](_0x401410[_0x9837('0x37')]['data3']);}return _0x137a81;})[_0x9837('0x13')](saveUpdates(_0x401410[_0x9837('0x37')],null))[_0x9837('0x13')](respondWithResult(_0x836226,null))['catch'](handleError(_0x836226,null));};exports[_0x9837('0x14')]=function(_0x12feb5,_0x398733){return db[_0x9837('0x18')][_0x9837('0x35')]({'where':{'id':_0x12feb5[_0x9837('0x33')]['id']}})[_0x9837('0x13')](handleEntityNotFound(_0x398733,null))[_0x9837('0x13')](removeEntity(_0x398733,null))[_0x9837('0x31')](handleError(_0x398733,null));};exports[_0x9837('0x3c')]=function(_0xd6ef16,_0x169d70){return db['CloudProvider'][_0x9837('0x3d')]({'where':{'id':_0xd6ef16[_0x9837('0x33')]['id']},'raw':!![]})[_0x9837('0x13')](function(_0x255ddb){if(!_0x255ddb)return _0x169d70[_0x9837('0x9')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x255ddb,_0xd6ef16[_0x9837('0x3e')]['id'])};})[_0x9837('0x13')](respondWithResult(_0x169d70,null))[_0x9837('0x31')](handleError(_0x169d70,null));};exports['oauth2MicrosoftCallback']=function(_0x527964,_0x446353){var _0x380350=_0x527964[_0x9837('0x37')];var _0x14a947;var _0x1fbf93;if(_0x380350[_0x9837('0x15')])throw _0x380350;redis[_0x9837('0x3f')](_0x380350[_0x9837('0x40')])[_0x9837('0x13')](function(_0x377825){if(!_0x377825)throw new Error(_0x9837('0x41'));_0x14a947=JSON[_0x9837('0x42')](_0x377825);var _0x4f0f9b=Buffer['from'](_0x380350[_0x9837('0x40')],_0x9837('0x43'))[_0x9837('0x44')](_0x9837('0x45'));_0x1fbf93=JSON[_0x9837('0x42')](_0x4f0f9b);if(!oauth[_0x9837('0x46')](_0x380350['id_token'],_0x14a947[_0x9837('0x47')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x380350[_0x9837('0x40')]);return oauth[_0x9837('0x48')](_0x380350['code'],_0x14a947);})[_0x9837('0x13')](function(_0x5a0a89){_0x14a947[_0x9837('0x49')]=_0x5a0a89[_0x9837('0x4a')];_0x14a947['data6']=_0x5a0a89[_0x9837('0x4b')];return db[_0x9837('0x18')][_0x9837('0x12')]({'data5':_0x14a947[_0x9837('0x49')],'data6':_0x14a947[_0x9837('0x4c')]},{'where':{'id':_0x14a947['id']}});})['then'](function(){oauth[_0x9837('0x4d')](_0x14a947);socket[_0x9837('0x4e')]('microsoftAuthorization:success',{'id':_0x1fbf93['id']});return;})[_0x9837('0x13')](respondWithStatusCode(_0x446353,null))[_0x9837('0x31')](function(_0x14d241){if(_0x1fbf93){socket[_0x9837('0x4e')](_0x9837('0x4f'),{'id':_0x1fbf93['id']});}if(!_0x14a947){logger['error'](_0x9837('0x50'),_0x14d241);return _0x446353[_0x9837('0xa')](0x1f4)[_0x9837('0x51')](_0x14d241['message']);}logger[_0x9837('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x14a947['id'],JSON[_0x9837('0x52')](_0x14d241));});};
\ No newline at end of file
+var _0x98da=['parse','base64','toString','ascii','isValidIdToken','id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','./cloudProvider.oauth','redis','defaults','socket.io-emitter','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','sendStatus','error','stack','name','padEnd','slice','index','CloudProvider','fieldName','type','model','query','keys','filters','attributes','length','hasOwnProperty','order','sort','filter','where','merge','map','options','findAll','service','MicrosoftAzure','decryptString','data3','show','params','rawAttributes','intersection','fields','includeAll','include','find','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter'];(function(_0x36aa01,_0x391ab1){var _0x1572df=function(_0x5354a2){while(--_0x5354a2){_0x36aa01['push'](_0x36aa01['shift']());}};_0x1572df(++_0x391ab1);}(_0x98da,0x127));var _0xa98d=function(_0x5e9bdc,_0x482b7e){_0x5e9bdc=_0x5e9bdc-0x0;var _0x50acab=_0x98da[_0x5e9bdc];return _0x50acab;};'use strict';var _=require(_0xa98d('0x0'));var Redis=require(_0xa98d('0x1'));var qs=require(_0xa98d('0x2'));var encryptor=require(_0xa98d('0x3'));var config=require('../../config/environment');var logger=require(_0xa98d('0x4'))(_0xa98d('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0xa98d('0x6'));config[_0xa98d('0x7')]=_[_0xa98d('0x8')](config[_0xa98d('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xa98d('0x9'))(new Redis(config[_0xa98d('0x7')]));var redis=new Redis(config[_0xa98d('0x7')]);function respondWithStatusCode(_0x4c9353,_0x500c32){_0x500c32=_0x500c32||0xcc;return function(_0x32d123){if(_0x32d123){return _0x4c9353['sendStatus'](_0x500c32);}return _0x4c9353[_0xa98d('0xa')](_0x500c32)[_0xa98d('0xb')]();};}function respondWithResult(_0x3b7114,_0x5ec0cd){_0x5ec0cd=_0x5ec0cd||0xc8;return function(_0x31441a){if(_0x31441a){return _0x3b7114[_0xa98d('0xa')](_0x5ec0cd)[_0xa98d('0xc')](_0x31441a);}};}function respondWithFilteredResult(_0x1074fa,_0x523280){return function(_0xb3e026){if(_0xb3e026){var _0x58df09=typeof _0x523280[_0xa98d('0xd')]===_0xa98d('0xe')&&typeof _0x523280['limit']==='undefined';var _0x242d46=_0xb3e026[_0xa98d('0xf')];var _0x3aa42=_0x58df09?0x0:_0x523280['offset'];var _0x3e1999=_0x58df09?_0xb3e026[_0xa98d('0xf')]:_0x523280['offset']+_0x523280[_0xa98d('0x10')];var _0x39ae4b;if(_0x3e1999>=_0x242d46){_0x3e1999=_0x242d46;_0x39ae4b=0xc8;}else{_0x39ae4b=0xce;}_0x1074fa[_0xa98d('0xa')](_0x39ae4b);return _0x1074fa['set'](_0xa98d('0x11'),_0x3aa42+'-'+_0x3e1999+'/'+_0x242d46)['json'](_0xb3e026);}return null;};}function saveUpdates(_0x5962b1){return function(_0x9965c0){if(_0x9965c0){return _0x9965c0[_0xa98d('0x12')](_0x5962b1)[_0xa98d('0x13')](function(_0x49b24d){return _0x49b24d;});}return null;};}function removeEntity(_0x469edf){return function(_0x20d661){if(_0x20d661){return _0x20d661[_0xa98d('0x14')]()[_0xa98d('0x13')](function(){_0x469edf[_0xa98d('0xa')](0xcc)[_0xa98d('0xb')]();});}};}function handleEntityNotFound(_0xb53014){return function(_0x4dbb83){if(!_0x4dbb83){_0xb53014[_0xa98d('0x15')](0x194);}return _0x4dbb83;};}function handleError(_0x41c52c,_0x54f733){_0x54f733=_0x54f733||0x1f4;return function(_0x3e610f){logger[_0xa98d('0x16')](_0x3e610f[_0xa98d('0x17')]);if(_0x3e610f[_0xa98d('0x18')]){delete _0x3e610f['name'];}_0x41c52c[_0xa98d('0xa')](_0x54f733)['send'](_0x3e610f);};}function maskClientSecret(_0x5a6be1){return _[_0xa98d('0x19')](_0x5a6be1[_0xa98d('0x1a')](0x0,0x3),0x14,'*');}exports[_0xa98d('0x1b')]=function(_0x508f9e,_0x5c0a6c){var _0x3c88bf={},_0x25ff75={},_0x2cd269={'count':0x0,'rows':[]};var _0x1ec02a=_['map'](db[_0xa98d('0x1c')]['rawAttributes'],function(_0x1e38e5){return{'name':_0x1e38e5[_0xa98d('0x1d')],'type':_0x1e38e5[_0xa98d('0x1e')]['key']};});_0x25ff75[_0xa98d('0x1f')]=_['map'](_0x1ec02a,'name');_0x25ff75[_0xa98d('0x20')]=_[_0xa98d('0x21')](_0x508f9e['query']);_0x25ff75[_0xa98d('0x22')]=_['intersection'](_0x25ff75[_0xa98d('0x1f')],_0x25ff75[_0xa98d('0x20')]);_0x3c88bf['attributes']=_['intersection'](_0x25ff75[_0xa98d('0x1f')],qs['fields'](_0x508f9e[_0xa98d('0x20')]['fields']));_0x3c88bf[_0xa98d('0x23')]=_0x3c88bf[_0xa98d('0x23')][_0xa98d('0x24')]?_0x3c88bf[_0xa98d('0x23')]:_0x25ff75[_0xa98d('0x1f')];if(!_0x508f9e['query'][_0xa98d('0x25')]('nolimit')){_0x3c88bf[_0xa98d('0x10')]=qs[_0xa98d('0x10')](_0x508f9e[_0xa98d('0x20')][_0xa98d('0x10')]);_0x3c88bf[_0xa98d('0xd')]=qs[_0xa98d('0xd')](_0x508f9e[_0xa98d('0x20')]['offset']);}_0x3c88bf[_0xa98d('0x26')]=qs[_0xa98d('0x27')](_0x508f9e[_0xa98d('0x20')][_0xa98d('0x27')]);_0x3c88bf['where']=qs['filters'](_['pick'](_0x508f9e[_0xa98d('0x20')],_0x25ff75[_0xa98d('0x22')]),_0x1ec02a);if(_0x508f9e['query'][_0xa98d('0x28')]){_0x3c88bf[_0xa98d('0x29')]=_[_0xa98d('0x2a')](_0x3c88bf[_0xa98d('0x29')],{'$or':_[_0xa98d('0x2b')](_0x1ec02a,function(_0x259864){if(_0x259864[_0xa98d('0x1e')]!=='VIRTUAL'){var _0x565460={};_0x565460[_0x259864[_0xa98d('0x18')]]={'$like':'%'+_0x508f9e[_0xa98d('0x20')][_0xa98d('0x28')]+'%'};return _0x565460;}})});}_0x3c88bf=_[_0xa98d('0x2a')]({},_0x3c88bf,_0x508f9e[_0xa98d('0x2c')]);var _0x47e9df={'where':_0x3c88bf['where']};return db[_0xa98d('0x1c')][_0xa98d('0xf')](_0x47e9df)['then'](function(_0x1a0c13){_0x2cd269[_0xa98d('0xf')]=_0x1a0c13;if(_0x508f9e['query']['includeAll']){_0x3c88bf['include']=[{'all':!![]}];}return db[_0xa98d('0x1c')][_0xa98d('0x2d')](_0x3c88bf);})['then'](function(_0x353021){_0x2cd269['rows']=_[_0xa98d('0x2b')](_0x353021,function(_0x505fae){if(_0x505fae[_0xa98d('0x2e')]===_0xa98d('0x2f')){var _0x18681f=encryptor[_0xa98d('0x30')](_0x505fae[_0xa98d('0x31')]);_0x505fae[_0xa98d('0x31')]=maskClientSecret(_0x18681f);}return _0x505fae;});return _0x2cd269;})[_0xa98d('0x13')](respondWithFilteredResult(_0x5c0a6c,_0x3c88bf))['catch'](handleError(_0x5c0a6c,null));};exports[_0xa98d('0x32')]=function(_0x29e1d6,_0x41533f){var _0x824972={'raw':!![],'where':{'id':_0x29e1d6[_0xa98d('0x33')]['id']}},_0x3e7513={};_0x3e7513[_0xa98d('0x1f')]=_[_0xa98d('0x21')](db[_0xa98d('0x1c')][_0xa98d('0x34')]);_0x3e7513['query']=_[_0xa98d('0x21')](_0x29e1d6[_0xa98d('0x20')]);_0x3e7513[_0xa98d('0x22')]=_['intersection'](_0x3e7513[_0xa98d('0x1f')],_0x3e7513['query']);_0x824972[_0xa98d('0x23')]=_[_0xa98d('0x35')](_0x3e7513[_0xa98d('0x1f')],qs['fields'](_0x29e1d6[_0xa98d('0x20')][_0xa98d('0x36')]));_0x824972[_0xa98d('0x23')]=_0x824972[_0xa98d('0x23')][_0xa98d('0x24')]?_0x824972['attributes']:_0x3e7513[_0xa98d('0x1f')];if(_0x29e1d6[_0xa98d('0x20')][_0xa98d('0x37')]){_0x824972[_0xa98d('0x38')]=[{'all':!![]}];}_0x824972=_[_0xa98d('0x2a')]({},_0x824972,_0x29e1d6[_0xa98d('0x2c')]);return db[_0xa98d('0x1c')][_0xa98d('0x39')](_0x824972)['then'](handleEntityNotFound(_0x41533f,null))['then'](function(_0x49b45f){if(_0x49b45f[_0xa98d('0x2e')]===_0xa98d('0x2f')){var _0x430de1=encryptor[_0xa98d('0x30')](_0x49b45f[_0xa98d('0x31')]);_0x49b45f['data3']=maskClientSecret(_0x430de1);}return _0x49b45f;})[_0xa98d('0x13')](respondWithResult(_0x41533f,null))[_0xa98d('0x3a')](handleError(_0x41533f,null));};exports[_0xa98d('0x3b')]=function(_0x57a20e,_0x5b4acb){if(!_0x57a20e[_0xa98d('0x3c')][_0xa98d('0x18')])throw new Error(_0xa98d('0x3d'));if(!_0x57a20e[_0xa98d('0x3c')][_0xa98d('0x2e')])throw new Error(_0xa98d('0x3e'));var _0x1a3c09=db['CloudProvider'][_0xa98d('0x34')]['service']['values'];if(!_0x1a3c09[_0xa98d('0x3f')](_0x57a20e[_0xa98d('0x3c')]['service']))throw new Error(_0xa98d('0x40')+_0x1a3c09['join'](',\x20'));if(_0x57a20e[_0xa98d('0x3c')][_0xa98d('0x2e')]===_0xa98d('0x2f')&&_0x57a20e[_0xa98d('0x3c')]['data3']){_0x57a20e['body'][_0xa98d('0x31')]=encryptor[_0xa98d('0x41')](_0x57a20e[_0xa98d('0x3c')]['data3']);}return db[_0xa98d('0x1c')][_0xa98d('0x3b')](_0x57a20e[_0xa98d('0x3c')],{})['then'](respondWithResult(_0x5b4acb,0xc9))[_0xa98d('0x3a')](handleError(_0x5b4acb,null));};exports['update']=function(_0x2ee3e5,_0x2a9020){if(_0x2ee3e5[_0xa98d('0x3c')]['id']){delete _0x2ee3e5[_0xa98d('0x3c')]['id'];}return db['CloudProvider'][_0xa98d('0x39')]({'where':{'id':_0x2ee3e5[_0xa98d('0x33')]['id']}})[_0xa98d('0x13')](handleEntityNotFound(_0x2a9020,null))[_0xa98d('0x13')](function(_0x9ff483){if(_0x9ff483[_0xa98d('0x2e')]===_0xa98d('0x2f')&&_0x2ee3e5[_0xa98d('0x3c')][_0xa98d('0x31')]){_0x2ee3e5[_0xa98d('0x3c')][_0xa98d('0x31')]=encryptor[_0xa98d('0x41')](_0x2ee3e5[_0xa98d('0x3c')][_0xa98d('0x31')]);}return _0x9ff483;})[_0xa98d('0x13')](saveUpdates(_0x2ee3e5[_0xa98d('0x3c')],null))[_0xa98d('0x13')](respondWithResult(_0x2a9020,null))[_0xa98d('0x3a')](handleError(_0x2a9020,null));};exports[_0xa98d('0x14')]=function(_0x19b16b,_0x498cf3){return db[_0xa98d('0x1c')]['find']({'where':{'id':_0x19b16b[_0xa98d('0x33')]['id']}})[_0xa98d('0x13')](handleEntityNotFound(_0x498cf3,null))['then'](removeEntity(_0x498cf3,null))[_0xa98d('0x3a')](handleError(_0x498cf3,null));};exports[_0xa98d('0x42')]=function(_0x57aa91,_0x4bd4b9){return db['CloudProvider'][_0xa98d('0x43')]({'where':{'id':_0x57aa91['params']['id']},'raw':!![]})['then'](function(_0x49f45a){if(!_0x49f45a)return _0x4bd4b9['sendStatus'](0x194);return{'url':oauth[_0xa98d('0x44')](_0x49f45a,_0x57aa91['user']['id'])};})[_0xa98d('0x13')](respondWithResult(_0x4bd4b9,null))[_0xa98d('0x3a')](handleError(_0x4bd4b9,null));};exports[_0xa98d('0x45')]=function(_0x51e5a8,_0x1d76d2){var _0x2d694b=_0x51e5a8[_0xa98d('0x3c')];var _0x259912;var _0x43099c;if(_0x2d694b[_0xa98d('0x16')])throw _0x2d694b;redis[_0xa98d('0x46')](_0x2d694b[_0xa98d('0x47')])['then'](function(_0x31d5b5){if(!_0x31d5b5)throw new Error(_0xa98d('0x48'));_0x259912=JSON[_0xa98d('0x49')](_0x31d5b5);var _0x2d24bb=Buffer['from'](_0x2d694b[_0xa98d('0x47')],_0xa98d('0x4a'))[_0xa98d('0x4b')](_0xa98d('0x4c'));_0x43099c=JSON[_0xa98d('0x49')](_0x2d24bb);if(!oauth[_0xa98d('0x4d')](_0x2d694b[_0xa98d('0x4e')],_0x259912['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xa98d('0x4f')](_0x2d694b[_0xa98d('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x2d694b[_0xa98d('0x50')],_0x259912);})['then'](function(_0x8f5a31){_0x259912[_0xa98d('0x51')]=_0x8f5a31[_0xa98d('0x52')];_0x259912[_0xa98d('0x53')]=_0x8f5a31[_0xa98d('0x54')];return db[_0xa98d('0x1c')]['update']({'data5':_0x259912[_0xa98d('0x51')],'data6':_0x259912[_0xa98d('0x53')]},{'where':{'id':_0x259912['id']}});})[_0xa98d('0x13')](function(){oauth[_0xa98d('0x55')](_0x259912);socket[_0xa98d('0x56')](_0xa98d('0x57'),{'id':_0x43099c['id']});return;})[_0xa98d('0x13')](respondWithStatusCode(_0x1d76d2,null))['catch'](function(_0xf9e059){if(_0x43099c){socket[_0xa98d('0x56')](_0xa98d('0x58'),{'id':_0x43099c['id']});}if(!_0x259912){logger[_0xa98d('0x16')](_0xa98d('0x59'),_0xf9e059);return _0x1d76d2[_0xa98d('0xa')](0x1f4)[_0xa98d('0x5a')](_0xf9e059[_0xa98d('0x5b')]);}logger[_0xa98d('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x259912['id'],JSON['stringify'](_0xf9e059));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 56d8399..45678d2 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 _0x97d0=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x97d0,0x11e));var _0x097d=function(_0x4f185e,_0x7b5772){_0x4f185e=_0x4f185e-0x0;var _0x1c520d=_0x97d0[_0x4f185e];return _0x1c520d;};'use strict';var _=require('lodash');var util=require(_0x097d('0x0'));var logger=require(_0x097d('0x1'))(_0x097d('0x2'));var moment=require('moment');var BPromise=require(_0x097d('0x3'));var rp=require(_0x097d('0x4'));var fs=require('fs');var path=require(_0x097d('0x5'));var rimraf=require(_0x097d('0x6'));var config=require('../../config/environment');var attributes=require(_0x097d('0x7'));module['exports']=function(_0x2c7285,_0x2af1cc){return _0x2c7285[_0x097d('0x8')](_0x097d('0x9'),attributes,{'tableName':_0x097d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaca7=['moment','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','../../config/logger','api'];(function(_0x32c4ef,_0x7d19c2){var _0x346e8d=function(_0x584cb7){while(--_0x584cb7){_0x32c4ef['push'](_0x32c4ef['shift']());}};_0x346e8d(++_0x7d19c2);}(_0xaca7,0xb1));var _0x7aca=function(_0x547978,_0x577770){_0x547978=_0x547978-0x0;var _0xeb6b1e=_0xaca7[_0x547978];return _0xeb6b1e;};'use strict';var _=require('lodash');var util=require(_0x7aca('0x0'));var logger=require(_0x7aca('0x1'))(_0x7aca('0x2'));var moment=require(_0x7aca('0x3'));var BPromise=require('bluebird');var rp=require(_0x7aca('0x4'));var fs=require('fs');var path=require(_0x7aca('0x5'));var rimraf=require(_0x7aca('0x6'));var config=require('../../config/environment');var attributes=require(_0x7aca('0x7'));module[_0x7aca('0x8')]=function(_0xc81810,_0x5ea95e){return _0xc81810[_0x7aca('0x9')](_0x7aca('0xa'),attributes,{'tableName':_0x7aca('0xb'),'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 d5a0433..8e4c3e9 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 _0x7948=['prompt','login','replace','oauth2/','set','decode','payload','iss','issuer','aud','isAfter','exp','then','CloudProvider','findOne','data6','decryptString','data3','POST','data5','access_token','refresh_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce'];(function(_0x2c8a6b,_0x6bf01){var _0x261354=function(_0x5255a1){while(--_0x5255a1){_0x2c8a6b['push'](_0x2c8a6b['shift']());}};_0x261354(++_0x6bf01);}(_0x7948,0x118));var _0x8794=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x7948[_0x2ca2d0];return _0x521c23;};'use strict';var _=require('lodash');var crypto=require(_0x8794('0x0'));var jwt=require(_0x8794('0x1'));var moment=require(_0x8794('0x2'));var Redis=require(_0x8794('0x3'));var rp=require(_0x8794('0x4'));var util=require(_0x8794('0x5'));var encryptor=require(_0x8794('0x6'));var config=require(_0x8794('0x7'));var logger=require(_0x8794('0x8'))(_0x8794('0x9'));var schedule=require(_0x8794('0xa'));var db=require(_0x8794('0xb'))['db'];config[_0x8794('0xc')]=_[_0x8794('0xd')](config[_0x8794('0xc')],{'host':_0x8794('0xe'),'port':0x18eb});var redis=new Redis(config[_0x8794('0xc')]);var MICROSOFT_AUTH_URL=_0x8794('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8794('0x10'),_0x8794('0x11'),_0x8794('0x12'),_0x8794('0x13'),_0x8794('0x14'),_0x8794('0x15'),_0x8794('0x16')],'Dynamics365':[_0x8794('0x10'),_0x8794('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x8794('0x17');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5616ad){var _0x2d1647=_[_0x8794('0x18')](AZURE_AUTH_SCOPES[_0x5616ad[_0x8794('0x19')]]);if(_0x5616ad[_0x8794('0x19')]===_0x8794('0x1a'))_0x2d1647[_0x8794('0x1b')](_0x5616ad[_0x8794('0x1c')]+_0x8794('0x1d'));return _0x2d1647[_0x8794('0x1e')]('\x20');}function getAccessTokenScope(_0x586cea){if(_0x586cea[_0x8794('0x19')]===_0x8794('0x1f'))return _0x8794('0x14');if(_0x586cea[_0x8794('0x19')]==='Dynamics365')return _0x586cea[_0x8794('0x1c')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0xc52a20,_0x57b927){var _0x19a6ef=MICROSOFT_AUTH_URL['replace'](_0x8794('0x20'),_0xc52a20[_0x8794('0x21')]);var _0x3ce16a=[_0x8794('0x22'),_0x8794('0x23')];var _0x3a3ed6=Buffer[_0x8794('0x24')](JSON[_0x8794('0x25')]({'id':_0x57b927}))[_0x8794('0x26')](_0x8794('0x27'));var _0x364015=crypto[_0x8794('0x28')](0x10)['toString'](_0x8794('0x29'));var _0x58b47c=getAuthorizationScopes(_0xc52a20);var _0x427ff4=[{'key':_0x8794('0x2a'),'value':_0xc52a20[_0x8794('0x2b')]},{'key':_0x8794('0x2c'),'value':encodeURIComponent(_0x3ce16a['join']('\x20'))},{'key':_0x8794('0x2d'),'value':_0xc52a20[_0x8794('0x2e')]},{'key':_0x8794('0x2f'),'value':_0x8794('0x30')},{'key':_0x8794('0x31'),'value':encodeURIComponent(_0x58b47c)},{'key':_0x8794('0x32'),'value':_0x3a3ed6},{'key':_0x8794('0x33'),'value':_0x364015},{'key':_0x8794('0x34'),'value':_0x8794('0x35')}];var _0x4f8081=_0x19a6ef+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8794('0x18')](_0x427ff4,function(_0x76b8bc){return _0x76b8bc['key']+'='+_0x76b8bc['value'];})[_0x8794('0x1e')]('&');_0xc52a20['oauth2Claims']={'issuer':_0x19a6ef[_0x8794('0x36')](_0x8794('0x37'),''),'audience':_0xc52a20['data1'],'state':_0x3a3ed6,'nonce':_0x364015};redis[_0x8794('0x38')](_0x3a3ed6,JSON['stringify'](_0xc52a20));return _0x4f8081;}function isValidIdToken(_0x47db52,_0x527932){try{var _0x3fecd2=jwt[_0x8794('0x39')](_0x47db52,{'complete':!![]});var _0x2f1f30=_0x3fecd2[_0x8794('0x3a')];if(_0x2f1f30[_0x8794('0x3b')]!==_0x527932[_0x8794('0x3c')])return![];if(_0x2f1f30[_0x8794('0x3d')]!==_0x527932['audience'])return![];if(_0x2f1f30['nonce']!==_0x527932[_0x8794('0x33')])return![];if(moment()[_0x8794('0x3e')](moment['unix'](_0x2f1f30[_0x8794('0x3f')])))return![];return!![];}catch(_0x161cdd){throw _0x161cdd;}}function refreshOauth2MicrosoftAccessToken(_0x2445b2){return Promise['resolve']()[_0x8794('0x40')](function(){if(_0x2445b2['data3'])return _0x2445b2;return db[_0x8794('0x41')][_0x8794('0x42')]({'where':{'id':_0x2445b2['id']},'raw':!![]});})[_0x8794('0x40')](function(_0x4e7f5a){var _0x2895d5={'grant_type':'refresh_token','refresh_token':_0x4e7f5a[_0x8794('0x43')],'scope':getAccessTokenScope(_0x4e7f5a),'redirect_uri':_0x4e7f5a[_0x8794('0x2e')],'client_id':_0x4e7f5a[_0x8794('0x2b')],'client_secret':encryptor[_0x8794('0x44')](_0x4e7f5a[_0x8794('0x45')])};var _0xd15bc7={'method':_0x8794('0x46'),'uri':MICROSOFT_AUTH_URL[_0x8794('0x36')](_0x8794('0x20'),_0x4e7f5a[_0x8794('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2895d5,'json':!![]};return rp(_0xd15bc7);})[_0x8794('0x40')](function(_0x14ff85){_0x2445b2[_0x8794('0x47')]=_0x14ff85[_0x8794('0x48')];_0x2445b2['data6']=_0x14ff85[_0x8794('0x49')];return db[_0x8794('0x41')][_0x8794('0x4a')]({'data5':_0x2445b2['data5'],'data6':_0x2445b2[_0x8794('0x43')]},{'where':{'id':_0x2445b2['id']}});})[_0x8794('0x40')](function(){return _0x2445b2;})[_0x8794('0x4b')](function(_0x2417d0){logger['error'](_0x8794('0x4c'),_0x2445b2['id'],_0x2417d0);});}function getOauth2MicrosoftAccessToken(_0x4f2ee0,_0x4f1b76){var _0x395b31={'grant_type':_0x8794('0x4d'),'code':_0x4f2ee0,'scope':getAccessTokenScope(_0x4f1b76),'redirect_uri':_0x4f1b76[_0x8794('0x2e')],'client_id':_0x4f1b76[_0x8794('0x2b')],'client_secret':encryptor[_0x8794('0x44')](_0x4f1b76['data3'])};var _0x8d0493={'method':_0x8794('0x46'),'uri':MICROSOFT_AUTH_URL['replace'](_0x8794('0x20'),_0x4f1b76[_0x8794('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x395b31,'json':!![]};return rp(_0x8d0493);}function startRefreshInterval(_0x337aac){var _0x10aa8e=schedule['intervals'];if(_0x10aa8e[_0x337aac['id']])clearInterval(_0x10aa8e[_0x337aac['id']]);_0x10aa8e[_0x337aac['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x337aac['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8794('0x4e')]=_0x10aa8e;}function startAllRefreshIntervals(){return db[_0x8794('0x41')][_0x8794('0x4f')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8794('0x40')](function(_0xd2df9b){var _0x23a809=_0xd2df9b[_0x8794('0x18')](function(_0x50aa56){return refreshOauth2MicrosoftAccessToken(_0x50aa56)[_0x8794('0x40')](function(_0x1ab116){startRefreshInterval(_0x1ab116);});});return Promise[_0x8794('0x50')](_0x23a809);})[_0x8794('0x4b')](function(_0x4f49b3){var _0x3c74d5=_0x4f49b3?util['inspect'](_0x4f49b3,{'showHidden':![],'depth':null}):'';logger['error'](_0x8794('0x51'),_0x3c74d5);});}module[_0x8794('0x52')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x4f88=['replace','oauth2/','set','decode','aud','audience','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','data4','decryptString','data2','data5','access_token','refresh_token','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','push','data7','join','Outlook365','Dynamics365','/.default','{TENANT_ID}','code','id_token','from','stringify','toString','base64','randomBytes','hex','data1','redirect_uri','form_post','state','nonce','login','map','key','value'];(function(_0x16c447,_0x4a1499){var _0x9ad404=function(_0x5ebafe){while(--_0x5ebafe){_0x16c447['push'](_0x16c447['shift']());}};_0x9ad404(++_0x4a1499);}(_0x4f88,0x6c));var _0x84f8=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0x4f88[_0x1ee0a1];return _0x1d2d5b;};'use strict';var _=require('lodash');var crypto=require(_0x84f8('0x0'));var jwt=require(_0x84f8('0x1'));var moment=require(_0x84f8('0x2'));var Redis=require(_0x84f8('0x3'));var rp=require(_0x84f8('0x4'));var util=require(_0x84f8('0x5'));var encryptor=require(_0x84f8('0x6'));var config=require(_0x84f8('0x7'));var logger=require(_0x84f8('0x8'))(_0x84f8('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x84f8('0xa'))['db'];config[_0x84f8('0xb')]=_[_0x84f8('0xc')](config['redis'],{'host':_0x84f8('0xd'),'port':0x18eb});var redis=new Redis(config[_0x84f8('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x84f8('0xe'),'profile',_0x84f8('0xf'),_0x84f8('0x10'),_0x84f8('0x11'),_0x84f8('0x12'),_0x84f8('0x13')],'Dynamics365':[_0x84f8('0xe'),_0x84f8('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x84f8('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x278109){var _0x31b276=_['map'](AZURE_AUTH_SCOPES[_0x278109[_0x84f8('0x15')]]);if(_0x278109[_0x84f8('0x15')]==='Dynamics365')_0x31b276[_0x84f8('0x16')](_0x278109[_0x84f8('0x17')]+'/.default');return _0x31b276[_0x84f8('0x18')]('\x20');}function getAccessTokenScope(_0x2e36d6){if(_0x2e36d6['type']===_0x84f8('0x19'))return _0x84f8('0x11');if(_0x2e36d6[_0x84f8('0x15')]===_0x84f8('0x1a'))return _0x2e36d6[_0x84f8('0x17')]+_0x84f8('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3ac957,_0x4e1bf6){var _0x2d5da4=MICROSOFT_AUTH_URL['replace'](_0x84f8('0x1c'),_0x3ac957['data2']);var _0x32ea83=[_0x84f8('0x1d'),_0x84f8('0x1e')];var _0x3ba7ff=Buffer[_0x84f8('0x1f')](JSON[_0x84f8('0x20')]({'id':_0x4e1bf6}))[_0x84f8('0x21')](_0x84f8('0x22'));var _0x2b955c=crypto[_0x84f8('0x23')](0x10)['toString'](_0x84f8('0x24'));var _0x44f051=getAuthorizationScopes(_0x3ac957);var _0x503138=[{'key':'client_id','value':_0x3ac957[_0x84f8('0x25')]},{'key':'response_type','value':encodeURIComponent(_0x32ea83[_0x84f8('0x18')]('\x20'))},{'key':_0x84f8('0x26'),'value':_0x3ac957['data4']},{'key':'response_mode','value':_0x84f8('0x27')},{'key':'scope','value':encodeURIComponent(_0x44f051)},{'key':_0x84f8('0x28'),'value':_0x3ba7ff},{'key':_0x84f8('0x29'),'value':_0x2b955c},{'key':'prompt','value':_0x84f8('0x2a')}];var _0x1f3635=_0x2d5da4+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x84f8('0x2b')](_0x503138,function(_0x423f90){return _0x423f90[_0x84f8('0x2c')]+'='+_0x423f90[_0x84f8('0x2d')];})[_0x84f8('0x18')]('&');_0x3ac957['oauth2Claims']={'issuer':_0x2d5da4[_0x84f8('0x2e')](_0x84f8('0x2f'),''),'audience':_0x3ac957['data1'],'state':_0x3ba7ff,'nonce':_0x2b955c};redis[_0x84f8('0x30')](_0x3ba7ff,JSON[_0x84f8('0x20')](_0x3ac957));return _0x1f3635;}function isValidIdToken(_0x39c686,_0x105ab4){try{var _0x430558=jwt[_0x84f8('0x31')](_0x39c686,{'complete':!![]});var _0xd3a5f4=_0x430558['payload'];if(_0xd3a5f4['iss']!==_0x105ab4['issuer'])return![];if(_0xd3a5f4[_0x84f8('0x32')]!==_0x105ab4[_0x84f8('0x33')])return![];if(_0xd3a5f4[_0x84f8('0x29')]!==_0x105ab4[_0x84f8('0x29')])return![];if(moment()['isAfter'](moment[_0x84f8('0x34')](_0xd3a5f4[_0x84f8('0x35')])))return![];return!![];}catch(_0xb74e4){throw _0xb74e4;}}function refreshOauth2MicrosoftAccessToken(_0x3da133){return Promise[_0x84f8('0x36')]()[_0x84f8('0x37')](function(){if(_0x3da133[_0x84f8('0x38')])return _0x3da133;return db[_0x84f8('0x39')][_0x84f8('0x3a')]({'where':{'id':_0x3da133['id']},'raw':!![]});})[_0x84f8('0x37')](function(_0x3da734){var _0x147c36={'grant_type':'refresh_token','refresh_token':_0x3da734[_0x84f8('0x3b')],'scope':getAccessTokenScope(_0x3da734),'redirect_uri':_0x3da734[_0x84f8('0x3c')],'client_id':_0x3da734['data1'],'client_secret':encryptor[_0x84f8('0x3d')](_0x3da734[_0x84f8('0x38')])};var _0xc97aad={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x84f8('0x2e')](_0x84f8('0x1c'),_0x3da734[_0x84f8('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x147c36,'json':!![]};return rp(_0xc97aad);})[_0x84f8('0x37')](function(_0x17c145){_0x3da133[_0x84f8('0x3f')]=_0x17c145[_0x84f8('0x40')];_0x3da133['data6']=_0x17c145[_0x84f8('0x41')];return db[_0x84f8('0x39')][_0x84f8('0x42')]({'data5':_0x3da133[_0x84f8('0x3f')],'data6':_0x3da133[_0x84f8('0x3b')]},{'where':{'id':_0x3da133['id']}});})[_0x84f8('0x37')](function(){return _0x3da133;})['catch'](function(_0x335685){logger['error'](_0x84f8('0x43'),_0x3da133['id'],_0x335685);});}function getOauth2MicrosoftAccessToken(_0x406022,_0x441d48){var _0x8aa3ca={'grant_type':_0x84f8('0x44'),'code':_0x406022,'scope':getAccessTokenScope(_0x441d48),'redirect_uri':_0x441d48[_0x84f8('0x3c')],'client_id':_0x441d48['data1'],'client_secret':encryptor[_0x84f8('0x3d')](_0x441d48[_0x84f8('0x38')])};var _0x21d824={'method':_0x84f8('0x45'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x441d48[_0x84f8('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x8aa3ca,'json':!![]};return rp(_0x21d824);}function startRefreshInterval(_0x1f8bbe){var _0x1d5daf=schedule[_0x84f8('0x46')];if(_0x1d5daf[_0x1f8bbe['id']])clearInterval(_0x1d5daf[_0x1f8bbe['id']]);_0x1d5daf[_0x1f8bbe['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x84f8('0x47')](this,{'id':_0x1f8bbe['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x84f8('0x46')]=_0x1d5daf;}function startAllRefreshIntervals(){return db[_0x84f8('0x39')][_0x84f8('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x84f8('0x37')](function(_0x50bfbc){var _0x5c5980=_0x50bfbc['map'](function(_0x507c89){return refreshOauth2MicrosoftAccessToken(_0x507c89)[_0x84f8('0x37')](function(_0x43b341){startRefreshInterval(_0x43b341);});});return Promise[_0x84f8('0x49')](_0x5c5980);})['catch'](function(_0x156151){var _0x4289fb=_0x156151?util[_0x84f8('0x4a')](_0x156151,{'showHidden':![],'depth':null}):'';logger[_0x84f8('0x4b')](_0x84f8('0x4c'),_0x4289fb);});}module['exports']={'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 9c1ce23..027e3e4 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 _0x0c6b=['error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4aecfa,_0x28c3bd){var _0x3659d0=function(_0x1e96ce){while(--_0x1e96ce){_0x4aecfa['push'](_0x4aecfa['shift']());}};_0x3659d0(++_0x28c3bd);}(_0x0c6b,0x1bc));var _0xb0c6=function(_0x387005,_0x31fb09){_0x387005=_0x387005-0x0;var _0x475762=_0x0c6b[_0x387005];return _0x475762;};'use strict';var _=require(_0xb0c6('0x0'));var util=require('util');var moment=require(_0xb0c6('0x1'));var BPromise=require(_0xb0c6('0x2'));var rs=require(_0xb0c6('0x3'));var fs=require('fs');var Redis=require(_0xb0c6('0x4'));var db=require(_0xb0c6('0x5'))['db'];var utils=require(_0xb0c6('0x6'));var logger=require(_0xb0c6('0x7'))(_0xb0c6('0x8'));var config=require(_0xb0c6('0x9'));var jayson=require(_0xb0c6('0xa'));var client=jayson[_0xb0c6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x590ef9,_0x5ec174,_0x4e1245){return new BPromise(function(_0x3f18bd,_0x1be8bd){return client['request'](_0x590ef9,_0x4e1245)['then'](function(_0x2beb18){logger[_0xb0c6('0xc')](_0xb0c6('0xd'),_0x5ec174,_0xb0c6('0xe'));logger[_0xb0c6('0xf')](_0xb0c6('0x10'),_0x5ec174,_0xb0c6('0xe'),JSON[_0xb0c6('0x11')](_0x2beb18));if(_0x2beb18['error']){if(_0x2beb18[_0xb0c6('0x12')]['code']===0x1f4){logger[_0xb0c6('0x12')](_0xb0c6('0xd'),_0x5ec174,_0x2beb18[_0xb0c6('0x12')]['message']);return _0x1be8bd(_0x2beb18[_0xb0c6('0x12')][_0xb0c6('0x13')]);}logger[_0xb0c6('0x12')](_0xb0c6('0xd'),_0x5ec174,_0x2beb18[_0xb0c6('0x12')][_0xb0c6('0x13')]);return _0x3f18bd(_0x2beb18[_0xb0c6('0x12')][_0xb0c6('0x13')]);}else{logger['info'](_0xb0c6('0xd'),_0x5ec174,_0xb0c6('0xe'));_0x3f18bd(_0x2beb18[_0xb0c6('0x14')][_0xb0c6('0x13')]);}})['catch'](function(_0x19a09e){logger[_0xb0c6('0x12')](_0xb0c6('0xd'),_0x5ec174,_0x19a09e);_0x1be8bd(_0x19a09e);});});}
\ No newline at end of file
+var _0x09df=['rpc','../../config/environment','request','then','info','request\x20sent','debug','error','code','CloudProvider,\x20%s,\x20%s','message','lodash','util','bluebird','../../mysqldb'];(function(_0x3a13f0,_0xdfd8dd){var _0x5a4a5d=function(_0x503848){while(--_0x503848){_0x3a13f0['push'](_0x3a13f0['shift']());}};_0x5a4a5d(++_0xdfd8dd);}(_0x09df,0x164));var _0xf09d=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x09df[_0x5c3ae9];return _0x3f5950;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x284a42,_0x48b82f,_0x28c91c){return new BPromise(function(_0x2555c7,_0x2f1810){return client[_0xf09d('0x6')](_0x284a42,_0x28c91c)[_0xf09d('0x7')](function(_0x2a59a8){logger[_0xf09d('0x8')]('CloudProvider,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'));logger[_0xf09d('0xa')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'),JSON['stringify'](_0x2a59a8));if(_0x2a59a8[_0xf09d('0xb')]){if(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xc')]===0x1f4){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2f1810(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);}logger['error'](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2555c7(_0x2a59a8['error']['message']);}else{logger[_0xf09d('0x8')](_0xf09d('0xd'),_0x48b82f,_0xf09d('0x9'));_0x2555c7(_0x2a59a8['result'][_0xf09d('0xe')]);}})['catch'](function(_0x3614f7){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x3614f7);_0x2f1810(_0x3614f7);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index b63b671..fd300ac 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(_0x4ddbc7,_0x184ce8){var _0x376551=function(_0x5373db){while(--_0x5373db){_0x4ddbc7['push'](_0x4ddbc7['shift']());}};_0x376551(++_0x184ce8);}(_0xdb28,0x106));var _0x8db2=function(_0x5119bf,_0x4e147e){_0x5119bf=_0x5119bf-0x0;var _0x4f2df7=_0xdb28[_0x5119bf];return _0x4f2df7;};'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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x554eac,_0x3d8f56){var _0x8d1cde=function(_0x5d9f9b){while(--_0x5d9f9b){_0x554eac['push'](_0x554eac['shift']());}};_0x8d1cde(++_0x3d8f56);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index ce6acf9..731e92d 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 _0xc69b=['sequelize','exports','STRING'];(function(_0x40221e,_0x1a8b60){var _0x46fa3a=function(_0x59f108){while(--_0x59f108){_0x40221e['push'](_0x40221e['shift']());}};_0x46fa3a(++_0x1a8b60);}(_0xc69b,0x14a));var _0xbc69=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xc69b[_0x377a6e];return _0x37f751;};'use strict';var Sequelize=require(_0xbc69('0x0'));module[_0xbc69('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbc69('0x2')]},'companyId':{'type':Sequelize[_0xbc69('0x2')]},'website':{'type':Sequelize[_0xbc69('0x2')]},'phone':{'type':Sequelize[_0xbc69('0x2')]},'fax':{'type':Sequelize[_0xbc69('0x2')]},'type':{'type':Sequelize[_0xbc69('0x2')]},'street':{'type':Sequelize[_0xbc69('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbc69('0x2')]},'email':{'type':Sequelize[_0xbc69('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbc69('0x2')]},'sStreet':{'type':Sequelize[_0xbc69('0x2')]},'sPostalCode':{'type':Sequelize[_0xbc69('0x2')]},'sCity':{'type':Sequelize[_0xbc69('0x2')]},'sCountry':{'type':Sequelize[_0xbc69('0x2')]},'description':{'type':Sequelize[_0xbc69('0x2')]}};
\ No newline at end of file
+var _0xf881=['sequelize','exports','STRING'];(function(_0x5cc2b2,_0x58d5c0){var _0x343d7f=function(_0x4fc480){while(--_0x4fc480){_0x5cc2b2['push'](_0x5cc2b2['shift']());}};_0x343d7f(++_0x58d5c0);}(_0xf881,0x9f));var _0x1f88=function(_0x55af0d,_0x5db5c9){_0x55af0d=_0x55af0d-0x0;var _0x245085=_0xf881[_0x55af0d];return _0x245085;};'use strict';var Sequelize=require(_0x1f88('0x0'));module[_0x1f88('0x1')]={'name':{'type':Sequelize[_0x1f88('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1f88('0x2')]},'companyId':{'type':Sequelize[_0x1f88('0x2')]},'website':{'type':Sequelize[_0x1f88('0x2')]},'phone':{'type':Sequelize[_0x1f88('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1f88('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1f88('0x2')]},'city':{'type':Sequelize[_0x1f88('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1f88('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1f88('0x2')]},'sStreet':{'type':Sequelize[_0x1f88('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x1f88('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 5bdb302..10ee9a2 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 _0xf710=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','role','user','autoAssociation','body','describe','addContacts','CmContact','getContacts','pick','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x126f0c,_0x47d74c){var _0x1adcce=function(_0x473897){while(--_0x473897){_0x126f0c['push'](_0x126f0c['shift']());}};_0x1adcce(++_0x47d74c);}(_0xf710,0xfc));var _0x0f71=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf710[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x0f71('0x0'));var rimraf=require(_0x0f71('0x1'));var zipdir=require(_0x0f71('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f71('0x3'));var moment=require(_0x0f71('0x4'));var BPromise=require(_0x0f71('0x5'));var Mustache=require(_0x0f71('0x6'));var util=require(_0x0f71('0x7'));var path=require(_0x0f71('0x8'));var sox=require('sox');var csv=require(_0x0f71('0x9'));var ejs=require(_0x0f71('0xa'));var fs=require('fs');var fs_extra=require(_0x0f71('0xb'));var _=require(_0x0f71('0xc'));var squel=require(_0x0f71('0xd'));var crypto=require(_0x0f71('0xe'));var jsforce=require(_0x0f71('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0f71('0x9'));var querystring=require(_0x0f71('0x10'));var Papa=require(_0x0f71('0x11'));var Redis=require(_0x0f71('0x12'));var authService=require(_0x0f71('0x13'));var qs=require(_0x0f71('0x14'));var as=require(_0x0f71('0x15'));var hardwareService=require(_0x0f71('0x16'));var logger=require(_0x0f71('0x17'))(_0x0f71('0x18'));var utils=require(_0x0f71('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0f71('0x1a'));var db=require(_0x0f71('0x1b'))['db'];function respondWithStatusCode(_0x35f449,_0x3cac93){_0x3cac93=_0x3cac93||0xcc;return function(_0x110801){if(_0x110801){return _0x35f449[_0x0f71('0x1c')](_0x3cac93);}return _0x35f449[_0x0f71('0x1d')](_0x3cac93)[_0x0f71('0x1e')]();};}function respondWithResult(_0x1901db,_0x45495d){_0x45495d=_0x45495d||0xc8;return function(_0x5265e8){if(_0x5265e8){return _0x1901db[_0x0f71('0x1d')](_0x45495d)[_0x0f71('0x1f')](_0x5265e8);}};}function respondWithFilteredResult(_0x284aff,_0x1e1621){return function(_0xdf89ba){if(_0xdf89ba){var _0x37e158=typeof _0x1e1621['offset']===_0x0f71('0x20')&&typeof _0x1e1621[_0x0f71('0x21')]==='undefined';var _0x534cdb=_0xdf89ba[_0x0f71('0x22')];var _0x43509f=_0x37e158?0x0:_0x1e1621[_0x0f71('0x23')];var _0x49e2c7=_0x37e158?_0xdf89ba['count']:_0x1e1621[_0x0f71('0x23')]+_0x1e1621[_0x0f71('0x21')];var _0x265be0;if(_0x49e2c7>=_0x534cdb){_0x49e2c7=_0x534cdb;_0x265be0=0xc8;}else{_0x265be0=0xce;}_0x284aff['status'](_0x265be0);return _0x284aff['set']('Content-Range',_0x43509f+'-'+_0x49e2c7+'/'+_0x534cdb)[_0x0f71('0x1f')](_0xdf89ba);}return null;};}function patchUpdates(_0x422877){return function(_0x1d0d46){try{jsonpatch[_0x0f71('0x24')](_0x1d0d46,_0x422877,!![]);}catch(_0x5ba809){return BPromise[_0x0f71('0x25')](_0x5ba809);}return _0x1d0d46[_0x0f71('0x26')]();};}function saveUpdates(_0x5671c9,_0xcda3af){return function(_0x3e4e86){if(_0x3e4e86){return _0x3e4e86[_0x0f71('0x27')](_0x5671c9)[_0x0f71('0x28')](function(_0x4c2031){return _0x4c2031;});}return null;};}function removeEntity(_0x519968,_0x35aa84){return function(_0x2f7c2f){if(_0x2f7c2f){return _0x2f7c2f[_0x0f71('0x29')]()[_0x0f71('0x28')](function(){var _0x5d7fef=_0x2f7c2f[_0x0f71('0x2a')]({'plain':!![]});var _0x43e36b=_0x0f71('0x2b');return db[_0x0f71('0x2c')][_0x0f71('0x29')]({'where':{'type':_0x43e36b,'resourceId':_0x5d7fef['id']}})['then'](function(){return _0x2f7c2f;});})[_0x0f71('0x28')](function(){_0x519968['status'](0xcc)[_0x0f71('0x1e')]();});}};}function handleEntityNotFound(_0x3fef22,_0x39ec16){return function(_0x48c082){if(!_0x48c082){_0x3fef22['sendStatus'](0x194);}return _0x48c082;};}function handleError(_0x3c545d,_0x352c74){_0x352c74=_0x352c74||0x1f4;return function(_0x2d89f1){logger[_0x0f71('0x2d')](_0x2d89f1[_0x0f71('0x2e')]);if(_0x2d89f1[_0x0f71('0x2f')]){delete _0x2d89f1[_0x0f71('0x2f')];}_0x3c545d[_0x0f71('0x1d')](_0x352c74)[_0x0f71('0x30')](_0x2d89f1);};}exports[_0x0f71('0x31')]=function(_0x402b20,_0x15aa1c){var _0x45d68f={},_0x4d4cab={},_0x3af2ac={'count':0x0,'rows':[]};return db[_0x0f71('0x32')]['describe']()['then'](function(_0xf1a1f7){_0x4d4cab['model']=_[_0x0f71('0x33')](_0xf1a1f7);_0x4d4cab[_0x0f71('0x34')]=_['keys'](_0x402b20[_0x0f71('0x34')]);_0x4d4cab[_0x0f71('0x35')]=_[_0x0f71('0x36')](_0x4d4cab[_0x0f71('0x37')],_0x4d4cab['query']);_0x45d68f[_0x0f71('0x38')]=_[_0x0f71('0x36')](_0x4d4cab[_0x0f71('0x37')],qs[_0x0f71('0x39')](_0x402b20[_0x0f71('0x34')][_0x0f71('0x39')]));_0x45d68f['attributes']=_0x45d68f[_0x0f71('0x38')][_0x0f71('0x3a')]?_0x45d68f[_0x0f71('0x38')]:_0x4d4cab['model'];if(!_0x402b20[_0x0f71('0x34')][_0x0f71('0x3b')](_0x0f71('0x3c'))){_0x45d68f[_0x0f71('0x21')]=qs[_0x0f71('0x21')](_0x402b20[_0x0f71('0x34')]['limit']);_0x45d68f['offset']=qs[_0x0f71('0x23')](_0x402b20[_0x0f71('0x34')][_0x0f71('0x23')]);}_0x45d68f[_0x0f71('0x3d')]=qs[_0x0f71('0x3e')](_0x402b20[_0x0f71('0x34')]['sort']);_0x45d68f[_0x0f71('0x3f')]=qs['filters'](_['pick'](_0x402b20[_0x0f71('0x34')],_0x4d4cab[_0x0f71('0x35')]),_0xf1a1f7);if(_0x402b20[_0x0f71('0x34')][_0x0f71('0x40')]){_0x45d68f[_0x0f71('0x3f')]=_[_0x0f71('0x41')](_0x45d68f[_0x0f71('0x3f')],{'$or':_[_0x0f71('0x42')](_0x45d68f[_0x0f71('0x38')],function(_0x5cbcf0){var _0x5cc979={};_0x5cc979[_0x5cbcf0]={'$like':'%'+_0x402b20['query'][_0x0f71('0x40')]+'%'};return _0x5cc979;})});}_0x45d68f=_[_0x0f71('0x41')]({},_0x45d68f,_0x402b20['options']);var _0x5e48ce={'where':_0x45d68f[_0x0f71('0x3f')]};return db[_0x0f71('0x32')][_0x0f71('0x22')](_0x5e48ce)['then'](function(_0x4c36b2){_0x3af2ac[_0x0f71('0x22')]=_0x4c36b2;if(_0x402b20[_0x0f71('0x34')][_0x0f71('0x43')]){_0x45d68f['include']=[{'all':!![]}];}return db[_0x0f71('0x32')][_0x0f71('0x44')](_0x45d68f);})[_0x0f71('0x28')](function(_0x45ca39){_0x3af2ac[_0x0f71('0x45')]=_0x45ca39;return _0x3af2ac;})[_0x0f71('0x28')](respondWithFilteredResult(_0x15aa1c,_0x45d68f))['catch'](handleError(_0x15aa1c,null));})[_0x0f71('0x46')](handleError(_0x15aa1c,null));};exports[_0x0f71('0x47')]=function(_0x4d8d6e,_0x3ac8a0){var _0x19b989={'raw':![],'where':{'id':_0x4d8d6e[_0x0f71('0x48')]['id']}},_0x2b8090={};_0x2b8090[_0x0f71('0x37')]=_[_0x0f71('0x33')](db[_0x0f71('0x32')][_0x0f71('0x49')]);_0x2b8090[_0x0f71('0x34')]=_[_0x0f71('0x33')](_0x4d8d6e[_0x0f71('0x34')]);_0x2b8090[_0x0f71('0x35')]=_[_0x0f71('0x36')](_0x2b8090['model'],_0x2b8090[_0x0f71('0x34')]);_0x19b989['attributes']=_[_0x0f71('0x36')](_0x2b8090['model'],qs[_0x0f71('0x39')](_0x4d8d6e[_0x0f71('0x34')]['fields']));_0x19b989[_0x0f71('0x38')]=_0x19b989[_0x0f71('0x38')]['length']?_0x19b989[_0x0f71('0x38')]:_0x2b8090[_0x0f71('0x37')];if(_0x4d8d6e[_0x0f71('0x34')]['includeAll']){_0x19b989[_0x0f71('0x4a')]=[{'all':!![]}];}_0x19b989=_[_0x0f71('0x41')]({},_0x19b989,_0x4d8d6e[_0x0f71('0x4b')]);return db['CmCompany'][_0x0f71('0x4c')](_0x19b989)[_0x0f71('0x28')](handleEntityNotFound(_0x3ac8a0,null))['then'](respondWithResult(_0x3ac8a0,null))['catch'](handleError(_0x3ac8a0,null));};exports[_0x0f71('0x4d')]=function(_0x5c21d1,_0x11c254){return db[_0x0f71('0x32')]['create'](_0x5c21d1['body'],{})[_0x0f71('0x28')](function(_0xa3719b){var _0x265dd2=_0x5c21d1['user']['get']({'plain':!![]});if(!_0x265dd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x265dd2[_0x0f71('0x4e')]===_0x0f71('0x4f')){var _0xeecaa1=_0xa3719b[_0x0f71('0x2a')]({'plain':!![]});var _0x486bf5=_0x0f71('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x486bf5,'userProfileId':_0x265dd2['userProfileId']},'raw':!![]})[_0x0f71('0x28')](function(_0x49878c){if(_0x49878c&&_0x49878c[_0x0f71('0x50')]===0x0){return db[_0x0f71('0x2c')][_0x0f71('0x4d')]({'name':_0xeecaa1[_0x0f71('0x2f')],'resourceId':_0xeecaa1['id'],'type':_0x49878c[_0x0f71('0x2f')],'sectionId':_0x49878c['id']},{})[_0x0f71('0x28')](function(){return _0xa3719b;});}else{return _0xa3719b;}})[_0x0f71('0x46')](function(_0x18a31d){logger[_0x0f71('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18a31d);throw _0x18a31d;});}return _0xa3719b;})[_0x0f71('0x28')](respondWithResult(_0x11c254,0xc9))['catch'](handleError(_0x11c254,null));};exports['update']=function(_0x1aa9da,_0x169104){if(_0x1aa9da[_0x0f71('0x51')]['id']){delete _0x1aa9da['body']['id'];}return db[_0x0f71('0x32')][_0x0f71('0x4c')]({'where':{'id':_0x1aa9da[_0x0f71('0x48')]['id']}})[_0x0f71('0x28')](handleEntityNotFound(_0x169104,null))['then'](saveUpdates(_0x1aa9da['body'],null))[_0x0f71('0x28')](respondWithResult(_0x169104,null))[_0x0f71('0x46')](handleError(_0x169104,null));};exports[_0x0f71('0x29')]=function(_0x42e8ff,_0x102adc){return db[_0x0f71('0x32')]['find']({'where':{'id':_0x42e8ff[_0x0f71('0x48')]['id']}})[_0x0f71('0x28')](handleEntityNotFound(_0x102adc,null))[_0x0f71('0x28')](removeEntity(_0x102adc,null))[_0x0f71('0x46')](handleError(_0x102adc,null));};exports[_0x0f71('0x52')]=function(_0x5b5c05,_0x4de767){return db[_0x0f71('0x32')]['describe']()[_0x0f71('0x28')](respondWithResult(_0x4de767,null))[_0x0f71('0x46')](handleError(_0x4de767,null));};exports[_0x0f71('0x53')]=function(_0x1f4f96,_0x153670,_0x5a6337){return db[_0x0f71('0x54')]['find']({'where':{'id':_0x1f4f96[_0x0f71('0x48')]['id']}})['then'](handleEntityNotFound(_0x153670,null))[_0x0f71('0x28')](function(_0x1013f4){if(_0x1013f4){return _0x1013f4['addContacts'](_0x1f4f96['body']['ids'],_['omit'](_0x1f4f96['body'],['ids','id'])||{});}})[_0x0f71('0x28')](respondWithResult(_0x153670,null))[_0x0f71('0x46')](handleError(_0x153670,null));};exports[_0x0f71('0x55')]=function(_0x5be120,_0x3101ca,_0x381f03){var _0x41914e={};var _0x4561dc={};var _0x5d7c98;var _0x3c148f;return db['CmCompany']['findOne']({'where':{'id':_0x5be120[_0x0f71('0x48')]['id']}})[_0x0f71('0x28')](handleEntityNotFound(_0x3101ca,null))[_0x0f71('0x28')](function(_0x4ee5bd){if(_0x4ee5bd){_0x5d7c98=_0x4ee5bd;_0x4561dc[_0x0f71('0x37')]=_[_0x0f71('0x33')](db[_0x0f71('0x54')][_0x0f71('0x49')]);_0x4561dc['query']=_['keys'](_0x5be120[_0x0f71('0x34')]);_0x4561dc[_0x0f71('0x35')]=_[_0x0f71('0x36')](_0x4561dc[_0x0f71('0x37')],_0x4561dc['query']);_0x41914e['attributes']=_[_0x0f71('0x36')](_0x4561dc['model'],qs[_0x0f71('0x39')](_0x5be120[_0x0f71('0x34')][_0x0f71('0x39')]));_0x41914e['attributes']=_0x41914e[_0x0f71('0x38')][_0x0f71('0x3a')]?_0x41914e[_0x0f71('0x38')]:_0x4561dc[_0x0f71('0x37')];_0x41914e[_0x0f71('0x3d')]=qs[_0x0f71('0x3e')](_0x5be120['query'][_0x0f71('0x3e')]);_0x41914e[_0x0f71('0x3f')]=qs[_0x0f71('0x35')](_[_0x0f71('0x56')](_0x5be120[_0x0f71('0x34')],_0x4561dc['filters']));if(_0x5be120['query'][_0x0f71('0x40')]){_0x41914e[_0x0f71('0x3f')]=_[_0x0f71('0x41')](_0x41914e[_0x0f71('0x3f')],{'$or':_[_0x0f71('0x42')](_0x41914e[_0x0f71('0x38')],function(_0x15351b){var _0x495310={};_0x495310[_0x15351b]={'$like':'%'+_0x5be120[_0x0f71('0x34')][_0x0f71('0x40')]+'%'};return _0x495310;})});}_0x41914e=_['merge']({},_0x41914e,_0x5be120[_0x0f71('0x4b')]);return _0x5d7c98[_0x0f71('0x55')](_0x41914e);}})[_0x0f71('0x28')](function(_0x27b988){if(_0x27b988){_0x3c148f=_0x27b988[_0x0f71('0x3a')];if(!_0x5be120['query']['hasOwnProperty'](_0x0f71('0x3c'))){_0x41914e['limit']=qs[_0x0f71('0x21')](_0x5be120[_0x0f71('0x34')][_0x0f71('0x21')]);_0x41914e['offset']=qs[_0x0f71('0x23')](_0x5be120[_0x0f71('0x34')][_0x0f71('0x23')]);}return _0x5d7c98[_0x0f71('0x55')](_0x41914e);}})[_0x0f71('0x28')](function(_0x4feb6c){if(_0x4feb6c){return _0x4feb6c?{'count':_0x3c148f,'rows':_0x4feb6c}:null;}})[_0x0f71('0x28')](respondWithResult(_0x3101ca,null))[_0x0f71('0x46')](handleError(_0x3101ca,null));};
\ No newline at end of file
+var _0xa3c0=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','getContacts','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','Companies','error','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','filter','options','CmCompany','include','findAll','rows','catch','params','rawAttributes','includeAll','find'];(function(_0x42341f,_0x65f8c3){var _0x32c896=function(_0x1841b7){while(--_0x1841b7){_0x42341f['push'](_0x42341f['shift']());}};_0x32c896(++_0x65f8c3);}(_0xa3c0,0x114));var _0x0a3c=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0xa3c0[_0x133277];return _0x5b4a22;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a3c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a3c('0x1'));var rp=require('request-promise');var moment=require(_0x0a3c('0x2'));var BPromise=require(_0x0a3c('0x3'));var Mustache=require(_0x0a3c('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0a3c('0x5'));var csv=require(_0x0a3c('0x6'));var ejs=require(_0x0a3c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a3c('0x8'));var squel=require(_0x0a3c('0x9'));var crypto=require('crypto');var jsforce=require(_0x0a3c('0xa'));var deskjs=require(_0x0a3c('0xb'));var toCsv=require(_0x0a3c('0x6'));var querystring=require(_0x0a3c('0xc'));var Papa=require(_0x0a3c('0xd'));var Redis=require(_0x0a3c('0xe'));var authService=require(_0x0a3c('0xf'));var qs=require(_0x0a3c('0x10'));var as=require(_0x0a3c('0x11'));var hardwareService=require(_0x0a3c('0x12'));var logger=require('../../config/logger')(_0x0a3c('0x13'));var utils=require('../../config/utils');var config=require(_0x0a3c('0x14'));var licenseUtil=require(_0x0a3c('0x15'));var db=require(_0x0a3c('0x16'))['db'];function respondWithStatusCode(_0x397f82,_0x447bc0){_0x447bc0=_0x447bc0||0xcc;return function(_0x49bb7e){if(_0x49bb7e){return _0x397f82[_0x0a3c('0x17')](_0x447bc0);}return _0x397f82[_0x0a3c('0x18')](_0x447bc0)[_0x0a3c('0x19')]();};}function respondWithResult(_0x23c828,_0xdde9c9){_0xdde9c9=_0xdde9c9||0xc8;return function(_0x4b626d){if(_0x4b626d){return _0x23c828[_0x0a3c('0x18')](_0xdde9c9)[_0x0a3c('0x1a')](_0x4b626d);}};}function respondWithFilteredResult(_0x9ac5cf,_0x1ec7f4){return function(_0x58db40){if(_0x58db40){var _0x1949b0=typeof _0x1ec7f4['offset']===_0x0a3c('0x1b')&&typeof _0x1ec7f4[_0x0a3c('0x1c')]===_0x0a3c('0x1b');var _0x5c24dd=_0x58db40[_0x0a3c('0x1d')];var _0x8d2cf4=_0x1949b0?0x0:_0x1ec7f4[_0x0a3c('0x1e')];var _0x48a3a6=_0x1949b0?_0x58db40[_0x0a3c('0x1d')]:_0x1ec7f4[_0x0a3c('0x1e')]+_0x1ec7f4['limit'];var _0x591c66;if(_0x48a3a6>=_0x5c24dd){_0x48a3a6=_0x5c24dd;_0x591c66=0xc8;}else{_0x591c66=0xce;}_0x9ac5cf[_0x0a3c('0x18')](_0x591c66);return _0x9ac5cf['set'](_0x0a3c('0x1f'),_0x8d2cf4+'-'+_0x48a3a6+'/'+_0x5c24dd)[_0x0a3c('0x1a')](_0x58db40);}return null;};}function patchUpdates(_0x54e569){return function(_0x1f24d4){try{jsonpatch[_0x0a3c('0x20')](_0x1f24d4,_0x54e569,!![]);}catch(_0x47f118){return BPromise['reject'](_0x47f118);}return _0x1f24d4[_0x0a3c('0x21')]();};}function saveUpdates(_0xdf3155,_0x569b5c){return function(_0x18226e){if(_0x18226e){return _0x18226e[_0x0a3c('0x22')](_0xdf3155)[_0x0a3c('0x23')](function(_0x225e39){return _0x225e39;});}return null;};}function removeEntity(_0x32640a,_0x2d52a7){return function(_0x3eb1a2){if(_0x3eb1a2){return _0x3eb1a2[_0x0a3c('0x24')]()[_0x0a3c('0x23')](function(){var _0x1e1e43=_0x3eb1a2[_0x0a3c('0x25')]({'plain':!![]});var _0x550587=_0x0a3c('0x26');return db['UserProfileResource'][_0x0a3c('0x24')]({'where':{'type':_0x550587,'resourceId':_0x1e1e43['id']}})[_0x0a3c('0x23')](function(){return _0x3eb1a2;});})['then'](function(){_0x32640a[_0x0a3c('0x18')](0xcc)[_0x0a3c('0x19')]();});}};}function handleEntityNotFound(_0x1e3b0a,_0x19f233){return function(_0x5ace33){if(!_0x5ace33){_0x1e3b0a['sendStatus'](0x194);}return _0x5ace33;};}function handleError(_0x221aaa,_0x2a2484){_0x2a2484=_0x2a2484||0x1f4;return function(_0x367126){logger[_0x0a3c('0x27')](_0x367126[_0x0a3c('0x28')]);if(_0x367126['name']){delete _0x367126[_0x0a3c('0x29')];}_0x221aaa[_0x0a3c('0x18')](_0x2a2484)[_0x0a3c('0x2a')](_0x367126);};}exports[_0x0a3c('0x2b')]=function(_0x37fb92,_0x8037a8){var _0x43a5e0={},_0x20f8e6={},_0x1ecd9={'count':0x0,'rows':[]};return db['CmCompany'][_0x0a3c('0x2c')]()[_0x0a3c('0x23')](function(_0x564661){_0x20f8e6[_0x0a3c('0x2d')]=_[_0x0a3c('0x2e')](_0x564661);_0x20f8e6[_0x0a3c('0x2f')]=_[_0x0a3c('0x2e')](_0x37fb92['query']);_0x20f8e6[_0x0a3c('0x30')]=_[_0x0a3c('0x31')](_0x20f8e6[_0x0a3c('0x2d')],_0x20f8e6[_0x0a3c('0x2f')]);_0x43a5e0[_0x0a3c('0x32')]=_[_0x0a3c('0x31')](_0x20f8e6[_0x0a3c('0x2d')],qs[_0x0a3c('0x33')](_0x37fb92[_0x0a3c('0x2f')][_0x0a3c('0x33')]));_0x43a5e0[_0x0a3c('0x32')]=_0x43a5e0[_0x0a3c('0x32')][_0x0a3c('0x34')]?_0x43a5e0['attributes']:_0x20f8e6[_0x0a3c('0x2d')];if(!_0x37fb92['query'][_0x0a3c('0x35')](_0x0a3c('0x36'))){_0x43a5e0['limit']=qs[_0x0a3c('0x1c')](_0x37fb92[_0x0a3c('0x2f')][_0x0a3c('0x1c')]);_0x43a5e0['offset']=qs[_0x0a3c('0x1e')](_0x37fb92['query'][_0x0a3c('0x1e')]);}_0x43a5e0[_0x0a3c('0x37')]=qs[_0x0a3c('0x38')](_0x37fb92[_0x0a3c('0x2f')]['sort']);_0x43a5e0['where']=qs[_0x0a3c('0x30')](_[_0x0a3c('0x39')](_0x37fb92[_0x0a3c('0x2f')],_0x20f8e6[_0x0a3c('0x30')]),_0x564661);if(_0x37fb92[_0x0a3c('0x2f')]['filter']){_0x43a5e0[_0x0a3c('0x3a')]=_[_0x0a3c('0x3b')](_0x43a5e0[_0x0a3c('0x3a')],{'$or':_[_0x0a3c('0x3c')](_0x43a5e0[_0x0a3c('0x32')],function(_0x206075){var _0x35c89d={};_0x35c89d[_0x206075]={'$like':'%'+_0x37fb92['query'][_0x0a3c('0x3d')]+'%'};return _0x35c89d;})});}_0x43a5e0=_[_0x0a3c('0x3b')]({},_0x43a5e0,_0x37fb92[_0x0a3c('0x3e')]);var _0x39b876={'where':_0x43a5e0[_0x0a3c('0x3a')]};return db[_0x0a3c('0x3f')][_0x0a3c('0x1d')](_0x39b876)[_0x0a3c('0x23')](function(_0x483ab1){_0x1ecd9[_0x0a3c('0x1d')]=_0x483ab1;if(_0x37fb92[_0x0a3c('0x2f')]['includeAll']){_0x43a5e0[_0x0a3c('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0x0a3c('0x41')](_0x43a5e0);})[_0x0a3c('0x23')](function(_0x3b6290){_0x1ecd9[_0x0a3c('0x42')]=_0x3b6290;return _0x1ecd9;})['then'](respondWithFilteredResult(_0x8037a8,_0x43a5e0))['catch'](handleError(_0x8037a8,null));})[_0x0a3c('0x43')](handleError(_0x8037a8,null));};exports['show']=function(_0x3a034f,_0x5f49c6){var _0x953e71={'raw':![],'where':{'id':_0x3a034f[_0x0a3c('0x44')]['id']}},_0x1b34af={};_0x1b34af[_0x0a3c('0x2d')]=_['keys'](db[_0x0a3c('0x3f')][_0x0a3c('0x45')]);_0x1b34af[_0x0a3c('0x2f')]=_[_0x0a3c('0x2e')](_0x3a034f['query']);_0x1b34af[_0x0a3c('0x30')]=_[_0x0a3c('0x31')](_0x1b34af[_0x0a3c('0x2d')],_0x1b34af['query']);_0x953e71[_0x0a3c('0x32')]=_['intersection'](_0x1b34af[_0x0a3c('0x2d')],qs[_0x0a3c('0x33')](_0x3a034f['query'][_0x0a3c('0x33')]));_0x953e71[_0x0a3c('0x32')]=_0x953e71['attributes']['length']?_0x953e71[_0x0a3c('0x32')]:_0x1b34af[_0x0a3c('0x2d')];if(_0x3a034f[_0x0a3c('0x2f')][_0x0a3c('0x46')]){_0x953e71[_0x0a3c('0x40')]=[{'all':!![]}];}_0x953e71=_[_0x0a3c('0x3b')]({},_0x953e71,_0x3a034f[_0x0a3c('0x3e')]);return db[_0x0a3c('0x3f')][_0x0a3c('0x47')](_0x953e71)['then'](handleEntityNotFound(_0x5f49c6,null))['then'](respondWithResult(_0x5f49c6,null))['catch'](handleError(_0x5f49c6,null));};exports[_0x0a3c('0x48')]=function(_0x2f31a3,_0x4b5e3b){return db[_0x0a3c('0x3f')][_0x0a3c('0x48')](_0x2f31a3[_0x0a3c('0x49')],{})[_0x0a3c('0x23')](function(_0x21934f){var _0x269d05=_0x2f31a3[_0x0a3c('0x4a')][_0x0a3c('0x25')]({'plain':!![]});if(!_0x269d05)throw new Error(_0x0a3c('0x4b'));if(_0x269d05['role']===_0x0a3c('0x4a')){var _0x5683f3=_0x21934f[_0x0a3c('0x25')]({'plain':!![]});var _0x490020=_0x0a3c('0x26');return db[_0x0a3c('0x4c')][_0x0a3c('0x47')]({'where':{'name':_0x490020,'userProfileId':_0x269d05[_0x0a3c('0x4d')]},'raw':!![]})[_0x0a3c('0x23')](function(_0x3a59ad){if(_0x3a59ad&&_0x3a59ad[_0x0a3c('0x4e')]===0x0){return db[_0x0a3c('0x4f')][_0x0a3c('0x48')]({'name':_0x5683f3[_0x0a3c('0x29')],'resourceId':_0x5683f3['id'],'type':_0x3a59ad[_0x0a3c('0x29')],'sectionId':_0x3a59ad['id']},{})[_0x0a3c('0x23')](function(){return _0x21934f;});}else{return _0x21934f;}})[_0x0a3c('0x43')](function(_0x387ef8){logger[_0x0a3c('0x27')](_0x0a3c('0x50'),_0x387ef8);throw _0x387ef8;});}return _0x21934f;})[_0x0a3c('0x23')](respondWithResult(_0x4b5e3b,0xc9))[_0x0a3c('0x43')](handleError(_0x4b5e3b,null));};exports[_0x0a3c('0x22')]=function(_0x264395,_0x480934){if(_0x264395[_0x0a3c('0x49')]['id']){delete _0x264395[_0x0a3c('0x49')]['id'];}return db[_0x0a3c('0x3f')][_0x0a3c('0x47')]({'where':{'id':_0x264395[_0x0a3c('0x44')]['id']}})[_0x0a3c('0x23')](handleEntityNotFound(_0x480934,null))['then'](saveUpdates(_0x264395[_0x0a3c('0x49')],null))[_0x0a3c('0x23')](respondWithResult(_0x480934,null))['catch'](handleError(_0x480934,null));};exports['destroy']=function(_0x2b0b74,_0x1576d5){return db[_0x0a3c('0x3f')]['find']({'where':{'id':_0x2b0b74['params']['id']}})['then'](handleEntityNotFound(_0x1576d5,null))[_0x0a3c('0x23')](removeEntity(_0x1576d5,null))[_0x0a3c('0x43')](handleError(_0x1576d5,null));};exports['describe']=function(_0x44e027,_0x802cfa){return db[_0x0a3c('0x3f')]['describe']()[_0x0a3c('0x23')](respondWithResult(_0x802cfa,null))[_0x0a3c('0x43')](handleError(_0x802cfa,null));};exports[_0x0a3c('0x51')]=function(_0x5815ac,_0x16bad5,_0x130c61){return db[_0x0a3c('0x52')]['find']({'where':{'id':_0x5815ac['params']['id']}})['then'](handleEntityNotFound(_0x16bad5,null))['then'](function(_0x32fea3){if(_0x32fea3){return _0x32fea3[_0x0a3c('0x51')](_0x5815ac[_0x0a3c('0x49')]['ids'],_[_0x0a3c('0x53')](_0x5815ac[_0x0a3c('0x49')],[_0x0a3c('0x54'),'id'])||{});}})[_0x0a3c('0x23')](respondWithResult(_0x16bad5,null))['catch'](handleError(_0x16bad5,null));};exports[_0x0a3c('0x55')]=function(_0x48908e,_0x44dad0,_0x3e384f){var _0x590521={};var _0x4a5717={};var _0x2cf490;var _0x1b43aa;return db[_0x0a3c('0x3f')][_0x0a3c('0x56')]({'where':{'id':_0x48908e[_0x0a3c('0x44')]['id']}})[_0x0a3c('0x23')](handleEntityNotFound(_0x44dad0,null))[_0x0a3c('0x23')](function(_0x102874){if(_0x102874){_0x2cf490=_0x102874;_0x4a5717[_0x0a3c('0x2d')]=_['keys'](db[_0x0a3c('0x52')][_0x0a3c('0x45')]);_0x4a5717['query']=_[_0x0a3c('0x2e')](_0x48908e[_0x0a3c('0x2f')]);_0x4a5717[_0x0a3c('0x30')]=_[_0x0a3c('0x31')](_0x4a5717['model'],_0x4a5717[_0x0a3c('0x2f')]);_0x590521[_0x0a3c('0x32')]=_['intersection'](_0x4a5717[_0x0a3c('0x2d')],qs[_0x0a3c('0x33')](_0x48908e[_0x0a3c('0x2f')][_0x0a3c('0x33')]));_0x590521[_0x0a3c('0x32')]=_0x590521[_0x0a3c('0x32')]['length']?_0x590521['attributes']:_0x4a5717[_0x0a3c('0x2d')];_0x590521[_0x0a3c('0x37')]=qs[_0x0a3c('0x38')](_0x48908e[_0x0a3c('0x2f')][_0x0a3c('0x38')]);_0x590521[_0x0a3c('0x3a')]=qs[_0x0a3c('0x30')](_[_0x0a3c('0x39')](_0x48908e[_0x0a3c('0x2f')],_0x4a5717['filters']));if(_0x48908e[_0x0a3c('0x2f')][_0x0a3c('0x3d')]){_0x590521['where']=_[_0x0a3c('0x3b')](_0x590521[_0x0a3c('0x3a')],{'$or':_['map'](_0x590521[_0x0a3c('0x32')],function(_0x2345e2){var _0x2f1b68={};_0x2f1b68[_0x2345e2]={'$like':'%'+_0x48908e[_0x0a3c('0x2f')][_0x0a3c('0x3d')]+'%'};return _0x2f1b68;})});}_0x590521=_[_0x0a3c('0x3b')]({},_0x590521,_0x48908e[_0x0a3c('0x3e')]);return _0x2cf490[_0x0a3c('0x55')](_0x590521);}})[_0x0a3c('0x23')](function(_0x4c39db){if(_0x4c39db){_0x1b43aa=_0x4c39db[_0x0a3c('0x34')];if(!_0x48908e[_0x0a3c('0x2f')]['hasOwnProperty']('nolimit')){_0x590521[_0x0a3c('0x1c')]=qs['limit'](_0x48908e[_0x0a3c('0x2f')][_0x0a3c('0x1c')]);_0x590521[_0x0a3c('0x1e')]=qs[_0x0a3c('0x1e')](_0x48908e[_0x0a3c('0x2f')]['offset']);}return _0x2cf490[_0x0a3c('0x55')](_0x590521);}})['then'](function(_0x11a863){if(_0x11a863){return _0x11a863?{'count':_0x1b43aa,'rows':_0x11a863}:null;}})[_0x0a3c('0x23')](respondWithResult(_0x44dad0,null))[_0x0a3c('0x43')](handleError(_0x44dad0,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 2dac399..4221e26 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 _0x7403=['bluebird','request-promise','./cmCompany.attributes','exports','define','cm_companies','util','moment'];(function(_0xed0448,_0x1cf0d2){var _0x5263d3=function(_0xb7df2){while(--_0xb7df2){_0xed0448['push'](_0xed0448['shift']());}};_0x5263d3(++_0x1cf0d2);}(_0x7403,0x1b6));var _0x3740=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7403[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3740('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3740('0x1'));var BPromise=require(_0x3740('0x2'));var rp=require(_0x3740('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3740('0x4'));module[_0x3740('0x5')]=function(_0x3e1e27,_0x1ba72a){return _0x3e1e27[_0x3740('0x6')]('CmCompany',attributes,{'tableName':_0x3740('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ed4=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','moment','request-promise'];(function(_0x57b77c,_0x33093a){var _0x244ef5=function(_0x54a398){while(--_0x54a398){_0x57b77c['push'](_0x57b77c['shift']());}};_0x244ef5(++_0x33093a);}(_0x1ed4,0x13c));var _0x41ed=function(_0x44e121,_0x1f561c){_0x44e121=_0x44e121-0x0;var _0x1507a2=_0x1ed4[_0x44e121];return _0x1507a2;};'use strict';var _=require('lodash');var util=require(_0x41ed('0x0'));var logger=require(_0x41ed('0x1'))('api');var moment=require(_0x41ed('0x2'));var BPromise=require('bluebird');var rp=require(_0x41ed('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x41ed('0x4'));var attributes=require(_0x41ed('0x5'));module[_0x41ed('0x6')]=function(_0x1924e4,_0x2a631b){return _0x1924e4[_0x41ed('0x7')](_0x41ed('0x8'),attributes,{'tableName':_0x41ed('0x9'),'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 bd21da8..4982c31 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 _0x5498=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x3e454d,_0x17357f){var _0x3ae007=function(_0x40b2c6){while(--_0x40b2c6){_0x3e454d['push'](_0x3e454d['shift']());}};_0x3ae007(++_0x17357f);}(_0x5498,0xe7));var _0x8549=function(_0x2a8917,_0x55368e){_0x2a8917=_0x2a8917-0x0;var _0x19c1f1=_0x5498[_0x2a8917];return _0x19c1f1;};'use strict';var _=require('lodash');var util=require(_0x8549('0x0'));var moment=require(_0x8549('0x1'));var BPromise=require('bluebird');var rs=require(_0x8549('0x2'));var fs=require('fs');var Redis=require(_0x8549('0x3'));var db=require(_0x8549('0x4'))['db'];var utils=require(_0x8549('0x5'));var logger=require(_0x8549('0x6'))('rpc');var config=require(_0x8549('0x7'));var jayson=require(_0x8549('0x8'));var client=jayson['client'][_0x8549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe57e97,_0x25d7e5,_0x2fed05){return new BPromise(function(_0xc3e6d3,_0x315d86){return client['request'](_0xe57e97,_0x2fed05)[_0x8549('0xa')](function(_0x129f20){logger[_0x8549('0xb')](_0x8549('0xc'),_0x25d7e5,_0x8549('0xd'));logger[_0x8549('0xe')](_0x8549('0xf'),_0x25d7e5,'request\x20sent',JSON[_0x8549('0x10')](_0x129f20));if(_0x129f20['error']){if(_0x129f20[_0x8549('0x11')][_0x8549('0x12')]===0x1f4){logger[_0x8549('0x11')](_0x8549('0xc'),_0x25d7e5,_0x129f20[_0x8549('0x11')]['message']);return _0x315d86(_0x129f20[_0x8549('0x11')][_0x8549('0x13')]);}logger[_0x8549('0x11')](_0x8549('0xc'),_0x25d7e5,_0x129f20[_0x8549('0x11')][_0x8549('0x13')]);return _0xc3e6d3(_0x129f20[_0x8549('0x11')][_0x8549('0x13')]);}else{logger[_0x8549('0xb')](_0x8549('0xc'),_0x25d7e5,_0x8549('0xd'));_0xc3e6d3(_0x129f20[_0x8549('0x14')][_0x8549('0x13')]);}})[_0x8549('0x15')](function(_0x34a1b8){logger[_0x8549('0x11')](_0x8549('0xc'),_0x25d7e5,_0x34a1b8);_0x315d86(_0x34a1b8);});});}
\ No newline at end of file
+var _0x0f48=['result','moment','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x0f48,0xeb));var _0x80f4=function(_0x5934e4,_0x477406){_0x5934e4=_0x5934e4-0x0;var _0x3fbb91=_0x0f48[_0x5934e4];return _0x3fbb91;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x80f4('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80f4('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x80f4('0x2'));var logger=require('../../config/logger')(_0x80f4('0x3'));var config=require('../../config/environment');var jayson=require(_0x80f4('0x4'));var client=jayson['client'][_0x80f4('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x41f905,_0x4f54fd,_0x2a97d3){return new BPromise(function(_0x34a9d2,_0x2e359a){return client[_0x80f4('0x6')](_0x41f905,_0x2a97d3)[_0x80f4('0x7')](function(_0x4f903c){logger[_0x80f4('0x8')](_0x80f4('0x9'),_0x4f54fd,_0x80f4('0xa'));logger[_0x80f4('0xb')](_0x80f4('0xc'),_0x4f54fd,'request\x20sent',JSON[_0x80f4('0xd')](_0x4f903c));if(_0x4f903c[_0x80f4('0xe')]){if(_0x4f903c[_0x80f4('0xe')][_0x80f4('0xf')]===0x1f4){logger[_0x80f4('0xe')]('CmCompany,\x20%s,\x20%s',_0x4f54fd,_0x4f903c[_0x80f4('0xe')][_0x80f4('0x10')]);return _0x2e359a(_0x4f903c['error'][_0x80f4('0x10')]);}logger[_0x80f4('0xe')](_0x80f4('0x9'),_0x4f54fd,_0x4f903c['error'][_0x80f4('0x10')]);return _0x34a9d2(_0x4f903c[_0x80f4('0xe')][_0x80f4('0x10')]);}else{logger[_0x80f4('0x8')](_0x80f4('0x9'),_0x4f54fd,_0x80f4('0xa'));_0x34a9d2(_0x4f903c[_0x80f4('0x11')]['message']);}})['catch'](function(_0x106c2c){logger[_0x80f4('0xe')]('CmCompany,\x20%s,\x20%s',_0x4f54fd,_0x106c2c);_0x2e359a(_0x106c2c);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 5dca981..9b59550 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 _0x231d=['./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','post','/:id/contacts','addContacts','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11eed5,_0x1d2a1c){var _0x3d4bfb=function(_0x1fbb09){while(--_0x1fbb09){_0x11eed5['push'](_0x11eed5['shift']());}};_0x3d4bfb(++_0x1d2a1c);}(_0x231d,0x78));var _0xd231=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x231d[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xd231('0x0'));var util=require(_0xd231('0x1'));var path=require(_0xd231('0x2'));var timeout=require(_0xd231('0x3'));var express=require(_0xd231('0x4'));var router=express[_0xd231('0x5')]();var fs_extra=require(_0xd231('0x6'));var auth=require(_0xd231('0x7'));var interaction=require(_0xd231('0x8'));var config=require(_0xd231('0x9'));var controller=require(_0xd231('0xa'));router['get']('/',auth[_0xd231('0xb')](),controller[_0xd231('0xc')]);router[_0xd231('0xd')](_0xd231('0xe'),auth[_0xd231('0xb')](),controller[_0xd231('0xf')]);router[_0xd231('0xd')](_0xd231('0x10'),auth[_0xd231('0xb')](),controller[_0xd231('0x11')]);router[_0xd231('0xd')]('/:id/contacts',auth[_0xd231('0xb')](),controller['getContacts']);router['post']('/',auth['isAuthenticated'](),controller[_0xd231('0x12')]);router[_0xd231('0x13')](_0xd231('0x14'),auth[_0xd231('0xb')](),controller[_0xd231('0x15')]);router[_0xd231('0x16')](_0xd231('0x10'),auth[_0xd231('0xb')](),controller[_0xd231('0x17')]);router['delete']('/:id',auth[_0xd231('0xb')](),controller[_0xd231('0x18')]);module[_0xd231('0x19')]=router;
\ No newline at end of file
+var _0x2728=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3f8759,_0x3fe6fb){var _0x2d33ca=function(_0x39b5c9){while(--_0x39b5c9){_0x3f8759['push'](_0x3f8759['shift']());}};_0x2d33ca(++_0x3fe6fb);}(_0x2728,0x1d8));var _0x8272=function(_0x11d49b,_0xba47b7){_0x11d49b=_0x11d49b-0x0;var _0x1d2089=_0x2728[_0x11d49b];return _0x1d2089;};'use strict';var multer=require(_0x8272('0x0'));var util=require(_0x8272('0x1'));var path=require(_0x8272('0x2'));var timeout=require(_0x8272('0x3'));var express=require(_0x8272('0x4'));var router=express[_0x8272('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8272('0x6'));var interaction=require(_0x8272('0x7'));var config=require('../../config/environment');var controller=require(_0x8272('0x8'));router[_0x8272('0x9')]('/',auth[_0x8272('0xa')](),controller[_0x8272('0xb')]);router['get']('/describe',auth[_0x8272('0xa')](),controller[_0x8272('0xc')]);router['get'](_0x8272('0xd'),auth[_0x8272('0xa')](),controller[_0x8272('0xe')]);router[_0x8272('0x9')](_0x8272('0xf'),auth['isAuthenticated'](),controller[_0x8272('0x10')]);router[_0x8272('0x11')]('/',auth[_0x8272('0xa')](),controller[_0x8272('0x12')]);router[_0x8272('0x11')]('/:id/contacts',auth[_0x8272('0xa')](),controller[_0x8272('0x13')]);router[_0x8272('0x14')](_0x8272('0xd'),auth[_0x8272('0xa')](),controller[_0x8272('0x15')]);router[_0x8272('0x16')](_0x8272('0xd'),auth['isAuthenticated'](),controller[_0x8272('0x17')]);module[_0x8272('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 3343d14..01c9d21 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 _0x5f2f=['INTEGER','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x597a5,_0x563e48){var _0x1a47bb=function(_0x21f0e4){while(--_0x21f0e4){_0x597a5['push'](_0x597a5['shift']());}};_0x1a47bb(++_0x563e48);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4c0776,_0x4ae99b){_0x4c0776=_0x4c0776-0x0;var _0x38a814=_0x5f2f[_0x4c0776];return _0x38a814;};'use strict';var _=require(_0xf5f2('0x0'));var Sequelize=require(_0xf5f2('0x1'));module[_0xf5f2('0x2')]={'firstName':{'type':Sequelize[_0xf5f2('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf5f2('0x3')]},'street':{'type':Sequelize[_0xf5f2('0x3')]},'postalCode':{'type':Sequelize[_0xf5f2('0x3')]},'city':{'type':Sequelize[_0xf5f2('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf5f2('0x4')]},'phone':{'type':Sequelize[_0xf5f2('0x3')]},'mobile':{'type':Sequelize[_0xf5f2('0x3')]},'fax':{'type':Sequelize[_0xf5f2('0x3')]},'email':{'type':Sequelize[_0xf5f2('0x3')]},'url':{'type':Sequelize[_0xf5f2('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xf5f2('0x3')]},'twitter':{'type':Sequelize[_0xf5f2('0x3')]},'skype':{'type':Sequelize[_0xf5f2('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xf5f2('0x3')]},'line':{'type':Sequelize[_0xf5f2('0x3')]},'wechat':{'type':Sequelize[_0xf5f2('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xf5f2('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':Sequelize[_0xf5f2('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xf5f2('0x5')]}};
\ No newline at end of file
+var _0x5f66=['sequelize','STRING','INTEGER','DATE'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var Sequelize=require(_0x65f6('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x65f6('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x65f6('0x1')]},'street':{'type':Sequelize[_0x65f6('0x1')]},'postalCode':{'type':Sequelize[_0x65f6('0x1')]},'city':{'type':Sequelize[_0x65f6('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x65f6('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x65f6('0x1')]},'mobile':{'type':Sequelize[_0x65f6('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x65f6('0x1')]},'facebook':{'type':Sequelize[_0x65f6('0x1')]},'fb_data':{'type':Sequelize[_0x65f6('0x1')]},'twitter':{'type':Sequelize[_0x65f6('0x1')]},'skype':{'type':Sequelize[_0x65f6('0x1')]},'teams':{'type':Sequelize[_0x65f6('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x65f6('0x1')]},'telegram':{'type':Sequelize[_0x65f6('0x1')]},'UserId':{'type':Sequelize[_0x65f6('0x2')]},'priority':{'type':Sequelize[_0x65f6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x65f6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 580a9f1..59b0082 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 _0x39cb=['File\x20uploaded\x20correctly!','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','Website','Account','closed','closedAt','disposition','secondDisposition','Owner','browserName','deviceModel','osName','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','slice','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','limit','count','set','then','end','sendStatus','error','stack','name','send','CmContact','describe','keys','length','startsWith','CmCustomField','trimStart','cf_','all','fieldType','type','intersection','model','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','expr','search','parseSearch','sqlOperator','conditions','Tag','value','split','map','forEach','union','User','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','start','filter','isNil','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','DESC','having','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','c.firstName','c.phone','c.mobile','c.fax','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','find','tags','displayName','analytics','findAll','columnName','alias','custom','values','merge','body','get','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','destroy','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','update','ChatMessage','MailInteraction','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','join','dialTimezone','timezones','utcOffset','bulkCreate','duplicates','$or','findOrCreate','spread','params','cf_%d','$and','omit','pickBy','format','table','setFields','text','phone','getTags','findOne','rawAttributes','options','nolimit','setTags','ids','ContactId','includeAll','include','rows','getHopperHistories','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0x39cb,0x151));var _0xb39c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39cb[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0xb39c('0x0'));var BPromise=require(_0xb39c('0x1'));var util=require(_0xb39c('0x2'));var path=require(_0xb39c('0x3'));var fs=require('fs');var _=require(_0xb39c('0x4'));var squel=require('squel');var Papa=require(_0xb39c('0x5'));var Redis=require(_0xb39c('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0xb39c('0x7'));var logger=require(_0xb39c('0x8'))(_0xb39c('0x9'));var config=require(_0xb39c('0xa'));var shared=require(_0xb39c('0xb'));var db=require(_0xb39c('0xc'))['db'];config[_0xb39c('0xd')]=_['defaults'](config[_0xb39c('0xd')],{'host':_0xb39c('0xe'),'port':0x18eb});var socket=require(_0xb39c('0xf'))(new Redis(config[_0xb39c('0xd')]));require(_0xb39c('0x10'))['register'](socket);function respondWithResult(_0x469e7b,_0x27f2e0){_0x27f2e0=_0x27f2e0||0xc8;return function(_0x4421e7){if(_0x4421e7){return _0x469e7b[_0xb39c('0x11')](_0x27f2e0)[_0xb39c('0x12')](_0x4421e7);}};}function respondWithFilteredResult(_0x578dd9,_0xd30128){return function(_0x54f4b8){if(_0x54f4b8){var _0x13b0f8=typeof _0xd30128[_0xb39c('0x13')]===_0xb39c('0x14')&&typeof _0xd30128[_0xb39c('0x15')]===_0xb39c('0x14');var _0x4de628=_0x54f4b8[_0xb39c('0x16')];var _0x18843e=_0x13b0f8?0x0:_0xd30128[_0xb39c('0x13')];var _0x58f7ae=_0x13b0f8?_0x54f4b8[_0xb39c('0x16')]:_0xd30128['offset']+_0xd30128['limit'];var _0x2cb74f;if(_0x58f7ae>=_0x4de628){_0x58f7ae=_0x4de628;_0x2cb74f=0xc8;}else{_0x2cb74f=0xce;}_0x578dd9[_0xb39c('0x11')](_0x2cb74f);return _0x578dd9[_0xb39c('0x17')]('Content-Range',_0x18843e+'-'+_0x58f7ae+'/'+_0x4de628)[_0xb39c('0x12')](_0x54f4b8);}return null;};}function saveUpdates(_0x46cba1){return function(_0x3195f8){if(_0x3195f8){return _0x3195f8['update'](_0x46cba1)[_0xb39c('0x18')](function(_0x3812fa){return _0x3812fa;});}return null;};}function removeEntity(_0x4b38d3){return function(_0x5a8ee8){if(_0x5a8ee8){return _0x5a8ee8['destroy']()[_0xb39c('0x18')](function(){_0x4b38d3['status'](0xcc)[_0xb39c('0x19')]();});}};}function handleEntityNotFound(_0x53d138){return function(_0x464356){if(!_0x464356){_0x53d138[_0xb39c('0x1a')](0x194);}return _0x464356;};}function handleError(_0x3971d6,_0xed36fe){_0xed36fe=_0xed36fe||0x1f4;return function(_0x230fb3){logger[_0xb39c('0x1b')](_0x230fb3[_0xb39c('0x1c')]);if(_0x230fb3['name']){delete _0x230fb3[_0xb39c('0x1d')];}_0x3971d6[_0xb39c('0x11')](_0xed36fe)[_0xb39c('0x1e')](_0x230fb3);};}exports['index']=function(_0x89aa99,_0xb8ba59){var _0x1af7ae={},_0x2e072b={},_0x5d8be3={'count':0x0,'rows':[]};return db[_0xb39c('0x1f')][_0xb39c('0x20')]()[_0xb39c('0x18')](function(_0x2fd06e){var _0x4aa82b=[];for(var _0x19eb41=0x0;_0x19eb41
','Attachments','Title','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','Anonymous','pop','isEmpty','test','html','replace','includes','0x1?_0x298062[_0x8a26('0x11')](0x0,-0x1)['join']('\x20'):_0x548fd5[_0x8a26('0xc')];}return _0x8a26('0x12');}function getLastName(_0x5947fe){var _0x1beefc=_[_0x8a26('0x6')](_0x5947fe[_0x8a26('0x7')]);if(_0x1beefc&&_0x1beefc[_0x8a26('0xc')]){var _0x48210a=_0x1beefc['name'][_0x8a26('0xf')](/\s+/);return _0x48210a[_0x8a26('0x10')]>0x1?_0x48210a[_0x8a26('0x13')]():'';}return'';}function getMails(_0x25c588,_0x1b6ccf){var _0x385573='';for(var _0x3c6d11=0x0;_0x3c6d11<_0x1b6ccf[_0x8a26('0x7')][_0x8a26('0x10')];_0x3c6d11+=0x1){if(_0x1b6ccf[_0x8a26('0x7')][_0x3c6d11][_0x8a26('0x8')]!==_0x25c588){if(!_[_0x8a26('0x14')](_0x385573)){_0x385573+=',';}_0x385573+=_0x1b6ccf[_0x8a26('0x7')][_0x3c6d11]['name']||_0x1b6ccf[_0x8a26('0x7')][_0x3c6d11][_0x8a26('0x8')]||'';_0x385573+='\x20<';_0x385573+=_0x1b6ccf[_0x8a26('0x7')][_0x3c6d11][_0x8a26('0x8')]?_0x1b6ccf['value'][_0x3c6d11][_0x8a26('0x8')]:_0x8a26('0x9')+random[_0x8a26('0xa')](0x6)+_0x8a26('0xb');_0x385573+='>';}}return _0x385573;}function parseEmail(_0x2b9277,_0x3ebc65,_0xbc84e9){if(_0x3ebc65['html']){var _0x579325=/